From 6a77f38946aaee1cd85eeec6cf4229b204c15071 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Mon, 8 Aug 2005 20:49:14 +0000 Subject: [PATCH] vserver 1.9.5.x5 --- CREDITS | 69 +- Documentation/00-INDEX | 58 +- Documentation/Changes | 10 +- Documentation/DMA-API.txt | 2 +- Documentation/DocBook/Makefile | 15 +- Documentation/DocBook/deviceiobook.tmpl | 103 +- Documentation/DocBook/kernel-api.tmpl | 15 +- Documentation/DocBook/kernel-hacking.tmpl | 2 +- Documentation/DocBook/libata.tmpl | 192 +- Documentation/DocBook/procfs-guide.tmpl | 4 +- Documentation/DocBook/videobook.tmpl | 14 +- Documentation/IO-mapping.txt | 7 +- Documentation/RCU/listRCU.txt | 2 +- Documentation/SAK.txt | 4 +- Documentation/arm/Booting | 4 + Documentation/arm/IXP2000 | 10 +- Documentation/arm/IXP4xx | 27 +- Documentation/arm/README | 4 +- .../arm/Samsung-S3C24XX/EB2410ITX.txt | 24 +- .../arm/Samsung-S3C24XX/Overview.txt | 30 +- Documentation/arm/Sharp-LH/IOBarrier | 33 +- Documentation/block/as-iosched.txt | 2 +- Documentation/block/biodoc.txt | 3 +- Documentation/block/deadline-iosched.txt | 2 +- Documentation/cciss.txt | 30 +- Documentation/cdrom/00-INDEX | 2 + Documentation/cdrom/packet-writing.txt | 3 + Documentation/computone.txt | 15 +- Documentation/cpqarray.txt | 54 +- Documentation/cpu-freq/index.txt | 8 +- Documentation/cpu-freq/user-guide.txt | 1 + Documentation/crypto/api-intro.txt | 3 + Documentation/devices.txt | 75 +- Documentation/digiepca.txt | 26 +- Documentation/dnotify.txt | 6 + Documentation/dvb/README.dibusb | 60 +- Documentation/dvb/avermedia.txt | 26 +- Documentation/dvb/cards.txt | 18 +- Documentation/dvb/contributors.txt | 2 + Documentation/dvb/get_dvb_firmware | 20 +- Documentation/dvb/readme.txt | 13 +- Documentation/dvb/ttusb-dec.txt | 40 +- Documentation/early-userspace/README | 67 +- Documentation/fb/matroxfb.txt | 7 + Documentation/fb/vesafb.txt | 7 +- Documentation/filesystems/00-INDEX | 2 - Documentation/filesystems/Locking | 19 +- Documentation/filesystems/devfs/ChangeLog | 2 +- Documentation/filesystems/devfs/README | 47 - Documentation/filesystems/ext2.txt | 60 +- Documentation/filesystems/ntfs.txt | 180 +- Documentation/filesystems/proc.txt | 93 +- Documentation/filesystems/ufs.txt | 15 +- Documentation/filesystems/vfs.txt | 197 +- Documentation/floppy.txt | 48 +- Documentation/ftape.txt | 96 +- Documentation/hw_random.txt | 69 - Documentation/i2c/dev-interface | 4 +- Documentation/i2c/i2c-stub | 9 +- Documentation/i2c/sysfs-interface | 32 +- Documentation/i2c/writing-clients | 74 +- Documentation/i386/boot.txt | 3 + Documentation/i386/zero-page.txt | 7 +- Documentation/ide.txt | 13 +- Documentation/ioctl-number.txt | 4 +- Documentation/kbuild/makefiles.txt | 38 +- Documentation/kbuild/modules.txt | 487 +- Documentation/kernel-parameters.txt | 160 +- Documentation/md.txt | 23 +- Documentation/memory.txt | 6 +- Documentation/networking/e100.txt | 132 +- Documentation/networking/e1000.txt | 231 +- Documentation/networking/ip-sysctl.txt | 6 + Documentation/networking/ixgb.txt | 37 +- Documentation/networking/pktgen.txt | 291 +- Documentation/nmi_watchdog.txt | 14 + Documentation/parisc/registers | 23 +- Documentation/pci.txt | 21 +- Documentation/pm.txt | 56 +- Documentation/power/devices.txt | 176 + Documentation/power/pci.txt | 51 +- Documentation/power/swsusp.txt | 132 +- Documentation/power/video.txt | 11 +- Documentation/powerpc/00-INDEX | 3 + Documentation/ramdisk.txt | 141 +- Documentation/riscom8.txt | 42 +- Documentation/rocket.txt | 108 +- Documentation/s390/s390dbf.txt | 55 +- Documentation/scsi/ChangeLog.megaraid | 126 + Documentation/scsi/scsi_mid_low_api.txt | 60 +- Documentation/scsi/sym53c8xx_2.txt | 358 +- Documentation/serial/driver | 11 +- Documentation/sonypi.txt | 62 +- .../sound/alsa/ALSA-Configuration.txt | 127 +- .../alsa/DocBook/writing-an-alsa-driver.tmpl | 256 +- Documentation/sound/alsa/Joystick.txt | 10 +- Documentation/sound/alsa/MIXART.txt | 4 + Documentation/sound/alsa/OSS-Emulation.txt | 11 +- Documentation/sound/oss/README.modules | 5 +- Documentation/stable_api_nonsense.txt | 4 +- Documentation/stallion.txt | 68 +- Documentation/sysctl/vm.txt | 2 +- Documentation/time_interpolators.txt | 23 +- Documentation/tipar.txt | 26 +- Documentation/tty.txt | 7 +- Documentation/unicode.txt | 112 +- Documentation/usb/error-codes.txt | 56 +- Documentation/usb/sn9c102.txt | 402 +- Documentation/usb/usb-serial.txt | 56 + Documentation/usb/w9968cf.txt | 51 +- Documentation/video4linux/meye.txt | 38 +- Documentation/vm/hugetlbpage.txt | 264 +- Documentation/vm/numa | 2 +- Documentation/vm/overcommit-accounting | 3 + Documentation/vserver/debug.txt | 2 +- Documentation/x86_64/boot-options.txt | 56 +- Documentation/x86_64/mm.txt | 160 +- MAINTAINERS | 242 +- Makefile | 93 +- arch/alpha/Kconfig | 6 +- arch/alpha/Makefile | 2 +- arch/alpha/boot/bootloader.lds | 1 + arch/alpha/boot/bootp.c | 19 +- arch/alpha/boot/bootpz.c | 25 +- arch/alpha/boot/head.S | 21 + arch/alpha/boot/misc.c | 12 - arch/alpha/defconfig | 1 - arch/alpha/kernel/alpha_ksyms.c | 2 +- arch/alpha/kernel/console.c | 2 +- arch/alpha/kernel/core_marvel.c | 2 +- arch/alpha/kernel/irq.c | 2 +- arch/alpha/kernel/irq_i8259.c | 2 +- arch/alpha/kernel/irq_srm.c | 2 +- arch/alpha/kernel/pci.c | 20 +- arch/alpha/kernel/pci_impl.h | 1 - arch/alpha/kernel/proto.h | 3 - arch/alpha/kernel/ptrace.c | 2 +- arch/alpha/kernel/setup.c | 16 +- arch/alpha/kernel/signal.c | 2 +- arch/alpha/kernel/smc37c669.c | 2 +- arch/alpha/kernel/smp.c | 2 +- arch/alpha/kernel/srmcons.c | 37 +- arch/alpha/kernel/sys_alcor.c | 2 +- arch/alpha/kernel/sys_cabriolet.c | 2 +- arch/alpha/kernel/sys_dp264.c | 4 +- arch/alpha/kernel/sys_eb64p.c | 2 +- arch/alpha/kernel/sys_eiger.c | 2 +- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_mikasa.c | 2 +- arch/alpha/kernel/sys_nautilus.c | 2 +- arch/alpha/kernel/sys_noritake.c | 2 +- arch/alpha/kernel/sys_rawhide.c | 2 +- arch/alpha/kernel/sys_rx164.c | 2 +- arch/alpha/kernel/sys_sable.c | 2 +- arch/alpha/kernel/sys_sx164.c | 2 +- arch/alpha/kernel/sys_titan.c | 4 +- arch/alpha/kernel/sys_wildfire.c | 4 +- arch/alpha/kernel/systbls.S | 4 +- arch/alpha/kernel/time.c | 5 +- arch/alpha/lib/csum_partial_copy.c | 6 +- arch/alpha/lib/dec_and_lock.c | 8 +- arch/alpha/lib/memmove.S | 12 - arch/alpha/mm/init.c | 7 +- arch/alpha/mm/numa.c | 10 +- arch/alpha/oprofile/common.c | 19 +- arch/alpha/oprofile/op_model_ev4.c | 3 +- arch/alpha/oprofile/op_model_ev5.c | 3 +- arch/alpha/oprofile/op_model_ev6.c | 3 +- arch/alpha/oprofile/op_model_ev67.c | 8 +- arch/arm/Kconfig | 170 +- arch/arm/Kconfig.debug | 5 +- arch/arm/Makefile | 49 +- arch/arm/boot/Makefile | 86 +- arch/arm/boot/compressed/Makefile | 7 +- arch/arm/boot/compressed/head-sa1100.S | 36 +- arch/arm/boot/compressed/head-xscale.S | 19 +- arch/arm/boot/compressed/head.S | 8 + arch/arm/boot/compressed/ofw-shark.c | 2 + arch/arm/common/Makefile | 3 + arch/arm/common/amba.c | 4 +- arch/arm/common/locomo.c | 25 +- arch/arm/common/rtctime.c | 2 +- arch/arm/common/sa1111.c | 71 +- arch/arm/common/time-acorn.c | 33 +- arch/arm/common/via82c505.c | 2 +- arch/arm/configs/bast_defconfig | 179 +- arch/arm/configs/ebsa110_defconfig | 1 - arch/arm/configs/ep80219_defconfig | 97 +- arch/arm/configs/integrator_defconfig | 768 +- arch/arm/configs/iq31244_defconfig | 95 +- arch/arm/configs/iq80321_defconfig | 159 +- arch/arm/configs/iq80331_defconfig | 175 +- arch/arm/configs/ixp4xx_defconfig | 1 - arch/arm/configs/pleb_defconfig | 676 +- arch/arm/configs/s3c2410_defconfig | 172 +- arch/arm/configs/versatile_defconfig | 12 +- arch/arm/kernel/Makefile | 3 +- arch/arm/kernel/apm.c | 2 +- arch/arm/kernel/armksyms.c | 7 +- arch/arm/kernel/asm-offsets.c | 3 + arch/arm/kernel/bios32.c | 12 +- arch/arm/kernel/calls.S | 11 +- arch/arm/kernel/debug.S | 663 +- arch/arm/kernel/dma.c | 2 +- arch/arm/kernel/ecard.c | 41 +- arch/arm/kernel/entry-armv.S | 2078 +-- arch/arm/kernel/entry-common.S | 29 +- arch/arm/kernel/entry-header.S | 8 +- arch/arm/kernel/fiq.c | 55 +- arch/arm/kernel/head.S | 368 +- arch/arm/kernel/io.c | 6 +- arch/arm/kernel/irq.c | 179 +- arch/arm/kernel/module.c | 13 + arch/arm/kernel/process.c | 5 + arch/arm/kernel/ptrace.c | 7 +- arch/arm/kernel/semaphore.c | 4 +- arch/arm/kernel/setup.c | 102 +- arch/arm/kernel/signal.c | 216 +- arch/arm/kernel/sys_arm.c | 32 +- arch/arm/kernel/time.c | 72 +- arch/arm/kernel/traps.c | 39 +- arch/arm/kernel/vmlinux.lds.S | 35 +- arch/arm/lib/Makefile | 6 +- arch/arm/lib/csumpartial.S | 3 +- arch/arm/lib/csumpartialcopygeneric.S | 3 +- arch/arm/lib/delay.S | 13 +- arch/arm/lib/getuser.S | 22 +- arch/arm/lib/io-readsw-armv4.S | 87 +- arch/arm/lib/io-writesl.S | 57 +- arch/arm/lib/io-writesw-armv4.S | 62 +- arch/arm/lib/longlong.h | 1 - arch/arm/lib/putuser.S | 16 +- arch/arm/mach-clps711x/autcpu12.c | 6 +- arch/arm/mach-clps711x/cdb89712.c | 14 +- arch/arm/mach-clps711x/ceiva.c | 5 +- arch/arm/mach-clps711x/clep7312.c | 6 +- arch/arm/mach-clps711x/edb7211-arch.c | 6 +- arch/arm/mach-clps711x/fortunet.c | 6 +- arch/arm/mach-clps711x/p720t.c | 6 +- arch/arm/mach-clps711x/time.c | 10 +- arch/arm/mach-clps7500/core.c | 65 +- arch/arm/mach-ebsa110/core.c | 51 +- arch/arm/mach-ebsa110/io.c | 58 +- arch/arm/mach-epxa10db/arch.c | 35 +- arch/arm/mach-epxa10db/time.c | 7 +- arch/arm/mach-footbridge/Kconfig | 25 +- arch/arm/mach-footbridge/Makefile | 13 +- arch/arm/mach-footbridge/cats-hw.c | 30 + arch/arm/mach-footbridge/ebsa285-leds.c | 2 +- arch/arm/mach-footbridge/netwinder-hw.c | 50 +- arch/arm/mach-footbridge/netwinder-leds.c | 2 +- arch/arm/mach-footbridge/time.c | 122 +- arch/arm/mach-h720x/Kconfig | 11 + arch/arm/mach-h720x/cpu-h7201.c | 17 +- arch/arm/mach-h720x/cpu-h7202.c | 75 +- arch/arm/mach-h720x/h7201-eval.c | 7 +- arch/arm/mach-h720x/h7202-eval.c | 8 +- arch/arm/mach-imx/dma.c | 4 +- arch/arm/mach-imx/generic.c | 4 +- arch/arm/mach-imx/generic.h | 4 +- arch/arm/mach-imx/mx1ads.c | 2 +- arch/arm/mach-imx/time.c | 16 +- arch/arm/mach-integrator/core.c | 13 +- arch/arm/mach-integrator/impd1.c | 15 +- arch/arm/mach-integrator/integrator_ap.c | 13 +- arch/arm/mach-integrator/integrator_cp.c | 20 +- arch/arm/mach-integrator/pci_v3.c | 2 +- arch/arm/mach-integrator/time.c | 195 +- arch/arm/mach-iop3xx/Kconfig | 17 +- arch/arm/mach-iop3xx/Makefile | 4 +- arch/arm/mach-iop3xx/common.c | 1 - arch/arm/mach-iop3xx/iop321-pci.c | 37 +- arch/arm/mach-iop3xx/iop321-setup.c | 132 +- arch/arm/mach-iop3xx/iop321-time.c | 62 +- arch/arm/mach-iop3xx/iop331-pci.c | 35 +- arch/arm/mach-iop3xx/iop331-setup.c | 93 +- arch/arm/mach-iop3xx/iop331-time.c | 62 +- arch/arm/mach-iop3xx/iq31244-pci.c | 21 +- arch/arm/mach-iop3xx/iq80321-pci.c | 32 +- arch/arm/mach-iop3xx/iq80331-pci.c | 33 +- arch/arm/mach-ixp2000/Kconfig | 10 +- arch/arm/mach-ixp2000/core.c | 85 +- arch/arm/mach-ixp2000/enp2611.c | 38 +- arch/arm/mach-ixp2000/ixdp2400.c | 12 +- arch/arm/mach-ixp2000/ixdp2800.c | 14 +- arch/arm/mach-ixp2000/ixdp2x00.c | 11 +- arch/arm/mach-ixp2000/ixdp2x01.c | 49 +- arch/arm/mach-ixp2000/pci.c | 18 +- arch/arm/mach-ixp4xx/Kconfig | 51 +- arch/arm/mach-ixp4xx/Makefile | 2 + arch/arm/mach-ixp4xx/common-pci.c | 40 +- arch/arm/mach-ixp4xx/common.c | 74 +- arch/arm/mach-ixp4xx/coyote-pci.c | 1 + arch/arm/mach-ixp4xx/coyote-setup.c | 41 +- arch/arm/mach-ixp4xx/ixdp425-pci.c | 6 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 29 +- arch/arm/mach-ixp4xx/ixdpg425-pci.c | 1 + arch/arm/mach-ixp4xx/prpmc1100-pci.c | 1 + arch/arm/mach-ixp4xx/prpmc1100-setup.c | 7 +- arch/arm/mach-lh7a40x/arch-kev7a400.c | 8 +- arch/arm/mach-lh7a40x/arch-lpd7a40x.c | 14 +- arch/arm/mach-lh7a40x/time.c | 10 +- arch/arm/mach-omap/Kconfig | 65 +- arch/arm/mach-omap/Makefile | 6 +- arch/arm/mach-omap/board-generic.c | 35 +- arch/arm/mach-omap/board-h2.c | 36 +- arch/arm/mach-omap/board-h3.c | 37 +- arch/arm/mach-omap/board-innovator.c | 63 +- arch/arm/mach-omap/board-osk.c | 38 +- arch/arm/mach-omap/board-perseus2.c | 30 +- arch/arm/mach-omap/clock.c | 2 +- arch/arm/mach-omap/common.c | 409 +- arch/arm/mach-omap/common.h | 6 +- arch/arm/mach-omap/dma.c | 441 +- arch/arm/mach-omap/gpio.c | 22 +- arch/arm/mach-omap/irq.c | 10 +- arch/arm/mach-omap/mcbsp.c | 32 +- arch/arm/mach-omap/mux.c | 62 +- arch/arm/mach-omap/ocpi.c | 14 +- arch/arm/mach-omap/pm.c | 12 +- arch/arm/mach-omap/time.c | 229 +- arch/arm/mach-omap/usb.c | 116 +- arch/arm/mach-pxa/Kconfig | 20 + arch/arm/mach-pxa/Makefile | 1 + arch/arm/mach-pxa/generic.c | 9 +- arch/arm/mach-pxa/generic.h | 4 +- arch/arm/mach-pxa/idp.c | 2 +- arch/arm/mach-pxa/lubbock.c | 23 +- arch/arm/mach-pxa/mainstone.c | 106 +- arch/arm/mach-pxa/pm.c | 25 +- arch/arm/mach-pxa/pxa27x.c | 46 +- arch/arm/mach-pxa/ssp.c | 70 +- arch/arm/mach-pxa/time.c | 43 +- arch/arm/mach-rpc/riscpc.c | 101 +- arch/arm/mach-s3c2410/Kconfig | 50 +- arch/arm/mach-s3c2410/Makefile | 6 +- arch/arm/mach-s3c2410/clock.c | 203 +- arch/arm/mach-s3c2410/clock.h | 29 +- arch/arm/mach-s3c2410/cpu.c | 132 +- arch/arm/mach-s3c2410/cpu.h | 51 +- arch/arm/mach-s3c2410/devs.c | 6 + arch/arm/mach-s3c2410/dma.c | 122 +- arch/arm/mach-s3c2410/gpio.c | 17 + arch/arm/mach-s3c2410/irq.c | 88 +- arch/arm/mach-s3c2410/mach-bast.c | 208 +- arch/arm/mach-s3c2410/mach-h1940.c | 31 +- arch/arm/mach-s3c2410/mach-rx3715.c | 13 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 23 +- arch/arm/mach-s3c2410/mach-vr1000.c | 158 +- arch/arm/mach-s3c2410/s3c2410.c | 103 +- arch/arm/mach-s3c2410/s3c2410.h | 33 +- arch/arm/mach-s3c2410/s3c2440-dsc.c | 12 +- arch/arm/mach-s3c2410/s3c2440.c | 163 +- arch/arm/mach-s3c2410/s3c2440.h | 27 +- arch/arm/mach-s3c2410/time.c | 138 +- arch/arm/mach-s3c2410/usb-simtec.c | 20 +- arch/arm/mach-sa1100/Kconfig | 174 +- arch/arm/mach-sa1100/Makefile | 46 +- arch/arm/mach-sa1100/assabet.c | 120 +- arch/arm/mach-sa1100/badge4.c | 48 +- arch/arm/mach-sa1100/cerf.c | 64 +- arch/arm/mach-sa1100/collie.c | 102 +- arch/arm/mach-sa1100/generic.c | 59 +- arch/arm/mach-sa1100/generic.h | 13 +- arch/arm/mach-sa1100/h3600.c | 107 +- arch/arm/mach-sa1100/hackkit.c | 70 +- arch/arm/mach-sa1100/jornada720.c | 2 +- arch/arm/mach-sa1100/lart.c | 4 +- arch/arm/mach-sa1100/leds-simpad.c | 7 +- arch/arm/mach-sa1100/neponset.c | 23 +- arch/arm/mach-sa1100/pleb.c | 121 +- arch/arm/mach-sa1100/pm.c | 24 +- arch/arm/mach-sa1100/shannon.c | 44 +- arch/arm/mach-sa1100/simpad.c | 151 +- arch/arm/mach-sa1100/sleep.S | 4 +- arch/arm/mach-sa1100/time.c | 44 +- arch/arm/mach-shark/core.c | 53 +- arch/arm/mach-shark/irq.c | 7 +- arch/arm/mach-shark/leds.c | 2 +- arch/arm/mach-shark/pci.c | 4 +- arch/arm/mach-versatile/Makefile | 2 + arch/arm/mach-versatile/clock.c | 11 +- arch/arm/mach-versatile/clock.h | 6 +- arch/arm/mach-versatile/core.c | 219 +- arch/arm/mm/Kconfig | 38 +- arch/arm/mm/alignment.c | 190 +- arch/arm/mm/consistent.c | 61 +- arch/arm/mm/copypage-v6.c | 3 +- arch/arm/mm/init.c | 43 +- arch/arm/mm/ioremap.c | 8 +- arch/arm/mm/mm-armv.c | 79 +- arch/arm/mm/proc-arm1020.S | 45 +- arch/arm/mm/proc-arm1020e.S | 46 +- arch/arm/mm/proc-arm1022.S | 45 +- arch/arm/mm/proc-arm1026.S | 46 +- arch/arm/mm/proc-arm6_7.S | 12 +- arch/arm/mm/proc-arm720.S | 98 +- arch/arm/mm/proc-arm920.S | 47 +- arch/arm/mm/proc-arm922.S | 47 +- arch/arm/mm/proc-arm925.S | 53 +- arch/arm/mm/proc-arm926.S | 47 +- arch/arm/mm/proc-sa110.S | 32 +- arch/arm/mm/proc-sa1100.S | 44 +- arch/arm/mm/proc-v6.S | 51 +- arch/arm/mm/proc-xscale.S | 111 +- arch/arm/mm/tlb-v4.S | 2 +- arch/arm/mm/tlb-v4wb.S | 2 +- arch/arm/nwfpe/double_cpdo.c | 8 + arch/arm/oprofile/common.c | 44 +- arch/arm/oprofile/init.c | 3 +- arch/arm/oprofile/op_arm_model.h | 2 +- arch/arm/oprofile/op_model_xscale.c | 14 +- arch/arm/tools/mach-types | 64 +- arch/arm/vfp/entry.S | 2 +- arch/arm/vfp/vfp.h | 11 + arch/arm/vfp/vfpdouble.c | 10 +- arch/arm/vfp/vfphw.S | 33 +- arch/arm/vfp/vfpsingle.c | 6 +- arch/arm26/ACKNOWLEDGEMENTS | 2 + arch/arm26/Kconfig | 5 +- arch/arm26/Makefile | 14 +- arch/arm26/boot/Makefile | 8 +- arch/arm26/boot/compressed/head.S | 2 +- arch/arm26/boot/compressed/ll_char_wr.S | 2 +- arch/arm26/boot/compressed/uncompress.h | 1 - arch/arm26/boot/compressed/vmlinux.lds.in | 2 +- arch/arm26/boot/install.sh | 4 +- arch/arm26/kernel/Makefile | 15 +- arch/arm26/kernel/armksyms.c | 14 +- arch/arm26/kernel/asm-offsets.c | 1 - arch/arm26/kernel/calls.S | 5 + arch/arm26/kernel/compat.c | 2 +- arch/arm26/kernel/dma.c | 33 +- arch/arm26/kernel/ecard.c | 101 +- arch/arm26/kernel/entry.S | 214 +- arch/arm26/kernel/init_task.c | 6 +- arch/arm26/kernel/irq.c | 2 +- arch/arm26/kernel/process.c | 106 +- arch/arm26/kernel/ptrace.c | 4 +- arch/arm26/kernel/semaphore.c | 10 +- arch/arm26/kernel/setup.c | 6 +- arch/arm26/kernel/sys_arm.c | 41 + arch/arm26/kernel/time.c | 59 +- arch/arm26/kernel/traps.c | 14 +- arch/arm26/kernel/vmlinux-arm26-xip.lds.in | 5 +- arch/arm26/kernel/vmlinux-arm26.lds.in | 3 +- arch/arm26/lib/Makefile | 12 +- arch/arm26/lib/backtrace.S | 2 +- arch/arm26/lib/changebit.S | 2 +- arch/arm26/lib/clearbit.S | 2 +- arch/arm26/lib/copy_page.S | 2 +- arch/arm26/lib/csumipv6.S | 2 +- arch/arm26/lib/csumpartial.S | 2 +- arch/arm26/lib/csumpartialcopy.S | 2 +- arch/arm26/lib/csumpartialcopygeneric.S | 2 +- arch/arm26/lib/delay.S | 2 +- arch/arm26/lib/ecard.S | 2 +- arch/arm26/lib/floppydma.S | 2 +- arch/arm26/lib/getuser.S | 5 +- arch/arm26/lib/io-acorn.S | 2 +- arch/arm26/lib/io-readsb.S | 2 +- arch/arm26/lib/io-writesb.S | 2 +- arch/arm26/lib/io-writesl.S | 2 +- arch/arm26/lib/memchr.S | 2 +- arch/arm26/lib/memcpy.S | 2 +- arch/arm26/lib/memset.S | 2 +- arch/arm26/lib/memzero.S | 2 +- arch/arm26/lib/putuser.S | 5 +- arch/arm26/lib/setbit.S | 2 +- arch/arm26/lib/strchr.S | 2 +- arch/arm26/lib/strrchr.S | 2 +- arch/arm26/lib/testchangebit.S | 2 +- arch/arm26/lib/testclearbit.S | 2 +- arch/arm26/lib/testsetbit.S | 2 +- arch/arm26/machine/Makefile | 6 +- arch/arm26/machine/dma.c | 4 +- arch/arm26/machine/irq.c | 2 +- arch/arm26/mm/Makefile | 3 +- arch/arm26/mm/extable.c | 8 +- arch/arm26/mm/fault.c | 3 +- arch/arm26/mm/init.c | 8 +- arch/arm26/mm/proc-funcs.S | 2 +- arch/cris/Kconfig | 4 + arch/cris/Kconfig.debug | 27 +- arch/cris/Makefile | 4 +- arch/cris/arch-v10/drivers/Kconfig | 41 +- arch/cris/arch-v10/drivers/Makefile | 4 - arch/cris/arch-v10/drivers/axisflashmap.c | 61 +- arch/cris/arch-v10/drivers/ds1302.c | 5 +- arch/cris/arch-v10/drivers/gpio.c | 5 +- arch/cris/arch-v10/drivers/i2c.c | 18 +- arch/cris/arch-v10/drivers/pcf8563.c | 4 +- arch/cris/arch-v10/kernel/Makefile | 3 +- arch/cris/arch-v10/kernel/debugport.c | 468 +- arch/cris/arch-v10/kernel/entry.S | 139 +- arch/cris/arch-v10/kernel/fasttimer.c | 30 +- arch/cris/arch-v10/kernel/irq.c | 33 +- arch/cris/arch-v10/kernel/kgdb.c | 7 +- arch/cris/arch-v10/kernel/process.c | 24 +- arch/cris/arch-v10/kernel/ptrace.c | 42 +- arch/cris/arch-v10/kernel/signal.c | 28 +- arch/cris/arch-v10/kernel/time.c | 6 +- arch/cris/arch-v10/mm/fault.c | 104 +- arch/cris/arch-v10/mm/tlb.c | 20 +- arch/cris/arch-v10/vmlinux.lds.S | 1 + arch/cris/kernel/irq.c | 7 +- arch/h8300/Kconfig | 4 + arch/h8300/Makefile | 9 +- arch/h8300/defconfig | 219 +- arch/h8300/kernel/ptrace.c | 2 +- arch/h8300/kernel/setup.c | 2 +- arch/h8300/kernel/signal.c | 420 +- arch/h8300/kernel/syscalls.S | 15 + arch/h8300/kernel/time.c | 3 + arch/h8300/kernel/vmlinux.lds.S | 146 +- arch/h8300/platform/h8300h/entry.S | 6 +- arch/h8300/platform/h8s/edosk2674/crt0_rom.S | 2 +- arch/h8300/platform/h8s/entry.S | 6 +- arch/i386/Kconfig | 61 +- arch/i386/Kconfig.debug | 12 - arch/i386/Makefile | 11 +- arch/i386/boot/edd.S | 42 +- arch/i386/boot/setup.S | 4 +- arch/i386/boot/video.S | 4 +- arch/i386/crypto/aes-i586-asm.S | 325 +- arch/i386/crypto/aes.c | 6 +- arch/i386/defconfig | 2 +- arch/i386/kernel/Makefile | 4 +- arch/i386/kernel/acpi/Makefile | 1 + arch/i386/kernel/acpi/boot.c | 113 +- arch/i386/kernel/acpi/sleep.c | 2 +- arch/i386/kernel/acpi/wakeup.S | 29 +- arch/i386/kernel/apic.c | 115 +- arch/i386/kernel/apm.c | 28 +- arch/i386/kernel/cpu/Makefile | 2 +- arch/i386/kernel/cpu/amd.c | 17 + arch/i386/kernel/cpu/common.c | 89 +- arch/i386/kernel/cpu/cpufreq/Kconfig | 109 +- arch/i386/kernel/cpu/cpufreq/Makefile | 33 +- arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | 34 +- .../i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | 11 +- arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 21 +- arch/i386/kernel/cpu/cpufreq/longhaul.c | 34 +- arch/i386/kernel/cpu/cpufreq/longrun.c | 13 +- arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | 55 +- arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 95 +- arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 147 +- arch/i386/kernel/cpu/cpufreq/powernow-k8.h | 15 +- .../kernel/cpu/cpufreq/speedstep-centrino.c | 223 +- arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | 107 +- arch/i386/kernel/cpu/cpufreq/speedstep-lib.c | 56 +- arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | 77 +- arch/i386/kernel/cpu/cyrix.c | 11 +- arch/i386/kernel/cpu/intel.c | 177 +- arch/i386/kernel/cpu/intel_cacheinfo.c | 2 +- arch/i386/kernel/cpu/mcheck/k7.c | 3 +- arch/i386/kernel/cpu/mcheck/mce.c | 4 +- arch/i386/kernel/cpu/mcheck/mce.h | 2 +- arch/i386/kernel/cpu/mcheck/non-fatal.c | 1 + arch/i386/kernel/cpu/mcheck/p4.c | 9 +- arch/i386/kernel/cpu/mcheck/p5.c | 3 +- arch/i386/kernel/cpu/mcheck/p6.c | 3 +- arch/i386/kernel/cpu/mcheck/winchip.c | 3 +- arch/i386/kernel/cpu/mtrr/generic.c | 23 +- arch/i386/kernel/cpu/mtrr/main.c | 32 +- arch/i386/kernel/cpu/nexgen.c | 2 +- arch/i386/kernel/cpu/proc.c | 23 +- arch/i386/kernel/cpu/transmeta.c | 23 +- arch/i386/kernel/dmi_scan.c | 87 +- arch/i386/kernel/efi.c | 2 +- arch/i386/kernel/entry.S | 87 +- arch/i386/kernel/head.S | 8 +- arch/i386/kernel/i386_ksyms.c | 9 +- arch/i386/kernel/i387.c | 35 +- arch/i386/kernel/i8259.c | 4 +- arch/i386/kernel/io_apic.c | 31 +- arch/i386/kernel/irq.c | 1148 +- arch/i386/kernel/kprobes.c | 59 +- arch/i386/kernel/mca.c | 21 +- arch/i386/kernel/microcode.c | 35 +- arch/i386/kernel/mpparse.c | 28 +- arch/i386/kernel/nmi.c | 8 +- arch/i386/kernel/numaq.c | 11 +- arch/i386/kernel/pci-dma.c | 5 +- arch/i386/kernel/process.c | 52 +- arch/i386/kernel/ptrace.c | 236 +- arch/i386/kernel/reboot.c | 17 +- arch/i386/kernel/scx200.c | 71 +- arch/i386/kernel/semaphore.c | 18 +- arch/i386/kernel/setup.c | 84 +- arch/i386/kernel/signal.c | 61 +- arch/i386/kernel/smp.c | 14 +- arch/i386/kernel/smpboot.c | 21 +- arch/i386/kernel/srat.c | 33 +- arch/i386/kernel/time.c | 52 +- arch/i386/kernel/time_hpet.c | 73 +- arch/i386/kernel/timers/common.c | 1 + arch/i386/kernel/timers/timer.c | 16 +- arch/i386/kernel/timers/timer_cyclone.c | 8 +- arch/i386/kernel/timers/timer_hpet.c | 8 +- arch/i386/kernel/timers/timer_none.c | 6 - arch/i386/kernel/timers/timer_pit.c | 14 +- arch/i386/kernel/timers/timer_pm.c | 7 +- arch/i386/kernel/timers/timer_tsc.c | 18 +- arch/i386/kernel/trampoline.S | 10 +- arch/i386/kernel/traps.c | 148 +- arch/i386/kernel/vm86.c | 24 +- arch/i386/kernel/vsyscall-sysenter.S | 2 +- arch/i386/lib/dec_and_lock.c | 2 +- arch/i386/lib/delay.c | 2 +- arch/i386/lib/usercopy.c | 4 + arch/i386/mach-default/topology.c | 32 + arch/i386/mach-es7000/es7000.h | 7 - arch/i386/mach-es7000/es7000plat.c | 65 +- arch/i386/mach-visws/reboot.c | 3 - arch/i386/mach-visws/visws_apic.c | 2 +- arch/i386/mach-voyager/voyager_basic.c | 4 +- arch/i386/mach-voyager/voyager_smp.c | 66 +- arch/i386/math-emu/fpu_entry.c | 4 +- arch/i386/mm/discontig.c | 34 +- arch/i386/mm/fault.c | 21 +- arch/i386/mm/highmem.c | 6 +- arch/i386/mm/hugetlbpage.c | 149 +- arch/i386/mm/init.c | 29 +- arch/i386/mm/ioremap.c | 20 +- arch/i386/mm/mmap.c | 4 +- arch/i386/mm/pageattr.c | 50 +- arch/i386/mm/pgtable.c | 35 +- arch/i386/oprofile/Makefile | 2 +- arch/i386/oprofile/init.c | 16 +- arch/i386/oprofile/nmi_int.c | 63 +- arch/i386/oprofile/nmi_timer_int.c | 16 +- arch/i386/oprofile/op_model_athlon.c | 9 +- arch/i386/oprofile/op_model_p4.c | 9 +- arch/i386/oprofile/op_model_ppro.c | 9 +- arch/i386/oprofile/op_x86_model.h | 5 +- arch/i386/pci/acpi.c | 30 +- arch/i386/pci/common.c | 6 +- arch/i386/pci/fixup.c | 143 +- arch/i386/pci/i386.c | 10 +- arch/i386/pci/irq.c | 71 +- arch/i386/pci/mmconfig.c | 12 +- arch/i386/pci/numa.c | 8 +- arch/i386/pci/pcbios.c | 4 +- arch/i386/pci/pci.h | 2 - arch/i386/power/cpu.c | 2 +- arch/ia64/Kconfig | 69 +- arch/ia64/Kconfig.debug | 2 +- arch/ia64/Makefile | 11 +- arch/ia64/configs/bigsur_defconfig | 74 +- arch/ia64/configs/sn2_defconfig | 105 +- arch/ia64/configs/tiger_defconfig | 114 +- arch/ia64/configs/zx1_defconfig | 215 +- arch/ia64/defconfig | 690 +- arch/ia64/dig/Makefile | 5 - arch/ia64/hp/common/Makefile | 2 + arch/ia64/hp/common/sba_iommu.c | 9 +- arch/ia64/hp/sim/simeth.c | 10 +- arch/ia64/hp/sim/simserial.c | 66 +- arch/ia64/hp/zx1/Makefile | 2 +- arch/ia64/ia32/binfmt_elf32.c | 28 +- arch/ia64/ia32/elfcore32.h | 5 +- arch/ia64/ia32/ia32_entry.S | 22 +- arch/ia64/ia32/ia32_signal.c | 59 +- arch/ia64/ia32/ia32priv.h | 4 +- arch/ia64/ia32/sys_ia32.c | 70 +- arch/ia64/kernel/Makefile | 6 +- arch/ia64/kernel/acpi.c | 142 +- arch/ia64/kernel/asm-offsets.c | 29 +- arch/ia64/kernel/cyclone.c | 5 +- arch/ia64/kernel/domain.c | 6 +- arch/ia64/kernel/efi.c | 94 +- arch/ia64/kernel/entry.S | 238 +- arch/ia64/kernel/entry.h | 25 +- arch/ia64/kernel/fsys.S | 15 +- arch/ia64/kernel/gate.S | 4 +- arch/ia64/kernel/head.S | 45 +- arch/ia64/kernel/ia64_ksyms.c | 3 + arch/ia64/kernel/iosapic.c | 105 +- arch/ia64/kernel/irq.c | 1014 +- arch/ia64/kernel/irq_ia64.c | 48 +- arch/ia64/kernel/ivt.S | 58 +- arch/ia64/kernel/mca.c | 80 +- arch/ia64/kernel/mca_asm.S | 107 +- arch/ia64/kernel/mca_drv.c | 4 +- arch/ia64/kernel/minstate.h | 7 +- arch/ia64/kernel/perfmon.c | 136 +- arch/ia64/kernel/process.c | 43 +- arch/ia64/kernel/ptrace.c | 714 +- arch/ia64/kernel/sal.c | 2 +- arch/ia64/kernel/salinfo.c | 20 +- arch/ia64/kernel/setup.c | 90 +- arch/ia64/kernel/signal.c | 121 +- arch/ia64/kernel/smp.c | 12 +- arch/ia64/kernel/smpboot.c | 12 +- arch/ia64/kernel/sys_ia64.c | 9 +- arch/ia64/kernel/time.c | 36 +- arch/ia64/kernel/traps.c | 76 +- arch/ia64/kernel/unwind.c | 94 +- arch/ia64/lib/bitop.c | 4 +- arch/ia64/lib/csum_partial_copy.c | 11 +- arch/ia64/lib/dec_and_lock.c | 4 +- arch/ia64/lib/io.c | 24 +- arch/ia64/lib/memcpy.S | 16 - arch/ia64/lib/memcpy_mck.S | 9 - arch/ia64/lib/swiotlb.c | 346 +- arch/ia64/mm/contig.c | 5 +- arch/ia64/mm/discontig.c | 112 +- arch/ia64/mm/fault.c | 11 +- arch/ia64/mm/hugetlbpage.c | 35 +- arch/ia64/mm/init.c | 50 +- arch/ia64/mm/numa.c | 36 - arch/ia64/mm/tlb.c | 2 +- arch/ia64/oprofile/Makefile | 2 +- arch/ia64/oprofile/init.c | 14 +- arch/ia64/oprofile/perfmon.c | 15 +- arch/ia64/pci/pci.c | 278 +- arch/ia64/sn/Makefile | 6 +- arch/ia64/sn/kernel/Makefile | 3 +- arch/ia64/sn/kernel/bte.c | 124 +- arch/ia64/sn/kernel/bte_error.c | 14 +- arch/ia64/sn/kernel/huberror.c | 2 +- arch/ia64/sn/kernel/idle.c | 12 +- arch/ia64/sn/kernel/io_init.c | 9 +- arch/ia64/sn/kernel/iomv.c | 19 +- arch/ia64/sn/kernel/irq.c | 522 +- arch/ia64/sn/kernel/mca.c | 43 +- arch/ia64/sn/kernel/setup.c | 454 +- arch/ia64/sn/kernel/sn2/io.c | 60 +- arch/ia64/sn/kernel/sn2/prominfo_proc.c | 185 +- arch/ia64/sn/kernel/sn2/ptc_deadlock.S | 26 +- arch/ia64/sn/kernel/sn2/sn2_smp.c | 178 +- arch/ia64/sn/kernel/sn2/sn_hwperf.c | 172 +- arch/ia64/sn/kernel/sn2/sn_proc_fs.c | 15 +- arch/ia64/sn/kernel/sn2/timer.c | 15 +- arch/ia64/sn/kernel/sn2/timer_interrupt.c | 14 +- arch/ia64/sn/pci/pci_dma.c | 528 +- arch/m32r/Kconfig | 104 +- arch/m32r/Makefile | 5 +- arch/m32r/boot/compressed/Makefile | 7 +- arch/m32r/boot/compressed/head.S | 96 +- arch/m32r/boot/compressed/m32r_sio.c | 24 +- arch/m32r/boot/compressed/misc.c | 53 +- arch/m32r/boot/compressed/vmlinux.lds.S | 16 +- arch/m32r/boot/compressed/vmlinux.scr | 6 +- arch/m32r/boot/setup.S | 2 +- arch/m32r/defconfig | 188 +- arch/m32r/kernel/entry.S | 90 +- arch/m32r/kernel/io_m32700ut.c | 149 +- arch/m32r/kernel/io_mappi.c | 194 +- arch/m32r/kernel/io_mappi2.c | 233 +- arch/m32r/kernel/io_oaks32r.c | 66 +- arch/m32r/kernel/io_opsput.c | 131 +- arch/m32r/kernel/io_usrv.c | 6 +- arch/m32r/kernel/irq.c | 947 +- arch/m32r/kernel/process.c | 25 +- arch/m32r/kernel/ptrace.c | 99 +- arch/m32r/kernel/setup.c | 6 +- arch/m32r/kernel/setup_m32700ut.c | 4 +- arch/m32r/kernel/setup_mappi.c | 2 +- arch/m32r/kernel/setup_mappi2.c | 2 +- arch/m32r/kernel/setup_opsput.c | 4 +- arch/m32r/kernel/signal.c | 187 +- arch/m32r/kernel/smp.c | 8 +- arch/m32r/kernel/smpboot.c | 10 +- arch/m32r/kernel/sys_m32r.c | 6 +- arch/m32r/kernel/time.c | 21 +- arch/m32r/kernel/traps.c | 2 +- arch/m32r/lib/csum_partial_copy.c | 28 +- arch/m32r/lib/delay.c | 2 +- arch/m32r/lib/memset.S | 17 +- arch/m32r/m32700ut/defconfig.m32700ut.smp | 166 +- arch/m32r/m32700ut/defconfig.m32700ut.up | 166 +- arch/m32r/m32700ut/dot.gdbinit_200MHz_16MB | 14 +- arch/m32r/m32700ut/dot.gdbinit_300MHz_32MB | 24 +- arch/m32r/mappi/defconfig.nommu | 144 +- arch/m32r/mappi/defconfig.smp | 142 +- arch/m32r/mappi/defconfig.up | 142 +- arch/m32r/mappi/dot.gdbinit | 16 +- arch/m32r/mappi/dot.gdbinit.nommu | 6 +- arch/m32r/mappi/dot.gdbinit.smp | 12 +- arch/m32r/mappi2/defconfig.vdec2 | 43 +- arch/m32r/mm/discontig.c | 6 +- arch/m32r/mm/fault.c | 45 +- arch/m32r/mm/init.c | 11 +- arch/m32r/oaks32r/defconfig.nommu | 129 +- arch/m32r/oaks32r/dot.gdbinit.nommu | 15 +- arch/m32r/oprofile/init.c | 5 +- arch/m32r/opsput/defconfig.opsput | 160 +- arch/m32r/opsput/dot.gdbinit | 76 +- arch/m68k/Kconfig | 29 +- arch/m68k/Makefile | 2 +- arch/m68k/atari/hades-pci.c | 2 +- arch/m68k/atari/stram.c | 2 +- arch/m68k/configs/amiga_defconfig | 10 +- arch/m68k/configs/apollo_defconfig | 10 +- arch/m68k/configs/atari_defconfig | 10 +- arch/m68k/configs/bvme6000_defconfig | 10 +- arch/m68k/configs/hp300_defconfig | 10 +- arch/m68k/configs/mac_defconfig | 10 +- arch/m68k/configs/mvme147_defconfig | 10 +- arch/m68k/configs/mvme16x_defconfig | 10 +- arch/m68k/configs/q40_defconfig | 10 +- arch/m68k/configs/sun3_defconfig | 10 +- arch/m68k/configs/sun3x_defconfig | 10 +- arch/m68k/defconfig | 585 +- arch/m68k/hp300/config.c | 265 +- arch/m68k/hp300/ints.c | 9 +- arch/m68k/hp300/reboot.S | 21 +- arch/m68k/hp300/time.c | 13 +- arch/m68k/kernel/bios32.c | 6 +- arch/m68k/kernel/entry.S | 47 + arch/m68k/kernel/head.S | 194 +- arch/m68k/kernel/ptrace.c | 2 +- arch/m68k/kernel/setup.c | 25 +- arch/m68k/kernel/time.c | 3 + arch/m68k/kernel/vmlinux-std.lds | 4 +- arch/m68k/kernel/vmlinux-sun3.lds | 4 +- arch/m68k/kernel/vmlinux.lds.S | 6 +- arch/m68k/lib/checksum.c | 6 +- arch/m68k/mm/memory.c | 2 +- arch/m68k/mm/motorola.c | 2 +- arch/m68k/mm/sun3mmu.c | 1 - arch/m68k/q40/config.c | 1 - arch/m68k/q40/q40ints.c | 1 - arch/m68k/sun3/Makefile | 3 +- arch/m68k/sun3/mmu_emu.c | 5 +- arch/m68k/sun3/sun3dvma.c | 1 + arch/m68k/sun3/sun3ints.c | 4 + arch/m68k/sun3x/config.c | 3 +- arch/m68knommu/Kconfig | 121 +- arch/m68knommu/Makefile | 17 +- arch/m68knommu/defconfig | 6 +- arch/m68knommu/kernel/module.c | 35 +- arch/m68knommu/kernel/process.c | 4 +- arch/m68knommu/kernel/ptrace.c | 2 +- arch/m68knommu/kernel/setup.c | 9 +- arch/m68knommu/kernel/signal.c | 151 +- arch/m68knommu/kernel/syscalltable.S | 70 +- arch/m68knommu/kernel/time.c | 3 + arch/m68knommu/kernel/vmlinux.lds.S | 35 +- arch/m68knommu/lib/Makefile | 2 +- arch/m68knommu/lib/checksum.c | 6 +- arch/m68knommu/lib/delay.c | 3 + arch/m68knommu/mm/init.c | 3 +- arch/m68knommu/mm/memory.c | 1 - .../platform/5206e/MOTOROLA/crt0_ram.S | 30 +- arch/m68knommu/platform/5206e/config.c | 1 - arch/m68knommu/platform/5249/config.c | 1 - arch/m68knommu/platform/5272/config.c | 7 +- arch/m68knommu/platform/5307/Makefile | 2 + arch/m68knommu/platform/5307/config.c | 1 - arch/m68knommu/platform/5307/vectors.c | 2 +- arch/m68knommu/platform/5407/config.c | 1 - arch/mips/Kconfig | 239 +- arch/mips/Makefile | 318 +- arch/mips/arc/identify.c | 2 +- arch/mips/arc/misc.c | 2 +- arch/mips/au1000/common/Makefile | 9 +- arch/mips/au1000/common/au1xxx_irqmap.c | 49 +- arch/mips/au1000/common/cputable.c | 3 +- arch/mips/au1000/common/dbdma.c | 145 +- arch/mips/au1000/common/dma.c | 11 +- arch/mips/au1000/common/irq.c | 20 +- arch/mips/au1000/common/pci.c | 17 +- arch/mips/au1000/common/platform.c | 1 - arch/mips/au1000/common/power.c | 2 +- arch/mips/au1000/common/puts.c | 2 +- arch/mips/au1000/common/reset.c | 15 +- arch/mips/au1000/common/setup.c | 83 +- arch/mips/au1000/common/sleeper.S | 1 - arch/mips/au1000/common/time.c | 25 +- arch/mips/au1000/common/usbdev.c | 13 +- arch/mips/au1000/csb250/board_setup.c | 11 - arch/mips/au1000/csb250/irqmap.c | 2 +- arch/mips/au1000/db1x00/board_setup.c | 6 + arch/mips/au1000/db1x00/irqmap.c | 2 +- arch/mips/au1000/db1x00/mirage_ts.c | 8 +- arch/mips/au1000/hydrogen3/board_setup.c | 6 +- arch/mips/au1000/hydrogen3/irqmap.c | 2 +- arch/mips/au1000/mtx-1/board_setup.c | 14 +- arch/mips/au1000/mtx-1/init.c | 23 +- arch/mips/au1000/mtx-1/irqmap.c | 14 +- arch/mips/au1000/pb1000/board_setup.c | 14 +- arch/mips/au1000/pb1000/irqmap.c | 4 +- arch/mips/au1000/pb1100/board_setup.c | 16 +- arch/mips/au1000/pb1100/irqmap.c | 4 +- arch/mips/au1000/pb1500/board_setup.c | 12 +- arch/mips/au1000/pb1500/irqmap.c | 2 +- arch/mips/au1000/pb1550/board_setup.c | 7 +- arch/mips/au1000/pb1550/irqmap.c | 2 +- arch/mips/au1000/xxs1500/board_setup.c | 6 + arch/mips/au1000/xxs1500/irqmap.c | 2 +- arch/mips/boot/Makefile | 18 +- arch/mips/boot/addinitrd.c | 9 +- arch/mips/cobalt/irq.c | 2 +- arch/mips/cobalt/setup.c | 3 +- arch/mips/configs/atlas_defconfig | 637 +- arch/mips/configs/capcella_defconfig | 112 +- arch/mips/configs/cobalt_defconfig | 112 +- arch/mips/configs/db1000_defconfig | 135 +- arch/mips/configs/db1100_defconfig | 135 +- arch/mips/configs/db1500_defconfig | 327 +- arch/mips/configs/db1550_defconfig | 42 +- arch/mips/configs/ddb5476_defconfig | 113 +- arch/mips/configs/ddb5477_defconfig | 111 +- arch/mips/configs/decstation_defconfig | 113 +- arch/mips/configs/e55_defconfig | 113 +- arch/mips/configs/ev64120_defconfig | 111 +- arch/mips/configs/ev96100_defconfig | 112 +- arch/mips/configs/ip22_defconfig | 198 +- arch/mips/configs/ip27_defconfig | 197 +- arch/mips/configs/ip32_defconfig | 120 +- arch/mips/configs/it8172_defconfig | 131 +- arch/mips/configs/ivr_defconfig | 111 +- arch/mips/configs/jaguar-atx_defconfig | 101 +- arch/mips/configs/jmr3927_defconfig | 114 +- arch/mips/configs/lasat200_defconfig | 127 +- arch/mips/configs/malta_defconfig | 657 +- arch/mips/configs/mpc30x_defconfig | 117 +- arch/mips/configs/ocelot_3_defconfig | 56 +- arch/mips/configs/ocelot_c_defconfig | 108 +- arch/mips/configs/ocelot_defconfig | 111 +- arch/mips/configs/ocelot_g_defconfig | 108 +- arch/mips/configs/osprey_defconfig | 111 +- arch/mips/configs/pb1100_defconfig | 231 +- arch/mips/configs/pb1500_defconfig | 142 +- arch/mips/configs/pb1550_defconfig | 137 +- arch/mips/configs/rm200_defconfig | 220 +- arch/mips/configs/sb1250-swarm_defconfig | 129 +- arch/mips/configs/sead_defconfig | 108 +- arch/mips/configs/tb0226_defconfig | 117 +- arch/mips/configs/tb0229_defconfig | 143 +- arch/mips/configs/workpad_defconfig | 113 +- arch/mips/configs/yosemite_defconfig | 124 +- arch/mips/ddb5xxx/common/Makefile | 2 +- arch/mips/ddb5xxx/ddb5074/irq.c | 11 +- arch/mips/ddb5xxx/ddb5074/nile4_pic.c | 2 - arch/mips/ddb5xxx/ddb5074/setup.c | 10 - arch/mips/ddb5xxx/ddb5476/irq.c | 2 +- arch/mips/ddb5xxx/ddb5476/setup.c | 11 - arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c | 5 +- arch/mips/ddb5xxx/ddb5477/irq.c | 5 +- arch/mips/ddb5xxx/ddb5477/irq_5477.c | 4 +- arch/mips/ddb5xxx/ddb5477/setup.c | 8 +- arch/mips/dec/boot/decstation.c | 8 - arch/mips/dec/ioasic-irq.c | 2 +- arch/mips/dec/kn02-irq.c | 2 +- arch/mips/dec/setup.c | 13 +- arch/mips/defconfig | 198 +- arch/mips/galileo-boards/ev96100/irq.c | 3 +- arch/mips/galileo-boards/ev96100/time.c | 4 + arch/mips/gt64120/common/time.c | 4 +- arch/mips/gt64120/ev64120/irq.c | 8 +- arch/mips/gt64120/momenco_ocelot/dbg_io.c | 2 +- arch/mips/gt64120/momenco_ocelot/irq.c | 12 +- arch/mips/gt64120/momenco_ocelot/setup.c | 6 +- arch/mips/ite-boards/generic/irq.c | 111 +- arch/mips/jazz/irq.c | 11 +- arch/mips/jazz/jazzdma.c | 14 +- arch/mips/jazz/reset.c | 2 - arch/mips/jmr3927/rbhma3100/irq.c | 79 +- arch/mips/jmr3927/rbhma3100/setup.c | 9 +- arch/mips/kernel/Makefile | 8 +- arch/mips/kernel/cpu-bugs64.c | 5 +- arch/mips/kernel/cpu-probe.c | 1 + arch/mips/kernel/entry.S | 5 + arch/mips/kernel/gdb-stub.c | 2 + arch/mips/kernel/genex.S | 20 +- arch/mips/kernel/head.S | 54 +- arch/mips/kernel/i8259.c | 4 +- arch/mips/kernel/ioctl32.c | 6 + arch/mips/kernel/irixelf.c | 97 +- arch/mips/kernel/irixinv.c | 8 +- arch/mips/kernel/irixsig.c | 42 +- arch/mips/kernel/irq-mv6434x.c | 2 +- arch/mips/kernel/irq.c | 851 +- arch/mips/kernel/linux32.c | 17 +- arch/mips/kernel/mips_ksyms.c | 7 +- arch/mips/kernel/module.c | 2 +- arch/mips/kernel/process.c | 102 +- arch/mips/kernel/ptrace.c | 6 +- arch/mips/kernel/ptrace32.c | 6 +- arch/mips/kernel/r4k_switch.S | 37 +- arch/mips/kernel/scall32-o32.S | 230 +- arch/mips/kernel/scall64-64.S | 53 +- arch/mips/kernel/scall64-n32.S | 31 +- arch/mips/kernel/scall64-o32.S | 741 +- arch/mips/kernel/semaphore.c | 73 +- arch/mips/kernel/setup.c | 159 +- arch/mips/kernel/signal.c | 160 +- arch/mips/kernel/signal32.c | 224 +- arch/mips/kernel/signal_n32.c | 53 +- arch/mips/kernel/smp.c | 6 +- arch/mips/kernel/syscall.c | 25 +- arch/mips/kernel/sysirix.c | 45 +- arch/mips/kernel/time.c | 39 +- arch/mips/kernel/traps.c | 75 +- arch/mips/kernel/vmlinux.lds.S | 13 +- arch/mips/lasat/interrupt.c | 6 +- arch/mips/lasat/setup.c | 2 +- arch/mips/lib-32/dump_tlb.c | 2 + arch/mips/lib-64/dump_tlb.c | 12 +- arch/mips/lib/Makefile | 4 +- arch/mips/lib/csum_partial_copy.c | 8 +- arch/mips/lib/dec_and_lock.c | 4 +- arch/mips/lib/strlen_user.S | 3 +- arch/mips/lib/strnlen_user.S | 3 +- arch/mips/math-emu/cp1emu.c | 8 +- arch/mips/math-emu/dp_add.c | 2 +- arch/mips/math-emu/dp_cmp.c | 2 +- arch/mips/math-emu/dp_div.c | 2 +- arch/mips/math-emu/dp_fint.c | 2 +- arch/mips/math-emu/dp_flong.c | 2 +- arch/mips/math-emu/dp_frexp.c | 2 +- arch/mips/math-emu/dp_fsp.c | 2 +- arch/mips/math-emu/dp_logb.c | 2 +- arch/mips/math-emu/dp_modf.c | 2 +- arch/mips/math-emu/dp_mul.c | 2 +- arch/mips/math-emu/dp_scalb.c | 2 +- arch/mips/math-emu/dp_simple.c | 2 +- arch/mips/math-emu/dp_sqrt.c | 2 +- arch/mips/math-emu/dp_sub.c | 2 +- arch/mips/math-emu/dp_tint.c | 2 +- arch/mips/math-emu/dp_tlong.c | 2 +- arch/mips/math-emu/ieee754.c | 2 +- arch/mips/math-emu/ieee754.h | 2 +- arch/mips/math-emu/ieee754d.c | 2 +- arch/mips/math-emu/ieee754dp.c | 2 +- arch/mips/math-emu/ieee754dp.h | 2 +- arch/mips/math-emu/ieee754int.h | 2 +- arch/mips/math-emu/ieee754m.c | 2 +- arch/mips/math-emu/ieee754sp.c | 2 +- arch/mips/math-emu/ieee754sp.h | 2 +- arch/mips/math-emu/ieee754xcpt.c | 2 +- arch/mips/math-emu/sp_add.c | 2 +- arch/mips/math-emu/sp_cmp.c | 2 +- arch/mips/math-emu/sp_div.c | 2 +- arch/mips/math-emu/sp_fdp.c | 2 +- arch/mips/math-emu/sp_fint.c | 2 +- arch/mips/math-emu/sp_flong.c | 2 +- arch/mips/math-emu/sp_frexp.c | 2 +- arch/mips/math-emu/sp_logb.c | 2 +- arch/mips/math-emu/sp_modf.c | 2 +- arch/mips/math-emu/sp_mul.c | 2 +- arch/mips/math-emu/sp_scalb.c | 2 +- arch/mips/math-emu/sp_simple.c | 2 +- arch/mips/math-emu/sp_sqrt.c | 2 +- arch/mips/math-emu/sp_sub.c | 2 +- arch/mips/math-emu/sp_tint.c | 2 +- arch/mips/math-emu/sp_tlong.c | 2 +- arch/mips/mips-boards/atlas/atlas_int.c | 15 +- arch/mips/mips-boards/atlas/atlas_setup.c | 2 +- arch/mips/mips-boards/generic/gdb_hook.c | 1 - arch/mips/mips-boards/generic/init.c | 4 +- arch/mips/mips-boards/generic/memory.c | 2 +- arch/mips/mips-boards/generic/pci.c | 3 +- arch/mips/mips-boards/malta/malta_int.c | 29 +- arch/mips/mips-boards/malta/malta_setup.c | 44 +- arch/mips/mips-boards/sead/sead_int.c | 3 +- arch/mips/mips-boards/sead/sead_setup.c | 2 +- arch/mips/mm/Makefile | 40 +- arch/mips/mm/c-r3k.c | 4 +- arch/mips/mm/c-r4k.c | 227 +- arch/mips/mm/c-sb1.c | 42 +- arch/mips/mm/c-tx39.c | 4 +- arch/mips/mm/cache.c | 13 +- arch/mips/mm/cerr-sb1.c | 22 +- arch/mips/mm/cex-sb1.S | 1 - arch/mips/mm/highmem.c | 6 +- arch/mips/mm/init.c | 4 +- arch/mips/mm/ioremap.c | 18 +- arch/mips/mm/pg-r4k.c | 21 +- arch/mips/mm/pg-sb1.c | 257 +- arch/mips/mm/pgtable-32.c | 4 +- arch/mips/mm/pgtable-64.c | 22 - arch/mips/mm/pgtable.c | 1 + arch/mips/mm/sc-rm7k.c | 6 +- arch/mips/mm/tlb-andes.c | 25 +- arch/mips/mm/tlb-r3k.c | 6 +- arch/mips/mm/tlb-r4k.c | 33 +- arch/mips/mm/tlb-r8k.c | 7 +- arch/mips/mm/tlb-sb1.c | 32 +- arch/mips/mm/tlbex.c | 764 +- arch/mips/momentum/jaguar_atx/irq.c | 3 +- arch/mips/momentum/jaguar_atx/setup.c | 3 +- arch/mips/momentum/ocelot_3/reset.c | 3 +- arch/mips/momentum/ocelot_3/setup.c | 3 +- arch/mips/momentum/ocelot_c/dbg_io.c | 2 +- arch/mips/momentum/ocelot_c/irq.c | 14 +- arch/mips/momentum/ocelot_g/dbg_io.c | 2 +- arch/mips/momentum/ocelot_g/gt-irq.c | 5 +- arch/mips/momentum/ocelot_g/irq.c | 14 +- arch/mips/pci/Makefile | 7 +- arch/mips/pci/fixup-atlas.c | 9 +- arch/mips/pci/fixup-au1000.c | 21 +- arch/mips/pci/fixup-capcella.c | 6 + arch/mips/pci/fixup-cobalt.c | 8 +- arch/mips/pci/fixup-ddb5074.c | 2 +- arch/mips/pci/fixup-ddb5477.c | 2 +- arch/mips/pci/fixup-ev96100.c | 6 + arch/mips/pci/fixup-ip32.c | 7 +- arch/mips/pci/fixup-ite8172g.c | 6 + arch/mips/pci/fixup-ivr.c | 6 + arch/mips/pci/fixup-jaguar.c | 9 +- arch/mips/pci/fixup-jmr3927.c | 6 + arch/mips/pci/fixup-malta.c | 7 +- arch/mips/pci/fixup-mpc30x.c | 6 + arch/mips/pci/fixup-ocelot-c.c | 6 + arch/mips/pci/fixup-ocelot-g.c | 6 + arch/mips/pci/fixup-rbtx4927.c | 113 +- arch/mips/pci/fixup-sni.c | 9 +- arch/mips/pci/fixup-tb0219.c | 6 + arch/mips/pci/fixup-tb0226.c | 6 + arch/mips/pci/fixup-yosemite.c | 6 + arch/mips/pci/ops-au1000.c | 16 +- arch/mips/pci/ops-it8172.c | 3 +- arch/mips/pci/ops-msc.c | 8 +- arch/mips/pci/ops-sni.c | 4 +- arch/mips/pci/ops-titan.c | 59 +- arch/mips/pci/ops-tx3927.c | 2 +- arch/mips/pci/ops-tx4927.c | 263 +- arch/mips/pci/pci-ddb5074.c | 7 +- arch/mips/pci/pci-ddb5476.c | 7 +- arch/mips/pci/pci-ddb5477.c | 9 +- arch/mips/pci/pci-ev96100.c | 4 +- arch/mips/pci/pci-ip27.c | 322 +- arch/mips/pci/pci-ip32.c | 2 +- arch/mips/pci/pci-jmr3927.c | 2 +- arch/mips/pci/pci-lasat.c | 10 +- arch/mips/pci/pci-ocelot-c.c | 3 +- arch/mips/pci/pci-ocelot-g.c | 3 +- arch/mips/pci/pci-sb1250.c | 37 +- arch/mips/pci/pci-vr41xx.c | 4 +- arch/mips/pci/pci-vr41xx.h | 2 +- arch/mips/pci/pci-yosemite.c | 35 +- arch/mips/pci/pci.c | 12 +- arch/mips/pmc-sierra/yosemite/Makefile | 1 + .../pmc-sierra/yosemite/atmel_read_eeprom.h | 2 +- arch/mips/pmc-sierra/yosemite/dbg_io.c | 4 - arch/mips/pmc-sierra/yosemite/irq-handler.S | 57 +- arch/mips/pmc-sierra/yosemite/irq.c | 37 +- arch/mips/pmc-sierra/yosemite/prom.c | 28 +- arch/mips/pmc-sierra/yosemite/py-console.c | 46 +- arch/mips/pmc-sierra/yosemite/setup.c | 112 +- arch/mips/pmc-sierra/yosemite/setup.h | 9 +- arch/mips/pmc-sierra/yosemite/smp.c | 304 +- arch/mips/sgi-ip22/ip22-berr.c | 2 +- arch/mips/sgi-ip22/ip22-int.c | 3 +- arch/mips/sgi-ip22/ip22-nvram.c | 2 +- arch/mips/sgi-ip22/ip22-setup.c | 30 +- arch/mips/sgi-ip27/Makefile | 1 + arch/mips/sgi-ip27/ip27-hubio.c | 5 +- arch/mips/sgi-ip27/ip27-init.c | 376 +- arch/mips/sgi-ip27/ip27-irq-glue.S | 2 +- arch/mips/sgi-ip27/ip27-irq.c | 104 +- arch/mips/sgi-ip27/ip27-klnuma.c | 38 +- arch/mips/sgi-ip27/ip27-memory.c | 357 +- arch/mips/sgi-ip27/ip27-nmi.c | 11 +- arch/mips/sgi-ip27/ip27-reset.c | 5 +- arch/mips/sgi-ip27/ip27-smp.c | 22 +- arch/mips/sgi-ip27/ip27-timer.c | 5 +- arch/mips/sgi-ip32/Makefile | 2 +- arch/mips/sgi-ip32/crime.c | 38 +- arch/mips/sgi-ip32/ip32-irq.c | 71 +- arch/mips/sgi-ip32/ip32-reset.c | 20 +- arch/mips/sgi-ip32/ip32-setup.c | 14 +- arch/mips/sibyte/cfe/setup.c | 63 +- arch/mips/sibyte/cfe/smp.c | 11 +- arch/mips/sibyte/sb1250/bcm1250_tbprof.c | 108 +- arch/mips/sibyte/sb1250/bus_watcher.c | 3 +- arch/mips/sibyte/sb1250/irq.c | 104 +- arch/mips/sibyte/sb1250/irq_handler.S | 6 +- arch/mips/sibyte/sb1250/prom.c | 18 +- arch/mips/sibyte/sb1250/setup.c | 4 +- arch/mips/sibyte/sb1250/smp.c | 6 +- arch/mips/sibyte/sb1250/time.c | 23 +- arch/mips/sibyte/swarm/rtc_m41t81.c | 44 +- arch/mips/sibyte/swarm/rtc_xicor1241.c | 40 +- arch/mips/sibyte/swarm/setup.c | 7 +- arch/mips/sibyte/swarm/time.c | 42 +- arch/mips/sni/irq.c | 5 +- arch/mips/sni/setup.c | 3 +- arch/mips/tx4927/common/Makefile | 1 + arch/mips/tx4927/common/tx4927_irq.c | 128 +- arch/mips/tx4927/common/tx4927_setup.c | 11 +- .../toshiba_rbtx4927/toshiba_rbtx4927_irq.c | 17 +- .../toshiba_rbtx4927/toshiba_rbtx4927_prom.c | 9 + .../toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 241 +- arch/mips/vr4181/common/irq.c | 14 +- arch/mips/vr4181/common/time.c | 2 +- arch/mips/vr4181/osprey/setup.c | 2 +- arch/mips/vr41xx/common/bcu.c | 1 + arch/mips/vr41xx/common/giu.c | 2 +- arch/mips/vr41xx/common/icu.c | 7 +- arch/mips/vr41xx/common/ksyms.c | 2 +- arch/mips/vr41xx/common/pmu.c | 1 + arch/mips/vr41xx/common/vrc4173.c | 7 +- arch/parisc/Kconfig | 10 + arch/parisc/Makefile | 17 +- arch/parisc/configs/712_defconfig | 594 +- arch/parisc/configs/a500_defconfig | 163 +- arch/parisc/configs/b180_defconfig | 77 +- arch/parisc/configs/c3000_defconfig | 187 +- arch/parisc/configs/n4000_defconfig | 170 +- arch/parisc/hpux/entry_hpux.S | 2 +- arch/parisc/hpux/fs.c | 5 +- arch/parisc/hpux/sys_hpux.c | 89 +- arch/parisc/kernel/Makefile | 7 +- arch/parisc/kernel/asm-offsets.c | 4 + arch/parisc/kernel/binfmt_elf32.c | 6 +- arch/parisc/kernel/cache.c | 58 + arch/parisc/kernel/drivers.c | 404 +- arch/parisc/kernel/entry.S | 122 +- arch/parisc/kernel/firmware.c | 172 +- arch/parisc/kernel/head.S | 220 +- arch/parisc/kernel/inventory.c | 13 +- arch/parisc/kernel/irq.c | 706 +- arch/parisc/kernel/pacache.S | 6 +- arch/parisc/kernel/parisc_ksyms.c | 20 +- arch/parisc/kernel/pci-dma.c | 4 + arch/parisc/kernel/pdc_cons.c | 13 + arch/parisc/kernel/perf_asm.S | 854 +- arch/parisc/kernel/perf_images.h | 1 + arch/parisc/kernel/process.c | 5 +- arch/parisc/kernel/processor.c | 2 +- arch/parisc/kernel/ptrace.c | 51 +- arch/parisc/kernel/real2.S | 4 +- arch/parisc/kernel/setup.c | 2 + arch/parisc/kernel/signal.c | 31 +- arch/parisc/kernel/smp.c | 23 +- arch/parisc/kernel/sys_parisc.c | 8 + arch/parisc/kernel/sys_parisc32.c | 26 +- arch/parisc/kernel/syscall.S | 373 +- arch/parisc/kernel/syscall_table.S | 69 +- arch/parisc/kernel/time.c | 2 + arch/parisc/kernel/traps.c | 127 +- arch/parisc/kernel/unaligned.c | 185 +- arch/parisc/kernel/unwind.c | 118 +- arch/parisc/lib/Makefile | 4 +- arch/parisc/lib/bitops.c | 24 +- arch/parisc/lib/checksum.c | 44 +- arch/parisc/lib/debuglocks.c | 73 +- arch/parisc/lib/io.c | 58 +- arch/parisc/lib/lusercopy.S | 161 +- arch/parisc/lib/memcpy.c | 8 - arch/parisc/mm/fault.c | 15 +- arch/parisc/mm/init.c | 25 +- arch/parisc/mm/ioremap.c | 39 +- arch/parisc/oprofile/init.c | 4 +- arch/ppc/4xx_io/serial_sicc.c | 184 +- arch/ppc/8260_io/enet.c | 2 +- arch/ppc/8260_io/fcc_enet.c | 2 +- arch/ppc/8xx_io/Kconfig | 68 +- arch/ppc/8xx_io/Makefile | 2 +- arch/ppc/8xx_io/commproc.c | 267 +- arch/ppc/8xx_io/cs4218_tdm.c | 28 +- arch/ppc/8xx_io/enet.c | 12 +- arch/ppc/8xx_io/fec.c | 15 +- arch/ppc/8xx_io/micropatch.c | 145 +- arch/ppc/Kconfig | 121 +- arch/ppc/Kconfig.debug | 14 +- arch/ppc/Makefile | 5 +- arch/ppc/boot/common/misc-common.c | 16 +- arch/ppc/boot/common/util.S | 2 + arch/ppc/boot/lib/Makefile | 21 +- arch/ppc/boot/simple/Makefile | 28 +- arch/ppc/boot/simple/embed_config.c | 33 +- arch/ppc/boot/simple/head.S | 6 +- arch/ppc/boot/simple/misc-embedded.c | 2 +- arch/ppc/boot/simple/misc-ev64260.S | 76 +- arch/ppc/boot/simple/misc-mv64x60.S | 12 +- arch/ppc/boot/simple/misc.c | 7 +- arch/ppc/boot/simple/mpc52xx_tty.c | 1 + arch/ppc/boot/simple/mv64x60_stub.c | 12 +- arch/ppc/boot/simple/mv64x60_tty.c | 219 +- arch/ppc/boot/simple/pibs.c | 14 +- arch/ppc/boot/utils/mkbugboot.c | 2 +- arch/ppc/configs/FADS_defconfig | 24 +- arch/ppc/configs/IVMS8_defconfig | 21 +- arch/ppc/configs/SM850_defconfig | 27 +- arch/ppc/configs/SPD823TS_defconfig | 24 +- arch/ppc/configs/TQM823L_defconfig | 24 +- arch/ppc/configs/TQM850L_defconfig | 24 +- arch/ppc/configs/TQM860L_defconfig | 23 +- arch/ppc/configs/adir_defconfig | 1 - arch/ppc/configs/apus_defconfig | 1 - arch/ppc/configs/bseip_defconfig | 23 +- arch/ppc/configs/common_defconfig | 180 +- arch/ppc/configs/ev64260_defconfig | 444 +- arch/ppc/configs/ibmchrp_defconfig | 1 - arch/ppc/configs/k2_defconfig | 1 - arch/ppc/configs/mbx_defconfig | 24 +- arch/ppc/configs/menf1_defconfig | 1 - arch/ppc/configs/pcore_defconfig | 1 - arch/ppc/configs/pmac_defconfig | 1 - arch/ppc/configs/pplus_defconfig | 1 - arch/ppc/configs/rpxcllf_defconfig | 295 +- arch/ppc/configs/rpxlite_defconfig | 291 +- arch/ppc/kernel/Makefile | 5 +- arch/ppc/kernel/bitops.c | 2 +- arch/ppc/kernel/cpu_setup_6xx.S | 12 +- arch/ppc/kernel/cputable.c | 1342 +- arch/ppc/kernel/dma-mapping.c | 2 +- arch/ppc/kernel/entry.S | 42 +- arch/ppc/kernel/head_44x.S | 91 +- arch/ppc/kernel/head_4xx.S | 46 +- arch/ppc/kernel/head_8xx.S | 548 +- arch/ppc/kernel/head_booke.h | 99 + arch/ppc/kernel/head_e500.S | 110 +- arch/ppc/kernel/idle.c | 3 +- arch/ppc/kernel/irq.c | 529 +- arch/ppc/kernel/l2cr.S | 9 +- arch/ppc/kernel/misc.S | 5 +- arch/ppc/kernel/pci.c | 36 +- arch/ppc/kernel/ppc-stub.c | 20 +- arch/ppc/kernel/ppc_htab.c | 2 +- arch/ppc/kernel/ppc_ksyms.c | 13 +- arch/ppc/kernel/process.c | 32 +- arch/ppc/kernel/ptrace.c | 11 +- arch/ppc/kernel/setup.c | 6 +- arch/ppc/kernel/signal.c | 104 +- arch/ppc/kernel/smp.c | 20 +- arch/ppc/kernel/softemu8xx.c | 2 +- arch/ppc/kernel/time.c | 7 +- arch/ppc/kernel/traps.c | 50 +- arch/ppc/lib/dec_and_lock.c | 4 +- arch/ppc/lib/locks.c | 114 +- arch/ppc/lib/rheap.c | 1 + arch/ppc/lib/string.S | 6 - arch/ppc/mm/44x_mmu.c | 12 - arch/ppc/mm/fsl_booke_mmu.c | 6 +- arch/ppc/mm/init.c | 2 +- arch/ppc/mm/pgtable.c | 24 +- arch/ppc/mm/tlb.c | 2 +- arch/ppc/oprofile/Makefile | 7 +- arch/ppc/platforms/4xx/Kconfig | 38 +- arch/ppc/platforms/4xx/Makefile | 4 + arch/ppc/platforms/4xx/ebony.c | 120 +- arch/ppc/platforms/4xx/ebony.h | 4 +- arch/ppc/platforms/4xx/ibm405ep.c | 9 + arch/ppc/platforms/4xx/ibm405gp.c | 9 + arch/ppc/platforms/4xx/ibm405gpr.c | 9 + arch/ppc/platforms/4xx/ibm440gp.c | 13 + arch/ppc/platforms/4xx/ibm440gx.c | 17 + arch/ppc/platforms/4xx/ibmnp405h.h | 4 +- arch/ppc/platforms/4xx/ibmstbx25.c | 9 + arch/ppc/platforms/4xx/oak.c | 30 +- arch/ppc/platforms/4xx/ocotea.c | 61 +- arch/ppc/platforms/4xx/ocotea.h | 18 +- arch/ppc/platforms/4xx/redwood6.c | 50 +- arch/ppc/platforms/4xx/sycamore.c | 52 +- arch/ppc/platforms/85xx/Kconfig | 13 +- arch/ppc/platforms/85xx/Makefile | 6 +- arch/ppc/platforms/85xx/mpc8540_ads.c | 105 +- arch/ppc/platforms/85xx/mpc8540_ads.h | 4 - arch/ppc/platforms/85xx/mpc8555_cds.h | 2 +- arch/ppc/platforms/85xx/mpc8560_ads.c | 79 +- arch/ppc/platforms/85xx/mpc85xx_ads_common.c | 4 +- arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 103 +- arch/ppc/platforms/85xx/mpc85xx_cds_common.h | 10 +- arch/ppc/platforms/85xx/sbc8560.c | 63 +- arch/ppc/platforms/85xx/sbc85xx.c | 4 +- arch/ppc/platforms/Makefile | 7 +- arch/ppc/platforms/adir_pic.c | 20 +- arch/ppc/platforms/apus_setup.c | 2 +- arch/ppc/platforms/chrp_pci.c | 64 +- arch/ppc/platforms/chrp_setup.c | 93 +- arch/ppc/platforms/chrp_smp.c | 2 +- arch/ppc/platforms/chrp_time.c | 2 + arch/ppc/platforms/ev64260.c | 526 +- arch/ppc/platforms/ev64260.h | 101 +- arch/ppc/platforms/gemini_pci.c | 2 +- arch/ppc/platforms/k2.c | 3 +- arch/ppc/platforms/lopec.c | 3 +- arch/ppc/platforms/mcpn765.c | 7 +- arch/ppc/platforms/mvme5100.c | 2 +- arch/ppc/platforms/pal4_setup.c | 4 +- arch/ppc/platforms/pcore.c | 3 +- arch/ppc/platforms/pmac_cpufreq.c | 48 +- arch/ppc/platforms/pmac_feature.c | 238 +- arch/ppc/platforms/pmac_nvram.c | 2 +- arch/ppc/platforms/pmac_pci.c | 106 +- arch/ppc/platforms/pmac_pic.c | 42 +- arch/ppc/platforms/pmac_setup.c | 2 +- arch/ppc/platforms/pmac_sleep.S | 35 +- arch/ppc/platforms/pmac_smp.c | 9 +- arch/ppc/platforms/pplus.c | 9 +- arch/ppc/platforms/pq2ads.c | 4 +- arch/ppc/platforms/pq2ads.h | 2 + arch/ppc/platforms/prep_pci.c | 37 +- arch/ppc/platforms/prep_setup.c | 4 +- arch/ppc/platforms/prpmc750.c | 3 +- arch/ppc/platforms/rpxclassic.h | 1 - arch/ppc/platforms/rpxlite.h | 1 - arch/ppc/platforms/sandpoint.c | 135 +- arch/ppc/platforms/sbc82xx.c | 14 +- arch/ppc/platforms/tqm8xx.h | 2 - arch/ppc/syslib/Makefile | 32 +- arch/ppc/syslib/gen550_dbg.c | 10 +- arch/ppc/syslib/gen550_kgdb.c | 6 +- arch/ppc/syslib/gt64260_pic.c | 261 +- arch/ppc/syslib/i8259.c | 27 +- arch/ppc/syslib/ibm440gx_common.c | 72 +- arch/ppc/syslib/ibm440gx_common.h | 5 +- arch/ppc/syslib/ibm44x_common.c | 103 +- arch/ppc/syslib/indirect_pci.c | 33 +- arch/ppc/syslib/m8260_setup.c | 16 +- arch/ppc/syslib/m8xx_setup.c | 67 +- arch/ppc/syslib/mpc10x_common.c | 48 +- arch/ppc/syslib/mpc52xx_setup.c | 1 + arch/ppc/syslib/mv64360_pic.c | 325 +- arch/ppc/syslib/mv64x60.c | 3100 ++-- arch/ppc/syslib/open_pic.c | 70 +- arch/ppc/syslib/open_pic2.c | 2 +- arch/ppc/syslib/open_pic_defs.h | 2 +- arch/ppc/syslib/ppc405_pci.c | 4 +- arch/ppc/syslib/ppc4xx_dma.c | 90 +- arch/ppc/syslib/ppc4xx_pic.c | 661 +- arch/ppc/syslib/ppc4xx_setup.c | 67 +- arch/ppc/syslib/ppc4xx_sgdma.c | 16 +- arch/ppc/syslib/ppc85xx_common.c | 13 - arch/ppc/syslib/ppc85xx_common.h | 4 - arch/ppc/syslib/ppc85xx_setup.c | 45 +- arch/ppc/syslib/ppc85xx_setup.h | 9 - arch/ppc/syslib/ppc8xx_pic.c | 121 +- arch/ppc/syslib/prom.c | 4 +- arch/ppc/syslib/prom_init.c | 24 +- arch/ppc/syslib/qspan_pci.c | 38 +- arch/ppc/syslib/todc_time.c | 7 +- arch/ppc/syslib/xilinx_pic.c | 9 +- arch/ppc/xmon/start.c | 6 +- arch/ppc/xmon/xmon.c | 2 +- arch/ppc64/Kconfig | 63 +- arch/ppc64/Kconfig.debug | 24 +- arch/ppc64/Makefile | 9 +- arch/ppc64/boot/Makefile | 2 +- arch/ppc64/boot/main.c | 4 +- arch/ppc64/boot/string.S | 7 - arch/ppc64/configs/g5_defconfig | 1 - arch/ppc64/configs/iSeries_defconfig | 1 - arch/ppc64/configs/pSeries_defconfig | 5 +- arch/ppc64/defconfig | 1 - arch/ppc64/kernel/HvLpEvent.c | 8 + arch/ppc64/kernel/LparData.c | 199 +- arch/ppc64/kernel/Makefile | 25 +- arch/ppc64/kernel/asm-offsets.c | 27 +- arch/ppc64/kernel/binfmt_elf32.c | 6 +- arch/ppc64/kernel/bitops.c | 2 +- arch/ppc64/kernel/cpu_setup_power4.S | 9 + arch/ppc64/kernel/dma.c | 20 + arch/ppc64/kernel/eeh.c | 308 +- arch/ppc64/kernel/entry.S | 35 +- arch/ppc64/kernel/head.S | 335 +- arch/ppc64/kernel/i8259.c | 22 +- arch/ppc64/kernel/i8259.h | 4 +- arch/ppc64/kernel/iSeries_VpdInfo.c | 37 - arch/ppc64/kernel/iSeries_iommu.c | 96 +- arch/ppc64/kernel/iSeries_irq.c | 1 + arch/ppc64/kernel/iSeries_pci.c | 211 +- arch/ppc64/kernel/iSeries_pci_reset.c | 17 +- arch/ppc64/kernel/iSeries_proc.c | 4 +- arch/ppc64/kernel/iSeries_setup.c | 70 +- arch/ppc64/kernel/iSeries_smp.c | 7 +- arch/ppc64/kernel/idle.c | 28 +- arch/ppc64/kernel/iomap.c | 9 +- arch/ppc64/kernel/iommu.c | 74 +- arch/ppc64/kernel/irq.c | 523 +- arch/ppc64/kernel/lmb.c | 2 +- arch/ppc64/kernel/lparcfg.c | 46 +- arch/ppc64/kernel/maple_pci.c | 6 - arch/ppc64/kernel/maple_setup.c | 21 +- arch/ppc64/kernel/mf.c | 1120 +- arch/ppc64/kernel/misc.S | 101 +- arch/ppc64/kernel/mpic.c | 14 +- arch/ppc64/kernel/nvram.c | 15 +- arch/ppc64/kernel/pSeries_iommu.c | 327 +- arch/ppc64/kernel/pSeries_lpar.c | 107 +- arch/ppc64/kernel/pSeries_nvram.c | 2 +- arch/ppc64/kernel/pSeries_pci.c | 400 +- arch/ppc64/kernel/pSeries_setup.c | 270 +- arch/ppc64/kernel/pSeries_smp.c | 68 +- arch/ppc64/kernel/pacaData.c | 35 +- arch/ppc64/kernel/pci.c | 417 +- arch/ppc64/kernel/pci.h | 21 +- arch/ppc64/kernel/pci_dn.c | 123 +- arch/ppc64/kernel/pci_iommu.c | 7 + arch/ppc64/kernel/pmac.h | 1 - arch/ppc64/kernel/pmac_feature.c | 36 +- arch/ppc64/kernel/pmac_low_i2c.c | 46 +- arch/ppc64/kernel/pmac_nvram.c | 2 +- arch/ppc64/kernel/pmac_pci.c | 150 +- arch/ppc64/kernel/pmac_setup.c | 91 +- arch/ppc64/kernel/pmac_smp.c | 200 +- arch/ppc64/kernel/ppc_ksyms.c | 8 +- arch/ppc64/kernel/proc_ppc64.c | 74 +- arch/ppc64/kernel/process.c | 59 +- arch/ppc64/kernel/prom.c | 122 +- arch/ppc64/kernel/prom_init.c | 121 +- arch/ppc64/kernel/ptrace.c | 9 +- arch/ppc64/kernel/ptrace32.c | 2 +- arch/ppc64/kernel/ras.c | 124 +- arch/ppc64/kernel/rtas-proc.c | 15 +- arch/ppc64/kernel/rtas.c | 64 +- arch/ppc64/kernel/rtas_flash.c | 6 +- arch/ppc64/kernel/rtasd.c | 26 +- arch/ppc64/kernel/rtc.c | 25 +- arch/ppc64/kernel/setup.c | 341 +- arch/ppc64/kernel/signal.c | 51 +- arch/ppc64/kernel/signal32.c | 99 +- arch/ppc64/kernel/smp.c | 539 +- arch/ppc64/kernel/sys_ppc32.c | 46 +- arch/ppc64/kernel/syscalls.c | 40 +- arch/ppc64/kernel/sysfs.c | 136 +- arch/ppc64/kernel/time.c | 143 +- arch/ppc64/kernel/traps.c | 192 +- arch/ppc64/kernel/u3_iommu.c | 100 +- arch/ppc64/kernel/udbg.c | 125 +- arch/ppc64/kernel/vecemu.c | 2 +- arch/ppc64/kernel/vio.c | 35 +- arch/ppc64/kernel/viopath.c | 6 +- arch/ppc64/kernel/xics.c | 106 +- arch/ppc64/lib/Makefile | 1 + arch/ppc64/lib/dec_and_lock.c | 4 +- arch/ppc64/lib/locks.c | 4 +- arch/ppc64/lib/sstep.c | 4 +- arch/ppc64/mm/fault.c | 8 + arch/ppc64/mm/hash_low.S | 4 +- arch/ppc64/mm/hash_native.c | 68 +- arch/ppc64/mm/hash_utils.c | 35 +- arch/ppc64/mm/hugetlbpage.c | 439 +- arch/ppc64/mm/init.c | 40 +- arch/ppc64/mm/mmap.c | 4 +- arch/ppc64/mm/numa.c | 235 +- arch/ppc64/mm/slb.c | 10 +- arch/ppc64/mm/stab.c | 1 - arch/ppc64/mm/tlb.c | 8 +- arch/ppc64/oprofile/common.c | 34 +- arch/ppc64/oprofile/op_impl.h | 39 +- arch/ppc64/oprofile/op_model_power4.c | 49 +- arch/ppc64/oprofile/op_model_rs64.c | 5 +- arch/ppc64/xmon/start.c | 6 +- arch/ppc64/xmon/xmon.c | 264 +- arch/s390/Kconfig | 14 +- arch/s390/Makefile | 12 + arch/s390/appldata/appldata_base.c | 4 +- arch/s390/boot/Makefile | 2 +- arch/s390/defconfig | 55 +- arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/asm-offsets.c | 2 + arch/s390/kernel/binfmt_elf32.c | 41 +- arch/s390/kernel/compat_linux.c | 222 +- arch/s390/kernel/compat_linux.h | 16 +- arch/s390/kernel/compat_signal.c | 22 +- arch/s390/kernel/compat_wrapper.S | 32 +- arch/s390/kernel/cpcmd.c | 68 +- arch/s390/kernel/debug.c | 79 +- arch/s390/kernel/entry.S | 138 +- arch/s390/kernel/entry64.S | 131 +- arch/s390/kernel/irq.c | 10 +- arch/s390/kernel/module.c | 3 +- arch/s390/kernel/process.c | 9 +- arch/s390/kernel/ptrace.c | 11 +- arch/s390/kernel/s390_ksyms.c | 1 - arch/s390/kernel/setup.c | 57 +- arch/s390/kernel/smp.c | 73 +- arch/s390/kernel/sys_s390.c | 29 +- arch/s390/kernel/syscalls.S | 5 +- arch/s390/kernel/time.c | 49 +- arch/s390/kernel/traps.c | 94 +- arch/s390/kernel/vtime.c | 111 +- arch/s390/lib/string.c | 15 - arch/s390/mm/cmm.c | 12 - arch/s390/mm/extmem.c | 907 +- arch/s390/mm/init.c | 21 +- arch/s390/mm/mmap.c | 7 +- arch/s390/oprofile/init.c | 8 +- arch/sh/Kconfig | 105 +- arch/sh/Makefile | 63 +- arch/sh/boards/bigsur/irq.c | 2 +- arch/sh/boards/bigsur/setup.c | 2 +- arch/sh/boards/dreamcast/setup.c | 16 +- arch/sh/boards/harp/setup.c | 35 + arch/sh/boards/overdrive/pcidma.c | 2 +- arch/sh/boards/renesas/hs7751rvoip/io.c | 4 +- arch/sh/boards/renesas/rts7751r2d/mach.c | 4 +- arch/sh/boards/se/770x/irq.c | 31 +- arch/sh/boards/se/770x/mach.c | 2 + arch/sh/boards/se/7751/io.c | 2 +- arch/sh/boards/se/7751/pci.c | 2 +- arch/sh/cchips/voyagergx/consistent.c | 20 +- arch/sh/configs/rts7751r2d_defconfig | 445 +- arch/sh/configs/se7751_defconfig | 1 + arch/sh/drivers/dma/dma-api.c | 8 +- arch/sh/drivers/dma/dma-g2.c | 88 +- arch/sh/drivers/dma/dma-pvr2.c | 34 +- arch/sh/drivers/pci/Kconfig | 3 +- arch/sh/drivers/pci/Makefile | 2 +- arch/sh/drivers/pci/dma-dreamcast.c | 22 +- arch/sh/drivers/pci/fixups-dreamcast.c | 2 +- arch/sh/drivers/pci/fixups-rts7751r2d.c | 21 +- arch/sh/drivers/pci/ops-rts7751r2d.c | 7 +- arch/sh/drivers/pci/pci-auto.c | 2 + arch/sh/drivers/pci/pci-sh7751.c | 7 +- arch/sh/drivers/pci/pci-st40.c | 276 +- arch/sh/drivers/pci/pci-st40.h | 70 + arch/sh/drivers/pci/pci.c | 2 + arch/sh/kernel/cpu/init.c | 12 +- arch/sh/kernel/cpu/irq_imask.c | 2 +- arch/sh/kernel/cpu/irq_ipr.c | 10 +- arch/sh/kernel/cpu/sh2/Makefile | 2 + arch/sh/kernel/cpu/sh3/Makefile | 2 +- arch/sh/kernel/cpu/sh4/Makefile | 3 +- arch/sh/kernel/cpu/sh4/ex.S | 70 +- arch/sh/kernel/cpu/sh4/fpu.c | 4 +- arch/sh/kernel/cpu/sh4/irq_intc2.c | 153 +- arch/sh/kernel/cpu/sh4/sq.c | 33 +- arch/sh/kernel/early_printk.c | 4 +- arch/sh/kernel/entry.S | 6 + arch/sh/kernel/irq.c | 2 +- arch/sh/kernel/process.c | 26 +- arch/sh/kernel/ptrace.c | 10 +- arch/sh/kernel/setup.c | 3 +- arch/sh/kernel/sh_bios.c | 3 +- arch/sh/kernel/sh_ksyms.c | 16 +- arch/sh/kernel/signal.c | 36 +- arch/sh/kernel/smp.c | 4 +- arch/sh/kernel/time.c | 255 +- arch/sh/kernel/traps.c | 4 +- arch/sh/lib/Makefile | 8 +- arch/sh/lib/delay.c | 2 +- arch/sh/mm/Makefile | 2 + arch/sh/mm/cache-sh2.c | 24 +- arch/sh/mm/cache-sh3.c | 75 +- arch/sh/mm/cache-sh4.c | 129 +- arch/sh/mm/consistent.c | 4 + arch/sh/mm/extable.c | 3 +- arch/sh/mm/ioremap.c | 3 +- arch/sh/mm/tlb-sh3.c | 10 + arch/sh/oprofile/Makefile | 2 +- arch/sh/oprofile/op_model_null.c | 2 +- arch/sh/oprofile/op_model_sh7750.c | 9 +- arch/sh/ramdisk/Makefile | 5 +- arch/sh/tools/Makefile | 5 +- arch/sh/tools/mach-types | 4 + arch/sh64/Kconfig | 4 + arch/sh64/kernel/fpu.c | 4 +- arch/sh64/kernel/irq.c | 2 +- arch/sh64/kernel/irq_intc.c | 6 +- arch/sh64/kernel/pci_sh5.c | 2 +- arch/sh64/kernel/process.c | 14 +- arch/sh64/kernel/ptrace.c | 10 +- arch/sh64/kernel/signal.c | 10 +- arch/sh64/kernel/time.c | 3 + arch/sh64/lib/c-checksum.c | 8 +- arch/sh64/mm/hugetlbpage.c | 10 +- arch/sparc/Kconfig | 35 +- arch/sparc/kernel/apc.c | 8 +- arch/sparc/kernel/auxio.c | 12 +- arch/sparc/kernel/ebus.c | 6 +- arch/sparc/kernel/entry.S | 8 +- arch/sparc/kernel/idprom.c | 9 +- arch/sparc/kernel/ioport.c | 24 +- arch/sparc/kernel/irq.c | 2 +- arch/sparc/kernel/muldiv.c | 11 +- arch/sparc/kernel/pcic.c | 60 +- arch/sparc/kernel/pmc.c | 8 +- arch/sparc/kernel/process.c | 29 +- arch/sparc/kernel/ptrace.c | 14 +- arch/sparc/kernel/semaphore.c | 2 +- arch/sparc/kernel/signal.c | 19 +- arch/sparc/kernel/smp.c | 2 +- arch/sparc/kernel/sparc_ksyms.c | 6 +- arch/sparc/kernel/sun4c_irq.c | 17 +- arch/sparc/kernel/sun4d_irq.c | 2 +- arch/sparc/kernel/sun4d_smp.c | 23 +- arch/sparc/kernel/sun4m_smp.c | 3 +- arch/sparc/kernel/sys_sparc.c | 3 +- arch/sparc/kernel/sys_sunos.c | 2 +- arch/sparc/kernel/systbls.S | 3 +- arch/sparc/kernel/time.c | 12 +- arch/sparc/kernel/traps.c | 8 +- arch/sparc/lib/atomic32.c | 3 +- arch/sparc/lib/bitext.c | 20 +- arch/sparc/lib/memcpy.S | 11 +- arch/sparc/mm/fault.c | 20 +- arch/sparc/mm/generic.c | 2 +- arch/sparc/mm/highmem.c | 2 +- arch/sparc/mm/init.c | 2 - arch/sparc/mm/io-unit.c | 20 +- arch/sparc/mm/iommu.c | 45 +- arch/sparc/mm/srmmu.c | 13 +- arch/sparc/mm/sun4c.c | 4 +- arch/sparc/prom/console.c | 43 +- arch/sparc/prom/misc.c | 2 +- arch/sparc/prom/ranges.c | 2 +- arch/sparc/prom/tree.c | 5 +- arch/sparc64/Kconfig | 36 +- arch/sparc64/Makefile | 2 +- arch/sparc64/defconfig | 236 +- arch/sparc64/kernel/auxio.c | 4 +- arch/sparc64/kernel/binfmt_aout32.c | 25 +- arch/sparc64/kernel/binfmt_elf32.c | 8 +- arch/sparc64/kernel/devices.c | 2 +- arch/sparc64/kernel/entry.S | 4 +- arch/sparc64/kernel/irq.c | 2 +- arch/sparc64/kernel/isa.c | 2 +- arch/sparc64/kernel/kprobes.c | 33 +- arch/sparc64/kernel/pci.c | 4 +- arch/sparc64/kernel/pci_iommu.c | 3 +- arch/sparc64/kernel/pci_psycho.c | 8 +- arch/sparc64/kernel/pci_schizo.c | 2 +- arch/sparc64/kernel/process.c | 27 +- arch/sparc64/kernel/ptrace.c | 8 +- arch/sparc64/kernel/setup.c | 12 +- arch/sparc64/kernel/signal.c | 2 +- arch/sparc64/kernel/signal32.c | 46 +- arch/sparc64/kernel/smp.c | 18 +- arch/sparc64/kernel/sparc64_ksyms.c | 25 +- arch/sparc64/kernel/sys32.S | 6 +- arch/sparc64/kernel/sys_sparc.c | 27 +- arch/sparc64/kernel/sys_sparc32.c | 754 +- arch/sparc64/kernel/sys_sunos32.c | 14 +- arch/sparc64/kernel/systbls.S | 20 +- arch/sparc64/kernel/time.c | 17 +- arch/sparc64/kernel/trampoline.S | 85 +- arch/sparc64/kernel/traps.c | 2 +- arch/sparc64/kernel/unaligned.c | 2 +- arch/sparc64/lib/Makefile | 4 +- arch/sparc64/lib/U1memcpy.S | 3 + arch/sparc64/lib/U3memcpy.S | 3 + arch/sparc64/lib/atomic.S | 143 +- arch/sparc64/lib/bitops.S | 145 +- arch/sparc64/lib/debuglocks.c | 2 + arch/sparc64/lib/dec_and_lock.S | 4 +- arch/sparc64/lib/delay.c | 2 +- arch/sparc64/lib/find_bit.c | 7 +- arch/sparc64/lib/memmove.S | 12 +- arch/sparc64/lib/user_fixup.c | 9 +- arch/sparc64/mm/fault.c | 28 +- arch/sparc64/mm/generic.c | 44 +- arch/sparc64/mm/hugetlbpage.c | 20 +- arch/sparc64/mm/init.c | 9 +- arch/sparc64/mm/tlb.c | 4 +- arch/sparc64/oprofile/init.c | 4 +- arch/sparc64/prom/Makefile | 2 +- arch/sparc64/prom/memory.c | 10 +- arch/sparc64/prom/p1275.c | 223 +- arch/sparc64/solaris/entry64.S | 2 +- arch/sparc64/solaris/fs.c | 16 +- arch/sparc64/solaris/ioctl.c | 4 +- arch/sparc64/solaris/socksys.c | 2 +- arch/sparc64/solaris/systbl.S | 16 + arch/sparc64/solaris/timod.c | 8 +- arch/um/Kconfig | 97 +- arch/um/Kconfig_char | 17 +- arch/um/Makefile | 122 +- arch/um/Makefile-i386 | 9 +- arch/um/Makefile-os-Linux | 4 +- arch/um/Makefile-skas | 5 - arch/um/Makefile-tt | 1 - arch/um/Makefile-x86_64 | 35 + arch/um/defconfig | 186 +- arch/um/drivers/Makefile | 8 +- arch/um/drivers/chan_kern.c | 44 +- arch/um/drivers/chan_user.c | 57 +- arch/um/drivers/cow.h | 5 +- arch/um/drivers/cow_sys.h | 4 +- arch/um/drivers/cow_user.c | 8 +- arch/um/drivers/line.c | 328 +- arch/um/drivers/mconsole_kern.c | 79 +- arch/um/drivers/mmapper_kern.c | 7 +- arch/um/drivers/net_kern.c | 46 +- arch/um/drivers/net_user.c | 6 +- arch/um/drivers/port_kern.c | 1 + arch/um/drivers/port_user.c | 8 +- arch/um/drivers/pty.c | 3 +- arch/um/drivers/ssl.c | 126 +- arch/um/drivers/stdio_console.c | 150 +- arch/um/drivers/ubd_kern.c | 464 +- arch/um/drivers/ubd_user.c | 304 +- arch/um/drivers/xterm.c | 11 +- arch/um/drivers/xterm_kern.c | 10 +- arch/um/include/chan_kern.h | 10 +- arch/um/include/chan_user.h | 5 +- arch/um/include/frame_kern.h | 10 +- arch/um/include/init.h | 34 +- arch/um/include/irq_user.h | 2 +- arch/um/include/kern_util.h | 5 +- arch/um/include/line.h | 17 +- arch/um/include/mem_user.h | 1 + arch/um/include/mode.h | 4 +- arch/um/include/mode_kern.h | 4 +- arch/um/include/net_kern.h | 1 + arch/um/include/os.h | 1 + arch/um/include/process.h | 2 +- arch/um/include/ptrace_user.h | 42 + arch/um/include/syscall_user.h | 2 +- arch/um/include/sysdep-i386/checksum.h | 20 +- arch/um/include/sysdep-i386/ptrace.h | 48 +- arch/um/include/sysdep-i386/ptrace_user.h | 3 + arch/um/include/sysdep-i386/syscalls.h | 71 +- arch/um/include/sysdep-ppc/syscalls.h | 7 +- arch/um/include/sysdep-x86_64/syscalls.h | 5 + arch/um/include/ubd_user.h | 59 +- arch/um/include/um_mmu.h | 4 +- arch/um/include/um_uaccess.h | 18 +- arch/um/include/uml_uaccess.h | 2 +- arch/um/include/user_util.h | 2 +- arch/um/kernel/Makefile | 2 +- arch/um/kernel/checksum.c | 16 +- arch/um/kernel/dyn.lds.S | 5 + arch/um/kernel/exec_kern.c | 20 +- arch/um/kernel/exitcode.c | 2 +- arch/um/kernel/helper.c | 58 +- arch/um/kernel/initrd_user.c | 2 + arch/um/kernel/irq.c | 664 +- arch/um/kernel/irq_user.c | 9 +- arch/um/kernel/ksyms.c | 1 + arch/um/kernel/main.c | 40 +- arch/um/kernel/mem.c | 58 +- arch/um/kernel/mem_user.c | 61 +- arch/um/kernel/physmem.c | 7 +- arch/um/kernel/process.c | 197 +- arch/um/kernel/process_kern.c | 100 +- arch/um/kernel/ptrace.c | 80 +- arch/um/kernel/sigio_kern.c | 6 +- arch/um/kernel/signal_kern.c | 222 +- arch/um/kernel/signal_user.c | 6 +- arch/um/kernel/skas/Makefile | 11 +- arch/um/kernel/skas/exec_kern.c | 2 +- arch/um/kernel/skas/include/mode-skas.h | 5 - arch/um/kernel/skas/include/skas.h | 4 - arch/um/kernel/skas/include/uaccess-skas.h | 7 +- arch/um/kernel/skas/mem.c | 5 + arch/um/kernel/skas/process.c | 138 +- arch/um/kernel/skas/process_kern.c | 73 +- arch/um/kernel/skas/syscall_kern.c | 1 + arch/um/kernel/skas/syscall_user.c | 11 +- arch/um/kernel/skas/tlb.c | 150 +- arch/um/kernel/skas/trap_user.c | 9 +- arch/um/kernel/skas/uaccess.c | 49 +- arch/um/kernel/skas/util/Makefile | 2 + arch/um/kernel/smp.c | 8 +- arch/um/kernel/sys_call_table.c | 447 +- arch/um/kernel/syscall_kern.c | 145 +- arch/um/kernel/syscall_user.c | 4 +- arch/um/kernel/sysrq.c | 66 +- arch/um/kernel/time.c | 3 + arch/um/kernel/time_kern.c | 33 +- arch/um/kernel/tlb.c | 16 +- arch/um/kernel/trap_kern.c | 12 +- arch/um/kernel/trap_user.c | 23 - arch/um/kernel/tt/Makefile | 13 +- arch/um/kernel/tt/exec_user.c | 7 +- arch/um/kernel/tt/gdb.c | 8 +- arch/um/kernel/tt/include/mode-tt.h | 3 - arch/um/kernel/tt/include/tt.h | 5 +- arch/um/kernel/tt/process_kern.c | 24 +- arch/um/kernel/tt/ptproxy/proxy.c | 8 +- arch/um/kernel/tt/ptproxy/sysdep.c | 1 - arch/um/kernel/tt/ptproxy/wait.c | 1 - arch/um/kernel/tt/syscall_kern.c | 99 - arch/um/kernel/tt/syscall_user.c | 37 +- arch/um/kernel/tt/tlb.c | 160 +- arch/um/kernel/tt/tracer.c | 67 +- arch/um/kernel/tt/trap_user.c | 1 - arch/um/kernel/tt/uaccess.c | 12 +- arch/um/kernel/tty_log.c | 2 + arch/um/kernel/um_arch.c | 32 +- arch/um/kernel/umid.c | 20 +- arch/um/kernel/uml.lds.S | 12 +- arch/um/os-Linux/Makefile | 8 +- arch/um/os-Linux/file.c | 3 +- arch/um/os-Linux/process.c | 19 + arch/um/os-Linux/user_syms.c | 5 + arch/um/sys-i386/Makefile | 4 +- arch/um/sys-i386/ldt.c | 14 +- arch/um/sys-i386/ptrace.c | 30 +- arch/um/sys-i386/ptrace_user.c | 19 +- arch/um/sys-i386/sigcontext.c | 17 +- arch/um/sys-i386/syscalls.c | 134 +- arch/um/sys-i386/sysrq.c | 5 + arch/v850/Kconfig | 3 + arch/v850/kernel/fpga85e2c.c | 3 +- arch/v850/kernel/memcons.c | 5 +- arch/v850/kernel/ptrace.c | 10 +- arch/v850/kernel/rte_cb_leds.c | 2 +- arch/v850/kernel/rte_mb_a_pci.c | 6 +- arch/v850/kernel/semaphore.c | 2 +- arch/v850/kernel/signal.c | 14 +- arch/v850/kernel/sim85e2.c | 2 - arch/v850/kernel/simcons.c | 2 +- arch/v850/kernel/time.c | 3 + arch/v850/kernel/vmlinux.lds.S | 5 + arch/v850/lib/checksum.c | 4 +- arch/v850/lib/memcpy.c | 5 - arch/x86_64/Kconfig | 77 +- arch/x86_64/Kconfig.debug | 22 +- arch/x86_64/Makefile | 2 + arch/x86_64/boot/Makefile | 1 + arch/x86_64/boot/compressed/Makefile | 2 +- arch/x86_64/boot/setup.S | 4 +- arch/x86_64/boot/video.S | 4 +- arch/x86_64/defconfig | 171 +- arch/x86_64/ia32/fpu32.c | 7 +- arch/x86_64/ia32/ia32_aout.c | 24 +- arch/x86_64/ia32/ia32_binfmt.c | 33 +- arch/x86_64/ia32/ia32_signal.c | 38 +- arch/x86_64/ia32/ia32entry.S | 46 +- arch/x86_64/ia32/ipc32.c | 2 +- arch/x86_64/ia32/ptrace32.c | 7 +- arch/x86_64/ia32/sys_ia32.c | 350 +- arch/x86_64/ia32/syscall32.c | 33 +- arch/x86_64/kernel/Makefile | 16 +- arch/x86_64/kernel/acpi/sleep.c | 8 +- arch/x86_64/kernel/acpi/wakeup.S | 3 - arch/x86_64/kernel/aperture.c | 14 +- arch/x86_64/kernel/apic.c | 75 +- arch/x86_64/kernel/asm-offsets.c | 5 +- arch/x86_64/kernel/cpufreq/Kconfig | 56 +- arch/x86_64/kernel/cpufreq/Makefile | 8 +- arch/x86_64/kernel/early_printk.c | 5 +- arch/x86_64/kernel/entry.S | 6 +- arch/x86_64/kernel/genapic.c | 7 + arch/x86_64/kernel/head.S | 15 +- arch/x86_64/kernel/head64.c | 19 +- arch/x86_64/kernel/i387.c | 15 +- arch/x86_64/kernel/i8259.c | 6 +- arch/x86_64/kernel/init_task.c | 2 - arch/x86_64/kernel/io_apic.c | 154 +- arch/x86_64/kernel/irq.c | 837 +- arch/x86_64/kernel/kprobes.c | 16 +- arch/x86_64/kernel/mce.c | 41 +- arch/x86_64/kernel/module.c | 1 - arch/x86_64/kernel/mpparse.c | 25 +- arch/x86_64/kernel/nmi.c | 72 +- arch/x86_64/kernel/pci-gart.c | 25 +- arch/x86_64/kernel/process.c | 53 +- arch/x86_64/kernel/ptrace.c | 6 +- arch/x86_64/kernel/reboot.c | 72 +- arch/x86_64/kernel/setup.c | 384 +- arch/x86_64/kernel/setup64.c | 123 +- arch/x86_64/kernel/signal.c | 21 +- arch/x86_64/kernel/smp.c | 120 +- arch/x86_64/kernel/smpboot.c | 12 +- arch/x86_64/kernel/suspend_asm.S | 59 +- arch/x86_64/kernel/time.c | 180 +- arch/x86_64/kernel/traps.c | 88 +- arch/x86_64/kernel/vmlinux.lds.S | 35 +- arch/x86_64/kernel/vsyscall.c | 15 +- arch/x86_64/kernel/x8664_ksyms.c | 5 +- arch/x86_64/lib/bitops.c | 2 +- arch/x86_64/lib/bitstr.c | 2 +- arch/x86_64/lib/copy_user.S | 16 +- arch/x86_64/lib/csum-wrappers.c | 6 +- arch/x86_64/lib/dec_and_lock.c | 2 +- arch/x86_64/lib/delay.c | 2 +- arch/x86_64/lib/io.c | 16 +- arch/x86_64/mm/Makefile | 1 + arch/x86_64/mm/fault.c | 125 +- arch/x86_64/mm/init.c | 160 +- arch/x86_64/mm/ioremap.c | 130 +- arch/x86_64/mm/k8topology.c | 31 +- arch/x86_64/mm/numa.c | 63 +- arch/x86_64/mm/pageattr.c | 102 +- arch/x86_64/oprofile/Makefile | 2 +- arch/x86_64/pci/mmconfig.c | 10 +- crypto/Kconfig | 35 +- crypto/Makefile | 1 + crypto/blowfish.c | 2 +- crypto/serpent.c | 105 +- crypto/sha256.c | 10 +- crypto/sha512.c | 33 +- crypto/tcrypt.c | 27 +- crypto/tcrypt.h | 392 +- drivers/Kconfig | 4 + drivers/Makefile | 8 +- drivers/acorn/block/fd1772.c | 4 +- drivers/acorn/block/mfmhd.c | 2 +- drivers/acpi/Kconfig | 54 +- drivers/acpi/Makefile | 11 +- drivers/acpi/ac.c | 8 +- drivers/acpi/asus_acpi.c | 22 +- drivers/acpi/battery.c | 205 +- drivers/acpi/bus.c | 28 +- drivers/acpi/button.c | 8 +- drivers/acpi/debug.c | 10 +- drivers/acpi/dispatcher/dsfield.c | 2 +- drivers/acpi/dispatcher/dsinit.c | 2 +- drivers/acpi/dispatcher/dsmethod.c | 2 +- drivers/acpi/dispatcher/dsmthdat.c | 26 +- drivers/acpi/dispatcher/dsobject.c | 4 +- drivers/acpi/dispatcher/dsopcode.c | 7 +- drivers/acpi/dispatcher/dsutils.c | 14 +- drivers/acpi/dispatcher/dswexec.c | 78 +- drivers/acpi/dispatcher/dswload.c | 24 +- drivers/acpi/dispatcher/dswscope.c | 2 +- drivers/acpi/dispatcher/dswstate.c | 15 +- drivers/acpi/ec.c | 202 +- drivers/acpi/event.c | 2 +- drivers/acpi/events/evevent.c | 2 +- drivers/acpi/events/evgpe.c | 37 +- drivers/acpi/events/evgpeblk.c | 8 +- drivers/acpi/events/evmisc.c | 2 +- drivers/acpi/events/evregion.c | 2 +- drivers/acpi/events/evrgnini.c | 2 +- drivers/acpi/events/evsci.c | 2 +- drivers/acpi/events/evxface.c | 58 +- drivers/acpi/events/evxfevnt.c | 14 +- drivers/acpi/events/evxfregn.c | 6 +- drivers/acpi/executer/exconfig.c | 4 +- drivers/acpi/executer/exconvrt.c | 398 +- drivers/acpi/executer/excreate.c | 2 +- drivers/acpi/executer/exdump.c | 228 +- drivers/acpi/executer/exfield.c | 2 +- drivers/acpi/executer/exfldio.c | 546 +- drivers/acpi/executer/exmisc.c | 469 +- drivers/acpi/executer/exmutex.c | 2 +- drivers/acpi/executer/exnames.c | 2 +- drivers/acpi/executer/exoparg1.c | 239 +- drivers/acpi/executer/exoparg2.c | 146 +- drivers/acpi/executer/exoparg3.c | 6 +- drivers/acpi/executer/exoparg6.c | 137 +- drivers/acpi/executer/exprep.c | 27 +- drivers/acpi/executer/exregion.c | 4 +- drivers/acpi/executer/exresnte.c | 2 +- drivers/acpi/executer/exresolv.c | 62 +- drivers/acpi/executer/exresop.c | 59 +- drivers/acpi/executer/exstore.c | 101 +- drivers/acpi/executer/exstoren.c | 22 +- drivers/acpi/executer/exstorob.c | 29 +- drivers/acpi/executer/exsystem.c | 7 +- drivers/acpi/executer/exutils.c | 20 +- drivers/acpi/fan.c | 50 +- drivers/acpi/hardware/Makefile | 4 +- drivers/acpi/hardware/hwacpi.c | 2 +- drivers/acpi/hardware/hwgpe.c | 5 +- drivers/acpi/hardware/hwregs.c | 40 +- drivers/acpi/hardware/hwsleep.c | 25 +- drivers/acpi/hardware/hwtimer.c | 26 +- drivers/acpi/ibm_acpi.c | 2 +- drivers/acpi/motherboard.c | 4 +- drivers/acpi/namespace/Makefile | 4 +- drivers/acpi/namespace/nsaccess.c | 27 +- drivers/acpi/namespace/nsalloc.c | 10 +- drivers/acpi/namespace/nsdump.c | 67 +- drivers/acpi/namespace/nsdumpdv.c | 13 +- drivers/acpi/namespace/nseval.c | 94 +- drivers/acpi/namespace/nsinit.c | 35 +- drivers/acpi/namespace/nsload.c | 17 +- drivers/acpi/namespace/nsnames.c | 11 +- drivers/acpi/namespace/nsobject.c | 2 +- drivers/acpi/namespace/nsparse.c | 2 +- drivers/acpi/namespace/nssearch.c | 51 +- drivers/acpi/namespace/nsutils.c | 58 +- drivers/acpi/namespace/nswalk.c | 6 +- drivers/acpi/namespace/nsxfeval.c | 9 +- drivers/acpi/namespace/nsxfname.c | 57 +- drivers/acpi/namespace/nsxfobj.c | 7 +- drivers/acpi/numa.c | 28 +- drivers/acpi/osl.c | 82 +- drivers/acpi/parser/psargs.c | 2 +- drivers/acpi/parser/psopcode.c | 33 +- drivers/acpi/parser/psparse.c | 191 +- drivers/acpi/parser/psscope.c | 2 +- drivers/acpi/parser/pstree.c | 6 +- drivers/acpi/parser/psutils.c | 31 +- drivers/acpi/parser/pswalk.c | 2 +- drivers/acpi/parser/psxface.c | 2 +- drivers/acpi/pci_bind.c | 92 +- drivers/acpi/pci_irq.c | 154 +- drivers/acpi/pci_link.c | 115 +- drivers/acpi/pci_root.c | 2 + drivers/acpi/power.c | 16 +- drivers/acpi/resources/Makefile | 4 +- drivers/acpi/resources/rsaddr.c | 2 +- drivers/acpi/resources/rscalc.c | 114 +- drivers/acpi/resources/rscreate.c | 2 +- drivers/acpi/resources/rsdump.c | 2 +- drivers/acpi/resources/rsio.c | 2 +- drivers/acpi/resources/rsirq.c | 2 +- drivers/acpi/resources/rslist.c | 2 +- drivers/acpi/resources/rsmemory.c | 2 +- drivers/acpi/resources/rsmisc.c | 2 +- drivers/acpi/resources/rsutils.c | 12 +- drivers/acpi/resources/rsxface.c | 12 +- drivers/acpi/scan.c | 305 +- drivers/acpi/sleep/Makefile | 4 +- drivers/acpi/sleep/main.c | 13 +- drivers/acpi/sleep/poweroff.c | 2 + drivers/acpi/sleep/proc.c | 80 +- drivers/acpi/sleep/sleep.h | 1 + drivers/acpi/sleep/wakeup.c | 32 +- drivers/acpi/system.c | 45 +- drivers/acpi/tables/tbconvrt.c | 62 +- drivers/acpi/tables/tbget.c | 5 +- drivers/acpi/tables/tbgetall.c | 2 +- drivers/acpi/tables/tbinstal.c | 5 +- drivers/acpi/tables/tbrsdt.c | 3 +- drivers/acpi/tables/tbutils.c | 5 +- drivers/acpi/tables/tbxface.c | 9 +- drivers/acpi/tables/tbxfroot.c | 94 +- drivers/acpi/thermal.c | 51 +- drivers/acpi/toshiba_acpi.c | 4 +- drivers/acpi/utilities/utalloc.c | 51 +- drivers/acpi/utilities/utcopy.c | 29 +- drivers/acpi/utilities/utdebug.c | 9 +- drivers/acpi/utilities/utdelete.c | 11 +- drivers/acpi/utilities/uteval.c | 18 +- drivers/acpi/utilities/utglobal.c | 19 +- drivers/acpi/utilities/utinit.c | 2 +- drivers/acpi/utilities/utmath.c | 45 +- drivers/acpi/utilities/utmisc.c | 165 +- drivers/acpi/utilities/utobject.c | 64 +- drivers/acpi/utilities/utxface.c | 10 +- drivers/acpi/utils.c | 22 +- drivers/acpi/video.c | 15 +- drivers/atm/Makefile | 2 +- drivers/atm/ambassador.c | 254 +- drivers/atm/ambassador.h | 2 +- drivers/atm/atmtcp.c | 48 +- drivers/atm/eni.c | 21 +- drivers/atm/firestream.c | 81 +- drivers/atm/fore200e.c | 90 +- drivers/atm/fore200e.h | 32 +- drivers/atm/he.c | 103 +- drivers/atm/he.h | 43 - drivers/atm/horizon.c | 356 +- drivers/atm/horizon.h | 2 +- drivers/atm/idt77105.c | 4 +- drivers/atm/idt77105.h | 1 - drivers/atm/idt77252.c | 42 +- drivers/atm/idt77252.h | 2 +- drivers/atm/iphase.c | 137 +- drivers/atm/iphase.h | 28 +- drivers/atm/lanai.c | 8 +- drivers/atm/nicstar.c | 3 +- drivers/atm/nicstarmac.c | 11 +- drivers/atm/suni.c | 2 +- drivers/atm/zatm.c | 129 +- drivers/base/Kconfig | 4 +- drivers/base/Makefile | 3 +- drivers/base/bus.c | 202 +- drivers/base/class.c | 92 +- drivers/base/class_simple.c | 4 +- drivers/base/core.c | 54 +- drivers/base/cpu.c | 18 +- drivers/base/driver.c | 16 +- drivers/base/firmware.c | 4 +- drivers/base/firmware_class.c | 16 +- drivers/base/init.c | 3 +- drivers/base/node.c | 22 +- drivers/base/platform.c | 70 +- drivers/base/power/main.c | 13 +- drivers/base/power/power.h | 11 +- drivers/base/power/resume.c | 20 +- drivers/base/power/runtime.c | 4 +- drivers/base/power/suspend.c | 56 +- drivers/base/sys.c | 16 +- drivers/block/DAC960.c | 5 +- drivers/block/Kconfig | 162 +- drivers/block/Kconfig.iosched | 13 +- drivers/block/Makefile | 2 + drivers/block/acsi.c | 2 +- drivers/block/amiflop.c | 6 +- drivers/block/as-iosched.c | 122 +- drivers/block/ataflop.c | 2 +- drivers/block/cciss.c | 239 +- drivers/block/cciss_scsi.c | 72 +- drivers/block/cciss_scsi.h | 2 +- drivers/block/cfq-iosched.c | 1512 +- drivers/block/cpqarray.c | 22 +- drivers/block/cpqarray.h | 2 +- drivers/block/deadline-iosched.c | 142 +- drivers/block/elevator.c | 386 +- drivers/block/floppy.c | 48 +- drivers/block/genhd.c | 94 +- drivers/block/ida_cmd.h | 2 +- drivers/block/ida_ioctl.h | 2 +- drivers/block/ioctl.c | 17 + drivers/block/ll_rw_blk.c | 538 +- drivers/block/loop.c | 37 +- drivers/block/nbd.c | 4 +- drivers/block/noop-iosched.c | 62 +- drivers/block/paride/Kconfig | 2 +- drivers/block/paride/bpck6.c | 2 +- drivers/block/paride/paride.c | 6 +- drivers/block/paride/paride.h | 2 - drivers/block/paride/pcd.c | 16 +- drivers/block/paride/pd.c | 20 +- drivers/block/paride/pf.c | 18 +- drivers/block/paride/pg.c | 16 +- drivers/block/paride/pseudo.h | 2 +- drivers/block/paride/pt.c | 14 +- drivers/block/pktcdvd.c | 14 +- drivers/block/ps2esdi.c | 10 +- drivers/block/rd.c | 23 +- drivers/block/scsi_ioctl.c | 27 +- drivers/block/smart1,2.h | 2 +- drivers/block/swim3.c | 52 +- drivers/block/swim_iop.c | 2 +- drivers/block/sx8.c | 3 +- drivers/block/ub.c | 481 +- drivers/block/umem.c | 6 +- drivers/block/viodasd.c | 4 +- drivers/block/xd.c | 28 +- drivers/block/z2ram.c | 4 +- drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/Makefile | 1 + drivers/bluetooth/bcm203x.c | 11 +- drivers/bluetooth/bfusb.c | 14 +- drivers/bluetooth/bluecard_cs.c | 51 +- drivers/bluetooth/bt3c_cs.c | 67 +- drivers/bluetooth/btuart_cs.c | 52 +- drivers/bluetooth/dtl1_cs.c | 50 +- drivers/bluetooth/hci_bcsp.c | 4 +- drivers/bluetooth/hci_ldisc.c | 17 +- drivers/bluetooth/hci_usb.c | 89 +- drivers/bluetooth/hci_usb.h | 11 +- drivers/bluetooth/hci_vhci.c | 4 +- drivers/cdrom/Kconfig | 4 +- drivers/cdrom/Makefile | 1 + drivers/cdrom/aztcd.c | 9 +- drivers/cdrom/cdrom.c | 130 +- drivers/cdrom/cdu31a.c | 402 +- drivers/cdrom/cdu31a.h | 4 +- drivers/cdrom/cm206.c | 2 +- drivers/cdrom/gscd.c | 5 +- drivers/cdrom/isp16.c | 18 +- drivers/cdrom/isp16.h | 2 - drivers/cdrom/mcd.c | 14 +- drivers/cdrom/mcdx.c | 18 +- drivers/cdrom/optcd.c | 4 +- drivers/cdrom/sbpcd.c | 11 +- drivers/cdrom/sjcd.c | 4 +- drivers/cdrom/sonycd535.c | 4 +- drivers/cdrom/viocd.c | 59 +- drivers/char/Kconfig | 40 +- drivers/char/Makefile | 3 +- drivers/char/agp/Kconfig | 5 +- drivers/char/agp/agp.h | 10 - drivers/char/agp/ali-agp.c | 11 + drivers/char/agp/alpha-agp.c | 2 + drivers/char/agp/amd-k7-agp.c | 33 +- drivers/char/agp/amd64-agp.c | 92 +- drivers/char/agp/ati-agp.c | 22 +- drivers/char/agp/backend.c | 15 - drivers/char/agp/efficeon-agp.c | 7 +- drivers/char/agp/frontend.c | 8 +- drivers/char/agp/generic.c | 49 +- drivers/char/agp/hp-agp.c | 53 +- drivers/char/agp/i460-agp.c | 8 +- drivers/char/agp/intel-agp.c | 216 +- drivers/char/agp/intel-mch-agp.c | 88 +- drivers/char/agp/isoch.c | 2 +- drivers/char/agp/nvidia-agp.c | 6 +- drivers/char/agp/sis-agp.c | 12 +- drivers/char/agp/sworks-agp.c | 28 +- drivers/char/agp/uninorth-agp.c | 2 + drivers/char/agp/via-agp.c | 6 +- drivers/char/amiserial.c | 91 +- drivers/char/applicom.c | 13 +- drivers/char/consolemap.c | 4 +- drivers/char/cp437.uni | 2 +- drivers/char/cyclades.c | 101 +- drivers/char/drm/Kconfig | 5 +- drivers/char/drm/Makefile | 7 + drivers/char/drm/drmP.h | 347 +- drivers/char/drm/drm_core.h | 28 +- drivers/char/drm/drm_memory.h | 180 +- drivers/char/drm/drm_memory_debug.h | 4 +- drivers/char/drm/drm_os_linux.h | 8 - drivers/char/drm/drm_pciids.h | 128 +- drivers/char/drm/ffb_drv.c | 99 +- drivers/char/drm/ffb_drv.h | 2 +- drivers/char/drm/gamma_dma.c | 12 +- drivers/char/drm/gamma_lists.h | 6 +- drivers/char/drm/i810_dma.c | 139 +- drivers/char/drm/i810_drm.h | 46 +- drivers/char/drm/i810_drv.c | 89 +- drivers/char/drm/i810_drv.h | 37 +- drivers/char/drm/i830_dma.c | 114 +- drivers/char/drm/i830_drm.h | 43 +- drivers/char/drm/i830_drv.c | 98 +- drivers/char/drm/i830_drv.h | 35 +- drivers/char/drm/i830_irq.c | 6 +- drivers/char/drm/i915_dma.c | 92 +- drivers/char/drm/i915_drm.h | 37 +- drivers/char/drm/i915_drv.c | 91 +- drivers/char/drm/i915_drv.h | 24 + drivers/char/drm/i915_irq.c | 6 +- drivers/char/drm/i915_mem.c | 21 +- drivers/char/drm/mga_dma.c | 34 +- drivers/char/drm/mga_drv.c | 93 +- drivers/char/drm/mga_drv.h | 15 + drivers/char/drm/mga_irq.c | 3 +- drivers/char/drm/mga_state.c | 15 +- drivers/char/drm/mga_warp.c | 1 - drivers/char/drm/r128_cce.c | 17 +- drivers/char/drm/r128_drv.c | 88 +- drivers/char/drm/r128_drv.h | 23 +- drivers/char/drm/r128_irq.c | 3 +- drivers/char/drm/r128_state.c | 122 +- drivers/char/drm/radeon_cp.c | 395 +- drivers/char/drm/radeon_drm.h | 32 +- drivers/char/drm/radeon_drv.c | 92 +- drivers/char/drm/radeon_drv.h | 167 +- drivers/char/drm/radeon_irq.c | 11 +- drivers/char/drm/radeon_mem.c | 29 +- drivers/char/drm/radeon_state.c | 602 +- drivers/char/drm/sis_drm.h | 21 +- drivers/char/drm/sis_drv.c | 80 +- drivers/char/drm/sis_drv.h | 14 + drivers/char/drm/sis_ds.c | 21 +- drivers/char/drm/sis_ds.h | 8 +- drivers/char/drm/sis_mm.c | 23 +- drivers/char/drm/tdfx_drv.c | 72 +- drivers/char/ds1286.c | 2 +- drivers/char/dtlk.c | 23 +- drivers/char/ec3104_keyb.c | 4 +- drivers/char/efirtc.c | 2 +- drivers/char/epca.c | 178 +- drivers/char/epca.h | 2 +- drivers/char/esp.c | 97 +- .../char/ftape/compressor/zftape-compress.c | 10 +- drivers/char/ftape/lowlevel/fc-10.c | 4 +- drivers/char/ftape/lowlevel/fdc-io.c | 69 +- drivers/char/ftape/lowlevel/fdc-io.h | 5 - drivers/char/ftape/lowlevel/ftape-bsm.c | 8 +- drivers/char/ftape/lowlevel/ftape-bsm.h | 1 - drivers/char/ftape/lowlevel/ftape-ctl.c | 22 +- drivers/char/ftape/lowlevel/ftape-ctl.h | 1 - drivers/char/ftape/lowlevel/ftape-init.c | 43 +- drivers/char/ftape/lowlevel/ftape-io.c | 44 +- drivers/char/ftape/lowlevel/ftape-io.h | 4 - drivers/char/ftape/lowlevel/ftape-proc.c | 4 +- drivers/char/ftape/lowlevel/ftape-rw.c | 2 +- drivers/char/ftape/lowlevel/ftape-rw.h | 1 - drivers/char/ftape/zftape/zftape-buffers.c | 11 +- drivers/char/ftape/zftape/zftape-buffers.h | 1 - drivers/char/ftape/zftape/zftape-init.c | 20 +- drivers/char/ftape/zftape/zftape-init.h | 1 - drivers/char/ftape/zftape/zftape-rw.c | 1 - drivers/char/ftape/zftape/zftape-rw.h | 1 - drivers/char/ftape/zftape/zftape-vtbl.c | 4 +- drivers/char/ftape/zftape/zftape-vtbl.h | 1 - drivers/char/ftape/zftape/zftape_syms.c | 1 - drivers/char/generic_serial.c | 146 +- drivers/char/genrtc.c | 4 +- drivers/char/hpet.c | 103 +- drivers/char/hvc_console.c | 102 +- drivers/char/hvcs.c | 35 +- drivers/char/hvsi.c | 143 +- drivers/char/hw_random.c | 41 +- drivers/char/i8k.c | 65 +- drivers/char/ip2.c | 6 +- drivers/char/ip2/fip_firm.h | 2 +- drivers/char/ip2/i2cmd.c | 59 +- drivers/char/ip2/i2cmd.h | 17 - drivers/char/ip2/i2lib.c | 2 +- drivers/char/ip2main.c | 10 +- drivers/char/ipmi/Kconfig | 2 +- drivers/char/ipmi/ipmi_msghandler.c | 125 +- drivers/char/ipmi/ipmi_poweroff.c | 18 +- drivers/char/ipmi/ipmi_si_intf.c | 112 +- drivers/char/ipmi/ipmi_watchdog.c | 49 +- drivers/char/isicom.c | 868 +- drivers/char/istallion.c | 66 +- drivers/char/ite_gpio.c | 22 +- drivers/char/keyboard.c | 31 +- drivers/char/lcd.c | 90 +- drivers/char/lcd.h | 2 + drivers/char/lp.c | 8 +- drivers/char/mem.c | 19 +- drivers/char/misc.c | 14 +- drivers/char/mmtimer.c | 541 +- drivers/char/moxa.c | 137 +- drivers/char/mwave/3780i.c | 4 +- drivers/char/mwave/mwavedd.c | 10 +- drivers/char/mxser.c | 2768 ++-- drivers/char/n_hdlc.c | 32 +- drivers/char/n_r3964.c | 15 +- drivers/char/n_tty.c | 42 +- drivers/char/nvram.c | 2 +- drivers/char/nwflash.c | 2 +- drivers/char/pcmcia/synclink_cs.c | 97 +- drivers/char/pcxx.c | 55 +- drivers/char/pty.c | 57 +- drivers/char/qtronix.c | 9 +- drivers/char/random.c | 932 +- drivers/char/rio/func.h | 21 - drivers/char/rio/rio_linux.c | 46 +- drivers/char/rio/rioboot.c | 8 +- drivers/char/rio/riocmd.c | 58 +- drivers/char/rio/rioctrl.c | 35 +- drivers/char/rio/rioinit.c | 59 +- drivers/char/rio/riointr.c | 166 +- drivers/char/rio/rioroute.c | 18 +- drivers/char/rio/riotable.c | 19 +- drivers/char/rio/riotty.c | 17 +- drivers/char/riscom8.c | 66 +- drivers/char/rocket.c | 84 +- drivers/char/rtc.c | 4 +- drivers/char/s3c2410-rtc.c | 2 +- drivers/char/scx200_gpio.c | 2 +- drivers/char/selection.c | 47 +- drivers/char/serial167.c | 92 +- drivers/char/snsc.c | 26 +- drivers/char/sonypi.c | 1323 +- drivers/char/specialix.c | 68 +- drivers/char/stallion.c | 48 +- drivers/char/sx.c | 81 +- drivers/char/sx.h | 4 +- drivers/char/synclink.c | 450 +- drivers/char/synclinkmp.c | 60 +- drivers/char/sysrq.c | 62 +- drivers/char/tipar.c | 55 +- drivers/char/toshiba.c | 4 +- drivers/char/tpqic02.c | 3 +- drivers/char/tty_io.c | 184 +- drivers/char/tty_ioctl.c | 6 +- drivers/char/vc_screen.c | 60 +- drivers/char/viocons.c | 188 +- drivers/char/viotape.c | 2 +- drivers/char/vt.c | 491 +- drivers/char/vt_ioctl.c | 2 +- drivers/char/watchdog/Kconfig | 35 + drivers/char/watchdog/Makefile | 1 + drivers/char/watchdog/alim7101_wdt.c | 46 +- drivers/char/watchdog/i8xx_tco.c | 49 +- drivers/char/watchdog/ixp2000_wdt.c | 2 +- drivers/char/watchdog/ixp4xx_wdt.c | 4 +- drivers/char/watchdog/machzwd.c | 29 - drivers/char/watchdog/pcwd_usb.c | 8 +- drivers/char/watchdog/sc520_wdt.c | 2 +- drivers/char/watchdog/scx200_wdt.c | 12 +- drivers/cpufreq/Kconfig | 75 +- drivers/cpufreq/Makefile | 3 +- drivers/cpufreq/cpufreq.c | 320 +- drivers/cpufreq/cpufreq_ondemand.c | 132 +- drivers/cpufreq/cpufreq_performance.c | 4 + drivers/cpufreq/cpufreq_powersave.c | 3 + drivers/cpufreq/cpufreq_userspace.c | 427 +- drivers/cpufreq/freq_table.c | 28 +- drivers/cpufreq/proc_intf.c | 263 - drivers/dio/Makefile | 2 +- drivers/dio/dio.c | 321 +- drivers/eisa/Makefile | 3 - drivers/eisa/eisa-bus.c | 4 +- drivers/fc4/soc.c | 10 +- drivers/fc4/soc.h | 2 +- drivers/fc4/socal.c | 12 +- drivers/fc4/socal.h | 2 +- drivers/firmware/Kconfig | 10 +- drivers/firmware/edd.c | 8 +- drivers/firmware/efivars.c | 4 +- drivers/firmware/pcdp.c | 177 +- drivers/i2c/algos/Kconfig | 13 + drivers/i2c/algos/Makefile | 2 + drivers/i2c/algos/i2c-algo-bit.c | 4 +- drivers/i2c/algos/i2c-algo-ite.c | 8 - drivers/i2c/algos/i2c-algo-pca.c | 8 +- drivers/i2c/algos/i2c-algo-pcf.c | 4 +- drivers/i2c/busses/Kconfig | 82 +- drivers/i2c/busses/Makefile | 5 + drivers/i2c/busses/i2c-ali1535.c | 15 +- drivers/i2c/busses/i2c-ali1563.c | 19 +- drivers/i2c/busses/i2c-ali15x3.c | 11 +- drivers/i2c/busses/i2c-amd756.c | 75 +- drivers/i2c/busses/i2c-amd8111.c | 18 +- drivers/i2c/busses/i2c-elektor.c | 36 +- drivers/i2c/busses/i2c-hydra.c | 11 +- drivers/i2c/busses/i2c-i801.c | 62 +- drivers/i2c/busses/i2c-i810.c | 6 +- drivers/i2c/busses/i2c-ibm_iic.c | 52 +- drivers/i2c/busses/i2c-ibm_iic.h | 2 +- drivers/i2c/busses/i2c-iop3xx.c | 547 +- drivers/i2c/busses/i2c-iop3xx.h | 103 +- drivers/i2c/busses/i2c-ite.c | 31 +- drivers/i2c/busses/i2c-keywest.c | 8 +- drivers/i2c/busses/i2c-keywest.h | 6 +- drivers/i2c/busses/i2c-mpc.c | 168 +- drivers/i2c/busses/i2c-nforce2.c | 24 +- drivers/i2c/busses/i2c-piix4.c | 58 +- drivers/i2c/busses/i2c-prosavage.c | 21 +- drivers/i2c/busses/i2c-savage4.c | 6 +- drivers/i2c/busses/i2c-sis5595.c | 19 +- drivers/i2c/busses/i2c-sis630.c | 4 +- drivers/i2c/busses/i2c-sis96x.c | 16 +- drivers/i2c/busses/i2c-stub.c | 22 +- drivers/i2c/busses/i2c-via.c | 4 +- drivers/i2c/busses/i2c-viapro.c | 109 +- drivers/i2c/busses/i2c-voodoo3.c | 6 +- drivers/i2c/busses/scx200_acb.c | 20 +- drivers/i2c/busses/scx200_i2c.c | 4 +- drivers/i2c/chips/Kconfig | 60 + drivers/i2c/chips/Makefile | 5 + drivers/i2c/chips/adm1021.c | 11 +- drivers/i2c/chips/adm1025.c | 20 +- drivers/i2c/chips/adm1026.c | 11 +- drivers/i2c/chips/adm1031.c | 52 +- drivers/i2c/chips/asb100.c | 22 +- drivers/i2c/chips/ds1621.c | 19 +- drivers/i2c/chips/eeprom.c | 74 +- drivers/i2c/chips/fscher.c | 15 +- drivers/i2c/chips/gl518sm.c | 10 +- drivers/i2c/chips/isp1301_omap.c | 9 +- drivers/i2c/chips/it87.c | 278 +- drivers/i2c/chips/lm63.c | 4 +- drivers/i2c/chips/lm75.c | 7 +- drivers/i2c/chips/lm77.c | 6 +- drivers/i2c/chips/lm78.c | 49 +- drivers/i2c/chips/lm80.c | 12 +- drivers/i2c/chips/lm83.c | 30 +- drivers/i2c/chips/lm85.c | 580 +- drivers/i2c/chips/lm90.c | 75 +- drivers/i2c/chips/max1619.c | 13 +- drivers/i2c/chips/pc87360.c | 52 +- drivers/i2c/chips/pcf8574.c | 8 +- drivers/i2c/chips/pcf8591.c | 7 +- drivers/i2c/chips/smsc47m1.c | 89 +- drivers/i2c/chips/via686a.c | 70 +- drivers/i2c/chips/w83627hf.c | 69 +- drivers/i2c/chips/w83781d.c | 105 +- drivers/i2c/chips/w83l785ts.c | 11 +- drivers/i2c/i2c-core.c | 106 +- drivers/i2c/i2c-dev.c | 4 +- drivers/i2c/i2c-sensor-detect.c | 79 +- drivers/i2c/i2c-sensor-vid.c | 5 +- drivers/ide/Kconfig | 37 +- drivers/ide/Makefile | 1 + drivers/ide/arm/icside.c | 469 +- drivers/ide/arm/rapide.c | 85 +- drivers/ide/cris/ide-v10.c | 19 +- drivers/ide/ide-cd.c | 220 +- drivers/ide/ide-cd.h | 6 +- drivers/ide/ide-default.c | 3 +- drivers/ide/ide-disk.c | 652 +- drivers/ide/ide-dma.c | 269 +- drivers/ide/ide-floppy.c | 61 +- drivers/ide/ide-io.c | 317 +- drivers/ide/ide-iops.c | 79 +- drivers/ide/ide-lib.c | 153 +- drivers/ide/ide-pnp.c | 2 +- drivers/ide/ide-probe.c | 106 +- drivers/ide/ide-proc.c | 302 +- drivers/ide/ide-tape.c | 14 +- drivers/ide/ide-taskfile.c | 224 +- drivers/ide/ide.c | 299 +- drivers/ide/legacy/Makefile | 1 - drivers/ide/legacy/ali14xx.c | 2 + drivers/ide/legacy/dtc2278.c | 2 + drivers/ide/legacy/hd.c | 10 +- drivers/ide/legacy/ht6560b.c | 2 + drivers/ide/legacy/ide-cs.c | 24 +- drivers/ide/legacy/qd65xx.c | 9 +- drivers/ide/legacy/qd65xx.h | 2 +- drivers/ide/legacy/umc8672.c | 2 + drivers/ide/pci/Makefile | 1 - drivers/ide/pci/aec62xx.c | 253 +- drivers/ide/pci/alim15x3.c | 31 +- drivers/ide/pci/amd74xx.c | 13 +- drivers/ide/pci/atiixp.c | 159 +- drivers/ide/pci/cmd64x.c | 121 +- drivers/ide/pci/cs5520.c | 80 +- drivers/ide/pci/cs5530.c | 62 +- drivers/ide/pci/cy82c693.c | 78 +- drivers/ide/pci/generic.c | 107 +- drivers/ide/pci/hpt34x.c | 58 +- drivers/ide/pci/hpt366.c | 602 +- drivers/ide/pci/it8172.c | 57 +- drivers/ide/pci/ns87415.c | 104 +- drivers/ide/pci/opti621.c | 26 +- drivers/ide/pci/pdc202xx_new.c | 290 +- drivers/ide/pci/pdc202xx_old.c | 321 +- drivers/ide/pci/piix.c | 250 +- drivers/ide/pci/rz1000.c | 5 +- drivers/ide/pci/sc1200.c | 72 +- drivers/ide/pci/serverworks.c | 286 +- drivers/ide/pci/sgiioc4.c | 124 +- drivers/ide/pci/siimage.c | 101 +- drivers/ide/pci/sis5513.c | 37 +- drivers/ide/pci/sl82c105.c | 11 +- drivers/ide/pci/slc90e66.c | 149 +- drivers/ide/pci/triflex.c | 29 +- drivers/ide/pci/trm290.c | 102 +- drivers/ide/pci/via82cxxx.c | 14 +- drivers/ide/ppc/pmac.c | 214 +- drivers/ide/setup-pci.c | 198 +- drivers/ieee1394/amdtp.c | 42 +- drivers/ieee1394/csr.c | 2 +- drivers/ieee1394/dv1394.c | 101 +- drivers/ieee1394/eth1394.c | 100 +- drivers/ieee1394/highlevel.c | 4 +- drivers/ieee1394/nodemgr.c | 18 +- drivers/ieee1394/ohci1394.c | 12 +- drivers/ieee1394/pcilynx.c | 12 +- drivers/ieee1394/pcilynx.h | 8 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 13 +- drivers/ieee1394/sbp2.h | 18 +- drivers/ieee1394/video1394.c | 118 +- drivers/input/Kconfig | 2 +- drivers/input/evdev.c | 4 +- drivers/input/gameport/Kconfig | 2 +- drivers/input/gameport/cs461x.c | 20 +- drivers/input/gameport/fm801-gp.c | 2 +- drivers/input/input.c | 15 +- drivers/input/joydev.c | 4 +- drivers/input/joystick/amijoy.c | 3 +- drivers/input/joystick/analog.c | 2 +- drivers/input/joystick/db9.c | 6 +- drivers/input/joystick/gamecon.c | 12 +- drivers/input/joystick/iforce/Kconfig | 3 +- drivers/input/joystick/iforce/iforce-main.c | 16 +- drivers/input/joystick/magellan.c | 1 + drivers/input/joystick/sidewinder.c | 2 +- drivers/input/joystick/spaceball.c | 1 + drivers/input/joystick/spaceorb.c | 1 + drivers/input/joystick/stinger.c | 1 + drivers/input/joystick/turbografx.c | 6 +- drivers/input/joystick/twidjoy.c | 1 + drivers/input/joystick/warrior.c | 1 + drivers/input/keyboard/Kconfig | 1 + drivers/input/keyboard/atkbd.c | 719 +- drivers/input/keyboard/lkkbd.c | 7 +- drivers/input/keyboard/newtonkbd.c | 1 + drivers/input/keyboard/sunkbd.c | 1 + drivers/input/keyboard/xtkbd.c | 1 + drivers/input/misc/Kconfig | 1 - drivers/input/misc/pcspkr.c | 2 +- drivers/input/misc/sparcspkr.c | 2 +- drivers/input/mouse/Kconfig | 13 +- drivers/input/mouse/Makefile | 2 +- drivers/input/mouse/logips2pp.c | 186 +- drivers/input/mouse/logips2pp.h | 2 - drivers/input/mouse/pc110pad.c | 15 + drivers/input/mouse/psmouse-base.c | 604 +- drivers/input/mouse/psmouse.h | 65 +- drivers/input/mouse/sermouse.c | 25 +- drivers/input/mouse/synaptics.c | 88 +- drivers/input/mouse/synaptics.h | 5 +- drivers/input/mouse/vsxxxaa.c | 56 +- drivers/input/mousedev.c | 22 +- drivers/input/serio/Kconfig | 12 +- drivers/input/serio/Makefile | 1 + drivers/input/serio/ambakmi.c | 2 +- drivers/input/serio/gscps2.c | 13 - drivers/input/serio/i8042-io.h | 56 +- drivers/input/serio/i8042.c | 166 +- drivers/input/serio/i8042.h | 12 +- drivers/input/serio/maceps2.c | 26 +- drivers/input/serio/parkbd.c | 19 +- drivers/input/serio/q40kbd.c | 4 +- drivers/input/serio/rpckbd.c | 58 +- drivers/input/serio/sa1111ps2.c | 4 +- drivers/input/serio/serio.c | 33 +- drivers/input/serio/serport.c | 5 +- drivers/input/touchscreen/h3600_ts_input.c | 5 +- drivers/input/tsdev.c | 10 +- drivers/isdn/act2000/act2000_isa.c | 11 +- drivers/isdn/act2000/module.c | 8 +- drivers/isdn/capi/capi.c | 30 +- drivers/isdn/capi/capidrv.c | 17 +- drivers/isdn/capi/capifs.c | 1 + drivers/isdn/capi/kcapi.c | 39 +- drivers/isdn/divert/divert_init.c | 19 +- drivers/isdn/divert/divert_procfs.c | 22 +- drivers/isdn/divert/isdn_divert.c | 101 +- drivers/isdn/divert/isdn_divert.h | 2 + drivers/isdn/hardware/avm/Kconfig | 12 +- drivers/isdn/hardware/avm/avm_cs.c | 30 +- drivers/isdn/hardware/avm/avmcard.h | 2 +- drivers/isdn/hardware/avm/b1pcmcia.c | 1 - drivers/isdn/hardware/avm/c4.c | 9 +- drivers/isdn/hardware/eicon/capifunc.c | 52 +- drivers/isdn/hardware/eicon/dadapter.c | 6 +- drivers/isdn/hardware/eicon/dadapter.h | 7 +- drivers/isdn/hardware/eicon/di.c | 226 +- drivers/isdn/hardware/eicon/di.h | 5 - drivers/isdn/hardware/eicon/diva_didd.c | 6 +- drivers/isdn/hardware/eicon/diva_pci.h | 4 +- drivers/isdn/hardware/eicon/divamnt.c | 13 +- drivers/isdn/hardware/eicon/divasi.c | 5 +- drivers/isdn/hardware/eicon/divasmain.c | 30 +- drivers/isdn/hardware/eicon/divasproc.c | 3 +- drivers/isdn/hardware/eicon/io.c | 105 +- drivers/isdn/hardware/eicon/io.h | 25 +- drivers/isdn/hardware/eicon/maintidi.c | 10 +- drivers/isdn/hardware/eicon/message.c | 917 +- drivers/isdn/hardware/eicon/mntfunc.c | 6 +- drivers/isdn/hardware/eicon/os_4bri.c | 44 +- drivers/isdn/hardware/eicon/os_bri.c | 23 +- drivers/isdn/hardware/eicon/os_pri.c | 61 +- drivers/isdn/hardware/eicon/platform.h | 40 +- drivers/isdn/hardware/eicon/s_4bri.c | 563 +- drivers/isdn/hardware/eicon/s_bri.c | 369 +- drivers/isdn/hardware/eicon/s_pri.c | 396 +- drivers/isdn/hardware/eicon/xdi_adapter.h | 2 +- drivers/isdn/hardware/eicon/xdi_vers.h | 52 +- drivers/isdn/hisax/amd7930_fn.c | 4 +- drivers/isdn/hisax/avm_a1p.c | 2 +- drivers/isdn/hisax/avm_pci.c | 4 +- drivers/isdn/hisax/avma1_cs.c | 29 +- drivers/isdn/hisax/config.c | 21 +- drivers/isdn/hisax/elsa.c | 3 +- drivers/isdn/hisax/elsa_cs.c | 29 +- drivers/isdn/hisax/hfc_pci.c | 3 +- drivers/isdn/hisax/hfc_sx.c | 6 +- drivers/isdn/hisax/hfc_usb.c | 15 +- drivers/isdn/hisax/hfcscard.c | 3 +- drivers/isdn/hisax/hisax.h | 6 +- drivers/isdn/hisax/hisax_fcpcipnp.c | 20 +- drivers/isdn/hisax/hisax_isac.c | 2 +- drivers/isdn/hisax/icc.c | 2 +- drivers/isdn/hisax/icc.h | 2 +- drivers/isdn/hisax/isdnhdlc.c | 2 +- drivers/isdn/hisax/isurf.c | 5 +- drivers/isdn/hisax/sedlbauer_cs.c | 33 +- drivers/isdn/hisax/st5481_b.c | 2 +- drivers/isdn/hisax/st5481_d.c | 2 +- drivers/isdn/hisax/st5481_init.c | 9 +- drivers/isdn/hisax/st5481_usb.c | 4 +- drivers/isdn/hisax/teles0.c | 31 +- drivers/isdn/hisax/teles_cs.c | 29 +- drivers/isdn/hisax/telespci.c | 22 +- drivers/isdn/hysdn/boardergo.c | 7 +- drivers/isdn/hysdn/hycapi.c | 3 - drivers/isdn/hysdn/hysdn_sched.c | 7 +- drivers/isdn/i4l/Kconfig | 4 +- drivers/isdn/i4l/isdn_bsdcomp.c | 4 +- drivers/isdn/i4l/isdn_net.h | 7 +- drivers/isdn/i4l/isdn_tty.c | 49 +- drivers/isdn/i4l/isdn_x25iface.c | 16 +- drivers/isdn/icn/icn.c | 23 +- drivers/isdn/icn/icn.h | 5 +- drivers/isdn/isdnloop/isdnloop.c | 3 + drivers/isdn/pcbit/drv.c | 16 +- drivers/isdn/pcbit/module.c | 5 +- drivers/isdn/pcbit/pcbit.h | 6 +- drivers/isdn/sc/card.h | 7 +- drivers/isdn/sc/hardware.h | 3 - drivers/isdn/sc/init.c | 19 +- drivers/isdn/tpam/Kconfig | 2 +- drivers/isdn/tpam/tpam.h | 25 +- drivers/isdn/tpam/tpam_commands.c | 78 +- drivers/isdn/tpam/tpam_main.c | 26 +- drivers/isdn/tpam/tpam_memory.c | 38 +- drivers/isdn/tpam/tpam_nco.c | 34 +- drivers/isdn/tpam/tpam_queues.c | 49 +- drivers/macintosh/adb.c | 2 +- drivers/macintosh/adbhid.c | 2 +- drivers/macintosh/ans-lcd.c | 8 +- drivers/macintosh/macio-adb.c | 9 +- drivers/macintosh/macserial.c | 61 +- drivers/macintosh/mediabay.c | 25 +- drivers/macintosh/therm_adt746x.c | 282 +- drivers/macintosh/therm_pm72.c | 577 +- drivers/macintosh/therm_pm72.h | 50 +- drivers/macintosh/therm_windtunnel.c | 8 +- drivers/macintosh/via-cuda.c | 6 +- drivers/macintosh/via-pmu.c | 94 +- drivers/mca/mca-bus.c | 2 +- drivers/mca/mca-legacy.c | 59 - drivers/mca/mca-proc.c | 4 +- drivers/md/Kconfig | 11 +- drivers/md/Makefile | 31 + drivers/md/dm-crypt.c | 322 +- drivers/md/dm-io.c | 18 +- drivers/md/dm-ioctl.c | 120 +- drivers/md/dm-log.c | 30 +- drivers/md/dm-log.h | 2 +- drivers/md/dm-raid1.c | 19 +- drivers/md/dm-stripe.c | 9 +- drivers/md/dm-table.c | 39 +- drivers/md/dm-target.c | 5 +- drivers/md/dm.c | 99 +- drivers/md/dm.h | 31 +- drivers/md/kcopyd.c | 4 +- drivers/md/linear.c | 71 +- drivers/md/md.c | 222 +- drivers/md/multipath.c | 97 +- drivers/md/raid0.c | 13 +- drivers/md/raid1.c | 106 +- drivers/md/raid10.c | 103 +- drivers/md/raid5.c | 211 +- drivers/md/raid6algos.c | 10 + drivers/md/raid6main.c | 218 +- drivers/media/Kconfig | 18 +- drivers/media/common/ir-common.c | 13 +- drivers/media/common/saa7146_core.c | 201 +- drivers/media/common/saa7146_fops.c | 80 +- drivers/media/common/saa7146_hlp.c | 38 +- drivers/media/common/saa7146_i2c.c | 10 +- drivers/media/common/saa7146_vbi.c | 29 +- drivers/media/common/saa7146_video.c | 46 +- drivers/media/dvb/Kconfig | 20 +- drivers/media/dvb/Makefile | 3 +- drivers/media/dvb/b2c2/Kconfig | 22 +- drivers/media/dvb/b2c2/Makefile | 5 +- drivers/media/dvb/b2c2/b2c2-usb-core.c | 16 +- drivers/media/dvb/b2c2/skystar2.c | 745 +- drivers/media/dvb/bt8xx/Kconfig | 8 +- drivers/media/dvb/bt8xx/Makefile | 2 +- drivers/media/dvb/bt8xx/bt878.c | 55 +- drivers/media/dvb/bt8xx/bt878.h | 13 +- drivers/media/dvb/bt8xx/dvb-bt8xx.c | 729 +- drivers/media/dvb/bt8xx/dvb-bt8xx.h | 17 +- drivers/media/dvb/cinergyT2/cinergyT2.c | 8 +- drivers/media/dvb/dibusb/Kconfig | 12 +- drivers/media/dvb/dibusb/Makefile | 8 + drivers/media/dvb/dibusb/dvb-dibusb.h | 486 +- drivers/media/dvb/dvb-core/Makefile | 4 +- drivers/media/dvb/dvb-core/dmxdev.c | 21 +- drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 535 +- drivers/media/dvb/dvb-core/dvb_ca_en50221.h | 8 +- drivers/media/dvb/dvb-core/dvb_demux.c | 81 +- drivers/media/dvb/dvb-core/dvb_demux.h | 1 + drivers/media/dvb/dvb-core/dvb_filter.c | 14 +- drivers/media/dvb/dvb-core/dvb_frontend.c | 1098 +- drivers/media/dvb/dvb-core/dvb_frontend.h | 157 +- drivers/media/dvb/dvb-core/dvb_net.c | 530 +- drivers/media/dvb/dvb-core/dvbdev.c | 139 +- drivers/media/dvb/dvb-core/dvbdev.h | 12 + drivers/media/dvb/frontends/Kconfig | 233 +- drivers/media/dvb/frontends/Makefile | 18 +- drivers/media/dvb/frontends/at76c651.c | 498 +- drivers/media/dvb/frontends/cx22700.c | 2 +- drivers/media/dvb/frontends/cx24110.c | 625 +- drivers/media/dvb/frontends/dib3000-common.c | 64 +- drivers/media/dvb/frontends/dib3000-common.h | 38 +- drivers/media/dvb/frontends/dib3000.h | 21 +- drivers/media/dvb/frontends/dib3000mb.c | 52 +- drivers/media/dvb/frontends/dib3000mc.c | 531 +- drivers/media/dvb/frontends/dib3000mc_priv.h | 57 +- drivers/media/dvb/frontends/dvb_dummy_fe.c | 322 +- drivers/media/dvb/frontends/mt312.c | 699 +- drivers/media/dvb/frontends/mt312.h | 159 +- drivers/media/dvb/frontends/mt352.c | 24 +- drivers/media/dvb/frontends/mt352.h | 1 + drivers/media/dvb/frontends/nxt6000.c | 628 +- drivers/media/dvb/frontends/nxt6000.h | 285 +- drivers/media/dvb/frontends/sp8870.c | 3 +- drivers/media/dvb/frontends/sp887x.c | 617 +- drivers/media/dvb/frontends/stv0297.c | 94 +- drivers/media/dvb/frontends/stv0297.h | 3 + drivers/media/dvb/frontends/stv0299.c | 1365 +- drivers/media/dvb/frontends/tda10021.c | 2 +- drivers/media/dvb/frontends/tda10021.h | 2 +- drivers/media/dvb/frontends/tda1004x.c | 1746 +- drivers/media/dvb/frontends/tda80xx.c | 2 +- drivers/media/dvb/frontends/ves1820.c | 672 +- drivers/media/dvb/frontends/ves1x93.c | 592 +- drivers/media/dvb/ttpci/Kconfig | 26 +- drivers/media/dvb/ttpci/Makefile | 2 +- drivers/media/dvb/ttpci/av7110.c | 1633 +- drivers/media/dvb/ttpci/av7110.h | 63 +- drivers/media/dvb/ttpci/av7110_av.c | 73 +- drivers/media/dvb/ttpci/av7110_ca.c | 34 +- drivers/media/dvb/ttpci/av7110_hw.c | 544 +- drivers/media/dvb/ttpci/av7110_hw.h | 31 +- drivers/media/dvb/ttpci/av7110_ir.c | 17 +- drivers/media/dvb/ttpci/av7110_v4l.c | 210 +- drivers/media/dvb/ttpci/budget-av.c | 764 +- drivers/media/dvb/ttpci/budget-ci.c | 641 +- drivers/media/dvb/ttpci/budget-core.c | 188 +- drivers/media/dvb/ttpci/budget-patch.c | 590 +- drivers/media/dvb/ttpci/budget.c | 407 +- drivers/media/dvb/ttpci/budget.h | 36 +- drivers/media/dvb/ttpci/ttpci-eeprom.c | 23 +- drivers/media/dvb/ttpci/ttpci-eeprom.h | 5 +- drivers/media/dvb/ttusb-budget/Kconfig | 4 + drivers/media/dvb/ttusb-budget/Makefile | 2 +- .../media/dvb/ttusb-budget/dvb-ttusb-budget.c | 469 +- .../dvb/ttusb-budget/dvb-ttusb-dspbootcode.h | 2 +- drivers/media/dvb/ttusb-dec/Kconfig | 8 +- drivers/media/dvb/ttusb-dec/Makefile | 2 +- drivers/media/dvb/ttusb-dec/ttusb_dec.c | 374 +- drivers/media/radio/miropcm20-radio.c | 2 +- drivers/media/radio/radio-aimslab.c | 8 +- drivers/media/radio/radio-aztech.c | 4 +- drivers/media/radio/radio-cadet.c | 8 +- drivers/media/radio/radio-gemtek-pci.c | 6 +- drivers/media/radio/radio-gemtek.c | 6 +- drivers/media/radio/radio-maestro.c | 6 +- drivers/media/radio/radio-maxiradio.c | 6 +- drivers/media/radio/radio-rtrack2.c | 4 +- drivers/media/radio/radio-sf16fmi.c | 4 +- drivers/media/radio/radio-sf16fmr2.c | 4 +- drivers/media/radio/radio-terratec.c | 6 +- drivers/media/radio/radio-trust.c | 4 +- drivers/media/radio/radio-typhoon.c | 12 +- drivers/media/radio/radio-zoltrix.c | 8 +- drivers/media/video/Kconfig | 57 +- drivers/media/video/Makefile | 6 + drivers/media/video/adv7170.c | 4 +- drivers/media/video/adv7175.c | 4 +- drivers/media/video/arv.c | 2 +- drivers/media/video/bt819.c | 6 +- drivers/media/video/bt848.h | 10 +- drivers/media/video/bt856.c | 2 +- drivers/media/video/btcx-risc.c | 9 +- drivers/media/video/btcx-risc.h | 4 +- drivers/media/video/bttv-cards.c | 716 +- drivers/media/video/bttv-driver.c | 381 +- drivers/media/video/bttv-gpio.c | 14 +- drivers/media/video/bttv-i2c.c | 107 +- drivers/media/video/bttv-if.c | 26 +- drivers/media/video/bttv-risc.c | 66 +- drivers/media/video/bttv-vbi.c | 50 +- drivers/media/video/bttv.h | 28 +- drivers/media/video/bttvp.h | 46 +- drivers/media/video/bw-qcam.c | 33 +- drivers/media/video/c-qcam.c | 19 +- drivers/media/video/cpia.c | 48 +- drivers/media/video/cpia_pp.c | 2 +- drivers/media/video/cx88/Makefile | 12 +- drivers/media/video/cx88/cx88-cards.c | 389 +- drivers/media/video/cx88/cx88-core.c | 743 +- drivers/media/video/cx88/cx88-i2c.c | 171 +- drivers/media/video/cx88/cx88-mpeg.c | 2 +- drivers/media/video/cx88/cx88-reg.h | 80 +- drivers/media/video/cx88/cx88-tvaudio.c | 196 +- drivers/media/video/cx88/cx88-vbi.c | 64 +- drivers/media/video/cx88/cx88-video.c | 992 +- drivers/media/video/cx88/cx88.h | 297 +- drivers/media/video/dpc7146.c | 19 +- drivers/media/video/hexium_gemini.c | 11 +- drivers/media/video/hexium_orion.c | 15 +- drivers/media/video/ir-kbd-gpio.c | 107 +- drivers/media/video/ir-kbd-i2c.c | 57 +- drivers/media/video/meye.c | 1629 +- drivers/media/video/meye.h | 57 +- drivers/media/video/msp3400.c | 1068 +- drivers/media/video/msp3400.h | 22 + drivers/media/video/mxb.c | 23 +- drivers/media/video/mxb.h | 2 +- .../media/video/ovcamchip/ovcamchip_core.c | 7 +- drivers/media/video/planb.c | 9 +- drivers/media/video/pms.c | 24 +- drivers/media/video/saa5246a.c | 49 + drivers/media/video/saa5246a.h | 2 +- drivers/media/video/saa5249.c | 57 +- drivers/media/video/saa7110.c | 35 +- drivers/media/video/saa7111.c | 4 +- drivers/media/video/saa7114.c | 4 +- drivers/media/video/saa7134/Makefile | 6 +- drivers/media/video/saa7134/saa6752hs.c | 100 +- drivers/media/video/saa7134/saa7134-cards.c | 271 +- drivers/media/video/saa7134/saa7134-core.c | 336 +- drivers/media/video/saa7134/saa7134-i2c.c | 43 +- drivers/media/video/saa7134/saa7134-input.c | 69 +- drivers/media/video/saa7134/saa7134-oss.c | 26 +- drivers/media/video/saa7134/saa7134-reg.h | 2 + drivers/media/video/saa7134/saa7134-ts.c | 362 +- drivers/media/video/saa7134/saa7134-tvaudio.c | 78 +- drivers/media/video/saa7134/saa7134-vbi.c | 37 +- drivers/media/video/saa7134/saa7134-video.c | 172 +- drivers/media/video/saa7134/saa7134.h | 96 +- drivers/media/video/saa7146.h | 6 +- drivers/media/video/saa7185.c | 4 +- drivers/media/video/stradis.c | 9 +- drivers/media/video/tda7432.c | 96 +- drivers/media/video/tda9840.c | 305 +- drivers/media/video/tda9875.c | 40 +- drivers/media/video/tda9887.c | 101 +- drivers/media/video/tea6415c.c | 227 +- drivers/media/video/tea6420.c | 171 +- drivers/media/video/tuner-3036.c | 6 +- drivers/media/video/tuner.c | 283 +- drivers/media/video/tvaudio.c | 165 +- drivers/media/video/tvaudio.h | 2 +- drivers/media/video/tvmixer.c | 13 +- drivers/media/video/v4l1-compat.c | 38 +- drivers/media/video/v4l2-common.c | 16 +- drivers/media/video/video-buf-dvb.c | 11 +- drivers/media/video/video-buf.c | 180 +- drivers/media/video/videocodec.c | 7 +- drivers/media/video/videocodec.h | 11 + drivers/media/video/vino.c | 434 +- drivers/media/video/vino.h | 182 +- drivers/media/video/vpx3220.c | 2 +- drivers/media/video/w9966.c | 12 +- drivers/media/video/zoran.h | 6 +- drivers/media/video/zoran_card.c | 27 +- drivers/media/video/zoran_device.c | 58 +- drivers/media/video/zoran_device.h | 1 - drivers/media/video/zoran_driver.c | 116 +- drivers/media/video/zr36016.c | 2 +- drivers/media/video/zr36050.c | 96 +- drivers/media/video/zr36050.h | 6 + drivers/media/video/zr36060.c | 100 +- drivers/media/video/zr36060.h | 6 + drivers/media/video/zr36120.c | 33 +- drivers/message/fusion/Kconfig | 2 +- drivers/message/fusion/mptbase.c | 239 +- drivers/message/fusion/mptbase.h | 192 +- drivers/message/fusion/mptctl.c | 8 +- drivers/message/fusion/mptlan.c | 6 +- drivers/message/fusion/mptscsih.c | 753 +- drivers/message/fusion/mptscsih.h | 11 +- drivers/message/i2o/debug.c | 292 +- drivers/message/i2o/device.c | 72 +- drivers/message/i2o/driver.c | 59 +- drivers/message/i2o/exec-osm.c | 84 +- drivers/message/i2o/i2o_block.c | 303 +- drivers/message/i2o/i2o_config.c | 196 +- drivers/message/i2o/i2o_proc.c | 71 +- drivers/message/i2o/i2o_scsi.c | 204 +- drivers/message/i2o/iop.c | 187 +- drivers/message/i2o/pci.c | 69 +- drivers/misc/Kconfig | 2 +- drivers/misc/ibmasm/ibmasm.h | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 18 +- drivers/misc/ibmasm/lowlevel.c | 2 +- drivers/misc/ibmasm/lowlevel.h | 30 +- drivers/misc/ibmasm/module.c | 18 +- drivers/misc/ibmasm/uart.c | 2 +- drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mmc.c | 7 +- drivers/mmc/mmc_block.c | 16 +- drivers/mmc/mmc_queue.c | 24 +- drivers/mmc/mmc_queue.h | 1 + drivers/mmc/mmci.c | 17 +- drivers/mmc/mmci.h | 10 +- drivers/mmc/pxamci.c | 116 +- drivers/mmc/pxamci.h | 30 + drivers/mmc/wbsd.c | 261 +- drivers/mmc/wbsd.h | 13 +- drivers/mtd/Kconfig | 23 +- drivers/mtd/chips/Kconfig | 20 +- drivers/mtd/chips/amd_flash.c | 4 +- drivers/mtd/chips/cfi_cmdset_0001.c | 818 +- drivers/mtd/chips/cfi_cmdset_0002.c | 536 +- drivers/mtd/chips/cfi_cmdset_0020.c | 10 +- drivers/mtd/chips/cfi_probe.c | 152 +- drivers/mtd/chips/cfi_util.c | 134 +- drivers/mtd/chips/chipreg.c | 4 +- drivers/mtd/chips/gen_probe.c | 12 +- drivers/mtd/chips/jedec.c | 16 +- drivers/mtd/chips/jedec_probe.c | 240 +- drivers/mtd/chips/map_absent.c | 4 +- drivers/mtd/chips/map_ram.c | 10 +- drivers/mtd/chips/map_rom.c | 10 +- drivers/mtd/cmdlinepart.c | 6 +- drivers/mtd/devices/Kconfig | 26 +- drivers/mtd/devices/Makefile | 3 +- drivers/mtd/devices/blkmtd.c | 21 +- drivers/mtd/devices/doc2000.c | 72 +- drivers/mtd/devices/doc2001.c | 52 +- drivers/mtd/devices/doc2001plus.c | 68 +- drivers/mtd/devices/docprobe.c | 20 +- drivers/mtd/devices/ms02-nv.c | 8 +- drivers/mtd/devices/mtdram.c | 16 +- drivers/mtd/devices/phram.c | 160 +- drivers/mtd/devices/pmc551.c | 23 +- drivers/mtd/devices/slram.c | 46 +- drivers/mtd/ftl.c | 18 +- drivers/mtd/inftlcore.c | 10 +- drivers/mtd/inftlmount.c | 7 +- drivers/mtd/maps/Kconfig | 92 +- drivers/mtd/maps/Makefile | 9 +- drivers/mtd/maps/amd76xrom.c | 384 +- drivers/mtd/maps/arctic-mtd.c | 4 +- drivers/mtd/maps/autcpu12-nvram.c | 6 +- drivers/mtd/maps/beech-mtd.c | 4 +- drivers/mtd/maps/cdb89712.c | 8 +- drivers/mtd/maps/ceiva.c | 6 +- drivers/mtd/maps/cfi_flagadm.c | 4 +- drivers/mtd/maps/cstm_mips_ixx.c | 6 +- drivers/mtd/maps/db1550-flash.c | 13 +- drivers/mtd/maps/db1x00-flash.c | 21 +- drivers/mtd/maps/dbox2-flash.c | 4 +- drivers/mtd/maps/dc21285.c | 54 +- drivers/mtd/maps/dilnetpc.c | 14 +- drivers/mtd/maps/dmv182.c | 5 +- drivers/mtd/maps/ebony.c | 31 +- drivers/mtd/maps/edb7312.c | 13 +- drivers/mtd/maps/elan-104nc.c | 12 +- drivers/mtd/maps/epxa10db-flash.c | 4 +- drivers/mtd/maps/fortunet.c | 6 +- drivers/mtd/maps/h720x-flash.c | 4 +- drivers/mtd/maps/ichxrom.c | 496 +- drivers/mtd/maps/impa7.c | 9 +- drivers/mtd/maps/integrator-flash.c | 8 +- drivers/mtd/maps/ipaq-flash.c | 2 +- drivers/mtd/maps/iq80310.c | 4 +- drivers/mtd/maps/ixp2000.c | 53 +- drivers/mtd/maps/ixp4xx.c | 13 +- drivers/mtd/maps/l440gx.c | 14 +- drivers/mtd/maps/lasat.c | 4 +- drivers/mtd/maps/lubbock-flash.c | 4 +- drivers/mtd/maps/mbx860.c | 4 +- drivers/mtd/maps/mpc1211.c | 4 +- drivers/mtd/maps/netsc520.c | 10 +- drivers/mtd/maps/nettel.c | 27 +- drivers/mtd/maps/ocelot.c | 8 +- drivers/mtd/maps/octagon-5066.c | 2 +- drivers/mtd/maps/omap-toto-flash.c | 4 +- drivers/mtd/maps/pb1550-flash.c | 5 +- drivers/mtd/maps/pb1xxx-flash.c | 5 +- drivers/mtd/maps/pci.c | 8 +- drivers/mtd/maps/pcmciamtd.c | 31 +- drivers/mtd/maps/physmap.c | 10 +- drivers/mtd/maps/pnc2000.c | 8 +- drivers/mtd/maps/redwood.c | 5 +- drivers/mtd/maps/rpxlite.c | 4 +- drivers/mtd/maps/sa1100-flash.c | 1512 +- drivers/mtd/maps/sbc_gxx.c | 14 +- drivers/mtd/maps/sc520cdp.c | 16 +- drivers/mtd/maps/scb2_flash.c | 8 +- drivers/mtd/maps/scx200_docflash.c | 35 +- drivers/mtd/maps/solutionengine.c | 6 +- drivers/mtd/maps/sun_uflash.c | 11 +- drivers/mtd/maps/tqm8xxl.c | 2 +- drivers/mtd/maps/ts5500_flash.c | 2 +- drivers/mtd/maps/uclinux.c | 6 +- drivers/mtd/maps/vmax301.c | 2 +- drivers/mtd/maps/wr_sbc82xx_flash.c | 4 +- drivers/mtd/mtd_blkdevs.c | 12 +- drivers/mtd/mtdblock.c | 8 +- drivers/mtd/mtdblock_ro.c | 4 +- drivers/mtd/mtdchar.c | 22 +- drivers/mtd/mtdcore.c | 4 +- drivers/mtd/mtdpart.c | 6 +- drivers/mtd/nand/Kconfig | 65 +- drivers/mtd/nand/Makefile | 7 +- drivers/mtd/nand/au1550nd.c | 423 +- drivers/mtd/nand/autcpu12.c | 16 +- drivers/mtd/nand/diskonchip.c | 339 +- drivers/mtd/nand/edb7312.c | 37 +- drivers/mtd/nand/nand_base.c | 246 +- drivers/mtd/nand/nand_bbt.c | 25 +- drivers/mtd/nand/ppchameleonevb.c | 60 +- drivers/mtd/nand/s3c2410.c | 14 +- drivers/mtd/nand/spia.c | 31 +- drivers/mtd/nand/toto.c | 24 +- drivers/mtd/nand/tx4925ndfmc.c | 30 +- drivers/mtd/nand/tx4938ndfmc.c | 22 +- drivers/mtd/nftlcore.c | 10 +- drivers/mtd/nftlmount.c | 6 +- drivers/mtd/redboot.c | 32 +- drivers/net/3c501.c | 6 +- drivers/net/3c503.c | 6 +- drivers/net/3c505.c | 18 +- drivers/net/3c507.c | 156 +- drivers/net/3c509.c | 182 +- drivers/net/3c515.c | 23 +- drivers/net/3c523.c | 6 +- drivers/net/3c527.c | 2 +- drivers/net/3c59x.c | 354 +- drivers/net/7990.c | 164 +- drivers/net/7990.h | 12 +- drivers/net/8139cp.c | 22 +- drivers/net/8139too.c | 26 +- drivers/net/82596.c | 12 +- drivers/net/8390.c | 26 +- drivers/net/8390.h | 1 + drivers/net/Kconfig | 241 +- drivers/net/Makefile | 3 +- drivers/net/Space.c | 3 - drivers/net/a2065.c | 2 +- drivers/net/ac3200.c | 66 +- drivers/net/acenic.c | 189 +- drivers/net/acenic.h | 23 +- drivers/net/acenic_firmware.h | 2 +- drivers/net/amd8111e.c | 526 +- drivers/net/amd8111e.h | 6 +- drivers/net/appletalk/cops.c | 8 +- drivers/net/appletalk/ipddp.c | 2 +- drivers/net/appletalk/ltpc.c | 14 +- drivers/net/arcnet/Kconfig | 21 +- drivers/net/arcnet/Makefile | 1 + drivers/net/arcnet/arc-rawmode.c | 9 +- drivers/net/arcnet/arcnet.c | 258 +- drivers/net/arcnet/com20020-isa.c | 1 - drivers/net/arcnet/com20020.c | 28 +- drivers/net/arcnet/rfc1051.c | 3 + drivers/net/arcnet/rfc1201.c | 2 + drivers/net/ariadne.c | 2 +- drivers/net/arm/am79c961a.c | 15 +- drivers/net/arm/ether1.c | 2 +- drivers/net/arm/ether3.c | 2 +- drivers/net/arm/etherh.c | 167 +- drivers/net/at1700.c | 8 +- drivers/net/atari_bionet.c | 2 +- drivers/net/atari_pamsnet.c | 2 +- drivers/net/atarilance.c | 4 +- drivers/net/atp.c | 14 +- drivers/net/au1000_eth.c | 2 +- drivers/net/b44.c | 136 +- drivers/net/b44.h | 114 +- drivers/net/bagetlance.c | 2 +- drivers/net/bmac.c | 68 +- drivers/net/bonding/bond_3ad.c | 10 - drivers/net/bonding/bond_main.c | 38 +- drivers/net/bonding/bonding.h | 4 +- drivers/net/bsd_comp.c | 4 +- drivers/net/cs89x0.c | 18 +- drivers/net/de600.c | 8 +- drivers/net/de620.c | 12 +- drivers/net/declance.c | 9 - drivers/net/defxx.c | 146 +- drivers/net/defxx.h | 2 +- drivers/net/depca.c | 36 +- drivers/net/dgrs.c | 22 +- drivers/net/dl2k.c | 287 +- drivers/net/dl2k.h | 2 +- drivers/net/dummy.c | 4 +- drivers/net/e100.c | 94 +- drivers/net/e1000/e1000.h | 5 +- drivers/net/e1000/e1000_ethtool.c | 83 +- drivers/net/e1000/e1000_hw.c | 253 +- drivers/net/e1000/e1000_hw.h | 10 +- drivers/net/e1000/e1000_main.c | 271 +- drivers/net/e1000/e1000_osdep.h | 15 +- drivers/net/e1000/e1000_param.c | 167 +- drivers/net/e2100.c | 26 +- drivers/net/eepro.c | 146 +- drivers/net/eepro100.c | 469 +- drivers/net/eexpress.c | 6 +- drivers/net/epic100.c | 10 +- drivers/net/eql.c | 26 +- drivers/net/es3210.c | 6 +- drivers/net/eth16i.c | 10 +- drivers/net/ethertap.c | 2 +- drivers/net/ewrk3.c | 331 +- drivers/net/fc/iph5526_ip.h | 1 - drivers/net/fealnx.c | 14 +- drivers/net/fec.c | 501 +- drivers/net/fec.h | 6 +- drivers/net/fec_8xx/fec_8xx-netta.c | 2 +- drivers/net/fec_8xx/fec_main.c | 2 +- drivers/net/fec_8xx/fec_mii.c | 4 +- drivers/net/fmv18x.c | 2 +- drivers/net/forcedeth.c | 428 +- drivers/net/gianfar.c | 145 +- drivers/net/gianfar.h | 7 +- drivers/net/gianfar_ethtool.c | 6 +- drivers/net/gt96100eth.c | 10 +- drivers/net/hamachi.c | 273 +- drivers/net/hamradio/6pack.c | 404 +- drivers/net/hamradio/baycom_epp.c | 4 +- drivers/net/hamradio/baycom_par.c | 6 +- drivers/net/hamradio/baycom_ser_fdx.c | 8 +- drivers/net/hamradio/baycom_ser_hdx.c | 6 +- drivers/net/hamradio/dmascc.c | 1 - drivers/net/hamradio/hdlcdrv.c | 2 +- drivers/net/hamradio/mkiss.c | 8 +- drivers/net/hamradio/scc.c | 4 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/hp-plus.c | 4 +- drivers/net/hp.c | 4 +- drivers/net/hp100.c | 85 +- drivers/net/hplance.c | 185 +- drivers/net/hplance.h | 15 +- drivers/net/hydra.c | 2 +- drivers/net/ibm_emac/ibm_emac.h | 2 +- drivers/net/ibm_emac/ibm_emac_core.c | 46 +- drivers/net/ibm_emac/ibm_emac_core.h | 2 - drivers/net/ibm_emac/ibm_emac_mal.c | 2 +- drivers/net/ibm_emac/ibm_emac_mal.h | 1 + drivers/net/ibm_emac/ibm_emac_phy.c | 19 +- drivers/net/ibmlana.c | 15 +- drivers/net/ibmveth.c | 67 +- drivers/net/irda/ali-ircc.c | 6 +- drivers/net/irda/au1k_ir.c | 4 +- drivers/net/irda/donauboe.c | 4 +- drivers/net/irda/irda-usb.c | 26 +- drivers/net/irda/irport.c | 2 +- drivers/net/irda/irtty-sir.c | 8 +- drivers/net/irda/nsc-ircc.c | 15 +- drivers/net/irda/sa1100_ir.c | 129 +- drivers/net/irda/sir_kthread.c | 1 - drivers/net/irda/smsc-ircc2.c | 12 +- drivers/net/irda/stir4200.c | 53 +- drivers/net/irda/tekram-sir.c | 4 +- drivers/net/irda/via-ircc.c | 538 +- drivers/net/irda/via-ircc.h | 19 +- drivers/net/irda/vlsi_ir.c | 20 +- drivers/net/irda/vlsi_ir.h | 1 - drivers/net/irda/w83977af_ir.c | 6 +- drivers/net/isa-skeleton.c | 2 +- drivers/net/iseries_veth.c | 113 +- drivers/net/ixgb/ixgb.h | 28 +- drivers/net/ixgb/ixgb_ee.c | 192 +- drivers/net/ixgb/ixgb_ethtool.c | 680 +- drivers/net/ixgb/ixgb_hw.c | 231 +- drivers/net/ixgb/ixgb_hw.h | 52 +- drivers/net/ixgb/ixgb_ids.h | 21 +- drivers/net/ixgb/ixgb_main.c | 738 +- drivers/net/ixgb/ixgb_osdep.h | 10 +- drivers/net/ixgb/ixgb_param.c | 316 +- drivers/net/jazzsonic.c | 2 +- drivers/net/lance.c | 10 +- drivers/net/lasi_82596.c | 4 +- drivers/net/lne390.c | 66 +- drivers/net/lp486e.c | 16 +- drivers/net/mac8390.c | 6 +- drivers/net/mac89x0.c | 4 +- drivers/net/mace.c | 66 +- drivers/net/macsonic.c | 2 +- drivers/net/meth.c | 26 - drivers/net/mv643xx_eth.c | 2 +- drivers/net/mvme147.c | 22 +- drivers/net/myri_sbus.c | 12 +- drivers/net/natsemi.c | 289 +- drivers/net/ne.c | 6 +- drivers/net/ne2.c | 8 +- drivers/net/ne2k-pci.c | 37 +- drivers/net/ne3210.c | 34 +- drivers/net/ni5010.c | 2 +- drivers/net/ni52.c | 10 +- drivers/net/ni65.c | 8 +- drivers/net/ns83820.c | 190 +- drivers/net/pci-skeleton.c | 11 +- drivers/net/pcmcia/3c574_cs.c | 73 +- drivers/net/pcmcia/3c589_cs.c | 54 +- drivers/net/pcmcia/Kconfig | 2 +- drivers/net/pcmcia/axnet_cs.c | 51 +- drivers/net/pcmcia/com20020_cs.c | 32 +- drivers/net/pcmcia/fmvj18x_cs.c | 48 +- drivers/net/pcmcia/ibmtr_cs.c | 30 +- drivers/net/pcmcia/nmclan_cs.c | 47 +- drivers/net/pcmcia/pcnet_cs.c | 102 +- drivers/net/pcmcia/smc91c92_cs.c | 256 +- drivers/net/pcmcia/xirc2ps_cs.c | 83 +- drivers/net/pcnet32.c | 22 +- drivers/net/plip.c | 6 +- drivers/net/ppp_async.c | 27 +- drivers/net/ppp_deflate.c | 4 +- drivers/net/ppp_generic.c | 30 +- drivers/net/ppp_synctty.c | 19 +- drivers/net/pppoe.c | 2 +- drivers/net/r8169.c | 1126 +- drivers/net/rrunner.c | 34 +- drivers/net/rrunner.h | 6 +- drivers/net/s2io-regs.h | 3 + drivers/net/s2io.c | 3219 ++-- drivers/net/s2io.h | 307 +- drivers/net/sb1000.c | 2 +- drivers/net/sb1250-mac.c | 2 +- drivers/net/seeq8005.c | 6 +- drivers/net/sgiseeq.c | 2 +- drivers/net/shaper.c | 2 +- drivers/net/sis900.c | 316 +- drivers/net/sk98lin/Makefile | 1 + drivers/net/sk98lin/h/skdrv1st.h | 4 +- drivers/net/sk98lin/h/skdrv2nd.h | 9 +- drivers/net/sk98lin/skaddr.c | 2 +- drivers/net/sk98lin/skge.c | 284 +- drivers/net/sk98lin/skproc.c | 433 +- drivers/net/sk_g16.c | 4 +- drivers/net/sk_mca.c | 11 +- drivers/net/skfp/h/fplustm.h | 6 +- drivers/net/skfp/h/targethw.h | 6 +- drivers/net/skfp/h/targetos.h | 2 +- drivers/net/skfp/h/types.h | 21 +- drivers/net/skfp/hwmtm.c | 3 +- drivers/net/skfp/skfddi.c | 127 +- drivers/net/skfp/smt.c | 7 - drivers/net/slip.c | 47 +- drivers/net/smc-mca.c | 4 +- drivers/net/smc-ultra.c | 6 +- drivers/net/smc9194.c | 8 +- drivers/net/smc91x.c | 529 +- drivers/net/smc91x.h | 112 +- drivers/net/starfire.c | 306 +- drivers/net/sun3_82586.c | 2 +- drivers/net/sun3lance.c | 2 +- drivers/net/sunbmac.c | 2 +- drivers/net/sundance.c | 456 +- drivers/net/sungem.c | 8 +- drivers/net/sunhme.c | 14 +- drivers/net/sunlance.c | 137 +- drivers/net/sunqe.c | 2 +- drivers/net/tc35815.c | 2 +- drivers/net/tg3.c | 882 +- drivers/net/tg3.h | 56 +- drivers/net/tlan.c | 82 +- drivers/net/tlan.h | 88 +- drivers/net/tokenring/3c359.c | 44 +- drivers/net/tokenring/3c359.h | 2 +- drivers/net/tokenring/Kconfig | 2 +- drivers/net/tokenring/abyss.c | 9 +- drivers/net/tokenring/ibmtr.c | 8 +- drivers/net/tokenring/lanstreamer.c | 35 +- drivers/net/tokenring/lanstreamer.h | 2 +- drivers/net/tokenring/olympic.c | 101 +- drivers/net/tokenring/proteon.c | 6 +- drivers/net/tokenring/skisa.c | 6 +- drivers/net/tokenring/smctr.c | 8 +- drivers/net/tokenring/tms380tr.c | 2 +- drivers/net/tokenring/tmspci.c | 9 +- drivers/net/tulip/21142.c | 62 +- drivers/net/tulip/de2104x.c | 21 +- drivers/net/tulip/de4x5.c | 12 +- drivers/net/tulip/dmfe.c | 24 +- drivers/net/tulip/eeprom.c | 25 +- drivers/net/tulip/interrupt.c | 76 +- drivers/net/tulip/media.c | 154 +- drivers/net/tulip/pnic.c | 53 +- drivers/net/tulip/pnic2.c | 48 +- drivers/net/tulip/timer.c | 18 +- drivers/net/tulip/tulip.h | 54 +- drivers/net/tulip/tulip_core.c | 310 +- drivers/net/tulip/winbond-840.c | 273 +- drivers/net/tulip/xircom_cb.c | 18 +- drivers/net/tulip/xircom_tulip_cb.c | 236 +- drivers/net/tun.c | 303 +- drivers/net/typhoon.c | 278 +- drivers/net/via-rhine.c | 311 +- drivers/net/via-velocity.c | 108 +- drivers/net/via-velocity.h | 22 +- drivers/net/wan/Kconfig | 4 +- drivers/net/wan/c101.c | 5 +- drivers/net/wan/cosa.c | 10 +- drivers/net/wan/cosa.h | 10 +- drivers/net/wan/cycx_drv.c | 37 +- drivers/net/wan/cycx_main.c | 7 +- drivers/net/wan/cycx_x25.c | 12 +- drivers/net/wan/dlci.c | 2 +- drivers/net/wan/dscc4.c | 190 +- drivers/net/wan/farsync.c | 61 +- drivers/net/wan/hd6457x.c | 24 +- drivers/net/wan/hdlc_x25.c | 14 +- drivers/net/wan/hostess_sv11.c | 8 +- drivers/net/wan/lapbether.c | 20 +- drivers/net/wan/lmc/lmc_main.c | 11 +- drivers/net/wan/lmc/lmc_media.c | 2 +- drivers/net/wan/lmc/lmc_proto.c | 2 +- drivers/net/wan/n2.c | 7 +- drivers/net/wan/pc300.h | 12 +- drivers/net/wan/pc300_drv.c | 63 +- drivers/net/wan/pc300_tty.c | 58 +- drivers/net/wan/pci200syn.c | 10 +- drivers/net/wan/sbni.c | 20 +- drivers/net/wan/sdla.c | 6 +- drivers/net/wan/sdla_chdlc.c | 63 +- drivers/net/wan/sealevel.c | 10 +- drivers/net/wan/syncppp.c | 4 +- drivers/net/wan/wanxl.c | 8 +- drivers/net/wan/x25_asy.c | 26 +- drivers/net/wd.c | 8 +- drivers/net/wireless/Kconfig | 4 +- drivers/net/wireless/airo.c | 148 +- drivers/net/wireless/airo_cs.c | 34 +- drivers/net/wireless/arlan-main.c | 137 +- drivers/net/wireless/arlan-proc.c | 15 +- drivers/net/wireless/arlan.h | 26 +- drivers/net/wireless/atmel.c | 4 +- drivers/net/wireless/atmel_cs.c | 47 +- drivers/net/wireless/netwave_cs.c | 140 +- drivers/net/wireless/orinoco.c | 207 +- drivers/net/wireless/orinoco_cs.c | 40 +- drivers/net/wireless/prism54/isl_38xx.c | 15 +- drivers/net/wireless/prism54/isl_38xx.h | 4 + drivers/net/wireless/prism54/isl_ioctl.c | 663 +- drivers/net/wireless/prism54/isl_ioctl.h | 2 + drivers/net/wireless/prism54/isl_oid.h | 9 + drivers/net/wireless/prism54/islpci_dev.c | 51 +- drivers/net/wireless/prism54/islpci_dev.h | 5 +- drivers/net/wireless/prism54/islpci_eth.c | 5 +- drivers/net/wireless/prism54/islpci_hotplug.c | 11 +- drivers/net/wireless/prism54/islpci_mgt.c | 5 +- drivers/net/wireless/prism54/islpci_mgt.h | 2 - drivers/net/wireless/prism54/oid_mgt.c | 126 +- drivers/net/wireless/prism54/oid_mgt.h | 5 +- drivers/net/wireless/prism54/prismcompat.h | 6 +- drivers/net/wireless/ray_cs.c | 40 +- drivers/net/wireless/strip.c | 12 +- drivers/net/wireless/wavelan.c | 22 +- drivers/net/wireless/wavelan.p.h | 14 +- drivers/net/wireless/wavelan_cs.c | 277 +- drivers/net/wireless/wavelan_cs.p.h | 17 +- drivers/net/wireless/wl3501_cs.c | 81 +- drivers/net/yellowfin.c | 271 +- drivers/net/znet.c | 6 +- drivers/oprofile/buffer_sync.c | 65 +- drivers/oprofile/cpu_buffer.c | 156 +- drivers/oprofile/cpu_buffer.h | 6 + drivers/oprofile/event_buffer.h | 2 + drivers/oprofile/oprof.c | 71 +- drivers/oprofile/oprof.h | 6 +- drivers/oprofile/oprofile_files.c | 42 +- drivers/oprofile/oprofile_stats.c | 4 + drivers/oprofile/oprofile_stats.h | 1 + drivers/oprofile/oprofilefs.c | 17 +- drivers/oprofile/timer_int.c | 39 +- drivers/parisc/Makefile | 7 +- drivers/parisc/asp.c | 61 +- drivers/parisc/ccio-dma.c | 8 +- drivers/parisc/dino.c | 296 +- drivers/parisc/eisa.c | 80 +- drivers/parisc/gsc.c | 186 +- drivers/parisc/gsc.h | 21 +- drivers/parisc/iosapic.c | 436 +- drivers/parisc/iosapic_private.h | 19 +- drivers/parisc/lasi.c | 58 +- drivers/parisc/lba_pci.c | 366 +- drivers/parisc/led.c | 7 +- drivers/parisc/power.c | 8 +- drivers/parisc/sba_iommu.c | 157 +- drivers/parisc/superio.c | 186 +- drivers/parisc/wax.c | 48 +- drivers/parport/Kconfig | 4 +- drivers/parport/daisy.c | 157 +- drivers/parport/ieee1284.c | 4 +- drivers/parport/parport_cs.c | 22 +- drivers/parport/parport_pc.c | 351 +- drivers/parport/parport_sunbpp.c | 30 +- drivers/parport/probe.c | 14 +- drivers/parport/procfs.c | 3 - drivers/parport/share.c | 7 +- drivers/pci/Kconfig | 2 +- drivers/pci/Makefile | 10 +- drivers/pci/access.c | 2 +- drivers/pci/bus.c | 31 +- drivers/pci/hotplug/Kconfig | 23 +- drivers/pci/hotplug/Makefile | 1 - drivers/pci/hotplug/acpiphp_glue.c | 4 +- drivers/pci/hotplug/acpiphp_ibm.c | 103 +- drivers/pci/hotplug/cpci_hotplug_pci.c | 2 +- drivers/pci/hotplug/cpcihp_generic.c | 16 +- drivers/pci/hotplug/cpcihp_zt5550.c | 15 +- drivers/pci/hotplug/cpqphp.h | 9 +- drivers/pci/hotplug/cpqphp_core.c | 38 +- drivers/pci/hotplug/cpqphp_ctrl.c | 4 +- drivers/pci/hotplug/cpqphp_nvram.c | 14 +- drivers/pci/hotplug/cpqphp_nvram.h | 12 +- drivers/pci/hotplug/cpqphp_pci.c | 44 +- drivers/pci/hotplug/fakephp.c | 130 +- drivers/pci/hotplug/ibmphp.h | 2 +- drivers/pci/hotplug/ibmphp_core.c | 816 +- drivers/pci/hotplug/ibmphp_ebda.c | 4 +- drivers/pci/hotplug/ibmphp_hpc.c | 28 +- drivers/pci/hotplug/ibmphp_pci.c | 56 +- drivers/pci/hotplug/pci_hotplug_core.c | 2 +- drivers/pci/hotplug/pciehp.h | 38 +- drivers/pci/hotplug/pciehp_core.c | 100 +- drivers/pci/hotplug/pciehp_ctrl.c | 388 +- drivers/pci/hotplug/pciehp_hpc.c | 54 +- drivers/pci/hotplug/pciehp_pci.c | 8 + drivers/pci/hotplug/pciehprm_acpi.c | 43 +- drivers/pci/hotplug/rpadlpar_core.c | 170 +- drivers/pci/hotplug/rpaphp.h | 11 +- drivers/pci/hotplug/rpaphp_core.c | 180 +- drivers/pci/hotplug/rpaphp_pci.c | 93 +- drivers/pci/hotplug/rpaphp_slot.c | 11 +- drivers/pci/hotplug/rpaphp_vio.c | 4 +- drivers/pci/hotplug/shpchp.h | 11 +- drivers/pci/hotplug/shpchp_core.c | 5 +- drivers/pci/hotplug/shpchp_ctrl.c | 481 +- drivers/pci/hotplug/shpchp_hpc.c | 13 +- drivers/pci/hotplug/shpchprm_acpi.c | 6 +- drivers/pci/hotplug/shpchprm_legacy.c | 18 +- drivers/pci/msi.c | 59 +- drivers/pci/msi.h | 2 +- drivers/pci/pci-driver.c | 85 +- drivers/pci/pci-sysfs.c | 294 +- drivers/pci/pci.c | 119 +- drivers/pci/pci.h | 29 +- drivers/pci/pci.ids | 10 +- drivers/pci/probe.c | 202 +- drivers/pci/proc.c | 5 +- drivers/pci/quirks.c | 349 +- drivers/pci/remove.c | 15 +- drivers/pci/rom.c | 80 +- drivers/pci/search.c | 79 +- drivers/pci/setup-bus.c | 21 +- drivers/pci/setup-irq.c | 5 +- drivers/pci/setup-res.c | 2 +- drivers/pci/syscall.c | 7 +- drivers/pcmcia/Kconfig | 122 +- drivers/pcmcia/Makefile | 44 +- drivers/pcmcia/au1000_generic.c | 938 +- drivers/pcmcia/au1000_pb1x00.c | 43 +- drivers/pcmcia/cardbus.c | 45 +- drivers/pcmcia/cistpl.c | 136 +- drivers/pcmcia/cs.c | 729 +- drivers/pcmcia/cs_internal.h | 86 +- drivers/pcmcia/ds.c | 1079 +- drivers/pcmcia/hd64465_ss.c | 3 +- drivers/pcmcia/i82092.c | 7 +- drivers/pcmcia/i82365.c | 53 +- drivers/pcmcia/m32r_cfc.c | 25 +- drivers/pcmcia/m32r_pcc.c | 23 +- drivers/pcmcia/o2micro.h | 19 +- drivers/pcmcia/pcmcia_compat.c | 20 - drivers/pcmcia/pd6729.c | 273 +- drivers/pcmcia/pd6729.h | 6 +- drivers/pcmcia/pxa2xx_base.c | 6 + drivers/pcmcia/pxa2xx_lubbock.c | 2 + drivers/pcmcia/rsrc_mgr.c | 1017 +- drivers/pcmcia/sa1100_generic.c | 21 - drivers/pcmcia/sa1100_simpad.c | 4 +- drivers/pcmcia/sa1111_generic.c | 15 - drivers/pcmcia/soc_common.c | 7 +- drivers/pcmcia/soc_common.h | 2 +- drivers/pcmcia/socket_sysfs.c | 29 +- drivers/pcmcia/tcic.c | 35 +- drivers/pcmcia/ti113x.h | 11 +- drivers/pcmcia/yenta_socket.c | 36 +- drivers/pcmcia/yenta_socket.h | 2 +- drivers/pnp/Kconfig | 4 +- drivers/pnp/Makefile | 1 + drivers/pnp/core.c | 2 +- drivers/pnp/interface.c | 6 +- drivers/pnp/isapnp/Kconfig | 2 +- drivers/pnp/isapnp/core.c | 12 +- drivers/pnp/manager.c | 10 +- drivers/pnp/pnpacpi/core.c | 21 +- drivers/pnp/pnpbios/Kconfig | 5 +- drivers/pnp/pnpbios/bioscalls.c | 2 +- drivers/pnp/pnpbios/core.c | 17 +- drivers/pnp/pnpbios/rsparser.c | 12 +- drivers/pnp/quirks.c | 7 +- drivers/pnp/resource.c | 9 +- drivers/s390/Kconfig | 21 +- drivers/s390/block/dasd.c | 81 +- drivers/s390/block/dasd_3990_erp.c | 59 +- drivers/s390/block/dasd_devmap.c | 212 +- drivers/s390/block/dasd_diag.c | 80 +- drivers/s390/block/dasd_eckd.c | 270 +- drivers/s390/block/dasd_eckd.h | 12 +- drivers/s390/block/dasd_erp.c | 9 +- drivers/s390/block/dasd_fba.c | 177 +- drivers/s390/block/dasd_genhd.c | 4 +- drivers/s390/block/dasd_int.h | 21 +- drivers/s390/block/dasd_ioctl.c | 5 +- drivers/s390/block/dasd_proc.c | 12 +- drivers/s390/block/dcssblk.c | 168 +- drivers/s390/block/xpram.c | 3 +- drivers/s390/char/Makefile | 6 +- drivers/s390/char/con3215.c | 27 +- drivers/s390/char/con3270.c | 7 +- drivers/s390/char/raw3270.c | 38 +- drivers/s390/char/sclp.c | 1262 +- drivers/s390/char/sclp.h | 6 +- drivers/s390/char/sclp_con.c | 39 +- drivers/s390/char/sclp_cpi.c | 19 +- drivers/s390/char/sclp_rw.c | 62 +- drivers/s390/char/sclp_rw.h | 4 +- drivers/s390/char/sclp_tty.c | 70 +- drivers/s390/char/sclp_vt220.c | 122 +- drivers/s390/char/tape_block.c | 4 +- drivers/s390/char/tape_core.c | 13 +- drivers/s390/char/tty3270.c | 37 +- drivers/s390/char/vmlogrdr.c | 2 +- drivers/s390/cio/cio.c | 40 +- drivers/s390/cio/cio.h | 1 + drivers/s390/cio/cmf.c | 4 +- drivers/s390/cio/css.c | 12 +- drivers/s390/cio/css.h | 4 + drivers/s390/cio/device.c | 103 +- drivers/s390/cio/device_fsm.c | 37 +- drivers/s390/cio/device_id.c | 2 +- drivers/s390/cio/device_ops.c | 41 +- drivers/s390/cio/qdio.c | 38 +- drivers/s390/crypto/Makefile | 2 +- drivers/s390/crypto/z90common.h | 75 +- drivers/s390/crypto/z90crypt.h | 81 +- drivers/s390/crypto/z90hardware.c | 289 +- drivers/s390/crypto/z90main.c | 668 +- drivers/s390/net/ctcdbug.h | 6 +- drivers/s390/net/ctcmain.c | 34 +- drivers/s390/net/ctctty.c | 12 +- drivers/s390/net/iucv.c | 13 +- drivers/s390/net/iucv.h | 7 +- drivers/s390/net/lcs.c | 10 +- drivers/s390/net/lcs.h | 3 +- drivers/s390/net/netiucv.c | 2 +- drivers/s390/net/qeth.h | 91 +- drivers/s390/net/qeth_main.c | 1192 +- drivers/s390/net/qeth_mpc.h | 39 +- drivers/s390/net/qeth_proc.c | 8 +- drivers/s390/net/qeth_sys.c | 148 +- drivers/s390/net/smsgiucv.c | 2 +- drivers/s390/scsi/zfcp_aux.c | 134 +- drivers/s390/scsi/zfcp_ccw.c | 5 +- drivers/s390/scsi/zfcp_def.h | 129 +- drivers/s390/scsi/zfcp_erp.c | 538 +- drivers/s390/scsi/zfcp_ext.h | 11 +- drivers/s390/scsi/zfcp_fsf.c | 433 +- drivers/s390/scsi/zfcp_fsf.h | 17 +- drivers/s390/scsi/zfcp_qdio.c | 3 +- drivers/s390/scsi/zfcp_scsi.c | 89 +- drivers/s390/scsi/zfcp_sysfs_adapter.c | 3 +- drivers/s390/scsi/zfcp_sysfs_driver.c | 5 +- drivers/s390/scsi/zfcp_sysfs_port.c | 7 +- drivers/s390/scsi/zfcp_sysfs_unit.c | 13 +- drivers/sbus/char/aurora.c | 67 +- drivers/sbus/char/bbc_i2c.c | 4 +- drivers/sbus/char/bpp.c | 18 +- drivers/sbus/char/cpwatchdog.c | 8 +- drivers/sbus/char/display7seg.c | 4 +- drivers/sbus/char/flash.c | 6 +- drivers/sbus/char/jsflash.c | 4 +- drivers/sbus/char/riowatchdog.c | 8 +- drivers/sbus/char/rtc.c | 5 +- drivers/sbus/char/vfc_dev.c | 2 +- drivers/sbus/sbus.c | 16 + drivers/scsi/3w-9xxx.c | 1 + drivers/scsi/3w-9xxx.h | 10 +- drivers/scsi/3w-xxxx.c | 4329 ++--- drivers/scsi/3w-xxxx.h | 151 +- drivers/scsi/53c700.c | 187 +- drivers/scsi/53c700.h | 33 +- drivers/scsi/BusLogic.c | 177 +- drivers/scsi/BusLogic.h | 44 +- drivers/scsi/Kconfig | 83 +- drivers/scsi/Makefile | 9 +- drivers/scsi/NCR5380.c | 65 +- drivers/scsi/NCR53C9x.c | 15 +- drivers/scsi/NCR53C9x.h | 3 +- drivers/scsi/NCR53c406a.c | 2 +- drivers/scsi/NCR_D700.c | 27 +- drivers/scsi/NCR_Q720.c | 24 +- drivers/scsi/aacraid/README | 2 +- drivers/scsi/aacraid/aachba.c | 615 +- drivers/scsi/aacraid/aacraid.h | 218 +- drivers/scsi/aacraid/commsup.c | 27 - drivers/scsi/aacraid/linit.c | 196 +- drivers/scsi/aacraid/rkt.c | 131 +- drivers/scsi/aacraid/rx.c | 98 +- drivers/scsi/aacraid/sa.c | 66 +- drivers/scsi/advansys.c | 13 +- drivers/scsi/aha152x.c | 61 +- drivers/scsi/aha1542.c | 12 +- drivers/scsi/ahci.c | 62 +- drivers/scsi/aic7xxx/aic7770_osm.c | 16 +- drivers/scsi/aic7xxx/aic79xx.h | 8 +- drivers/scsi/aic7xxx/aic79xx.reg | 2 +- drivers/scsi/aic7xxx/aic79xx_core.c | 15 +- drivers/scsi/aic7xxx/aic79xx_inline.h | 10 +- drivers/scsi/aic7xxx/aic79xx_osm.c | 148 +- drivers/scsi/aic7xxx/aic79xx_osm.h | 84 +- drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 159 +- drivers/scsi/aic7xxx/aic79xx_pci.c | 57 +- drivers/scsi/aic7xxx/aic7xxx.h | 12 +- drivers/scsi/aic7xxx/aic7xxx_core.c | 9 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 122 +- drivers/scsi/aic7xxx/aic7xxx_osm.h | 85 +- drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 215 +- drivers/scsi/aic7xxx/aic7xxx_pci.c | 87 +- drivers/scsi/aic7xxx/aiclib.h | 39 + drivers/scsi/aic7xxx/cam.h | 6 - drivers/scsi/aic7xxx_old.c | 26 +- drivers/scsi/aic7xxx_old/aic7xxx_proc.c | 2 +- drivers/scsi/arm/acornscsi.c | 2 +- drivers/scsi/arm/arxescsi.c | 19 +- drivers/scsi/arm/cumana_2.c | 19 +- drivers/scsi/arm/eesox.c | 19 +- drivers/scsi/arm/fas216.c | 2 +- drivers/scsi/arm/powertec.c | 19 +- drivers/scsi/ata_piix.c | 59 +- drivers/scsi/atari_scsi.c | 2 +- drivers/scsi/atp870u.c | 2 +- drivers/scsi/constants.c | 944 +- drivers/scsi/cpqfcTSinit.c | 2 +- drivers/scsi/dc395x.c | 87 +- drivers/scsi/dec_esp.c | 402 +- drivers/scsi/dmx3191d.c | 216 +- drivers/scsi/dpt/dpti_ioctl.h | 1 - drivers/scsi/dpt_i2o.c | 56 +- drivers/scsi/dpti.h | 21 +- drivers/scsi/dtc.c | 49 +- drivers/scsi/dtc.h | 34 +- drivers/scsi/eata.c | 3219 ++-- drivers/scsi/esp.c | 2 +- drivers/scsi/fd_mcs.c | 58 +- drivers/scsi/fdomain.c | 184 +- drivers/scsi/g_NCR5380.c | 14 +- drivers/scsi/gdth.c | 978 +- drivers/scsi/gdth_proc.c | 287 +- drivers/scsi/gdth_proc.h | 6 +- drivers/scsi/hosts.c | 48 +- drivers/scsi/ibmmca.c | 11 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 146 +- drivers/scsi/ibmvscsi/ibmvscsi.h | 1 + drivers/scsi/ibmvscsi/rpa_vscsi.c | 2 +- drivers/scsi/ide-scsi.c | 216 +- drivers/scsi/imm.c | 6 +- drivers/scsi/in2000.c | 2 +- drivers/scsi/ipr.c | 79 +- drivers/scsi/ipr.h | 64 +- drivers/scsi/ips.c | 32 +- drivers/scsi/ips.h | 63 +- drivers/scsi/jazz_esp.c | 97 +- drivers/scsi/lasi700.c | 42 +- drivers/scsi/libata-core.c | 683 +- drivers/scsi/libata-scsi.c | 144 +- drivers/scsi/libata.h | 9 +- drivers/scsi/mac53c94.c | 24 +- drivers/scsi/mac_esp.c | 2 +- drivers/scsi/mca_53c9x.c | 6 +- drivers/scsi/megaraid.c | 32 +- drivers/scsi/megaraid/Kconfig.megaraid | 1 + drivers/scsi/megaraid/mega_common.h | 3 + drivers/scsi/megaraid/megaraid_ioctl.h | 9 +- drivers/scsi/megaraid/megaraid_mbox.c | 431 +- drivers/scsi/megaraid/megaraid_mbox.h | 26 +- drivers/scsi/megaraid/megaraid_mm.c | 139 +- drivers/scsi/megaraid/megaraid_mm.h | 4 +- drivers/scsi/mesh.c | 122 +- drivers/scsi/ncr53c8xx.c | 1356 +- drivers/scsi/ncr53c8xx.h | 10 +- drivers/scsi/nsp32.c | 135 +- drivers/scsi/nsp32.h | 9 +- drivers/scsi/oktagon_esp.c | 2 - drivers/scsi/osst.c | 1039 +- drivers/scsi/osst.h | 23 +- drivers/scsi/pas16.c | 4 +- drivers/scsi/pcmcia/aha152x_stub.c | 35 +- drivers/scsi/pcmcia/fdomain_stub.c | 23 +- drivers/scsi/pcmcia/nsp_cs.c | 32 +- drivers/scsi/pcmcia/qlogic_stub.c | 28 +- drivers/scsi/pcmcia/sym53c500_cs.c | 28 +- drivers/scsi/ppa.c | 2 +- drivers/scsi/psi240i.c | 37 - drivers/scsi/ql12160_fw.h | 22 +- drivers/scsi/ql1280_fw.h | 22 +- drivers/scsi/qla1280.c | 141 +- drivers/scsi/qla1280.h | 4 +- drivers/scsi/qla2xxx/Kconfig | 14 +- drivers/scsi/qla2xxx/Makefile | 2 - drivers/scsi/qla2xxx/ql2300.c | 2 +- drivers/scsi/qla2xxx/ql2300_fw.c | 13736 ++++++++-------- drivers/scsi/qla2xxx/ql2322_fw.c | 13716 +++++++-------- drivers/scsi/qla2xxx/ql6312.c | 14 +- drivers/scsi/qla2xxx/ql6312_fw.c | 12734 +++++++------- drivers/scsi/qla2xxx/qla_dbg.c | 94 +- drivers/scsi/qla2xxx/qla_def.h | 87 +- drivers/scsi/qla2xxx/qla_devtbl.h | 96 +- drivers/scsi/qla2xxx/qla_gbl.h | 47 +- drivers/scsi/qla2xxx/qla_init.c | 833 +- drivers/scsi/qla2xxx/qla_inline.h | 15 +- drivers/scsi/qla2xxx/qla_iocb.c | 110 +- drivers/scsi/qla2xxx/qla_isr.c | 306 +- drivers/scsi/qla2xxx/qla_mbx.c | 530 +- drivers/scsi/qla2xxx/qla_os.c | 622 +- drivers/scsi/qla2xxx/qla_rscn.c | 59 +- drivers/scsi/qla2xxx/qla_sup.c | 111 +- drivers/scsi/qla2xxx/qla_version.h | 6 +- drivers/scsi/qlogicfas.c | 4 +- drivers/scsi/qlogicfc.c | 8 +- drivers/scsi/qlogicfc_asm.c | 10 +- drivers/scsi/qlogicisp.c | 17 +- drivers/scsi/qlogicpti.c | 2 +- drivers/scsi/sata_nv.c | 112 +- drivers/scsi/sata_promise.c | 83 +- drivers/scsi/sata_sil.c | 22 +- drivers/scsi/sata_sis.c | 19 +- drivers/scsi/sata_svw.c | 17 +- drivers/scsi/sata_sx4.c | 27 +- drivers/scsi/sata_uli.c | 67 +- drivers/scsi/sata_via.c | 214 +- drivers/scsi/sata_vsc.c | 23 +- drivers/scsi/scsi.c | 78 +- drivers/scsi/scsi_debug.c | 582 +- drivers/scsi/scsi_devinfo.c | 28 +- drivers/scsi/scsi_error.c | 222 +- drivers/scsi/scsi_ioctl.c | 82 +- drivers/scsi/scsi_lib.c | 331 +- drivers/scsi/scsi_module.c | 1 - drivers/scsi/scsi_priv.h | 23 +- drivers/scsi/scsi_scan.c | 357 +- drivers/scsi/scsi_sysfs.c | 276 +- drivers/scsi/scsi_transport_fc.c | 1028 +- drivers/scsi/scsi_transport_spi.c | 432 +- drivers/scsi/scsicam.c | 12 +- drivers/scsi/sd.c | 201 +- drivers/scsi/seagate.c | 86 +- drivers/scsi/sg.c | 75 +- drivers/scsi/sim710.c | 21 +- drivers/scsi/sr.c | 17 +- drivers/scsi/sr_ioctl.c | 15 + drivers/scsi/st.c | 461 +- drivers/scsi/st.h | 30 +- drivers/scsi/sun3_scsi.c | 10 +- drivers/scsi/sun3_scsi_vme.c | 10 +- drivers/scsi/sun3x_esp.c | 2 +- drivers/scsi/sym53c416.c | 10 +- drivers/scsi/sym53c8xx_2/sym53c8xx.h | 82 +- drivers/scsi/sym53c8xx_2/sym_conf.h | 43 +- drivers/scsi/sym53c8xx_2/sym_defs.h | 135 +- drivers/scsi/sym53c8xx_2/sym_fw.c | 41 +- drivers/scsi/sym53c8xx_2/sym_fw.h | 35 +- drivers/scsi/sym53c8xx_2/sym_fw1.h | 35 +- drivers/scsi/sym53c8xx_2/sym_fw2.h | 35 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 789 +- drivers/scsi/sym53c8xx_2/sym_glue.h | 76 +- drivers/scsi/sym53c8xx_2/sym_hipd.c | 615 +- drivers/scsi/sym53c8xx_2/sym_hipd.h | 113 +- drivers/scsi/sym53c8xx_2/sym_malloc.c | 37 +- drivers/scsi/sym53c8xx_2/sym_misc.c | 137 +- drivers/scsi/sym53c8xx_2/sym_misc.h | 35 +- drivers/scsi/sym53c8xx_2/sym_nvram.c | 74 +- drivers/scsi/sym53c8xx_2/sym_nvram.h | 41 +- drivers/scsi/sym53c8xx_comm.h | 360 +- drivers/scsi/sym53c8xx_defs.h | 39 +- drivers/scsi/t128.c | 71 +- drivers/scsi/t128.h | 14 +- drivers/scsi/tmscsim.c | 2720 ++- drivers/scsi/tmscsim.h | 102 +- drivers/scsi/u14-34f.c | 72 +- drivers/scsi/ultrastor.c | 2 +- drivers/scsi/wd33c93.c | 2 +- drivers/scsi/wd33c93.h | 2 + drivers/scsi/wd7000.c | 13 +- drivers/scsi/zalon.c | 28 +- drivers/serial/21285.c | 33 +- drivers/serial/68328serial.c | 20 +- drivers/serial/68360serial.c | 22 +- drivers/serial/8250.c | 1011 +- drivers/serial/8250.h | 20 +- drivers/serial/8250_acorn.c | 60 +- drivers/serial/8250_acpi.c | 74 +- drivers/serial/8250_gsc.c | 55 +- drivers/serial/8250_pci.c | 111 +- drivers/serial/8250_pnp.c | 41 +- drivers/serial/Kconfig | 91 +- drivers/serial/Makefile | 10 +- drivers/serial/amba-pl010.c | 66 +- drivers/serial/amba-pl011.c | 51 +- drivers/serial/au1x00_uart.c | 15 - drivers/serial/clps711x.c | 28 +- drivers/serial/cpm_uart/cpm_uart.h | 9 +- drivers/serial/cpm_uart/cpm_uart_core.c | 15 + drivers/serial/cpm_uart/cpm_uart_cpm1.c | 23 +- drivers/serial/cpm_uart/cpm_uart_cpm2.c | 8 +- drivers/serial/dz.c | 27 +- drivers/serial/icom.c | 97 +- drivers/serial/icom.h | 12 +- drivers/serial/ip22zilog.c | 118 +- drivers/serial/mcfserial.c | 92 +- drivers/serial/mpc52xx_uart.c | 4 +- drivers/serial/pmac_zilog.c | 84 +- drivers/serial/pmac_zilog.h | 9 +- drivers/serial/pxa.c | 47 +- drivers/serial/s3c2410.c | 1472 +- drivers/serial/sa1100.c | 27 +- drivers/serial/serial_core.c | 154 +- drivers/serial/serial_cs.c | 53 +- drivers/serial/serial_lh7a40x.c | 59 +- drivers/serial/sh-sci.c | 72 +- drivers/serial/sh-sci.h | 76 +- drivers/serial/sn_console.c | 289 +- drivers/serial/sunsab.c | 24 +- drivers/serial/sunsu.c | 23 +- drivers/serial/sunzilog.c | 76 +- drivers/serial/uart00.c | 27 +- drivers/tc/lk201.c | 443 +- drivers/tc/lk201.h | 146 +- drivers/tc/tc.c | 179 +- drivers/tc/zs.c | 637 +- drivers/tc/zs.h | 68 +- drivers/telephony/ixj.c | 111 +- drivers/telephony/ixj_pcmcia.c | 8 +- drivers/usb/Kconfig | 4 +- drivers/usb/Makefile | 11 +- drivers/usb/README | 33 +- drivers/usb/atm/speedtch.c | 38 +- drivers/usb/atm/usb_atm.c | 47 +- drivers/usb/atm/usb_atm.h | 20 +- drivers/usb/class/Kconfig | 3 +- drivers/usb/class/audio.c | 62 +- drivers/usb/class/bluetty.c | 38 +- drivers/usb/class/cdc-acm.c | 108 +- drivers/usb/class/cdc-acm.h | 4 +- drivers/usb/class/usb-midi.c | 49 +- drivers/usb/class/usb-midi.h | 4 +- drivers/usb/class/usblp.c | 41 +- drivers/usb/core/config.c | 4 +- drivers/usb/core/devices.c | 32 +- drivers/usb/core/devio.c | 151 +- drivers/usb/core/file.c | 2 +- drivers/usb/core/hcd-pci.c | 176 +- drivers/usb/core/hcd.c | 372 +- drivers/usb/core/hcd.h | 46 +- drivers/usb/core/hub.c | 1062 +- drivers/usb/core/hub.h | 2 +- drivers/usb/core/inode.c | 125 +- drivers/usb/core/message.c | 148 +- drivers/usb/core/otg_whitelist.h | 16 +- drivers/usb/core/sysfs.c | 90 +- drivers/usb/core/urb.c | 16 +- drivers/usb/core/usb.c | 339 +- drivers/usb/core/usb.h | 27 +- drivers/usb/gadget/Kconfig | 50 +- drivers/usb/gadget/Makefile | 2 +- drivers/usb/gadget/dummy_hcd.c | 541 +- drivers/usb/gadget/epautoconf.c | 3 + drivers/usb/gadget/ether.c | 144 +- drivers/usb/gadget/file_storage.c | 92 +- drivers/usb/gadget/gadget_chips.h | 12 + drivers/usb/gadget/goku_udc.c | 165 +- drivers/usb/gadget/goku_udc.h | 8 +- drivers/usb/gadget/inode.c | 7 +- drivers/usb/gadget/lh7a40x_udc.c | 7 +- drivers/usb/gadget/net2280.c | 21 +- drivers/usb/gadget/net2280.h | 8 +- drivers/usb/gadget/omap_udc.c | 471 +- drivers/usb/gadget/omap_udc.h | 17 +- drivers/usb/gadget/pxa2xx_udc.c | 17 +- drivers/usb/gadget/rndis.c | 57 +- drivers/usb/gadget/serial.c | 912 +- drivers/usb/gadget/zero.c | 13 +- drivers/usb/host/Kconfig | 42 +- drivers/usb/host/Makefile | 4 +- drivers/usb/host/ehci-dbg.c | 47 +- drivers/usb/host/ehci-hcd.c | 404 +- drivers/usb/host/ehci-hub.c | 89 +- drivers/usb/host/ehci-mem.c | 44 +- drivers/usb/host/ehci-q.c | 218 +- drivers/usb/host/ehci-sched.c | 454 +- drivers/usb/host/ehci.h | 49 +- drivers/usb/host/hc_crisv10.c | 32 +- drivers/usb/host/ohci-dbg.c | 154 +- drivers/usb/host/ohci-hcd.c | 391 +- drivers/usb/host/ohci-hub.c | 251 +- drivers/usb/host/ohci-lh7a404.c | 81 +- drivers/usb/host/ohci-mem.c | 34 +- drivers/usb/host/ohci-omap.c | 117 +- drivers/usb/host/ohci-pci.c | 70 +- drivers/usb/host/ohci-pxa27x.c | 43 +- drivers/usb/host/ohci-q.c | 237 +- drivers/usb/host/ohci-sa1111.c | 61 +- drivers/usb/host/ohci.h | 285 +- drivers/usb/host/sl811-hcd.c | 345 +- drivers/usb/host/sl811.h | 18 +- drivers/usb/host/uhci-debug.c | 62 +- drivers/usb/host/uhci-hcd.c | 470 +- drivers/usb/host/uhci-hcd.h | 64 +- drivers/usb/host/uhci-hub.c | 142 +- drivers/usb/image/Kconfig | 7 +- drivers/usb/image/hpusbscsi.c | 12 +- drivers/usb/image/mdc800.c | 67 +- drivers/usb/image/microtek.c | 21 +- drivers/usb/image/microtek.h | 1 + drivers/usb/input/Kconfig | 16 +- drivers/usb/input/aiptek.c | 10 +- drivers/usb/input/ati_remote.c | 27 +- drivers/usb/input/hid-core.c | 139 +- drivers/usb/input/hid-debug.h | 278 +- drivers/usb/input/hid-ff.c | 4 +- drivers/usb/input/hid-input.c | 484 +- drivers/usb/input/hid-lgff.c | 4 +- drivers/usb/input/hid.h | 45 +- drivers/usb/input/hiddev.c | 6 +- drivers/usb/input/kbtab.c | 10 +- drivers/usb/input/mtouchusb.c | 10 +- drivers/usb/input/pid.c | 2 +- drivers/usb/input/powermate.c | 17 +- drivers/usb/input/touchkitusb.c | 29 +- drivers/usb/input/usbkbd.c | 10 +- drivers/usb/input/usbmouse.c | 10 +- drivers/usb/input/wacom.c | 10 +- drivers/usb/input/xpad.c | 14 +- drivers/usb/media/Kconfig | 6 +- drivers/usb/media/Makefile | 2 +- drivers/usb/media/dabusb.c | 16 +- drivers/usb/media/ibmcam.c | 25 +- drivers/usb/media/konicawc.c | 27 +- drivers/usb/media/ov511.c | 44 +- drivers/usb/media/se401.c | 46 +- drivers/usb/media/sn9c102.h | 43 +- drivers/usb/media/sn9c102_core.c | 662 +- drivers/usb/media/sn9c102_pas106b.c | 132 +- drivers/usb/media/sn9c102_pas202bcb.c | 111 +- drivers/usb/media/sn9c102_sensor.h | 136 +- drivers/usb/media/sn9c102_tas5110c1b.c | 69 +- drivers/usb/media/sn9c102_tas5130d1b.c | 86 +- drivers/usb/media/stv680.c | 31 +- drivers/usb/media/ultracam.c | 16 +- drivers/usb/media/usbvideo.c | 102 +- drivers/usb/media/vicam.c | 20 +- drivers/usb/media/w9968cf.c | 77 +- drivers/usb/media/w9968cf.h | 2 +- drivers/usb/misc/Kconfig | 49 +- drivers/usb/misc/Makefile | 6 +- drivers/usb/misc/auerswald.c | 33 +- drivers/usb/misc/emi26.c | 8 +- drivers/usb/misc/emi62.c | 6 +- drivers/usb/misc/legousbtower.c | 15 +- drivers/usb/misc/rio500.c | 14 +- drivers/usb/misc/usblcd.c | 15 +- drivers/usb/misc/usbtest.c | 35 +- drivers/usb/misc/uss720.c | 7 +- drivers/usb/net/Kconfig | 33 +- drivers/usb/net/catc.c | 137 +- drivers/usb/net/kaweth.c | 193 +- drivers/usb/net/pegasus.c | 401 +- drivers/usb/net/pegasus.h | 3 + drivers/usb/net/rtl8150.c | 194 +- drivers/usb/net/usbnet.c | 218 +- drivers/usb/serial/Kconfig | 48 + drivers/usb/serial/Makefile | 4 + drivers/usb/serial/belkin_sa.c | 13 +- drivers/usb/serial/bus.c | 1 + drivers/usb/serial/console.c | 4 +- drivers/usb/serial/cyberjack.c | 22 +- drivers/usb/serial/cypress_m8.c | 614 +- drivers/usb/serial/digi_acceleport.c | 25 +- drivers/usb/serial/empeg.c | 20 +- drivers/usb/serial/ftdi_sio.c | 192 +- drivers/usb/serial/ftdi_sio.h | 72 + drivers/usb/serial/generic.c | 14 +- drivers/usb/serial/io_edgeport.c | 301 +- drivers/usb/serial/io_fw_boot.h | 6 +- drivers/usb/serial/io_fw_boot2.h | 6 +- drivers/usb/serial/io_fw_down.h | 6 +- drivers/usb/serial/io_fw_down2.h | 6 +- drivers/usb/serial/io_tables.h | 9 + drivers/usb/serial/io_ti.c | 829 +- drivers/usb/serial/io_usbvend.h | 2 +- drivers/usb/serial/ipaq.c | 523 +- drivers/usb/serial/ipaq.h | 75 - drivers/usb/serial/ir-usb.c | 13 +- drivers/usb/serial/keyspan.c | 29 +- drivers/usb/serial/keyspan.h | 1 - drivers/usb/serial/keyspan_pda.c | 25 +- drivers/usb/serial/kl5kusb105.c | 27 +- drivers/usb/serial/kobil_sct.c | 28 +- drivers/usb/serial/mct_u232.c | 173 +- drivers/usb/serial/omninet.c | 19 +- drivers/usb/serial/pl2303.c | 424 +- drivers/usb/serial/pl2303.h | 11 +- drivers/usb/serial/safe_serial.c | 9 +- drivers/usb/serial/usb-serial.c | 342 +- drivers/usb/serial/usb-serial.h | 25 +- drivers/usb/serial/visor.c | 111 +- drivers/usb/serial/visor.h | 6 +- drivers/usb/serial/whiteheat.c | 21 +- drivers/usb/storage/Kconfig | 17 +- drivers/usb/storage/freecom.c | 2 +- drivers/usb/storage/isd200.c | 10 +- drivers/usb/storage/protocol.c | 49 - drivers/usb/storage/scsiglue.c | 99 +- drivers/usb/storage/transport.c | 45 +- drivers/usb/storage/unusual_devs.h | 293 +- drivers/usb/storage/usb.c | 112 +- drivers/usb/storage/usb.h | 12 +- drivers/usb/usb-skeleton.c | 2 +- drivers/video/Kconfig | 224 +- drivers/video/Makefile | 21 +- drivers/video/acornfb.c | 22 +- drivers/video/amba-clcd.c | 18 + drivers/video/amifb.c | 48 +- drivers/video/asiliantfb.c | 3 - drivers/video/aty/Makefile | 6 +- drivers/video/aty/ati_ids.h | 54 +- drivers/video/aty/aty128fb.c | 125 +- drivers/video/aty/atyfb.h | 227 +- drivers/video/aty/atyfb_base.c | 3630 ++-- drivers/video/aty/mach64_accel.c | 212 +- drivers/video/aty/mach64_ct.c | 733 +- drivers/video/aty/mach64_cursor.c | 297 +- drivers/video/aty/mach64_gx.c | 20 +- drivers/video/aty/radeon_accel.c | 39 + drivers/video/aty/radeon_base.c | 914 +- drivers/video/aty/radeon_monitor.c | 222 +- drivers/video/aty/radeon_pm.c | 2622 ++- drivers/video/aty/radeonfb.h | 232 +- drivers/video/aty/xlinit.c | 83 +- drivers/video/bw2.c | 26 +- drivers/video/cg14.c | 66 +- drivers/video/cg3.c | 50 +- drivers/video/cg6.c | 60 +- drivers/video/chipsfb.c | 2 +- drivers/video/cirrusfb.c | 43 +- drivers/video/console/Kconfig | 1 + drivers/video/console/Makefile | 3 +- drivers/video/console/fbcon.c | 1339 +- drivers/video/console/fbcon.h | 35 + drivers/video/console/font_6x11.c | 2252 +-- drivers/video/console/mdacon.c | 17 +- drivers/video/console/newport_con.c | 86 +- drivers/video/console/sticore.c | 2 +- drivers/video/console/vgacon.c | 29 +- drivers/video/controlfb.c | 20 +- drivers/video/cyber2000fb.c | 18 +- drivers/video/cyber2000fb.h | 4 +- drivers/video/epson1355fb.c | 13 +- drivers/video/fbmem.c | 287 +- drivers/video/fbmon.c | 111 +- drivers/video/fbsysfs.c | 2 + drivers/video/ffb.c | 11 +- drivers/video/fm2fb.c | 25 +- drivers/video/g364fb.c | 1 + drivers/video/gbefb.c | 137 +- drivers/video/hgafb.c | 58 +- drivers/video/hpfb.c | 398 +- drivers/video/i810/i810.h | 7 +- drivers/video/i810/i810_accel.c | 57 +- drivers/video/i810/i810_gtf.c | 3 +- drivers/video/i810/i810_main.c | 293 +- drivers/video/igafb.c | 5 +- drivers/video/imsttfb.c | 23 +- drivers/video/intelfb/intelfbdrv.c | 25 +- drivers/video/intelfb/intelfbhw.c | 16 + drivers/video/kyro/STG4000InitDevice.c | 4 +- drivers/video/kyro/STG4000Interface.h | 26 +- drivers/video/kyro/STG4000OverlayDevice.c | 10 +- drivers/video/kyro/STG4000Ramdac.c | 8 +- drivers/video/kyro/STG4000Reg.h | 4 +- drivers/video/kyro/STG4000VTG.c | 8 +- drivers/video/kyro/fbdev.c | 3 +- drivers/video/leo.c | 45 +- drivers/video/logo/Kconfig | 2 +- drivers/video/matrox/Makefile | 3 +- drivers/video/matrox/matroxfb_DAC1064.c | 25 +- drivers/video/matrox/matroxfb_DAC1064.h | 2 +- drivers/video/matrox/matroxfb_accel.c | 22 +- drivers/video/matrox/matroxfb_base.c | 131 +- drivers/video/matrox/matroxfb_base.h | 143 +- drivers/video/matrox/matroxfb_crtc2.c | 9 +- drivers/video/matrox/matroxfb_crtc2.h | 1 + drivers/video/matrox/matroxfb_g450.h | 2 +- drivers/video/maxinefb.c | 54 +- drivers/video/modedb.c | 49 +- drivers/video/neofb.c | 108 +- drivers/video/offb.c | 78 +- drivers/video/p9100.c | 25 +- drivers/video/platinumfb.c | 28 +- drivers/video/pm2fb.c | 226 +- drivers/video/pmag-ba-fb.c | 39 +- drivers/video/pmagb-b-fb.c | 30 +- drivers/video/pvr2fb.c | 1 + drivers/video/pxafb.c | 68 +- drivers/video/radeonfb.c | 41 +- drivers/video/riva/fbdev.c | 421 +- drivers/video/riva/nv_driver.c | 161 +- drivers/video/riva/riva_hw.c | 569 +- drivers/video/riva/riva_hw.h | 83 +- drivers/video/riva/rivafb-i2c.c | 44 +- drivers/video/riva/rivafb.h | 3 +- drivers/video/sa1100fb.c | 353 +- drivers/video/savage/savagefb-i2c.c | 10 +- drivers/video/sbuslib.c | 23 +- drivers/video/sgivwfb.c | 4 +- drivers/video/sis/300vtbl.h | 185 +- drivers/video/sis/310vtbl.h | 213 +- drivers/video/sis/init.c | 643 +- drivers/video/sis/init.h | 535 +- drivers/video/sis/init301.c | 1330 +- drivers/video/sis/init301.h | 154 +- drivers/video/sis/initdef.h | 26 +- drivers/video/sis/oem300.h | 36 +- drivers/video/sis/oem310.h | 2 +- drivers/video/sis/osdef.h | 25 +- drivers/video/sis/sis.h | 168 +- drivers/video/sis/sis_main.c | 308 +- drivers/video/sis/sis_main.h | 75 +- drivers/video/sis/vgatypes.h | 63 +- drivers/video/sis/vstruct.h | 19 +- drivers/video/skeletonfb.c | 44 +- drivers/video/softcursor.c | 73 +- drivers/video/sstfb.c | 46 +- drivers/video/stifb.c | 24 +- drivers/video/tcx.c | 42 +- drivers/video/tdfxfb.c | 54 +- drivers/video/tgafb.c | 45 +- drivers/video/tridentfb.c | 48 +- drivers/video/tx3912fb.c | 12 - drivers/video/valkyriefb.c | 48 +- drivers/video/vesafb.c | 87 +- drivers/video/vfb.c | 6 +- drivers/video/vga16fb.c | 44 +- drivers/w1/Kconfig | 2 +- drivers/w1/Makefile | 4 + drivers/w1/dscore.c | 55 +- drivers/w1/dscore.h | 34 +- drivers/w1/matrox_w1.c | 13 +- drivers/w1/w1.c | 139 +- drivers/w1/w1.h | 7 + drivers/w1/w1_family.c | 12 +- drivers/w1/w1_int.c | 27 +- drivers/w1/w1_int.h | 2 +- drivers/w1/w1_io.c | 10 + drivers/w1/w1_io.h | 1 + drivers/w1/w1_netlink.c | 11 + drivers/w1/w1_therm.c | 71 +- drivers/zorro/zorro.c | 2 +- fs/Kconfig | 210 +- fs/Kconfig.binfmt | 13 + fs/Makefile | 16 +- fs/adfs/dir.c | 2 +- fs/adfs/inode.c | 2 +- fs/adfs/map.c | 2 +- fs/adfs/super.c | 2 +- fs/affs/amigaffs.c | 15 +- fs/affs/bitmap.c | 10 +- fs/affs/dir.c | 12 +- fs/affs/file.c | 21 +- fs/affs/inode.c | 24 +- fs/affs/namei.c | 15 +- fs/affs/super.c | 20 +- fs/affs/symlink.c | 9 +- fs/afs/cell.c | 2 +- fs/afs/cmservice.c | 4 +- fs/afs/kafsasyncd.c | 2 +- fs/afs/kafstimod.c | 2 +- fs/afs/main.c | 8 +- fs/afs/server.c | 2 +- fs/afs/types.h | 2 - fs/afs/vlocation.c | 2 +- fs/afs/volume.c | 4 +- fs/aio.c | 8 +- fs/attr.c | 30 +- fs/autofs/inode.c | 3 +- fs/autofs4/inode.c | 3 +- fs/autofs4/root.c | 24 +- fs/bad_inode.c | 3 +- fs/befs/debug.c | 2 + fs/bfs/dir.c | 14 +- fs/bfs/inode.c | 2 +- fs/binfmt_aout.c | 50 +- fs/binfmt_elf.c | 209 +- fs/binfmt_elf_fdpic.c | 3 +- fs/binfmt_em86.c | 2 +- fs/binfmt_flat.c | 2 +- fs/binfmt_misc.c | 5 +- fs/binfmt_script.c | 2 +- fs/binfmt_som.c | 2 +- fs/bio.c | 42 +- fs/block_dev.c | 30 +- fs/buffer.c | 192 +- fs/char_dev.c | 58 +- fs/cifs/CHANGES | 54 +- fs/cifs/Makefile | 2 +- fs/cifs/README | 82 +- fs/cifs/TODO | 34 +- fs/cifs/cifs_debug.c | 17 +- fs/cifs/cifs_fs_sb.h | 6 +- fs/cifs/cifsfs.c | 127 +- fs/cifs/cifsfs.h | 8 +- fs/cifs/cifsglob.h | 33 +- fs/cifs/cifspdu.h | 415 +- fs/cifs/cifsproto.h | 15 +- fs/cifs/cifssmb.c | 1127 +- fs/cifs/connect.c | 121 +- fs/cifs/dir.c | 3 - fs/cifs/fcntl.c | 54 +- fs/cifs/file.c | 353 +- fs/cifs/inode.c | 44 +- fs/cifs/misc.c | 82 +- fs/cifs/netmisc.c | 7 +- fs/cifs/smberr.h | 1 + fs/cifs/transport.c | 150 +- fs/cifs/xattr.c | 109 +- fs/coda/cnode.c | 2 +- fs/coda/dir.c | 62 +- fs/coda/file.c | 4 +- fs/coda/inode.c | 4 +- fs/coda/psdev.c | 18 +- fs/coda/sysctl.c | 58 +- fs/coda/upcall.c | 29 +- fs/compat.c | 231 +- fs/compat_ioctl.c | 78 +- fs/cramfs/inode.c | 1 + fs/dcache.c | 180 +- fs/dcookies.c | 1 + fs/devfs/base.c | 12 +- fs/devfs/util.c | 2 +- fs/devpts/Makefile | 1 - fs/devpts/inode.c | 56 +- fs/devpts/xattr_security.c | 29 +- fs/direct-io.c | 60 +- fs/dquot.c | 226 +- fs/efs/namei.c | 33 + fs/efs/super.c | 25 + fs/eventpoll.c | 5 +- fs/exec.c | 281 +- fs/ext2/acl.c | 113 +- fs/ext2/acl.h | 5 - fs/ext2/balloc.c | 40 +- fs/ext2/dir.c | 10 +- fs/ext2/ext2.h | 2 +- fs/ext2/file.c | 8 +- fs/ext2/ialloc.c | 5 +- fs/ext2/inode.c | 25 +- fs/ext2/ioctl.c | 4 +- fs/ext2/namei.c | 27 +- fs/ext2/super.c | 183 +- fs/ext2/symlink.c | 16 +- fs/ext2/xattr.c | 368 +- fs/ext2/xattr.h | 40 +- fs/ext2/xattr_security.c | 11 +- fs/ext2/xattr_trusted.c | 11 +- fs/ext2/xattr_user.c | 27 +- fs/ext3/Makefile | 2 +- fs/ext3/acl.c | 113 +- fs/ext3/acl.h | 2 - fs/ext3/balloc.c | 848 +- fs/ext3/dir.c | 2 +- fs/ext3/file.c | 30 +- fs/ext3/ialloc.c | 21 +- fs/ext3/inode.c | 220 +- fs/ext3/ioctl.c | 73 +- fs/ext3/namei.c | 43 +- fs/ext3/resize.c | 184 +- fs/ext3/super.c | 359 +- fs/ext3/symlink.c | 16 +- fs/ext3/xattr.c | 1470 +- fs/ext3/xattr.h | 37 +- fs/ext3/xattr_security.c | 14 +- fs/ext3/xattr_trusted.c | 13 +- fs/ext3/xattr_user.c | 13 +- fs/fat/Makefile | 2 +- fs/fat/cache.c | 455 +- fs/fat/dir.c | 391 +- fs/fat/file.c | 170 +- fs/fat/inode.c | 1201 +- fs/fat/misc.c | 152 +- fs/fcntl.c | 67 +- fs/fifo.c | 8 +- fs/file.c | 34 +- fs/file_table.c | 15 +- fs/filesystems.c | 3 +- fs/fs-writeback.c | 36 +- fs/hfs/Makefile | 2 +- fs/hfs/btree.c | 8 +- fs/hfs/catalog.c | 8 +- fs/hfs/dir.c | 7 +- fs/hfs/extent.c | 10 +- fs/hfs/hfs_fs.h | 8 + fs/hfs/inode.c | 43 +- fs/hfs/mdb.c | 8 +- fs/hfs/super.c | 3 +- fs/hfsplus/btree.c | 8 +- fs/hfsplus/catalog.c | 8 +- fs/hfsplus/dir.c | 6 +- fs/hfsplus/extents.c | 10 +- fs/hfsplus/hfsplus_fs.h | 6 + fs/hfsplus/inode.c | 40 +- fs/hfsplus/ioctl.c | 108 +- fs/hfsplus/super.c | 6 +- fs/hostfs/hostfs.h | 21 + fs/hostfs/hostfs_kern.c | 13 +- fs/hpfs/file.c | 2 +- fs/hugetlbfs/inode.c | 31 +- fs/inode.c | 184 +- fs/ioctl.c | 96 +- fs/isofs/compress.c | 1 - fs/isofs/inode.c | 5 + fs/isofs/rock.c | 25 +- fs/jbd/checkpoint.c | 13 +- fs/jbd/commit.c | 46 +- fs/jbd/journal.c | 12 +- fs/jbd/recovery.c | 2 + fs/jbd/revoke.c | 7 +- fs/jbd/transaction.c | 69 +- fs/jffs/inode-v23.c | 8 +- fs/jffs2/Makefile | 3 +- fs/jffs2/README.Locking | 46 +- fs/jffs2/background.c | 11 +- fs/jffs2/build.c | 53 +- fs/jffs2/compr.c | 11 +- fs/jffs2/compr_zlib.c | 4 +- fs/jffs2/dir.c | 5 +- fs/jffs2/erase.c | 12 +- fs/jffs2/file.c | 4 +- fs/jffs2/fs.c | 34 +- fs/jffs2/gc.c | 27 +- fs/jffs2/ioctl.c | 4 +- fs/jffs2/malloc.c | 4 +- fs/jffs2/nodelist.c | 49 +- fs/jffs2/nodelist.h | 52 +- fs/jffs2/nodemgmt.c | 121 +- fs/jffs2/os-linux.h | 24 +- fs/jffs2/pushpull.h | 4 +- fs/jffs2/read.c | 6 +- fs/jffs2/readinode.c | 12 +- fs/jffs2/scan.c | 21 +- fs/jffs2/super.c | 20 +- fs/jffs2/symlink.c | 4 +- fs/jffs2/wbuf.c | 169 +- fs/jffs2/write.c | 8 +- fs/jffs2/writev.c | 4 +- fs/jfs/acl.c | 81 +- fs/jfs/inode.c | 11 +- fs/jfs/jfs_dinode.h | 28 +- fs/jfs/jfs_dmap.c | 10 +- fs/jfs/jfs_dmap.h | 75 +- fs/jfs/jfs_dtree.c | 26 +- fs/jfs/jfs_dtree.h | 18 +- fs/jfs/jfs_imap.c | 71 +- fs/jfs/jfs_imap.h | 74 +- fs/jfs/jfs_incore.h | 2 +- fs/jfs/jfs_logmgr.c | 18 +- fs/jfs/jfs_logmgr.h | 96 +- fs/jfs/jfs_metapage.c | 21 +- fs/jfs/jfs_mount.c | 2 +- fs/jfs/jfs_superblock.h | 32 +- fs/jfs/jfs_txnmgr.c | 6 +- fs/jfs/jfs_types.h | 16 +- fs/jfs/jfs_unicode.c | 2 +- fs/jfs/jfs_unicode.h | 32 +- fs/jfs/jfs_xattr.h | 4 +- fs/jfs/jfs_xtree.c | 62 +- fs/jfs/jfs_xtree.h | 14 +- fs/jfs/namei.c | 2 +- fs/jfs/super.c | 6 +- fs/jfs/xattr.c | 59 +- fs/libfs.c | 14 +- fs/lockd/Makefile | 2 +- fs/lockd/clntproc.c | 2 + fs/lockd/host.c | 6 +- fs/lockd/mon.c | 8 +- fs/lockd/svc.c | 21 +- fs/lockd/svc4proc.c | 8 +- fs/lockd/svclock.c | 16 +- fs/lockd/svcproc.c | 8 +- fs/lockd/xdr.c | 49 +- fs/lockd/xdr4.c | 10 +- fs/locks.c | 256 +- fs/mbcache.c | 118 +- fs/minix/bitmap.c | 27 +- fs/minix/dir.c | 6 +- fs/minix/itree_common.c | 6 +- fs/minix/namei.c | 4 +- fs/msdos/namei.c | 195 +- fs/namei.c | 174 +- fs/namespace.c | 93 +- fs/nfs/dir.c | 247 +- fs/nfs/direct.c | 431 +- fs/nfs/file.c | 61 +- fs/nfs/inode.c | 112 +- fs/nfs/nfs3proc.c | 20 +- fs/nfs/nfs4proc.c | 189 +- fs/nfs/nfs4state.c | 12 +- fs/nfs/proc.c | 16 +- fs/nfs/read.c | 19 +- fs/nfs/unlink.c | 3 +- fs/nfs/write.c | 48 +- fs/nfsctl.c | 1 + fs/nfsd/Makefile | 2 +- fs/nfsd/export.c | 5 - fs/nfsd/nfs3xdr.c | 16 - fs/nfsd/nfs4proc.c | 96 +- fs/nfsd/nfs4state.c | 906 +- fs/nfsd/nfs4xdr.c | 245 +- fs/nfsd/nfscache.c | 2 +- fs/nfsd/nfsfh.c | 66 +- fs/nfsd/nfsproc.c | 7 +- fs/nfsd/nfssvc.c | 3 +- fs/nfsd/vfs.c | 45 +- fs/nls/nls_ascii.c | 12 +- fs/nls/nls_base.c | 2 +- fs/nls/nls_cp932.c | 101 +- fs/nls/nls_cp936.c | 691 +- fs/nls/nls_cp949.c | 300 +- fs/nls/nls_cp950.c | 679 +- fs/ntfs/ChangeLog | 199 +- fs/ntfs/Makefile | 6 +- fs/ntfs/aops.c | 1230 +- fs/ntfs/attrib.c | 1326 +- fs/ntfs/attrib.h | 34 +- fs/ntfs/bitmap.c | 1 + fs/ntfs/collate.c | 3 +- fs/ntfs/compress.c | 12 +- fs/ntfs/debug.c | 29 +- fs/ntfs/debug.h | 6 +- fs/ntfs/dir.c | 62 +- fs/ntfs/dir.h | 2 + fs/ntfs/file.c | 7 +- fs/ntfs/index.c | 81 +- fs/ntfs/index.h | 6 +- fs/ntfs/inode.c | 466 +- fs/ntfs/inode.h | 24 +- fs/ntfs/layout.h | 87 +- fs/ntfs/lcnalloc.c | 11 +- fs/ntfs/lcnalloc.h | 29 + fs/ntfs/logfile.c | 65 +- fs/ntfs/malloc.h | 1 + fs/ntfs/mft.c | 2583 ++- fs/ntfs/mft.h | 15 +- fs/ntfs/namei.c | 27 +- fs/ntfs/ntfs.h | 81 +- fs/ntfs/quota.c | 8 +- fs/ntfs/super.c | 71 +- fs/ntfs/types.h | 28 - fs/ntfs/unistr.c | 2 + fs/ntfs/upcase.c | 1 + fs/ntfs/volume.h | 4 + fs/open.c | 41 +- fs/openpromfs/inode.c | 5 +- fs/partitions/Kconfig | 33 +- fs/partitions/check.c | 27 +- fs/partitions/devfs.c | 2 +- fs/partitions/efi.c | 258 +- fs/partitions/ibm.c | 3 +- fs/partitions/msdos.c | 1 + fs/partitions/sgi.c | 8 +- fs/pipe.c | 233 +- fs/posix_acl.c | 42 - fs/proc/Makefile | 4 +- fs/proc/array.c | 129 +- fs/proc/base.c | 252 +- fs/proc/generic.c | 22 +- fs/proc/inode.c | 1 + fs/proc/kcore.c | 22 +- fs/proc/proc_misc.c | 137 +- fs/proc/proc_tty.c | 6 +- fs/proc/root.c | 5 +- fs/proc/task_mmu.c | 47 +- fs/proc/task_nommu.c | 81 +- fs/qnx4/bitmap.c | 3 +- fs/qnx4/inode.c | 2 +- fs/qnx4/namei.c | 4 +- fs/qnx4/truncate.c | 2 +- fs/quota.c | 72 +- fs/quota_v1.c | 62 +- fs/quota_v2.c | 227 +- fs/ramfs/inode.c | 1 + fs/read_write.c | 76 +- fs/readdir.c | 5 +- fs/reiserfs/bitmap.c | 40 +- fs/reiserfs/dir.c | 15 +- fs/reiserfs/do_balan.c | 8 +- fs/reiserfs/file.c | 164 +- fs/reiserfs/fix_node.c | 13 +- fs/reiserfs/ibalance.c | 12 +- fs/reiserfs/inode.c | 273 +- fs/reiserfs/ioctl.c | 8 +- fs/reiserfs/item_ops.c | 20 +- fs/reiserfs/journal.c | 1159 +- fs/reiserfs/namei.c | 235 +- fs/reiserfs/objectid.c | 2 + fs/reiserfs/prints.c | 68 +- fs/reiserfs/procfs.c | 2 +- fs/reiserfs/resize.c | 26 +- fs/reiserfs/stree.c | 181 +- fs/reiserfs/super.c | 641 +- fs/reiserfs/tail_conversion.c | 3 + fs/reiserfs/xattr.c | 8 +- fs/reiserfs/xattr_acl.c | 4 +- fs/romfs/inode.c | 3 +- fs/select.c | 4 +- fs/smbfs/file.c | 7 +- fs/smbfs/inode.c | 28 +- fs/smbfs/proc.c | 46 +- fs/smbfs/proto.h | 8 +- fs/smbfs/request.c | 64 +- fs/smbfs/smbiod.c | 2 +- fs/stat.c | 1 + fs/super.c | 34 +- fs/sysfs/bin.c | 73 +- fs/sysfs/dir.c | 372 +- fs/sysfs/file.c | 109 +- fs/sysfs/group.c | 8 +- fs/sysfs/inode.c | 97 +- fs/sysfs/mount.c | 30 +- fs/sysfs/symlink.c | 72 +- fs/sysfs/sysfs.h | 76 +- fs/sysv/CHANGES | 2 +- fs/sysv/ChangeLog | 12 +- fs/sysv/dir.c | 6 +- fs/sysv/ialloc.c | 2 +- fs/sysv/itree.c | 6 +- fs/sysv/namei.c | 4 +- fs/udf/balloc.c | 47 +- fs/udf/file.c | 22 +- fs/udf/ialloc.c | 31 +- fs/udf/inode.c | 118 +- fs/udf/lowlevel.c | 6 - fs/udf/namei.c | 12 +- fs/udf/super.c | 5 +- fs/udf/udfdecl.h | 1 - fs/ufs/balloc.c | 2 +- fs/ufs/cylinder.c | 2 +- fs/ufs/dir.c | 4 +- fs/ufs/ialloc.c | 4 +- fs/ufs/inode.c | 8 +- fs/ufs/namei.c | 8 +- fs/ufs/super.c | 2 +- fs/ufs/truncate.c | 2 +- fs/ufs/util.c | 53 + fs/ufs/util.h | 2 + fs/vfat/namei.c | 331 +- fs/xattr.c | 131 + fs/xfs/Makefile | 1 + fs/xfs/linux-2.6/kmem.c | 15 +- fs/xfs/linux-2.6/kmem.h | 6 +- fs/xfs/linux-2.6/xfs_aops.c | 38 +- fs/xfs/linux-2.6/xfs_buf.c | 405 +- fs/xfs/linux-2.6/xfs_buf.h | 89 +- fs/xfs/linux-2.6/xfs_file.c | 54 +- fs/xfs/linux-2.6/xfs_globals.c | 1 + fs/xfs/linux-2.6/xfs_ioctl.c | 11 +- fs/xfs/linux-2.6/xfs_ioctl32.c | 151 +- fs/xfs/linux-2.6/xfs_ioctl32.h | 11 +- fs/xfs/linux-2.6/xfs_iops.c | 29 +- fs/xfs/linux-2.6/xfs_linux.h | 6 +- fs/xfs/linux-2.6/xfs_lrw.c | 27 +- fs/xfs/linux-2.6/xfs_stats.h | 12 +- fs/xfs/linux-2.6/xfs_super.c | 91 +- fs/xfs/linux-2.6/xfs_super.h | 2 + fs/xfs/linux-2.6/xfs_sysctl.c | 5 + fs/xfs/linux-2.6/xfs_sysctl.h | 2 + fs/xfs/linux-2.6/xfs_vfs.c | 2 +- fs/xfs/linux-2.6/xfs_vnode.c | 7 +- fs/xfs/linux-2.6/xfs_vnode.h | 1 + fs/xfs/quota/xfs_qm.c | 47 +- fs/xfs/quota/xfs_qm.h | 7 +- fs/xfs/quota/xfs_qm_bhv.c | 20 +- fs/xfs/quota/xfs_qm_syscalls.c | 12 +- fs/xfs/support/debug.c | 2 +- fs/xfs/xfs_alloc.c | 18 +- fs/xfs/xfs_clnt.h | 1 + fs/xfs/xfs_dinode.h | 5 +- fs/xfs/xfs_fs.h | 2 +- fs/xfs/xfs_iget.c | 93 +- fs/xfs/xfs_inode.c | 7 +- fs/xfs/xfs_inode.h | 19 +- fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_log.c | 55 +- fs/xfs/xfs_log_priv.h | 5 +- fs/xfs/xfs_log_recover.c | 7 +- fs/xfs/xfs_mount.c | 16 +- fs/xfs/xfs_mount.h | 12 +- fs/xfs/xfs_rtalloc.c | 18 +- fs/xfs/xfs_trans.h | 2 +- fs/xfs/xfs_trans_inode.c | 9 +- fs/xfs/xfs_utils.c | 2 +- fs/xfs/xfs_vfsops.c | 21 +- fs/xfs/xfs_vnodeops.c | 24 +- include/acpi/acconfig.h | 6 +- include/acpi/acdebug.h | 7 +- include/acpi/acdisasm.h | 8 +- include/acpi/acdispat.h | 12 +- include/acpi/acevents.h | 2 +- include/acpi/acexcep.h | 2 +- include/acpi/acglobal.h | 9 +- include/acpi/achware.h | 7 +- include/acpi/acinterp.h | 53 +- include/acpi/aclocal.h | 6 +- include/acpi/acmacros.h | 37 +- include/acpi/acnamesp.h | 12 +- include/acpi/acobject.h | 11 +- include/acpi/acoutput.h | 4 +- include/acpi/acparser.h | 8 +- include/acpi/acpi.h | 2 +- include/acpi/acpi_bus.h | 14 +- include/acpi/acpi_drivers.h | 2 + include/acpi/acpiosxf.h | 17 +- include/acpi/acpixf.h | 31 +- include/acpi/acresrc.h | 6 +- include/acpi/acstruct.h | 2 +- include/acpi/actables.h | 4 +- include/acpi/actbl.h | 4 +- include/acpi/actbl1.h | 2 +- include/acpi/actbl2.h | 94 +- include/acpi/actypes.h | 19 +- include/acpi/acutils.h | 32 +- include/acpi/amlcode.h | 54 +- include/acpi/amlresrc.h | 32 +- include/acpi/platform/acenv.h | 15 +- include/acpi/platform/acgcc.h | 2 +- include/acpi/platform/aclinux.h | 4 +- include/acpi/processor.h | 104 +- include/asm-alpha/bitops.h | 8 +- include/asm-alpha/core_cia.h | 12 +- include/asm-alpha/dma-mapping.h | 4 + include/asm-alpha/errno.h | 5 + include/asm-alpha/hardirq.h | 34 - include/asm-alpha/io.h | 28 +- include/asm-alpha/io_trivial.h | 4 +- include/asm-alpha/mmzone.h | 4 +- include/asm-alpha/page.h | 3 + include/asm-alpha/pgalloc.h | 4 +- include/asm-alpha/pgtable.h | 16 +- include/asm-alpha/processor.h | 6 - include/asm-alpha/resource.h | 22 +- include/asm-alpha/spinlock.h | 7 +- include/asm-alpha/string.h | 1 - include/asm-alpha/thread_info.h | 1 + include/asm-alpha/topology.h | 3 - include/asm-alpha/uaccess.h | 8 +- include/asm-alpha/unistd.h | 1 - include/asm-arm/arch-clps711x/io.h | 6 +- include/asm-arm/arch-clps711x/time.h | 3 + include/asm-arm/arch-ebsa110/io.h | 14 +- include/asm-arm/arch-ebsa285/io.h | 20 +- include/asm-arm/arch-epxa10db/io.h | 2 +- include/asm-arm/arch-h720x/h7202-regs.h | 8 +- include/asm-arm/arch-h720x/hardware.h | 24 +- include/asm-arm/arch-h720x/io.h | 4 +- include/asm-arm/arch-imx/io.h | 4 +- include/asm-arm/arch-integrator/io.h | 6 +- include/asm-arm/arch-integrator/platform.h | 4 - include/asm-arm/arch-iop3xx/hardware.h | 1 + include/asm-arm/arch-iop3xx/io.h | 6 +- include/asm-arm/arch-iop3xx/iop321.h | 27 +- include/asm-arm/arch-iop3xx/iop331-irqs.h | 23 + include/asm-arm/arch-iop3xx/iop331.h | 47 +- include/asm-arm/arch-iop3xx/iq31244.h | 12 - include/asm-arm/arch-iop3xx/iq80321.h | 11 - include/asm-arm/arch-iop3xx/iq80331.h | 15 - include/asm-arm/arch-iop3xx/timex.h | 2 +- include/asm-arm/arch-iop3xx/uncompress.h | 8 +- include/asm-arm/arch-iop3xx/vmalloc.h | 5 +- include/asm-arm/arch-ixp2000/dma.h | 2 +- include/asm-arm/arch-ixp2000/io.h | 10 +- include/asm-arm/arch-ixp2000/irqs.h | 30 +- include/asm-arm/arch-ixp2000/ixdp2x00.h | 2 +- include/asm-arm/arch-ixp2000/ixdp2x01.h | 4 + include/asm-arm/arch-ixp2000/ixp2000-regs.h | 11 +- include/asm-arm/arch-ixp2000/platform.h | 7 +- include/asm-arm/arch-ixp2000/system.h | 25 +- include/asm-arm/arch-ixp4xx/hardware.h | 7 + include/asm-arm/arch-ixp4xx/io.h | 16 +- include/asm-arm/arch-ixp4xx/irqs.h | 20 +- include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | 46 +- include/asm-arm/arch-ixp4xx/platform.h | 5 +- include/asm-arm/arch-ixp4xx/system.h | 7 +- include/asm-arm/arch-ixp4xx/uncompress.h | 4 +- include/asm-arm/arch-l7200/io.h | 6 +- include/asm-arm/arch-l7200/time.h | 3 + include/asm-arm/arch-lh7a40x/io.h | 6 +- include/asm-arm/arch-lh7a40x/memory.h | 2 + include/asm-arm/arch-lh7a40x/timex.h | 1 - include/asm-arm/arch-omap/board-h2.h | 12 +- include/asm-arm/arch-omap/board-h3.h | 72 +- include/asm-arm/arch-omap/board-innovator.h | 12 +- include/asm-arm/arch-omap/board.h | 51 +- include/asm-arm/arch-omap/dma.h | 32 +- include/asm-arm/arch-omap/gpio.h | 1 + include/asm-arm/arch-omap/hardware.h | 116 +- include/asm-arm/arch-omap/io.h | 6 +- include/asm-arm/arch-omap/irqs.h | 24 +- include/asm-arm/arch-omap/mcbsp.h | 2 +- include/asm-arm/arch-omap/memory.h | 4 +- include/asm-arm/arch-omap/mux.h | 51 +- include/asm-arm/arch-omap/omap16xx.h | 3 +- include/asm-arm/arch-omap/pm.h | 259 +- include/asm-arm/arch-omap/timex.h | 4 +- include/asm-arm/arch-omap/uncompress.h | 27 +- include/asm-arm/arch-pxa/io.h | 6 +- include/asm-arm/arch-pxa/memory.h | 2 - include/asm-arm/arch-pxa/pxa-regs.h | 218 +- include/asm-arm/arch-pxa/ssp.h | 4 +- include/asm-arm/arch-rpc/io.h | 22 +- include/asm-arm/arch-s3c2410/dma.h | 70 +- include/asm-arm/arch-s3c2410/hardware.h | 6 +- include/asm-arm/arch-s3c2410/io.h | 9 +- include/asm-arm/arch-s3c2410/regs-clock.h | 19 +- include/asm-arm/arch-s3c2410/regs-dsc.h | 32 +- include/asm-arm/arch-s3c2410/regs-gpio.h | 23 +- include/asm-arm/arch-s3c2410/regs-gpioj.h | 3 +- include/asm-arm/arch-s3c2410/regs-iic.h | 16 +- include/asm-arm/arch-s3c2410/regs-iis.h | 14 +- include/asm-arm/arch-s3c2410/regs-lcd.h | 14 +- include/asm-arm/arch-s3c2410/regs-rtc.h | 2 + include/asm-arm/arch-s3c2410/regs-sdi.h | 20 +- include/asm-arm/arch-s3c2410/regs-serial.h | 102 +- include/asm-arm/arch-s3c2410/regs-udc.h | 7 +- include/asm-arm/arch-s3c2410/regs-watchdog.h | 1 + include/asm-arm/arch-s3c2410/system.h | 32 +- include/asm-arm/arch-s3c2410/timex.h | 19 +- include/asm-arm/arch-s3c2410/uncompress.h | 31 +- include/asm-arm/arch-s3c2410/vr1000-map.h | 8 +- include/asm-arm/arch-sa1100/collie.h | 61 +- include/asm-arm/arch-sa1100/ide.h | 75 +- include/asm-arm/arch-sa1100/io.h | 6 +- include/asm-arm/arch-sa1100/irqs.h | 9 +- include/asm-arm/arch-sa1100/system.h | 9 - include/asm-arm/arch-sa1100/timex.h | 1 - include/asm-arm/arch-shark/io.h | 2 +- include/asm-arm/arch-versatile/hardware.h | 2 +- include/asm-arm/arch-versatile/io.h | 6 +- include/asm-arm/arch-versatile/platform.h | 28 +- include/asm-arm/arch-versatile/timex.h | 2 +- include/asm-arm/atomic.h | 2 + include/asm-arm/bitops.h | 12 +- include/asm-arm/cacheflush.h | 65 +- include/asm-arm/delay.h | 30 +- include/asm-arm/dma-mapping.h | 19 + include/asm-arm/domain.h | 14 +- include/asm-arm/ecard.h | 1 + include/asm-arm/elf.h | 4 +- include/asm-arm/hardirq.h | 37 +- include/asm-arm/hardware/amba_clcd.h | 9 +- include/asm-arm/hardware/sa1111.h | 6 +- include/asm-arm/ide.h | 4 - include/asm-arm/io.h | 70 +- include/asm-arm/irq.h | 3 +- include/asm-arm/mach/arch.h | 6 +- include/asm-arm/mach/flash.h | 19 +- include/asm-arm/mach/irq.h | 31 +- include/asm-arm/mach/map.h | 6 +- include/asm-arm/mach/mmc.h | 1 - include/asm-arm/mach/time.h | 37 +- include/asm-arm/mmu_context.h | 11 +- include/asm-arm/numnodes.h | 11 +- include/asm-arm/page.h | 8 +- include/asm-arm/pgalloc.h | 6 +- include/asm-arm/pgtable.h | 8 +- include/asm-arm/posix_types.h | 8 +- include/asm-arm/processor.h | 4 - include/asm-arm/procinfo.h | 6 +- include/asm-arm/ptrace.h | 1 + include/asm-arm/resource.h | 47 +- include/asm-arm/serial.h | 6 +- include/asm-arm/setup.h | 2 - include/asm-arm/smp.h | 58 +- include/asm-arm/spinlock.h | 8 + include/asm-arm/string.h | 2 - include/asm-arm/system.h | 58 +- include/asm-arm/thread_info.h | 8 +- include/asm-arm/tlb.h | 3 + include/asm-arm/tlbflush.h | 4 +- include/asm-arm/uaccess.h | 34 +- include/asm-arm/unistd.h | 6 +- include/asm-arm26/atomic.h | 90 +- include/asm-arm26/bitops.h | 73 +- include/asm-arm26/checksum.h | 14 +- include/asm-arm26/constants.h | 1 - include/asm-arm26/hardirq.h | 36 +- include/asm-arm26/hardware.h | 1 + include/asm-arm26/io.h | 2 + include/asm-arm26/irqchip.h | 17 - include/asm-arm26/pgtable.h | 4 +- include/asm-arm26/posix_types.h | 8 +- include/asm-arm26/processor.h | 3 - include/asm-arm26/resource.h | 47 +- include/asm-arm26/setup.h | 2 +- include/asm-arm26/system.h | 246 +- include/asm-arm26/thread_info.h | 4 +- include/asm-arm26/tlb.h | 18 +- include/asm-arm26/uaccess.h | 37 +- include/asm-arm26/unistd.h | 319 +- include/asm-cris/hardirq.h | 34 - include/asm-cris/io.h | 2 + include/asm-cris/page.h | 3 + include/asm-cris/pgalloc.h | 8 +- include/asm-cris/pgtable.h | 2 + include/asm-cris/resource.h | 47 +- include/asm-cris/thread_info.h | 1 + include/asm-frv/io.h | 12 - include/asm-generic/dma-mapping-broken.h | 2 +- include/asm-generic/errno.h | 5 + include/asm-generic/pci.h | 7 + include/asm-generic/sections.h | 1 + include/asm-generic/siginfo.h | 7 - include/asm-generic/tlb.h | 8 + include/asm-generic/topology.h | 5 - include/asm-generic/vmlinux.lds.h | 6 + include/asm-h8300/bitops.h | 10 +- include/asm-h8300/delay.h | 7 +- include/asm-h8300/hardirq.h | 32 - include/asm-h8300/io.h | 25 +- include/asm-h8300/mmu.h | 13 +- include/asm-h8300/page.h | 3 + include/asm-h8300/pgtable.h | 5 +- include/asm-h8300/processor.h | 5 - include/asm-h8300/resource.h | 47 +- include/asm-h8300/sigcontext.h | 2 + include/asm-h8300/signal.h | 2 + include/asm-h8300/system.h | 3 +- include/asm-h8300/thread_info.h | 1 + include/asm-h8300/timex.h | 4 - include/asm-h8300/ucontext.h | 13 +- include/asm-h8300/unistd.h | 24 +- include/asm-i386/acpi.h | 13 +- include/asm-i386/agp.h | 4 +- include/asm-i386/apic.h | 9 +- include/asm-i386/atomic.h | 42 + include/asm-i386/bug.h | 2 +- include/asm-i386/checksum.h | 16 +- include/asm-i386/cpu.h | 18 +- include/asm-i386/cpufeature.h | 6 +- include/asm-i386/desc.h | 9 + include/asm-i386/elf.h | 2 +- include/asm-i386/fixmap.h | 4 +- include/asm-i386/hardirq.h | 44 +- include/asm-i386/highmem.h | 21 +- include/asm-i386/hpet.h | 1 + include/asm-i386/hw_irq.h | 16 +- include/asm-i386/i387.h | 2 - include/asm-i386/io.h | 34 +- include/asm-i386/io_apic.h | 6 +- include/asm-i386/irq.h | 33 +- include/asm-i386/kprobes.h | 9 + include/asm-i386/mach-default/do_timer.h | 3 + include/asm-i386/mach-numaq/mach_apic.h | 11 +- include/asm-i386/mach-summit/mach_mpparse.h | 3 + include/asm-i386/mach-visws/do_timer.h | 3 + include/asm-i386/mach-voyager/do_timer.h | 3 + include/asm-i386/mca.h | 3 - include/asm-i386/mmzone.h | 7 - include/asm-i386/module.h | 2 + include/asm-i386/mpspec.h | 2 +- include/asm-i386/node.h | 1 + include/asm-i386/page.h | 13 +- include/asm-i386/param.h | 8 +- include/asm-i386/pgalloc.h | 20 +- include/asm-i386/pgtable-2level-defs.h | 2 - include/asm-i386/pgtable-2level.h | 33 +- include/asm-i386/pgtable-3level.h | 31 +- include/asm-i386/pgtable.h | 19 +- include/asm-i386/processor.h | 23 +- include/asm-i386/ptrace.h | 2 + include/asm-i386/resource.h | 48 +- include/asm-i386/semaphore.h | 40 +- include/asm-i386/setup.h | 2 +- include/asm-i386/smp.h | 3 +- include/asm-i386/spinlock.h | 44 +- include/asm-i386/string.h | 3 - include/asm-i386/suspend.h | 3 + include/asm-i386/system.h | 5 +- include/asm-i386/thread_info.h | 11 +- include/asm-i386/timer.h | 20 +- include/asm-i386/timex.h | 4 - include/asm-i386/topology.h | 26 +- include/asm-i386/uaccess.h | 8 +- include/asm-i386/unistd.h | 14 +- include/asm-ia64/acpi.h | 2 +- include/asm-ia64/bitops.h | 2 +- include/asm-ia64/cpu.h | 5 + include/asm-ia64/delay.h | 2 +- include/asm-ia64/elf.h | 4 +- include/asm-ia64/hardirq.h | 31 +- include/asm-ia64/hw_irq.h | 20 +- include/asm-ia64/io.h | 45 +- include/asm-ia64/iosapic.h | 4 + include/asm-ia64/kregs.h | 1 + include/asm-ia64/machvec.h | 64 +- include/asm-ia64/machvec_init.h | 6 +- include/asm-ia64/machvec_sn2.h | 14 +- include/asm-ia64/mca.h | 28 +- include/asm-ia64/mca_asm.h | 4 + include/asm-ia64/mmzone.h | 11 +- include/asm-ia64/msi.h | 1 - include/asm-ia64/nodedata.h | 2 +- include/asm-ia64/numa.h | 2 +- include/asm-ia64/numnodes.h | 2 +- include/asm-ia64/page.h | 11 + include/asm-ia64/pal.h | 22 +- include/asm-ia64/pci.h | 25 +- include/asm-ia64/pgalloc.h | 21 +- include/asm-ia64/pgtable.h | 30 +- include/asm-ia64/processor.h | 25 +- include/asm-ia64/ptrace.h | 8 +- include/asm-ia64/resource.h | 54 +- include/asm-ia64/sal.h | 6 + include/asm-ia64/sections.h | 1 - include/asm-ia64/signal.h | 2 + include/asm-ia64/sn/addrs.h | 340 +- include/asm-ia64/sn/arch.h | 22 +- include/asm-ia64/sn/bte.h | 4 +- include/asm-ia64/sn/clksupport.h | 30 +- include/asm-ia64/sn/fetchop.h | 2 +- include/asm-ia64/sn/geo.h | 131 +- include/asm-ia64/sn/intr.h | 49 +- include/asm-ia64/sn/io.h | 286 +- include/asm-ia64/sn/klconfig.h | 482 +- include/asm-ia64/sn/leds.h | 9 +- include/asm-ia64/sn/module.h | 131 +- include/asm-ia64/sn/nodepda.h | 71 +- include/asm-ia64/sn/pda.h | 18 +- include/asm-ia64/sn/rw_mmr.h | 11 +- include/asm-ia64/sn/shub_mmr.h | 402 +- include/asm-ia64/sn/simulator.h | 8 +- include/asm-ia64/sn/sn2/sn_hwperf.h | 10 +- include/asm-ia64/sn/sn_cpuid.h | 96 +- include/asm-ia64/sn/sn_fru.h | 2 +- include/asm-ia64/sn/sn_sal.h | 204 +- include/asm-ia64/sn/sndrv.h | 14 +- include/asm-ia64/sn/types.h | 4 +- include/asm-ia64/spinlock.h | 11 +- include/asm-ia64/string.h | 1 - include/asm-ia64/system.h | 1 + include/asm-ia64/thread_info.h | 19 +- include/asm-ia64/tlb.h | 6 + include/asm-ia64/topology.h | 44 +- include/asm-ia64/uaccess.h | 2 +- include/asm-ia64/unistd.h | 23 +- include/asm-m32r/assembler.h | 35 +- include/asm-m32r/atomic.h | 48 +- include/asm-m32r/bitops.h | 84 +- include/asm-m32r/checksum.h | 10 +- include/asm-m32r/elf.h | 44 +- include/asm-m32r/hardirq.h | 42 +- include/asm-m32r/ide.h | 2 +- include/asm-m32r/io.h | 13 +- include/asm-m32r/irq.h | 17 +- include/asm-m32r/m32102.h | 112 +- include/asm-m32r/mmu_context.h | 21 +- include/asm-m32r/page.h | 3 + include/asm-m32r/pgalloc.h | 14 +- include/asm-m32r/pgtable-2level.h | 20 +- include/asm-m32r/pgtable.h | 227 +- include/asm-m32r/processor.h | 36 +- include/asm-m32r/resource.h | 51 +- include/asm-m32r/rtc.h | 2 +- include/asm-m32r/semaphore.h | 27 +- include/asm-m32r/smp.h | 1 - include/asm-m32r/spinlock.h | 68 +- include/asm-m32r/system.h | 12 +- include/asm-m32r/termbits.h | 1 + include/asm-m32r/thread_info.h | 63 +- include/asm-m32r/topology.h | 5 - include/asm-m32r/unistd.h | 241 +- include/asm-m68k/atomic.h | 2 + include/asm-m68k/blinken.h | 15 +- include/asm-m68k/bootinfo.h | 7 + include/asm-m68k/checksum.h | 13 +- include/asm-m68k/hardirq.h | 30 - include/asm-m68k/io.h | 19 + include/asm-m68k/mc146818rtc.h | 2 + include/asm-m68k/motorola_pgalloc.h | 6 +- include/asm-m68k/pgtable.h | 5 +- include/asm-m68k/resource.h | 47 +- include/asm-m68k/setup.h | 2 +- include/asm-m68k/thread_info.h | 1 + include/asm-m68k/timex.h | 4 - include/asm-m68k/tlbflush.h | 2 + include/asm-m68k/unistd.h | 50 +- include/asm-m68knommu/atomic.h | 74 +- include/asm-m68knommu/bitops.h | 263 +- include/asm-m68knommu/checksum.h | 2 + include/asm-m68knommu/coldfire.h | 10 +- include/asm-m68knommu/delay.h | 55 +- include/asm-m68knommu/elf.h | 8 - include/asm-m68knommu/hardirq.h | 32 - include/asm-m68knommu/io.h | 2 + include/asm-m68knommu/m5206sim.h | 12 +- include/asm-m68knommu/m5249sim.h | 90 + include/asm-m68knommu/m527xsim.h | 20 + include/asm-m68knommu/m528xsim.h | 9 + include/asm-m68knommu/mcfdma.h | 2 +- include/asm-m68knommu/mcfpit.h | 2 +- include/asm-m68knommu/mcfsim.h | 9 +- include/asm-m68knommu/mcfuart.h | 2 +- include/asm-m68knommu/page.h | 10 +- include/asm-m68knommu/page_offset.h | 4 - include/asm-m68knommu/param.h | 33 +- include/asm-m68knommu/pgtable.h | 5 +- include/asm-m68knommu/processor.h | 7 +- include/asm-m68knommu/system.h | 13 + include/asm-m68knommu/thread_info.h | 9 +- include/asm-m68knommu/unistd.h | 75 +- include/asm-mips/addrspace.h | 62 +- include/asm-mips/asmmacro-32.h | 6 +- include/asm-mips/asmmacro-64.h | 18 + include/asm-mips/atomic.h | 631 +- include/asm-mips/bitops.h | 570 +- include/asm-mips/bootinfo.h | 3 + include/asm-mips/break.h | 2 +- include/asm-mips/checksum.h | 11 +- include/asm-mips/compat.h | 9 +- include/asm-mips/cpu-features.h | 38 +- include/asm-mips/cpu-info.h | 1 + include/asm-mips/debug.h | 7 +- include/asm-mips/delay.h | 8 +- include/asm-mips/div64.h | 7 +- include/asm-mips/dma-mapping.h | 8 + include/asm-mips/elf.h | 24 +- include/asm-mips/errno.h | 4 + include/asm-mips/fixmap.h | 1 - include/asm-mips/gdb-stub.h | 1 + include/asm-mips/gt64120.h | 227 +- include/asm-mips/hardirq.h | 44 +- include/asm-mips/hazards.h | 87 +- include/asm-mips/hw_irq.h | 2 - include/asm-mips/ide.h | 12 - include/asm-mips/io.h | 554 +- include/asm-mips/ip32/crime.h | 216 +- include/asm-mips/ip32/mace.h | 153 +- include/asm-mips/irq.h | 30 +- include/asm-mips/irq_cpu.h | 1 + include/asm-mips/jazz.h | 2 + include/asm-mips/mach-atlas/mc146818rtc.h | 39 +- include/asm-mips/mach-au1x00/au1000.h | 324 +- include/asm-mips/mach-au1x00/au1xxx_dbdma.h | 2 + include/asm-mips/mach-au1x00/au1xxx_psc.h | 349 +- include/asm-mips/mach-db1x00/db1x00.h | 37 +- include/asm-mips/mach-ev64120/mach-gt64120.h | 20 +- include/asm-mips/mach-ev96100/mach-gt64120.h | 22 +- include/asm-mips/mach-generic/floppy.h | 1 - include/asm-mips/mach-generic/ide.h | 97 +- include/asm-mips/mach-generic/mangle-port.h | 3 +- include/asm-mips/mach-generic/spaces.h | 4 +- .../mach-ip27/cpu-feature-overrides.h | 1 + include/asm-mips/mach-ip27/mangle-port.h | 3 +- include/asm-mips/mach-ip27/mmzone.h | 27 + include/asm-mips/mach-ip27/spaces.h | 6 +- include/asm-mips/mach-ip27/topology.h | 30 +- include/asm-mips/mach-ip32/mangle-port.h | 2 + include/asm-mips/mach-ip32/mc146818rtc.h | 1 - include/asm-mips/mach-ip32/spaces.h | 18 +- .../asm-mips/mach-ja/cpu-feature-overrides.h | 7 + include/asm-mips/mach-lasat/mach-gt64120.h | 10 +- .../mach-mips/cpu-feature-overrides.h | 3 + include/asm-mips/mach-mips/mach-gt64120.h | 12 +- include/asm-mips/mach-ocelot/mach-gt64120.h | 10 +- .../mach-ocelot3/cpu-feature-overrides.h | 1 + include/asm-mips/mach-pb1x00/pb1550.h | 12 + .../mach-sibyte/cpu-feature-overrides.h | 1 + .../mach-yosemite/cpu-feature-overrides.h | 7 + include/asm-mips/marvell.h | 1 - include/asm-mips/mipsregs.h | 108 +- include/asm-mips/mmu_context.h | 38 +- include/asm-mips/mmzone.h | 3 - include/asm-mips/numnodes.h | 2 +- include/asm-mips/page.h | 17 +- include/asm-mips/pci.h | 65 + include/asm-mips/pci/bridge.h | 7 +- include/asm-mips/pgalloc.h | 4 +- include/asm-mips/pgtable-32.h | 24 +- include/asm-mips/pgtable-64.h | 19 +- include/asm-mips/pgtable-bits.h | 33 +- include/asm-mips/pgtable.h | 135 +- include/asm-mips/pmon.h | 39 +- include/asm-mips/posix_types.h | 8 +- include/asm-mips/prefetch.h | 44 + include/asm-mips/processor.h | 83 +- include/asm-mips/ptrace.h | 2 + include/asm-mips/r4kcache.h | 17 +- include/asm-mips/resource.h | 25 +- include/asm-mips/sections.h | 1 - include/asm-mips/serial.h | 105 +- include/asm-mips/sgi/ioc.h | 2 +- include/asm-mips/sgi/sgi.h | 4 +- include/asm-mips/sgiarcs.h | 4 +- include/asm-mips/sibyte/sb1250.h | 2 +- include/asm-mips/sigcontext.h | 5 +- include/asm-mips/siginfo.h | 122 +- include/asm-mips/sim.h | 5 +- include/asm-mips/smp.h | 7 +- include/asm-mips/sn/hub.h | 19 - include/asm-mips/sn/mapped_kernel.h | 16 +- include/asm-mips/sn/sn0/hubio.h | 2 + include/asm-mips/sn/sn_private.h | 6 +- include/asm-mips/socket.h | 6 +- include/asm-mips/spinlock.h | 270 +- include/asm-mips/stackframe.h | 22 +- include/asm-mips/statfs.h | 32 +- include/asm-mips/string.h | 7 +- include/asm-mips/system.h | 362 +- include/asm-mips/thread_info.h | 3 +- include/asm-mips/titan_dep.h | 40 +- include/asm-mips/tx4927/tx4927.h | 18 +- include/asm-mips/uaccess.h | 222 +- include/asm-mips/unistd.h | 102 +- include/asm-mips/vr41xx/vrc4173.h | 2 + include/asm-mips/war.h | 11 + include/asm-parisc/assembly.h | 17 +- include/asm-parisc/atomic.h | 54 +- include/asm-parisc/bitops.h | 24 +- include/asm-parisc/bug.h | 8 + include/asm-parisc/cache.h | 1 + include/asm-parisc/cacheflush.h | 19 +- include/asm-parisc/checksum.h | 10 +- include/asm-parisc/errno.h | 4 + include/asm-parisc/hardirq.h | 38 +- include/asm-parisc/hardware.h | 5 +- include/asm-parisc/hw_irq.h | 2 +- include/asm-parisc/io.h | 279 +- include/asm-parisc/irq.h | 95 +- include/asm-parisc/parisc-device.h | 17 +- include/asm-parisc/pci.h | 36 +- include/asm-parisc/pdc.h | 16 +- include/asm-parisc/pgalloc.h | 8 +- include/asm-parisc/pgtable.h | 5 +- include/asm-parisc/posix_types.h | 2 +- include/asm-parisc/processor.h | 3 - include/asm-parisc/ptrace.h | 3 +- include/asm-parisc/resource.h | 48 +- include/asm-parisc/serial.h | 15 - include/asm-parisc/spinlock.h | 47 +- include/asm-parisc/string.h | 7 + include/asm-parisc/superio.h | 7 - include/asm-parisc/system.h | 27 +- include/asm-parisc/thread_info.h | 16 +- include/asm-parisc/tlbflush.h | 8 + include/asm-parisc/uaccess.h | 178 +- include/asm-parisc/unistd.h | 39 +- include/asm-ppc/8xx_immap.h | 234 +- include/asm-ppc/commproc.h | 69 +- include/asm-ppc/cputable.h | 6 + include/asm-ppc/gg2.h | 2 +- include/asm-ppc/hardirq.h | 45 +- include/asm-ppc/highmem.h | 6 +- include/asm-ppc/hw_irq.h | 1 - include/asm-ppc/ibm44x.h | 158 +- include/asm-ppc/ibm4xx.h | 8 + include/asm-ppc/immap_cpm2.h | 2 +- include/asm-ppc/io.h | 357 +- include/asm-ppc/irq.h | 27 +- include/asm-ppc/machdep.h | 1 + include/asm-ppc/mmu.h | 24 +- include/asm-ppc/mpc10x.h | 4 + include/asm-ppc/mpc8260.h | 2 +- include/asm-ppc/mpc85xx.h | 42 + include/asm-ppc/mpc8xx.h | 6 +- include/asm-ppc/mv64x60.h | 304 +- include/asm-ppc/mv64x60_defs.h | 1463 +- include/asm-ppc/ocp_ids.h | 1 + include/asm-ppc/open_pic.h | 6 +- include/asm-ppc/pci-bridge.h | 6 +- include/asm-ppc/pgtable.h | 26 +- include/asm-ppc/pmac_feature.h | 21 +- include/asm-ppc/ppc4xx_dma.h | 15 +- include/asm-ppc/ppc4xx_pic.h | 51 +- include/asm-ppc/processor.h | 8 +- include/asm-ppc/reg.h | 5 + include/asm-ppc/reg_booke.h | 57 +- include/asm-ppc/resource.h | 44 +- include/asm-ppc/rwsem.h | 6 +- include/asm-ppc/sections.h | 2 - include/asm-ppc/serial.h | 2 + include/asm-ppc/signal.h | 19 + include/asm-ppc/smp.h | 1 - include/asm-ppc/spinlock.h | 49 +- include/asm-ppc/string.h | 1 - include/asm-ppc/system.h | 1 + include/asm-ppc/thread_info.h | 3 +- include/asm-ppc/time.h | 3 +- include/asm-ppc/timex.h | 4 - include/asm-ppc/uaccess.h | 28 +- include/asm-ppc/uninorth.h | 49 + include/asm-ppc/unistd.h | 7 +- include/asm-ppc64/bug.h | 2 + include/asm-ppc64/cache.h | 19 + include/asm-ppc64/cacheflush.h | 2 +- include/asm-ppc64/cputable.h | 57 +- include/asm-ppc64/eeh.h | 213 +- include/asm-ppc64/floppy.h | 1 + include/asm-ppc64/hardirq.h | 46 +- include/asm-ppc64/iSeries/HvLpEvent.h | 3 + include/asm-ppc64/iSeries/HvReleaseData.h | 1 + include/asm-ppc64/iSeries/LparData.h | 3 - include/asm-ppc64/iSeries/iSeries_pci.h | 18 - include/asm-ppc64/iSeries/mf.h | 41 +- include/asm-ppc64/ide.h | 2 +- include/asm-ppc64/io.h | 44 +- include/asm-ppc64/iommu.h | 26 +- include/asm-ppc64/irq.h | 22 +- include/asm-ppc64/machdep.h | 15 + include/asm-ppc64/mmu.h | 20 +- include/asm-ppc64/mmu_context.h | 13 +- include/asm-ppc64/naca.h | 24 +- include/asm-ppc64/paca.h | 22 +- include/asm-ppc64/page.h | 11 +- include/asm-ppc64/pci-bridge.h | 65 +- include/asm-ppc64/pci.h | 13 +- include/asm-ppc64/pgalloc.h | 1 - include/asm-ppc64/pgtable.h | 33 +- include/asm-ppc64/plpar_wrappers.h | 8 +- include/asm-ppc64/ppcdebug.h | 5 +- include/asm-ppc64/processor.h | 38 +- include/asm-ppc64/prom.h | 62 +- include/asm-ppc64/ptrace-common.h | 2 + include/asm-ppc64/resource.h | 53 +- include/asm-ppc64/rtas.h | 4 +- include/asm-ppc64/serial.h | 111 +- include/asm-ppc64/smp.h | 21 +- include/asm-ppc64/spinlock.h | 20 +- include/asm-ppc64/sstep.h | 11 + include/asm-ppc64/string.h | 1 - include/asm-ppc64/system.h | 1 - include/asm-ppc64/systemcfg.h | 17 +- include/asm-ppc64/thread_info.h | 11 +- include/asm-ppc64/time.h | 4 +- include/asm-ppc64/timex.h | 4 - include/asm-ppc64/tlbflush.h | 3 +- include/asm-ppc64/topology.h | 23 +- include/asm-ppc64/uaccess.h | 4 +- include/asm-ppc64/udbg.h | 4 +- include/asm-ppc64/unistd.h | 24 +- include/asm-ppc64/xics.h | 5 + include/asm-s390/ccwdev.h | 13 + include/asm-s390/cio.h | 2 + include/asm-s390/cpcmd.h | 10 + include/asm-s390/debug.h | 2 + include/asm-s390/elf.h | 11 +- include/asm-s390/extmem.h | 23 +- include/asm-s390/hardirq.h | 47 +- include/asm-s390/io.h | 2 + include/asm-s390/lowcore.h | 47 +- include/asm-s390/page.h | 3 + include/asm-s390/pgtable.h | 12 +- include/asm-s390/resource.h | 47 +- include/asm-s390/siginfo.h | 71 - include/asm-s390/spinlock.h | 20 +- include/asm-s390/string.h | 1 - include/asm-s390/system.h | 16 + include/asm-s390/thread_info.h | 1 + include/asm-s390/timer.h | 2 - include/asm-s390/timex.h | 4 - include/asm-s390/unistd.h | 8 +- include/asm-sh/adc.h | 3 +- include/asm-sh/addrspace.h | 2 + include/asm-sh/bitops.h | 4 +- include/asm-sh/bugs.h | 4 +- include/asm-sh/cache.h | 5 +- include/asm-sh/checksum.h | 15 +- include/asm-sh/cpu-sh3/cache.h | 7 + include/asm-sh/cpu-sh3/cacheflush.h | 42 + include/asm-sh/cpu-sh4/freq.h | 4 + include/asm-sh/dma-mapping.h | 46 +- include/asm-sh/dma.h | 2 + include/asm-sh/freq.h | 3 +- include/asm-sh/hardirq.h | 33 - include/asm-sh/io.h | 2 + include/asm-sh/irq.h | 25 +- include/asm-sh/machvec.h | 2 +- include/asm-sh/mmu_context.h | 2 + include/asm-sh/mpc1211/keyboard.h | 2 +- include/asm-sh/page.h | 8 +- include/asm-sh/pgalloc.h | 8 +- include/asm-sh/pgtable.h | 9 +- include/asm-sh/processor.h | 10 +- include/asm-sh/resource.h | 47 +- include/asm-sh/rtc.h | 3 +- include/asm-sh/se/se.h | 8 + include/asm-sh/shmparam.h | 2 + include/asm-sh/spinlock.h | 13 +- include/asm-sh/string.h | 3 - include/asm-sh/system.h | 1 - include/asm-sh/thread_info.h | 11 +- include/asm-sh/timex.h | 4 - include/asm-sh/ubc.h | 3 +- include/asm-sh/unistd.h | 8 +- include/asm-sh/user.h | 2 - include/asm-sh/watchdog.h | 3 +- include/asm-sh64/io.h | 5 + include/asm-sh64/keyboard.h | 2 +- include/asm-sh64/pgalloc.h | 12 +- include/asm-sh64/pgtable.h | 5 +- include/asm-sh64/processor.h | 6 - include/asm-sh64/thread_info.h | 1 + include/asm-sparc/asi.h | 3 +- include/asm-sparc/atomic.h | 1 + include/asm-sparc/bitext.h | 1 + include/asm-sparc/bitops.h | 8 +- include/asm-sparc/checksum.h | 14 +- include/asm-sparc/dma.h | 2 +- include/asm-sparc/elf.h | 6 +- include/asm-sparc/errno.h | 5 + include/asm-sparc/fbio.h | 6 +- include/asm-sparc/floppy.h | 8 +- include/asm-sparc/hardirq.h | 30 - include/asm-sparc/highmem.h | 4 +- include/asm-sparc/io.h | 194 +- include/asm-sparc/mostek.h | 7 +- include/asm-sparc/oplib.h | 5 +- include/asm-sparc/pcic.h | 6 +- include/asm-sparc/pgtable.h | 23 + include/asm-sparc/pgtsrmmu.h | 1 + include/asm-sparc/processor.h | 8 +- include/asm-sparc/resource.h | 20 +- include/asm-sparc/sbus.h | 2 + include/asm-sparc/sigcontext.h | 3 +- include/asm-sparc/signal.h | 8 +- include/asm-sparc/spinlock.h | 25 +- include/asm-sparc/string.h | 4 +- include/asm-sparc/svr4.h | 6 +- include/asm-sparc/system.h | 8 +- include/asm-sparc/thread_info.h | 1 + include/asm-sparc/timex.h | 4 - include/asm-sparc/uaccess.h | 10 +- include/asm-sparc/unistd.h | 7 +- include/asm-sparc/winmacro.h | 9 +- include/asm-sparc64/atomic.h | 56 +- include/asm-sparc64/bitops.h | 46 +- include/asm-sparc64/checksum.h | 12 +- include/asm-sparc64/compat.h | 66 + include/asm-sparc64/errno.h | 5 + include/asm-sparc64/fbio.h | 4 +- include/asm-sparc64/hardirq.h | 30 - include/asm-sparc64/io.h | 74 +- include/asm-sparc64/kprobes.h | 8 + include/asm-sparc64/mmu_context.h | 3 +- include/asm-sparc64/page.h | 21 +- include/asm-sparc64/pci.h | 5 + include/asm-sparc64/pgalloc.h | 5 +- include/asm-sparc64/pgtable.h | 33 +- include/asm-sparc64/processor.h | 4 - include/asm-sparc64/resource.h | 26 +- include/asm-sparc64/sections.h | 2 +- include/asm-sparc64/siginfo.h | 5 +- include/asm-sparc64/spinlock.h | 7 +- include/asm-sparc64/system.h | 20 +- include/asm-sparc64/thread_info.h | 1 + include/asm-sparc64/timex.h | 4 - include/asm-sparc64/tlb.h | 4 +- include/asm-sparc64/uaccess.h | 40 +- include/asm-sparc64/unistd.h | 7 +- include/asm-um/archparam-i386.h | 78 +- include/asm-um/archparam-ppc.h | 4 - include/asm-um/atomic.h | 5 + include/asm-um/current.h | 13 +- include/asm-um/elf.h | 8 +- include/asm-um/fixmap.h | 9 +- include/asm-um/hardirq.h | 28 +- include/asm-um/page.h | 106 +- include/asm-um/pgalloc.h | 24 +- include/asm-um/pgtable.h | 240 +- include/asm-um/processor-generic.h | 2 +- include/asm-um/processor-i386.h | 6 +- include/asm-um/ptrace-generic.h | 8 +- include/asm-um/system-i386.h | 2 + include/asm-um/thread_info.h | 4 +- include/asm-um/uaccess.h | 4 +- include/asm-um/unistd.h | 108 +- include/asm-v850/hardirq.h | 32 - include/asm-v850/io.h | 9 +- include/asm-v850/pgtable.h | 2 + include/asm-v850/posix_types.h | 4 +- include/asm-v850/processor.h | 7 - include/asm-v850/resource.h | 47 +- include/asm-v850/string.h | 2 - include/asm-v850/thread_info.h | 1 + include/asm-v850/timex.h | 4 - include/asm-x86_64/acpi.h | 6 + include/asm-x86_64/agp.h | 5 +- include/asm-x86_64/apic.h | 2 +- include/asm-x86_64/apicdef.h | 36 +- include/asm-x86_64/atomic.h | 25 + include/asm-x86_64/bitops.h | 8 +- include/asm-x86_64/bootsetup.h | 2 +- include/asm-x86_64/cacheflush.h | 1 + include/asm-x86_64/calling.h | 16 - include/asm-x86_64/checksum.h | 8 +- include/asm-x86_64/compat.h | 7 +- include/asm-x86_64/cpufeature.h | 4 +- include/asm-x86_64/desc.h | 2 + include/asm-x86_64/e820.h | 3 - include/asm-x86_64/elf.h | 4 +- include/asm-x86_64/hardirq.h | 58 +- include/asm-x86_64/hpet.h | 4 + include/asm-x86_64/hw_irq.h | 4 +- include/asm-x86_64/i387.h | 10 - include/asm-x86_64/ia32.h | 8 +- include/asm-x86_64/ia32_unistd.h | 6 +- include/asm-x86_64/io.h | 115 +- include/asm-x86_64/io_apic.h | 2 +- include/asm-x86_64/irq.h | 7 +- include/asm-x86_64/kdebug.h | 4 +- include/asm-x86_64/kprobes.h | 2 + include/asm-x86_64/mce.h | 13 + include/asm-x86_64/mmu_context.h | 10 +- include/asm-x86_64/mmzone.h | 8 +- include/asm-x86_64/mpspec.h | 6 +- include/asm-x86_64/msi.h | 1 + include/asm-x86_64/msr.h | 3 +- include/asm-x86_64/mtrr.h | 3 - include/asm-x86_64/nmi.h | 6 + include/asm-x86_64/numa.h | 12 +- include/asm-x86_64/numnodes.h | 7 +- include/asm-x86_64/page.h | 34 +- include/asm-x86_64/pci.h | 1 - include/asm-x86_64/pda.h | 1 - include/asm-x86_64/pgalloc.h | 38 +- include/asm-x86_64/pgtable.h | 145 +- include/asm-x86_64/processor.h | 16 +- include/asm-x86_64/proto.h | 10 +- include/asm-x86_64/resource.h | 47 +- include/asm-x86_64/smp.h | 52 +- include/asm-x86_64/spinlock.h | 23 +- include/asm-x86_64/swiotlb.h | 4 + include/asm-x86_64/system.h | 8 +- include/asm-x86_64/thread_info.h | 3 +- include/asm-x86_64/timex.h | 4 - include/asm-x86_64/topology.h | 30 +- include/asm-x86_64/uaccess.h | 6 +- include/asm-x86_64/unistd.h | 17 +- include/asm-x86_64/vsyscall.h | 6 +- include/linux/ac97_codec.h | 55 + include/linux/acct.h | 4 + include/linux/acpi.h | 63 + include/linux/affs_fs.h | 89 - include/linux/agp_backend.h | 20 +- include/linux/agpgart.h | 4 +- include/linux/amigaffs.h | 132 - include/linux/arcdevice.h | 22 +- include/linux/ata.h | 46 +- include/linux/atalk.h | 4 +- include/linux/atm.h | 3 + include/linux/atmdev.h | 9 +- include/linux/atmsvc.h | 7 +- include/linux/audit.h | 8 +- include/linux/binfmts.h | 4 +- include/linux/bio.h | 7 + include/linux/bitops.h | 11 +- include/linux/blkdev.h | 68 +- include/linux/bootmem.h | 19 +- include/linux/buffer_head.h | 14 +- include/linux/byteorder/big_endian.h | 12 +- include/linux/byteorder/little_endian.h | 12 +- include/linux/capability.h | 6 +- include/linux/cdev.h | 2 - include/linux/cdrom.h | 6 +- include/linux/coda.h | 4 +- include/linux/coda_proc.h | 21 - include/linux/coda_psdev.h | 2 +- include/linux/com20020.h | 30 +- include/linux/compat.h | 8 +- include/linux/compat_ioctl.h | 13 + include/linux/compiler.h | 17 +- include/linux/completion.h | 6 + include/linux/console.h | 1 + include/linux/console_struct.h | 3 + include/linux/cpu.h | 3 + include/linux/cpufreq.h | 87 +- include/linux/cpumask.h | 16 +- include/linux/crc-ccitt.h | 2 + include/linux/crypto.h | 11 + include/linux/cyclades.h | 4 + include/linux/cyclomx.h | 2 +- include/linux/cycx_drv.h | 6 +- include/linux/dcache.h | 21 +- include/linux/delay.h | 1 + include/linux/device-mapper.h | 11 +- include/linux/device.h | 20 +- include/linux/devpts_fs.h | 2 +- include/linux/dio.h | 188 +- include/linux/divert.h | 2 + include/linux/dm-ioctl.h | 26 +- include/linux/dnotify.h | 46 +- include/linux/dtlk.h | 2 +- include/linux/dvb/frontend.h | 22 +- include/linux/dvb/osd.h | 32 + include/linux/dvb/version.h | 1 + include/linux/edd.h | 4 + include/linux/eeprom.h | 4 +- include/linux/efi.h | 24 +- include/linux/efs_fs.h | 1 + include/linux/efs_vh.h | 17 - include/linux/elevator.h | 64 +- include/linux/elf.h | 7 +- include/linux/etherdevice.h | 2 - include/linux/ext2_fs.h | 2 +- include/linux/ext3_fs.h | 115 +- include/linux/ext3_fs_i.h | 30 +- include/linux/ext3_fs_sb.h | 7 +- include/linux/ext3_jbd.h | 22 +- include/linux/fb.h | 137 +- include/linux/fcdevice.h | 4 - include/linux/fddidevice.h | 7 - include/linux/file.h | 4 +- include/linux/filter.h | 8 + include/linux/firmware.h | 1 + include/linux/fs.h | 138 +- include/linux/gen_stats.h | 5 + include/linux/generic_serial.h | 3 +- include/linux/genhd.h | 35 +- include/linux/gfp.h | 1 + include/linux/hardirq.h | 64 +- include/linux/hdlc.h | 8 +- include/linux/hdreg.h | 26 +- include/linux/highmem.h | 15 +- include/linux/hippidevice.h | 21 - include/linux/hpet.h | 1 + include/linux/i2c-id.h | 21 +- include/linux/i2c-sensor.h | 36 - include/linux/i2c-vid.h | 36 +- include/linux/i2c.h | 18 +- include/linux/i2o.h | 98 +- include/linux/icmp.h | 2 + include/linux/ide.h | 213 +- include/linux/idr.h | 2 +- include/linux/if_arcnet.h | 14 + include/linux/if_ether.h | 3 +- include/linux/if_ppp.h | 2 +- include/linux/if_tun.h | 7 +- include/linux/if_vlan.h | 4 +- include/linux/in6.h | 2 + include/linux/inet.h | 2 + include/linux/inetdevice.h | 3 + include/linux/init.h | 4 +- include/linux/init_task.h | 12 +- include/linux/input.h | 28 +- include/linux/interrupt.h | 63 +- include/linux/ioport.h | 5 + include/linux/ip.h | 38 +- include/linux/ipmi.h | 65 +- include/linux/ipmi_msgdefs.h | 2 +- include/linux/ipv6.h | 59 +- include/linux/ipv6_route.h | 3 +- include/linux/irq.h | 21 +- include/linux/irq_cpustat.h | 4 +- include/linux/isicom.h | 173 - include/linux/jbd.h | 63 +- include/linux/jffs2.h | 4 +- include/linux/jffs2_fs_i.h | 3 +- include/linux/jffs2_fs_sb.h | 11 +- include/linux/jiffies.h | 415 +- include/linux/kallsyms.h | 10 + include/linux/kernel.h | 10 +- include/linux/kernel_stat.h | 20 +- include/linux/kmod.h | 4 - include/linux/kobject.h | 25 +- include/linux/kprobes.h | 6 +- include/linux/libata.h | 124 +- include/linux/list.h | 50 +- include/linux/lockd/debug.h | 9 + include/linux/lockd/xdr.h | 10 +- include/linux/lp.h | 6 - include/linux/major.h | 1 + include/linux/mbcache.h | 40 +- include/linux/mc146818rtc.h | 4 +- include/linux/mca-legacy.h | 5 - include/linux/mca.h | 14 +- include/linux/mempolicy.h | 6 +- include/linux/meye.h | 17 +- include/linux/miscdevice.h | 5 +- include/linux/mm.h | 100 +- include/linux/mmc/mmc.h | 4 +- include/linux/mmzone.h | 105 +- include/linux/module.h | 117 +- include/linux/moduleparam.h | 30 +- include/linux/mount.h | 4 + include/linux/msdos_fs.h | 208 +- include/linux/mtd/cfi.h | 70 +- include/linux/mtd/doc2000.h | 8 +- include/linux/mtd/flashchip.h | 4 +- include/linux/mtd/gen_probe.h | 4 +- include/linux/mtd/map.h | 22 +- include/linux/mtd/nand.h | 26 +- include/linux/mtd/partitions.h | 3 +- include/linux/mv643xx.h | 49 + include/linux/net.h | 9 +- include/linux/netdevice.h | 40 +- include/linux/netfilter.h | 12 +- include/linux/netfilter_arp/arp_tables.h | 6 +- include/linux/netfilter_bridge/ebtables.h | 6 +- include/linux/netfilter_ipv4/ip_conntrack.h | 195 +- .../netfilter_ipv4/ip_conntrack_amanda.h | 13 +- .../linux/netfilter_ipv4/ip_conntrack_core.h | 11 +- .../linux/netfilter_ipv4/ip_conntrack_ftp.h | 30 +- .../netfilter_ipv4/ip_conntrack_helper.h | 16 +- .../linux/netfilter_ipv4/ip_conntrack_irc.h | 18 +- .../netfilter_ipv4/ip_conntrack_protocol.h | 4 - .../linux/netfilter_ipv4/ip_conntrack_tcp.h | 3 +- .../linux/netfilter_ipv4/ip_conntrack_tftp.h | 4 + .../linux/netfilter_ipv4/ip_conntrack_tuple.h | 10 +- include/linux/netfilter_ipv4/ip_nat.h | 47 +- include/linux/netfilter_ipv4/ip_nat_core.h | 21 +- include/linux/netfilter_ipv4/ip_nat_helper.h | 45 +- .../linux/netfilter_ipv4/ip_nat_protocol.h | 8 +- include/linux/netfilter_ipv4/ip_tables.h | 66 +- include/linux/netfilter_ipv4/ipt_LOG.h | 3 +- include/linux/netfilter_ipv4/ipt_MARK.h | 12 + include/linux/netfilter_ipv4/ipt_conntrack.h | 23 +- include/linux/netfilter_ipv4/ipt_multiport.h | 9 + include/linux/netfilter_ipv6/ip6_tables.h | 18 +- include/linux/netfilter_ipv6/ip6t_LOG.h | 3 +- include/linux/netlink.h | 10 +- include/linux/netpoll.h | 1 - include/linux/nfs4.h | 1 + include/linux/nfs_fs.h | 71 +- include/linux/nfs_xdr.h | 2 +- include/linux/nfsd/state.h | 68 +- include/linux/nfsd/xdr4.h | 24 +- include/linux/nodemask.h | 24 +- include/linux/notifier.h | 10 +- include/linux/oprofile.h | 20 +- include/linux/page-flags.h | 45 +- include/linux/pagemap.h | 8 + include/linux/pagevec.h | 7 +- include/linux/parport.h | 13 - include/linux/parport_pc.h | 23 +- include/linux/pci.h | 135 +- include/linux/pci_ids.h | 113 +- include/linux/personality.h | 4 + include/linux/pipe_fs_i.h | 29 +- include/linux/pkt_cls.h | 12 +- include/linux/pkt_sched.h | 34 +- include/linux/pm.h | 148 +- include/linux/pnp.h | 4 +- include/linux/posix-timers.h | 38 +- include/linux/posix_acl.h | 1 - include/linux/prctl.h | 2 +- include/linux/preempt.h | 19 +- include/linux/prio_tree.h | 48 +- include/linux/proc_fs.h | 8 +- include/linux/profile.h | 18 +- include/linux/ptrace.h | 2 + include/linux/quota.h | 3 +- include/linux/quotaops.h | 2 +- include/linux/raid/linear.h | 11 +- include/linux/raid/md.h | 2 +- include/linux/raid/md_k.h | 7 +- include/linux/raid/md_p.h | 4 +- include/linux/raid/multipath.h | 3 +- include/linux/raid/raid1.h | 1 + include/linux/raid/raid5.h | 2 + include/linux/random.h | 7 +- include/linux/rbtree.h | 3 +- include/linux/rcupdate.h | 32 +- include/linux/reiserfs_acl.h | 2 - include/linux/reiserfs_fs.h | 158 +- include/linux/reiserfs_fs_sb.h | 46 +- include/linux/rmap.h | 5 +- include/linux/rtnetlink.h | 8 +- include/linux/sched.h | 351 +- include/linux/sctp.h | 8 +- include/linux/security.h | 147 +- include/linux/selection.h | 23 +- include/linux/sem.h | 1 + include/linux/serial.h | 2 + include/linux/serial_core.h | 33 +- include/linux/serial_reg.h | 293 +- include/linux/serio.h | 16 +- include/linux/skbuff.h | 31 +- include/linux/slab.h | 11 +- include/linux/smb_fs.h | 2 +- include/linux/smb_mount.h | 5 +- include/linux/smp.h | 35 +- include/linux/smp_lock.h | 62 +- include/linux/socket.h | 7 +- include/linux/sonypi.h | 50 +- include/linux/spinlock.h | 182 +- include/linux/sunrpc/auth.h | 4 - include/linux/sunrpc/cache.h | 5 - include/linux/sunrpc/gss_asn1.h | 2 - include/linux/sunrpc/sched.h | 67 +- include/linux/sunrpc/xdr.h | 6 - include/linux/sunrpc/xprt.h | 3 - include/linux/suspend.h | 25 +- include/linux/swap.h | 2 + include/linux/swapops.h | 3 +- include/linux/syscalls.h | 17 +- include/linux/sysctl.h | 14 +- include/linux/sysfs.h | 25 + include/linux/sysrq.h | 46 +- include/linux/tcp.h | 95 +- include/linux/threads.h | 2 +- include/linux/ticable.h | 2 + include/linux/time.h | 285 +- include/linux/times.h | 74 +- include/linux/timex.h | 83 +- include/linux/topology.h | 91 +- include/linux/trdevice.h | 4 - include/linux/tty.h | 2 + include/linux/tty_driver.h | 6 +- include/linux/tty_ldisc.h | 2 +- include/linux/types.h | 16 +- include/linux/udf_fs_sb.h | 4 + include/linux/udp.h | 26 +- include/linux/usb.h | 123 +- include/linux/usb_ch9.h | 27 +- include/linux/usbdevice_fs.h | 35 - include/linux/videodev.h | 15 +- include/linux/videodev2.h | 19 +- include/linux/videotext.h | 85 +- include/linux/vmalloc.h | 1 + include/linux/vs_base.h | 17 +- include/linux/vs_context.h | 107 +- include/linux/vs_cvirt.h | 23 +- include/linux/vs_dlimit.h | 6 +- include/linux/vs_limit.h | 109 +- include/linux/vs_memory.h | 21 +- include/linux/vs_network.h | 27 +- include/linux/vs_sched.h | 3 + include/linux/vs_socket.h | 8 - include/linux/vserver/context.h | 187 +- include/linux/vserver/cvirt.h | 194 +- include/linux/vserver/cvirt_def.h | 18 + include/linux/vserver/debug.h | 313 +- include/linux/vserver/dlimit.h | 4 +- include/linux/vserver/inode.h | 40 +- include/linux/vserver/legacy.h | 1 - include/linux/vserver/limit.h | 139 +- include/linux/vserver/namespace.h | 4 +- include/linux/vserver/network.h | 95 +- include/linux/vserver/sched.h | 212 +- include/linux/vserver/sched_def.h | 2 + include/linux/vserver/switch.h | 5 +- include/linux/vserver/xid.h | 8 +- include/linux/wait.h | 90 +- include/linux/wireless.h | 64 +- include/linux/writeback.h | 8 +- include/linux/xattr.h | 16 + include/media/audiochip.h | 2 +- include/media/ir-common.h | 2 + include/media/saa6752hs.h | 6 +- include/media/saa7146.h | 12 +- include/media/saa7146_vv.h | 7 +- include/media/tuner.h | 16 +- include/media/video-buf-dvb.h | 4 +- include/media/video-buf.h | 64 +- include/mtd/mtd-abi.h | 8 +- include/net/act_api.h | 7 +- include/net/addrconf.h | 4 +- include/net/af_unix.h | 3 - include/net/ax25.h | 2 - include/net/bluetooth/bluetooth.h | 1 + include/net/bluetooth/hci.h | 52 +- include/net/bluetooth/hci_core.h | 82 +- include/net/bluetooth/l2cap.h | 29 +- include/net/bluetooth/rfcomm.h | 59 +- include/net/bluetooth/sco.h | 7 +- include/net/checksum.h | 4 +- include/net/dn.h | 2 - include/net/dn_fib.h | 1 - include/net/dn_nsp.h | 2 +- include/net/dst.h | 21 +- include/net/gen_stats.h | 3 + include/net/icmp.h | 21 +- include/net/if_inet6.h | 15 + include/net/ip.h | 56 +- include/net/ip6_route.h | 4 +- include/net/ip_fib.h | 2 - include/net/ip_vs.h | 6 +- include/net/ipconfig.h | 11 - include/net/ipv6.h | 15 +- include/net/ipx.h | 21 +- include/net/irda/ircomm_event.h | 1 - include/net/irda/ircomm_lmp.h | 27 - include/net/irda/ircomm_param.h | 1 - include/net/irda/ircomm_ttp.h | 31 - include/net/irda/ircomm_tty.h | 2 - include/net/irda/ircomm_tty_attach.h | 2 - include/net/irda/irda_device.h | 2 - include/net/irda/iriap.h | 10 - include/net/irda/irias_object.h | 3 +- include/net/irda/irlan_client.h | 3 - include/net/irda/irlan_common.h | 3 - include/net/irda/irlap.h | 2 - include/net/irda/irlap_frame.h | 1 - include/net/irda/irlmp.h | 6 +- include/net/irda/irttp.h | 3 - include/net/irda/parameters.h | 2 - include/net/irda/qos.h | 1 - include/net/irda/timer.h | 10 +- include/net/iw_handler.h | 54 +- include/net/lapb.h | 4 + include/net/llc_c_ac.h | 19 - include/net/llc_c_ev.h | 12 - include/net/llc_conn.h | 3 - include/net/llc_pdu.h | 1 - include/net/llc_sap.h | 1 - include/net/ndisc.h | 5 + include/net/neighbour.h | 8 +- include/net/pkt_act.h | 40 +- include/net/pkt_cls.h | 218 +- include/net/pkt_sched.h | 278 +- include/net/rose.h | 8 - include/net/route.h | 3 +- include/net/sctp/command.h | 13 - include/net/sctp/constants.h | 8 +- include/net/sctp/sctp.h | 57 +- include/net/sctp/sm.h | 69 +- include/net/sctp/structs.h | 87 +- include/net/sctp/tsnmap.h | 16 - include/net/sctp/ulpevent.h | 5 +- include/net/sctp/ulpqueue.h | 1 - include/net/sctp/user.h | 6 +- include/net/snmp.h | 14 +- include/net/sock.h | 32 +- include/net/tc_act/tc_gact.h | 2 +- include/net/tc_act/tc_pedit.h | 2 +- include/net/tcp.h | 319 +- include/net/tcp_ecn.h | 37 +- include/net/udp.h | 2 + include/net/x25.h | 6 +- include/net/xfrm.h | 25 +- include/pcmcia/bulkmem.h | 176 +- include/pcmcia/ciscode.h | 25 +- include/pcmcia/cisreg.h | 25 +- include/pcmcia/cistpl.h | 35 +- include/pcmcia/cs.h | 58 +- include/pcmcia/cs_types.h | 30 +- include/pcmcia/ds.h | 65 +- include/pcmcia/mem_op.h | 114 +- include/pcmcia/ss.h | 71 +- include/rxrpc/call.h | 5 - include/rxrpc/packet.h | 2 - include/rxrpc/transport.h | 2 - include/scsi/scsi.h | 19 +- include/scsi/scsi_dbg.h | 3 + include/scsi/scsi_device.h | 41 +- include/scsi/scsi_devinfo.h | 2 + include/scsi/scsi_eh.h | 41 +- include/scsi/scsi_host.h | 63 +- include/scsi/scsi_ioctl.h | 2 + include/scsi/scsi_tcq.h | 52 +- include/scsi/scsi_transport.h | 27 +- include/scsi/scsi_transport_fc.h | 304 +- include/scsi/scsi_transport_spi.h | 96 +- include/sound/ac97_codec.h | 30 +- include/sound/ad1848.h | 9 - include/sound/ainstr_fm.h | 2 - include/sound/ainstr_gf1.h | 2 - include/sound/ainstr_iw.h | 2 - include/sound/ainstr_simple.h | 2 - include/sound/ak4531_codec.h | 2 +- include/sound/asound.h | 5 +- include/sound/control.h | 9 +- include/sound/core.h | 13 +- include/sound/cs4231.h | 5 - include/sound/cs46xx.h | 2 +- include/sound/cs8427.h | 3 - include/sound/emu10k1.h | 72 +- include/sound/es1688.h | 3 - include/sound/gus.h | 4 - include/sound/hdsp.h | 14 +- include/sound/info.h | 9 - include/sound/opl3.h | 5 + include/sound/pcm.h | 96 +- include/sound/rawmidi.h | 7 - include/sound/sb.h | 4 - include/sound/seq_kernel.h | 8 + include/sound/seq_midi_emul.h | 2 - include/sound/snd_wavefront.h | 1 - include/sound/soundfont.h | 1 - include/sound/trident.h | 4 - include/sound/version.h | 4 +- include/sound/vx_core.h | 34 +- include/sound/ymfpci.h | 5 +- include/video/kyro.h | 2 +- include/video/mach64.h | 351 +- include/video/maxinefb.h | 5 +- include/video/neomagic.h | 4 +- include/video/newport.h | 36 +- include/video/permedia2.h | 11 + include/video/radeon.h | 479 +- include/video/sstfb.h | 11 +- include/video/tdfx.h | 2 +- include/video/tgafb.h | 6 +- init/Kconfig | 97 +- init/Makefile | 2 + init/calibrate.c | 8 +- init/do_mounts.c | 20 +- init/do_mounts_devfs.c | 1 - init/do_mounts_md.c | 10 + init/do_mounts_rd.c | 17 +- init/initramfs.c | 31 +- init/main.c | 127 +- init/version.c | 7 +- ipc/mqueue.c | 21 +- ipc/msg.c | 7 +- ipc/sem.c | 34 +- ipc/shm.c | 33 +- ipc/util.c | 83 +- ipc/util.h | 13 +- kernel/Makefile | 8 +- kernel/acct.c | 58 +- kernel/audit.c | 102 +- kernel/auditsc.c | 29 +- kernel/capability.c | 69 +- kernel/compat.c | 152 +- kernel/cpu.c | 57 +- kernel/dma.c | 2 +- kernel/exec_domain.c | 3 +- kernel/exit.c | 304 +- kernel/fork.c | 310 +- kernel/futex.c | 78 +- kernel/intermodule.c | 2 +- kernel/irq/autoprobe.c | 1 + kernel/irq/handle.c | 11 - kernel/irq/manage.c | 2 + kernel/irq/proc.c | 2 - kernel/itimer.c | 58 +- kernel/kallsyms.c | 216 +- kernel/kmod.c | 23 - kernel/kprobes.c | 13 +- kernel/ksysfs.c | 3 +- kernel/kthread.c | 25 +- kernel/module.c | 282 +- kernel/panic.c | 46 +- kernel/params.c | 359 +- kernel/pid.c | 137 +- kernel/posix-timers.c | 140 +- kernel/power/Kconfig | 21 +- kernel/power/disk.c | 54 +- kernel/power/main.c | 33 +- kernel/power/pm.c | 31 - kernel/power/poweroff.c | 2 +- kernel/power/process.c | 4 +- kernel/power/swsusp.c | 266 +- kernel/printk.c | 76 +- kernel/profile.c | 305 +- kernel/ptrace.c | 91 +- kernel/rcupdate.c | 47 +- kernel/resource.c | 4 +- kernel/sched.c | 1842 ++- kernel/signal.c | 324 +- kernel/softirq.c | 34 +- kernel/spinlock.c | 237 +- kernel/stop_machine.c | 11 +- kernel/sys.c | 192 +- kernel/sys_ni.c | 3 +- kernel/sysctl.c | 144 +- kernel/time.c | 76 +- kernel/timer.c | 159 +- kernel/user.c | 18 +- kernel/vserver/Kconfig | 38 + kernel/vserver/Makefile | 2 + kernel/vserver/context.c | 305 +- kernel/vserver/cvirt.c | 110 +- kernel/vserver/cvirt_init.h | 11 + kernel/vserver/cvirt_proc.h | 2 + kernel/vserver/dlimit.c | 5 +- kernel/vserver/helper.c | 54 +- kernel/vserver/init.c | 3 +- kernel/vserver/inode.c | 102 +- kernel/vserver/legacy.c | 89 +- kernel/vserver/limit.c | 32 +- kernel/vserver/limit_proc.h | 10 + kernel/vserver/namespace.c | 53 +- kernel/vserver/network.c | 97 +- kernel/vserver/proc.c | 47 +- kernel/vserver/sched.c | 11 +- kernel/vserver/sched_init.h | 1 + kernel/vserver/sched_proc.h | 2 + kernel/vserver/signal.c | 14 +- kernel/vserver/switch.c | 45 +- kernel/vserver/sysctl.c | 7 +- kernel/workqueue.c | 10 +- lib/Kconfig | 18 + lib/Kconfig.debug | 74 +- lib/Makefile | 11 +- lib/bitmap.c | 2 +- lib/dec_and_lock.c | 4 +- lib/idr.c | 25 +- lib/inflate.c | 40 +- lib/iomap.c | 8 +- lib/kernel_lock.c | 144 +- lib/kobject.c | 148 +- lib/kobject_uevent.c | 2 +- lib/parser.c | 1 + lib/radix-tree.c | 6 +- lib/reed_solomon/reed_solomon.c | 16 +- lib/rwsem-spinlock.c | 42 +- lib/rwsem.c | 16 +- lib/string.c | 26 - mm/Makefile | 4 +- mm/bootmem.c | 20 +- mm/fadvise.c | 1 + mm/filemap.c | 249 +- mm/fremap.c | 19 +- mm/highmem.c | 24 +- mm/hugetlb.c | 7 +- mm/madvise.c | 16 +- mm/memory.c | 1169 +- mm/mempolicy.c | 104 +- mm/mincore.c | 51 +- mm/mlock.c | 30 +- mm/mmap.c | 323 +- mm/mprotect.c | 82 +- mm/mremap.c | 56 +- mm/msync.c | 95 +- mm/nommu.c | 868 +- mm/oom_kill.c | 220 +- mm/page-writeback.c | 37 +- mm/page_alloc.c | 693 +- mm/pdflush.c | 6 +- mm/prio_tree.c | 471 +- mm/readahead.c | 455 +- mm/rmap.c | 70 +- mm/shmem.c | 302 +- mm/slab.c | 211 +- mm/swap_state.c | 4 +- mm/swapfile.c | 172 +- mm/thrash.c | 12 +- mm/tiny-shmem.c | 2 - mm/truncate.c | 65 +- mm/vmalloc.c | 127 +- mm/vmscan.c | 59 +- net/802/fc.c | 39 +- net/802/fddi.c | 48 +- net/802/hippi.c | 108 +- net/802/psnap.c | 2 +- net/802/tr.c | 47 +- net/8021q/vlan.c | 99 +- net/8021q/vlan.h | 3 +- net/8021q/vlan_dev.c | 42 +- net/8021q/vlanproc.c | 2 +- net/8021q/vlanproc.h | 4 +- net/Kconfig | 24 +- net/Makefile | 3 +- net/appletalk/Makefile | 2 +- net/appletalk/aarp.c | 6 +- net/appletalk/atalk_proc.c | 6 +- net/appletalk/ddp.c | 24 +- net/atm/addr.c | 93 +- net/atm/addr.h | 2 +- net/atm/br2684.c | 2 +- net/atm/common.c | 7 +- net/atm/lec.c | 322 +- net/atm/lec.h | 1 - net/atm/mpc.c | 11 +- net/atm/resources.c | 7 +- net/atm/signaling.c | 23 +- net/atm/svc.c | 154 +- net/ax25/af_ax25.c | 4 +- net/ax25/ax25_dev.c | 2 +- net/ax25/ax25_ds_subr.c | 2 +- net/ax25/ax25_iface.c | 6 +- net/ax25/ax25_out.c | 2 +- net/ax25/ax25_route.c | 18 +- net/ax25/ax25_uid.c | 2 +- net/bluetooth/af_bluetooth.c | 14 +- net/bluetooth/cmtp/capi.c | 72 +- net/bluetooth/cmtp/cmtp.h | 1 - net/bluetooth/hci_conn.c | 35 +- net/bluetooth/hci_core.c | 96 +- net/bluetooth/hci_event.c | 125 +- net/bluetooth/hci_sock.c | 27 +- net/bluetooth/hci_sysfs.c | 15 +- net/bluetooth/hidp/core.c | 201 +- net/bluetooth/hidp/hidp.h | 45 + net/bluetooth/l2cap.c | 225 +- net/bluetooth/lib.c | 6 +- net/bluetooth/rfcomm/core.c | 194 +- net/bluetooth/rfcomm/sock.c | 76 +- net/bluetooth/rfcomm/tty.c | 16 +- net/bluetooth/sco.c | 5 +- net/bridge/br_if.c | 4 +- net/bridge/br_netfilter.c | 35 +- net/bridge/netfilter/Kconfig | 18 +- net/bridge/netfilter/Makefile | 1 + net/bridge/netfilter/ebt_limit.c | 2 +- net/bridge/netfilter/ebt_log.c | 7 +- net/bridge/netfilter/ebtables.c | 16 +- net/compat.c | 19 +- net/core/datagram.c | 19 +- net/core/dev.c | 419 +- net/core/dev_mcast.c | 2 +- net/core/dst.c | 49 +- net/core/dv.c | 25 +- net/core/ethtool.c | 31 +- net/core/gen_estimator.c | 48 +- net/core/gen_stats.c | 91 +- net/core/iovec.c | 23 - net/core/link_watch.c | 4 +- net/core/neighbour.c | 39 +- net/core/net-sysfs.c | 11 + net/core/netfilter.c | 31 +- net/core/netpoll.c | 54 +- net/core/pktgen.c | 3780 +++-- net/core/rtnetlink.c | 50 +- net/core/scm.c | 4 +- net/core/skbuff.c | 63 +- net/core/sock.c | 89 +- net/core/wireless.c | 215 +- net/decnet/Kconfig | 11 - net/decnet/af_decnet.c | 16 +- net/decnet/dn_dev.c | 69 +- net/decnet/dn_fib.c | 19 +- net/decnet/dn_neigh.c | 9 +- net/decnet/dn_nsp_in.c | 1 + net/decnet/dn_nsp_out.c | 4 +- net/decnet/dn_route.c | 35 +- net/decnet/dn_rules.c | 7 +- net/decnet/dn_table.c | 2 +- net/decnet/dn_timer.c | 47 - net/econet/af_econet.c | 4 +- net/ethernet/eth.c | 63 +- net/ipv4/Kconfig | 24 +- net/ipv4/Makefile | 3 +- net/ipv4/af_inet.c | 69 +- net/ipv4/ah4.c | 2 +- net/ipv4/arp.c | 11 +- net/ipv4/datagram.c | 2 +- net/ipv4/devinet.c | 13 +- net/ipv4/esp4.c | 5 +- net/ipv4/fib_frontend.c | 8 +- net/ipv4/fib_hash.c | 115 +- net/ipv4/fib_lookup.h | 8 + net/ipv4/fib_rules.c | 17 +- net/ipv4/fib_semantics.c | 76 +- net/ipv4/icmp.c | 10 +- net/ipv4/igmp.c | 46 +- net/ipv4/inetpeer.c | 6 +- net/ipv4/ip_fragment.c | 37 +- net/ipv4/ip_gre.c | 8 +- net/ipv4/ip_input.c | 4 +- net/ipv4/ip_options.c | 2 + net/ipv4/ip_output.c | 30 +- net/ipv4/ip_sockglue.c | 23 +- net/ipv4/ipcomp.c | 2 +- net/ipv4/ipconfig.c | 34 +- net/ipv4/ipip.c | 2 +- net/ipv4/ipmr.c | 4 +- net/ipv4/ipvs/ip_vs_app.c | 2 +- net/ipv4/ipvs/ip_vs_conn.c | 10 +- net/ipv4/ipvs/ip_vs_core.c | 45 +- net/ipv4/ipvs/ip_vs_ctl.c | 53 +- net/ipv4/ipvs/ip_vs_est.c | 2 +- net/ipv4/ipvs/ip_vs_ftp.c | 3 +- net/ipv4/ipvs/ip_vs_lblc.c | 2 +- net/ipv4/ipvs/ip_vs_lblcr.c | 4 +- net/ipv4/ipvs/ip_vs_proto.c | 4 +- net/ipv4/ipvs/ip_vs_proto_icmp.c | 4 +- net/ipv4/ipvs/ip_vs_proto_tcp.c | 2 +- net/ipv4/ipvs/ip_vs_proto_udp.c | 2 +- net/ipv4/ipvs/ip_vs_sched.c | 2 +- net/ipv4/ipvs/ip_vs_sync.c | 24 +- net/ipv4/netfilter/Kconfig | 109 +- net/ipv4/netfilter/Makefile | 22 +- net/ipv4/netfilter/arp_tables.c | 28 +- net/ipv4/netfilter/arptable_filter.c | 3 +- net/ipv4/netfilter/ip_conntrack_amanda.c | 62 +- net/ipv4/netfilter/ip_conntrack_core.c | 734 +- net/ipv4/netfilter/ip_conntrack_ftp.c | 172 +- net/ipv4/netfilter/ip_conntrack_irc.c | 84 +- net/ipv4/netfilter/ip_conntrack_proto_icmp.c | 2 +- net/ipv4/netfilter/ip_conntrack_proto_sctp.c | 33 +- net/ipv4/netfilter/ip_conntrack_proto_tcp.c | 68 +- net/ipv4/netfilter/ip_conntrack_standalone.c | 71 +- net/ipv4/netfilter/ip_conntrack_tftp.c | 33 +- net/ipv4/netfilter/ip_nat_amanda.c | 127 +- net/ipv4/netfilter/ip_nat_core.c | 930 +- net/ipv4/netfilter/ip_nat_ftp.c | 257 +- net/ipv4/netfilter/ip_nat_helper.c | 112 +- net/ipv4/netfilter/ip_nat_irc.c | 227 +- net/ipv4/netfilter/ip_nat_proto_icmp.c | 12 +- net/ipv4/netfilter/ip_nat_proto_tcp.c | 27 +- net/ipv4/netfilter/ip_nat_proto_udp.c | 30 +- net/ipv4/netfilter/ip_nat_proto_unknown.c | 4 +- net/ipv4/netfilter/ip_nat_rule.c | 92 +- net/ipv4/netfilter/ip_nat_snmp_basic.c | 147 +- net/ipv4/netfilter/ip_nat_standalone.c | 119 +- net/ipv4/netfilter/ip_nat_tftp.c | 170 +- net/ipv4/netfilter/ip_queue.c | 13 +- net/ipv4/netfilter/ip_tables.c | 303 +- net/ipv4/netfilter/ipt_CLUSTERIP.c | 3 +- net/ipv4/netfilter/ipt_ECN.c | 59 +- net/ipv4/netfilter/ipt_LOG.c | 10 +- net/ipv4/netfilter/ipt_MARK.c | 115 +- net/ipv4/netfilter/ipt_MASQUERADE.c | 103 +- net/ipv4/netfilter/ipt_NETMAP.c | 14 +- net/ipv4/netfilter/ipt_REDIRECT.c | 14 +- net/ipv4/netfilter/ipt_REJECT.c | 82 +- net/ipv4/netfilter/ipt_SAME.c | 22 +- net/ipv4/netfilter/ipt_ULOG.c | 10 +- net/ipv4/netfilter/ipt_hashlimit.c | 18 +- net/ipv4/netfilter/ipt_helper.c | 16 +- net/ipv4/netfilter/ipt_limit.c | 2 +- net/ipv4/netfilter/ipt_multiport.c | 122 +- net/ipv4/netfilter/ipt_recent.c | 29 +- net/ipv4/netfilter/ipt_tcpmss.c | 12 - net/ipv4/netfilter/iptable_filter.c | 24 +- net/ipv4/netfilter/iptable_mangle.c | 22 +- net/ipv4/netfilter/iptable_raw.c | 22 +- net/ipv4/protocol.c | 2 +- net/ipv4/raw.c | 41 +- net/ipv4/route.c | 72 +- net/ipv4/syncookies.c | 6 +- net/ipv4/sysctl_net_ipv4.c | 8 + net/ipv4/tcp.c | 213 +- net/ipv4/tcp_diag.c | 384 +- net/ipv4/tcp_input.c | 738 +- net/ipv4/tcp_ipv4.c | 206 +- net/ipv4/tcp_minisocks.c | 215 +- net/ipv4/tcp_output.c | 190 +- net/ipv4/tcp_timer.c | 37 +- net/ipv4/udp.c | 105 +- net/ipv4/xfrm4_input.c | 3 + net/ipv4/xfrm4_output.c | 18 +- net/ipv4/xfrm4_policy.c | 7 - net/ipv6/Kconfig | 4 +- net/ipv6/addrconf.c | 249 +- net/ipv6/af_inet6.c | 48 +- net/ipv6/ah6.c | 2 +- net/ipv6/anycast.c | 18 +- net/ipv6/datagram.c | 10 +- net/ipv6/esp6.c | 17 +- net/ipv6/exthdrs.c | 77 - net/ipv6/icmp.c | 34 +- net/ipv6/ip6_fib.c | 10 +- net/ipv6/ip6_flowlabel.c | 6 +- net/ipv6/ip6_output.c | 45 +- net/ipv6/ip6_tunnel.c | 16 +- net/ipv6/ipcomp6.c | 2 +- net/ipv6/ipv6_sockglue.c | 6 +- net/ipv6/ipv6_syms.c | 6 - net/ipv6/mcast.c | 90 +- net/ipv6/ndisc.c | 141 +- net/ipv6/netfilter/Kconfig | 1 - net/ipv6/netfilter/ip6_queue.c | 17 +- net/ipv6/netfilter/ip6_tables.c | 283 +- net/ipv6/netfilter/ip6t_LOG.c | 289 +- net/ipv6/netfilter/ip6t_MARK.c | 2 +- net/ipv6/netfilter/ip6t_ah.c | 269 +- net/ipv6/netfilter/ip6t_dst.c | 103 +- net/ipv6/netfilter/ip6t_esp.c | 91 +- net/ipv6/netfilter/ip6t_eui64.c | 5 +- net/ipv6/netfilter/ip6t_frag.c | 111 +- net/ipv6/netfilter/ip6t_hbh.c | 101 +- net/ipv6/netfilter/ip6t_hl.c | 2 +- net/ipv6/netfilter/ip6t_ipv6header.c | 33 +- net/ipv6/netfilter/ip6t_length.c | 3 +- net/ipv6/netfilter/ip6t_limit.c | 5 +- net/ipv6/netfilter/ip6t_mac.c | 3 +- net/ipv6/netfilter/ip6t_mark.c | 3 +- net/ipv6/netfilter/ip6t_multiport.c | 39 +- net/ipv6/netfilter/ip6t_owner.c | 3 +- net/ipv6/netfilter/ip6t_physdev.c | 3 +- net/ipv6/netfilter/ip6t_rt.c | 124 +- net/ipv6/netfilter/ip6table_filter.c | 3 +- net/ipv6/netfilter/ip6table_mangle.c | 7 +- net/ipv6/netfilter/ip6table_raw.c | 3 +- net/ipv6/proc.c | 34 +- net/ipv6/protocol.c | 2 +- net/ipv6/raw.c | 64 +- net/ipv6/reassembly.c | 12 +- net/ipv6/route.c | 99 +- net/ipv6/sit.c | 6 +- net/ipv6/sysctl_net_ipv6.c | 2 +- net/ipv6/tcp_ipv6.c | 94 +- net/ipv6/udp.c | 55 +- net/ipv6/xfrm6_output.c | 20 +- net/ipv6/xfrm6_policy.c | 6 +- net/ipv6/xfrm6_state.c | 6 +- net/ipv6/xfrm6_tunnel.c | 2 +- net/ipx/af_ipx.c | 81 +- net/ipx/ipx_proc.c | 10 +- net/ipx/ipx_route.c | 4 +- net/irda/af_irda.c | 6 +- net/irda/discovery.c | 35 - net/irda/ircomm/ircomm_core.c | 4 +- net/irda/ircomm/ircomm_event.c | 4 +- net/irda/ircomm/ircomm_lmp.c | 128 +- net/irda/ircomm/ircomm_param.c | 17 - net/irda/ircomm/ircomm_ttp.c | 84 +- net/irda/ircomm/ircomm_tty.c | 35 +- net/irda/ircomm/ircomm_tty_attach.c | 200 +- net/irda/ircomm/ircomm_tty_ioctl.c | 2 +- net/irda/irda_device.c | 70 +- net/irda/iriap.c | 51 +- net/irda/irias_object.c | 24 +- net/irda/irlan/irlan_client.c | 45 +- net/irda/irlan/irlan_common.c | 34 +- net/irda/irlan/irlan_provider.c | 8 +- net/irda/irlap.c | 8 +- net/irda/irlap_event.c | 40 +- net/irda/irlap_frame.c | 35 +- net/irda/irlmp.c | 120 +- net/irda/irmod.c | 6 +- net/irda/irnet/Kconfig | 2 +- net/irda/irnet/irnet.h | 6 +- net/irda/irnet/irnet_ppp.c | 9 +- net/irda/irnet/irnet_ppp.h | 7 - net/irda/irsysctl.c | 1 - net/irda/irttp.c | 12 +- net/irda/parameters.c | 11 +- net/irda/qos.c | 36 +- net/irda/timer.c | 21 +- net/key/af_key.c | 12 +- net/lapb/lapb_iface.c | 2 +- net/llc/llc_c_ac.c | 127 +- net/llc/llc_c_ev.c | 88 - net/llc/llc_conn.c | 7 +- net/llc/llc_core.c | 8 +- net/llc/llc_if.c | 24 - net/llc/llc_pdu.c | 13 - net/llc/llc_proc.c | 4 +- net/llc/llc_sap.c | 5 +- net/llc/llc_station.c | 2 +- net/netlink/af_netlink.c | 625 +- net/netlink/netlink_dev.c | 2 +- net/netrom/af_netrom.c | 4 +- net/netrom/nr_dev.c | 8 +- net/netrom/nr_in.c | 9 - net/netrom/nr_route.c | 11 +- net/packet/af_packet.c | 26 +- net/rose/af_rose.c | 2 +- net/rose/rose_dev.c | 38 +- net/rose/rose_link.c | 39 +- net/rose/rose_route.c | 10 +- net/rose/rose_subr.c | 4 +- net/rxrpc/call.c | 15 +- net/rxrpc/connection.c | 4 +- net/rxrpc/internal.h | 3 - net/rxrpc/krxiod.c | 4 +- net/rxrpc/krxsecd.c | 2 +- net/rxrpc/krxtimod.c | 2 +- net/rxrpc/peer.c | 4 +- net/rxrpc/rxrpc_syms.c | 16 - net/rxrpc/transport.c | 12 +- net/sched/Kconfig | 57 +- net/sched/Makefile | 4 +- net/sched/act_api.c | 722 +- net/sched/cls_api.c | 238 +- net/sched/cls_fw.c | 351 +- net/sched/cls_route.c | 372 +- net/sched/cls_rsvp.c | 5 +- net/sched/cls_rsvp.h | 132 +- net/sched/cls_rsvp6.c | 5 +- net/sched/cls_tcindex.c | 415 +- net/sched/cls_u32.c | 294 +- net/sched/estimator.c | 4 +- net/sched/gact.c | 180 +- net/sched/ipt.c | 296 +- net/sched/mirred.c | 182 +- net/sched/pedit.c | 160 +- net/sched/police.c | 251 +- net/sched/sch_api.c | 171 +- net/sched/sch_atm.c | 44 +- net/sched/sch_cbq.c | 202 +- net/sched/sch_dsmark.c | 21 +- net/sched/sch_fifo.c | 28 +- net/sched/sch_generic.c | 55 +- net/sched/sch_gred.c | 44 +- net/sched/sch_hfsc.c | 153 +- net/sched/sch_htb.c | 139 +- net/sched/sch_ingress.c | 38 +- net/sched/sch_netem.c | 75 +- net/sched/sch_prio.c | 82 +- net/sched/sch_red.c | 56 +- net/sched/sch_sfq.c | 16 +- net/sched/sch_tbf.c | 22 +- net/sched/sch_teql.c | 9 +- net/sctp/associola.c | 106 +- net/sctp/bind_addr.c | 21 +- net/sctp/chunk.c | 10 +- net/sctp/command.c | 23 - net/sctp/debug.c | 20 +- net/sctp/endpointola.c | 60 +- net/sctp/input.c | 104 +- net/sctp/inqueue.c | 39 +- net/sctp/ipv6.c | 61 +- net/sctp/objcnt.c | 2 +- net/sctp/output.c | 4 +- net/sctp/outqueue.c | 40 +- net/sctp/proc.c | 2 +- net/sctp/protocol.c | 72 +- net/sctp/sm_make_chunk.c | 192 +- net/sctp/sm_sideeffect.c | 68 +- net/sctp/sm_statefuns.c | 534 +- net/sctp/sm_statetable.c | 50 +- net/sctp/socket.c | 267 +- net/sctp/ssnmap.c | 7 +- net/sctp/transport.c | 96 +- net/sctp/tsnmap.c | 39 +- net/sctp/ulpevent.c | 59 +- net/sctp/ulpqueue.c | 24 +- net/socket.c | 49 +- net/sunrpc/auth.c | 20 +- net/sunrpc/auth_gss/auth_gss.c | 55 +- net/sunrpc/auth_gss/gss_generic_token.c | 35 - net/sunrpc/auth_gss/gss_krb5_crypto.c | 2 +- net/sunrpc/auth_gss/gss_krb5_mech.c | 3 - net/sunrpc/auth_gss/gss_mech_switch.c | 12 +- net/sunrpc/auth_gss/gss_spkm3_mech.c | 9 +- net/sunrpc/auth_gss/svcauth_gss.c | 6 +- net/sunrpc/auth_null.c | 3 +- net/sunrpc/auth_unix.c | 8 +- net/sunrpc/cache.c | 45 +- net/sunrpc/clnt.c | 51 +- net/sunrpc/pmap_clnt.c | 6 +- net/sunrpc/rpc_pipe.c | 16 +- net/sunrpc/sched.c | 573 +- net/sunrpc/sunrpc_syms.c | 1 - net/sunrpc/svcauth.c | 5 +- net/sunrpc/svcauth_unix.c | 130 +- net/sunrpc/svcsock.c | 6 +- net/sunrpc/xdr.c | 137 +- net/sunrpc/xprt.c | 20 +- net/unix/af_unix.c | 75 +- net/unix/sysctl_net_unix.c | 2 +- net/wanrouter/af_wanpipe.c | 2 +- net/x25/af_x25.c | 88 +- net/x25/sysctl_net_x25.c | 1 - net/x25/x25_dev.c | 46 +- net/x25/x25_facilities.c | 14 - net/x25/x25_in.c | 14 - net/x25/x25_link.c | 48 +- net/x25/x25_out.c | 13 - net/x25/x25_proc.c | 11 +- net/x25/x25_route.c | 2 +- net/x25/x25_subr.c | 33 +- net/x25/x25_timer.c | 14 - net/xfrm/Kconfig | 4 - net/xfrm/Makefile | 3 +- net/xfrm/xfrm_algo.c | 85 +- net/xfrm/xfrm_input.c | 4 + net/xfrm/xfrm_policy.c | 86 +- net/xfrm/xfrm_state.c | 72 +- net/xfrm/xfrm_user.c | 22 +- scripts/Makefile.build | 2 +- scripts/Makefile.clean | 2 +- scripts/Makefile.lib | 27 + scripts/Makefile.modinst | 5 +- scripts/Makefile.modpost | 1 + scripts/basic/docproc.c | 33 +- scripts/basic/fixdep.c | 18 +- scripts/basic/split-include.c | 2 +- scripts/checkstack.pl | 3 + scripts/conmakehash.c | 2 +- scripts/gen_initramfs_list.sh | 147 +- scripts/kallsyms.c | 586 +- scripts/kconfig/Makefile | 22 +- scripts/kconfig/conf.c | 6 +- scripts/kconfig/confdata.c | 22 +- scripts/kconfig/expr.c | 10 + scripts/kconfig/expr.h | 2 + scripts/kconfig/gconf.c | 32 - scripts/kconfig/gconf.glade | 40 +- scripts/kconfig/lkc.h | 13 + scripts/kconfig/lkc_proto.h | 1 + scripts/kconfig/mconf.c | 452 +- scripts/kconfig/menu.c | 40 - scripts/kconfig/symbol.c | 40 +- scripts/kconfig/zconf.tab.c_shipped | 1 + scripts/kconfig/zconf.y | 1 + scripts/kernel-doc | 188 +- scripts/lxdialog/Makefile | 4 + scripts/lxdialog/dialog.h | 3 + scripts/lxdialog/menubox.c | 11 +- scripts/mksysmap | 2 +- scripts/mod/file2alias.c | 19 +- scripts/mod/modpost.c | 81 +- scripts/mod/modpost.h | 10 +- scripts/mod/sumversion.c | 94 +- scripts/reference_discarded.pl | 3 +- scripts/reference_init.pl | 7 +- scripts/ver_linux | 2 + security/Kconfig | 41 + security/Makefile | 2 + security/capability.c | 1 + security/commoncap.c | 110 +- security/dummy.c | 94 +- security/keys/compat.c | 2 +- security/keys/key.c | 4 +- security/keys/keyctl.c | 2 +- security/keys/keyring.c | 2 +- security/security.c | 99 +- security/selinux/Kconfig | 11 +- security/selinux/avc.c | 611 +- security/selinux/hooks.c | 557 +- security/selinux/include/av_inherit.h | 72 +- security/selinux/include/av_perm_to_string.h | 453 +- security/selinux/include/av_permissions.h | 26 +- security/selinux/include/avc.h | 49 +- security/selinux/include/class_to_string.h | 110 +- .../selinux/include/common_perm_to_string.h | 115 +- security/selinux/include/flask.h | 2 + security/selinux/include/netif.h | 11 +- security/selinux/include/objsec.h | 13 +- security/selinux/netif.c | 122 +- security/selinux/nlmsgtab.c | 3 + security/selinux/selinuxfs.c | 309 +- security/selinux/ss/avtab.c | 37 +- security/selinux/ss/avtab.h | 1 + security/selinux/ss/conditional.c | 52 +- security/selinux/ss/ebitmap.c | 21 +- security/selinux/ss/mls.c | 89 +- security/selinux/ss/policydb.c | 289 +- security/selinux/ss/policydb.h | 12 +- security/selinux/ss/services.c | 14 +- security/selinux/ss/sidtab.c | 21 +- sound/Kconfig | 4 +- sound/Makefile | 2 +- sound/arm/Kconfig | 9 +- sound/arm/sa11xx-uda1341.c | 4 +- sound/core/Kconfig | 77 +- sound/core/control.c | 239 +- sound/core/hwdep.c | 2 +- sound/core/info.c | 26 +- sound/core/init.c | 36 +- sound/core/ioctl32/hwdep32.c | 34 +- sound/core/ioctl32/ioctl32.c | 305 +- sound/core/ioctl32/ioctl32.h | 91 +- sound/core/ioctl32/pcm32.c | 343 +- sound/core/ioctl32/rawmidi32.c | 16 +- sound/core/ioctl32/seq32.c | 6 +- sound/core/ioctl32/timer32.c | 10 +- sound/core/memalloc.c | 9 +- sound/core/memory.c | 18 +- sound/core/oss/mixer_oss.c | 40 +- sound/core/oss/mulaw.c | 1 + sound/core/oss/pcm_oss.c | 38 +- sound/core/oss/pcm_plugin.c | 49 +- sound/core/oss/pcm_plugin.h | 1 - sound/core/oss/rate.c | 2 + sound/core/oss/route.c | 91 +- sound/core/pcm.c | 36 +- sound/core/pcm_lib.c | 101 +- sound/core/pcm_memory.c | 2 +- sound/core/pcm_misc.c | 11 +- sound/core/pcm_native.c | 660 +- sound/core/rawmidi.c | 17 +- sound/core/seq/Makefile | 2 + sound/core/seq/instr/ainstr_fm.c | 5 +- sound/core/seq/instr/ainstr_gf1.c | 5 +- sound/core/seq/instr/ainstr_iw.c | 5 +- sound/core/seq/instr/ainstr_simple.c | 5 +- sound/core/seq/oss/seq_oss.c | 14 +- sound/core/seq/oss/seq_oss_device.h | 1 - sound/core/seq/oss/seq_oss_init.c | 39 +- sound/core/seq/oss/seq_oss_readq.c | 3 +- sound/core/seq/oss/seq_oss_timer.c | 2 +- sound/core/seq/seq.c | 21 +- sound/core/seq/seq_clientmgr.c | 11 +- sound/core/seq/seq_clientmgr.h | 1 - sound/core/seq/seq_device.c | 32 +- sound/core/seq/seq_dummy.c | 6 +- sound/core/seq/seq_instr.c | 18 +- sound/core/seq/seq_memory.c | 5 +- sound/core/seq/seq_memory.h | 1 - sound/core/seq/seq_midi.c | 12 +- sound/core/seq/seq_midi_emul.c | 17 +- sound/core/seq/seq_midi_event.c | 6 +- sound/core/sgbuf.c | 6 +- sound/core/sound.c | 29 +- sound/core/timer.c | 17 +- sound/drivers/Kconfig | 48 +- sound/drivers/dummy.c | 15 +- sound/drivers/mpu401/mpu401.c | 13 +- sound/drivers/mpu401/mpu401_uart.c | 4 +- sound/drivers/opl3/Makefile | 1 + sound/drivers/opl3/opl3_drums.c | 8 +- sound/drivers/opl3/opl3_lib.c | 142 +- sound/drivers/opl3/opl3_midi.c | 2 +- sound/drivers/opl3/opl3_seq.c | 4 +- sound/drivers/opl4/opl4_lib.c | 13 +- sound/drivers/serial-u16550.c | 23 +- sound/drivers/virmidi.c | 9 +- sound/drivers/vx/vx_cmd.c | 2 +- sound/drivers/vx/vx_cmd.h | 2 - sound/drivers/vx/vx_core.c | 116 +- sound/drivers/vx/vx_hwdep.c | 138 +- sound/drivers/vx/vx_pcm.c | 8 +- sound/drivers/vx/vx_uer.c | 2 +- sound/i2c/cs8427.c | 21 +- sound/i2c/i2c.c | 2 +- sound/i2c/l3/uda1341.c | 7 +- sound/i2c/other/ak4117.c | 2 +- sound/isa/Kconfig | 189 +- sound/isa/ad1816a/ad1816a.c | 21 +- sound/isa/ad1816a/ad1816a_lib.c | 10 +- sound/isa/ad1848/ad1848.c | 15 +- sound/isa/ad1848/ad1848_lib.c | 30 +- sound/isa/als100.c | 23 +- sound/isa/azt2320.c | 23 +- sound/isa/cmi8330.c | 23 +- sound/isa/cs423x/cs4231.c | 19 +- sound/isa/cs423x/cs4231_lib.c | 42 +- sound/isa/cs423x/cs4236.c | 29 +- sound/isa/dt019x.c | 19 +- sound/isa/es1688/es1688.c | 17 +- sound/isa/es1688/es1688_lib.c | 8 +- sound/isa/es18xx.c | 38 +- sound/isa/gus/gus_dma.c | 12 +- sound/isa/gus/gus_mem.c | 3 +- sound/isa/gus/gus_sample.c | 2 +- sound/isa/gus/gusclassic.c | 21 +- sound/isa/gus/gusextreme.c | 29 +- sound/isa/gus/gusmax.c | 21 +- sound/isa/gus/interwave.c | 27 +- sound/isa/opl3sa2.c | 41 +- sound/isa/opti9xx/opti92x-ad1848.c | 12 +- sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/emu8000_callback.c | 4 + sound/isa/sb/emu8000_pcm.c | 3 +- sound/isa/sb/es968.c | 13 +- sound/isa/sb/sb16.c | 29 +- sound/isa/sb/sb16_main.c | 10 +- sound/isa/sb/sb8.c | 13 +- sound/isa/sb/sb8_main.c | 4 +- sound/isa/sb/sb_common.c | 2 +- sound/isa/sgalaxy.c | 15 +- sound/isa/sscape.c | 39 +- sound/isa/wavefront/wavefront.c | 35 +- sound/isa/wavefront/wavefront_fx.c | 3 +- sound/isa/wavefront/wavefront_synth.c | 100 +- sound/oss/Kconfig | 28 +- sound/oss/Makefile | 3 + sound/oss/ac97.c | 13 +- sound/oss/ac97.h | 16 - sound/oss/ac97_codec.c | 92 + sound/oss/aci.c | 9 +- sound/oss/aci.h | 1 - sound/oss/ad1816.c | 23 +- sound/oss/ad1848.c | 30 +- sound/oss/ad1889.c | 63 +- sound/oss/ad1889.h | 2 +- sound/oss/adlib_card.c | 2 +- sound/oss/aedsp16.c | 30 +- sound/oss/ali5455.c | 30 +- sound/oss/au1000.c | 206 +- sound/oss/audio.c | 4 +- sound/oss/audio_syms.c | 3 - sound/oss/awe_wave.c | 14 +- sound/oss/btaudio.c | 20 +- sound/oss/cmpci.c | 37 +- sound/oss/cs4232.c | 23 +- sound/oss/cs4281/cs4281_wrapper-24.c | 4 +- sound/oss/cs4281/cs4281m.c | 58 +- sound/oss/cs4281/cs4281pm-24.c | 6 +- sound/oss/cs46xx.c | 85 +- sound/oss/cs46xx_wrapper-24.h | 2 +- sound/oss/cs46xxpm-24.h | 1 - sound/oss/dev_table.c | 4 +- sound/oss/dev_table.h | 1 - sound/oss/dmabuf.c | 2 +- sound/oss/dmasound/dmasound_awacs.c | 35 +- sound/oss/emu10k1/audio.c | 13 +- sound/oss/emu10k1/audio.h | 3 - sound/oss/emu10k1/cardmi.c | 59 +- sound/oss/emu10k1/cardmi.h | 17 - sound/oss/emu10k1/cardwi.c | 2 +- sound/oss/emu10k1/efxmgr.c | 4 +- sound/oss/emu10k1/hwaccess.c | 38 +- sound/oss/emu10k1/hwaccess.h | 2 - sound/oss/emu10k1/main.c | 8 +- sound/oss/emu10k1/midi.c | 2 +- sound/oss/emu10k1/voicemgr.c | 3 +- sound/oss/es1370.c | 14 +- sound/oss/es1371.c | 20 +- sound/oss/esssolo1.c | 12 +- sound/oss/forte.c | 14 +- sound/oss/gus_card.c | 16 +- sound/oss/gus_wave.c | 4 +- sound/oss/i810_audio.c | 171 +- sound/oss/ite8172.c | 98 +- sound/oss/kahlua.c | 2 +- sound/oss/mad16.c | 28 +- sound/oss/maestro.c | 24 +- sound/oss/maestro3.c | 33 +- sound/oss/maestro3.h | 4 +- sound/oss/maui.c | 4 +- sound/oss/midibuf.c | 2 +- sound/oss/mpu401.c | 4 +- sound/oss/msnd.c | 107 +- sound/oss/msnd.h | 18 +- sound/oss/msnd_pinnacle.c | 203 +- sound/oss/nec_vrc5477.c | 55 +- sound/oss/nm256.h | 10 +- sound/oss/nm256_audio.c | 14 +- sound/oss/opl3.c | 2 +- sound/oss/opl3sa.c | 14 +- sound/oss/opl3sa2.c | 29 +- sound/oss/pas2_card.c | 34 +- sound/oss/pss.c | 34 +- sound/oss/rme96xx.c | 34 +- sound/oss/sb.h | 3 - sound/oss/sb_card.c | 2 +- sound/oss/sb_common.c | 15 +- sound/oss/sb_ess.c | 2 +- sound/oss/sequencer.c | 4 +- sound/oss/sgalaxy.c | 10 +- sound/oss/sonicvibes.c | 12 +- sound/oss/sound_calls.h | 1 - sound/oss/sound_syms.c | 3 - sound/oss/soundcard.c | 12 +- sound/oss/sscape.c | 14 +- sound/oss/swarm_cs4297a.c | 233 +- sound/oss/sys_timer.c | 2 +- sound/oss/trident.c | 14 +- sound/oss/trix.c | 20 +- sound/oss/uart401.c | 8 +- sound/oss/uart6850.c | 6 +- sound/oss/via82cxxx_audio.c | 224 +- sound/oss/vwsnd.c | 6 +- sound/oss/waveartist.c | 2 +- sound/oss/wavfront.c | 102 +- sound/oss/wf_midi.c | 2 +- sound/oss/ymfpci.c | 16 +- sound/oss/ymfpci.h | 2 +- sound/parisc/Kconfig | 9 +- sound/parisc/harmony.c | 22 +- sound/pci/Kconfig | 321 +- sound/pci/Makefile | 3 + sound/pci/ac97/Makefile | 7 +- sound/pci/ac97/ac97_codec.c | 836 +- sound/pci/ac97/ac97_id.h | 3 + sound/pci/ac97/ac97_local.h | 34 +- sound/pci/ac97/ac97_patch.c | 325 +- sound/pci/ac97/ac97_patch.h | 1 + sound/pci/ac97/ac97_pcm.c | 170 +- sound/pci/ac97/ac97_proc.c | 18 +- sound/pci/ac97/ak4531_codec.c | 34 +- sound/pci/ali5451/ali5451.c | 23 +- sound/pci/als4000.c | 16 +- sound/pci/atiixp.c | 80 +- sound/pci/atiixp_modem.c | 30 +- sound/pci/au88x0/au88x0.c | 28 +- sound/pci/au88x0/au88x0.h | 8 +- sound/pci/au88x0/au88x0_core.c | 83 +- sound/pci/au88x0/au88x0_eq.c | 94 +- sound/pci/au88x0/au88x0_mixer.c | 4 +- sound/pci/au88x0/au88x0_pcm.c | 13 +- sound/pci/azt3328.c | 53 +- sound/pci/bt87x.c | 188 +- sound/pci/cmipci.c | 53 +- sound/pci/cs4281.c | 72 +- sound/pci/cs46xx/cs46xx.c | 13 +- sound/pci/cs46xx/cs46xx_lib.c | 226 +- sound/pci/cs46xx/cs46xx_lib.h | 40 - sound/pci/cs46xx/dsp_spos.c | 34 +- sound/pci/cs46xx/dsp_spos_scb_lib.c | 16 +- sound/pci/cs46xx/imgs/cwcdma.h | 8 +- sound/pci/emu10k1/Makefile | 4 +- sound/pci/emu10k1/emu10k1.c | 51 +- sound/pci/emu10k1/emu10k1_main.c | 44 +- sound/pci/emu10k1/emu10k1_synth.c | 4 +- sound/pci/emu10k1/emufx.c | 227 +- sound/pci/emu10k1/emumixer.c | 71 +- sound/pci/emu10k1/emupcm.c | 25 +- sound/pci/emu10k1/emuproc.c | 250 +- sound/pci/emu10k1/io.c | 25 - sound/pci/emu10k1/irq.c | 4 +- sound/pci/ens1370.c | 79 +- sound/pci/es1938.c | 32 +- sound/pci/es1968.c | 100 +- sound/pci/fm801.c | 30 +- sound/pci/ice1712/Makefile | 2 +- sound/pci/ice1712/ak4xxx.c | 3 +- sound/pci/ice1712/aureon.c | 1254 +- sound/pci/ice1712/aureon.h | 15 +- sound/pci/ice1712/delta.c | 16 + sound/pci/ice1712/delta.h | 4 +- sound/pci/ice1712/ews.c | 59 +- sound/pci/ice1712/hoontech.c | 164 +- sound/pci/ice1712/ice1712.c | 78 +- sound/pci/ice1712/ice1712.h | 25 +- sound/pci/ice1712/ice1724.c | 20 +- sound/pci/intel8x0.c | 414 +- sound/pci/intel8x0m.c | 65 +- sound/pci/korg1212/korg1212.c | 169 +- sound/pci/maestro3.c | 82 +- sound/pci/mixart/mixart.c | 40 +- sound/pci/mixart/mixart.h | 2 +- sound/pci/mixart/mixart_core.c | 7 +- sound/pci/mixart/mixart_hwdep.c | 174 +- sound/pci/mixart/mixart_hwdep.h | 3 +- sound/pci/nm256/nm256.c | 123 +- sound/pci/rme32.c | 50 +- sound/pci/rme96.c | 32 +- sound/pci/rme9652/hdsp.c | 379 +- sound/pci/rme9652/rme9652.c | 22 +- sound/pci/sonicvibes.c | 25 +- sound/pci/trident/trident.c | 11 +- sound/pci/trident/trident_main.c | 63 +- sound/pci/trident/trident_memory.c | 23 - sound/pci/trident/trident_synth.c | 4 +- sound/pci/via82xx.c | 123 +- sound/pci/vx222/vx222.c | 27 +- sound/pci/vx222/vx222_ops.c | 26 +- sound/pci/ymfpci/ymfpci.c | 15 +- sound/pci/ymfpci/ymfpci_main.c | 31 +- sound/pcmcia/Kconfig | 18 +- sound/pcmcia/pdaudiocf/pdaudiocf.c | 33 +- sound/pcmcia/pdaudiocf/pdaudiocf.h | 2 - sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 6 +- sound/pcmcia/vx/vx_entry.c | 96 +- sound/pcmcia/vx/vxp_ops.c | 28 +- sound/pcmcia/vx/vxpocket.c | 19 +- sound/pcmcia/vx/vxpocket.h | 3 - sound/ppc/Kconfig | 5 + sound/ppc/daca.c | 24 +- sound/ppc/pmac.c | 44 +- sound/ppc/pmac.h | 12 +- sound/ppc/tumbler.c | 47 +- sound/sound_core.c | 2 +- sound/sparc/amd7930.c | 7 +- sound/sparc/cs4231.c | 34 +- sound/synth/emux/emux.c | 8 +- sound/synth/emux/emux_seq.c | 3 +- sound/synth/emux/emux_synth.c | 10 - sound/synth/emux/soundfont.c | 8 - sound/usb/Kconfig | 15 +- sound/usb/usbaudio.c | 193 +- sound/usb/usbaudio.h | 5 +- sound/usb/usbmidi.c | 20 +- sound/usb/usbmixer.c | 68 +- sound/usb/usbmixer_maps.c | 9 + sound/usb/usbquirks.h | 67 +- sound/usb/usx2y/Makefile | 2 +- sound/usb/usx2y/usX2Yhwdep.c | 18 +- sound/usb/usx2y/usbusx2y.c | 65 +- sound/usb/usx2y/usbusx2y.h | 47 +- sound/usb/usx2y/usbusx2yaudio.c | 818 +- sound/usb/usx2y/usx2y.h | 6 +- usr/Makefile | 52 +- usr/gen_init_cpio.c | 360 +- 6979 files changed, 283087 insertions(+), 229553 deletions(-) diff --git a/CREDITS b/CREDITS index 22252bdf5..71aa0d4d6 100644 --- a/CREDITS +++ b/CREDITS @@ -46,13 +46,11 @@ D: Various kernel patches S: United Kingdom N: Werner Almesberger -E: werner.almesberger@epfl.ch +E: werner@almesberger.net +W: http://www.almesberger.net/ D: dosfs, LILO, some fd features, ATM, various other hacks here and there -S: Ecole Polytechnique Federale de Lausanne -S: DSC ICA -S: INN (Ecublens) -S: CH-1015 Lausanne -S: Switzerland +S: Buenos Aires +S: Argentina N: Tim Alpaerts E: tim_alpaerts@toyota-motor-europe.com @@ -497,6 +495,14 @@ E: m@mbsks.franken.de D: REINER SCT cyberJack pinpad/e-com USB chipcard reader driver S: Germany +N: Adrian Bunk +E: bunk@stusta.de +P: 1024D/4F12B400 B29C E71E FE19 6755 5C8A 84D4 99FC EA98 4F12 B400 +D: misc kernel hacking and testing +S: Grasmeierstrasse 11 +S: 80805 Muenchen +S: Germany + N: Ray Burr E: ryb@nightmare.com D: Original author of Amiga FFS filesystem @@ -799,6 +805,21 @@ S: One Dell Way S: Round Rock, TX 78682 S: USA +N: Ben Dooks +E: ben-linux@fluff.org +E: ben@simtec.co.uk +W: http://www.fluff.org/ben/ +W: http://www.simtec.co.uk/ +D: Samsung S3C2410/S3C2440 support, general ARM support +D: Maintaining Simtec Electronics development boards +S: Simtec Electronics +S: Avondale Drive +S: Tarleton +S: Preston +S: Lancs +S: PR4 6AX +S: United Kingdom + N: John G Dorsey E: john+@cs.cmu.edu D: ARM Linux ports to Assabet/Neponset, Spot @@ -1805,7 +1826,8 @@ D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards N: Greg Kroah-Hartman E: greg@kroah.com -W: http://www.kroah.com/linux-usb/ +E: gregkh@suse.de +W: http://www.kroah.com/linux/ D: USB Serial Converter driver framework, USB Handspring Visor driver D: ConnectTech WHITEHeat USB driver, Generic USB Serial driver D: USB I/O Edgeport driver, USB Serial IrDA driver @@ -1813,6 +1835,7 @@ D: USB Bluetooth driver, USB Skeleton driver D: bits and pieces of USB core code. D: PCI Hotplug core, PCI Hotplug Compaq driver modifications D: portions of the Linux Security Module (LSM) framework +D: parts of the driver core, debugfs. N: Russell Kroll E: rkroll@exploits.org @@ -1887,7 +1910,7 @@ D: Early protocol filter for bridging code D: Bug fixes N: Paul Laufer -E: pelaufer@csupomona.edu +E: paul@laufernet.com D: Soundblaster driver fixes, ISAPnP quirk S: California, USA @@ -2015,6 +2038,17 @@ N: H.J. Lu E: hjl@gnu.ai.mit.edu D: GCC + libraries hacker +N: Michal Ludvig +E: michal@logix.cz +E: michal.ludvig@asterisk.co.nz +W: http://www.logix.cz/michal +P: 1024D/C45B2218 1162 6471 D391 76E0 9F99 29DA 0C3A 2509 C45B 2218 +D: VIA PadLock driver +D: Netfilter pkttype module +S: Asterisk Ltd. +S: Auckland +S: New Zealand + N: Tuomas J. Lukka E: Tuomas.Lukka@Helsinki.FI D: Original dual-monitor patches @@ -2764,7 +2798,7 @@ N: Luca Risolia E: luca.risolia@studio.unibo.it P: 1024D/FCE635A4 88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4 D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips -D: V4L2 driver for SN9C10[12] PC Camera Controllers +D: V4L2 driver for SN9C10x PC Camera Controllers S: Via Liberta' 41/A S: Osio Sotto, 24046, Bergamo S: Italy @@ -2921,10 +2955,10 @@ S: 03600 Karkkila S: Finland N: Deepak Saxena -E: deepak@csociety.purdue.edu +E: dsaxena@plexity.net D: I2O kernel layer (config, block, core, pci, net). I2O disk support for LILO -D: XScale(IOP310) porting -S: Tempe, Arizona +D: XScale(IOP, IXP) porting and other random ARM bits +S: Portland, OR N: Eric Schenk E: Eric.Schenk@dna.lth.se @@ -3150,6 +3184,14 @@ S: Department of Zoology, University of Washington S: Seattle, WA 98195-1800 S: USA +N: Eugene Surovegin +E: ebs@ebshome.net +W: http://kernel.ebshome.net/ +P: 1024D/AE5467F1 FF22 39F1 6728 89F6 6E6C 2365 7602 F33D AE54 67F1 +D: Embedded PowerPC 4xx: I2C, PIC and random hacks/fixes +S: Sunnyvale, California 94085 +S: USA + N: Corey Thomas E: corey@world.std.com W: http://world.std.com/~corey/index.html @@ -3329,7 +3371,7 @@ D: Amiga Buddha and Catweasel chipset IDE D: Atari Falcon chipset IDE D: Amiga Gayle chipset IDE D: mipsel NEC DDB Vrc-5074 -S: Holsbeeksesteenweg 166 +S: Emiel Vlieberghlaan 2A/21 S: B-3010 Kessel-Lo S: Belgium @@ -3563,7 +3605,6 @@ S: The Netherlands N: David Woodhouse E: dwmw2@infradead.org -E: dwmw2@redhat.com D: ARCnet stuff, Applicom board driver, SO_BINDTODEVICE, D: some Alpha platform porting from 2.0, Memory Technology Devices, D: Acquire watchdog timer, PC speaker driver maintenance, diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 008c5471f..72dc90f8f 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -20,6 +20,8 @@ Changes - list of changes that break older software packages. CodingStyle - how the boss likes the C code in the kernel to look. +DMA-API.txt + - DMA API, pci_ API & extensions for non-consistent memory machines. DMA-mapping.txt - info for PCI drivers using DMA portably across all platforms. DocBook/ @@ -30,12 +32,14 @@ IPMI.txt - info on Linux Intelligent Platform Management Interface (IPMI) Driver. IRQ-affinity.txt - how to select which CPU(s) handle which interrupt events on SMP. +ManagementStyle + - how to (attempt to) manage kernel hackers. MSI-HOWTO.txt - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ. +RCU/ + - directory with info on RCU (read-copy update). README.DAC960 - info on Mylex DAC960/DAC1100 PCI RAID Controller Driver for Linux. -README.moxa - - release notes for Moxa mutiport serial card. SAK.txt - info on Secure Attention Keys. SubmittingDrivers @@ -46,8 +50,6 @@ VGA-softcursor.txt - how to change your VGA cursor from a blinking underscore. arm/ - directory with info about Linux on the ARM architecture. -as-iosched.txt - - info on anticipatory IO scheduler. basic_profiling.txt - basic instructions for those who wants to profile Linux kernel. binfmt_misc.txt @@ -60,20 +62,24 @@ cciss.txt - info, major/minor #'s for Compaq's SMART Array Controllers. cdrom/ - directory with information on the CD-ROM drivers that Linux has. +cli-sti-removal.txt + - cli()/sti() removal guide. computone.txt - info on Computone Intelliport II/Plus Multiport Serial Driver. cpqarray.txt - info on using Compaq's SMART2 Intelligent Disk Array Controllers. -cpufreq/ +cpu-freq/ - info on CPU frequency and voltage scaling. cris/ - directory with info about Linux on CRIS architecture. +crypto/ + - directory with info on the Crypto API. debugging-modules.txt - some notes on debugging modules after Linux 2.6.3. +device-mapper/ + - directory with info on Device Mapper. devices.txt - plain ASCII listing of all the nodes in /dev/ with major minor #'s. -digiboard.txt - - info on the Digiboard PC/X{i,e,eve} multiport boards. digiepca.txt - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards. dnotify.txt @@ -92,6 +98,8 @@ fb/ - directory with info on the frame buffer graphics abstraction layer. filesystems/ - directory with info on the various filesystems that Linux supports. +firmware_class/ + - request_firmware() hotplug interface info. floppy.txt - notes and driver options for the floppy disk driver. ftape.txt @@ -100,10 +108,14 @@ hayes-esp.txt - info on using the Hayes ESP serial driver. highuid.txt - notes on the change from 16 bit to 32 bit user/group IDs. +hpet.txt + - High Precision Event Timer Driver for Linux. hw_random.txt - info on Linux support for random number generator in i8xx chipsets. i2c/ - directory with info about the I2C bus/protocol (2 wire, kHz speed). +i2o/ + - directory with info about the Linux I2O subsystem. i386/ - directory with info about Linux on Intel 32 bit architecture. ia64/ @@ -114,6 +126,8 @@ initrd.txt - how to use the RAM disk as an initial/temporary root filesystem. input/ - info on Linux input device support. +io_ordering.txt + - info on ordering I/O writes to memory-mapped addresses. ioctl-number.txt - how to implement and register device/driver ioctl calls. iostats.txt @@ -134,6 +148,8 @@ kernel-parameters.txt - summary listing of command line / boot prompt args for the kernel. kobject.txt - info of the kobject infrastructure of the Linux kernel. +laptop-mode.txt + - How to conserve battery power using laptop-mode. ldm.txt - a brief description of LDM (Windows Dynamic Disks). locks.txt @@ -156,10 +172,8 @@ memory.txt - info on typical Linux memory problems. mips/ - directory with info about Linux on MIPS architecture. -mkdev.cciss - - script to make /dev entries for SMART controllers (see cciss.txt). -mkdev.ida - - script to make /dev entries for Intelligent Disk Array Controllers. +mono.txt + - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. moxa-smartio - info on installing/using Moxa multiport serial driver. mtrr.txt @@ -172,6 +186,8 @@ nfsroot.txt - short guide on setting up a diskless box with NFS root filesystem. nmi_watchdog.txt - info on NMI watchdog for SMP systems. +numastat.txt + - info on how to read Numa policy hit/miss statistics in sysfs. oops-tracing.txt - how to decode those nasty internal kernel error dump messages. paride.txt @@ -199,17 +215,25 @@ ramdisk.txt riscom8.txt - notes on using the RISCom/8 multi-port serial driver. rocket.txt - - info on installing/using the Comtrol RocketPort multiport serial driver. + - info on the Comtrol RocketPort multiport serial driver. rpc-cache.txt - introduction to the caching mechanisms in the sunrpc layer. rtc.txt - notes on how to use the Real Time Clock (aka CMOS clock) driver. s390/ - directory with info on using Linux on the IBM S390. +sched-coding.txt + - reference for various scheduler-related methods in the O(1) scheduler. sched-design.txt - goals, design and implementation of the Linux O(1) scheduler. +sched-domains.txt + - information on scheduling domains. +sched-stats.txt + - information on schedstats (Linux Scheduler Statistics). scsi/ - directory with info on Linux scsi support. +serial/ + - directory with info on the low level serial API. serial-console.txt - how to set up Linux with a serial line console as the default. sgi-visws.txt @@ -242,14 +266,24 @@ sysrq.txt - info on the magic SysRq key. telephony/ - directory with info on telephony (e.g. voice over IP) support. +time_interpolators.txt + - info on time interpolators. +tipar.txt + - information about Parallel link cable for Texas Instruments handhelds. +tty.txt + - guide to the locking policies of the tty layer. unicode.txt - info on the Unicode character/font mapping used in Linux. +uml/ + - directory with infomation about User Mode Linux. usb/ - directory with info regarding the Universal Serial Bus. video4linux/ - directory with info regarding video/TV/radio cards and linux. vm/ - directory with info on the Linux vm code. +voyager.txt + - guide to running Linux on the Voyager architecture. watchdog/ - how to auto-reboot Linux if it has "fallen and can't get up". ;-) x86_64/ diff --git a/Documentation/Changes b/Documentation/Changes index 22ec89259..c056d65b1 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -223,6 +223,11 @@ If you are running v0.1.17 or earlier, you should upgrade to version v0.99.0 or higher. Running old versions may cause problems with programs using shared memory. +udev +---- +udev is a userspace application for populating /dev dynamically with +only entries for devices actually present. udev replaces devfs. + Networking ========== @@ -368,6 +373,10 @@ Powertweak ---------- o +udev +---- +o + Networking ********** @@ -399,4 +408,3 @@ NFS-Utils --------- o - diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index 8787c4d09..6ee3cd613 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt @@ -160,7 +160,7 @@ pci_set_dma_mask(struct pci_device *dev, u64 mask) Checks to see if the mask is possible and updates the device parameters if it is. -Returns: 1 if successful and 0 if not +Returns: 0 if successful and a negative error if not. u64 dma_get_required_mask(struct device *dev) diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 9a23eab00..fc50b1073 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -8,10 +8,10 @@ DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \ kernel-hacking.sgml kernel-locking.sgml via-audio.sgml \ - mousedrivers.sgml deviceiobook.sgml procfs-guide.sgml \ - tulip-user.sgml writing_usb_driver.sgml scsidrivers.sgml \ - sis900.sgml kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \ - gadget.sgml libata.sgml + deviceiobook.sgml procfs-guide.sgml tulip-user.sgml \ + writing_usb_driver.sgml scsidrivers.sgml sis900.sgml \ + kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \ + gadget.sgml libata.sgml mtdnand.sgml librs.sgml ### # The build process is as follows (targets): @@ -58,14 +58,14 @@ MAKEMAN = $(PERL) $(srctree)/scripts/makeman # The following rules are used to generate the .sgml documentation # required to generate the final targets. (ps, pdf, html). quiet_cmd_docproc = DOCPROC $@ - cmd_docproc = $(DOCPROC) doc $< >$@ + cmd_docproc = SRCTREE=$(srctree)/ $(DOCPROC) doc $< >$@ define rule_docproc set -e; \ $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(cmd_$(1)); \ ( \ echo 'cmd_$@ := $(cmd_$(1))'; \ - echo $@: `$(DOCPROC) depend $<`; \ + echo $@: `SRCTREE=$(srctree) $(DOCPROC) depend $<`; \ ) > $(dir $@).$(notdir $@).cmd endef @@ -129,6 +129,9 @@ quiet_cmd_db2html = DB2HTML $@ # Rule to generate man files - output is placed in the man subdirectory %.9: %.sgml +ifneq ($(KBUILD_SRC),) + $(Q)mkdir -p $(objtree)/Documentation/DocBook/man +endif $(SPLITMAN) $< $(objtree)/Documentation/DocBook/man "$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)" $(MAKEMAN) convert $(objtree)/Documentation/DocBook/man $< diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl index d3f418384..0d1da8cbd 100644 --- a/Documentation/DocBook/deviceiobook.tmpl +++ b/Documentation/DocBook/deviceiobook.tmpl @@ -147,8 +147,7 @@ compiler is not permitted to reorder the I/O sequence. When the ordering can be compiler optimised, you can use __readb and friends to indicate the relaxed ordering. Use - this with care. The rmb provides a read memory - barrier. The wmb provides a write memory barrier. + this with care. @@ -159,19 +158,113 @@ asynchronously. A driver author must issue a read from the same device to ensure that writes have occurred in the specific cases the author cares. This kind of property cannot be hidden from driver - writers in the API. + writers in the API. In some cases, the read used to flush the device + may be expected to fail (if the card is resetting, for example). In + that case, the read should be done from config space, which is + guaranteed to soft-fail if the card doesn't respond. + + + + The following is an example of flushing a write to a device when + the driver would like to ensure the write's effects are visible prior + to continuing execution. + + + +static inline void +qla1280_disable_intrs(struct scsi_qla_host *ha) +{ + struct device_reg *reg; + + reg = ha->iobase; + /* disable risc and host interrupts */ + WRT_REG_WORD(&reg->ictrl, 0); + /* + * The following read will ensure that the above write + * has been received by the device before we return from this + * function. + */ + RD_REG_WORD(&reg->ictrl); + ha->flags.ints_enabled = 0; +} + + + + In addition to write posting, on some large multiprocessing systems + (e.g. SGI Challenge, Origin and Altix machines) posted writes won't + be strongly ordered coming from different CPUs. Thus it's important + to properly protect parts of your driver that do memory-mapped writes + with locks and use the mmiowb to make sure they + arrive in the order intended. Issuing a regular readX + will also ensure write ordering, but should only be used + when the driver has to be sure that the write has actually arrived + at the device (not that it's simply ordered with respect to other + writes), since a full readX is a relatively + expensive operation. + + + + Generally, one should use mmiowb prior to + releasing a spinlock that protects regions using writeb + or similar functions that aren't surrounded by + readb calls, which will ensure ordering and flushing. The + following pseudocode illustrates what might occur if write ordering + isn't guaranteed via mmiowb or one of the + readX functions. + + + +CPU A: spin_lock_irqsave(&dev_lock, flags) +CPU A: ... +CPU A: writel(newval, ring_ptr); +CPU A: spin_unlock_irqrestore(&dev_lock, flags) + ... +CPU B: spin_lock_irqsave(&dev_lock, flags) +CPU B: writel(newval2, ring_ptr); +CPU B: ... +CPU B: spin_unlock_irqrestore(&dev_lock, flags) + + + + In the case above, newval2 could be written to ring_ptr before + newval. Fixing it is easy though: + + + +CPU A: spin_lock_irqsave(&dev_lock, flags) +CPU A: ... +CPU A: writel(newval, ring_ptr); +CPU A: mmiowb(); /* ensure no other writes beat us to the device */ +CPU A: spin_unlock_irqrestore(&dev_lock, flags) + ... +CPU B: spin_lock_irqsave(&dev_lock, flags) +CPU B: writel(newval2, ring_ptr); +CPU B: ... +CPU B: mmiowb(); +CPU B: spin_unlock_irqrestore(&dev_lock, flags) + + + + See tg3.c for a real world example of how to use mmiowb + PCI ordering rules also guarantee that PIO read responses arrive - after any outstanding DMA writes on that bus, since for some devices + after any outstanding DMA writes from that bus, since for some devices the result of a readb call may signal to the driver that a DMA transaction is complete. In many cases, however, the driver may want to indicate that the next readb call has no relation to any previous DMA writes performed by the device. The driver can use readb_relaxed for these cases, although only - some platforms will honor the relaxed semantics. + some platforms will honor the relaxed semantics. Using the relaxed + read functions will provide significant performance benefits on + platforms that support it. The qla2xxx driver provides examples + of how to use readX_relaxed. In many cases, + a majority of the driver's readX calls can + safely be converted to readX_relaxed calls, since + only a few will indicate or depend on DMA completion. diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 5f11984a0..c8e2581ce 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl @@ -105,6 +105,15 @@ KAO --> + + The debugfs filesystem + + debugfs interface +!Efs/debugfs/inode.c +!Efs/debugfs/file.c + + + The Linux VFS The Directory Cache @@ -133,12 +142,16 @@ KAO --> Socket Filter !Enet/core/filter.c + Generic Network Statistics +!Iinclude/linux/gen_stats.h +!Enet/core/gen_stats.c +!Enet/core/gen_estimator.c + Network device support Driver Support -!Edrivers/net/net_init.c !Enet/core/dev.c 8390 Based Network Cards diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl index cd1bc1574..1e8219d85 100644 --- a/Documentation/DocBook/kernel-hacking.tmpl +++ b/Documentation/DocBook/kernel-hacking.tmpl @@ -888,7 +888,7 @@ printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress)); The second class of atomic operations is atomic bit operations on a long, defined in - include/asm/bitops.h. These + include/linux/bitops.h. These operations generally take a pointer to the bit pattern, and a bit number: 0 is the least significant bit. set_bit(), clear_bit() diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index ac0d5fc0a..92a405a0e 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl @@ -61,6 +61,196 @@ + + libata Driver API + + struct ata_port_operations + + +void (*port_disable) (struct ata_port *); + + + + Called from ata_bus_probe() and ata_bus_reset() error paths, + as well as when unregistering from the SCSI module (rmmod, hot + unplug). + + + +void (*dev_config) (struct ata_port *, struct ata_device *); + + + + Called after IDENTIFY [PACKET] DEVICE is issued to each device + found. Typically used to apply device-specific fixups prior to + issue of SET FEATURES - XFER MODE, and prior to operation. + + + +void (*set_piomode) (struct ata_port *, struct ata_device *); +void (*set_dmamode) (struct ata_port *, struct ata_device *); +void (*post_set_mode) (struct ata_port *ap); + + + + Hooks called prior to the issue of SET FEATURES - XFER MODE + command. dev->pio_mode is guaranteed to be valid when + ->set_piomode() is called, and dev->dma_mode is guaranteed to be + valid when ->set_dmamode() is called. ->post_set_mode() is + called unconditionally, after the SET FEATURES - XFER MODE + command completes successfully. + + + + ->set_piomode() is always called (if present), but + ->set_dma_mode() is only called if DMA is possible. + + + +void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); +void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); + + + + ->tf_load() is called to load the given taskfile into hardware + registers / DMA buffers. ->tf_read() is called to read the + hardware registers / DMA buffers, to obtain the current set of + taskfile register values. + + + +void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); + + + + causes an ATA command, previously loaded with + ->tf_load(), to be initiated in hardware. + + + +u8 (*check_status)(struct ata_port *ap); +void (*dev_select)(struct ata_port *ap, unsigned int device); + + + + Reads the Status ATA shadow register from hardware. On some + hardware, this has the side effect of clearing the interrupt + condition. + + + +void (*dev_select)(struct ata_port *ap, unsigned int device); + + + + Issues the low-level hardware command(s) that causes one of N + hardware devices to be considered 'selected' (active and + available for use) on the ATA bus. + + + +void (*phy_reset) (struct ata_port *ap); + + + + The very first step in the probe phase. Actions vary depending + on the bus type, typically. After waking up the device and probing + for device presence (PATA and SATA), typically a soft reset + (SRST) will be performed. Drivers typically use the helper + functions ata_bus_reset() or sata_phy_reset() for this hook. + + + +void (*bmdma_setup) (struct ata_queued_cmd *qc); +void (*bmdma_start) (struct ata_queued_cmd *qc); + + + + When setting up an IDE BMDMA transaction, these hooks arm + (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA + engine. + + + +void (*qc_prep) (struct ata_queued_cmd *qc); +int (*qc_issue) (struct ata_queued_cmd *qc); + + + + Higher-level hooks, these two hooks can potentially supercede + several of the above taskfile/DMA engine hooks. ->qc_prep is + called after the buffers have been DMA-mapped, and is typically + used to populate the hardware's DMA scatter-gather table. + Most drivers use the standard ata_qc_prep() helper function, but + more advanced drivers roll their own. + + + ->qc_issue is used to make a command active, once the hardware + and S/G tables have been prepared. IDE BMDMA drivers use the + helper function ata_qc_issue_prot() for taskfile protocol-based + dispatch. More advanced drivers roll their own ->qc_issue + implementation, using this as the "issue new ATA command to + hardware" hook. + + + +void (*eng_timeout) (struct ata_port *ap); + + + + This is a high level error handling function, called from the + error handling thread, when a command times out. + + + +irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); +void (*irq_clear) (struct ata_port *); + + + + ->irq_handler is the interrupt handling routine registered with + the system, by libata. ->irq_clear is called during probe just + before the interrupt handler is registered, to be sure hardware + is quiet. + + + +u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); +void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, + u32 val); + + + + Read and write standard SATA phy registers. Currently only used + if ->phy_reset hook called the sata_phy_reset() helper function. + + + +int (*port_start) (struct ata_port *ap); +void (*port_stop) (struct ata_port *ap); +void (*host_stop) (struct ata_host_set *host_set); + + + + ->port_start() is called just after the data structures for each + port are initialized. Typically this is used to alloc per-port + DMA buffers / tables / rings, enable DMA engines, and similar + tasks. + + + ->host_stop() is called when the rmmod or hot unplug process + begins. The hook must stop all hardware interrupts, DMA + engines, etc. + + + ->port_stop() is called after ->host_stop(). It's sole function + is to release DMA/memory resources, now that they are no longer + actively being used. + + + + + libata Library !Edrivers/scsi/libata-core.c @@ -83,7 +273,7 @@ - ata_sil Internals + sata_sil Internals !Idrivers/scsi/sata_sil.c diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl index 669b0466a..34206230c 100644 --- a/Documentation/DocBook/procfs-guide.tmpl +++ b/Documentation/DocBook/procfs-guide.tmpl @@ -100,8 +100,8 @@ I'd like to thank Jeff Garzik jgarzik@pobox.com and Alexander Viro - viro@math.psu.edu for their input, Tim Waugh - twaugh@redhat.com for his viro@parcelfarce.linux.theplanet.co.uk for their input, + Tim Waugh twaugh@redhat.com for his Selfdocbook, and Marc Joosen marcj@historia.et.tudelft.nl for proofreading. diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl index 45243eeb2..2c92b1836 100644 --- a/Documentation/DocBook/videobook.tmpl +++ b/Documentation/DocBook/videobook.tmpl @@ -731,13 +731,14 @@ static int io = 0x300; static int io = -1; +#endif MODULE_AUTHOR("Alan Cox"); MODULE_DESCRIPTION("A driver for an imaginary radio card."); -MODULE_PARM(io, "i"); +module_param(io, int, 0444); MODULE_PARM_DESC(io, "I/O address of the card."); -int init_module(void) +static int __init init(void) { if(io==-1) { @@ -748,25 +749,26 @@ int init_module(void) return myradio_init(NULL); } -void cleanup_module(void) +static void __exit cleanup(void) { video_unregister_device(&my_radio); release_region(io, MY_IO_SIZE); } -#endif +module_init(init); +module_exit(cleanup); In this example we set the IO base by default if the driver is compiled into - the kernel where you cannot pass a parameter. For the module we require the + the kernel: you can still set it using "my_radio.irq" if this file is called my_radio.c. For the module we require the user sets the parameter. We set io to a nonsense port (-1) so that we can tell if the user supplied an io parameter or not. We use MODULE_ defines to give an author for the card driver and a description. We also use them to declare that io is an integer and it is the - address of the card. + address of the card, and can be read by anyone from sysfs. The clean-up routine unregisters the video_device we registered, and frees diff --git a/Documentation/IO-mapping.txt b/Documentation/IO-mapping.txt index ddc817346..86edb61bd 100644 --- a/Documentation/IO-mapping.txt +++ b/Documentation/IO-mapping.txt @@ -119,9 +119,10 @@ you can't use it from the bus master. So why do we care about the physical address at all? We do need the physical address in some cases, it's just not very often in normal code. The physical address is needed if you use memory mappings, for example, because the -"remap_page_range()" mm function wants the physical address of the memory to -be remapped (the memory management layer doesn't know about devices outside -the CPU, so it shouldn't need to know about "bus addresses" etc). +"remap_pfn_range()" mm function wants the physical address of the memory to +be remapped as measured in units of pages, a.k.a. the pfn (the memory +management layer doesn't know about devices outside the CPU, so it +shouldn't need to know about "bus addresses" etc). NOTE NOTE NOTE! The above is only one part of the whole equation. The above only talks about "real memory", that is, CPU memory (RAM). diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt index 46950afda..bda6ead69 100644 --- a/Documentation/RCU/listRCU.txt +++ b/Documentation/RCU/listRCU.txt @@ -82,7 +82,7 @@ lock might be used as follows for deletion and insertion: list_for_each_entry(e, list, list) { if (!audit_compare_rule(rule, &e->rule)) { list_del(&e->list); - call_rcu(&e->rcu, audit_free_rule, e); + write_unlock(&auditsc_lock); return 0; } } diff --git a/Documentation/SAK.txt b/Documentation/SAK.txt index 9be5a227b..b9019ca87 100644 --- a/Documentation/SAK.txt +++ b/Documentation/SAK.txt @@ -1,5 +1,5 @@ Linux 2.4.2 Secure Attention Key (SAK) handling -18 March 2001, Andrew Morton +18 March 2001, Andrew Morton An operating system's Secure Attention Key is a security tool which is provided as protection against trojan password capturing programs. It @@ -44,7 +44,7 @@ NOTES /dev/console opened. Unfortunately this includes a number of things which you don't - actually want killed. This is because these appliccaitons are + actually want killed. This is because these applications are incorrectly holding /dev/console open. Be sure to complain to your Linux distributor about this! diff --git a/Documentation/arm/Booting b/Documentation/arm/Booting index a851d039a..fad566bb0 100644 --- a/Documentation/arm/Booting +++ b/Documentation/arm/Booting @@ -118,6 +118,10 @@ to store page tables. The recommended placement is 32KiB into RAM. In either case, the following conditions must be met: +- Quiesce all DMA capable devicess so that memory does not get + corrupted by bogus network packets or disk data. This will save + you many hours of debug. + - CPU register settings r0 = 0, r1 = machine type number discovered in (3) above. diff --git a/Documentation/arm/IXP2000 b/Documentation/arm/IXP2000 index 48ba502fa..969f16593 100644 --- a/Documentation/arm/IXP2000 +++ b/Documentation/arm/IXP2000 @@ -18,7 +18,7 @@ http://developer.intel.com/design/network/products/npfamily/ixp2xxx.htm 2. Linux Support -Linux currently supports the following features on the IXP2000 NPUS: +Linux currently supports the following features on the IXP2000 NPUs: - On-chip serial - PCI @@ -30,10 +30,10 @@ That is about all we can support under Linux ATM b/c the core networking components of the chip are accessed via Intel's closed source SDK. Please contact Intel directly on issues with using those. There is also a mailing list run by some folks at Princeton University that might -be of helpful: https://lists.cs.princeton.edu/mailman/listinfo/ixp2xxx +be of help: https://lists.cs.princeton.edu/mailman/listinfo/ixp2xxx WHATEVER YOU DO, DO NOT POST EMAIL TO THE LINUX-ARM OR LINUX-ARM-KERNEL -MAILINNG LISTS REGARDING THE INTEL SDK. +MAILING LISTS REGARDING THE INTEL SDK. 3. Supported Platforms @@ -47,12 +47,12 @@ MAILINNG LISTS REGARDING THE INTEL SDK. - The IXP2000 platforms ususally have rather complex PCI bus topologies with large memory space requirements. In addition, b/c of the way the - Intel SDK is designed, devices are enumerated in a vert specific + Intel SDK is designed, devices are enumerated in a very specific way. B/c of this this, we use "pci=firmware" option in the kernel command line so that we do not re-enumerate the bus. - IXDP2x01 systems have variable clock tick rates that we cannot determine - via HW registers. The "ixdp2x01_clk=XXX" cmd line options allows you + via HW registers. The "ixdp2x01_clk=XXX" cmd line options allow you to pass the clock rate to the board port. 5. Thanks diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/IXP4xx index d86d818a4..d4c6d3aa0 100644 --- a/Documentation/arm/IXP4xx +++ b/Documentation/arm/IXP4xx @@ -12,8 +12,11 @@ is targeted for network applications, though it has become popular in industrial control and other areas due to low cost and power consumption. The IXP4xx family currently consists of several processors that support different network offload functions such as encryption, -routing, firewalling, etc. For more information on the various -versions of the CPU, see: +routing, firewalling, etc. The IXP46x family is an updated version which +supports faster speeds, new memory and flash configurations, and more +integration such as an on-chip I2C controller. + +For more information on the various versions of the CPU, see: http://developer.intel.com/design/network/products/npfamily/ixp4xx.htm @@ -27,7 +30,7 @@ Linux currently supports the following features on the IXP4xx chips: - Dual serial ports - PCI interface - Flash access (MTD/JFFS) -- I2C through GPIO +- I2C through GPIO on IXP42x - GPIO for input/output/interrupts See include/asm-arm/arch-ixp4xx/platform.h for access functions. - Timers (watchdog, OS) @@ -122,6 +125,21 @@ http://developer.intel.com/design/network/products/npfamily/ixdp425.htm also known as the Richfield board. It contains 4 PCI slots, 16MB of flash, two 10/100 ports and one ADSL port. +Intel IXDP465 Development Platform +http://developer.intel.com/design/network/products/npfamily/ixdp465.htm + + This is basically an IXDP425 with an IXP465 and 32M of flash instead + of just 16. + +Intel IXDPG425 Development Platform + + This is basically and ADI Coyote board with a NEC EHCI controller + added. One issue with this board is that the mini-PCI slots only + have the 3.3v line connected, so you can't use a PCI to mini-PCI + adapter with an E100 card. So to NFS root you need to use either + the CSR or a WiFi card and a ramdisk that BOOTPs and then does + a pivot_root to NFS. + Motorola PrPMC1100 Processor Mezanine Card http://www.fountainsys.com/datasheet/PrPMC1100.pdf @@ -145,6 +163,7 @@ The IXP4xx work has been funded by Intel Corp. and MontaVista Software, Inc. The following people have contributed patches/comments/etc: +Lennerty Buytenhek Lutz Jaenicke Justin Mayfield Robert E. Ranslam @@ -152,4 +171,4 @@ Robert E. Ranslam ------------------------------------------------------------------------- -Last Update: 5/13/2004 +Last Update: 01/04/2005 diff --git a/Documentation/arm/README b/Documentation/arm/README index 1dd5d6cb7..a6f718e90 100644 --- a/Documentation/arm/README +++ b/Documentation/arm/README @@ -163,9 +163,9 @@ CONFIG_MACH_ and CONFIG_ARCH_ -Kernel entry (head-armv.S) +Kernel entry (head.S) -------------------------- - The initial entry into the kernel is via head-armv.S, which uses machine + The initial entry into the kernel is via head.S, which uses machine independent code. The machine is selected by the value of 'r1' on entry, which must be kept unique. diff --git a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt index 831b98c73..000e3d7a7 100644 --- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt +++ b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt @@ -15,7 +15,7 @@ Configuration ------------- To set the default configuration, use `make bast_defconfig` which - supports the commonly used features of this board + supports the commonly used features of this board. Support @@ -23,15 +23,23 @@ Support Official support information can be found on the Simtec Electronics website, at the product page http://www.simtec.co.uk/products/EB2410ITX/ - and http://www.simtec.co.uk/products/EB2410ITX/resources.html + + Useful links: + + - Resources Page http://www.simtec.co.uk/products/EB2410ITX/resources.html + + - Board FAQ at http://www.simtec.co.uk/products/EB2410ITX/faq.html + + - Bootloader info http://www.simtec.co.uk/products/SWABLE/resources.html + and FAQ http://www.simtec.co.uk/products/SWABLE/faq.html MTD --- - The NAND and NOR onboard are currently supported in the linux-mtd cvs, - and are awaiting merge in the mainline. see the linux-mtd project at - http://www.linux-mtd.infradead.org/ for more information. + The NAND and NOR support has been merged from the linux-mtd project. + Any prolbems, see http://www.linux-mtd.infradead.org/ for more + information or up-to-date versions of linux-mtd. IDE @@ -41,4 +49,10 @@ IDE changing speed of devices, PIO Mode 4 capable drives should be used. +Maintainers +----------- + + This board is maintained by Simtec Electronics. + + (c) 2004 Ben Dooks, Simtec Electronics diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt index aa3f83aa2..5a05c2c72 100644 --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt @@ -45,12 +45,18 @@ Machines Handheld (IPAQ), available in several varieties + HP iPAQ rx3715 + + S3C2440 based IPAQ, with a number of variations depending on + features shipped. + + NAND ---- - The current kernels do not have direct support for the NAND - controller, the latest linux-mtd CVS has support for this. - See http://www.linux-mtd.infradead.org/ + The current kernels now have support for the s3c2410 NAND + controller. If there are any problems the latest linux-mtd + CVS can be found from http://www.linux-mtd.infradead.org/ Serial @@ -84,14 +90,26 @@ Clock Management Port Contributors ----------------- - Ben Dooks + Ben Dooks (BJD) Vincent Sanders Herbert Potzl - Arnaud Patard + Arnaud Patard (RTP) Roc Wu + Klaus Fetscher + Dimitry Andric + Shannon Holland + + +Document Changes +---------------- + 05 Sep 2004 - BJD - Added Document Changes section + 05 Sep 2004 - BJD - Added Klaus Fetscher to list of contributors + 25 Oct 2004 - BJD - Added Dimitry Andric to list of contributors + 25 Oct 2004 - BJD - Updated the MTD from the 2.6.9 merge + 21 Jan 2005 - BJD - Added rx3715, added Shannon to contributors Document Author --------------- -Ben Dooks, (c) 2004 Simtec Electronics +Ben Dooks, (c) 2004-2005 Simtec Electronics diff --git a/Documentation/arm/Sharp-LH/IOBarrier b/Documentation/arm/Sharp-LH/IOBarrier index bf34e046e..c0d885367 100644 --- a/Documentation/arm/Sharp-LH/IOBarrier +++ b/Documentation/arm/Sharp-LH/IOBarrier @@ -5,7 +5,7 @@ Due to an unfortunate oversight when the Card Engines were designed, the signals that control access to some peripherals, most notably the SMC91C9111 ethernet controller, are not properly handled. -The symptom is that back to back IO with the peripheral returns +The symptom is that some back to back IO with the peripheral returns unreliable data. With the SMC chip, you'll see errors about the bank register being 'screwed'. @@ -13,20 +13,33 @@ The cause is that the AEN signal to the SMC chip does not transition for every memory access. It is driven through the CPLD from the CS7 line of the CPU's static memory controller which is optimized to eliminate unnecessary transitions. Yet, the SMC requires a transition -for every access. The Sharp website has more information on the -effect of this power conservation feature on peripheral interfacing. +for every write access. The Sharp website has more information about +the effect this power-conserving feature has on peripheral +interfacing. -The solution is to follow every access to the SMC chip with an access -to another memory region that will force the CPU to release the chip -select line. Note that it is important to guarantee that the access -will force the CPU off-chip. We map a page of SDRAM as if it were an -uncacheable IO device and read from it after every SMC IO operation. +The solution is to follow every write access to the SMC chip with an +access to another memory region that will force the CPU to release the +chip select line. It is important to guarantee that this access +forces the CPU off-chip. We map a page of SDRAM as if it were an +uncacheable IO device and read from it after every SMC IO write +operation. SMC IO BARRIER IO -You might be tempted to believe that we must access another device +Only this sequence is important. It does not matter that there is no +BARRIER IO before the access to the SMC chip because the AEN latch +only needs occurs after the SMC IO write cycle. The routines that +implement this work-around make an additional concession which is to +disable interrupts during the IO sequence. Other hardware devices +(the LogicPD CPLD) have registers in the same the physical memory +region as the SMC chip. An interrupt might allow an access to one of +those registers while SMC IO is being performed. + +You might be tempted to think that we have to access another device attached to the static memory controller, but the empirical evidence indicates that this is not so. Mapping 0x00000000 (flash) and 0xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems -to be faster. +to be faster. Choosing to access an undecoded memory region is not +desirable as there is no way to know how that chip select will be used +in the future. diff --git a/Documentation/block/as-iosched.txt b/Documentation/block/as-iosched.txt index fd763cc48..6f47332c8 100644 --- a/Documentation/block/as-iosched.txt +++ b/Documentation/block/as-iosched.txt @@ -132,7 +132,7 @@ a combination of IO behavior from all those devices. Tuning the anticipatory IO scheduler ------------------------------------ When using 'as', the anticipatory IO scheduler there are 5 parameters under -/sys/block/*/iosched/. All are units of milliseconds. +/sys/block/*/queue/iosched/. All are units of milliseconds. The parameters are: * read_expire diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index f24dbcaca..6dd274d7e 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt @@ -1172,8 +1172,7 @@ PIO drivers (or drivers that need to revert to PIO transfer once in a while (IDE for example)), where the CPU is doing the actual data transfer a virtual mapping is needed. If the driver supports highmem I/O, (Sec 1.1, (ii) ) it needs to use __bio_kmap_atomic and bio_kmap_irq to -temporarily map a bio into the virtual address space. See how IDE handles -this with ide_map_buffer. +temporarily map a bio into the virtual address space. 8. Prior/Related/Impacted patches diff --git a/Documentation/block/deadline-iosched.txt b/Documentation/block/deadline-iosched.txt index 2b1318600..c918b3a60 100644 --- a/Documentation/block/deadline-iosched.txt +++ b/Documentation/block/deadline-iosched.txt @@ -9,7 +9,7 @@ Each io queue has a set of io scheduler tunables associated with it. These tunables control how the io scheduler works. You can find these entries in: -/sys/block//iosched +/sys/block//queue/iosched assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted, you can do so by typing: diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt index 7d8f67e5c..74589c53a 100644 --- a/Documentation/cciss.txt +++ b/Documentation/cciss.txt @@ -14,28 +14,29 @@ This driver is known to work with the following cards: * SA 6400 * SA 6400 U320 Expansion Module * SA 6i - * SA 6422 - * SA V100 + * SA P600 -If nodes are not already created in the /dev/cciss directory +If nodes are not already created in the /dev/cciss directory, run as root: -# mkdev.cciss [ctlrs] - -Where ctlrs is the number of controllers you have (defaults to 1 if not -specified). +# cd /dev +# ./MAKEDEV cciss Device Naming: -------------- -You need some entries in /dev for the cciss device. The mkdev.cciss script +You need some entries in /dev for the cciss device. The MAKEDEV script can make device nodes for you automatically. Currently the device setup is as follows: Major numbers: 104 cciss0 105 cciss1 - 106 cciss2 - etc... + 106 cciss2 + 105 cciss3 + 108 cciss4 + 109 cciss5 + 110 cciss6 + 111 cciss7 Minor numbers: b7 b6 b5 b4 b3 b2 b1 b0 @@ -45,7 +46,7 @@ Minor numbers: | +-------------------- Logical Volume number -The suggested device naming scheme is: +The device naming scheme is: /dev/cciss/c0d0 Controller 0, disk 0, whole device /dev/cciss/c0d0p1 Controller 0, disk 0, partition 1 /dev/cciss/c0d0p2 Controller 0, disk 0, partition 2 @@ -117,16 +118,13 @@ from the adapter, informing the SCSI mid layer may not be necessary. Note that the naming convention of the /proc filesystem entries contains a number in addition to the driver name. (E.g. "cciss0" -instead of just "cciss" which you might expect.) This is because -of changes to the 2.4 kernel PCI interface related to PCI hot plug -that imply the driver must register with the SCSI mid layer once per -adapter instance rather than once per driver. +instead of just "cciss" which you might expect.) Note: ONLY sequential access devices and medium changers are presented as SCSI devices to the SCSI mid layer by the cciss driver. Specifically, physical SCSI disk drives are NOT presented to the SCSI mid layer. The physical SCSI disk drives are controlled directly by the array controller -hardware and it is important to prevent the OS from attempting to directly +hardware and it is important to prevent the kernel from attempting to directly access these devices too, as if the array controller were merely a SCSI controller in the same way that we are allowing it to access SCSI tape drives. diff --git a/Documentation/cdrom/00-INDEX b/Documentation/cdrom/00-INDEX index eae689667..916dafe29 100644 --- a/Documentation/cdrom/00-INDEX +++ b/Documentation/cdrom/00-INDEX @@ -22,6 +22,8 @@ mcdx - info on improved Mitsumi CD-ROM driver. optcd - info on the Optics Storage 8000 AT CD-ROM driver +packet-writing.txt + - Info on the CDRW packet writing module sbpcd - info on the SoundBlaster/Panasonic CD-ROM interface driver. sjcd diff --git a/Documentation/cdrom/packet-writing.txt b/Documentation/cdrom/packet-writing.txt index d34fcbca9..b402e4c94 100644 --- a/Documentation/cdrom/packet-writing.txt +++ b/Documentation/cdrom/packet-writing.txt @@ -43,6 +43,8 @@ shall implement "true random writes with 2KB granularity", which means that it should be possible to put any filesystem with a block size >= 2KB on such a disc. For example, it should be possible to do: + # dvd+rw-format /dev/hdc (only needed if the disc has never + been formatted) # mkudffs /dev/hdc # mount /dev/hdc /cdrom -t udf -o rw,noatime @@ -54,6 +56,7 @@ writes are not 32KB aligned. Both problems can be solved by using the pktcdvd driver, which always generates aligned writes. + # dvd+rw-format /dev/hdc # pktsetup dev_name /dev/hdc # mkudffs /dev/pktcdvd/dev_name # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime diff --git a/Documentation/computone.txt b/Documentation/computone.txt index ea2b5d3e3..b1cf59b84 100644 --- a/Documentation/computone.txt +++ b/Documentation/computone.txt @@ -1,3 +1,13 @@ +NOTE: This is an unmaintained driver. It is not guaranteed to work due to +changes made in the tty layer in 2.6. If you wish to take over maintenance of +this driver, contact Michael Warfield . + +Changelog: +---------- +11-01-2001: Original Document + +10-29-2004: Minor misspelling & format fix, update status of driver. + James Nelson Computone Intelliport II/Plus Multiport Serial Driver ----------------------------------------------------- @@ -146,7 +156,7 @@ selects polled mode). If no base addresses are specified the defaults in ip2.c are used. If you are autoloading the driver module with kerneld or kmod the base addresses and interrupt number must also be set in ip2.c and recompile or just insert and options line in /etc/modprobe.conf or both. -The options line is equivalent to the command line and takes precidence over +The options line is equivalent to the command line and takes precedence over what is in ip2.c. /etc/modprobe.conf sample: @@ -166,7 +176,8 @@ The equivalent for the kernel command line (in lilo.conf): Note: Both io and irq should be updated to reflect YOUR system. An "io" - address of 1 or 2 indicates a PCI or EISA card in the board table. The PCI or EISA irq will be assigned automatically. + address of 1 or 2 indicates a PCI or EISA card in the board table. + The PCI or EISA irq will be assigned automatically. Specifying an invalid or in-use irq will default the driver into running in polled mode for that card. If all irq entries are 0 then diff --git a/Documentation/cpqarray.txt b/Documentation/cpqarray.txt index d0e185f7c..c7154e20e 100644 --- a/Documentation/cpqarray.txt +++ b/Documentation/cpqarray.txt @@ -26,31 +26,13 @@ unable to test against these cards: * IDA-2 * IAES -Installing: ------------ - -You need to build a new kernel to use this device, even if you want to -use a loadable module. - -Apply the patch to a 2.2.x kernel: - -# cd linux -# patch -p1 + + +1999 : Original Document diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt index 0d5a00a65..5009805f9 100644 --- a/Documentation/cpu-freq/index.txt +++ b/Documentation/cpu-freq/index.txt @@ -35,10 +35,10 @@ Mailing List ------------ There is a CPU frequency changing CVS commit and general list where you can report bugs, problems or submit patches. To post a message, -send an email to cpufreq@www.linux.org.uk, to subscribe go to -http://www.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the +send an email to cpufreq@lists.linux.org.uk, to subscribe go to +http://lists.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the mailing list are available to subscribers at -http://www.linux.org.uk/mailman/private/cpufreq/. +http://lists.linux.org.uk/mailman/private/cpufreq/. Links @@ -50,7 +50,7 @@ how to access the CVS repository: * http://cvs.arm.linux.org.uk/ the CPUFreq Mailing list: -* http://www.linux.org.uk/mailman/listinfo/cpufreq +* http://lists.linux.org.uk/mailman/listinfo/cpufreq Clock and voltage scaling for the SA-1100: * http://www.lart.tudelft.nl/projects/scaling diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt index 5e6391ca9..7fedc00c3 100644 --- a/Documentation/cpu-freq/user-guide.txt +++ b/Documentation/cpu-freq/user-guide.txt @@ -65,6 +65,7 @@ Intel Pentium 4, Intel Xeon Intel Pentium M (Centrino) National Semiconductors Geode GX Transmeta Crusoe +Transmeta Efficeon VIA Cyrix 3 / C3 various processors on some ACPI 2.0-compatible systems [*] diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt index 62778c57f..fa0c8b974 100644 --- a/Documentation/crypto/api-intro.txt +++ b/Documentation/crypto/api-intro.txt @@ -231,6 +231,9 @@ Whirlpool algorithm contributors: Aaron Grothe Jean-Luc Cooke +Anubis algorithm contributors: + Aaron Grothe + Generic scatterwalk code by Adam J. Richter Please send any credits updates or corrections to: diff --git a/Documentation/devices.txt b/Documentation/devices.txt index c46f5961a..9d0cdb431 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt @@ -1,9 +1,9 @@ - LINUX ALLOCATED DEVICES + LINUX ALLOCATED DEVICES (2.6+ version) Maintained by Torben Mathiasen - Last revised: 04 August 2004 + Last revised: 25 January 2005 This list is the Linux Device List, the official registry of allocated device numbers and /dev directory nodes for the Linux operating @@ -24,7 +24,8 @@ platform only. Allocations marked (68k/Atari) apply to Linux/68k on the Atari platform only. The symbol {2.6} means the allocation is obsolete and scheduled for -removal once kernel version 2.6 (or equivalent) is released. +removal once kernel version 2.6 (or equivalent) is released. Some of these +allocations have already been removed. This document is in the public domain. The author requests, however, that semantically altered versions are not distributed without @@ -41,13 +42,6 @@ reply. **** DEVICE DRIVERS AUTHORS PLEASE READ THIS **** -THE DEVICE REGISTRY IS OFFICIALLY FROZEN FOR LINUS TORVALDS' KERNEL -TREE. At Linus' request, no more allocations will be made official -for Linus' kernel tree; the 3 June 2001 version of this list is the -official final version of this registry. At Alan Cox' request, -however, the registry will continue to be maintained for the -ac -series of kernels, and registrations will be accepted. - To have a major number allocated, or a minor number in situations where that applies (e.g. busmice), please contact me with the appropriate device information. Also, if you have additional @@ -436,6 +430,8 @@ Your cooperation is appreciated. 226 = /dev/systrace Systrace device 227 = /dev/mcelog X86_64 Machine Check Exception driver 228 = /dev/hpet HPET driver + 229 = /dev/fuse Fuse (virtual filesystem in user-space) + 230 = /dev/midishare MidiShare driver 240-254 Reserved for local use 255 Reserved for MISC_DYNAMIC_MINOR @@ -1176,7 +1172,7 @@ Your cooperation is appreciated. Requested by: andy@scramdisklinux.org - 65 char Sundance "plink" Transputer boards + 65 char Sundance "plink" Transputer boards (obsolete, unused) 0 = /dev/plink0 First plink device 1 = /dev/plink1 Second plink device 2 = /dev/plink2 Third plink device @@ -1526,12 +1522,12 @@ Your cooperation is appreciated. disks (see major number 3) except that the limit on partitions is 15. - 83 char Teletext/videotext interfaces {2.6} - 0 = /dev/vtx Teletext decoder - 16 = /dev/vttuner TV tuner on teletext interface - - Devices for the driver contained in the VideoteXt package. - More information on http://home.pages.de/~videotext/ + 83 char Matrox mga_vid video driver + 0 = /dev/mga_vid0 1st video card + 1 = /dev/mga_vid1 2nd video card + 2 = /dev/mga_vid2 3rd video card + ... + 15 = /dev/mga_vid15 16th video card 83 block I2O hard disk 0 = /dev/i2o/hdaw 49th I2O hard disk, whole disk @@ -1701,11 +1697,6 @@ Your cooperation is appreciated. 3 = /dev/ipauth Authentication control device/log file ... - 95 block IBM S/390 VM/ESA minidisk - 0 = /dev/msd0 First VM/ESA minidisk - 1 = /dev/msd1 Second VM/ESA minidisk - ... - 96 char Parallel port ATAPI tape devices 0 = /dev/pt0 First parallel port ATAPI tape 1 = /dev/pt1 Second parallel port ATAPI tape @@ -1742,10 +1733,14 @@ Your cooperation is appreciated. See http://stm.lbl.gov/comedi or http://www.llp.fu-berlin.de/. 98 block User-mode virtual block device - 0 = /dev/ubd0 First user-mode block device - 1 = /dev/ubd1 Second user-mode block device + 0 = /dev/ubda First user-mode block device + 16 = /dev/udbb Second user-mode block device ... + Partitions are handled in the same way as for IDE + disks (see major number 3) except that the limit on + partitions is 15. + This device is used by the user-mode virtual kernel port. 99 char Raw parallel ports @@ -2109,6 +2104,7 @@ Your cooperation is appreciated. disks (see major number 3) except that the limit on partitions is 15. +130 char (Misc devices) 130 block SCSI disk devices (160-175) 0 = /dev/sdfe 161st SCSI disk whole disk @@ -2559,6 +2555,11 @@ Your cooperation is appreciated. 65 = /dev/usb/usblcd USBLCD Interface (info@usblcd.de) 66 = /dev/usb/cpad0 Synaptics cPad (mouse/LCD) +180 block USB block devices + 0 = /dev/uba First USB block device + 8 = /dev/ubb Second USB block device + 16 = /dev/ubc Thrid USB block device + ... 181 char Conrad Electronic parallel port radio clocks 0 = /dev/pcfclock0 First Conrad radio clock @@ -2747,6 +2748,12 @@ Your cooperation is appreciated. 43 = /dev/ttySMX2 Motorola i.MX - port 2 44 = /dev/ttyMM0 Marvell MPSC - port 0 45 = /dev/ttyMM1 Marvell MPSC - port 1 + 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 + ... + 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 + 50 = /dev/ttyIOC40 Altix serial card + ... + 81 = /dev/ttyIOC431 Altix serial card 205 char Low-density serial ports (alternate device) 0 = /dev/culu0 Callout device for ttyLU0 @@ -2772,9 +2779,16 @@ Your cooperation is appreciated. ... 39 = /dev/cudb7 Callout device for ttyDB7 40 = /dev/cusg0 Callout device for ttySG0 - 41 = /dev/ttySMX0 Callout device for ttySMX0 - 42 = /dev/ttySMX1 Callout device for ttySMX1 - 43 = /dev/ttySMX2 Callout device for ttySMX2 + 41 = /dev/ttycusmx0 Callout device for ttySMX0 + 42 = /dev/ttycusmx1 Callout device for ttySMX1 + 43 = /dev/ttycusmx2 Callout device for ttySMX2 + 46 = /dev/cucpm0 Callout device for ttyCPM0 + ... + 49 = /dev/cucpm5 Callout device for ttyCPM5 + 50 = /dev/cuioc40 Callout device for ttyIOC40 + ... + 81 = /dev/cuioc431 Callout device for ttyIOC431 + 206 char OnStream SC-x0 tape devices 0 = /dev/osst0 First OnStream SCSI tape, mode 0 @@ -2988,7 +3002,12 @@ Your cooperation is appreciated. ioctl()'s can be used to rewind the tape regardless of the device used to access it. -231-239 UNASSIGNED +231 char InfiniBand MAD + 0 = /dev/infiniband/umad0 + 1 = /dev/infiniband/umad1 + ... + +232-239 UNASSIGNED 240-254 char LOCAL/EXPERIMENTAL USE 240-254 block LOCAL/EXPERIMENTAL USE diff --git a/Documentation/digiepca.txt b/Documentation/digiepca.txt index 01c4adc59..88820fe38 100644 --- a/Documentation/digiepca.txt +++ b/Documentation/digiepca.txt @@ -1,3 +1,11 @@ +NOTE: This driver is obsolete. Digi provides a 2.6 driver (dgdm) at +http://www.digi.com for PCI cards. They no longer maintain this driver, +and have no 2.6 driver for ISA cards. + +This driver requires a number of user-space tools. They can be aquired from +http://www.digi.com, but only works with 2.4 kernels. + + The Digi Intl. epca driver. ---------------------------- The Digi Intl. epca driver for Linux supports the following boards: @@ -64,9 +72,6 @@ drivers/char/README.epca for more details. Note, this driver REQUIRES that digiDload be executed prior to it being used. Failure to do this will result in an ENODEV error. -The latest version of the tool package is available at: -ftp://ftp.dgii.com/drivers/linux/released/async/ - Documentation: -------------- Complete documentation for this product may be found in the tool package. @@ -74,14 +79,8 @@ Complete documentation for this product may be found in the tool package. Sources of information and support: ----------------------------------- Digi Intl. support site for this product: --> digilnux@dgii.com -Related information and information concerning other drivers supporting -Digi Intl. products: - --> FTP: ftp://dgii.com --> Webpage: http://www.dgii.com --> Webpage: http://lameter.com/digi +-> http://www.digi.com Acknowledgments: ---------------- @@ -90,3 +89,10 @@ supporting the original public domain DigiBoard driver Copyright (C) 1994,1995 Troy De Jongh. Many thanks to Christoph Lameter (christoph@lameter.com) and Mike McLagan (mike.mclagan@linux.org) who authored and contributed to the original document. + +Changelog: +---------- +10-29-04: Update status of driver, remove dead links in document + James Nelson + +2000 (?) Original Document diff --git a/Documentation/dnotify.txt b/Documentation/dnotify.txt index 3434cb3d1..6984fca60 100644 --- a/Documentation/dnotify.txt +++ b/Documentation/dnotify.txt @@ -54,6 +54,12 @@ directory "b". Also, files that are unlinked, will still cause notifications in the last directory that they were linked to. +Configuration +------------- + +Dnotify is controlled via the CONFIG_DNOTIFY configuration option. When +disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL. + Example ------- diff --git a/Documentation/dvb/README.dibusb b/Documentation/dvb/README.dibusb index e3d650b81..be4b5e277 100644 --- a/Documentation/dvb/README.dibusb +++ b/Documentation/dvb/README.dibusb @@ -26,7 +26,7 @@ Produced and reselled by Twinhan: - HAMA DVB-T USB device http://www.hama.de/portal/articleId*110620/action*2598 -- CTS Portable (Chinese Television System) +- CTS Portable (Chinese Television System) (2) http://www.2cts.tv/ctsportable/ - Unknown USB DVB-T device with vendor ID Hyper-Paltek @@ -46,16 +46,16 @@ Produced and reselled by KWorld: Others: ------- -- Ultima Electronic/Artec T1 USB TVBOX (AN2135 and AN2235) +- Ultima Electronic/Artec T1 USB TVBOX (AN2135, AN2235, AN2235 with Panasonic Tuner) http://82.161.246.249/products-tvbox.html -- Compro Videomate DVB-U2000 - DVB-T USB +- Compro Videomate DVB-U2000 - DVB-T USB (2) http://www.comprousa.com/products/vmu2000.htm - Grandtec USB DVB-T http://www.grand.com.tw/ -- Avermedia AverTV DVBT USB +- Avermedia AverTV DVBT USB (2) http://www.avermedia.com/ - DiBcom USB DVB-T reference device (non-public) @@ -63,16 +63,33 @@ Others: Supported devices USB2.0 ======================== -- Twinhan MagicBox II +- Twinhan MagicBox II (2) http://www.twinhan.com/product_terrestrial_7.asp -- Yakumo DVB-T mobile +- Hanftek UMT-010 (1) + http://www.globalsources.com/si/6008819757082/ProductDetail/Digital-TV/product_id-100046529 + +- Typhoon/Yakumo/HAMA DVB-T mobile USB2.0 (1) http://www.yakumo.de/produkte/index.php?pid=1&ag=DVB-T +- Artec T1 USB TVBOX (FX2) (2) + - DiBcom USB2.0 DVB-T reference device (non-public) +1) It is working almost. +2) No test reports received yet. + 0. NEWS: + 2004-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb + - first almost working version for HanfTek UMT-010 + - found out, that Yakumo/HAMA/Typhoon are predessors of the HanfTek + 2004-01-10 - refactoring completed, now everything is very delightful + - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a + Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich. + 2004-12-29 - after several days of struggling around bug of no returning URBs fixed. + 2004-12-26 - refactored the dibusb-driver, splitted into separate files + - i2c-probing enabled 2004-12-06 - possibility for demod i2c-address probing - new usb IDs (Compro,Artec) 2004-11-23 - merged changes from DiB3000MC_ver2.1 @@ -115,13 +132,15 @@ Supported devices USB2.0 1. How to use? NOTE: This driver was developed using Linux 2.6.6., -it is working with 2.6.7, 2.6.8.1, 2.6.9 . +it is working with 2.6.7 and above. Linux 2.4.x support is not planned, but patches are very welcome. NOTE: I'm using Debian testing, so the following explaination (especially the hotplug-path) needn't match your system, but probably it will :). +The driver is included in the kernel since Linux 2.6.10. + 1.1. Firmware The USB driver needs to download a firmware to start working. @@ -155,9 +174,13 @@ from withing the dvb-kernel cvs repository. first have a look, which debug level are available: modinfo dib3000mb +modinfo dib3000-common +modinfo dib3000mc modinfo dvb-dibusb +modprobe dib3000-common debug= modprobe dib3000mb debug= +modprobe dib3000mc debug= modprobe dvb-dibusb debug= should do the trick. @@ -168,13 +191,11 @@ turned on. At this point you should be able to start a dvb-capable application. For myself I used mplayer, dvbscan, tzap and kaxtv, they are working. Using the device -as a slave device in vdr, was not working for me. Some work has to be done -(patches and comments are very welcome). +in vdr (at least the USB2.0 one) is working. 2. Known problems and bugs -TODO: -- signal-quality and strength calculations +- none this time 2.1. Adding support for devices @@ -202,9 +223,10 @@ Most of the current supported devices are USB1.1 and thus they have a maximum bandwidth of about 5-6 MBit/s when connected to a USB2.0 hub. This is not enough for receiving the complete transport stream of a DVB-T channel (which can be about 16 MBit/s). Normally this is not a -problem, if you only want to watch TV, but watching a channel while -recording another channel on the same frequency simply does not work. -This applies to all USB1.1 DVB-T devices. +problem, if you only want to watch TV (this does not apply for HDTV), +but watching a channel while recording another channel on the same +frequency simply does not work. This applies to all USB1.1 DVB-T +devices, not only dibusb) A special problem of the dibusb for the USB1.1 is, that the USB control IC has a problem with write accesses while having MPEG2-streaming @@ -218,14 +240,20 @@ due the automatic scanning (introduced in 1.3.x, afaik) and epg-scan. Disabling these features is maybe a solution. Additionally this behaviour of VDR exceeds the USB1.1 bandwidth. +Update: +For the USB1.1 and VDR some work has been done (patches and comments are still +very welcome). Maybe the problem is solved in the meantime because I now use +the dmx_sw_filter function instead of dmx_sw_filter_packet. I hope the +linux-dvb software filter is able to get the best of the garbled TS. + 2.3. Comments Patches, comments and suggestions are very very welcome 3. Acknowledgements Amaury Demol (ademol@dibcom.fr) and Francois Kanounnikoff from DiBcom for - providing specs, code and help, on which the dvb-dibusb and dib3000mb are - based. + providing specs, code and help, on which the dvb-dibusb, dib3000mb and + dib3000mc are based. David Matthews for identifying a new device type (Artec T1 with AN2235) and for extending dibusb with remote control event handling. Thank you. diff --git a/Documentation/dvb/avermedia.txt b/Documentation/dvb/avermedia.txt index 5d8dbdada..09020ebd2 100644 --- a/Documentation/dvb/avermedia.txt +++ b/Documentation/dvb/avermedia.txt @@ -6,7 +6,6 @@ HOWTO: Get An Avermedia DVB-T working under Linux Assumptions and Introduction The Avermedia DVB-T Getting the card going - Getting the Firmware Receiving DVB-T in Australia Known Limitations Further Update @@ -149,28 +148,9 @@ Getting the card going to start accessing the card with utilities such as scan, tzap, dvbstream etc. - The current version of the frontend module sp887x.o, contains - no firmware drivers?, so the first time you open it with a DVB - utility the driver will try to download some initial firmware - to the card. You will need to download this firmware from the - web, or copy it from an installation of the Windows drivers - that probably came with your card, before you can use it. - - The default Linux filesystem location for this firmware is - /usr/lib/hotplug/firmware/sc_main.mc . - _________________________________________________________ - -Getting the Firmware - - As the firmware for the card is no longer contained within the - driver, it is necessary to extract it from the windows - drivers. - - The Windows drivers for the Avermedia DVB-T can be obtained - from: http://babyurl.com/H3U970 and you can get an application - to extract the firmware from: - http://www.kyz.uklinux.net/cabextract.php. - _________________________________________________________ + The frontend module sp887x.o, requires an external firmware. + Please use the command "get_dvb_firmware sp887x" to download + it. Then copy it to /usr/lib/hotplug/firmware. Receiving DVB-T in Australia diff --git a/Documentation/dvb/cards.txt b/Documentation/dvb/cards.txt index 695f174d8..efdc4ee9d 100644 --- a/Documentation/dvb/cards.txt +++ b/Documentation/dvb/cards.txt @@ -38,6 +38,7 @@ o Frontends drivers: Comtech DVBT-6k07 (SP5730 PLL) (NxtWave Communications NXT6000 demodulator) - sp887x : Microtune 7202D + - dib3000mb : DiBcom 3000-MB demodulator DVB-S/C/T: - dst : TwinHan DST Frontend @@ -49,7 +50,7 @@ o Cards based on the Phillips saa7146 multimedia PCI bridge chip: - "budget" cards (i.e. without hardware MPEG decoder): - Technotrend Budget / Hauppauge WinTV-Nova PCI Cards - SATELCO Multimedia PCI - - KNC1 DVB-S + - KNC1 DVB-S, Typhoon DVB-S, Terratec Cinergy 1200 DVB-S (no CI support) - Typhoon DVB-S budget - Fujitsu-Siemens Activy DVB-S budget card @@ -66,4 +67,19 @@ o Technotrend / Hauppauge DVB USB devices: - Nova USB - DEC 2000-T, 3000-S, 2540-T +o DiBcom DVB-T USB based devices: + - Twinhan VisionPlus VisionDTV USB-Ter DVB-T Device + - HAMA DVB-T USB device + - CTS Portable (Chinese Television System) + - KWorld V-Stream XPERT DTV DVB-T USB + - JetWay DTV DVB-T USB + - ADSTech Instant TV DVB-T USB + - Ultima Electronic/Artec T1 USB TVBOX (AN2135 and AN2235) + - Compro Videomate DVB-U2000 - DVB-T USB + - Grandtec USB DVB-T + - Avermedia AverTV DVBT USB + - DiBcom USB DVB-T reference device (non-public) + - Yakumo DVB-T mobile USB2.0 + - DiBcom USB2.0 DVB-T reference device (non-public) + o Experimental support for the analog module of the Siemens DVB-C PCI card diff --git a/Documentation/dvb/contributors.txt b/Documentation/dvb/contributors.txt index 12026e933..dd40ad665 100644 --- a/Documentation/dvb/contributors.txt +++ b/Documentation/dvb/contributors.txt @@ -69,6 +69,8 @@ Andreas 'randy' Weinberger Kenneth Aafløy for adding support for Typhoon DVB-S budget card +Ernst Peinlich + for tuning/DiSEqC support for the DEC 3000-s (If you think you should be in this list, but you are not, drop a line to the DVB mailing list) diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index e9964b71e..22d410e6e 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware @@ -21,7 +21,8 @@ use File::Temp qw/ tempdir /; use IO::Handle; -@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", "dec2540t", "dec3000s", "vp7041", "dibusb" ); +@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", + "dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002" ); # Check args syntax() if (scalar(@ARGV) != 1); @@ -233,6 +234,23 @@ sub dibusb { $outfile; } +sub nxt2002 { + my $sourcefile = "Broadband4PC_4_2_11.zip"; + my $url = "http://www.bbti.us/download/windows/$sourcefile"; + my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; + my $outfile = "dvb-fe-nxt2002.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/SkyNETU.sys", $hash); + extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); + + $outfile; +} + # --------------------------------------------------------------- # Utilities diff --git a/Documentation/dvb/readme.txt b/Documentation/dvb/readme.txt index 720aa8ce0..a60c27d43 100644 --- a/Documentation/dvb/readme.txt +++ b/Documentation/dvb/readme.txt @@ -28,9 +28,9 @@ is the who-is-who of DVB development "faq.txt" contains frequently asked questions and their answers. -"firmware.txt" -contains informations for required external firmware -files and where to get them. +"get_dvb_firmware" +script to download and extract firmware for those devices +that require it. "ttusb-dec.txt" contains detailed informations about the @@ -41,4 +41,11 @@ contains detailed installation instructions for the various bt8xx based "budget" DVB cards (Nebula, Pinnacle PCTV, Twinhan DST) +"README.dibusb" +contains detailed information about adapters +based on DiBcom reference design. + +"udev.txt" +how to get DVB and udev up and running. + Good luck and have fun! diff --git a/Documentation/dvb/ttusb-dec.txt b/Documentation/dvb/ttusb-dec.txt index 4a547fba7..5c1e984c2 100644 --- a/Documentation/dvb/ttusb-dec.txt +++ b/Documentation/dvb/ttusb-dec.txt @@ -6,6 +6,8 @@ Driver Status Supported: DEC2000-t + DEC2450-t + DEC3000-s Linux Kernels 2.4 and 2.6 Video Streaming Audio Streaming @@ -13,52 +15,30 @@ Supported: Channel Zapping Hotplug firmware loader under 2.6 kernels -In Progress: - DEC2540-t - DEC3000-s - To Do: Tuner status information DVB network interface Streaming video PC->DEC + Conax support for 2450-t Getting the Firmware -------------------- -The firmware can be found in the software update zip files on this page: -http://www.hauppauge.de/sw_dec.htm - -The firmwares are named as follows: -DEC2000-t: STB_PC_T.bin -DEC2540-t: STB_PC_X.bin -DEC3000-s: STB_PC_S.bin - -Note that firmwares since version 2.16 beta2 for the DEC2000-t give the device -the USB ID of the DEC3000-s. The driver copes with this. - -Instructions follow for retrieving version 2.16 of the firmware: - -wget http://hauppauge.lightpath.net/de/dec216.exe -unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_T.bin -unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_X.bin -unzip -j dec216.exe software/OEM/STB/App/Boot/STB_PC_S.bin +To download the firmware, use the following commands: +"get_dvb_firmware dec2000t" +"get_dvb_firmware dec2540t" +"get_dvb_firmware dec3000s" Compilation Notes for 2.4 kernels --------------------------------- For 2.4 kernels the firmware for the DECs is compiled into the driver itself. -The firmwares are expected to be in the build-2.4 directory at compilation -time. -mv STB_PC_T.bin build-2.4/dvb-ttusb-dec-2000t.fw -mv STB_PC_X.bin build-2.4/dvb-ttusb-dec-2540t.fw -mv STB_PC_S.bin build-2.4/dvb-ttusb-dec-3000s.fw +Copy the three files downloaded above into the build-2.4 directory. Hotplug Firmware Loading for 2.6 kernels ---------------------------------------- For 2.6 kernels the firmware is loaded at the point that the driver module is -loaded. See Documentation/dvb/firmware.txt for more information. +loaded. See linux/Documentation/dvb/firmware.txt for more information. -mv STB_PC_T.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2000t.fw -mv STB_PC_X.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2540t.fw -mv STB_PC_S.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-3000s.fw +Copy the three files downloaded above into the /usr/lib/hotplug/firmware directory. diff --git a/Documentation/early-userspace/README b/Documentation/early-userspace/README index 7d5661284..270a88e22 100644 --- a/Documentation/early-userspace/README +++ b/Documentation/early-userspace/README @@ -1,7 +1,7 @@ Early userspace support ======================= -Last update: 2003-08-21 +Last update: 2004-12-20 tlh "Early userspace" is a set of libraries and programs that provide @@ -17,15 +17,66 @@ It consists of several major infrastructure components: - initramfs, a chunk of code that unpacks the compressed cpio image midway through the kernel boot process. - klibc, a userspace C library, currently packaged separately, that is - optimised for correctness and small size. + optimized for correctness and small size. The cpio file format used by initramfs is the "newc" (aka "cpio -c") -format, and is documented in the file "buffer-format.txt". If you -want to generate your own cpio files directly instead of hacking on -gen_init_cpio, you will need to short-circuit the build process in -usr/ so that gen_init_cpio does not get run, then simply pop your own -initramfs_data.cpio.gz file into place. - +format, and is documented in the file "buffer-format.txt". There are +two ways to add an early userspace image: specify an existing cpio +archive to be used as the image or have the kernel build process build +the image from specifications. + +CPIO ARCHIVE method + +You can create a cpio archive that contains the early userspace image. +Youre cpio archive should be specified in CONFIG_INITRAMFS_SOURCE and it +will be used directly. Only a single cpio file may be specified in +CONFIG_INITRAMFS_SOURCE and directory and file names are not allowed in +combination with a cpio archive. + +IMAGE BUILDING method + +The kernel build process can also build an early userspace image from +source parts rather than supplying a cpio archive. This method provides +a way to create images with root-owned files even though the image was +built by an unprivileged user. + +The image is specified as one or more sources in +CONFIG_INITRAMFS_SOURCE. Sources can be either directories or files - +cpio archives are *not* allowed when building from sources. + +A source directory will have it and all of it's contents packaged. The +specified directory name will be mapped to '/'. When packaging a +directory, limited user and group ID translation can be performed. +INITRAMFS_ROOT_UID can be set to a user ID that needs to be mapped to +user root (0). INITRAMFS_ROOT_GID can be set to a group ID that needs +to be mapped to group root (0). + +A source file must be directives in the format required by the +usr/gen_init_cpio utility (run 'usr/gen_init_cpio --help' to get the +file format). The directives in the file will be passed directly to +usr/gen_init_cpio. + +When a combination of directories and files are specified then the +initramfs image will be an aggregate of all of them. In this way a user +can create a 'root-image' directory and install all files into it. +Because device-special files cannot be created by a unprivileged user, +special files can be listed in a 'root-files' file. Both 'root-image' +and 'root-files' can be listed in CONFIG_INITRAMFS_SOURCE and a complete +early userspace image can be built by an unprivileged user. + +As a technical note, when directories and files are specified, the +entire CONFIG_INITRAMFS_SOURCE is passed to +scripts/gen_initramfs_list.sh. This means that CONFIG_INITRAMFS_SOURCE +can really be interpreted as any legal argument to +gen_initramfs_list.sh. If a directory is specified as an argument then +the contents are scanned, uid/gid translation is performed, and +usr/gen_init_cpio file directives are output. If a directory is +specified as an arugemnt to scripts/gen_initramfs_list.sh then the +contents of the file are simply copied to the output. All of the output +directives from directory scanning and file contents copying are +processed by usr/gen_init_cpio. + +See also 'scripts/gen_initramfs_list.sh -h'. Where's this all leading? ========================= diff --git a/Documentation/fb/matroxfb.txt b/Documentation/fb/matroxfb.txt index 621e3b3e4..ad7a67707 100644 --- a/Documentation/fb/matroxfb.txt +++ b/Documentation/fb/matroxfb.txt @@ -223,6 +223,13 @@ dfp:X - use settings X for digital flat panel interface. X is number from selects who is source of display clocks, whether G400, or panel. Default value is now read back from hardware - so you should specify this value only if you are also using `init' parameter. +outputs:XYZ - set mapping between CRTC and outputs. Each letter can have value + of 0 (for no CRTC), 1 (CRTC1) or 2 (CRTC2), and first letter corresponds + to primary analog output, second letter to the secondary analog output + and third letter to the DVI output. Default setting is 100 for + cards below G400 or G400 without DFP, 101 for G400 with DFP, and + 111 for G450 and G550. You can set mapping only on first card, + use matroxset for setting up other devices. vesa:X - selects startup videomode. X is number from 0 to 0x1FF, see table above for detailed explanation. Default is 640x480x8bpp if driver has 8bpp support. Otherwise first available of 640x350x4bpp, diff --git a/Documentation/fb/vesafb.txt b/Documentation/fb/vesafb.txt index 36beb54f1..814e2f56a 100644 --- a/Documentation/fb/vesafb.txt +++ b/Documentation/fb/vesafb.txt @@ -146,11 +146,16 @@ pmipal Use the protected mode interface for palette changes. mtrr setup memory type range registers for the vesafb framebuffer. -vram:n remap 'n' MiB of video RAM. If 0 or not specified, remap memory +vremap:n + remap 'n' MiB of video RAM. If 0 or not specified, remap memory according to video mode. (2.5.66 patch/idea by Antonino Daplas reversed to give override possibility (allocate more fb memory than the kernel would) to 2.4 by tmb@iki.fi) +vtotal:n + if the video BIOS of your card incorrectly determines the total + amount of video RAM, use this option to override the BIOS (in MiB). + Have fun! Gerd diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index 6cf8082f6..bcfbab899 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX @@ -42,8 +42,6 @@ udf.txt - info and mount options for the UDF filesystem. ufs.txt - info on the ufs filesystem. -umsdos.txt - - info on the umsdos extensions to the msdos filesystem. vfat.txt - info on using the VFAT filesystem used in Windows NT and Windows 95 vfs.txt diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index f1c2cee13..2c9ce27b1 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -295,13 +295,19 @@ fl_release_private: yes yes prototypes: int (*fl_compare_owner)(struct file_lock *, struct file_lock *); void (*fl_notify)(struct file_lock *); /* unblock callback */ + void (*fl_copy_lock)(struct file_lock *, struct file_lock *); + void (*fl_release_private)(struct file_lock *); + void (*fl_break)(struct file_lock *); /* break_lease callback */ locking rules: BKL may block fl_compare_owner: yes no fl_notify: yes no +fl_copy_lock: yes no +fl_release_private: yes yes +fl_break: yes no - Currently only NLM provides instances of this class. None of the + Currently only NFSD and NLM provide instances of this class. None of the them block. If you have out-of-tree instances - please, show up. Locking in that area will change. --------------------------- buffer_head ----------------------------------- @@ -311,8 +317,8 @@ prototypes: locking rules: called from interrupts. In other words, extreme care is needed here. bh is locked, but that's all warranties we have here. Currently only RAID1, -highmem and fs/buffer.c are providing these. Block devices call this method -upon the IO completion. +highmem, fs/buffer.c, and fs/ntfs/aops.c are providing these. Block devices +call this method upon the IO completion. --------------------------- block_device_operations ----------------------- prototypes: @@ -344,6 +350,8 @@ prototypes: unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); + long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); + long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *); @@ -377,6 +385,8 @@ aio_write: no readdir: no poll: no ioctl: yes (see below) +unlocked_ioctl: no (see below) +compat_ioctl: no mmap: no open: maybe (see below) flush: no @@ -422,6 +432,9 @@ move ->readdir() to inode_operations and use a separate method for directory anything that resembles union-mount we won't have a struct file for all components. And there are other reasons why the current interface is a mess... +->ioctl() on regular files is superceded by the ->unlocked_ioctl() that +doesn't take the BKL. + ->read on directories probably must go away - we should just enforce -EISDIR in sys_read() and friends. diff --git a/Documentation/filesystems/devfs/ChangeLog b/Documentation/filesystems/devfs/ChangeLog index 12583144e..e5aba5246 100644 --- a/Documentation/filesystems/devfs/ChangeLog +++ b/Documentation/filesystems/devfs/ChangeLog @@ -1632,7 +1632,7 @@ Changes for patch v177 - Fixed bugs in handling symlinks: could leak or cause Oops - Cleaned up directory handling by separating fops - Thanks to Alexander Viro + Thanks to Alexander Viro =============================================================================== Changes for patch v178 diff --git a/Documentation/filesystems/devfs/README b/Documentation/filesystems/devfs/README index 3ef858266..54366ecc2 100644 --- a/Documentation/filesystems/devfs/README +++ b/Documentation/filesystems/devfs/README @@ -1349,47 +1349,6 @@ This will cause devfsd to create (and destroy) symbolic links which point to the kernel-supplied names. -SCSI Host Probing Issues - -Devfs allows you to identify SCSI discs based in part on SCSI host -numbers. If you have only one SCSI host (card) in your computer, then -clearly it will be given host number 0. Life is not always that easy -is you have multiple SCSI hosts. Unfortunately, it can sometimes be -difficult to guess what the probing order of SCSI hosts is. You need -to know the probe order before you can use device names. To make this -easy, there is a kernel boot parameter called "scsihosts". This allows -you to specify the probe order for different types of SCSI hosts. The -syntax of this parameter is: - -scsihosts=:::...: - -where ,,..., are the names -of drivers used in the /proc filesystem. For example: - - scsihosts=aha1542:ppa:aha1542::ncr53c7xx - - -means that devices connected to - -- first aha1542 controller - will be /dev/scsi/host0/bus#/target#/lun# -- first parallel port ZIP - will be /dev/scsi/host1/bus#/target#/lun# -- second aha1542 controller - will be /dev/scsi/host2/bus#/target#/lun# -- first NCR53C7xx controller - will be /dev/scsi/host4/bus#/target#/lun# -- any extra controller - will be /dev/scsi/host5/bus#/target#/lun#, - /dev/scsi/host6/bus#/target#/lun#, etc -- if any of above controllers will not be found - the reserved names will - not be used by any other device. -- /dev/scsi/host3/bus#/target#/lun# names will never be used - - -You can use ',' instead of ':' as the separator character if you -wish. I have used the devfsd naming scheme -here. - -Note that this scheme does not address the SCSI host order if you have -multiple cards of the same type (such as NCR53c8xx). In this case you -need to use the driver-specific boot parameters to control this. - ----------------------------------------------------------------------------- @@ -1952,12 +1911,6 @@ explores the SCSI subsystem and how it interacts with devfs Douglas Gilbert has written another useful document at -http://www.torque.net/scsi/scsihosts.html which -discusses the scsihosts= boot option - - -Douglas Gilbert has written yet another useful document at - http://www.torque.net/scsi/SCSI-2.4-HOWTO/ which discusses the Linux SCSI subsystem in 2.4. diff --git a/Documentation/filesystems/ext2.txt b/Documentation/filesystems/ext2.txt index 23a4d98f9..b5cb9110c 100644 --- a/Documentation/filesystems/ext2.txt +++ b/Documentation/filesystems/ext2.txt @@ -11,57 +11,53 @@ for NetBSD, FreeBSD, the GNU HURD, Windows 95/98/NT, OS/2 and RISC OS. Options ======= -When mounting an ext2 filesystem, the following options are accepted. -Defaults are marked with (*). +Most defaults are determined by the filesystem superblock, and can be +set using tune2fs(8). Kernel-determined defaults are indicated by (*). bsddf (*) Makes `df' act like BSD. minixdf Makes `df' act like Minix. -barrier=1 This enables/disables barriers. barrier=0 disables it, - barrier=1 enables it. - -orlov (*) This enables the new Orlov block allocator. It's - enabled by default. - -oldalloc This disables the Orlov block allocator and - enables the old block allocator. Orlov should - have better performance, we'd like to get some - feedback if it's the contrary for you. - -user_xattr (*) Enables POSIX Extended Attributes. It's enabled by - default, however you need to confifure its support - (CONFIG_EXT2_FS_XATTR). This is neccesary if you want - to use POSIX Acces Control Lists support. You can visit - http://acl.bestbits.at to know more about POSIX Extended - attributes. - -nouser_xattr Disables POSIX Extended Attributes. - -acl (*) Enables POSIX Access Control Lists support. This is - enabled by default, however you need to configure - its support (CONFIG_EXT2_FS_POSIX_ACL). If you want - to know more about ACLs visit http://acl.bestbits.at - -noacl This option disables POSIX Access Control List support. - +check Check block and inode bitmaps at mount time + (requires CONFIG_EXT2_CHECK). check=none, nocheck (*) Don't do extra checking of bitmaps on mount (check=normal and check=strict options removed) debug Extra debugging information is sent to the kernel syslog. Useful for developers. -errors=continue (*) Keep going on a filesystem error. +errors=continue Keep going on a filesystem error. errors=remount-ro Remount the filesystem read-only on an error. errors=panic Panic and halt the machine if an error occurs. grpid, bsdgroups Give objects the same group ID as their parent. -nogrpid, sysvgroups (*) New objects have the group ID of their creator. +nogrpid, sysvgroups New objects have the group ID of their creator. + +nouid32 Use 16-bit UIDs and GIDs. + +oldalloc Enable the old block allocator. Orlov should + have better performance, we'd like to get some + feedback if it's the contrary for you. +orlov (*) Use the Orlov block allocator. + (See http://lwn.net/Articles/14633/ and + http://lwn.net/Articles/14446/.) resuid=n The user ID which may use the reserved blocks. -resgid=n The group ID which may use the reserved blocks. +resgid=n The group ID which may use the reserved blocks. sb=n Use alternate superblock at this location. +user_xattr Enable "user." POSIX Extended Attributes + (requires CONFIG_EXT2_FS_XATTR). + See also http://acl.bestbits.at +nouser_xattr Don't support "user." extended attributes. + +acl Enable POSIX Access Control Lists support + (requires CONFIG_EXT2_FS_POSIX_ACL). + See also http://acl.bestbits.at +noacl Don't support POSIX ACLs. + +nobh Do not attach buffer_heads to file pagecache. + grpquota,noquota,quota,usrquota Quota options are silently ignored by ext2. diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt index 7d600c0f4..f89b440fa 100644 --- a/Documentation/filesystems/ntfs.txt +++ b/Documentation/filesystems/ntfs.txt @@ -10,8 +10,10 @@ Table of contents - Features - Supported mount options - Known bugs and (mis-)features -- Using Software RAID with NTFS -- Limitiations when using the MD driver +- Using NTFS volume and stripe sets + - The Device-Mapper driver + - The Software RAID / MD driver + - Limitiations when using the MD driver - ChangeLog @@ -199,11 +201,161 @@ Please send bug reports/comments/feedback/abuse to the Linux-NTFS development list at sourceforge: linux-ntfs-dev@lists.sourceforge.net -Using Software RAID with NTFS -============================= +Using NTFS volume and stripe sets +================================= + +For support of volume and stripe sets, you can either use the kernel's +Device-Mapper driver or the kernel's Software RAID / MD driver. The former is +the recommended one to use for linear raid. But the latter is required for +raid level 5. For striping and mirroring, either driver should work fine. + + +The Device-Mapper driver +------------------------ + +You will need to create a table of the components of the volume/stripe set and +how they fit together and load this into the kernel using the dmsetup utility +(see man 8 dmsetup). + +Linear volume sets, i.e. linear raid, has been tested and works fine. Even +though untested, there is no reason why stripe sets, i.e. raid level 0, and +mirrors, i.e. raid level 1 should not work, too. Stripes with parity, i.e. +raid level 5, unfortunately cannot work yet because the current version of the +Device-Mapper driver does not support raid level 5. You may be able to use the +Software RAID / MD driver for raid level 5, see the next section for details. + +To create the table describing your volume you will need to know each of its +components and their sizes in sectors, i.e. multiples of 512-byte blocks. + +For NT4 fault tolerant volumes you can obtain the sizes using fdisk. So for +example if one of your partitions is /dev/hda2 you would do: + +$ fdisk -ul /dev/hda + +Disk /dev/hda: 81.9 GB, 81964302336 bytes +255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors +Units = sectors of 1 * 512 = 512 bytes + + Device Boot Start End Blocks Id System + /dev/hda1 * 63 4209029 2104483+ 83 Linux + /dev/hda2 4209030 37768814 16779892+ 86 NTFS + /dev/hda3 37768815 46170809 4200997+ 83 Linux + +And you would know that /dev/hda2 has a size of 37768814 - 4209030 + 1 = +33559785 sectors. + +For Win2k and later dynamic disks, you can for example use the ldminfo utility +which is part of the Linux LDM tools (the latest version at the time of +writing is linux-ldm-0.0.8.tar.bz2). You can download it from: + http://linux-ntfs.sourceforge.net/downloads.html +Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go +into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You +will find the precompiled (i386) ldminfo utility there. NOTE: You will not be +able to compile this yourself easily so use the binary version! + +Then you would use ldminfo in dump mode to obtain the necessary information: + +$ ./ldminfo --dump /dev/hda + +This would dump the LDM database found on /dev/hda which describes all of your +dynamic disks and all the volumes on them. At the bottom you will see the +VOLUME DEFINITIONS section which is all you really need. You may need to look +further above to determine which of the disks in the volume definitions is +which device in Linux. Hint: Run ldminfo on each of your dynamic disks and +look at the Disk Id close to the top of the output for each (the PRIVATE HEADER +section). You can then find these Disk Ids in the VBLK DATABASE section in the + components where you will get the LDM Name for the disk that is found in +the VOLUME DEFINITIONS section. + +Note you will also need to enable the LDM driver in the Linux kernel. If your +distribution did not enable it, you will need to recompile the kernel with it +enabled. This will create the LDM partitions on each device at boot time. You +would then use those devices (for /dev/hda they would be /dev/hda1, 2, 3, etc) +in the Device-Mapper table. + +You can also bypass using the LDM driver by using the main device (e.g. +/dev/hda) and then using the offsets of the LDM partitions into this device as +the "Start sector of device" when creating the table. Once again ldminfo would +give you the correct information to do this. + +Assuming you know all your devices and their sizes things are easy. + +For a linear raid the table would look like this (note all values are in +512-byte sectors): + +--- cut here --- +# Offset into Size of this Raid type Device Start sector +# volume device of device +0 1028161 linear /dev/hda1 0 +1028161 3903762 linear /dev/hdb2 0 +4931923 2103211 linear /dev/hdc1 0 +--- cut here --- -For support of volume and stripe sets, use the kernel's Software RAID / MD -driver and set up your /etc/raidtab appropriately (see man 5 raidtab). +For a striped volume, i.e. raid level 0, you will need to know the chunk size +you used when creating the volume. Windows uses 64kiB as the default, so it +will probably be this unless you changes the defaults when creating the array. + +For a raid level 0 the table would look like this (note all values are in +512-byte sectors): + +--- cut here --- +# Offset Size Raid Number Chunk 1st Start 2nd Start +# into of the type of size Device in Device in +# volume volume stripes device device +0 2056320 striped 2 128 /dev/hda1 0 /dev/hdb1 0 +--- cut here --- + +If there are more than two devices, just add each of them to the end of the +line. + +Finally, for a mirrored volume, i.e. raid level 1, the table would look like +this (note all values are in 512-byte sectors): + +--- cut here --- +# Ofs Size Raid Log Number Region Should Number Source Start Taget Start +# in of the type type of log size sync? of Device in Device in +# vol volume params mirrors Device Device +0 2056320 mirror core 2 16 nosync 2 /dev/hda1 0 /dev/hdb1 0 +--- cut here --- + +If you are mirroring to multiple devices you can specify further targets at the +end of the line. + +Note the "Should sync?" parameter "nosync" means that the two mirrors are +already in sync which will be the case on a clean shutdown of Windows. If the +mirrors are not clean, you can specify the "sync" option instead of "nosync" +and the Device-Mapper driver will then copy the entirey of the "Source Device" +to the "Target Device" or if you specified multipled target devices to all of +them. + +Once you have your table, save it in a file somewhere (e.g. /etc/ntfsvolume1), +and hand it over to dmsetup to work with, like so: + +$ dmsetup create myvolume1 /etc/ntfsvolume1 + +You can obviously replace "myvolume1" with whatever name you like. + +If it all worked, you will now have the device /dev/device-mapper/myvolume1 +which you can then just use as an argument to the mount command as usual to +mount the ntfs volume. For example: + +$ mount -t ntfs -o ro /dev/device-mapper/myvolume1 /mnt/myvol1 + +(You need to create the directory /mnt/myvol1 first and of course you can use +anything you like instead of /mnt/myvol1 as long as it is an existing +directory.) + +It is advisable to do the mount read-only to see if the volume has been setup +correctly to avoid the possibility of causing damage to the data on the ntfs +volume. + + +The Software RAID / MD driver +----------------------------- + +An alternative to using the Device-Mapper driver is to use the kernel's +Software RAID / MD driver. For which you need to set up your /etc/raidtab +appropriately (see man 5 raidtab). Linear volume sets, i.e. linear raid, as well as stripe sets, i.e. raid level 0, have been tested and work fine (though see section "Limitiations when using @@ -258,8 +410,8 @@ setup correctly to avoid the possibility of causing damage to the data on the ntfs volume. -Limitiations when using the MD driver -===================================== +Limitiations when using the Software RAID / MD driver +----------------------------------------------------- Using the md driver will not work properly if any of your NTFS partitions have an odd number of sectors. This is especially important for linear raid as all @@ -271,12 +423,24 @@ apparent when you try to use the volume again under Windows. So when using linear raid, make sure that all your partitions have an even number of sectors BEFORE attempting to use it. You have been warned! +Even better is to simply use the Device-Mapper for linear raid and then you do +not have this problem with odd numbers of sectors. + ChangeLog ========= Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. +2.1.22: + - Improve handling of ntfs volumes with errors. + - Fix various bugs and race conditions. +2.1.21: + - Fix several race conditions and various other bugs. + - Many internal cleanups, code reorganization, optimizations, and mft + and index record writing code rewritten to fit in with the changes. + - Update Documentation/filesystems/ntfs.txt with instructions on how to + use the Device-Mapper driver with NTFS ftdisk/LDM raid. 2.1.20: - Fix two stupid bugs introduced in 2.1.18 release. 2.1.19: diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 0dad0f2b0..f3f69ad01 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -350,22 +350,6 @@ available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE available in ZONE_NORMAL, etc... - -1.3 IDE devices in /proc/ide ----------------------------- - -The subdirectory /proc/ide contains information about all IDE devices of which -the kernel is aware. There is one subdirectory for each IDE controller, the -file drivers and a link for each IDE device, pointing to the device directory -in the controller specific subtree. - -The file drivers contains general information about the drivers used for the -IDE devices: - - > cat /proc/ide/drivers - ide-cdrom version 4.53 - ide-disk version 1.08 - .............................................................................. meminfo: @@ -394,9 +378,9 @@ Dirty: 968 kB Writeback: 0 kB Mapped: 280372 kB Slab: 684068 kB -Committed_AS: 1576424 kB +CommitLimit: 7669796 kB +Committed_AS: 100056 kB PageTables: 24448 kB -ReverseMaps: 1080904 VmallocTotal: 112216 kB VmallocUsed: 428 kB VmallocChunk: 111088 kB @@ -434,26 +418,54 @@ VmallocChunk: 111088 kB Writeback: Memory which is actively being written back to the disk Mapped: files which have been mmaped, such as libraries Slab: in-kernel data structures cache -Committed_AS: An estimate of how much RAM you would need to make a - 99.99% guarantee that there never is OOM (out of memory) - for this workload. Normally the kernel will overcommit - memory. That means, say you do a 1GB malloc, nothing - happens, really. Only when you start USING that malloc - memory you will get real memory on demand, and just as - much as you use. So you sort of take a mortgage and hope - the bank doesn't go bust. Other cases might include when - you mmap a file that's shared only when you write to it - and you get a private copy of that data. While it normally - is shared between processes. The Committed_AS is a - guesstimate of how much RAM/swap you would need - worst-case. + CommitLimit: Based on the overcommit ratio ('vm.overcommit_ratio'), + this is the total amount of memory currently available to + be allocated on the system. This limit is only adhered to + if strict overcommit accounting is enabled (mode 2 in + 'vm.overcommit_memory'). + The CommitLimit is calculated with the following formula: + CommitLimit = ('vm.overcommit_ratio' * Physical RAM) + Swap + For example, on a system with 1G of physical RAM and 7G + of swap with a `vm.overcommit_ratio` of 30 it would + yield a CommitLimit of 7.3G. + For more details, see the memory overcommit documentation + in vm/overcommit-accounting. +Committed_AS: The amount of memory presently allocated on the system. + The committed memory is a sum of all of the memory which + has been allocated by processes, even if it has not been + "used" by them as of yet. A process which malloc()'s 1G + of memory, but only touches 300M of it will only show up + as using 300M of memory even if it has the address space + allocated for the entire 1G. This 1G is memory which has + been "committed" to by the VM and can be used at any time + by the allocating application. With strict overcommit + enabled on the system (mode 2 in 'vm.overcommit_memory'), + allocations which would exceed the CommitLimit (detailed + above) will not be permitted. This is useful if one needs + to guarantee that processes will not fail due to lack of + memory once that memory has been successfully allocated. PageTables: amount of memory dedicated to the lowest level of page tables. - ReverseMaps: number of reverse mappings performed VmallocTotal: total size of vmalloc memory area VmallocUsed: amount of vmalloc area which is used VmallocChunk: largest contigious block of vmalloc area which is free + +1.3 IDE devices in /proc/ide +---------------------------- + +The subdirectory /proc/ide contains information about all IDE devices of which +the kernel is aware. There is one subdirectory for each IDE controller, the +file drivers and a link for each IDE device, pointing to the device directory +in the controller specific subtree. + +The file drivers contains general information about the drivers used for the +IDE devices: + + > cat /proc/ide/drivers + ide-cdrom version 4.53 + ide-disk version 1.08 + More detailed information can be found in the controller specific subdirectories. These are named ide0, ide1 and so on. Each of these directories contains the files shown in table 1-4. @@ -1269,6 +1281,14 @@ block_dump block_dump enables block I/O debugging when set to a nonzero value. More information on block I/O debugging is in Documentation/laptop-mode.txt. +swap_token_timeout +------------------ + +This file contains valid hold time of swap out protection token. The Linux +VM has token based thrashing control mechanism and uses the token to prevent +unnecessary page faults in thrashing situation. The unit of the value is +second. The value would be useful to tune thrashing behavior. + 2.5 /proc/sys/dev - Device specific parameters ---------------------------------------------- @@ -1689,12 +1709,13 @@ flush Writing to this file results in a flush of the routing cache. -gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, -gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 --------------------------------------------------------------- +gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh +--------------------------------------------------------------------- Values to control the frequency and behavior of the garbage collection -algorithm for the routing cache. +algorithm for the routing cache. gc_min_interval is deprecated and replaced +by gc_min_interval_ms. + max_size -------- diff --git a/Documentation/filesystems/ufs.txt b/Documentation/filesystems/ufs.txt index bdedb9fff..2b5a56a6a 100644 --- a/Documentation/filesystems/ufs.txt +++ b/Documentation/filesystems/ufs.txt @@ -15,13 +15,15 @@ ufstype=type_of_ufs ufs manually by mount option ufstype. Possible values are: old old format of ufs - default value, supported os read-only + default value, supported as read-only 44bsd used in FreeBSD, NetBSD, OpenBSD - supported os read-write + supported as read-write + + ufs2 used in FreeBSD 5.x + supported as read-only - ufs2 used in FreeBSD 5.x - supported os read-only + 5xbsd synonym for ufs2 sun used in SunOS (Solaris) supported as read-write @@ -29,6 +31,9 @@ ufstype=type_of_ufs sunx86 used in SunOS for Intel (Solarisx86) supported as read-write + hp used in HP-UX + supported as read-only + nextstep used in NextStep supported as read-only @@ -46,7 +51,7 @@ POSSIBLE PROBLEMS ================= There is still bug in reallocation of fragment, in file fs/ufs/balloc.c, -line 364. But it seem working on current buffer cache configuration. +line 364. But it seems working on current buffer cache configuration. BUG REPORTS diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 5be10c915..3f318dd44 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -44,7 +44,7 @@ Opening a File The VFS implements the open(2), stat(2), chmod(2) and similar system calls. The pathname argument is used by the VFS to search through the directory entry cache (dentry cache or "dcache"). This provides a very -fast lookup mechanism to translate a pathname (filename) into a +fast look-up mechanism to translate a pathname (filename) into a specific dentry. An individual dentry usually has a pointer to an inode. Inodes are the @@ -64,7 +64,7 @@ resolve your pathname into a dentry, the VFS may have to resort to creating dentries along the way, and then loading the inode. This is done by looking up the inode. -To lookup an inode (usually read from disc) requires that the VFS +To look up an inode (usually read from disc) requires that the VFS calls the lookup() method of the parent directory inode. This method is installed by the specific filesystem implementation that the inode lives in. There will be more on this later. @@ -286,7 +286,7 @@ otherwise noted. dentry). Here you will probably call d_instantiate() with the dentry and the newly created inode - lookup: called when the VFS needs to lookup an inode in a parent + lookup: called when the VFS needs to look up an inode in a parent directory. The name to look for is found in the dentry. This method must call d_add() to insert the found inode into the dentry. The "i_count" field in the inode structure should be @@ -405,7 +405,10 @@ from device node to device driver (this is an unofficial kernel patch). -struct dentry_operations
+Directory Entry Cache (dcache)
+------------------------------ + +struct dentry_operations ======================== This describes how a filesystem can overload the standard dentry @@ -425,7 +428,7 @@ struct dentry_operations { }; d_revalidate: called when the VFS needs to revalidate a dentry. This - is called whenever a name lookup finds a dentry in the + is called whenever a name look-up finds a dentry in the dcache. Most filesystems leave this as NULL, because all their dentries in the dcache are valid @@ -448,6 +451,9 @@ Each dentry has a pointer to its parent dentry, as well as a hash list of child dentries. Child dentries are basically like files in a directory. +Directory Entry Cache APIs +-------------------------- + There are a number of functions defined which permit a filesystem to manipulate dentries: @@ -482,3 +488,184 @@ manipulate dentries: pointer is NULL, the dentry is called a "negative dentry". This function is commonly called when an inode is created for an existing negative dentry + + d_lookup: look up a dentry given its parent and path name component + It looks up the child of that given name from the dcache + hash table. If it is found, the reference count is incremented + and the dentry is returned. The caller must use d_put() + to free the dentry when it finishes using it. + + +RCU-based dcache locking model +------------------------------ + +On many workloads, the most common operation on dcache is +to look up a dentry, given a parent dentry and the name +of the child. Typically, for every open(), stat() etc., +the dentry corresponding to the pathname will be looked +up by walking the tree starting with the first component +of the pathname and using that dentry along with the next +component to look up the next level and so on. Since it +is a frequent operation for workloads like multiuser +environments and webservers, it is important to optimize +this path. + +Prior to 2.5.10, dcache_lock was acquired in d_lookup and thus +in every component during path look-up. Since 2.5.10 onwards, +fastwalk algorithm changed this by holding the dcache_lock +at the beginning and walking as many cached path component +dentries as possible. This signficantly decreases the number +of acquisition of dcache_lock. However it also increases the +lock hold time signficantly and affects performance in large +SMP machines. Since 2.5.62 kernel, dcache has been using +a new locking model that uses RCU to make dcache look-up +lock-free. + +The current dcache locking model is not very different from the existing +dcache locking model. Prior to 2.5.62 kernel, dcache_lock +protected the hash chain, d_child, d_alias, d_lru lists as well +as d_inode and several other things like mount look-up. RCU-based +changes affect only the way the hash chain is protected. For everything +else the dcache_lock must be taken for both traversing as well as +updating. The hash chain updations too take the dcache_lock. +The significant change is the way d_lookup traverses the hash chain, +it doesn't acquire the dcache_lock for this and rely on RCU to +ensure that the dentry has not been *freed*. + + +Dcache locking details +---------------------- +For many multi-user workloads, open() and stat() on files are +very frequently occurring operations. Both involve walking +of path names to find the dentry corresponding to the +concerned file. In 2.4 kernel, dcache_lock was held +during look-up of each path component. Contention and +cacheline bouncing of this global lock caused significant +scalability problems. With the introduction of RCU +in linux kernel, this was worked around by making +the look-up of path components during path walking lock-free. + + +Safe lock-free look-up of dcache hash table +=========================================== + +Dcache is a complex data structure with the hash table entries +also linked together in other lists. In 2.4 kernel, dcache_lock +protected all the lists. We applied RCU only on hash chain +walking. The rest of the lists are still protected by dcache_lock. +Some of the important changes are : + +1. The deletion from hash chain is done using hlist_del_rcu() macro which + doesn't initialize next pointer of the deleted dentry and this + allows us to walk safely lock-free while a deletion is happening. + +2. Insertion of a dentry into the hash table is done using + hlist_add_head_rcu() which take care of ordering the writes - + the writes to the dentry must be visible before the dentry + is inserted. This works in conjuction with hlist_for_each_rcu() + while walking the hash chain. The only requirement is that + all initialization to the dentry must be done before hlist_add_head_rcu() + since we don't have dcache_lock protection while traversing + the hash chain. This isn't different from the existing code. + +3. The dentry looked up without holding dcache_lock by cannot be + returned for walking if it is unhashed. It then may have a NULL + d_inode or other bogosity since RCU doesn't protect the other + fields in the dentry. We therefore use a flag DCACHE_UNHASHED to + indicate unhashed dentries and use this in conjunction with a + per-dentry lock (d_lock). Once looked up without the dcache_lock, + we acquire the per-dentry lock (d_lock) and check if the + dentry is unhashed. If so, the look-up is failed. If not, the + reference count of the dentry is increased and the dentry is returned. + +4. Once a dentry is looked up, it must be ensured during the path + walk for that component it doesn't go away. In pre-2.5.10 code, + this was done holding a reference to the dentry. dcache_rcu does + the same. In some sense, dcache_rcu path walking looks like + the pre-2.5.10 version. + +5. All dentry hash chain updations must take the dcache_lock as well as + the per-dentry lock in that order. dput() does this to ensure + that a dentry that has just been looked up in another CPU + doesn't get deleted before dget() can be done on it. + +6. There are several ways to do reference counting of RCU protected + objects. One such example is in ipv4 route cache where + deferred freeing (using call_rcu()) is done as soon as + the reference count goes to zero. This cannot be done in + the case of dentries because tearing down of dentries + require blocking (dentry_iput()) which isn't supported from + RCU callbacks. Instead, tearing down of dentries happen + synchronously in dput(), but actual freeing happens later + when RCU grace period is over. This allows safe lock-free + walking of the hash chains, but a matched dentry may have + been partially torn down. The checking of DCACHE_UNHASHED + flag with d_lock held detects such dentries and prevents + them from being returned from look-up. + + +Maintaining POSIX rename semantics +================================== + +Since look-up of dentries is lock-free, it can race against +a concurrent rename operation. For example, during rename +of file A to B, look-up of either A or B must succeed. +So, if look-up of B happens after A has been removed from the +hash chain but not added to the new hash chain, it may fail. +Also, a comparison while the name is being written concurrently +by a rename may result in false positive matches violating +rename semantics. Issues related to race with rename are +handled as described below : + +1. Look-up can be done in two ways - d_lookup() which is safe + from simultaneous renames and __d_lookup() which is not. + If __d_lookup() fails, it must be followed up by a d_lookup() + to correctly determine whether a dentry is in the hash table + or not. d_lookup() protects look-ups using a sequence + lock (rename_lock). + +2. The name associated with a dentry (d_name) may be changed if + a rename is allowed to happen simultaneously. To avoid memcmp() + in __d_lookup() go out of bounds due to a rename and false + positive comparison, the name comparison is done while holding the + per-dentry lock. This prevents concurrent renames during this + operation. + +3. Hash table walking during look-up may move to a different bucket as + the current dentry is moved to a different bucket due to rename. + But we use hlists in dcache hash table and they are null-terminated. + So, even if a dentry moves to a different bucket, hash chain + walk will terminate. [with a list_head list, it may not since + termination is when the list_head in the original bucket is reached]. + Since we redo the d_parent check and compare name while holding + d_lock, lock-free look-up will not race against d_move(). + +4. There can be a theoritical race when a dentry keeps coming back + to original bucket due to double moves. Due to this look-up may + consider that it has never moved and can end up in a infinite loop. + But this is not any worse that theoritical livelocks we already + have in the kernel. + + +Important guidelines for filesystem developers related to dcache_rcu +==================================================================== + +1. Existing dcache interfaces (pre-2.5.62) exported to filesystem + don't change. Only dcache internal implementation changes. However + filesystems *must not* delete from the dentry hash chains directly + using the list macros like allowed earlier. They must use dcache + APIs like d_drop() or __d_drop() depending on the situation. + +2. d_flags is now protected by a per-dentry lock (d_lock). All + access to d_flags must be protected by it. + +3. For a hashed dentry, checking of d_count needs to be protected + by d_lock. + + +Papers and other documentation on dcache locking +================================================ + +1. Scaling dcache with RCU (http://linuxjournal.com/article.php?sid=7124). + +2. http://lse.sourceforge.net/locking/dcache/dcache.html diff --git a/Documentation/floppy.txt b/Documentation/floppy.txt index 99d3ad3b3..6fb10fcd8 100644 --- a/Documentation/floppy.txt +++ b/Documentation/floppy.txt @@ -13,15 +13,20 @@ LILO configuration options (Thinkpad users, read this) The floppy driver is configured using the 'floppy=' option in lilo. This option can be typed at the boot prompt, or entered in the lilo configuration file. - Example: If your kernel is called linux-2.2.13, type the following line + + Example: If your kernel is called linux-2.6.9, type the following line at the lilo boot prompt (if you have a thinkpad): - linux-2.2.13 floppy=thinkpad + + linux-2.6.9 floppy=thinkpad + You may also enter the following line in /etc/lilo.conf, in the description -of linux-2.2.13: +of linux-2.6.9: + append = "floppy=thinkpad" Several floppy related options may be given, example: - linux-2.2.13 floppy=daring floppy=two_fdc + + linux-2.6.9 floppy=daring floppy=two_fdc append = "floppy=daring floppy=two_fdc" If you give options both in the lilo config file and on the boot @@ -29,17 +34,25 @@ prompt, the option strings of both places are concatenated, the boot prompt options coming last. That's why there are also options to restore the default behavior. + +Module configuration options +============================ + If you use the floppy driver as a module, use the following syntax: - insmod floppy +modprobe floppy Example: - insmod floppy daring two_fdc + modprobe floppy omnibook messages + + If you need certain options enabled every time you load the floppy driver, +you can put: + + options floppy omnibook messages + +in /etc/modprobe.conf. - Some versions of insmod are buggy in one way or another. If you have -any problems (options not being passed correctly, segfaults during -insmod), first check whether there is a more recent version. - The floppy related options include: + The floppy driver related options are: floppy=asus_pci Sets the bit mask to allow only units 0 and 1. (default) @@ -99,7 +112,7 @@ insmod), first check whether there is a more recent version. master arbitration error" messages from your Ethernet card (or from other devices) while accessing the floppy. - floppy=fifo + floppy=usefifo Enables the FIFO. (default) floppy=,fifo_depth @@ -110,6 +123,7 @@ insmod), first check whether there is a more recent version. lower, the interrupt latency should be lower too (faster processor). The benefit of a lower threshold is less interrupts. + To tune the fifo threshold, switch on over/underrun messages using 'floppycontrol --messages'. Then access a floppy disk. If you get a huge amount of "Over/Underrun - retrying" @@ -120,6 +134,7 @@ insmod), first check whether there is a more recent version. fifo values without rebooting the machine for each test. Note that you need to do 'floppycontrol --messages' every time you re-insert the module. + Usually, tuning the fifo threshold should not be needed, as the default (0xa) is reasonable. @@ -128,6 +143,7 @@ insmod), first check whether there is a more recent version. you have more than two floppy drives (only two can be described in the physical CMOS), or if your BIOS uses non-standard CMOS types. The CMOS types are: + 0 - Use the value of the physical CMOS 1 - 5 1/4 DD 2 - 5 1/4 HD @@ -136,6 +152,7 @@ insmod), first check whether there is a more recent version. 5 - 3 1/2 ED 6 - 3 1/2 ED 16 - unknown or not installed + (Note: there are two valid types for ED drives. This is because 5 was initially chosen to represent floppy *tapes*, and 6 for ED drives. AMI ignored this, and used 5 for ED drives. That's why the floppy @@ -188,7 +205,6 @@ insmod), first check whether there is a more recent version. in some more extreme cases." - Supporting utilities and additional documentation: ================================================== @@ -219,3 +235,11 @@ sure to mention also the type of the filesystem in the subject line. Be sure to read the FAQ before mailing/posting any bug reports! Alain + +Changelog +========= + +10-30-2004 : Cleanup, updating, add reference to module configuration. + James Nelson + +6-3-2000 : Original Document diff --git a/Documentation/ftape.txt b/Documentation/ftape.txt index 9cc814a55..7d8bb3384 100644 --- a/Documentation/ftape.txt +++ b/Documentation/ftape.txt @@ -2,26 +2,21 @@ Intro ===== This file describes some issues involved when using the "ftape" -floppy tape device driver that comes with the Linux kernel. This -document deals with ftape-3.04 and later. Please read the section -"Changes" for the most striking differences between version 3.04 and -2.08; the latter was the version of ftape delivered with the kernel -until kernel version 2.0.30 and 2.1.57. ftape-3.x developed as the -re-unification of ftape-2.x and zftape. zftape was developed in -parallel with the stock ftape-2.x driver sharing the same hardware -support but providing an enhanced file system interface. zftape also -provided user transparent block-wise on-the-fly compression (regard it -as a feature or bug of zftape). +floppy tape device driver that comes with the Linux kernel. ftape has a home page at -http://www-math.math.rwth-aachen.de/~LBFM/claus/ftape +http://ftape.dot-heine.de/ which contains further information about ftape. Please cross check this WWW address against the address given (if any) in the MAINTAINERS file located in the top level directory of the Linux kernel source tree. +NOTE: This is an unmaintained set of drivers, and it is not guaranteed to work. +If you are interested in taking over maintenance, contact Claus-Justus Heine +, the former maintainer. + Contents ======== @@ -31,9 +26,8 @@ A. Changes 1. Goal 2. I/O Block Size 3. Write Access when not at EOD (End Of Data) or BOT (Begin Of Tape) - 4. MTBSF - backspace over file mark and position at its EOT side - 5. Formatting - 6. Interchanging cartridges with other operating systems + 4. Formatting + 5. Interchanging cartridges with other operating systems B. Debugging Output 1. Introduction @@ -58,7 +52,7 @@ changed. Up to date documentation as well as recent development versions of ftape and useful links to related topics can be found at the ftape home page at -http://www-math.math.rwth-aachen.de/~LBFM/claus/ftape +http://ftape.dot-heine.de/ ******************************************************************************* @@ -70,7 +64,7 @@ A. Changes The goal of all that incompatibilities was to give ftape an interface that resembles the interface provided by SCSI tape drives as close as possible. Thus any Unix backup program that is known to work - with SCSI tape drives should also work with ftape-3.04 and above. + with SCSI tape drives should also work. The concept of a fixed block size for read/write transfers is rather unrelated to this SCSI tape compatibility at the file system @@ -81,14 +75,8 @@ A. Changes 2. I/O Block Size ~~~~~~~~~~~~~~ - The probably most striking difference between ftape-2.x and - ftape-3.x with the zftape file system interface is the concept of a - fixed block size: data must be written to or read from the tape in - multiples of a fixed block size. The block size defaults to 10k - which is the default block size of GNU tar. While this is quite - usual for SCSI tapes (block size of 32k?) and the QIC-150 driver - `./drivers/char/tpqic02.c' ftape-2.x allowed data to be written in - arbitrary portions to the tape. + The block size defaults to 10k which is the default block size of + GNU tar. The block size can be tuned either during kernel configuration or at runtime with the MTIOCTOP ioctl using the MTSETBLK operation @@ -109,53 +97,41 @@ A. Changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ zftape (the file system interface of ftape-3.x) denies write access to the tape cartridge when it isn't positioned either at BOT or - EOD. This inconvenience has been introduced as it was reported that - the former behavior of ftape-2.x which allowed write access at - arbitrary locations already has caused data loss with some backup - programs. - -4. MTBSF - backspace over file mark and position at its EOT side - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ftape-2.x didn't handle the MTBSF tape operation correctly. A MTBSF - call (i.e. "mt -f /dev/nqft0 bsf #COUNT") should space over #COUNT - file marks and then position at the EOT tape side of the file - mark. This has to be taken literally, i.e. "mt -f /dev/nqft0 bsf 1" - should simply position at the start of the current volume. - -5. Formatting + EOD. + +4. Formatting ~~~~~~~~~~ - ftape-3.x DOES support formatting of floppy tape cartridges. You - need the `ftformat' program that is shipped with the modules version - of ftape-3.x. Please get the latest version of ftape from + ftape DOES support formatting of floppy tape cartridges. You need the + `ftformat' program that is shipped with the modules version of ftape. + Please get the latest version of ftape from ftp://sunsite.unc.edu/pub/Linux/kernel/tapes or from the ftape home page at - http://www-math.math.rwth-aachen.de/~LBFM/claus/ftape + http://ftape.dot-heine.de/ `ftformat' is contained in the `./contrib/' subdirectory of that separate ftape package. -6. Interchanging cartridges with other operating systems +5. Interchanging cartridges with other operating systems ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The internal emulation of Unix tape device file marks has changed - completely. ftape-3.x now uses the volume table segment as specified + completely. ftape now uses the volume table segment as specified by the QIC-40/80/3010/3020/113 standards to emulate file marks. As a consequence there is limited support to interchange cartridges with other operating systems. To be more precise: ftape will detect volumes written by other OS's programs and other OS's programs will detect volumes written by - ftape-3.x. + ftape. However, it isn't possible to extract the data dumped to the tape - by some MSDOG program with ftape-3.x. This exceeds the scope of a + by some MSDOS program with ftape. This exceeds the scope of a kernel device driver. If you need such functionality, then go ahead - and write a user space utility that is able to do - that. ftape-3.x/zftape already provides all kernel level support - necessary to do that. + and write a user space utility that is able to do that. ftape already + provides all kernel level support necessary to do that. ******************************************************************************* @@ -200,7 +176,7 @@ B. Debugging Output ii) trim the debugging output at module load time with - insmod ftape.o ft_tracing=#DBGLVL + modprobe ftape ft_tracing=#DBGLVL Of course, this applies only if you have configured ftape to be compiled as a module. @@ -240,7 +216,7 @@ C. Boot and load time configuration 2. Module load time parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Module parameters can be specified either directly when invoking - the program 'insmod' at the shell prompt: + the program 'modprobe' at the shell prompt: modprobe ftape ft_tracing=4 @@ -277,6 +253,12 @@ C. Boot and load time configuration line documentation provided during that kernel configuration process. + ft_probe_fc10 is set to a non-zero value if you wish for ftape to + probe for a Colorado FC-10 or FC-20 controller. + + ft_mach2 is set to a non-zero value if you wish for ftape to probe + for a Mountain MACH-2 controller. + module | kernel command line -----------------------|---------------------- ft_fdc_base=BASE | ftape=BASE,ioport @@ -316,10 +298,10 @@ D. Support and contacts page to query for the most recent documentation, related work and development versions of ftape. + Changelog: + ========== + +~1996: Original Document - LocalWords: ftape Linux zftape http www rwth aachen LBFM claus EOD config - LocalWords: datarate LocalWords BOT MTBSF EOT HOWTO QIC tpqic menuconfig - LocalWords: MTIOCTOP MTSETBLK mt dev qft setblk BLKSZ bsf zftape's xconfig - LocalWords: nqft ftformat ftp sunsite unc edu contrib ft MSDOG fdc - LocalWords: dma setdensity DBGLVL insmod lilo LI nux ader conf txt - LocalWords: modprobe IRQ BOOL ioport irq fc mach THR +10-24-2004: General cleanup and updating, noting additional module options. + James Nelson diff --git a/Documentation/hw_random.txt b/Documentation/hw_random.txt index 20be482b6..bb58c36b5 100644 --- a/Documentation/hw_random.txt +++ b/Documentation/hw_random.txt @@ -67,72 +67,3 @@ Driver details: Special thanks to Matt Sottek. I did the "guts", he did the "brains" and all the testing. - -Change history: - - Version 1.0.0: - * Merge Intel, AMD, VIA RNG drivers into one. - Further changelog in BitKeeper. - - Version 0.9.8: - * Support other i8xx chipsets by adding 82801E detection - * 82801DB detection is the same as for 82801CA. - - Version 0.9.7: - * Support other i8xx chipsets too (by adding 82801BA(M) and - 82801CA(M) detection) - - Version 0.9.6: - * Internal driver cleanups, prep for 1.0.0 release. - - Version 0.9.5: - * Rip out entropy injection via timer. It never ever worked, - and a better solution (rngd) is now available. - - Version 0.9.4: - * Fix: Remove request_mem_region - * Fix: Horrible bugs in FIPS calculation and test execution - - Version 0.9.3: - * Clean up rng_read a bit. - * Update i810_rng driver Web site URL. - * Increase default timer interval to 4 samples per second. - * Abort if mem region is not available. - * BSS zero-initialization cleanup. - * Call misc_register() from rng_init_one. - * Fix O_NONBLOCK to occur before we schedule. - - Version 0.9.2: - * Simplify open blocking logic - - Version 0.9.1: - * Support i815 chipsets too (Matt Sottek) - * Fix reference counting when statically compiled (prumpf) - * Rewrite rng_dev_read (prumpf) - * Make module races less likely (prumpf) - * Small miscellaneous bug fixes (prumpf) - * Use pci table for PCI id list - - Version 0.9.0: - * Don't register a pci_driver, because we are really - using PCI bridge vendor/device ids, and someone - may want to register a driver for the bridge. (bug fix) - * Don't let the usage count go negative (bug fix) - * Clean up spinlocks (bug fix) - * Enable PCI device, if necessary (bug fix) - * iounmap on module unload (bug fix) - * If RNG chrdev is already in use when open(2) is called, - sleep until it is available. - * Remove redundant globals rng_allocated, rng_use_count - * Convert numeric globals to unsigned - * Module unload cleanup - - Version 0.6.2: - * Clean up spinlocks. Since we don't have any interrupts - to worry about, but we do have a timer to worry about, - we use spin_lock_bh everywhere except the timer function - itself. - * Fix module load/unload. - * Fix timer function and h/w enable/disable logic - * New timer interval sysctl - * Clean up sysctl names diff --git a/Documentation/i2c/dev-interface b/Documentation/i2c/dev-interface index 4fe882cb4..09d6cda2a 100644 --- a/Documentation/i2c/dev-interface +++ b/Documentation/i2c/dev-interface @@ -3,7 +3,7 @@ possible to access all devices on an adapter from userspace, through the /dev interface. You need to load module i2c-dev for this. Each registered i2c adapter gets a number, counting from 0. You can -examine /proc/bus/i2c to see what number corresponds to which adapter. +examine /sys/class/i2c-dev/ to see what number corresponds to which adapter. I2C device files are character device files with major device number 89 and a minor device number corresponding to the number assigned as explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ..., @@ -19,7 +19,7 @@ Yes, I know, you should never include kernel header files, but until glibc knows about i2c, there is not much choice. Now, you have to decide which adapter you want to access. You should -inspect /proc/bus/i2c to decide this. Adapter numbers are assigned +inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned somewhat dynamically, so you can not even assume /dev/i2c-0 is the first adapter. diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub index 2626ba926..d6dcb138a 100644 --- a/Documentation/i2c/i2c-stub +++ b/Documentation/i2c/i2c-stub @@ -2,14 +2,19 @@ MODULE: i2c-stub DESCRIPTION: -This module is a very simple fake I2C/SMBus driver. It implements three -types of SMBus commands: write quick, (r/w) byte data, and (r/w) word data. +This module is a very simple fake I2C/SMBus driver. It implements four +types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, and +(r/w) word data. No hardware is needed nor associated with this module. It will accept write quick commands to all addresses; it will respond to the other commands (also to all addresses) by reading from or writing to an array in memory. It will also spam the kernel logs for every command it handles. +A pointer register with auto-increment is implemented for all byte +operations. This allows for continuous byte reads like those supported by +EEPROMs, among others. + The typical use-case is like this: 1. load this module 2. use i2cset (from lm_sensors project) to pre-load some data diff --git a/Documentation/i2c/sysfs-interface b/Documentation/i2c/sysfs-interface index 3e74daeb9..346400519 100644 --- a/Documentation/i2c/sysfs-interface +++ b/Documentation/i2c/sysfs-interface @@ -135,18 +135,44 @@ fan[1-3]_div Fan divisor. Note that this is actually an internal clock divisor, which affects the measurable speed range, not the read value. -fan[1-3]_pwm Pulse width modulation fan control. +******* +* PWM * +******* + +pwm[1-3] Pulse width modulation fan control. Integer value in the range 0 to 255 Read/Write 255 is max or 100%. -fan[1-3]_pwm_enable +pwm[1-3]_enable Switch PWM on and off. Not always present even if fan*_pwm is. 0 to turn off - 1 to turn on + 1 to turn on in manual mode + 2 to turn on in automatic mode Read/Write +pwm[1-*]_auto_channels_temp + Select which temperature channels affect this PWM output in + auto mode. Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc... + Which values are possible depend on the chip used. + +pwm[1-*]_auto_point[1-*]_pwm +pwm[1-*]_auto_point[1-*]_temp +pwm[1-*]_auto_point[1-*]_temp_hyst + Define the PWM vs temperature curve. Number of trip points is + chip-dependent. Use this for chips which associate trip points + to PWM output channels. + +OR + +temp[1-*]_auto_point[1-*]_pwm +temp[1-*]_auto_point[1-*]_temp +temp[1-*]_auto_point[1-*]_temp_hyst + Define the PWM vs temperature curve. Number of trip points is + chip-dependent. Use this for chips which associate trip points + to temperature channels. + **************** * Temperatures * diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index a45421284..011e92094 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients @@ -24,22 +24,24 @@ all clients from it. Remember, a driver structure contains general access routines, a client structure specific information like the actual I2C address. - static struct i2c_driver foo_driver = { - .owner = THIS_MODULE, - .name = "Foo version 2.3 driver", - .id = I2C_DRIVERID_FOO, /* usually from i2c-id.h */ - .flags = I2C_DF_NOTIFY, - .attach_adapter = &foo_attach_adapter, - .detach_client = &foo_detach_client, - .command = &foo_command /* may be NULL */ - } +static struct i2c_driver foo_driver = { + .owner = THIS_MODULE, + .name = "Foo version 2.3 driver", + .id = I2C_DRIVERID_FOO, /* from i2c-id.h, optional */ + .flags = I2C_DF_NOTIFY, + .attach_adapter = &foo_attach_adapter, + .detach_client = &foo_detach_client, + .command = &foo_command /* may be NULL */ +} The name can be chosen freely, and may be upto 40 characters long. Please use something descriptive here. -The id should be a unique ID. The range 0xf000 to 0xffff is reserved for -local use, and you can use one of those until you start distributing the -driver. Before you do that, contact the i2c authors to get your own ID(s). +If used, the id should be a unique ID. The range 0xf000 to 0xffff is +reserved for local use, and you can use one of those until you start +distributing the driver, at which time you should contact the i2c authors +to get your own ID(s). Note that most of the time you don't need an ID +at all so you can just omit it. Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This means that your driver will be notified when new adapters are found. @@ -569,7 +571,7 @@ the driver module is usually enough. have to be cleaned up! */ static int __initdata foo_initialized = 0; - int __init foo_init(void) + static int __init foo_init(void) { int res; printk("foo version %s (%s)\n",FOO_VERSION,FOO_DATE); @@ -583,41 +585,27 @@ the driver module is usually enough. return 0; } - int __init foo_cleanup(void) + void foo_cleanup(void) { - int res; if (foo_initialized == 1) { if ((res = i2c_del_driver(&foo_driver))) { printk("foo: Driver registration failed, module not removed.\n"); - return res; + return; } foo_initialized --; } - return 0; } - #ifdef MODULE - /* Substitute your own name and email address */ MODULE_AUTHOR("Frodo Looijaard " MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); - int init_module(void) - { - return foo_init(); - } - - int cleanup_module(void) - { - return foo_cleanup(); - } - - #endif /* def MODULE */ + module_init(foo_init); + module_exit(foo_cleanup); Note that some functions are marked by `__init', and some data structures -by `__init_data'. If this driver is compiled as part of the kernel (instead -of as a module), those functions and structures can be removed after -kernel booting is completed. +by `__init_data'. Hose functions and structures can be removed after +kernel booting (or module loading) is completed. Command function ================ @@ -688,14 +676,26 @@ SMBus communication extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); extern s32 i2c_smbus_write_word_data(struct i2c_client * client, u8 command, u16 value); - extern s32 i2c_smbus_process_call(struct i2c_client * client, - u8 command, u16 value); - extern s32 i2c_smbus_read_block_data(struct i2c_client * client, - u8 command, u8 *values); extern s32 i2c_smbus_write_block_data(struct i2c_client * client, u8 command, u8 length, u8 *values); +These ones were removed in Linux 2.6.10 because they had no users, but could +be added back later if needed: + + extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, + u8 command, u8 *values); + extern s32 i2c_smbus_read_block_data(struct i2c_client * client, + u8 command, u8 *values); + extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, + u8 command, u8 length, + u8 *values); + extern s32 i2c_smbus_process_call(struct i2c_client * client, + u8 command, u16 value); + extern s32 i2c_smbus_block_process_call(struct i2c_client *client, + u8 command, u8 length, + u8 *values) + All these transactions return -1 on failure. The 'write' transactions return 0 on success; the 'read' transactions return the read value, except for read_block, which returns the number of values read. The block buffers diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index afa6d1299..1c48f0eba 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt @@ -173,6 +173,9 @@ filled out, however: 2 bootsect-loader 3 SYSLINUX 4 EtherBoot + 5 ELILO + 7 GRuB + 8 U-BOOT Please contact if you need a bootloader ID value assigned. diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt index bbdf7261e..67c053a09 100644 --- a/Documentation/i386/zero-page.txt +++ b/Documentation/i386/zero-page.txt @@ -28,7 +28,8 @@ Offset Type Description 0xa0 16 bytes System description table truncated to 16 bytes. ( struct sys_desc_table_struct ) - 0xb0 - 0x1c3 Free. Add more parameters here if you really need them. + 0xb0 - 0x13f Free. Add more parameters here if you really need them. + 0x140- 0x1be EDID_INFO Video mode setup 0x1c4 unsigned long EFI system table pointer 0x1c8 unsigned long EFI memory descriptor size @@ -73,6 +74,10 @@ Offset Type Description 0x21c unsigned long INITRD_SIZE, size in bytes of ramdisk image 0x220 4 bytes (setup.S) 0x224 unsigned short setup.S heap end pointer +0x226 unsigned short zero_pad +0x228 unsigned long cmd_line_ptr +0x22c unsigned long ramdisk_max +0x230 16 bytes trampoline 0x290 - 0x2cf EDD_MBR_SIG_BUFFER (edd.S) 0x2d0 - 0x600 E820MAP 0x600 - 0x7ff EDDBUF (edd.S) for disk signature read sector diff --git a/Documentation/ide.txt b/Documentation/ide.txt index 58853a4ef..29866fbfb 100644 --- a/Documentation/ide.txt +++ b/Documentation/ide.txt @@ -248,13 +248,6 @@ Summary of ide driver parameters for kernel command line allowing ide-floppy, ide-tape, and ide-cdrom|writers to use ide-scsi emulation on a device specific option. - "hdx=stroke" : Should you have a system w/ an AWARD Bios and your - drives are larger than 32GB and it will not boot, - one is required to perform a few OEM operations first. - The option is called "stroke" because it allows one - to "soft clip" the drive to work around a barrier - limit. - "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz, where "xx" is between 20 and 66 inclusive, used when tuning chipset PIO modes. @@ -304,7 +297,9 @@ Summary of ide driver parameters for kernel command line "ide=reverse" : formerly called to pci sub-system, but now local. -The following are valid ONLY on ide0 (except dc4030), which usually corresponds + "ide=nodma" : disable DMA globally for the IDE subsystem. + +The following are valid ONLY on ide0, which usually corresponds to the first ATA interface found on the particular host, and the defaults for the base,ctl ports must not be altered. @@ -315,7 +310,7 @@ the base,ctl ports must not be altered. "ide0=qd65xx" : probe/support qd65xx interface "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445) "ide0=umc8672" : probe/support umc8672 chipsets - "idex=dc4030" : probe/support Promise DC4030VL interface + "ide=doubler" : probe/support IDE doublers on Amiga There may be more options than shown -- use the source, Luke! diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index bd7a19777..769f925c8 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt @@ -72,6 +72,7 @@ Code Seq# Include File Comments 0x09 all linux/md.h 0x12 all linux/fs.h linux/blkpg.h +0x1b all InfiniBand Subsystem 0x20 all drivers/cdrom/cm206.h 0x22 all scsi/sg.h '#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem @@ -145,7 +146,7 @@ Code Seq# Include File Comments 'p' 40-7F linux/nvram.h 'p' 80-9F user-space parport -'q' 00-1F linux/videotext.h conflict! +'q' 00-1F linux/serio.h 'q' 80-FF Internet PhoneJACK, Internet LineJACK 'r' 00-1F linux/msdos_fs.h @@ -163,6 +164,7 @@ Code Seq# Include File Comments 'z' 40-7F CAN bus card 0x80 00-1F linux/fb.h +0x81 00-1F linux/videotext.h 0x89 00-06 asm-i386/sockios.h 0x89 0B-DF linux/sockios.h 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 1075e4de2..2616a58a5 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -6,7 +6,7 @@ This document describes the Linux kernel Makefiles. === 1 Overview === 2 Who does what - === 3 The kbuild Makefiles + === 3 The kbuild files --- 3.1 Goal definitions --- 3.2 Built-in object goals - obj-y --- 3.3 Loadable module goals - obj-m @@ -101,11 +101,14 @@ These people need to know about all aspects of the kernel Makefiles. This document is aimed towards normal developers and arch developers. -=== 3 The kbuild Makefiles +=== 3 The kbuild files Most Makefiles within the kernel are kbuild Makefiles that use the kbuild infrastructure. This chapter introduce the syntax used in the kbuild makefiles. +The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will +continue to be supported. All new developmen is expected to use the +Kbuild filename. Section 3.1 "Goal definitions" is a quick intro, further chapters provide more details, with real examples. @@ -707,15 +710,17 @@ When kbuild executes the following steps are followed (roughly): probe supported options: #arch/i386/Makefile - check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc \ - /dev/null\ > /dev/null 2>&1; then echo "$(1)"; \ - else echo "$(2)"; fi) - cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,\ - -march=c3,-march=i486) - CFLAGS += $(cflags-y) + ... + cflags-$(CONFIG_MPENTIUMII) += $(call cc-option,\ + -march=pentium2,-march=i686) + ... + # Disable unit-at-a-time mode ... + CFLAGS += $(call cc-option,-fno-unit-at-a-time) + ... + - The above examples both utilise the trick that a config option expands + The first examples utilises the trick that a config option expands to 'y' when selected. CFLAGS_KERNEL $(CC) options specific for built-in @@ -997,6 +1002,21 @@ When kbuild executes the following steps are followed (roughly): option. When $(biarch) equals to y the expanded variables $(aflags-y) and $(cflags-y) will be assigned the values -a32 and -m32. + cc-option-align + gcc version >= 3.0 shifted type of options used to speify + alignment of functions, loops etc. $(cc-option-align) whrn used + as prefix to the align options will select the right prefix: + gcc < 3.00 + cc-option-align = -malign + gcc >= 3.00 + cc-option-align = -falign + + Example: + CFLAGS += $(cc-option-align)-functions=4 + + In the above example the option -falign-functions=4 is used for + gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used. + cc-version cc-version return a numerical version of the $(CC) compiler version. The format is where both are two digits. So for example diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index b8933206f..c91caf7eb 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt @@ -1,68 +1,419 @@ -For now this is a raw copy from the old Documentation/kbuild/modules.txt, -which was removed in 2.6.0-test5. -The information herein is correct but not complete. - -Installing modules in a non-standard location ---------------------------------------------- -When the modules needs to be installed under another directory -the INSTALL_MOD_PATH can be used to prefix "/lib/modules" as seen -in the following example: - -make INSTALL_MOD_PATH=/frodo modules_install - -This will install the modules in the directory /frodo/lib/modules. -/frodo can be a NFS mounted filesystem on another machine, allowing -out-of-the-box support for installation on remote machines. - - -Compiling modules outside the official kernel ---------------------------------------------- - -Often modules are developed outside the official kernel. To keep up -with changes in the build system the most portable way to compile a -module outside the kernel is to use the kernel build system, -kbuild. Use the following command-line: - -make -C path/to/kernel/src M=$PWD modules - -This requires that a makefile exits made in accordance to -Documentation/kbuild/makefiles.txt. Read that file for more details on -the build system. - -The following is a short summary of how to write your Makefile to get -you up and running fast. Assuming your module will be called -yourmodule.ko, your code should be in yourmodule.c and your Makefile -should include - -obj-m := yourmodule.o - -If the code for your module is in multiple files that need to be -linked, you need to tell the build system which files to compile. In -the case of multiple files, none of these files can be named -yourmodule.c because doing so would cause a problem with the linking -step. Assuming your code exists in file1.c, file2.c, and file3.c and -you want to build yourmodule.ko from them, your Makefile should -include - -obj-m := yourmodule.o -yourmodule-objs := file1.o file2.o file3.o - -Now for a final example to put it all together. Assuming the -KERNEL_SOURCE environment variable is set to the directory where you -compiled the kernel, a simple Makefile that builds yourmodule.ko as -described above would look like - -# Tells the build system to build yourmodule.ko. -obj-m := yourmodule.o - -# Tells the build system to build these object files and link them as -# yourmodule.o, before building yourmodule.ko. This line can be left -# out if all the code for your module is in one file, yourmodule.c. If -# you are using multiple files, none of these files can be named -# yourmodule.c. -yourmodule-objs := file1.o file2.o file3.o - -# Invokes the kernel build system to come back to the current -# directory and build yourmodule.ko. -default: - make -C ${KERNEL_SOURCE} M=`pwd` modules + +In this document you will find information about: +- how to build external modules +- how to make your module use kbuild infrastructure +- how kbuild will install a kernel +- how to install modules in a non-standard location + +=== Table of Contents + + === 1 Introduction + === 2 How to build external modules + --- 2.1 Building external modules + --- 2.2 Available targets + --- 2.3 Available options + --- 2.4 Preparing the kernel tree for module build + === 3. Example commands + === 4. Creating a kbuild file for an external module + === 5. Include files + --- 5.1 How to include files from the kernel include dir + --- 5.2 External modules using an include/ dir + === 6. Module installation + --- 6.1 INSTALL_MOD_PATH + --- 6.2 INSTALL_MOD_DIR + === 7. Module versioning + === 8. Tips & Tricks + --- 8.1 Testing for CONFIG_FOO_BAR + + + +=== 1. Introduction + +kbuild includes functionality for building modules both +within the kernel source tree and outside the kernel source tree. +The latter is usually referred to as external modules and is used +both during development and for modules that are not planned to be +included in the kernel tree. + +What is covered within this file is mainly information to authors +of modules. The author of an external modules should supply +a makefile that hides most of the complexity so one only has to type +'make' to buld the module. A complete example will be present in +chapter ¤. Creating a kbuild file for an external module". + + +=== 2. How to build external modules + +kbuild offers functionality to build external modules, with the +prerequisite that there is a pre-built kernel available with full source. +A subset of the targets available when building the kernel is available +when building an external module. + +--- 2.1 Building external modules + + Use the following command to build an external module: + + make -C M=`pwd` + + For the running kernel use: + make -C /lib/modules/`uname -r`/build M=`pwd` + + For the above command to succeed the kernel must have been built with + modules enabled. + + To install the modules that were just built: + + make -C M=`pwd` modules_install + + More complex examples later, the above should get you going. + +--- 2.2 Available targets + + $KDIR refers to path to kernel source top-level directory + + make -C $KDIR M=`pwd` + Will build the module(s) located in current directory. + All output files will be located in the same directory + as the module source. + No attempts are made to update the kernel source, and it is + a precondition that a successful make has been executed + for the kernel. + + make -C $KDIR M=`pwd` modules + The modules target is implied when no target is given. + Same functionality as if no target was specified. + See description above. + + make -C $KDIR M=$PWD modules_install + Install the external module(s). + Installation default is in /lib/modules//extra, + but may be prefixed with INSTALL_MOD_PATH - see separate chater. + + make -C $KDIR M=$PWD clean + Remove all generated files for the module - the kernel + source directory is not moddified. + + make -C $KDIR M=`pwd` help + help will list the available target when building external + modules. + +--- 2.3 Available options: + + $KDIR refer to path to kernel src + + make -C $KDIR + Used to specify where to find the kernel source. + '$KDIR' represent the directory where the kernel source is. + Make will actually change directory to the specified directory + when executed but change back when finished. + + make -C $KDIR M=`pwd` + M= is used to tell kbuild that an external module is + being built. + The option given to M= is the directory where the external + module (kbuild file) is located. + When an external module is being built only a subset of the + usual targets are available. + + make -C $KDIR SUBDIRS=`pwd` + Same as M=. The SUBDIRS= syntax is kept for backwards + compatibility. + +--- 2.4 Preparing the kernel tree for module build + + To make sure the kernel contains the information required to + build external modules the target 'modules_prepare' must be used. + 'module_prepare' solely exists as a simple way to prepare + a kernel for building external modules. + Note: modules_prepare will not build Module.symvers even if + CONFIG_MODULEVERSIONING is set. + Therefore a full kernel build needs to be executed to make + module versioning work. + + +=== 3. Example commands + +This example shows the actual commands to be executed when building +an external module for the currently running kernel. +In the example below the distribution is supposed to use the +facility to locate output files for a kernel compile in a different +directory than the kernel source - but the examples will also work +when the source and the output files are mixed in the same directory. + +# Kernel source +/lib/modules//source -> /usr/src/linux- + +# Output from kernel compile +/lib/modules//build -> /usr/src/linux--up + +Change to the directory where the kbuild file is located and execute +the following commands to build the module: + + cd /home/user/src/module + make -C /usr/src/`uname -r`/source \ + O=/lib/modules/`uname-r`/build \ + M=`pwd` + +Then to install the module use the following command: + + make -C /usr/src/`uname -r`/source \ + O=/lib/modules/`uname-r`/build \ + M=`pwd` \ + modules_install + +If one looks closely you will see that this is the same commands as +listed before - with the directories spelled out. + +The above are rather long commands, and the following chapter +lists a few tricks to make it all easier. + + +=== 4. Creating a kbuild file for an external module + +kbuild is the build system for the kernel, and external modules +must use kbuild to stay compatible with changes in the build system +and to pick up the right flags to gcc etc. + +The kbuild file used as input shall follow the syntax described +in Documentation/kbuild/makefiles.txt. This chapter will introduce a few +more tricks to be used when dealing with external modules. + +In the following a Makefile will be created for a module with the +following files: + 8123_if.c + 8123_if.h + 8123_pci.c + 8123_bin.o_shipped <= Binary blob + +--- 4.1 Shared Makefile for module and kernel + + An external module always includes a wrapper Makefile supporting + building the module using 'make' with no arguments. + The Makefile provided will most likely include additional + functionality such as test targets etc. and this part shall + be filtered away from kbuild since it may impact kbuild if + name clashes occurs. + + Example 1: + --> filename: Makefile + ifneq ($(KERNELRELEASE),) + # kbuild part of makefile + obj-m := 8123.o + 8123-y := 8123_if.o 8123_pci.o 8123_bin.o + + else + # Normal Makefile + + KERNELDIR := /lib/modules/`uname -r`/build + all:: + $(MAKE) -C $KERNELDIR M=`pwd` $@ + + # Module specific targets + genbin: + echo "X" > 8123_bini.o_shipped + + endif + + In example 1 the check for KERNELRELEASE is used to separate + the two parts of the Makefile. kbuild will only see the two + assignments whereas make will see everything except the two + kbuild assignments. + + In recent versions of the kernel, kbuild will look for a file named + Kbuild and as second option look for a file named Makefile. + Utilising the Kbuild file makes us split up the Makefile in example 1 + into two files as shown in example 2: + + Example 2: + --> filename: Kbuild + obj-m := 8123.o + 8123-y := 8123_if.o 8123_pci.o 8123_bin.o + + --> filename: Makefile + KERNELDIR := /lib/modules/`uname -r`/build + all:: + $(MAKE) -C $KERNELDIR M=`pwd` $@ + + # Module specific targets + genbin: + echo "X" > 8123_bin_shipped + + + In example 2 we are down to two fairly simple files and for simple + files as used in this example the split is questionable. But some + external modules use Makefiles of several hundred lines and here it + really pays off to separate the kbuild part from the rest. + Example 3 shows a backward compatible version. + + Example 3: + --> filename: Kbuild + obj-m := 8123.o + 8123-y := 8123_if.o 8123_pci.o 8123_bin.o + + --> filename: Makefile + ifneq ($(KERNELRELEASE),) + include Kbuild + else + # Normal Makefile + + KERNELDIR := /lib/modules/`uname -r`/build + all:: + $(MAKE) -C $KERNELDIR M=`pwd` $@ + + # Module specific targets + genbin: + echo "X" > 8123_bin_shipped + + endif + + The trick here is to include the Kbuild file from Makefile so + if an older version of kbuild picks up the Makefile the Kbuild + file will be included. + +--- 4.2 Binary blobs included in a module + + Some external modules needs to include a .o as a blob. kbuild + has support for this, but requires the blob file to be named + _shipped. In our example the blob is named + 8123_bin.o_shipped and when the kbuild rules kick in the file + 8123_bin.o is created as a simple copy off the 8213_bin.o_shipped file + with the _shipped part stripped of the filename. + This allows the 8123_bin.o filename to be used in the assignment to + the module. + + Example 4: + obj-m := 8123.o + 8123-y := 8123_if.o 8123_pci.o 8123_bin.o + + In example 4 there is no distinction between the ordinary .c/.h files + and the binary file. But kbuild will pick up different rules to create + the .o file. + + +=== 5. Include files + +Include files are a necessity when a .c file uses something from another .c +files (not strictly in the sense of .c but if good programming practice is +used). Any module that consist of more than one .c file will have a .h file +for one of the .c files. +- If the .h file only describes a module internal interface then the .h file + shall be placed in the same directory as the .c files. +- If the .h files describe an interface used by other parts of the kernel + located in different directories, the .h files shall be located in + include/linux/ or other include/ directories as appropriate. + +One exception for this rule is larger subsystems that have their own directory +under include/ such as include/scsi. Another exception is arch-specific +.h files which are located under include/asm-$(ARCH)/*. + +External modules have a tendency to locate include files in a separate include/ +directory and therefore needs to deal with this in their kbuild file. + +--- 5.1 How to include files from the kernel include dir + + When a module needs to include a file from include/linux/ then one + just uses: + + #include + + kbuild will make sure to add options to gcc so the relevant + directories are searched. + Likewise for .h files placed in the same directory as the .c file. + + #include "8123_if.h" + + will do the job. + +--- 5.2 External modules using an include/ dir + + External modules often locate their .h files in a separate include/ + directory although this is not usual kernel style. When an external + module uses an include/ dir then kbuild needs to be told so. + The trick here is to use either EXTRA_CFLAGS (take effect for all .c + files) or CFLAGS_$F.o (take effect only for a single file). + + In our example if we move 8123_if.h to a subdirectory named include/ + the resulting Kbuild file would look like: + + --> filename: Kbuild + obj-m := 8123.o + + EXTRA_CFLAGS := -Iinclude + 8123-y := 8123_if.o 8123_pci.o 8123_bin.o + + Note that in the assingment there is no space between -I and the path. + This is a kbuild limitation and no space must be present. + + +=== 6. Module installation + +Modules which are included in the kernel is installed in the directory: + + /lib/modules/$(KERNELRELEASE)/kernel + +External modules are installed in the directory: + + /lib/modules/$(KERNELRELEASE)/extra + +--- 6.1 INSTALL_MOD_PATH + + Above are the default directories, but as always some level of + customization is possible. One can prefix the path using the variable + INSTALL_MOD_PATH: + + $ make INSTALL_MOD_PATH=/frodo modules_install + => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel + + INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the + example above be specified on the commandline when calling make. + INSTALL_MOD_PATH has effect both when installing modules included in + the kernel as well as when installing external modules. + +--- 6.2 INSTALL_MOD_DIR + + When installing external modules they are default installed in a + directory under /lib/modules/$(KERNELRELEASE)/extra, but one may wish + to locate modules for a specific functionality in a separate + directory. For this purpose one can use INSTALL_MOD_DIR to specify an + alternative name than 'extra'. + + $ make INSTALL_MOD_DIR=gandalf -C KERNELDIR \ + M=`pwd` modules_install + => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf + + +=== 7. Module versioning + +Module versioning are enabled by the CONFIG_MODVERSIONS tag. + +Module versioning is used as a simple ABI consistency check. The Module +versioning creates a CRC value of the full prototype for an exported symbol and +when a module is loaded/used then the CRC values contained in the kernel are +compared with similar values in the module. If they are not equal then the +kernel refuses to load the module. + +During a kernel build a file named Module.symvers will be generated. This +file includes the symbol version of all symbols within the kernel. If the +Module.symvers file is saved from the last full kernel compile one does not +have to do a full kernel compile to build a module version's compatible module. + +=== 8. Tips & Tricks + +--- 8.1 Testing for CONFIG_FOO_BAR + + Modules often needs to check for certain CONFIG_ options to decide if + a specific feature shall be included in the module. When kbuild is used + this is done by referencing the CONFIG_ variable directly. + + #fs/ext2/Makefile + obj-$(CONFIG_EXT2_FS) += ext2.o + + ext2-y := balloc.o bitmap.o dir.o + ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o + + External modules have traditionally used grep to check for specific + CONFIG_ settings directly in .config. This usage is broken. + As introduced before external modules shall use kbuild when building + and therefore can use the same methods as in-kernel modules when testing + for CONFIG_ definitions. + diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e7ea0b7a6..b24c796f0 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -29,6 +29,7 @@ restrictions referred to are that the relevant option is valid if: CD Appropriate CD support is enabled. DEVFS devfs support is enabled. DRM Direct Rendering Management support is enabled. + EDD BIOS Enhanced Disk Drive Services (EDD) is enabled EFI EFI Partitioning (GPT) is enabled EIDE EIDE/ATAPI support is enabled. FB The frame buffer device is enabled. @@ -50,9 +51,11 @@ restrictions referred to are that the relevant option is valid if: MOUSE Appropriate mouse support is enabled. MTD MTD support is enabled. NET Appropriate network support is enabled. + NUMA NUMA support is enabled. NFS Appropriate NFS support is enabled. OSS OSS sound support is enabled. PARIDE The ParIDE subsystem is enabled. + PARISC The PA-RISC architecture is enabled. PCI PCI bus support is enabled. PCMCIA The PCMCIA subsystem is enabled. PNP Plug & Play support is enabled. @@ -149,6 +152,8 @@ running once the system is up. debugging. After system has booted up, it can be set via /proc/acpi/debug_level. + acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT + ad1816= [HW,OSS] Format: ,,, See also Documentation/sound/oss/AD1816. @@ -221,15 +226,19 @@ running once the system is up. atascsi= [HW,SCSI] Atari SCSI - atkbd.extra= [HW] Enable extra LEDs and keys on IBM RapidAccess, EzKey - and similar keyboards + atkbd.extra= [HW] Enable extra LEDs and keys on IBM RapidAccess, + EzKey and similar keyboards atkbd.reset= [HW] Reset keyboard during initialization atkbd.set= [HW] Select keyboard code set Format: (2 = AT (default) 3 = PS/2) - atkbd.scroll= [HW] Enable scroll wheel on MS Office and similar keyboards + atkbd.scroll= [HW] Enable scroll wheel on MS Office and similar + keyboards + + atkbd.softraw= [HW] Choose between synthetic and real raw mode + Format: (0 = real, 1 = synthetic (default)) atkbd.softrepeat= [HW] Use software keyboard repeat @@ -311,8 +320,24 @@ running once the system is up. condev= [HW,S390] console device conmode= - console= [KNL] Output console - Console device and comm spec (speed, control, parity). + console= [KNL] Output console device and options. + + tty Use the virtual console device . + + ttyS[,options] + Use the specified serial port. The options are of + the form "bbbbpn", where "bbbb" is the baud rate, + "p" is parity ("n", "o", or "e"), and "n" is bits. + Default is "9600n8". + + See also Documentation/serial-console.txt. + + uart,io,[,options] + uart,mmio,[,options] + Start an early, polled-mode console on the 8250/16550 + UART at the specified I/O port or MMIO address, + switching to the matching ttyS device later. The + options are the same as for ttyS, above. cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver Format: ,,,[,] @@ -391,10 +416,14 @@ running once the system is up. edb= [HW,PS2] + edd= [EDD] + Format: {"of[f]" | "sk[ipmbr]"} + See comment in arch/i386/boot/edd.S + eicon= [HW,ISDN] Format: ,, - eisa_irq_edge= [PARISC] + eisa_irq_edge= [PARISC,HW] See header of drivers/parisc/eisa.c. elanfreq= [IA-32] @@ -403,7 +432,8 @@ running once the system is up. elevator= [IOSCHED] Format: {"as"|"cfq"|"deadline"|"noop"} - See Documentation/as-iosched.txt for details + See Documentation/block/as-iosched.txt + and Documentation/block/deadline-iosched.txt for details. es1370= [HW,OSS] Format: [,] @@ -456,6 +486,10 @@ running once the system is up. gvp11= [HW,SCSI] + hashdist= [KNL,NUMA] Large hashes allocated during boot + are distributed across NUMA nodes. Defaults on + for IA-64, off otherwise. + hcl= [IA-64] SGI's Hardware Graph compatibility layer hd= [EIDE] (E)IDE hard drive subsystem geometry @@ -480,6 +514,8 @@ running once the system is up. i8042.dumbkbd [HW] Pretend that controlled can only read data from keyboard and can not control its state (Don't attempt to blink the leds) + i8042.noacpi [HW] Don't use ACPI to discover KBD/AUX controller + settings i8042.noaux [HW] Don't check for auxiliary (== mouse) port i8042.nomux [HW] Don't check presence of an active multiplexing controller @@ -488,16 +524,26 @@ running once the system is up. i810= [HW,DRM] + i8k.force [HW] Activate i8k driver even if SMM BIOS signature + does not match list of supported models. + i8k.power_status + [HW] Report power status in /proc/i8k + (disabled by default) + i8k.restricted [HW] Allow controlling fans only if SYS_ADMIN + capability is set. + ibmmcascsi= [HW,MCA,SCSI] IBM MicroChannel SCSI adapter See Documentation/mca.txt. icn= [HW,ISDN] Format: [,[,[,]]] + ide= [HW] (E)IDE subsystem + Format: ide=nodma or ide=doubler or ide=reverse + See Documentation/ide.txt. + ide?= [HW] (E)IDE subsystem - Config (iomem/irq), tuning or debugging - (serialize,reset,no{dma,tune,probe}) or chipset - specific parameters. + Format: ide?=noprobe or chipset specific parameters. See Documentation/ide.txt. idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed @@ -545,11 +591,13 @@ running once the system is up. Format: , , , isolcpus= [KNL,SMP] Isolate CPUs from the general scheduler. - Format: , ..., + Format: ,..., This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. The only way to move a process onto or off an "isolated" CPU is via the CPU affinity syscalls. + begins at 0 and the maximum value is + "number of CPUs in system - 1". This option is the preferred way to isolate CPUs. The alternative - manually setting the CPU mask of all tasks @@ -629,7 +677,11 @@ running once the system is up. mac53c9x= [HW,SCSI] Format: ,,,,,,, - + + machvec= [IA64] + Force the use of a particular machine-vector (machvec) in a generic + kernel. Example: machvec=hpzx1_swiotlb + mad16= [HW,OSS] Format: ,,,,,, @@ -643,9 +695,10 @@ running once the system is up. maxcpus= [SMP] Maximum number of processors that an SMP kernel should make use of - max_scsi_luns= [SCSI] + max_luns= [SCSI] Maximum number of LUNs to probe + Should be between 1 and 2^32-1. - max_scsi_report_luns= + max_report_luns= [SCSI] Maximum number of LUNs received Should be between 1 and 16384. @@ -670,6 +723,9 @@ running once the system is up. mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory Amount of memory to be used when the kernel is not able to see the whole system memory or for test. + [IA-32] Use together with memmap= to avoid physical + address space collisions. Without memmap= PCI devices + could be placed at addresses belonging to unused RAM. mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel memory. @@ -692,7 +748,7 @@ running once the system is up. [KNL,ACPI] Mark specific memory as reserved. Region of memory to be used, from ss to ss+nn. - meye= [HW] Set MotionEye Camera parameters + meye.*= [HW] Set MotionEye Camera parameters See Documentation/video4linux/meye.txt. mga= [HW,DRM] @@ -754,8 +810,8 @@ running once the system is up. noalign [KNL,ARM] - noapic [SMP,APIC] Tells the kernel not to make use of any - APIC that may be present on the system. + noapic [SMP,APIC] Tells the kernel to not make use of any + IOAPICs that may be present in the system. noasync [HW,M68K] Disables async and sync negotiation for all devices. @@ -769,14 +825,12 @@ running once the system is up. noexec [IA-64] - noexec [i386] + noexec [i386, x86_64] noexec=on: enable non-executable mappings (default) noexec=off: disable nn-executable mappings nofxsr [BUGS=IA-32] - nohighio [BUGS=IA-32] Disable highmem block I/O. - nohlt [BUGS=ARM] no-hlt [BUGS=IA-32] Tells the kernel that the hlt @@ -842,6 +896,13 @@ running once the system is up. panic= [KNL] Kernel behaviour on panic Format: + parkbd.port= [HW] Parallel port number the keyboard adapter is + connected to, default is 0. + Format: + parkbd.mode= [HW] Parallel port keyboard adapter mode of operation, + 0 for XT, 1 for AT (default is AT). + Format: + parport=0 [HW,PPT] Specify parallel ports. 0 disables. parport=auto Use 'auto' to force the driver to use parport=0xBBB[,IRQ[,DMA]] any IRQ/DMA settings detected (the @@ -857,6 +918,16 @@ running once the system is up. order they are specified on the command line, starting with parport0. + parport_init_mode= + [HW,PPT] Configure VIA parallel port to + operate in specific mode. This is + necessary on Pegasos computer where + firmware has no options for setting up + parallel port mode and sets it to + spp. Currently this function knows + 686a and 8231 chips. + Format: [spp|ps2|epp|ecp|ecpepp] + pas2= [HW,OSS] Format: ,,,,,,, @@ -912,6 +983,10 @@ running once the system is up. enabled. noacpi [IA-32] Do not use ACPI for IRQ routing or for PCI scanning. + routeirq Do IRQ routing for all PCI devices. + This is normally done in pci_enable_device(), + so this option is a temporary workaround + for broken drivers that don't call it. firmware [ARM] Do not re-enumerate the bus but instead just use the configuration @@ -925,6 +1000,11 @@ running once the system is up. pd. [PARIDE] See Documentation/paride.txt. + pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at + boot time. + Format: { 0 | 1 } + See arch/parisc/kernel/pdc_chassis.c + pf. [PARIDE] See Documentation/paride.txt. @@ -938,6 +1018,9 @@ running once the system is up. Format: { parport | timid | 0 } See also Documentation/parport.txt. + pnpacpi= [ACPI] + { off } + pnpbios= [ISAPNP] { on | off | curr | res | no-curr | no-res } @@ -960,6 +1043,10 @@ running once the system is up. (param: profile step/bucket size as a power of 2 for statistical time based profiling) + processor.max_cstate= [HW, ACPI] + Limit processor to maximum C-state + max_cstate=9 overrides any DMI blacklist limit. + prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk before loading. See Documentation/ramdisk.txt. @@ -1001,10 +1088,6 @@ running once the system is up. New name for the ramdisk parameter. See Documentation/ramdisk.txt. - ramdisk_start= [RAM] Starting block of RAM disk image (so you can - place it after the kernel image on a boot floppy). - See Documentation/ramdisk.txt. - reboot= [BUGS=IA-32,BUGS=ARM,BUGS=IA-64] Rebooting mode Format: [,[,...]] See arch/*/kernel/reboot.c. @@ -1023,6 +1106,9 @@ running once the system is up. root= [KNL] Root filesystem + rootdelay= [KNL] Delay (in seconds) to pause before attempting to + mount the root filesystem + rootflags= [KNL] Set root filesystem mount option string rootfstype= [KNL] Set root filesystem type @@ -1060,8 +1146,6 @@ running once the system is up. scsi_logging= [SCSI] - scsihosts= [SCSI] - serialnumber [BUGS=IA-32] sf16fm= [HW] SF16FMI radio driver for Linux @@ -1219,17 +1303,12 @@ running once the system is up. sonycd535= [HW,CD] Format: [,] - sonypi= [HW] Sony Programmable I/O Control Device driver - Format: ,,,,, + sonypi.*= [HW] Sony Programmable I/O Control Device driver + See Documentation/sonypi.txt specialix= [HW,SERIAL] Specialix multi-serial port adapter See Documentation/specialix.txt. - speedstep_coppermine= - [HW,IA-32] Take CPU in your notebook as SpeedStep-capable - See comment before function speedstep_setup() in - arch/i386/kernel/cpu/cpufreq/speedstep.c. - spia_io_base= [HW,MTD] spia_fio_base= spia_pedr= @@ -1244,7 +1323,7 @@ running once the system is up. st0x= [HW,SCSI] See header of drivers/scsi/seagate.c. - sti= [HW] + sti= [PARISC,HW] Format: Set the STI (builtin display/keyboard on the HP-PARISC machines) console (graphic card) which should be used @@ -1277,12 +1356,13 @@ running once the system is up. thash_entries= [KNL,NET] Set number of hash buckets for TCP connection - tipar= [HW] - See header of drivers/char/tipar.c. + tipar.timeout= [HW,PPT] + Set communications timeout in tenths of a second + (default 15). + + tipar.delay= [HW,PPT] + Set inter-bit delay in microseconds (default 10). - tiusb= [HW,USB] Texas Instruments' USB GraphLink (aka SilverLink) - Format: - tmc8xx= [HW,SCSI] See header of drivers/scsi/seagate.c. @@ -1311,6 +1391,8 @@ running once the system is up. uart6850= [HW,OSS] Format: , + + usb-handoff [HW] Enable early USB BIOS -> OS handoff video= [FB] Frame buffer configuration See Documentation/fb/modedb.txt. diff --git a/Documentation/md.txt b/Documentation/md.txt index 3fb3b1ef1..e2b536992 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt @@ -45,7 +45,8 @@ Boot time autodetection of RAID arrays When md is compiled into the kernel (not as module), partitions of type 0xfd are scanned and automatically assembled into RAID arrays. This autodetection may be suppressed with the kernel parameter -"raid=noautodetect". +"raid=noautodetect". As of kernel 2.6.9, only drives with a type 0 +superblock can be autodetected and run at boot time. The kernel parameter "raid=partitionable" (or "raid=part") means that all auto-detected arrays are assembled as partitionable. @@ -55,13 +56,13 @@ Superblock formats ------------------ The md driver can support a variety of different superblock formats. -(It doesn't yet, but it can) +Currently, it supports superblock formats "0.90.0" and the "md-1" format +introduced in the 2.5 development series. -The kernel does *NOT* autodetect which format superblock is being -used. It must be told. +The kernel will autodetect which format superblock is being used. Superblock format '0' is treated differently to others for legacy -reasons. +reasons - it is the original superblock format. General Rules - apply for all superblock formats @@ -69,6 +70,7 @@ General Rules - apply for all superblock formats An array is 'created' by writing appropriate superblocks to all devices. + It is 'assembled' by associating each of these devices with an particular md virtual device. Once it is completely assembled, it can be accessed. @@ -76,10 +78,10 @@ be accessed. An array should be created by a user-space tool. This will write superblocks to all devices. It will usually mark the array as 'unclean', or with some devices missing so that the kernel md driver -can create approrpriate redundancy (copying in raid1, parity +can create appropriate redundancy (copying in raid1, parity calculation in raid4/5). -When an array is assembled, it is first initialised with the +When an array is assembled, it is first initialized with the SET_ARRAY_INFO ioctl. This contains, in particular, a major and minor version number. The major version number selects which superblock format is to be used. The minor number might be used to tune handling @@ -101,15 +103,16 @@ array using HOT_REMOVE_DISK. Specific Rules that apply to format-0 super block arrays, and - arrays with no superblock (non-persistant). + arrays with no superblock (non-persistent). ------------------------------------------------------------- An array can be 'created' by describing the array (level, chunksize etc) in a SET_ARRAY_INFO ioctl. This must has major_version==0 and raid_disks != 0. -Then uninitialised devices can be added with ADD_NEW_DISK. The + +Then uninitialized devices can be added with ADD_NEW_DISK. The structure passed to ADD_NEW_DISK must specify the state of the device and it's role in the array. -One started with RUN_ARRAY, uninitialised spares can be added with +Once started with RUN_ARRAY, uninitialized spares can be added with HOT_ADD_DISK. diff --git a/Documentation/memory.txt b/Documentation/memory.txt index 7af1709e8..2b3dedd39 100644 --- a/Documentation/memory.txt +++ b/Documentation/memory.txt @@ -21,6 +21,8 @@ systems. All of these problems can be addressed with the "mem=XXXM" boot option (where XXX is the size of RAM to use in megabytes). It can also tell Linux to use less memory than is actually installed. +If you use "mem=" on a machine with PCI, consider using "memmap=" to avoid +physical address space collisions. See the documentation of your boot loader (LILO, loadlin, etc.) about how to pass options to the kernel. @@ -44,7 +46,9 @@ Try: * Disabling the cache from the BIOS. * Try passing the "mem=4M" option to the kernel to limit - Linux to using a very small amount of memory. + Linux to using a very small amount of memory. Use "memmap="-option + together with "mem=" on systems with PCI to avoid physical address + space collisions. Other tricks: diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt index 0b2b7051a..df7246947 100644 --- a/Documentation/networking/e100.txt +++ b/Documentation/networking/e100.txt @@ -1,14 +1,16 @@ Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters ============================================================== -March 15, 2004 +November 17, 2004 Contents ======== - In This Release -- Supported Adapters +- Identifying Your Adapter +- Driver Configuration Parameters +- Additional Configurations - Support @@ -16,26 +18,132 @@ In This Release =============== This file describes the Linux* Base Driver for the Intel(R) PRO/100 Family of -Adapters, version 3.x.x. This driver includes support for Itanium(TM)-based -systems. +Adapters, version 3.3.x. This driver supports 2.4.x and 2.6.x kernels. - -Supported Adapters -================== - -To verify that your adapter is supported, find the board ID number on the -adapter. Look for a label that has a barcode and a number in the format -A12345-001. Match this to the list of numbers above. +Identifying Your Adapter +======================== For more information on how to identify your adapter, go to the Adapter & Driver ID Guide at: http://support.intel.com/support/network/adapter/pro100/21397.htm -For the latest Intel PRO/100 network driver for Linux, see: +For the latest Intel network drivers for Linux, refer to the following +website. In the search field, enter your adapter name or type, or use the +networking link on the left to search for your adapter: http://downloadfinder.intel.com/scripts-df/support_intel.asp +Driver Configuration Parameters +=============================== + +The default value for each parameter is generally the recommended setting, +unless otherwise noted. + +Rx Descriptors: Number of receive descriptors. A receive descriptor is a data + structure that describes a receive buffer and its attributes to the network + controller. The data in the descriptor is used by the controller to write + data from the controller to host memory. In the 3.0.x driver the valid + range for this parameter is 64-256. The default value is 64. This parameter + can be changed using the command + + ethtool -G eth? rx n, where n is the number of desired rx descriptors. + +Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a + data structure that describes a transmit buffer and its attributes to the + network controller. The data in the descriptor is used by the controller to + read data from the host memory to the controller. In the 3.0.x driver the + valid range for this parameter is 64-256. The default value is 64. This + parameter can be changed using the command + + ethtool -G eth? tx n, where n is the number of desired tx descriptors. + +Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by + default. Ethtool can be used as follows to force speed/duplex. + + ethtool -s eth? autoneg off speed {10|100} duplex {full|half} + + NOTE: setting the speed/duplex to incorrect values will cause the link to + fail. + +Event Log Message Level: The driver uses the message level flag to log events + to syslog. The message level can be set at driver load time. It can also be + set using the command + + ethtool -s eth? msglvl n + +Additional Configurations +========================= + + Configuring the Driver on Different Distributions + ------------------------------------------------- + + Configuring a network driver to load properly when the system is started is + distribution dependent. Typically, the configuration process involves adding + an alias line to /etc/modules.conf as well as editing other system startup + scripts and/or configuration files. Many popular Linux distributions ship + with tools to make these changes for you. To learn the proper way to + configure a network device for your system, refer to your distribution + documentation. If during this process you are asked for the driver or module + name, the name for the Linux Base Driver for the Intel PRO/100 Family of + Adapters is e100. + + As an example, if you install the e100 driver for two PRO/100 adapters + (eth0 and eth1), add the following to modules.conf: + + alias eth0 e100 + alias eth1 e100 + + Viewing Link Messages + --------------------- + In order to see link messages and other Intel driver information on your + console, you must set the dmesg level up to six. This can be done by + entering the following on the command line before loading the e100 driver: + + dmesg -n 8 + + If you wish to see all messages issued by the driver, including debug + messages, set the dmesg level to eight. + + NOTE: This setting is not saved across reboots. + + Ethtool + ------- + + The driver utilizes the ethtool interface for driver configuration and + diagnostics, as well as displaying statistical information. Ethtool + version 1.6 or later is required for this functionality. + + The latest release of ethtool can be found at: + http://sf.net/projects/gkernel. + + NOTE: This driver uses mii support from the kernel. As a result, when + there is no link, ethtool will report speed/duplex to be 10/half. + + NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support + for a more complete ethtool feature set can be enabled by upgrading + ethtool to ethtool-1.8.1. + + Enabling Wake on LAN* (WoL) + --------------------------- + WoL is provided through the Ethtool* utility. Ethtool is included with Red + Hat* 8.0. For other Linux distributions, download and install Ethtool from + the following website: http://sourceforge.net/projects/gkernel. + + For instructions on enabling WoL with Ethtool, refer to the Ethtool man + page. + + WoL will be enabled on the system during the next shut down or reboot. For + this driver version, in order to enable WoL, the e100 driver must be + loaded when shutting down or rebooting the system. + + NAPI + ---- + + NAPI (Rx polling mode) is supported in the e100 driver. NAPI is enabled + or disabled based on the configuration of the kernel. + + See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. Support ======= diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt index 9b2329f99..2ebd4058d 100644 --- a/Documentation/networking/e1000.txt +++ b/Documentation/networking/e1000.txt @@ -1,14 +1,14 @@ Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters =============================================================== -January 8, 2003 +November 17, 2004 Contents ======== - In This Release -- Supported Adapters +- Identifying Your Adapter - Command Line Parameters - Speed and Duplex Configuration - Additional Configurations @@ -20,63 +20,28 @@ In This Release =============== This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family -of Adapters, version 5.0.x. This driver includes support for -Itanium(TM)-based systems. +of Adapters, version 5.x.x. +For questions related to hardware requirements, refer to the documentation +supplied with your Intel PRO/1000 adapter. All hardware requirements listed +apply to use with Linux. Native VLANs are now available with supported kernels. - -Supported Adapters -================== - -The following Intel network adapters are compatible with the drivers in this -release: - - Controller Adapter Name Board IDs - ---------- ------------ --------- - - 82542 PRO/1000 Gigabit Server Adapter 700262-xxx, 717037-xxx - - 82543 PRO/1000 F Server Adapter 738640-xxx, A38888-xxx - - 82543 PRO/1000 T Server Adapter A19845-xxx, A33948-xxx - - 82544 PRO/1000 XT Server Adapter A51580-xxx - - 82544 PRO/1000 XF Server Adapter A50484-xxx - - 82544 PRO/1000 T Desktop Adapter A62947-xxx - - 82540 PRO/1000 MT Desktop Adapter A78408-xxx - 82541 C91016-xxx - - 82545 PRO/1000 MT Server Adapter A92165-xxx - - 82546 PRO/1000 MT Dual Port Server Adapter A92111-xxx - - 82545 PRO/1000 MF Server Adapter A91622-xxx - - 82545 PRO/1000 MF Server Adapter(LX) A91624-xxx - - 82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx - - - -To verify your Intel adapter is supported, find the board ID number on the -adapter. Look for a label that has a barcode and a number in the format -A12345-001. Match this to the list of numbers above. +Identifying Your Adapter +======================== For more information on how to identify your adapter, go to the Adapter & Driver ID Guide at: http://support.intel.com/support/network/adapter/pro100/21397.htm -For the latest Intel network drivers for Linux, refer to the following +For the latest Intel network drivers for Linux, refer to the following +website. In the search field, enter your adapter name or type, or use the +networking link on the left to search for your adapter: http://downloadfinder.intel.com/scripts-df/support_intel.asp - Command Line Parameters ======================= @@ -92,27 +57,39 @@ For example, with two PRO/1000 PCI adapters, entering: insmod e1000 TxDescriptors=80,128 -loads the e1000 driver with 80 TX resources for the first adapter and 128 TX -resources for the second adapter. +loads the e1000 driver with 80 TX descriptors for the first adapter and 128 TX +descriptors for the second adapter. The default value for each parameter is generally the recommended setting, -unless otherwise noted. +unless otherwise noted. Also, if the driver is statically built into the +kernel, the driver is loaded with the default values for all the parameters. +Ethtool can be used to change some of the parameters at runtime. + + NOTES: For more information about the AutoNeg, Duplex, and Speed + parameters, see the "Speed and Duplex Configuration" section in + this document. -For more information about the AutoNeg, Duplex, and Speed parameters, see the -"Speed and Duplex Configuration" section in this document. + For more information about the InterruptThrottleRate, RxIntDelay, + TxIntDelay, RxAbsIntDelay, and TxAbsIntDelay parameters, see the + application note at: + http://www.intel.com/design/network/applnots/ap450.htm + A descriptor describes a data buffer and attributes related to the + data buffer. This information is accessed by the hardware. AutoNeg (adapters using copper connections only) Valid Range: 0x01-0x0F, 0x20-0x2F Default Value: 0x2F This parameter is a bit mask that specifies which speed and duplex settings the board advertises. When this parameter is used, the Speed and - Duplex parameters must not be specified. + Duplex parameters must not be specified. + NOTE: Refer to the Speed and Duplex section of this readme for more + information on the AutoNeg parameter. Duplex (adapters using copper connections only) Valid Range: 0-2 (0=auto-negotiate, 1=half, 2=full) Default Value: 0 - Defines the direction in which data is allowed to flow. Can by either one + Defines the direction in which data is allowed to flow. Can be either one or two-directional. If both Duplex and the link partner are set to auto- negotiate, the board auto-detects the correct duplex. If the link partner is forced (either full or half), Duplex defaults to half-duplex. @@ -125,30 +102,59 @@ Default: Read flow control settings from the EEPROM InterruptThrottleRate Valid Range: 100-100000 (0=off, 1=dynamic) -Default Value: 1 +Default Value: 8000 This value represents the maximum number of interrupts per second the controller generates. InterruptThrottleRate is another setting used in interrupt moderation. Dynamic mode uses a heuristic algorithm to adjust InterruptThrottleRate based on the current traffic load. +Un-supported Adapters: InterruptThrottleRate is NOT supported by 82542, 82543 + or 82544-based adapters. NOTE: InterruptThrottleRate takes precedence over the TxAbsIntDelay and RxAbsIntDelay parameters. In other words, minimizing the receive and/or transmit absolute delays does not force the controller to generate more interrupts than what the Interrupt Throttle Rate allows. + CAUTION: If you are using the Intel PRO/1000 CT Network Connection + (controller 82547), setting InterruptThrottleRate to a value + greater than 75,000, may hang (stop transmitting) adapters under + certain network conditions. If this occurs a NETDEV WATCHDOG + message is logged in the system event log. In addition, the + controller is automatically reset, restoring the network + connection. To eliminate the potential for the hang, ensure + that InterruptThrottleRate is set no greater than 75,000 and is + not set to 0. + NOTE: When e1000 is loaded with default settings and multiple adapters are + in use simultaneously, the CPU utilization may increase non-linearly. + In order to limit the CPU utilization without impacting the overall + throughput, we recommend that you load the driver as follows: + + insmod e1000.o InterruptThrottleRate=3000,3000,3000 + + This sets the InterruptThrottleRate to 3000 interrupts/sec for the + first, second, and third instances of the driver. The range of 2000 to + 3000 interrupts per second works on a majority of systems and is a + good starting point, but the optimal value will be platform-specific. + If CPU utilization is not a concern, use RX_POLLING (NAPI) and default + driver settings. RxDescriptors Valid Range: 80-256 for 82542 and 82543-based adapters - 80-4096 for 82540, 82544, 82545, and 82546-based adapters -Default Value: 80 + 80-4096 for all other supported adapters +Default Value: 256 This value is the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more incoming packets. - Each descriptor is 16 bytes. A receive buffer is also allocated for each - descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending - on the MTU setting. The maximum MTU size is 16110. + Each descriptor is 16 bytes. A receive buffer is allocated for each + descriptor and can either be 2048 or 4096 bytes long, depending on the MTU + + setting. An incoming packet can span one or more receive descriptors. + The maximum MTU size is 16110. NOTE: MTU designates the frame size. It only needs to be set for Jumbo Frames. + NOTE: Depending on the available system resources, the request for a + higher number of receive descriptors may be denied. In this case, + use a lower number. RxIntDelay Valid Range: 0-65535 (0=off) @@ -168,11 +174,11 @@ Default Value: 0 restoring the network connection. To eliminate the potential for the hang ensure that RxIntDelay is set to 0. -RxAbsIntDelay (82540, 82545, and 82546-based adapters only) +RxAbsIntDelay (82540, 82545 and later adapters only) Valid Range: 0-65535 (0=off) Default Value: 128 This value, in units of 1.024 microseconds, limits the delay in which a - transmit interrupt is generated. Useful only if RxIntDelay is non-zero, + receive interrupt is generated. Useful only if RxIntDelay is non-zero, this value ensures that an interrupt is generated after the initial packet is received within the set amount of time. Proper tuning, along with RxIntDelay, may improve traffic throughput in specific network @@ -188,12 +194,16 @@ Default Value: 0 (auto-negotiate at all supported speeds) TxDescriptors Valid Range: 80-256 for 82542 and 82543-based adapters - 80-4096 for 82540, 82544, 82545, and 82546-based adapters + 80-4096 for all other supported adapters Default Value: 256 This value is the number of transmit descriptors allocated by the driver. Increasing this value allows the driver to queue more transmits. Each descriptor is 16 bytes. + NOTE: Depending on the available system resources, the request for a + higher number of transmit descriptors may be denied. In this case, + use a lower number. + TxIntDelay Valid Range: 0-65535 (0=off) Default Value: 64 @@ -203,7 +213,7 @@ Default Value: 64 system is reporting dropped transmits, this value may be set too high causing the driver to run out of available transmit descriptors. -TxAbsIntDelay (82540, 82545, and 82546-based adapters only) +TxAbsIntDelay (82540, 82545 and later adapters only) Valid Range: 0-65535 (0=off) Default Value: 64 This value, in units of 1.024 microseconds, limits the delay in which a @@ -219,7 +229,6 @@ Default Value: 1 A value of '1' indicates that the driver should enable IP checksum offload for received packets (both UDP and TCP) to the adapter hardware. - Speed and Duplex Configuration ============================== @@ -243,13 +252,16 @@ For copper-based boards, the keywords interact as follows: also be forced. The AutoNeg parameter is used when more control is required over the auto- -negotiation process. When this parameter is used, Speed and Duplex must not -be specified. This parameter is a bitmap that specifies which speed and -duplex settings are advertised to the link partner. +negotiation process. When this parameter is used, Speed and Duplex parameters +must not be specified. The following table describes supported values for the +AutoNeg parameter: + +Speed (Mbps) 1000 100 100 10 10 +Duplex Full Full Half Full Half +Value (in base 16) 0x20 0x08 0x04 0x02 0x01 -Bit 7 6 5 4 3 2 1 0 -Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10 -Duplex Full Full Half Full Half +Example: insmod e1000 AutoNeg=0x03, loads e1000 and specifies (10 full duplex, +10 half duplex) for negotiation with the peer. Note that setting AutoNeg does not guarantee that the board will link at the highest specified speed or duplex mode, but the board will link at the @@ -261,6 +273,38 @@ adapter MUST be forced to the same speed/duplex. Additional Configurations ========================= + Configuring the Driver on Different Distributions + ------------------------------------------------- + + Configuring a network driver to load properly when the system is started is + distribution dependent. Typically, the configuration process involves adding + an alias line to /etc/modules.conf as well as editing other system startup + scripts and/or configuration files. Many popular Linux distributions ship + with tools to make these changes for you. To learn the proper way to + configure a network device for your system, refer to your distribution + documentation. If during this process you are asked for the driver or module + name, the name for the Linux Base Driver for the Intel PRO/1000 Family of + Adapters is e1000. + + As an example, if you install the e1000 driver for two PRO/1000 adapters + (eth0 and eth1) and set the speed and duplex to 10full and 100half, add the + following to modules.conf: + + alias eth0 e1000 + alias eth1 e1000 + options e1000 Speed=10,100 Duplex=2,1 + + Viewing Link Messages + --------------------- + + Link messages will not be displayed to the console if the distribution is + restricting system messages. In order to see network driver link messages on + your console, set dmesg to eight by entering the following: + + dmesg -n 8 + + NOTE: This setting is not saved across reboots. + Jumbo Frames ------------ @@ -278,6 +322,47 @@ Additional Configurations 10 or 100 Mbps may result in poor performance or loss of link. + NOTE: MTU designates the frame size. To enable Jumbo Frames, increase the + MTU size on the interface beyond 1500. + + Ethtool + ------- + + The driver utilizes the ethtool interface for driver configuration and + diagnostics, as well as displaying statistical information. Ethtool + version 1.6 or later is required for this functionality. + + The latest release of ethtool can be found from + http://sf.net/projects/gkernel. + + NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support + for a more complete ethtool feature set can be enabled by upgrading + ethtool to ethtool-1.8.1. + + Enabling Wake on LAN* (WoL) + --------------------------- + + WoL is configured through the Ethtool* utility. Ethtool is included with + all versions of Red Hat after Red Hat 7.2. For other Linux distributions, + download and install Ethtool from the following website: + http://sourceforge.net/projects/gkernel. + + For instructions on enabling WoL with Ethtool, refer to the website listed + above. + + WoL will be enabled on the system during the next shut down or reboot. + For this driver version, in order to enable WoL, the e1000 driver must be + loaded when shutting down or rebooting the system. + + NAPI + ---- + + NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled + or disabled based on the configuration of the kernel. + + See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. + + Known Issues ============ @@ -285,9 +370,9 @@ Known Issues ------------------------------- Memory allocation failures have been observed on Linux systems with 64 MB - of RAM or less that are running Jumbo Frames. If you are using Jumbo - Frames, your system may require more than the advertised minimum - requirement of 64 MB of system memory. + of RAM or less that are running Jumbo Frames. If you are using Jumbo Frames, + your system may require more than the advertised minimum requirement of 64 MB + of system memory. Support diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index c9ead70d5..a2c893a74 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -355,6 +355,12 @@ tcp_default_win_scale - INTEGER conections. Default: 7 +tcp_tso_win_divisor - INTEGER + This allows control over what percentage of the congestion window + can be consumed by a single TSO frame. + The setting of this parameter is a choice between burstiness and + building larger TSO frames. + Default: 8 tcp_frto - BOOLEAN Enables F-RTO, an enhanced recovery algorithm for TCP retransmission diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt index 993090c41..c62d588ed 100644 --- a/Documentation/networking/ixgb.txt +++ b/Documentation/networking/ixgb.txt @@ -1,14 +1,14 @@ Linux* Base Driver for the Intel(R) PRO/10GbE Family of Adapters ================================================================ -January 06, 2003 +September 13, 2004 Contents ======== - In This Release -- Supported Adapters +- Identifying Your Adapter - Command Line Parameters - Improving Performance - Support @@ -18,36 +18,23 @@ In This Release =============== This file describes the Linux* Base Driver for the Intel(R) PRO/10GbE Family -of Adapters, version 1.0.x. This driver is intended for 2.4.x kernels; it is -known to build properly on 2.4.x kernels through 2.4.18. Intel focused -testing on Intel architectures running kernels 2.4.18. This driver includes -support for Itanium(TM)-based systems. +of Adapters, version 1.0.x. This driver includes support for Itanium(TM)2 and +EM64T systems. For questions related to hardware requirements, refer to the documentation supplied with your Intel PRO/10GbE adapter. All hardware requirements listed apply to use with Linux. - -Supported Adapters -================== - -The following Intel network adapters are compatible with the drivers in this -release: - - Controller Adapter Name Board IDs - ---------- ------------ --------- - - 82597EX Intel(R) PRO/10GbE LR Server Adapter A82505-xxx - +Identifying Your Adapter +======================== To verify your Intel adapter is supported, find the board ID number on the adapter. Look for a label that has a barcode and a number in the format -A12345-001. Match this to the list of numbers above. +A12345-001. -For more information on how to identify your adapter, go to the Adapter & -Driver ID Guide at: +Use the above information and the Adapter & Driver ID Guide at: - http://support.intel.com/support/network/adapter/pro100/21397.htm + http://support.intel.com/support/network/adapter/pro100/21397.htm For the latest Intel network drivers for Linux, go to: @@ -72,8 +59,9 @@ loads the ixgb driver with 80 TX resources for the first adapter and 128 TX resources for the second adapter. The default value for each parameter is generally the recommended setting, -unless otherwise noted. - +unless otherwise noted. Also, if the driver is statically built into the +kernel, the driver is loaded with the default values for all the parameters. +Ethtool can be used to change some of the parameters at runtime. FlowControl Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) @@ -125,7 +113,6 @@ Default Value: 1 offload for transmitted packets (both UDP and TCP) to the adapter hardware. - Improving Performance ===================== diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt index 99c1485d7..cc4b4d041 100644 --- a/Documentation/networking/pktgen.txt +++ b/Documentation/networking/pktgen.txt @@ -1,77 +1,214 @@ -How to use the Linux packet generator module. - -1. Enable CONFIG_NET_PKTGEN to compile and build pktgen.o, install it - in the place where insmod may find it. -2. Cut script "ipg" (see below). -3. Edit script to set preferred device and destination IP address. -3a. Create more scripts for different interfaces. Up to thirty-two - pktgen processes can be configured and run at once by using the - 32 /proc/net/pktgen/pg* files. -4. Run in shell: ". ipg" -5. After this two commands are defined: - A. "pg" to start generator and to get results. - B. "pgset" to change generator parameters. F.e. - pgset "clone_skb 100" sets the number of copies of the same packet - will be sent before a new packet is allocated - pgset "clone_skb 0" use multiple SKBs for packet generation - pgset "pkt_size 9014" sets packet size to 9014 - pgset "frags 5" packet will consist of 5 fragments - pgset "count 200000" sets number of packets to send, set to zero - for continuous sends until explicitly - stopped. - pgset "ipg 5000" sets artificial gap inserted between packets - to 5000 nanoseconds - pgset "dst 10.0.0.1" sets IP destination address - (BEWARE! This generator is very aggressive!) - pgset "dst_min 10.0.0.1" Same as dst - pgset "dst_max 10.0.0.254" Set the maximum destination IP. - pgset "src_min 10.0.0.1" Set the minimum (or only) source IP. - pgset "src_max 10.0.0.254" Set the maximum source IP. - pgset "dstmac 00:00:00:00:00:00" sets MAC destination address - pgset "srcmac 00:00:00:00:00:00" sets MAC source address - pgset "src_mac_count 1" Sets the number of MACs we'll range through. The - 'minimum' MAC is what you set with srcmac. - pgset "dst_mac_count 1" Sets the number of MACs we'll range through. The - 'minimum' MAC is what you set with dstmac. - pgset "flag [name]" Set a flag to determine behaviour. Current flags - are: IPSRC_RND #IP Source is random (between min/max), - IPDST_RND, UDPSRC_RND, - UDPDST_RND, MACSRC_RND, MACDST_RND - pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then - cycle through the port range. - pgset "udp_src_max 9" set UDP source port max. - pgset "udp_dst_min 9" set UDP destination port min, If < udp_dst_max, then - cycle through the port range. - pgset "udp_dst_max 9" set UDP destination port max. - pgset stop aborts injection - - Also, ^C aborts generator. - ----- cut here - -#! /bin/sh - -modprobe pktgen - -PGDEV=/proc/net/pktgen/pg0 - -function pgset() { - local result - - echo $1 > $PGDEV - - result=`cat $PGDEV | fgrep "Result: OK:"` - if [ "$result" = "" ]; then - cat $PGDEV | fgrep Result: - fi -} - -function pg() { - echo inject > $PGDEV - cat $PGDEV -} - -pgset "odev eth0" -pgset "dst 0.0.0.0" - ----- cut here + + + HOWTO for the linux packet generator + ------------------------------------ + +Date: 041221 + +Enable CONFIG_NET_PKTGEN to compile and build pktgen.o either in kernel +or as module. Module is preferred. insmod pktgen if needed. Once running +pktgen creates a thread on each CPU where each thread has affinty it's CPU. +Monitoring and controlling is done via /proc. Easiest to select a suitable +a sample script and configure. + +On a dual CPU: + +ps aux | grep pkt +root 129 0.3 0.0 0 0 ? SW 2003 523:20 [pktgen/0] +root 130 0.3 0.0 0 0 ? SW 2003 509:50 [pktgen/1] + + +For montoring and control pktgen creates: + /proc/net/pktgen/pgctrl + /proc/net/pktgen/kpktgend_X + /proc/net/pktgen/ethX + + +Viewing threads +=============== +/proc/net/pktgen/kpktgend_0 +Name: kpktgend_0 max_before_softirq: 10000 +Running: +Stopped: eth1 +Result: OK: max_before_softirq=10000 + +Most important the devices assigend to thread. Note! A device can only belong +to one thread. + + +Viewing devices +=============== + +Parm section holds configured info. Current hold running stats. +Result is printed after run or after interruption. Example: + +/proc/net/pktgen/eth1 + +Params: count 10000000 min_pkt_size: 60 max_pkt_size: 60 + frags: 0 delay: 0 clone_skb: 1000000 ifname: eth1 + flows: 0 flowlen: 0 + dst_min: 10.10.11.2 dst_max: + src_min: src_max: + src_mac: 00:00:00:00:00:00 dst_mac: 00:04:23:AC:FD:82 + udp_src_min: 9 udp_src_max: 9 udp_dst_min: 9 udp_dst_max: 9 + src_mac_count: 0 dst_mac_count: 0 + Flags: +Current: + pkts-sofar: 10000000 errors: 39664 + started: 1103053986245187us stopped: 1103053999346329us idle: 880401us + seq_num: 10000011 cur_dst_mac_offset: 0 cur_src_mac_offset: 0 + cur_saddr: 0x10a0a0a cur_daddr: 0x20b0a0a + cur_udp_dst: 9 cur_udp_src: 9 + flows: 0 +Result: OK: 13101142(c12220741+d880401) usec, 10000000 (60byte,0frags) + 763292pps 390Mb/sec (390805504bps) errors: 39664 + +Confguring threads and devices +============================== +This is done via the /proc interface easiest done via pgset in the scripts + +Examples: + + pgset "clone_skb 1" sets the number of copies of the same packet + pgset "clone_skb 0" use single SKB for all transmits + pgset "pkt_size 9014" sets packet size to 9014 + pgset "frags 5" packet will consist of 5 fragments + pgset "count 200000" sets number of packets to send, set to zero + for continious sends untill explicitl stopped. + + pgset "delay 5000" adds delay to hard_start_xmit(). nanoseconds + + pgset "dst 10.0.0.1" sets IP destination address + (BEWARE! This generator is very aggressive!) + + pgset "dst_min 10.0.0.1" Same as dst + pgset "dst_max 10.0.0.254" Set the maximum destination IP. + pgset "src_min 10.0.0.1" Set the minimum (or only) source IP. + pgset "src_max 10.0.0.254" Set the maximum source IP. + pgset "dst6 fec0::1" IPV6 destination address + pgset "src6 fec0::2" IPV6 source address + pgset "dstmac 00:00:00:00:00:00" sets MAC destination address + pgset "srcmac 00:00:00:00:00:00" sets MAC source address + + pgset "src_mac_count 1" Sets the number of MACs we'll range through. + The 'minimum' MAC is what you set with srcmac. + + pgset "dst_mac_count 1" Sets the number of MACs we'll range through. + The 'minimum' MAC is what you set with dstmac. + + pgset "flag [name]" Set a flag to determine behaviour. Current flags + are: IPSRC_RND #IP Source is random (between min/max), + IPDST_RND, UDPSRC_RND, + UDPDST_RND, MACSRC_RND, MACDST_RND + + pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then + cycle through the port range. + + pgset "udp_src_max 9" set UDP source port max. + pgset "udp_dst_min 9" set UDP destination port min, If < udp_dst_max, then + cycle through the port range. + pgset "udp_dst_max 9" set UDP destination port max. + + pgset stop aborts injection. Also, ^C aborts generator. + + +Example scripts +=============== + +A collection of small tutorial scripts for pktgen is in expamples dir. + +pktgen.conf-1-1 # 1 CPU 1 dev +pktgen.conf-1-2 # 1 CPU 2 dev +pktgen.conf-2-1 # 2 CPU's 1 dev +pktgen.conf-2-2 # 2 CPU's 2 dev +pktgen.conf-1-1-rdos # 1 CPU 1 dev w. route DoS +pktgen.conf-1-1-ip6 # 1 CPU 1 dev ipv6 +pktgen.conf-1-1-ip6-rdos # 1 CPU 1 dev ipv6 w. route DoS +pktgen.conf-1-1-flows # 1 CPU 1 dev multiple flows. + +Run in shell: ./pktgen.conf-X-Y It does all the setup including sending. + + +Interrupt affinity +=================== +Note when adding devices to a specific CPU there good idea to also assign +/proc/irq/XX/smp_affinity so the TX-interrupts gets bound to the same CPU. +as this reduces cache bouncing when freeing skb's. + + +Current commands and configuration options +========================================== + +** Pgcontrol commands: + +start +stop + +** Thread commands: + +add_device +rem_device_all +max_before_softirq + + +** Device commands: + +count +clone_skb +debug + +frags +delay + +src_mac_count +dst_mac_count + +pkt_size +min_pkt_size +max_pkt_size + +udp_src_min +udp_src_max + +udp_dst_min +udp_dst_max + +flag + IPSRC_RND + TXSIZE_RND + IPDST_RND + UDPSRC_RND + UDPDST_RND + MACSRC_RND + MACDST_RND + +dst_min +dst_max + +src_min +src_max + +dst_mac +src_mac + +clear_counters + +dst6 +src6 + +flows +flowlen + +References: +ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/ +ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/ + +Paper from Linux-Kongress in Erlangen 2004. +ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/pktgen_paper.pdf + +Thanks to: +Grant Grundler for testing on IA-64 and parisc, Harald Welte, Lennert Buytenhek +Stephen Hemminger, Andi Kleen, Dave Miller and many others. + + +Good luck with the linux net-development. \ No newline at end of file diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt index 6cad46e8a..c025a4561 100644 --- a/Documentation/nmi_watchdog.txt +++ b/Documentation/nmi_watchdog.txt @@ -54,6 +54,20 @@ then the system has crashed so hard (eg. hardware-wise) that either it cannot even accept NMI interrupts, or the crash has made the kernel unable to print messages. +Be aware that when using local APIC, the frequency of NMI interrupts +it generates, depends on the system load. The local APIC NMI watchdog, +lacking a better source, uses the "cycles unhalted" event. As you may +guess it doesn't tick when the CPU is in the halted state (which happens +when the system is idle), but if your system locks up on anything but the +"hlt" processor instruction, the watchdog will trigger very soon as the +"cycles unhalted" event will happen every clock tick. If it locks up on +"hlt", then you are out of luck -- the event will not happen at all and the +watchdog won't trigger. This is a shortcoming of the local APIC watchdog +-- unfortunately there is no "clock ticks" event that would work all the +time. The I/O APIC watchdog is driven externally and has no such shortcoming. +But its NMI frequency is much higher, resulting in a more significant hit +to the overall system performance. + NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default, you have to enable it with a boot time parameter. Prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally on x86 SMP boxes. diff --git a/Documentation/parisc/registers b/Documentation/parisc/registers index 08b9f558d..dd3caddd1 100644 --- a/Documentation/parisc/registers +++ b/Documentation/parisc/registers @@ -35,8 +35,8 @@ CR31 (TR 7) Temporary register, used in various places SR0 temporary space register SR4-SR7 set to 0 SR1 temporary space register -SR2 unused -SR3 used for userspace accesses (current process)* +SR2 kernel should not clobber this +SR3 used for userspace accesses (current process) Space Registers (user mode) @@ -78,13 +78,8 @@ Shadow Registers used by interruption handler code TOC enable bit 1 ========================================================================= -Info from John Marvin: - -From: "John Marvin" -To: randolf@tausq.org -Subject: Re: parisc asm questions - -[...] +Register usage notes, originally from John Marvin, with some additional +notes from Randolph Chung. For the general registers: @@ -111,9 +106,10 @@ that you should be aware of: don't care about the values that were passed in anymore. r28,r29: are ret0 and ret1. They are what you pass return values - in. r28 is the primary return. I'm not sure I remember - under what circumstances stuff is returned in r29 (millicode - perhaps). + in. r28 is the primary return. When returning small structures + r29 may also be used to pass data back to the caller. + + r30: stack pointer r31: the ble instruction puts the return pointer in here. @@ -123,6 +119,3 @@ r3-r18,r27,r30 need to be saved and restored. r3-r18 are just used to make references to global variables easier. r30 is the stack pointer. -John - - diff --git a/Documentation/pci.txt b/Documentation/pci.txt index a1a2bd557..b0676d114 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt @@ -141,26 +141,24 @@ for PCI devices manually using the following constructs: Searching by vendor and device ID: struct pci_dev *dev = NULL; - while (dev = pci_find_device(VENDOR_ID, DEVICE_ID, dev)) + while (dev = pci_get_device(VENDOR_ID, DEVICE_ID, dev)) configure_device(dev); Searching by class ID (iterate in a similar way): - pci_find_class(CLASS_ID, dev) + pci_get_class(CLASS_ID, dev) Searching by both vendor/device and subsystem vendor/device ID: - pci_find_subsys(VENDOR_ID, DEVICE_ID, SUBSYS_VENDOR_ID, SUBSYS_DEVICE_ID, dev). + pci_get_subsys(VENDOR_ID, DEVICE_ID, SUBSYS_VENDOR_ID, SUBSYS_DEVICE_ID, dev). You can use the constant PCI_ANY_ID as a wildcard replacement for VENDOR_ID or DEVICE_ID. This allows searching for any device from a specific vendor, for example. -Note that these functions are not hotplug-safe. Their hotplug-safe -replacements are pci_get_device(), pci_get_class() and pci_get_subsys(). -They increment the reference count on the pci_dev that they return. -You must eventually (possibly at module unload) decrement the reference -count on these devices by calling pci_dev_put(). + These functions are hotplug-safe. They increment the reference count on +the pci_dev that they return. You must eventually (possibly at module unload) +decrement the reference count on these devices by calling pci_dev_put(). 3. Enabling and disabling devices @@ -275,11 +273,12 @@ pci_present() of PCI subsystem when trying to talk to it. devices just return NULL. pcibios_(read|write)_* Superseded by their pci_(read|write)_* counterparts. -pcibios_find_* Superseded by their pci_find_* counterparts. -pci_for_each_dev() Superseded by pci_find_device() +pcibios_find_* Superseded by their pci_get_* counterparts. +pci_for_each_dev() Superseded by pci_get_device() pci_for_each_dev_reverse() Superseded by pci_find_device_reverse() pci_for_each_bus() Superseded by pci_find_next_bus() pci_find_device() Superseded by pci_get_device() pci_find_subsys() Superseded by pci_get_subsys() -pcibios_find_class() Superseded by pci_find_class() +pcibios_find_class() Superseded by pci_get_class() +pci_find_class() Superseded by pci_get_class() pci_(read|write)_*_nodev() Superseded by pci_bus_(read|write)_*() diff --git a/Documentation/pm.txt b/Documentation/pm.txt index 483d2a5d1..6b9aecc4c 100644 --- a/Documentation/pm.txt +++ b/Documentation/pm.txt @@ -36,8 +36,8 @@ system the associated daemon will exit gracefully. apmd: http://worldvisions.ca/~apenwarr/apmd/ acpid: http://acpid.sf.net/ -Driver Interface ----------------- +Driver Interface -- OBSOLETE, DO NOT USE! +----------------************************* If you are writing a new driver or maintaining an old driver, it should include power management support. Without power management support, a single driver may prevent a system with power management @@ -90,54 +90,6 @@ void pm_unregister(struct pm_dev *dev); */ void pm_unregister_all(pm_callback cback); -/* - * Device idle/use detection - * - * In general, drivers for all devices should call "pm_access" - * before accessing the hardware (ie. before reading or modifying - * a hardware register). Request or packet-driven drivers should - * additionally call "pm_dev_idle" when a device is not being used. - * - * Examples: - * 1) A keyboard driver would call pm_access whenever a key is pressed - * 2) A network driver would call pm_access before submitting - * a packet for transmit or receive and pm_dev_idle when its - * transfer and receive queues are empty. - * 3) A VGA driver would call pm_access before it accesses any - * of the video controller registers - * - * Ultimately, the PM policy manager uses the access and idle - * information to decide when to suspend individual devices - * or when to suspend the entire system - */ - -/* - * Description: Update device access time and wake up device, if necessary - * - * Parameters: - * dev - PM device previously returned from pm_register - * - * Details: If called from an interrupt handler pm_access updates - * access time but should never need to wake up the device - * (if device is generating interrupts, it should be awake - * already) This is important as we can not wake up - * devices from an interrupt handler. - */ -void pm_access(struct pm_dev *dev); - -/* - * Description: Identify device as currently being idle - * - * Parameters: - * dev - PM device previously returned from pm_register - * - * Details: A call to pm_dev_idle might signal to the policy manager - * to put a device to sleep. If a new device request arrives - * between the call to pm_dev_idle and the pm_callback - * callback, the driver should fail the pm_callback request. - */ -void pm_dev_idle(struct pm_dev *dev); - /* * Power management request callback * @@ -262,8 +214,8 @@ Q: Who do I contact for additional information about ACPI Development mailing list: acpi-devel@lists.sourceforge.net -System Interface ----------------- +System Interface -- OBSOLETE, DO NOT USE! +----------------************************* If you are providing new power management support to Linux (ie. adding support for something like APM or ACPI), you should communicate with drivers through the existing generic power diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 435ea29bb..2e7eccd13 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt @@ -118,6 +118,94 @@ will fail. There is currently no way to know what states a device or driver supports a priori. This will change in the future. +pm_message_t meaning + +pm_message_t has two fields. event ("major"), and flags. If driver +does not know event code, it aborts the request, returning error. Some +drivers may need to deal with special cases based on the actual type +of suspend operation being done at the system level. This is why +there are flags. + +Event codes are: + +ON -- no need to do anything except special cases like broken +HW. + +# NOTIFICATION -- pretty much same as ON? + +FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from +scratch. That probably means stop accepting upstream requests, the +actual policy of what to do with them beeing specific to a given +driver. It's acceptable for a network driver to just drop packets +while a block driver is expected to block the queue so no request is +lost. (Use IDE as an example on how to do that). FREEZE requires no +power state change, and it's expected for drivers to be able to +quickly transition back to operating state. + +SUSPEND -- like FREEZE, but also put hardware into low-power state. If +there's need to distinguish several levels of sleep, additional flag +is probably best way to do that. + +Transitions are only from a resumed state to a suspended state, never +between 2 suspended states. (ON -> FREEZE or ON -> SUSPEND can happen, +FREEZE -> SUSPEND or SUSPEND -> FREEZE can not). + +All events are: + +[NOTE NOTE NOTE: If you are driver author, you should not care; you +should only look at event, and ignore flags.] + +#Prepare for suspend -- userland is still running but we are going to +#enter suspend state. This gives drivers chance to load firmware from +#disk and store it in memory, or do other activities taht require +#operating userland, ability to kmalloc GFP_KERNEL, etc... All of these +#are forbiden once the suspend dance is started.. event = ON, flags = +#PREPARE_TO_SUSPEND + +Apm standby -- prepare for APM event. Quiesce devices to make life +easier for APM BIOS. event = FREEZE, flags = APM_STANDBY + +Apm suspend -- same as APM_STANDBY, but it we should probably avoid +spinning down disks. event = FREEZE, flags = APM_SUSPEND + +System halt, reboot -- quiesce devices to make life easier for BIOS. event += FREEZE, flags = SYSTEM_HALT or SYSTEM_REBOOT + +System shutdown -- at least disks need to be spun down, or data may be +lost. Quiesce devices, just to make life easier for BIOS. event = +FREEZE, flags = SYSTEM_SHUTDOWN + +Kexec -- turn off DMAs and put hardware into some state where new +kernel can take over. event = FREEZE, flags = KEXEC + +Powerdown at end of swsusp -- very similar to SYSTEM_SHUTDOWN, except wake +may need to be enabled on some devices. This actually has at least 3 +subtypes, system can reboot, enter S4 and enter S5 at the end of +swsusp. event = FREEZE, flags = SWSUSP and one of SYSTEM_REBOOT, +SYSTEM_SHUTDOWN, SYSTEM_S4 + +Suspend to ram -- put devices into low power state. event = SUSPEND, +flags = SUSPEND_TO_RAM + +Freeze for swsusp snapshot -- stop DMA and interrupts. No need to put +devices into low power mode, but you must be able to reinitialize +device from scratch in resume method. This has two flavors, its done +once on suspending kernel, once on resuming kernel. event = FREEZE, +flags = DURING_SUSPEND or DURING_RESUME + +Device detach requested from /sys -- deinitialize device; proably same as +SYSTEM_SHUTDOWN, I do not understand this one too much. probably event += FREEZE, flags = DEV_DETACH. + +#These are not really events sent: +# +#System fully on -- device is working normally; this is probably never +#passed to suspend() method... event = ON, flags = 0 +# +#Ready after resume -- userland is now running, again. Time to free any +#memory you ate during prepare to suspend... event = ON, flags = +#READY_AFTER_RESUME +# Driver Detach Power Management @@ -141,3 +229,91 @@ module is re-inserted during it's ->probe() (or equivalent) method. The driver core will not call any extra functions when binding the device to the driver. +pm_message_t meaning + +pm_message_t has two fields. event ("major"), and flags. If driver +does not know event code, it aborts the request, returning error. Some +drivers may need to deal with special cases based on the actual type +of suspend operation being done at the system level. This is why +there are flags. + +Event codes are: + +ON -- no need to do anything except special cases like broken +HW. + +# NOTIFICATION -- pretty much same as ON? + +FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from +scratch. That probably means stop accepting upstream requests, the +actual policy of what to do with them being specific to a given +driver. It's acceptable for a network driver to just drop packets +while a block driver is expected to block the queue so no request is +lost. (Use IDE as an example on how to do that). FREEZE requires no +power state change, and it's expected for drivers to be able to +quickly transition back to operating state. + +SUSPEND -- like FREEZE, but also put hardware into low-power state. If +there's need to distinguish several levels of sleep, additional flag +is probably best way to do that. + +Transitions are only from a resumed state to a suspended state, never +between 2 suspended states. (ON -> FREEZE or ON -> SUSPEND can happen, +FREEZE -> SUSPEND or SUSPEND -> FREEZE can not). + +All events are: + +[NOTE NOTE NOTE: If you are driver author, you should not care; you +should only look at event, and ignore flags.] + +#Prepare for suspend -- userland is still running but we are going to +#enter suspend state. This gives drivers chance to load firmware from +#disk and store it in memory, or do other activities taht require +#operating userland, ability to kmalloc GFP_KERNEL, etc... All of these +#are forbiden once the suspend dance is started.. event = ON, flags = +#PREPARE_TO_SUSPEND + +Apm standby -- prepare for APM event. Quiesce devices to make life +easier for APM BIOS. event = FREEZE, flags = APM_STANDBY + +Apm suspend -- same as APM_STANDBY, but it we should probably avoid +spinning down disks. event = FREEZE, flags = APM_SUSPEND + +System halt, reboot -- quiesce devices to make life easier for BIOS. event += FREEZE, flags = SYSTEM_HALT or SYSTEM_REBOOT + +System shutdown -- at least disks need to be spun down, or data may be +lost. Quiesce devices, just to make life easier for BIOS. event = +FREEZE, flags = SYSTEM_SHUTDOWN + +Kexec -- turn off DMAs and put hardware into some state where new +kernel can take over. event = FREEZE, flags = KEXEC + +Powerdown at end of swsusp -- very similar to SYSTEM_SHUTDOWN, except wake +may need to be enabled on some devices. This actually has at least 3 +subtypes, system can reboot, enter S4 and enter S5 at the end of +swsusp. event = FREEZE, flags = SWSUSP and one of SYSTEM_REBOOT, +SYSTEM_SHUTDOWN, SYSTEM_S4 + +Suspend to ram -- put devices into low power state. event = SUSPEND, +flags = SUSPEND_TO_RAM + +Freeze for swsusp snapshot -- stop DMA and interrupts. No need to put +devices into low power mode, but you must be able to reinitialize +device from scratch in resume method. This has two flavors, its done +once on suspending kernel, once on resuming kernel. event = FREEZE, +flags = DURING_SUSPEND or DURING_RESUME + +Device detach requested from /sys -- deinitialize device; proably same as +SYSTEM_SHUTDOWN, I do not understand this one too much. probably event += FREEZE, flags = DEV_DETACH. + +#These are not really events sent: +# +#System fully on -- device is working normally; this is probably never +#passed to suspend() method... event = ON, flags = 0 +# +#Ready after resume -- userland is now running, again. Time to free any +#memory you ate during prepare to suspend... event = ON, flags = +#READY_AFTER_RESUME +# diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index 972c7c74b..c85428e7a 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt @@ -5,6 +5,7 @@ PCI Power Management An overview of the concepts and the related functions in the Linux kernel Patrick Mochel +(and others) --------------------------------------------------------------------------- @@ -31,10 +32,15 @@ The PCI PM spec defines 4 operating states for devices (D0 - D3) and for buses the higher the number, the longer the latency is for the device to return to an operational state (D0). +There are actually two D3 states. When someone talks about D3, they usually +mean D3hot, which corresponds to an ACPI D2 state (power is reduced, the +device may lose some context). But they may also mean D3cold, which is an +ACPI D3 state (power is fully off, all state was discarded); or both. + Bus power management is not covered in this version of this document. -Note that all PCI devices support D0 and D3 by default, regardless of whether or -not they implement any of the PCI PM spec. +Note that all PCI devices support D0 and D3cold by default, regardless of +whether or not they implement any of the PCI PM spec. The possible state transitions that a device can undergo are: @@ -204,15 +210,16 @@ if (dev->driver && dev->driver->suspend) dev->driver->suspend(dev,state); A driver uses this function to actually transition the device into a low power -state. This may include disabling I/O, memory and bus-mastering, as well as -physically transitioning the device to a lower power state. +state. This should include disabling I/O, IRQs, and bus-mastering, as well as +physically transitioning the device to a lower power state; it may also include +calls to pci_enable_wake(). Bus mastering may be disabled by doing: pci_disable_device(dev); For devices that support the PCI PM Spec, this may be used to set the device's -power state: +power state to match the suspend() parameter: pci_set_power_state(dev,state); @@ -223,7 +230,7 @@ The driver should be sure to track the current state of the device, as it may obviate the need for some operations. The driver should update the current_state field in its pci_dev structure in -this function. +this function, except for PM-capable devices when pci_set_power_state is used. resume ------ @@ -237,16 +244,28 @@ The resume callback may be called from any power state, and is always meant to transition the device to the D0 state. The driver is responsible for reenabling any features of the device that had -been disabled during previous suspend calls and restoring all state that was -saved in previous save_state calls. +been disabled during previous suspend calls, such as IRQs and bus mastering, +as well as calling pci_restore_state(). + +If the device is currently in D3, it may need to be reinitialized in resume(). + + * Some types of devices, like bus controllers, will preserve context in D3hot + (using Vcc power). Their drivers will often want to avoid re-initializing + them after re-entering D0 (perhaps to avoid resetting downstream devices). + + * Other kinds of devices in D3hot will discard device context as part of a + soft reset when re-entering the D0 state. + + * Devices resuming from D3cold always go through a power-on reset. Some + device context can also be preserved using Vaux power. + + * Some systems hide D3cold resume paths from drivers. For example, on PCs + the resume path for suspend-to-disk often runs BIOS powerup code, which + will sometimes re-initialize the device. -If the device is currently in D3, it must be completely reinitialized, as it -must be assumed that the device has lost all of its context (even that of its -PCI config space). For almost all current drivers, this means that the -initialization code that the driver does at boot must be separated out and -called again from the resume callback. Note that some values for the device may -not have to be probed for this time around if they are saved before entering the -low power state. +To handle resets during D3 to D0 transitions, it may be convenient to share +device initialization code between probe() and resume(). Device parameters +can also be saved before the driver suspends into D3, avoiding re-probe. If the device supports the PCI PM Spec, it can use this to physically transition the device to D0: @@ -263,7 +282,7 @@ The driver should take note of the state that it is resuming from in order to ensure correct (and speedy) operation. The driver should update the current_state field in its pci_dev structure in -this function. +this function, except for PM-capable devices when pci_set_power_state is used. enable_wake diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index cbbbc9c07..c7c3459fd 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt @@ -15,10 +15,21 @@ From kernel/suspend.c: * If you change kernel command line between suspend and resume... * ...prepare for nasty fsck or worse. * - * (*) pm interface support is needed to make it safe. + * If you change your hardware while system is suspended... + * ...well, it was not good idea. + * + * (*) suspend/resume support is needed to make it safe. You need to append resume=/dev/your_swap_partition to kernel command -line. Then you suspend by echo 4 > /proc/acpi/sleep. +line. Then you suspend by + +echo shutdown > /sys/power/disk; echo disk > /sys/power/state + +. If you feel ACPI works pretty well on your system, you might try + +echo platform > /sys/power/disk; echo disk > /sys/power/state + + Article about goals and implementation of Software Suspend for Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -32,42 +43,24 @@ saves the state of the machine to a filesystem or to a partition and switches to standby mode. Later resuming the machine the saved state is loaded back to ram and the machine can continue its work. It has two real benefits. First we save ourselves the time machine goes down and later boots up, energy costs -real high when running from batteries. The other gain is that we don't have to +are real high when running from batteries. The other gain is that we don't have to interrupt our programs so processes that are calculating something for a long time shouldn't need to be written interruptible. -Using the code - -You have two ways to use this code. The first one is is with a patched -SysVinit (my patch is against 2.76 and available at my home page). You -might call 'swsusp' or 'shutdown -z
+
+ Registration of Device Struct + + At some point, typically after calling snd_device_new(), + you need to register the struct device of the chip + you're handling for udev and co. ALSA provides a macro for compatibility with + older kernels. Simply call like the following: + + +dev); +]]> + + + so that it stores the PCI's device pointer to the card. This will be + referred by ALSA core functions later when the devices are registered. + + + In the case of non-PCI, pass the proper device struct pointer of the BUS + instead. (In the case of legacy ISA without PnP, you don't have to do + anything.) + +
+
PCI Entries @@ -1802,8 +1850,9 @@ mychip_t *chip = snd_pcm_substream_chip(substream); snd_pcm_runtime_t *runtime = substream->runtime; - // set up the hardware with the current configuration - // for example... + /* set up the hardware with the current configuration + * for example... + */ mychip_set_sample_format(chip, runtime->format); mychip_set_sample_rate(chip, runtime->rate); mychip_set_channels(chip, runtime->channels); @@ -1836,7 +1885,7 @@ mychip_t *chip = snd_pcm_substream_chip(substream); unsigned int current_ptr; - // get the current hardware pointer + /* get the current hardware pointer */ current_ptr = mychip_get_hw_pointer(chip); return current_ptr; } @@ -2069,18 +2118,19 @@ static void mychip_pcm_free(snd_pcm_t *pcm) { mychip_t *chip = snd_pcm_chip(pcm); - // free your own data + /* free your own data */ kfree(chip->my_private_pcm_data); - // do what you like else... + // do what you like else + .... } static int __devinit snd_mychip_new_pcm(mychip_t *chip) { snd_pcm_t *pcm; .... - // allocate your own data + /* allocate your own data */ chip->my_private_pcm_data = kmalloc(...); - // set the destructor + /* set the destructor */ pcm->private_data = chip; pcm->private_free = mychip_pcm_free; .... @@ -2232,7 +2282,7 @@ struct _snd_pcm_runtime { runtime; ... - runtime->hw = snd_mychip_playback_hw; // common definition + runtime->hw = snd_mychip_playback_hw; /* common definition */ if (chip->model == VERY_OLD_ONE) runtime->hw.channels_max = 1; ]]> @@ -3031,7 +3081,7 @@ struct _snd_pcm_runtime { spin_lock(&chip->lock); .... if (pcm_irq_invoked(chip)) { - // call updater, unlock before it + /* call updater, unlock before it */ spin_unlock(&chip->lock); snd_pcm_period_elapsed(chip->substream); spin_lock(&chip->lock); @@ -3076,24 +3126,25 @@ struct _snd_pcm_runtime { .... if (pcm_irq_invoked(chip)) { unsigned int last_ptr, size; - // get the current hardware pointer (in frames) + /* get the current hardware pointer (in frames) */ last_ptr = get_hw_ptr(chip); - // calculate the processed frames since the - // last update + /* calculate the processed frames since the + * last update + */ if (last_ptr < chip->last_ptr) size = runtime->buffer_size + last_ptr - chip->last_ptr; else size = last_ptr - chip->last_ptr; - // remember the last updated point + /* remember the last updated point */ chip->last_ptr = last_ptr; - // accumulate the size + /* accumulate the size */ chip->size += size; - // over the period boundary? + /* over the period boundary? */ if (chip->size >= runtime->period_size) { - // reset the accumulator + /* reset the accumulator */ chip->size %= runtime->period_size; - // call updater + /* call updater */ spin_unlock(&chip->lock); snd_pcm_period_elapsed(substream); spin_lock(&chip->lock); @@ -3217,7 +3268,7 @@ struct _snd_pcm_runtime { snd_mask_t *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); snd_mask_t fmt; - snd_mask_any(&fmt); // Init the struct + snd_mask_any(&fmt); /* Init the struct */ if (c->min < 2) { fmt.bits[0] &= SNDRV_PCM_FMTBIT_S16_LE; return snd_mask_refine(f, &fmt); @@ -4060,8 +4111,8 @@ struct _snd_pcm_runtime { Also, there is a function to change the sample rate (of a certain register such as - AC97_PCM_FRONT_DAC_RATE) when VRA is - supported by the codec: + AC97_PCM_FRONT_DAC_RATE) when VRA or + DRA is supported by the codec: snd_ac97_set_rate(). @@ -4341,7 +4392,39 @@ struct _snd_pcm_runtime { - If this function returns successfully with 0, then create a + When the accessing to the hardware requires special method + instead of the standard I/O access, you can create opl3 instance + separately with snd_opl3_new(). + + + + + + + + + + Then set command, + private_data and + private_free for the private + access function, the private data and the destructor. + The l_port and r_port are not necessarily set. Only the + command must be set properly. You can retrieve the data + from opl3->private_data field. + + + + After creating the opl3 instance via snd_opl3_new(), + call snd_opl3_init() to initialize the chip to the + proper state. Note that snd_opl3_create() always + calls it internally. + + + + If the opl3 instance is created successfully, then create a hwdep device for this opl3. @@ -5100,7 +5183,7 @@ struct _snd_pcm_runtime { Call snd_pcm_suspend_all() to suspend the running PCM streams. Save the register values if necessary. Stop the hardware if necessary. - Set the power-state as D3hot by calling snd_power_change_state(). + Disable the PCI device by calling pci_disable_device(). @@ -5112,16 +5195,16 @@ struct _snd_pcm_runtime { pm_private_data; - // (2) + /* (2) */ snd_pcm_suspend_all(chip->pcm); - // (3) + /* (3) */ snd_mychip_save_registers(chip); - // (4) + /* (4) */ snd_mychip_stop_hardware(chip); - // (5) - snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); + /* (5) */ + pci_disable_device(chip->pci); return 0; } ]]> @@ -5141,8 +5224,6 @@ struct _snd_pcm_runtime { Resume the mixer, e.g. calling snd_ac97_resume(). Restart the hardware (if any). - Set the power-state as D0 by calling - snd_power_change_state(). @@ -5154,20 +5235,18 @@ struct _snd_pcm_runtime { pm_private_data; - // (2) + /* (2) */ pci_enable_device(chip->pci); - // (3) + /* (3) */ snd_mychip_reinit_chip(chip); - // (4) + /* (4) */ snd_mychip_restore_registers(chip); - // (5) + /* (5) */ snd_ac97_resume(chip->ac97); - // (6) + /* (6) */ snd_mychip_restart_chip(chip); - // (7) - snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } ]]> @@ -5283,19 +5362,15 @@ struct _snd_pcm_runtime { - - Here boot_devs is passed but simply ignored since we don't care - the number of parsed parameters. @@ -5392,7 +5467,10 @@ struct _snd_pcm_runtime { depends on SND select SND_PCM help - Say 'Y' or 'M' to include support for Foobar XYZ soundcard. + Say Y here to include support for Foobar XYZ soundcard. + + To compile this driver as a module, choose M here: the module + will be called snd-xyz. ]]> diff --git a/Documentation/sound/alsa/Joystick.txt b/Documentation/sound/alsa/Joystick.txt index dcc6c85e1..ccda41b10 100644 --- a/Documentation/sound/alsa/Joystick.txt +++ b/Documentation/sound/alsa/Joystick.txt @@ -49,17 +49,15 @@ The following PCI drivers support the joystick natively. cs46xx N/A N/A es1938 N/A N/A es1968 joystick 0 = disable (default), 1 = enable - intel8x0(*1)joystick 0 = disable (default), 1 = enable sonicvibes N/A N/A trident N/A N/A - via82xx(*2) joystick 0 = disable (default), 1 = enable + via82xx(*1) joystick 0 = disable (default), 1 = enable ymfpci joystick_port 0 = disable (default), 1 = auto-detect, - manual: 0x201, 0x202, 0x204, 0x205(*3) + manual: 0x201, 0x202, 0x204, 0x205(*2) --------------------------------------------------------------------------- - *1) not all chips support joystick - *2) VIA686A/B only - *3) With YMF744/754 chips, the port address can be chosen arbitrarily + *1) VIA686A/B only + *2) With YMF744/754 chips, the port address can be chosen arbitrarily The following drivers don't support gameport natively, but there are additional modules. Load the corresponding module to add the gameport diff --git a/Documentation/sound/alsa/MIXART.txt b/Documentation/sound/alsa/MIXART.txt index 3ff85969b..5cb970612 100644 --- a/Documentation/sound/alsa/MIXART.txt +++ b/Documentation/sound/alsa/MIXART.txt @@ -72,6 +72,10 @@ NOT YET IMPLEMENTED FIRMWARE ======== +[As of 2.6.11, the firmware can be loaded automatically with hotplug + when CONFIG_FW_LOADER is set. The mixartloader is necessary only + for older versions or when you build the driver into kernel.] + For loading the firmware automatically after the module is loaded, use the post-install command. For example, add the following entry to /etc/modprobe.conf for miXart driver: diff --git a/Documentation/sound/alsa/OSS-Emulation.txt b/Documentation/sound/alsa/OSS-Emulation.txt index 7ba680cf4..ec2a02541 100644 --- a/Documentation/sound/alsa/OSS-Emulation.txt +++ b/Documentation/sound/alsa/OSS-Emulation.txt @@ -164,16 +164,15 @@ sending the command above. The block and non-block options are used to change the behavior of opening the device file. -As default, ALSA behaves as defined in POSIX, i.e. blocks the file -when it's busy until the device becomes free (unless O_NONBLOCK is -specified). Some applications assume the non-block open behavior, -which are actually implemented in some real OSS drivers. + +As default, ALSA behaves as original OSS drivers, i.e. does not block +the file when it's busy. The -EBUSY error is returned in this case. This blocking behavior can be changed globally via nonblock_open -module option of snd-pcm-oss. For using the non-block mode as default +module option of snd-pcm-oss. For using the blocking mode as default for OSS devices, define like the following: - options snd-pcm-oss nonblock_open=1 + options snd-pcm-oss nonblock_open=0 The partial-frag and no-silence commands have been added recently. Both commands are for optimization use only. The former command diff --git a/Documentation/sound/oss/README.modules b/Documentation/sound/oss/README.modules index 0e6c92d61..e691d74e1 100644 --- a/Documentation/sound/oss/README.modules +++ b/Documentation/sound/oss/README.modules @@ -59,8 +59,9 @@ sound.o # The sound driver uart401.o # Used by sb, maybe other cards Whichever card you have, try feeding it the options that would be the -default if you were making the driver wired, not as modules. You can look -at the init_module() code for the card to see what args are expected. +default if you were making the driver wired, not as modules. You can +look at function referred to by module_init() for the card to see what +args are expected. Note that at present there is no way to configure the io, irq and other parameters for the modular drivers as one does for the wired drivers.. One diff --git a/Documentation/stable_api_nonsense.txt b/Documentation/stable_api_nonsense.txt index c33c99c51..3cea13875 100644 --- a/Documentation/stable_api_nonsense.txt +++ b/Documentation/stable_api_nonsense.txt @@ -9,7 +9,7 @@ realize that this article describes the _in kernel_ interfaces, not the kernel to userspace interfaces. The kernel to userspace interface is the one that application programs use, the syscall interface. That interface is _very_ stable over time, and will not break. I have old -programs that were built on a pre 0.9something kernel that still works +programs that were built on a pre 0.9something kernel that still work just fine on the latest 2.6 kernel release. This interface is the one that users and application programmers can count on being stable. @@ -167,7 +167,7 @@ up by the person who did the kernel change in the first place. This ensures that your driver is always buildable, and works over time, with very little effort on your part. -The very good side affects of having your driver in the main kernel tree +The very good side effects of having your driver in the main kernel tree are: - The quality of the driver will rise as the maintenance costs (to the original developer) will decrease. diff --git a/Documentation/stallion.txt b/Documentation/stallion.txt index 084d485b1..5c4902d9a 100644 --- a/Documentation/stallion.txt +++ b/Documentation/stallion.txt @@ -1,8 +1,13 @@ +* NOTE - This is an unmaintained driver. Lantronix, which bought Stallion +technologies, is not active in driver maintenance, and they have no information +on when or if they will have a 2.6 driver. + +James Nelson - 12-12-2004 Stallion Multiport Serial Driver Readme --------------------------------------- -Copyright (C) 1994-1999, Stallion Technologies (support@stallion.com). +Copyright (C) 1994-1999, Stallion Technologies. Version: 5.5.1 Date: 28MAR99 @@ -19,29 +24,20 @@ the true Stallion intelligent multiport boards - EasyConnection 8/64 If you are using any of the Stallion intelligent multiport boards (Brumby, ONboard, EasyConnection 8/64 (ISA, EISA, MCA), EasyConnection/RA-PCI) with -Linux you will need to get the driver utility package. This package is -available at most of the Linux archive sites (and on CD-ROMs that contain -these archives). The file will be called stallion-X.X.X.tar.gz where X.X.X -will be the version number. In particular this package contains the board -embedded executable images that are required for these boards. It also -contains the downloader program. These boards cannot be used without this. +Linux you will need to get the driver utility package. This contains a +firmware loader and the firmware images necessary to make the devices operate. The Stallion Technologies ftp site, ftp.stallion.com, will always have -the latest version of the driver utility package. Other sites that usually -have the latest version are tsx-11.mit.edu, sunsite.unc.edu and their -mirrors. +the latest version of the driver utility package. -ftp.stallion.com:/drivers/ata5/Linux/v550.tar.gz -tsx-11.mit.edu:/pub/linux/packages/stallion/stallion-5.5.0.tar.gz -sunsite.unc.edu:/pub/Linux/kernel/patches/serial/stallion-5.5.0.tar.gz +ftp://ftp.stallion.com/drivers/ata5/Linux/ata-linux-550.tar.gz As of the printing of this document the latest version of the driver utility package is 5.5.0. If a later version is now available then you should use the latest version. If you are using the EasyIO, EasyConnection 8/32 or EasyConnection 8/64-PCI -boards then you don't need this package. Although it does have a handy -script to create the /dev device nodes for these boards, and a serial stats +boards then you don't need this package, although it does have a serial stats display program. If you require DIP switch settings, EISA or MCA configuration files, or any @@ -85,7 +81,7 @@ Brumby or original Stallion board then use the "istallion" driver module. Typically to load up the smart board driver use: - insmod stallion.o + modprobe stallion This will load the EasyIO and EasyConnection 8/32 driver. It will output a message to say that it loaded and print the driver version number. It will @@ -96,12 +92,12 @@ syslogd daemons are setup on your system. To load the intelligent board driver use: - insmod istallion.o + modprobe istallion It will output similar messages to the smart board driver. If not using an auto-detectable board type (that is a PCI board) then you -will also need to supply command line arguments to the "insmod" command +will also need to supply command line arguments to the modprobe command when loading the driver. The general form of the configuration argument is board?=[,[,][,]] @@ -111,7 +107,7 @@ where: board? -- specifies the arbitrary board number of this board, can be in the range 0 to 3. - name -- textual name of this board. The board name is the comman + name -- textual name of this board. The board name is the common board name, or any "shortened" version of that. The board type number may also be used here. @@ -127,24 +123,24 @@ where: Up to 4 board configuration arguments can be specified on the load line. Here is some examples: - insmod stallion.o board0=easyio,0x2a0,5 + modprobe stallion board0=easyio,0x2a0,5 This configures an EasyIO board as board 0 at I/O address 0x2a0 and IRQ 5. - insmod istallion.o board3=ec8/64,0x2c0,0xcc000 + modprobe istallion board3=ec8/64,0x2c0,0xcc000 This configures an EasyConnection 8/64 ISA as board 3 at I/O address 0x2c0 at memory address 0xcc000. - insmod stallion.o board1=ec8/32-at,0x2a0,0x280,10 + modprobe stallion board1=ec8/32-at,0x2a0,0x280,10 This configures an EasyConnection 8/32 ISA board at primary I/O address 0x2a0, secondary address 0x280 and IRQ 10. You will probably want to enter this module load and configuration information into your system startup scripts so that the drivers are loaded and configured -on each system boot. Typically the start up script would be something line -/etc/rc.d/rc.modules. +on each system boot. Typically the start up script would be something like +/etc/modprobe.conf. 2.2 STATIC DRIVER CONFIGURATION: @@ -161,8 +157,8 @@ supports any combination of ONboards, Brumbys, Stallions and EasyConnection To set up the driver(s) for the boards that you want to use you need to edit the appropriate driver file and add configuration entries. -If using EasyIO or EasyConnection 8/32 ISA or MCA boards, do: - vi /usr/src/linux/drivers/char/stallion.c +If using EasyIO or EasyConnection 8/32 ISA or MCA boards, + In drivers/char/stallion.c: - find the definition of the stl_brdconf array (of structures) near the top of the file - modify this to match the boards you are going to install @@ -170,8 +166,8 @@ If using EasyIO or EasyConnection 8/32 ISA or MCA boards, do: - save and exit If using ONboard, Brumby, Stallion or EasyConnection 8/64 (ISA or EISA) -boards then do: - vi /usr/src/linux/drivers/char/istallion.c +boards, + In drivers/char/istallion.c: - find the definition of the stli_brdconf array (of structures) near the top of the file - modify this to match the boards you are going to install @@ -291,20 +287,20 @@ If you load the wrong image file into a board it will fail to start up, and of course the ports will not be operational! If you are using the modularized version of the driver you might want to put -the insmod calls in the startup script as well (before the download lines +the modprobe calls in the startup script as well (before the download lines obviously). 3.2 USING THE SERIAL PORTS Once the driver is installed you will need to setup some device nodes to -access the serial ports. The simplest method is to use the stallion utility -"mkdevnods" script. It will automatically create device entries for Stallion -boards. This will create the normal serial port devices as /dev/ttyE# where -# is the port number starting from 0. A bank of 64 minor device numbers is -allocated to each board, so the first port on the second board is port 64, -etc. A set of callout type devices is also created. They are created as the -devices /dev/cue# where # is the same as for the ttyE devices. +access the serial ports. The simplest method is to use the /dev/MAKEDEV program. +It will automatically create device entries for Stallion boards. This will +create the normal serial port devices as /dev/ttyE# where# is the port number +starting from 0. A bank of 64 minor device numbers is allocated to each board, +so the first port on the second board is port 64,etc. A set of callout type +devices may also be created. They are created as the devices /dev/cue# where # +is the same as for the ttyE devices. For the most part the Stallion driver tries to emulate the standard PC system COM ports and the standard Linux serial driver. The idea is that you should diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 57c6fbc84..2f1aae32a 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt @@ -31,7 +31,7 @@ Currently, these files are in /proc/sys/vm: dirty_ratio, dirty_background_ratio, dirty_expire_centisecs, dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode, -block_dump: +block_dump, swap_token_timeout: See Documentation/filesystems/proc.txt diff --git a/Documentation/time_interpolators.txt b/Documentation/time_interpolators.txt index d9fefd5f4..e3b60854f 100644 --- a/Documentation/time_interpolators.txt +++ b/Documentation/time_interpolators.txt @@ -9,32 +9,33 @@ The architecture specific code typically provides gettimeofday and settimeofday under Linux. The time interpolator provides both if an arch defines CONFIG_TIME_INTERPOLATION. The arch still must set up timer tick operations and call the necessary functions to advance the clock. + With the time interpolator a standardized interface exists for time -interpolation between ticks which also allows the determination -of time in a hardware independent way. The provided logic is highly scalable +interpolation between ticks. The provided logic is highly scalable and has been tested in SMP situations of up to 512 CPUs. If CONFIG_TIME_INTERPOLATION is defined then the architecture specific code -(or the device drivers - like HPET) must register time interpolators. +(or the device drivers - like HPET) may register time interpolators. These are typically defined in the following way: -static struct time_interpolator my_interpolator; +static struct time_interpolator my_interpolator { + .frequency = MY_FREQUENCY, + .source = TIME_SOURCE_MMIO32, + .shift = 8, /* scaling for higher accuracy */ + .drift = -1, /* Unknown drift */ + .jitter = 0 /* time source is stable */ +}; void time_init(void) { .... /* Initialization of the timer *. - my_interpolator.frequency = MY_FREQUENCY; - my_interpolator.source = TIME_SOURCE_MMIO32; my_interpolator.address = &my_timer; - my_interpolator.shift = 32; /* increase accuracy of scaling */ - my_interpolator.drift = -1; /* Unknown */ - my_interpolator.jitter = 0; /* A stable time source */ register_time_interpolator(&my_interpolator); .... } -For more details see include/linux/timex.h. +For more details see include/linux/timex.h and kernel/timer.c. -Christoph Lameter , September 8, 2004 +Christoph Lameter , October 31, 2004 diff --git a/Documentation/tipar.txt b/Documentation/tipar.txt index 773b9a248..67133baef 100644 --- a/Documentation/tipar.txt +++ b/Documentation/tipar.txt @@ -4,7 +4,7 @@ Author: Romain Lievin -Homepage: http://lpg.ticalc.org/prj_dev +Homepage: http://lpg.ticalc.org/prj_tidev/index.html INTRODUCTION: @@ -12,31 +12,30 @@ INTRODUCTION: This is a driver for the very common home-made parallel link cable, a cable designed for connecting TI8x/9x graphing calculators (handhelds) to a computer or workstation (Alpha, Sparc). Given that driver is built on parport, the -parallel port abstraction layer, this driver is independent of the platform. +parallel port abstraction layer, this driver is architecture-independent. It can also be used with another device plugged on the same port (such as a -ZIP drive). I have a 100MB ZIP and both of them work fine ! +ZIP drive). I have a 100MB ZIP and both of them work fine! If you need more information, please visit the 'TI drivers' homepage at the URL above. WHAT YOU NEED: -A TI calculator of course and a program capable to communicate with your -calculator. -TiLP will work for sure (since I am his developer !). yal92 may be able to use +A TI calculator and a program capable of communicating with your calculator. + +TiLP will work for sure (since I am its developer!). yal92 may be able to use it by changing tidev for tipar (may require some hacking...). HOW TO USE IT: You must have first compiled parport support (CONFIG_PARPORT_DEV): either compiled in your kernel, either as a module. -This driver supports the new device hierarchy (devfs). -Next, (as root) from your appropriate modules directory (lib/modules/2.5.XX): +Next, (as root): modprobe parport - insmod tipar.o + modprobe tipar If it is not already there (it usually is), create the device: @@ -47,14 +46,14 @@ If it is not already there (it usually is), create the device: You will have to set permissions on this device to allow you to read/write from it: - chmod 666 /dev/tipar? + chmod 666 /dev/tipar[0..2] Now you are ready to run a linking program such as TiLP. Be sure to configure it properly (RTFM). MODULE PARAMETERS: - You can set these with: insmod tipar NAME=VALUE + You can set these with: modprobe tipar NAME=VALUE There is currently no way to set these on a per-cable basis. NAME: timeout @@ -66,11 +65,12 @@ MODULE PARAMETERS: NAME: delay TYPE: integer DEFAULT: 10 - DESC: Inter-bit delay in micro-seconds. An lower value gives an higher data + DESC: Inter-bit delay in micro-seconds. A lower value gives an higher data rate but makes transmission less reliable. These parameters can be changed at run time by any program via ioctl(2) calls -as listed in ./include/linux/ticable.h +as listed in ./include/linux/ticable.h. + Rather than write 50 pages describing the ioctl() and so on, it is perhaps more useful you look at ticables library (dev_link.c) that demonstrates how to use them, and demonstrates the features of the driver. This is diff --git a/Documentation/tty.txt b/Documentation/tty.txt index a49605642..5f6dc1267 100644 --- a/Documentation/tty.txt +++ b/Documentation/tty.txt @@ -49,10 +49,9 @@ open() - Called when the line discipline is attached to discipline for this tty will occur until it completes successfully. Can sleep. -write() - A process is writing data from user space - through the line discipline. Multiple write calls - are serialized by the tty layer for the ldisc. May - sleep. +write() - A process is writing data through the line + discipline. Multiple write calls are serialized + by the tty layer for the ldisc. May sleep. flush_buffer() - May be called at any point between open and close. diff --git a/Documentation/unicode.txt b/Documentation/unicode.txt index 61242c097..4a33f81ca 100644 --- a/Documentation/unicode.txt +++ b/Documentation/unicode.txt @@ -1,3 +1,13 @@ + Last update: 2005-01-17, version 1.4 + +This file is maintained by H. Peter Anvin as part +of the Linux Assigned Names And Numbers Authority (LANANA) project. +The current version can be found at: + + http://www.lanana.org/docs/unicode/unicode.txt + + ------------------------ + The Linux kernel code has been rewritten to use Unicode to map characters to fonts. By downloading a single Unicode-to-font table, both the eight-bit character sets and UTF-8 mode are changed to use @@ -18,6 +28,10 @@ might be completely different than the IBM character set. This permits for example the use of block graphics even with a Latin-1 font loaded. +Note that although these codes are similar to ISO 2022, neither the +codes nor their uses match ISO 2022; Linux has two 8-bit codes (G0 and +G1), whereas ISO 2022 has four 7-bit codes (G0-G3). + In accordance with the Unicode standard/ISO 10646 the range U+F000 to U+F8FF has been reserved for OS-wide allocation (the Unicode Standard refers to this as a "Corporate Zone", since this is inaccurate for @@ -26,18 +40,20 @@ point since it lets the direct-mapping area start on a large power of two (in case 1024- or 2048-character fonts ever become necessary). This leaves U+E000 to U+EFFF as End User Zone. -The Unicodes in the range U+F000 to U+F1FF have been hard-coded to map -directly to the loaded font, bypassing the translation table. The -user-defined map now defaults to U+F000 to U+F1FF, emulating the -previous behaviour. This range may expand in the future should it be -warranted. +[v1.2]: The Unicodes range from U+F000 and up to U+F7FF have been +hard-coded to map directly to the loaded font, bypassing the +translation table. The user-defined map now defaults to U+F000 to +U+F0FF, emulating the previous behaviour. In practice, this range +might be shorter; for example, vgacon can only handle 256-character +(U+F000..U+F0FF) or 512-character (U+F000..U+F1FF) fonts. + Actual characters assigned in the Linux Zone -------------------------------------------- -In addition, the following characters not present in Unicode 1.1.4 (at -least, I have not found them!) have been defined; these are used by -the DEC VT graphics map: +In addition, the following characters not present in Unicode 1.1.4 +have been defined; these are used by the DEC VT graphics map. [v1.2] +THIS USE IS OBSOLETE AND SHOULD NO LONGER BE USED; PLEASE SEE BELOW. U+F800 DEC VT GRAPHICS HORIZONTAL LINE SCAN 1 U+F801 DEC VT GRAPHICS HORIZONTAL LINE SCAN 3 @@ -48,31 +64,30 @@ The DEC VT220 uses a 6x10 character matrix, and these characters form a smooth progression in the DEC VT graphics character set. I have omitted the scan 5 line, since it is also used as a block-graphics character, and hence has been coded as U+2500 FORMS LIGHT HORIZONTAL. -However, I left U+F802 blank should the need arise. -Klingon language support ------------------------- +[v1.3]: These characters have been officially added to Unicode 3.2.0; +they are added at U+23BA, U+23BB, U+23BC, U+23BD. Linux now uses the +new values. -Unfortunately, Unicode/ISO 10646 does not allocate code points for the -language Klingon, probably fearing the potential code point explosion -if many fictional languages were submitted for inclusion. There are -also political reasons (the Japanese, for example, are not too happy -about the whole 16-bit concept to begin with.) However, with Linux -being a hacker-driven OS it seems this is a brilliant linguistic hack -worth supporting. Hence I have chosen to add it to the list in the -Linux Zone. +[v1.2]: The following characters have been added to represent common +keyboard symbols that are unlikely to ever be added to Unicode proper +since they are horribly vendor-specific. This, of course, is an +excellent example of horrible design. -Several glyph forms for the Klingon alphabet have been proposed. -However, since the set of symbols appear to be consistent throughout, -with only the actual shapes being different, in keeping with standard -Unicode practice these differences are considered font variants. +U+F810 KEYBOARD SYMBOL FLYING FLAG +U+F811 KEYBOARD SYMBOL PULLDOWN MENU +U+F812 KEYBOARD SYMBOL OPEN APPLE +U+F813 KEYBOARD SYMBOL SOLID APPLE -Klingon has an alphabet of 26 characters, a positional numeric writing -system with 10 digits, and is written left-to-right, top-to-bottom. -Punctuation appears to be only used in Latin transliteration; it -appears customary to write each sentence on its own line, and -centered. Space has been reserved for punctuation should it prove -necessary. +Klingon language support +------------------------ + +In 1996, Linux was the first operating system in the world to add +support for the artificial language Klingon, created by Marc Okrand +for the "Star Trek" television series. This encoding was later +adopted by the ConScript Unicode Registry and proposed (but ultimately +rejected) for inclusion in Unicode Plane 1. Thus, it remains as a +Linux/CSUR private assignment in the Linux Zone. This encoding has been endorsed by the Klingon Language Institute. For more information, contact them at: @@ -84,6 +99,19 @@ of the dingbats/symbols/forms type and this is a language, I have located it at the end, on a 16-cell boundary in keeping with standard Unicode practice. +NOTE: This range is now officially managed by the ConScript Unicode +Registry. The normative reference is at: + + http://www.evertype.com/standards/csur/klingon.html + +Klingon has an alphabet of 26 characters, a positional numeric writing +system with 10 digits, and is written left-to-right, top-to-bottom. + +Several glyph forms for the Klingon alphabet have been proposed. +However, since the set of symbols appear to be consistent throughout, +with only the actual shapes being different, in keeping with standard +Unicode practice these differences are considered font variants. + U+F8D0 KLINGON LETTER A U+F8D1 KLINGON LETTER B U+F8D2 KLINGON LETTER CH @@ -124,16 +152,24 @@ U+F8F7 KLINGON DIGIT SEVEN U+F8F8 KLINGON DIGIT EIGHT U+F8F9 KLINGON DIGIT NINE +U+F8FD KLINGON COMMA +U+F8FE KLINGON FULL STOP +U+F8FF KLINGON SYMBOL FOR EMPIRE + Other Fictional and Artificial Scripts -------------------------------------- Since the assignment of the Klingon Linux Unicode block, a registry of -fictional and artificial scripts has been established by John Cowan, -. The ConScript Unicode Registry is accessible at -http://locke.ccil.org/~cowan/csur/; the ranges used fall at the bottom -of the End User Zone and can hence not be normatively assigned, but it -is recommended that people who wish to encode fictional scripts use -these codes, in the interest of interoperability. For Klingon, CSUR -has adopted the Linux encoding. - - H. Peter Anvin +fictional and artificial scripts has been established by John Cowan + and Michael Everson . +The ConScript Unicode Registry is accessible at: + + http://www.evertype.com/standards/csur/ + +The ranges used fall at the low end of the End User Zone and can hence +not be normatively assigned, but it is recommended that people who +wish to encode fictional scripts use these codes, in the interest of +interoperability. For Klingon, CSUR has adopted the Linux encoding. +The CSUR people are driving adding Tengwar and Cirth into Unicode +Plane 1; the addition of Klingon to Unicode Plane 1 has been rejected +and so the above encoding remains official. diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt index 64ade120d..9e41284f7 100644 --- a/Documentation/usb/error-codes.txt +++ b/Documentation/usb/error-codes.txt @@ -1,11 +1,12 @@ -Revised: 2002-Feb-09. +Revised: 2004-Oct-21 This is the documentation of (hopefully) all possible error codes (and their interpretation) that can be returned from usbcore. Some of them are returned by the Host Controller Drivers (HCDs), which device drivers only see through usbcore. As a rule, all the HCDs should -behave the same except for transfer speed dependent behaviors. +behave the same except for transfer speed dependent behaviors and the +way certain faults are reported. ************************************************************************** @@ -26,29 +27,35 @@ USB-specific: of urb. (treat as a host controller bug.) -EINVAL a) Invalid transfer type specified (or not supported) - b) Invalid interrupt interval (0<=n<256) - c) more than one interrupt packet requested + b) Invalid or unsupported periodic transfer interval + c) ISO: attempted to change transfer interval d) ISO: number_of_packets is < 0 + e) various other cases -EAGAIN a) specified ISO start frame too early b) (using ISO-ASAP) too much scheduled for the future wait some time and try again. --EFBIG too much ISO frames requested (currently uhci>900) +-EFBIG Host controller driver can't schedule that many ISO frames. -EPIPE Specified endpoint is stalled. For non-control endpoints, reset this status with usb_clear_halt(). --EMSGSIZE endpoint message size is zero, do interface/alternate setting +-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable + in the current interface altsetting. + (b) ISO packet is biger than endpoint maxpacket + (c) requested data transfer size is invalid (negative) --ENOSPC The host controller's bandwidth is already consumed and - this request would push it past its allowed limit. +-ENOSPC This request would overcommit the usb bandwidth reserved + for periodic transfers (interrupt, isochronous). --ESHUTDOWN The host controller has been disabled due to some +-ESHUTDOWN The device or host controller has been disabled due to some problem that could not be worked around. -EPERM Submission failed because urb->reject was set. +-EHOSTUNREACH URB was rejected because the device is suspended. + ************************************************************************** * Error codes returned by in urb->status * @@ -71,14 +78,25 @@ one or more packets could finish before an error stops further endpoint I/O. -EINPROGRESS URB still pending, no results yet (That is, if drivers see this it's a bug.) --EPROTO (*) a) bitstuff error +-EPROTO (*, **) a) bitstuff error b) no response packet received within the prescribed bus turn-around time c) unknown USB error --EILSEQ (*) CRC mismatch +-EILSEQ (*, **) a) CRC mismatch + b) no response packet received within the + prescribed bus turn-around time + c) unknown USB error --EPIPE Endpoint stalled. For non-control endpoints, + In cases b) and c) either -EPROTO or -EILSEQ + may be returned. Note that often the controller + hardware does not distinguish among cases a), + b), and c), so a driver cannot tell whether + there was a protocol error, a failure to respond + (often caused by device disconnect), or some + other fault. + +-EPIPE (**) Endpoint stalled. For non-control endpoints, reset this status with usb_clear_halt(). -ECOMM During an IN transfer, the host controller @@ -97,8 +115,6 @@ one or more packets could finish before an error stops further endpoint I/O. specified buffer, and URB_SHORT_NOT_OK was set in urb->transfer_flags. --ETIMEDOUT transfer timed out, NAK - -ENODEV Device was removed. Often preceded by a burst of other errors, since the hub driver does't detect device removal events immediately. @@ -110,13 +126,19 @@ one or more packets could finish before an error stops further endpoint I/O. -ECONNRESET URB was asynchronously unlinked by usb_unlink_urb --ESHUTDOWN The host controller has been disabled due to some - problem that could not be worked around. +-ESHUTDOWN The device or host controller has been disabled due + to some problem that could not be worked around, + such as a physical disconnect. (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate hardware problems such as bad devices (including firmware) or cables. +(**) This is also one of several codes that different kinds of host +controller use to to indicate a transfer has failed because of device +disconnect. In the interval before the hub driver starts disconnect +processing, devices may receive such fault reports for every request. + ************************************************************************** @@ -130,4 +152,4 @@ usb_register(): usb_get_*/usb_set_*(): usb_control_msg(): usb_bulk_msg(): - All USB errors (submit/status) can occur +-ETIMEDOUT timeout expired before the transfer completed diff --git a/Documentation/usb/sn9c102.txt b/Documentation/usb/sn9c102.txt index 3999069b9..f6911442b 100644 --- a/Documentation/usb/sn9c102.txt +++ b/Documentation/usb/sn9c102.txt @@ -1,7 +1,7 @@ - SN9C10[12] PC Camera Controllers + SN9C10x PC Camera Controllers Driver for Linux - ================================ + ============================= - Documentation - @@ -9,28 +9,33 @@ Index ===== 1. Copyright -2. License -3. Overview -4. Module dependencies -5. Module loading -6. Module parameters -7. Optional device control through "sysfs" -8. Supported devices -9. How to add support for new image sensors -10. Notes for V4L2 application developers -11. Contact information -12. Credits +2. Disclaimer +3. License +4. Overview and features +5. Module dependencies +6. Module loading +7. Module parameters +8. Optional device control through "sysfs" +9. Supported devices +10. How to add plug-in's for new image sensors +11. Notes for V4L2 application developers +12. Video frame formats +13. Contact information +14. Credits 1. Copyright ============ -Copyright (C) 2004 by Luca Risolia +Copyright (C) 2004-2005 by Luca Risolia + +2. Disclaimer +============= SONiX is a trademark of SONiX Technology Company Limited, inc. -This driver is not sponsored or developed by SONiX. +This software is not sponsored or developed by SONiX. -2. License +3. License ========== 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 @@ -47,28 +52,55 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -3. Overview -=========== -This driver attempts to support the video streaming capabilities of the devices -mounting the SONiX SN9C101 or SONiX SN9C102 PC Camera Controllers. +4. Overview and features +======================== +This driver attempts to support the video and audio streaming capabilities of +the devices mounting the SONiX SN9C101, SN9C102 and SN9C103 PC Camera +Controllers. -- It's worth to note that SONiX has never collaborated with me during the -development of this project, despite of several requests for enough detailed +It's worth to note that SONiX has never collaborated with the author during the +development of this project, despite several requests for enough detailed specifications of the register tables, compression engine and video data format -of the above chips - - -Up to 64 cameras can be handled at the same time. They can be connected and -disconnected from the host many times without turning off the computer, if -your system supports the hotplug facility. +of the above chips. Nevertheless, these informations are no longer necessary, +becouse all the aspects related to these chips are known and have been +described in detail in this documentation. The driver relies on the Video4Linux2 and USB core modules. It has been designed to run properly on SMP systems as well. -The latest version of the SN9C10[12] driver can be found at the following URL: -http://go.lamarinapunto.com/ - - -4. Module dependencies +The latest version of the SN9C10x driver can be found at the following URL: +http://www.linux-projects.org/ + +Some of the features of the driver are: + +- full compliance with the Video4Linux2 API (see also "Notes for V4L2 + application developers" paragraph); +- available mmap or read/poll methods for video streaming through isochronous + data transfers; +- automatic detection of image sensor; +- support for any window resolutions and optional panning within the maximum + pixel area of image sensor; +- image downscaling with arbitrary scaling factors from 1, 2 and 4 in both + directions (see "Notes for V4L2 application developers" paragraph); +- two different video formats for uncompressed or compressed data in low or + high compression quality (see also "Notes for V4L2 application developers" + and "Video frame formats" paragraphs); +- full support for the capabilities of many of the possible image sensors that + can be connected to the SN9C10x bridges, including, for istance, red, green, + blue and global gain adjustments and exposure (see "Supported devices" + paragraph for details); +- use of default color settings for sunlight conditions; +- dynamic I/O interface for both SN9C10x and image sensor control and + monitoring (see "Optional device control through 'sysfs'" paragraph); +- dynamic driver control thanks to various module parameters (see "Module + parameters" paragraph); +- up to 64 cameras can be handled at the same time; they can be connected and + disconnected from the host many times without turning off the computer, if + your system supports hotplugging; +- no known bugs. + + +5. Module dependencies ====================== For it to work properly, the driver needs kernel support for Video4Linux and USB. @@ -100,7 +132,7 @@ And finally: CONFIG_USB_SN9C102=m -5. Module loading +6. Module loading ================= To use the driver, it is necessary to load the "sn9c102" module into memory after every other module required: "videodev", "usbcore" and, depending on @@ -108,7 +140,6 @@ the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". Loading can be done as shown below: - [root@localhost home]# modprobe usbcore [root@localhost home]# modprobe sn9c102 At this point the devices should be recognized. You can invoke "dmesg" to @@ -117,23 +148,34 @@ analyze kernel messages and verify that the loading process has gone well: [user@localhost home]$ dmesg -6. Module parameters +7. Module parameters ==================== Module parameters are listed below: ------------------------------------------------------------------------------- Name: video_nr -Type: int array (min = 0, max = 32) +Type: int array (min = 0, max = 64) Syntax: <-1|n[,...]> Description: Specify V4L2 minor mode number: -1 = use next available n = use minor number n - You can specify up to 32 cameras this way. + You can specify up to 64 cameras this way. For example: video_nr=-1,2,-1 would assign minor number 2 to the second recognized camera and use auto for the first one and for every other camera. Default: -1 ------------------------------------------------------------------------------- +Name: force_munmap; +Type: bool array (min = 0, max = 64) +Syntax: <0|1[,...]> +Description: Force the application to unmap previously mapped buffer memory + before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not + all the applications support this feature. This parameter is + specific for each detected camera. + 0 = do not force memory unmapping" + 1 = force memory unmapping (save memory)" +Default: 0 +------------------------------------------------------------------------------- Name: debug Type: int Syntax: @@ -143,106 +185,186 @@ Description: Debugging information level, from 0 to 3: 2 = significant informations 3 = more verbose messages Level 3 is useful for testing only, when only one device - is used. + is used. It also shows some more informations about the + hardware being detected. This parameter can be changed at + runtime thanks to the /sys filesystem. Default: 2 ------------------------------------------------------------------------------- -7. Optional device control through "sysfs" +8. Optional device control through "sysfs" [1] ========================================== -It is possible to read and write both the SN9C10[12] and the image sensor +It is possible to read and write both the SN9C10x and the image sensor registers by using the "sysfs" filesystem interface. -Every time a supported device is recognized, a read-only file named "green" is +Every time a supported device is recognized, a write-only file named "green" is created in the /sys/class/video4linux/videoX directory. You can set the green channel's gain by writing the desired value to it. The value may range from 0 -to 15. +to 15 for SN9C101 or SN9C102 bridges, from 0 to 127 for SN9C103 bridges. +Similarly, only for SN9C103 controllers, blue and red gain control files are +available in the same directory, for which accepted values may range from 0 to +127. There are other four entries in the directory above for each registered camera: "reg", "val", "i2c_reg" and "i2c_val". The first two files control the -SN9C10[12] bridge, while the other two control the sensor chip. "reg" and +SN9C10x bridge, while the other two control the sensor chip. "reg" and "i2c_reg" hold the values of the current register index where the following reading/writing operations are addressed at through "val" and "i2c_val". Their -use is not intended for end-users, unless you know what you are doing. Note -that "i2c_reg" and "i2c_val" won't be created if the sensor does not actually -support the standard I2C protocol. Also, remember that you must be logged in as +use is not intended for end-users. Note that "i2c_reg" and "i2c_val" won't be +created if the sensor does not actually support the standard I2C protocol or +its registers are not 8-bit long. Also, remember that you must be logged in as root before writing to them. As an example, suppose we were to want to read the value contained in the -register number 1 of the sensor register table - which usually is the product +register number 1 of the sensor register table - which is usually the product identifier - of the camera registered as "/dev/video0": [root@localhost #] cd /sys/class/video4linux/video0 [root@localhost #] echo 1 > i2c_reg [root@localhost #] cat i2c_val -Now let's set the green gain's register of the SN9C10[12] chip to 2: +Note that "cat" will fail if sensor registers cannot be read. + +Now let's set the green gain's register of the SN9C101 or SN9C102 chips to 2: [root@localhost #] echo 0x11 > reg [root@localhost #] echo 2 > val -Note that the SN9C10[12] always returns 0 when some of its registers are read. -To avoid race conditions, all the I/O accesses to the files are serialized. - - -8. Supported devices +Note that the SN9C10x always returns 0 when some of its registers are read. +To avoid race conditions, all the I/O accesses to the above files are +serialized. + +The sysfs interface also provides the "frame_header" entry, which exports the +frame header of the most recent requested and captured video frame. The header +is 12-bytes long and is appended to every video frame by the SN9C10x +controllers. As an example, this additional information can be used by the user +application for implementing auto-exposure features via software. + +The following table describes the frame header: + +Byte # Value Description +------ ----- ----------- +0x00 0xFF Frame synchronisation pattern. +0x01 0xFF Frame synchronisation pattern. +0x02 0x00 Frame synchronisation pattern. +0x03 0xC4 Frame synchronisation pattern. +0x04 0xC4 Frame synchronisation pattern. +0x05 0x96 Frame synchronisation pattern. +0x06 0x00 or 0x01 Unknown meaning. The exact value depends on the chip. +0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a + frame counter, u is unknown, zz is a size indicator + (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for + "compression enabled" (1 = yes, 0 = no). +0x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). +0x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). + For a pure white image, this number will be equal to 500 + times the area of the specified AE area. For images + that are not pure white, the value scales down according + to relative whiteness. +0x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). +0x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). + For a pure white image, this number will be equal to 125 + times the area outside of the specified AE area. For + images that are not pure white, the value scales down + according to relative whiteness. + +The AE area (sx, sy, ex, ey) in the active window can be set by programming the +registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit +corresponds to 32 pixels. + +[1] The frame header has been documented by Bertrik Sikken. + + +9. Supported devices ==================== -- I won't mention any of the names of the companies as well as their products -here. They have never collaborated with me, so no advertising - +None of the names of the companies as well as their products will be mentioned +here. They have never collaborated with the author, so no advertising. From the point of view of a driver, what unambiguously identify a device are its vendor and product USB identifiers. Below is a list of known identifiers of -devices mounting the SN9C10[12] PC camera controllers: +devices mounting the SN9C10x PC camera controllers: Vendor ID Product ID --------- ---------- -0xc45 0x6001 -0xc45 0x6005 -0xc45 0x6009 -0xc45 0x600d -0xc45 0x6024 -0xc45 0x6025 -0xc45 0x6028 -0xc45 0x6029 -0xc45 0x602a -0xc45 0x602c -0xc45 0x6030 - -The list above does NOT imply that all those devices work with this driver: up -until now only the ones that mount the following image sensors are supported. -Kernel messages will always tell you whether this is the case: +0x0c45 0x6001 +0x0c45 0x6005 +0x0c45 0x6009 +0x0c45 0x600d +0x0c45 0x6024 +0x0c45 0x6025 +0x0c45 0x6028 +0x0c45 0x6029 +0x0c45 0x602a +0x0c45 0x602b +0x0c45 0x602c +0x0c45 0x6030 +0x0c45 0x6080 +0x0c45 0x6082 +0x0c45 0x6083 +0x0c45 0x6088 +0x0c45 0x608a +0x0c45 0x608b +0x0c45 0x608c +0x0c45 0x608e +0x0c45 0x608f +0x0c45 0x60a0 +0x0c45 0x60a2 +0x0c45 0x60a3 +0x0c45 0x60a8 +0x0c45 0x60aa +0x0c45 0x60ab +0x0c45 0x60ac +0x0c45 0x60ae +0x0c45 0x60af +0x0c45 0x60b0 +0x0c45 0x60b2 +0x0c45 0x60b3 +0x0c45 0x60b8 +0x0c45 0x60ba +0x0c45 0x60bb +0x0c45 0x60bc +0x0c45 0x60be + +The list above does not imply that all those devices work with this driver: up +until now only the ones that mount the following image sensors are supported; +kernel messages will always tell you whether this is the case: Model Manufacturer ----- ------------ -PAS106B PixArt Imaging Inc. -PAS202BCB PixArt Imaging Inc. +HV7131D Hynix Semiconductor, Inc. +MI-0343 Micron Technology, Inc. +PAS106B PixArt Imaging, Inc. +PAS202BCB PixArt Imaging, Inc. TAS5110C1B Taiwan Advanced Sensor Corporation TAS5130D1B Taiwan Advanced Sensor Corporation +All the available control settings of each image sensor are supported through +the V4L2 interface. + If you think your camera is based on the above hardware and is not actually listed in the above table, you may try to add the specific USB VendorID and ProductID identifiers to the sn9c102_id_table[] in the file "sn9c102_sensor.h"; then compile, load the module again and look at the kernel output. -If this works, please send an email to me reporting the kernel messages, so -that I will add a new entry in the list of supported devices. +If this works, please send an email to the author reporting the kernel +messages, so that a new entry in the list of supported devices can be added. Donations of new models for further testing and support would be much -appreciated. I won't add official support for hardware that I don't actually -have. +appreciated. Non-available hardware won't be supported by the author of this +driver. -9. How to add support for new image sensors -=========================================== -It should be easy to write code for new sensors by using the small API that I -have created for this purpose, which is present in "sn9c102_sensor.h" +10. How to add plug-in's for new image sensors +============================================== +It should be easy to write plug-in's for new sensors by using the small API +that has been created for this purpose, which is present in "sn9c102_sensor.h" (documentation is included there). As an example, have a look at the code in "sn9c102_pas106b.c", which uses the mentioned interface. -At the moment, not yet supported image sensors are: HV7131[D|E1] (VGA), -MI03 (VGA), OV7620 (VGA). +At the moment, possible unsupported image sensors are: CIS-VF10 (VGA), +OV7620 (VGA), OV7630 (VGA). -10. Notes for V4L2 application developers +11. Notes for V4L2 application developers ========================================= This driver follows the V4L2 API specifications. In particular, it enforces two rules: @@ -251,35 +373,115 @@ rules: file descriptor. Once it is selected, the application must close and reopen the device to switch to the other I/O method; -- previously mapped buffer memory must always be unmapped before calling any -of the "VIDIOC_S_CROP", "VIDIOC_TRY_FMT" and "VIDIOC_S_FMT" ioctl's. The same -number of buffers as before will be allocated again to match the size of the -new video frames, so you have to map them again before any I/O attempts. +- although it is not mandatory, previously mapped buffer memory should always +be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's. +The same number of buffers as before will be allocated again to match the size +of the new video frames, so you have to map the buffers again before any I/O +attempts on them. Consistently with the hardware limits, this driver also supports image downscaling with arbitrary scaling factors from 1, 2 and 4 in both directions. -However the V4L2 API specifications don't correctly define how the scaling -factor can be choosen arbitrarily by the "negotiation" of the "source" and +However, the V4L2 API specifications don't correctly define how the scaling +factor can be chosen arbitrarily by the "negotiation" of the "source" and "target" rectangles. To work around this flaw, we have added the convention that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the scaling factor is restored to 1. +This driver supports two different video formats: the first one is the "8-bit +Sequential Bayer" format and can be used to obtain uncompressed video data +from the device through the current I/O method, while the second one provides +"raw" compressed video data (without frame headers not related to the +compressed data). The compression quality may vary from 0 to 1 and can be +selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2 +ioctl's. For maximum flexibility, both the default active video format and the +default compression quality depend on how the image sensor being used is +initialized (as described in the documentation of the API for the image sensors +supplied by this driver). -11. Contact information + +12. Video frame formats [1] +======================= +The SN9C10x PC Camera Controllers can send images in two possible video +formats over the USB: either native "Sequential RGB Bayer" or Huffman +compressed. The latter is used to achieve high frame rates. The current video +format may be selected or queried from the user application by calling the +VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 API +specifications. + +The name "Sequential Bayer" indicates the organization of the red, green and +blue pixels in one video frame. Each pixel is associated with a 8-bit long +value and is disposed in memory according to the pattern shown below: + +B[0] G[1] B[2] G[3] ... B[m-2] G[m-1] +G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1] +... +... B[(n-1)(m-2)] G[(n-1)(m-1)] +... G[n(m-2)] R[n(m-1)] + +The above matrix also represents the sequential or progressive read-out mode of +the (n, m) Bayer color filter array used in many CCD/CMOS image sensors. + +One compressed video frame consists of a bitstream that encodes for every R, G, +or B pixel the difference between the value of the pixel itself and some +reference pixel value. Pixels are organised in the Bayer pattern and the Bayer +sub-pixels are tracked individually and alternatingly. For example, in the +first line values for the B and G1 pixels are alternatingly encoded, while in +the second line values for the G2 and R pixels are alternatingly encoded. + +The pixel reference value is calculated as follows: +- the 4 top left pixels are encoded in raw uncompressed 8-bit format; +- the value in the top two rows is the value of the pixel left of the current + pixel; +- the value in the left column is the value of the pixel above the current + pixel; +- for all other pixels, the reference value is the average of the value of the + pixel on the left and the value of the pixel above the current pixel; +- there is one code in the bitstream that specifies the value of a pixel + directly (in 4-bit resolution); +- pixel values need to be clamped inside the range [0..255] for proper + decoding. + +The algorithm purely describes the conversion from compressed Bayer code used +in the SN9C10x chips to uncompressed Bayer. Additional steps are required to +convert this to a color image (i.e. a color interpolation algorithm). + +The following Huffman codes have been found: +0: +0 (relative to reference pixel value) +100: +4 +101: -4? +1110xxxx: set absolute value to xxxx.0000 +1101: +11 +1111: -11 +11001: +20 +110000: -20 +110001: ??? - these codes are apparently not used + +[1] The Huffman compression algorithm has been reverse-engineered and + documented by Bertrik Sikken. + + +13. Contact information ======================= -I may be contacted by e-mail at . +The author may be contacted by e-mail at . -I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'. -My public 1024-bit key should be available at any keyserver; the fingerprint -is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. +GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is +'FCE635A4'; the public 1024-bit key should be available at any keyserver; +the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. -12. Credits +14. Credits =========== -I would thank the following persons: +Many thanks to following persons for their contribute (listed in alphabetical +order): -- Stefano Mozzi, who donated 45 EU; - Luca Capello for the donation of a webcam; -- Mizuno Takafumi for the donation of a webcam; +- Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the + donation of a webcam; - Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB - image sensor. + image sensor; +- Stefano Mozzi, who donated 45 EU; +- Bertrik Sikken, who reverse-engineered and documented the Huffman compression + algorithm used in the SN9C10x controllers and implemented the first decoder; +- Mizuno Takafumi for the donation of a webcam; +- An "anonymous" donator (who didn't want his name to be revealed) for the + donation of a webcam. diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt index d431f19f7..f001cd93b 100644 --- a/Documentation/usb/usb-serial.txt +++ b/Documentation/usb/usb-serial.txt @@ -211,6 +211,62 @@ ZyXEL omni.net lcd plus ISDN TA azummo@towertech.it +Cypress M8 CY4601 Family Serial Driver + + This driver was in most part developed by Neil "koyama" Whelchel. It + has been improved since that previous form to support dynamic serial + line settings and improved line handling. The driver is for the most + part stable and has been tested on an smp machine. (dual p2) + + Chipsets supported under CY4601 family: + + CY7C63723, CY7C63742, CY7C63743, CY7C64013 + + Devices supported: + + -DeLorme's USB Earthmate (SiRF Star II lp arch) + -Cypress HID->COM RS232 adapter + + Note: Cypress Semiconductor claims no affiliation with the + the hid->com device. + + Most devices using chipsets under the CY4601 family should + work with the driver. As long as they stay true to the CY4601 + usbserial specification. + + Technical notes: + + The Earthmate starts out at 4800 8N1 by default... the driver will + upon start init to this setting. usbserial core provides the rest + of the termios settings, along with some custom termios so that the + output is in proper format and parsable. + + The device can be put into sirf mode by issuing NMEA command: + $PSRF100,,,,,*CHECKSUM + $PSRF100,0,9600,8,1,0*0C + + It should then be sufficient to change the port termios to match this + to begin communicating. + + As far as I can tell it supports pretty much every sirf command as + documented online available with firmware 2.31, with some unknown + message ids. + + The hid->com adapter can run at a maximum baud of 115200bps. Please note + that the device has trouble or is incapable of raising line voltage properly. + It will be fine with null modem links, as long as you do not try to link two + together without hacking the adapter to set the line high. + + The driver is smp safe. Performance with the driver is rather low when using + it for transfering files. This is being worked on, but I would be willing to + accept patches. An urb queue or packet buffer would likely fit the bill here. + + If you have any questions, problems, patches, feature requests, etc. you can + contact me here via email: + dignome@gmail.com + (your problems/patches can alternately be submitted to usb-devel) + + Digi AccelePort Driver This driver supports the Digi AccelePort USB 2 and 4 devices, 2 port diff --git a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt index f52d65e55..18a47738d 100644 --- a/Documentation/usb/w9968cf.txt +++ b/Documentation/usb/w9968cf.txt @@ -8,26 +8,30 @@ Index ===== -1. Copyright -2. License -3. Overview -4. Supported devices -5. Module dependencies -6. Module loading -7. Module paramaters -8. Contact information -9. Credits +1. Copyright +2. Disclaimer +3. License +4. Overview +5. Supported devices +6. Module dependencies +7. Module loading +8. Module paramaters +9. Contact information +10. Credits 1. Copyright ============ Copyright (C) 2002-2004 by Luca Risolia + +2. Disclaimer +============= Winbond is a trademark of Winbond Electronics Corporation. -This driver is not sponsored or developed by Winbond. +This software is not sponsored or developed by Winbond. -2. License +3. License ========== 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 @@ -44,7 +48,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -3. Overview +4. Overview =========== This driver supports the video streaming capabilities of the devices mounting Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips. OV681 @@ -57,7 +61,7 @@ decoding, up-scaling and colour conversions. Once the driver is installed, every time an application tries to open a recognized device, "w9968cf" checks the presence of the "w9968cf-vpp" module and loads it automatically by default. -Please keep in mind that official kernels do NOT include the second module for +Please keep in mind that official kernels do not include the second module for performance purposes. However it is always recommended to download and install the latest and complete release of the driver, replacing the existing one, if present: it will be still even possible not to load the "w9968cf-vpp" module at @@ -65,7 +69,7 @@ all, if you ever want to. Another important missing feature of the version in the official Linux 2.4 kernels is the writeable /proc filesystem interface. The latest and full-featured version of the W996[87]CF driver can be found at: -http://go.lamarinapunto.com/ . Please refer to the documentation included in +http://www.linux-projects.org. Please refer to the documentation included in that package, if you are going to use it. Up to 32 cameras can be handled at the same time. They can be connected and @@ -83,7 +87,7 @@ will be automatically loaded by default (provided that the kernel has been compiled with the automatic module loading option). -4. Supported devices +5. Supported devices ==================== At the moment, known W996[87]CF and OV681 based devices are: - Aroma Digi Pen VGA Dual Mode ADG-5000 (unknown image sensor) @@ -99,11 +103,9 @@ At the moment, known W996[87]CF and OV681 based devices are: If you know any other W996[87]CF or OV681 based cameras, please contact me. -The list above does NOT imply that all those devices work with this driver: up +The list above does not imply that all those devices work with this driver: up until now only webcams that have an image sensor supported by the "ovcamchip" -module work. -For a list of supported image sensors, please visit the author's homepage on -this module: http://alpha.dyndns.org/ov511/ +module work. Kernel messages will always tell you whether this is case. Possible external microcontrollers of those webcams are not supported: this means that still images cannot be downloaded from the device memory. @@ -113,7 +115,7 @@ Furthermore, it's worth to note that I was only able to run tests on my additional testing and full support, would be much appreciated. -5. Module dependencies +6. Module dependencies ====================== For it to work properly, the driver needs kernel support for Video4Linux, USB and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not @@ -157,7 +159,7 @@ And finally: CONFIG_USB_W9968CF=m -6. Module loading +7. Module loading ================= To use the driver, it is necessary to load the "w9968cf" module into memory after every other module required. @@ -166,6 +168,7 @@ Loading can be done this way, from root: [root@localhost home]# modprobe usbcore [root@localhost home]# modprobe i2c-core + [root@localhost home]# modprobe videodev [root@localhost home]# modprobe w9968cf At this point the pertinent devices should be recognized: "dmesg" can be used @@ -181,7 +184,7 @@ explanation about them and which syntax to use, it is recommended to run the [root@locahost home]# modinfo w9968cf -7. Module parameters +8. Module parameters ==================== Module parameters are listed below: ------------------------------------------------------------------------------- @@ -452,7 +455,7 @@ Default: 0 ------------------------------------------------------------------------------- -8. Contact information +9. Contact information ====================== I may be contacted by e-mail at . @@ -461,7 +464,7 @@ My public 1024-bit key should be available at your keyserver; the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. -9. Credits +10. Credits ========== The development would not have proceed much further without having looked at the source code of other drivers and without the help of several persons; in diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt index 5adcd2502..2137da975 100644 --- a/Documentation/video4linux/meye.txt +++ b/Documentation/video4linux/meye.txt @@ -1,12 +1,12 @@ Vaio Picturebook Motion Eye Camera Driver Readme ------------------------------------------------ - Copyright (C) 2001-2003 Stelian Pop + Copyright (C) 2001-2004 Stelian Pop Copyright (C) 2001-2002 Alcôve Copyright (C) 2000 Andrew Tridgell This driver enable the use of video4linux compatible applications with the -Motion Eye camera. This driver requires the "Sony Vaio Programmable I/O -Control Device" driver (which can be found in the "Character drivers" +Motion Eye camera. This driver requires the "Sony Vaio Programmable I/O +Control Device" driver (which can be found in the "Character drivers" section of the kernel configuration utility) to be compiled and installed (using its "camera=1" parameter). @@ -24,7 +24,7 @@ This driver supports the 'second' version of the MotionEye camera :) The first version was connected directly on the video bus of the Neomagic video card and is unsupported. -The second one, made by Kawasaki Steel is fully supported by this +The second one, made by Kawasaki Steel is fully supported by this driver (PCI vendor/device is 0x136b/0xff01) The third one, present in recent (more or less last year) Picturebooks @@ -41,13 +41,12 @@ little information if any is available for this camera Driver options: --------------- -Several options can be passed to the meye driver, either by adding them -to /etc/modprobe.conf file, when the driver is compiled as a module, or -by adding the following to the kernel command line (in your bootloader): +Several options can be passed to the meye driver using the standard +module argument syntax (= when passing the option to the +module or meye.= on the kernel boot line when meye is +statically linked into the kernel). Those options are: - meye=gbuffers[,gbufsize[,video_nr]] - -where: + forcev4l1: force use of V4L1 API instead of V4L2 gbuffers: number of capture buffers, default is 2 (32 max) @@ -81,8 +80,9 @@ Usage: Private API: ------------ - The driver supports frame grabbing with the video4linux API, so - all video4linux tools (like xawtv) should work with this driver. + The driver supports frame grabbing with the video4linux API + (either v4l1 or v4l2), so all video4linux tools (like xawtv) + should work with this driver. Besides the video4linux interface, the driver has a private interface for accessing the Motion Eye extended parameters (camera sharpness, @@ -116,7 +116,7 @@ Private API: MEYEIOC_STILLJCAPT Takes a snapshot in an uncompressed or compressed jpeg format. This ioctl blocks until the snapshot is done and returns (for - jpeg snapshot) the size of the image. The image data is + jpeg snapshot) the size of the image. The image data is available from the first mmap'ed buffer. Look at the 'motioneye' application code for an actual example. @@ -124,13 +124,7 @@ Private API: Bugs / Todo: ------------ - - overlay output is not supported (although the camera is capable of). - (it should not be too hard to to it, provided we found how...) - - - mjpeg hardware playback doesn't work (depends on overlay...) + - the driver could be much cleaned up by removing the v4l1 support. + However, this means all v4l1-only applications will stop working. - - rewrite the driver to use some common video4linux API for snapshot - and mjpeg capture. Unfortunately, video4linux1 does not permit it, - the BUZ API seems to be targeted to TV cards only. The video4linux 2 - API may be an option, if it goes into the kernel (maybe 2.5 - material ?). + - 'motioneye' still uses the meye private v4l1 API extensions. diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 47a7121b4..1b9bcd1fe 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt @@ -1,14 +1,14 @@ The intent of this file is to give a brief summary of hugetlbpage support in the Linux kernel. This support is built on top of multiple page size support -that is provided by most of modern architectures. For example, IA-32 -architecture supports 4K and 4M (2M in PAE mode) page sizes, IA-64 +that is provided by most modern architectures. For example, i386 +architecture supports 4K and 4M (2M in PAE mode) page sizes, ia64 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, -256M. A TLB is a cache of virtual-to-physical translations. Typically this -is a very scarce resource on processor. Operating systems try to make best -use of limited number of TLB resources. This optimization is more critical -now as bigger and bigger physical memories (several GBs) are more readily -available. +256M and ppc64 supports 4K and 16M. A TLB is a cache of virtual-to-physical +translations. Typically this is a very scarce resource on processor. +Operating systems try to make best use of limited number of TLB resources. +This optimization is more critical now as bigger and bigger physical memories +(several GBs) are more readily available. Users can use the huge page support in Linux kernel by either using the mmap system call or standard SYSv shared memory system calls (shmget, shmat). @@ -98,125 +98,187 @@ a supplementary group and system admin needs to configure that gid into applications to use any combination of mmaps and shm* calls. Though the mount of filesystem will be required for using mmaps. -/* Example of using hugepage in user application using Sys V shared memory - * system calls. In this example, app is requesting memory of size 256MB that - * is backed by huge pages. Application uses the flag SHM_HUGETLB in shmget - * system call to informt the kernel that it is requesting hugepages. For - * IA-64 architecture, Linux kernel reserves Region number 4 for hugepages. - * That means the addresses starting with 0x800000....will need to be - * specified. +******************************************************************* + +/* + * Example of using hugepage memory in a user application using Sys V shared + * memory system calls. In this example the app is requesting 256MB of + * memory that is backed by huge pages. The application uses the flag + * SHM_HUGETLB in the shmget system call to inform the kernel that it is + * requesting hugepages. + * + * For the ia64 architecture, the Linux kernel reserves Region number 4 for + * hugepages. That means the addresses starting with 0x800000... will need + * to be specified. Specifying a fixed address is not required on ppc64, + * i386 or x86_64. + * + * Note: The default shared memory limit is quite low on many kernels, + * you may need to increase it via: + * + * echo 268435456 > /proc/sys/kernel/shmmax + * + * This will increase the maximum size per shared memory segment to 256MB. + * The other limit that you will hit eventually is shmall which is the + * total amount of shared memory in pages. To set it to 16GB on a system + * with a 4kB pagesize do: + * + * echo 4194304 > /proc/sys/kernel/shmall */ +#include +#include #include +#include #include -#include #include -#include -extern int errno; +#ifndef SHM_HUGETLB #define SHM_HUGETLB 04000 -#define LPAGE_SIZE (256UL*1024UL*1024UL) -#define dprintf(x) printf(x) -#define ADDR (0x8000000000000000UL) -main() +#endif + +#define LENGTH (256UL*1024*1024) + +#define dprintf(x) printf(x) + +/* Only ia64 requires this */ +#ifdef __ia64__ +#define ADDR (void *)(0x8000000000000000UL) +#define SHMAT_FLAGS (SHM_RND) +#else +#define ADDR (void *)(0x0UL) +#define SHMAT_FLAGS (0) +#endif + +int main(void) { - int shmid; - int i, j, k; - volatile char *shmaddr; - - if ((shmid =shmget(2, LPAGE_SIZE, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W )) -< 0) { - perror("Failure:"); - exit(1); - } - printf("shmid: 0x%x\n", shmid); - shmaddr = shmat(shmid, (void *)ADDR, SHM_RND) ; - if (errno != 0) { - perror("Shared Memory Attach Failure:"); - exit(2); - } - printf("shmaddr: %p\n", shmaddr); - - dprintf("Starting the writes:\n"); - for (i=0;i +#include #include +#include #include #include -#include #define FILE_NAME "/mnt/hugepagefile" -#define LENGTH (256*1024*1024) +#define LENGTH (256UL*1024*1024) #define PROTECTION (PROT_READ | PROT_WRITE) -#define FLAGS MAP_SHARED |MAP_FIXED -#define ADDRESS (char *)(0x60000000UL + 0x8000000000000000UL) -extern errno; +/* Only ia64 requires this */ +#ifdef __ia64__ +#define ADDR (void *)(0x8000000000000000UL) +#define FLAGS (MAP_SHARED | MAP_FIXED) +#else +#define ADDR (void *)(0x0UL) +#define FLAGS (MAP_SHARED) +#endif -check_bytes(char *addr) +void check_bytes(char *addr) { - printf("First hex is %x\n", *((unsigned int *)addr)); + printf("First hex is %x\n", *((unsigned int *)addr)); } -write_bytes(char *addr) +void write_bytes(char *addr) { - int i; - for (i=0;i -Description: +Virtual memory map with 4 level page tables: - Userspace is able to modify and it sees only the 3rd/2nd/1st level - pagetables (pgd_offset() implicitly walks the 1st slot of the 4th - level pagetable and it returns an entry into the 3rd level pagetable). - This is where the per-process 512 Gigabytes limit cames from. +0000000000000000 - 00007fffffffffff (=47bits) user space, different per mm +hole caused by [48:63] sign extension +ffff800000000000 - ffff80ffffffffff (=40bits) guard hole +ffff810000000000 - ffffc0ffffffffff (=46bits) direct mapping of phys. memory +ffffc10000000000 - ffffc1ffffffffff (=40bits) hole +ffffc20000000000 - ffffe1ffffffffff (=45bits) vmalloc/ioremap space +... unused hole ... +ffffffff80000000 - ffffffff82800000 (=40MB) kernel text mapping, from phys 0 +... unused hole ... +ffffffff88000000 - fffffffffff00000 (=1919MB) module mapping space - The common code pgd is the PDPE, the pmd is the PDE, the - pte is the PTE. The PML4E remains invisible to the common - code. +vmalloc space is lazily synchronized into the different PML4 pages of +the processes using the page fault handler, with init_level4_pgt as +reference. - The kernel uses all the first 47 bits of the negative half - of the virtual address space to build the direct mapping using - 2 Mbytes page size. The kernel virtual addresses have bit number - 47 always set to 1 (and in turn also bits 48-63 are set to 1 too, - due the sign extension). This is where the 128 Terabytes - 2 Gigabytes global - limit of RAM cames from. +Current X86-64 implementations only support 40 bit of address space, +but we support upto 46bits. This expands into MBZ space in the page tables. - Since the per-process limit is 512 Gigabytes (due to kernel common - code 3 level pagetable limitation), the higher virtual address mapped - into userspace is 0x7fffffffff and it makes sense to use it - as the top of the userspace stack to allow the stack to grow as - much as possible. - - Setting the PAGE_OFFSET to 2^39 (after the last userspace - virtual address) wouldn't make much difference compared to - setting PAGE_OFFSET to 0xffff800000000000 because we have an - hole into the virtual address space. The last byte mapped by the - 255th slot in the 4th level pagetable is at virtual address - 0x00007fffffffffff and the first byte mapped by the 256th slot in the - 4th level pagetable is at address 0xffff800000000000. Due to this - hole we can't trivially build a direct mapping across all the - 512 slots of the 4th level pagetable, so we simply use only the - second (negative) half of the 4th level pagetable for that purpose - (that provides us 128 Terabytes of contigous virtual addresses). - Strictly speaking we could build a direct mapping also across the hole - using some DISCONTIGMEM trick, but we don't need such a large - direct mapping right now. - -Future: - - During 2.5.x we can break the 512 Gigabytes per-process limit - possibly by removing from the common code any knowledge about the - architectural dependent physical layout of the virtual to physical - mapping. - - Once the 512 Gigabytes limit will be removed the kernel stack will - be moved (most probably to virtual address 0x00007fffffffffff). - Nothing will break in userspace due that move, as nothing breaks - in IA32 compiling the kernel with CONFIG_2G. - -Linus agreed on not breaking common code and to live with the 512 Gigabytes -per-process limitation for the 2.4.x timeframe and he has given me and Andi -some very useful hints... (thanks! :) - -Thanks also to H. Peter Anvin for his interesting and useful suggestions on -the x86-64-discuss lists! - -Other memory management related issues follows: - -PAGE_SIZE: - - If somebody is wondering why these days we still have a so small - 4k pagesize (16 or 32 kbytes would be much better for performance - of course), the PAGE_SIZE have to remain 4k for 32bit apps to - provide 100% backwards compatible IA32 API (we can't allow silent - fs corruption or as best a loss of coherency with the page cache - by allocating MAP_SHARED areas in MAP_ANONYMOUS memory with a - do_mmap_fake). I think it could be possible to have a dynamic page - size between 32bit and 64bit apps but it would need extremely - intrusive changes in the common code as first for page cache and - we sure don't want to depend on them right now even if the - hardware would support that. - -PAGETABLE SIZE: - - In turn we can't afford to have pagetables larger than 4k because - we could not be able to allocate them due physical memory - fragmentation, and failing to allocate the kernel stack is a minor - issue compared to failing the allocation of a pagetable. If we - fail the allocation of a pagetable the only thing we can do is to - sched_yield polling the freelist (deadlock prone) or to segfault - the task (not even the sighandler would be sure to run). - -KERNEL STACK: - - 1st stage: - - The kernel stack will be at first allocated with an order 2 allocation - (16k) (the utilization of the stack for a 64bit platform really - isn't exactly the double of a 32bit platform because the local - variables may not be all 64bit wide, but not much less). This will - make things even worse than they are right now on IA32 with - respect of failing fork/clone due memory fragmentation. - - 2nd stage: - - We'll benchmark if reserving one register as task_struct - pointer will improve performance of the kernel (instead of - recalculating the task_struct pointer starting from the stack - pointer each time). My guess is that recalculating will be faster - but it worth a try. - - If reserving one register for the task_struct pointer - will be faster we can as well split task_struct and kernel - stack. task_struct can be a slab allocation or a - PAGE_SIZEd allocation, and the kernel stack can then be - allocated in a order 1 allocation. Really this is risky, - since 8k on a 64bit platform is going to be less than 7k - on a 32bit platform but we could try it out. This would - reduce the fragmentation problem of an order of magnitude - making it equal to the current IA32. - - We must also consider the x86-64 seems to provide in hardware a - per-irq stack that could allow us to remove the irq handler - footprint from the regular per-process-stack, so it could allow - us to live with a smaller kernel stack compared to the other - linux architectures. - - 3rd stage: - - Before going into production if we still have the order 2 - allocation we can add a sysctl that allows the kernel stack to be - allocated with vmalloc during memory fragmentation. This have to - remain turned off during benchmarks :) but it should be ok in real - life. - -Order of PAGE_CACHE_SIZE and other allocations: - - On the long run we can increase the PAGE_CACHE_SIZE to be - an order 2 allocations and also the slab/buffercache etc.ec.. - could be all done with order 2 allocations. To make the above - to work we should change lots of common code thus it can be done - only once the basic port will be in a production state. Having - a working PAGE_CACHE_SIZE would be a benefit also for - IA32 and other architectures of course. - -Andrea SuSE +-Andi Kleen, Jul 2004 diff --git a/MAINTAINERS b/MAINTAINERS index b2b5643bc..7cd2c7ad3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -283,8 +283,19 @@ M: john@dnsworld.co.uk S: Maintained ARM MFM AND FLOPPY DRIVERS -P: Dave Gilbert -M: linux@treblig.org +P: Ian Molton +M: spyro@f2s.com +S: Maintained + +ARM/CORGI MACHINE SUPPORT +P: Richard Purdie +M: rpurdie@rpsys.net +S: Maintained + +ARM/PLEB SUPPORT +P: Peter Chubb +M: pleb@gelato.unsw.edu.au +W: http://www.disy.cse.unsw.edu.au/Hardware/PLEB S: Maintained ARM/PT DIGITAL BOARD PORT @@ -307,6 +318,20 @@ L: linux-arm-kernel@lists.arm.linux.org.uk W: http://www.arm.linux.org.uk/ S: Maintained +ARM/S3C2410 ARM ARCHITECTURE +P: Ben Dooks +M: ben-s3c2410@fluff.org +L: linux-arm-kernel@lists.arm.linux.org.uk +W: http://www.fluff.org/ben/linux/ +S: Maintained + +ARM/S3C2440 ARM ARCHITECTURE +P: Ben Dooks +M: ben-s3c2440@fluff.org +L: linux-arm-kernel@lists.arm.linux.org.uk +W: http://www.fluff.org/ben/linux/ +S: Maintained + ARPD SUPPORT P: Jonathan Layes L: linux-net@vger.kernel.org @@ -322,6 +347,12 @@ W: http://sourceforge.net/projects/acpi4asus W: http://julien.lerouge.free.fr S: Maintained +ATA OVER ETHERNET DRIVER +P: Ed L. Cashin +M: ecashin@coraid.com +W: http://www.coraid.com/support/linux +S: Supported + ATM P: Chas Williams M: chas@cmf.nrl.navy.mil @@ -531,10 +562,9 @@ S: Supported COMPUTONE INTELLIPORT MULTIPORT CARD P: Michael H. Warfield M: Michael H. Warfield -W: http://www.computone.com/ W: http://www.wittsend.com/computone.html L: linux-computone@lazuli.wittsend.com -S: Supported +S: Orphaned COSA/SRP SYNC SERIAL DRIVER P: Jan "Yenya" Kasprzak @@ -545,7 +575,7 @@ S: Maintained CPU FREQUENCY DRIVERS P: Dave Jones M: davej@codemonkey.org.uk -L: cpufreq@www.linux.org.uk +L: cpufreq@lists.linux.org.uk W: http://www.codemonkey.org.uk/projects/cpufreq/ S: Maintained @@ -559,8 +589,8 @@ W: http://sourceforge.net/projects/cramfs/ S: Orphan CRIS PORT -P: Bjorn Wesen -M: bjornw@axis.com +P: Mikael Starvik +M: starvik@axis.com L: dev-etrax@axis.com W: http://developer.axis.com S: Maintained @@ -670,7 +700,7 @@ P: Digi International, Inc M: Eng.Linux@digi.com L: Eng.Linux@digi.com W: http://www.digi.com -S: Maintained +S: Orphaned DIGI RIGHTSWITCH NETWORK DRIVER P: Rick Richardson @@ -683,7 +713,7 @@ P: Christoph Lameter M: christoph@lameter.com W: http://www.digi.com L: digilnux@digi.com -S: Orphaned +S: Obsolete DIRECTORY NOTIFICATION P: Stephen Rothwell @@ -700,8 +730,8 @@ W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html S: Maintained DISKQUOTA: -P: Marco van Wieringen -M: mvw@planets.elm.net +P: Jan Kara +M: jack@suse.cz L: linux-kernel@vger.kernel.org S: Maintained @@ -719,7 +749,7 @@ S: Maintained DRIVER CORE, KOBJECTS, AND SYSFS P: Greg Kroah-Hartman -M: greg@kroah.com +M: gregkh@suse.de L: linux-kernel@vger.kernel.org S: Supported @@ -806,7 +836,7 @@ S: Maintained EXT3 FILE SYSTEM P: Stephen Tweedie, Andrew Morton -M: sct@redhat.com, akpm@digeo.com, adilger@clusterfs.com +M: sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com L: ext3-users@redhat.com S: Maintained @@ -818,11 +848,11 @@ W: http://www.farsite.co.uk/ S: Supported FRAMEBUFFER LAYER -P: James Simmons, Geert Uytterhoeven -M: jsimmons@infradead.org, geert@linux-m68k.org +P: Antonino Daplas +M: adaplas@pol.net L: linux-fbdev-devel@lists.sourceforge.net W: http://linux-fbdev.sourceforge.net/ -S: Supported +S: Maintained FILE LOCKING (flock() and fcntl()/lockf()) P: Matthew Wilcox @@ -832,7 +862,7 @@ S: Maintained FILESYSTEMS (VFS and infrastructure) P: Alexander Viro -M: viro@math.psu.edu +M: viro@parcelfarce.linux.theplanet.co.uk S: Maintained FIRMWARE LOADER (request_firmware) @@ -857,12 +887,15 @@ M: hch@infradead.org W: ftp://ftp.openlinux.org/pub/people/hch/vxfs S: Maintained +FUJITSU FR-V PORT +P: David Howells +M: dhowells@redhat.com +S: Maintained + FTAPE/QIC-117 -P: Claus-Justus Heine -M: claus@momo.math.rwth-aachen.de L: linux-tape@vger.kernel.org -W: http://www-math.math.rwth-aachen.de/~LBFM/claus/ftape/ -S: Maintained +W: http://sourceforge.net/projects/ftape +S: Orphan FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) P: Rik Faith @@ -947,7 +980,12 @@ S: Maintained HPUSBSCSI P: Oliver Neukum -M: drivers@neukum.org +M: oliver@neukum.name +S: Maintained + +HUGETLB FILESYSTEM +P: William Irwin +M: wli@holomorphy.com S: Maintained I2C AND SENSORS DRIVERS @@ -985,8 +1023,8 @@ W: http://www.kernelconcepts.de/ S: Maintained IA64 (Itanium) PLATFORM -P: David Mosberger-Tang -M: davidm@hpl.hp.com +P: Tony Luck +M: tony.luck@intel.com L: linux-ia64@vger.kernel.org W: http://www.ia64-linux.org/ S: Maintained @@ -1078,6 +1116,17 @@ M: lethal@chaoticdreams.org L: linux-fbdev-devel@lists.sourceforge.net S: Maintained +INFINIBAND SUBSYSTEM +P: Roland Dreier +M: roland@topspin.com +P: Sean Hefty +M: mshefty@ichips.intel.com +P: Hal Rosenstock +M: halr@voltaire.com +L: openib-general@openib.org +W: http://www.openib.org/ +S: Supported + INPUT (KEYBOARD, MOUSE, JOYSTICK) DRIVERS P: Vojtech Pavlik M: vojtech@suse.cz @@ -1112,8 +1161,8 @@ P: John Ronciak M: john.ronciak@intel.com P: Ganesh Venkatesan M: ganesh.venkatesan@intel.com -P: Scott Feldman -M: scott.feldman@intel.com +P: Jesse Brandeburg +M: jesse.brandeburg@intel.com W: http://sourceforge.net/projects/e1000/ S: Supported @@ -1137,13 +1186,6 @@ M: john.ronciak@intel.com W: http://sourceforge.net/projects/e1000/ S: Supported -INTERMEZZO FILE SYSTEM -P: Cluster File Systems -M: intermezzo-devel@lists.sf.net -W: http://www.inter-mezzo.org/ -L: intermezzo-discuss@lists.sourceforge.net -S: Maintained - IOC3 DRIVER P: Ralf Baechle M: ralf@linux-mips.org @@ -1250,6 +1292,12 @@ W: http://nfs.sourceforge.net/ W: http://www.cse.unsw.edu.au/~neilb/patches/linux-devel/ S: Maintained +KERNEL EVENT LAYER (KOBJECT_UEVENT) +P: Robert Love +M: rml@novell.com +L: linux-kernel@vger.kernel.org +S: Maintained + LANMEDIA WAN CARD DRIVER P: Andrew Stanley-Jones M: asj@lanmedia.com @@ -1291,14 +1339,14 @@ LINUX FOR POWERPC P: Paul Mackerras M: paulus@samba.org W: http://www.penguinppc.org/ -L: linuxppc-dev@lists.linuxppc.org +L: linuxppc-dev@ozlabs.org S: Supported LINUX FOR POWER MACINTOSH P: Benjamin Herrenschmidt M: benh@kernel.crashing.org W: http://www.penguinppc.org/ -L: linuxppc-dev@lists.linuxppc.org +L: linuxppc-dev@ozlabs.org S: Maintained LINUX FOR POWERPC EMBEDDED MPC52XX @@ -1314,21 +1362,21 @@ LINUX FOR POWERPC EMBEDDED PPC4XX P: Matt Porter M: mporter@kernel.crashing.org W: http://www.penguinppc.org/ -L: linuxppc-embedded@lists.linuxppc.org +L: linuxppc-embedded@ozlabs.org S: Maintained LINUX FOR POWERPC EMBEDDED PPC8XX AND BOOT CODE P: Tom Rini M: trini@kernel.crashing.org W: http://www.penguinppc.org/ -L: linuxppc-embedded@lists.linuxppc.org +L: linuxppc-embedded@ozlabs.org S: Maintained LINUX FOR POWERPC EMBEDDED PPC85XX P: Kumar Gala M: kumar.gala@freescale.com W: http://www.penguinppc.org/ -L: linuxppc-embedded@lists.linuxppc.org +L: linuxppc-embedded@ozlabs.org S: Maintained LLC (802.2) @@ -1344,7 +1392,7 @@ P: Anton Blanchard M: anton@samba.org M: anton@au.ibm.com W: http://linuxppc64.org -L: linuxppc64-dev@lists.linuxppc.org +L: linuxppc64-dev@ozlabs.org S: Supported LINUX SECURITY MODULE (LSM) FRAMEWORK @@ -1430,14 +1478,14 @@ S: Maintained MEMORY TECHNOLOGY DEVICES P: David Woodhouse -M: dwmw2@redhat.com +M: dwmw2@infradead.org W: http://www.linux-mtd.infradead.org/ L: linux-mtd@lists.infradead.org S: Maintained MICROTEK X6 SCANNER P: Oliver Neukum -M: drivers@neukum.org +M: oliver@neukum.name S: Maintained MIPS @@ -1448,11 +1496,8 @@ L: linux-mips@linux-mips.org S: Maintained MISCELLANEOUS MCA-SUPPORT -P: David Weinehall -M: Project MCA Team -M: David Weinehall -W: http://www.acc.umu.se/~tao/ -W: http://www.acc.umu.se/~mcalinux/ +P: James Bottomley +M: jejb@steeleye.com L: linux-kernel@vger.kernel.org S: Maintained @@ -1529,7 +1574,7 @@ S: Maintained NETWORK DEVICE DRIVERS P: Andrew Morton -M: akpm@digeo.com +M: akpm@osdl.org P: Jeff Garzik M: jgarzik@pobox.com L: linux-net@vger.kernel.org @@ -1562,7 +1607,6 @@ P: Wensong Zhang M: wensong@linux-vs.org P: Julian Anastasov M: ja@ssi.bg -L: lvs-users@linuxvirtualserver.org S: Maintained NFS CLIENT @@ -1700,14 +1744,14 @@ S: Maintained PCI SUBSYSTEM P: Greg Kroah-Hartman -M: greg@kroah.com +M: gregkh@suse.de L: linux-kernel@vger.kernel.org +L: linux-pci@atrey.karlin.mff.cuni.cz S: Supported PCI HOTPLUG CORE P: Greg Kroah-Hartman -M: greg@kroah.com -M: gregkh@us.ibm.com +M: gregkh@suse.de S: Supported PCI HOTPLUG COMPAQ DRIVER @@ -1725,6 +1769,12 @@ M: tsbogend@alpha.franken.de L: linux-net@vger.kernel.org S: Maintained +PHRAM MTD DRIVER +P: Jörn Engel +M: joern@wh.fh-wedel.de +L: linux-mtd@lists.infradead.org +S: Maintained + POSIX CLOCKS and TIMERS P: George Anzinger M: george@mvista.com @@ -1749,7 +1799,7 @@ S: Maintained PPP OVER ETHERNET P: Michal Ostrowski -M: mostrows@styx.uwaterloo.ca +M: mostrows@speakeasy.net S: Maintained PREEMPTIBLE KERNEL @@ -1760,6 +1810,13 @@ L: kpreempt-tech@lists.sourceforge.net W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel S: Supported +PRISM54 WIRELESS DRIVER +P: Prism54 Development Team +M: prism54-private@prism54.org +L: netdev@oss.sgi.com +W: http://prism54.org +S: Maintained + PROMISE DC4030 CACHING DISK CONTROLLER DRIVER P: Peter Denison M: promise@pnd-pc.demon.co.uk @@ -1772,6 +1829,12 @@ M: nico@cam.org L: linux-arm-kernel@lists.arm.linux.org.uk S: Maintained +QLOGIC QLA2XXX FC-SCSI DRIVER +P: Andrew Vasquez +M: andrew.vasquez@qlogic.com +L: linux-scsi@vger.kernel.org +S: Supported + QNX4 FILESYSTEM P: Anders Larsen M: al@alarsen.net @@ -1823,9 +1886,7 @@ L: linux-hams@vger.kernel.org S: Maintained RISCOM8 DRIVER -P: Dmitry Gorodchanin -L: linux-kernel@vger.kernel.org -S: Maintained +S: Orphan RTLINUX REALTIME LINUX P: Victor Yodaiken @@ -1934,6 +1995,20 @@ L: linux-visws-devel@lists.sf.net W: http://linux-visws.sf.net S: Maintained for 2.6. +SIMTEC EB110ATX (Chalice CATS) +P: Ben Dooks +P: Vincent Sanders +M: support@simtec.co.uk +W: http://www.simtec.co.uk/products/EB110ATX/ +S: Supported + +SIMTEC EB2410ITX (BAST) +P: Ben Dooks +P: Vincent Sanders +M: support@simtec.co.uk +W: http://www.simtec.co.uk/products/EB2410ITX/ +S: Supported + SIS 5513 IDE CONTROLLER DRIVER P: Lionel Bouton M: Lionel.Bouton@inet6.fr @@ -2025,6 +2100,13 @@ L: sparclinux@vger.kernel.org L: ultralinux@vger.kernel.org S: Maintained +SHARP LH SUPPORT (LH7952X & LH7A40X) +P: Marc Singer +M: elf@buici.com +W: http://projects.buici.com/arm +L: linux-arm-kernel@lists.arm.linux.org.uk +S: Maintained + SPARC (sparc32): P: William L. Irwin M: wli@holomorphy.com @@ -2034,7 +2116,6 @@ S: Maintained SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER P: Roger Wolff M: R.E.Wolff@BitWizard.nl -M: io8-linux@specialix.co.uk L: linux-kernel@vger.kernel.org ? S: Supported @@ -2104,13 +2185,6 @@ P: Christoph Hellwig M: hch@infradead.org S: Maintained -TI GRAPH LINK USB (SilverLink) CABLE DRIVER -P: Romain Lievin -M: roms@lpg.ticalc.org -P: Julien Blache -M: jb@technologeek.org -S: Maintained - TI PARALLEL LINK CABLE DRIVER P: Romain Lievin M: roms@lpg.ticalc.org @@ -2191,13 +2265,6 @@ L: linux_udf@hpesjro.fc.hp.com W: http://linux-udf.sourceforge.net S: Maintained -UMSDOS FILESYSTEM -P: Matija Nalis -M: Matija Nalis -L: linux-kernel@vger.kernel.org -W: http://linux.voyager.hr/umsdos/ -S: Maintained - UNIFORM CDROM DRIVER P: Jens Axboe M: axboe@suse.de @@ -2206,8 +2273,8 @@ W: http://www.kernel.dk S: Maintained USB ACM DRIVER -P: Vojtech Pavlik -M: vojtech@suse.cz +P: Oliver Neukum +M: oliver@neukum.name L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net S: Maintained @@ -2250,7 +2317,7 @@ S: Maintained USB KAWASAKI LSI DRIVER P: Oliver Neukum -M: drivers@neukum.org +M: oliver@neukum.name L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net S: Maintained @@ -2319,11 +2386,10 @@ S: Maintained USB SERIAL DRIVER P: Greg Kroah-Hartman -M: greg@kroah.com +M: gregkh@suse.de L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net -S: Maintained -W: http://www.kroah.com/linux-usb/ +S: Supported USB SERIAL BELKIN F5U103 DRIVER P: William Greathouse @@ -2332,6 +2398,15 @@ L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net S: Maintained +USB SERIAL CYPRESS M8 DRIVER +P: Lonnie Mendez +M: dignome@gmail.com +L: linux-usb-users@lists.sourceforge.net +L: linux-usb-devel@lists.sourceforge.net +S: Maintained +W: http://geocities.com/i0xox0i +W: http://firstlight.net/cvs + USB SERIAL CYBERJACK PINPAD/E-COM DRIVER L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net @@ -2367,16 +2442,16 @@ L: linux-usb-devel@lists.sourceforge.net W: http://www.connecttech.com S: Supported -USB SN9C10[12] DRIVER +USB SN9C10x DRIVER P: Luca Risolia M: luca.risolia@studio.unibo.it L: linux-usb-devel@lists.sourceforge.net -W: http://go.lamarinapunto.com +W: http://www.linux-projects.org S: Maintained USB SUBSYSTEM P: Greg Kroah-Hartman -M: greg@kroah.com +M: gregkh@suse.de L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net W: http://www.linux-usb.org @@ -2399,7 +2474,7 @@ USB W996[87]CF DRIVER P: Luca Risolia M: luca.risolia@studio.unibo.it L: linux-usb-devel@lists.sourceforge.net -W: http://go.lamarinapunto.com +W: http://www.linux-projects.org S: Maintained USER-MODE LINUX @@ -2467,6 +2542,13 @@ M: johnpol@2ka.mipt.ru L: sensors@stimpy.netroedge.com S: Maintained +W83L51xD SD/MMC CARD INTERFACE DRIVER +P: Pierre Ossman +M: drzeus-wbsd@drzeus.cx +L: wbsd-devel@list.drzeus.cx +W: http://projects.drzeus.cx/wbsd +S: Maintained + W83L785TS HARDWARE MONITOR DRIVER P: Jean Delvare M: khali@linux-fr.org diff --git a/Makefile b/Makefile index a11956358..40e308502 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 -SUBLEVEL = 9 -EXTRAVERSION = -vs1.9.3 -NAME=Zonked Quokka +SUBLEVEL = 11 +EXTRAVERSION = .7 +NAME=Woozy Numbat # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -149,15 +149,14 @@ space := $(nullstring) # end of line # careful not to include files twice if building in the source # directory. LOCALVERSION from the command line override all of this -ifeq ($(objtree),$(srctree)) -localversion-files := $(wildcard $(srctree)/localversion*) -else -localversion-files := $(wildcard $(objtree)/localversion* $(srctree)/localversion*) -endif +localver := $(objtree)/localversion* $(srctree)/localversion* +localver := $(sort $(wildcard $(localver))) +# skip backup files (containing '~') +localver := $(foreach f, $(localver), $(if $(findstring ~, $(f)),,$(f))) LOCALVERSION = $(subst $(space),, \ - $(shell cat /dev/null $(localversion-files)) \ - $(subst ",,$(CONFIG_LOCALVERSION))) + $(shell cat /dev/null $(localver)) \ + $(patsubst "%",%,$(CONFIG_LOCALVERSION))) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION) @@ -291,10 +290,15 @@ check_gcc = $(warning check_gcc is deprecated - use cc-option) \ $(call cc-option, $(1),$(2)) # cc-option-yn -# Usage: flag := $(call gcc-option-yn, -march=winchip-c6) +# Usage: flag := $(call cc-option-yn, -march=winchip-c6) cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "y"; else echo "n"; fi;) +# cc-option-align +# Prefix align with either -falign or -malign +cc-option-align = $(subst -functions=0,,\ + $(call cc-option,-falign-functions=0,-malign-functions=0)) + # cc-version # Usage gcc-ver := $(call cc-version $(CC)) cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ @@ -326,7 +330,10 @@ DEPMOD = /sbin/depmod KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse + +NOSTDINC_FLAGS = -nostdinc -isystem $(shell $(CC) -print-file-name=include) CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ +CHECKFLAGS += $(NOSTDINC_FLAGS) MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) @@ -334,7 +341,6 @@ LDFLAGS_MODULE = -r CFLAGS_KERNEL = AFLAGS_KERNEL = -NOSTDINC_FLAGS = -nostdinc -iwithprefix include # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option @@ -344,7 +350,8 @@ LINUXINCLUDE := -Iinclude \ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common + -fno-strict-aliasing -fno-common \ + -ffreestanding AFLAGS := -D__ASSEMBLY__ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \ @@ -379,6 +386,18 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV scripts_basic: $(Q)$(MAKE) $(build)=scripts/basic +.PHONY: outputmakefile +# outputmakefile generate a Makefile to be placed in output directory, if +# using a seperate output directory. This allows convinient use +# of make in output directory +outputmakefile: + $(Q)if test ! $(srctree) -ef $(objtree); then \ + $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ + $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ + > $(objtree)/Makefile; \ + echo ' GEN $(objtree)/Makefile'; \ + fi + # To make sure we do not include .config for any of the *config targets # catch them early, and hand them over to scripts/kconfig/Makefile # It is allowed to specify more targets when calling make, including @@ -423,9 +442,15 @@ ifeq ($(config-targets),1) # *config targets only - make sure prerequisites are updated, and descend # in scripts/kconfig to make the *config target -config: scripts_basic FORCE +# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. +# KBUILD_DEFCONFIG may point out an alternative default configuration +# used for 'make defconfig' +include $(srctree)/arch/$(ARCH)/Makefile +export KBUILD_DEFCONFIG + +config: scripts_basic outputmakefile FORCE $(Q)$(MAKE) $(build)=scripts/kconfig $@ -%config: scripts_basic FORCE +%config: scripts_basic outputmakefile FORCE $(Q)$(MAKE) $(build)=scripts/kconfig $@ else @@ -486,7 +511,16 @@ else CFLAGS += -O2 endif -ifndef CONFIG_FRAME_POINTER +#Add align options if CONFIG_CC_* is not equal to 0 +add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1))) +CFLAGS += $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions) +CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels) +CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops) +CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps) + +ifdef CONFIG_FRAME_POINTER +CFLAGS += -fno-omit-frame-pointer +else CFLAGS += -fomit-frame-pointer endif @@ -494,10 +528,13 @@ ifdef CONFIG_DEBUG_INFO CFLAGS += -g endif +include $(srctree)/arch/$(ARCH)/Makefile + # warn about C99 declaration after statement CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) -include $(srctree)/arch/$(ARCH)/Makefile +# disable pointer signedness warnings in gcc 4.0 +CFLAGS += $(call cc-option,-Wno-pointer-sign,) # Default kernel image to build when no specific target is given. # KBUILD_IMAGE may be overruled on the commandline or @@ -711,22 +748,12 @@ $(vmlinux-dirs): prepare-all scripts .PHONY: prepare-all prepare prepare0 prepare1 prepare2 -# prepare 2 generate Makefile to be placed in output directory, if -# using a seperate output directory. This allows convinient use -# of make in output directory -prepare2: - $(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \ - $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ - $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ - > $(objtree)/Makefile; \ - fi - -# prepare1 is used to check if we are building in a separate output directory, +# prepare2 is used to check if we are building in a separate output directory, # and if so do: # 1) Check that make has not been executed in the kernel src $(srctree) # 2) Create the include2 directory, used for the second asm symlink -prepare1: prepare2 +prepare2: ifneq ($(KBUILD_SRC),) @echo ' Using $(srctree) as source for kernel' $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ @@ -738,6 +765,9 @@ ifneq ($(KBUILD_SRC),) $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm endif +# prepare1 creates a makefile if using a separate output directory +prepare1: prepare2 outputmakefile + prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER ifneq ($(KBUILD_MODULES),) $(Q)rm -rf $(MODVERDIR) @@ -1141,7 +1171,7 @@ cmd_TAGS = $(all-sources) | etags - quiet_cmd_tags = MAKE $@ define cmd_tags rm -f $@; \ - CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ + CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL"`; \ $(all-sources) | xargs ctags $$CTAGSF -a endef @@ -1185,6 +1215,9 @@ checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(PERL) $(src)/scripts/checkstack.pl $(ARCH) +kernelrelease: + @echo $(KERNELRELEASE) + # FIXME Should go into a make.lib or something # =========================================================================== diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 67ac95088..15e343207 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -28,6 +28,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_ISA_DMA bool default y @@ -485,7 +489,7 @@ config SMP singleprocessor machines. On a singleprocessor machine, the kernel will run faster if you say N here. - See also the , and the SMP-HOWTO + See also the , and the SMP-HOWTO available at . If you don't know what to do here, say N. diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile index c21132e4f..22ebfb2be 100644 --- a/arch/alpha/Makefile +++ b/arch/alpha/Makefile @@ -11,7 +11,7 @@ NM := $(NM) -B LDFLAGS_vmlinux := -static -N #-relax -CHECKFLAGS += -D__alpha__ +CHECKFLAGS += -D__alpha__ -m64 cflags-y := -pipe -mno-fp-regs -ffixed-8 # Determine if we can use the BWX instructions with GAS. diff --git a/arch/alpha/boot/bootloader.lds b/arch/alpha/boot/bootloader.lds index 6643ae256..31c081ce1 100644 --- a/arch/alpha/boot/bootloader.lds +++ b/arch/alpha/boot/bootloader.lds @@ -1,5 +1,6 @@ OUTPUT_FORMAT("elf64-alpha") ENTRY(__start) +printk = srm_printk; SECTIONS { . = 0x20000000; diff --git a/arch/alpha/boot/bootp.c b/arch/alpha/boot/bootp.c index f5ab2a4cb..ec53c28e3 100644 --- a/arch/alpha/boot/bootp.c +++ b/arch/alpha/boot/bootp.c @@ -26,6 +26,8 @@ extern unsigned long switch_to_osf_pal(unsigned long nr, struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa, unsigned long *vptb); +extern void move_stack(unsigned long new_stack); + struct hwrpb_struct *hwrpb = INIT_HWRPB; static struct pcb_struct pcb_va[1]; @@ -118,12 +120,10 @@ static inline void runkernel(void) { __asm__ __volatile__( - "bis %1,%1,$30\n\t" "bis %0,%0,$27\n\t" "jmp ($27)" : /* no outputs: it doesn't even return */ - : "r" (START_ADDR), - "r" (PAGE_SIZE + INIT_STACK)); + : "r" (START_ADDR)); } extern char _end; @@ -147,9 +147,7 @@ start_kernel(void) */ static long nbytes; static char envval[256] __attribute__((aligned(8))); -#ifdef INITRD_IMAGE_SIZE static unsigned long initrd_start; -#endif srm_printk("Linux/AXP bootp loader for Linux " UTS_RELEASE "\n"); if (INIT_HWRPB->pagesize != 8192) { @@ -164,13 +162,20 @@ start_kernel(void) } pal_init(); -#ifdef INITRD_IMAGE_SIZE /* The initrd must be page-aligned. See below for the cause of the magic number 5. */ - initrd_start = ((START_ADDR + 5*KERNEL_SIZE) | (PAGE_SIZE-1)) + 1; + initrd_start = ((START_ADDR + 5*KERNEL_SIZE + PAGE_SIZE) | + (PAGE_SIZE-1)) + 1; +#ifdef INITRD_IMAGE_SIZE srm_printk("Initrd positioned at %#lx\n", initrd_start); #endif + /* + * Move the stack to a safe place to ensure it won't be + * overwritten by kernel image. + */ + move_stack(initrd_start - PAGE_SIZE); + nbytes = callback_getenv(ENV_BOOTED_OSFLAGS, envval, sizeof(envval)); if (nbytes < 0 || nbytes >= sizeof(envval)) { nbytes = 0; diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c index e0d808f4e..a6657f2cf 100644 --- a/arch/alpha/boot/bootpz.c +++ b/arch/alpha/boot/bootpz.c @@ -41,9 +41,6 @@ #undef DEBUG_ADDRESSES #undef DEBUG_LAST_STEPS -#define DEBUG_SP(x) \ - {register long sp asm("30"); srm_printk("%s (sp=%lx)\n", x, sp);} - extern unsigned long switch_to_osf_pal(unsigned long nr, struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa, unsigned long *vptb); @@ -51,6 +48,8 @@ extern unsigned long switch_to_osf_pal(unsigned long nr, extern int decompress_kernel(void* destination, void *source, size_t ksize, size_t kzsize); +extern void move_stack(unsigned long new_stack); + struct hwrpb_struct *hwrpb = INIT_HWRPB; static struct pcb_struct pcb_va[1]; @@ -163,12 +162,10 @@ static inline void runkernel(void) { __asm__ __volatile__( - "bis %1,%1,$30\n\t" "bis %0,%0,$27\n\t" "jmp ($27)" : /* no outputs: it doesn't even return */ - : "r" (START_ADDR), - "r" (PAGE_SIZE + INIT_STACK)); + : "r" (START_ADDR)); } /* Must record the SP (it is virtual) on entry, so we can make sure @@ -253,7 +250,9 @@ extern char _end; for "bootmem" anyway. */ #define K_COPY_IMAGE_START NEXT_PAGE(K_KERNEL_IMAGE_END) -#define K_INITRD_START NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE) +/* Reserve one page below INITRD for the new stack. */ +#define K_INITRD_START \ + NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE + PAGE_SIZE) #define K_COPY_IMAGE_END \ (K_INITRD_START + REAL_INITRD_SIZE + MALLOC_AREA_SIZE) #define K_COPY_IMAGE_SIZE \ @@ -419,8 +418,7 @@ start_kernel(void) initrd_image_start, INITRD_IMAGE_SIZE); #endif - memcpy((void *)initrd_image_start, - (void *)V_INITRD_START, + memcpy((void *)initrd_image_start, (void *)V_INITRD_START, INITRD_IMAGE_SIZE); #endif /* INITRD_IMAGE_SIZE */ @@ -436,9 +434,14 @@ start_kernel(void) K_KERNEL_IMAGE_START, (unsigned)KERNEL_SIZE); #endif + /* + * Move the stack to a safe place to ensure it won't be + * overwritten by kernel image. + */ + move_stack(initrd_image_start - PAGE_SIZE); + memcpy((void *)K_KERNEL_IMAGE_START, - (void *)uncompressed_image_start, - KERNEL_SIZE); + (void *)uncompressed_image_start, KERNEL_SIZE); } /* Clear the zero page, then move the argument list in. */ diff --git a/arch/alpha/boot/head.S b/arch/alpha/boot/head.S index e3159d69d..f3d98089b 100644 --- a/arch/alpha/boot/head.S +++ b/arch/alpha/boot/head.S @@ -100,3 +100,24 @@ halt: .prologue 0 call_pal PAL_halt .end halt + +/* $16 - new stack page */ + .align 3 + .globl move_stack + .ent move_stack +move_stack: + .prologue 0 + lda $0, 0x1fff($31) + and $0, $30, $1 /* Stack offset */ + or $1, $16, $16 /* New stack pointer */ + mov $30, $1 + mov $16, $2 +1: ldq $3, 0($1) /* Move the stack */ + addq $1, 8, $1 + stq $3, 0($2) + and $0, $1, $4 + addq $2, 8, $2 + bne $4, 1b + mov $16, $30 + ret ($26) + .end move_stack diff --git a/arch/alpha/boot/misc.c b/arch/alpha/boot/misc.c index b8119502f..1d65adf56 100644 --- a/arch/alpha/boot/misc.c +++ b/arch/alpha/boot/misc.c @@ -205,15 +205,3 @@ decompress_kernel(void *output_start, /* puts(" done, booting the kernel.\n"); */ return output_ptr; } - -/* dummy-up printk */ -asmlinkage int printk(const char *fmt, ...) -{ - va_list args; - long ret; - - va_start(args, fmt); - ret = srm_printk(fmt, args); - va_end(args); - return ret; -} diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig index 6ac8d4a7d..5e39b7a7c 100644 --- a/arch/alpha/defconfig +++ b/arch/alpha/defconfig @@ -411,7 +411,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m # CONFIG_IP_NF_TARGET_REDIRECT is not set # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c index ad654afb8..64ba44928 100644 --- a/arch/alpha/kernel/alpha_ksyms.c +++ b/arch/alpha/kernel/alpha_ksyms.c @@ -185,7 +185,7 @@ EXPORT_SYMBOL(cpu_data); EXPORT_SYMBOL(smp_num_cpus); EXPORT_SYMBOL(smp_call_function); EXPORT_SYMBOL(smp_call_function_on_cpu); -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #ifdef CONFIG_DEBUG_SPINLOCK EXPORT_SYMBOL(_raw_spin_unlock); EXPORT_SYMBOL(debug_spin_lock); diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c index 254ab65d3..cb3e739fb 100644 --- a/arch/alpha/kernel/console.c +++ b/arch/alpha/kernel/console.c @@ -47,7 +47,7 @@ locate_and_init_vga(void *(*sel_func)(void *, void *)) if (!sel_func) sel_func = (void *)default_vga_hose_select; - for(dev=NULL; (dev=pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { + for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { if (!hose) hose = dev->sysdata; else hose = sel_func(hose, dev->sysdata); } diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index bb4fe0498..44866cb26 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c @@ -118,7 +118,7 @@ alloc_io7(unsigned int pe) io7 = alloc_bootmem(sizeof(*io7)); io7->pe = pe; - io7->irq_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&io7->irq_lock); for (h = 0; h < 4; h++) { io7->ports[h].io7 = io7; diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index 199435fb9..b6114f5c0 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -26,10 +26,10 @@ #include #include #include +#include #include #include -#include #include /* diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index 52231e371..b188683b8 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -22,7 +22,7 @@ /* Note mask bit is true for DISABLED irqs. */ static unsigned int cached_irq_mask = 0xffff; -static spinlock_t i8259_irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(i8259_irq_lock); static inline void i8259_update_irq_hw(unsigned int irq, unsigned long mask) diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c index b51316cfa..0a87e4669 100644 --- a/arch/alpha/kernel/irq_srm.c +++ b/arch/alpha/kernel/irq_srm.c @@ -15,7 +15,7 @@ * at the same time in multiple CPUs? To be safe I added a spinlock * but it can be removed trivially if the palcode is robust against smp. */ -spinlock_t srm_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(srm_irq_lock); static inline void srm_enable_irq(unsigned int irq) diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index b4c64d4fd..1f36bbd0e 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -227,7 +227,7 @@ pdev_save_srm_config(struct pci_dev *dev) tmp->next = srm_saved_configs; tmp->dev = dev; - pci_save_state(dev, tmp->regs); + pci_save_state(dev); srm_saved_configs = tmp; } @@ -243,7 +243,7 @@ pci_restore_srm_config(void) /* Restore SRM config. */ for (tmp = srm_saved_configs; tmp; tmp = tmp->next) { - pci_restore_state(tmp->dev, tmp->regs); + pci_restore_state(tmp->dev); } } #endif @@ -280,7 +280,6 @@ pcibios_fixup_bus(struct pci_bus *bus) /* Propagate hose info into the subordinate devices. */ struct pci_controller *hose = bus->sysdata; - struct list_head *ln; struct pci_dev *dev = bus->self; if (!dev) { @@ -304,9 +303,7 @@ pcibios_fixup_bus(struct pci_bus *bus) pcibios_fixup_device_resources(dev, bus); } - for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { - struct pci_dev *dev = pci_dev_b(ln); - + list_for_each_entry(dev, &bus->devices, bus_list) { pdev_save_srm_config(dev); if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) pcibios_fixup_device_resources(dev, bus); @@ -403,11 +400,10 @@ pcibios_set_master(struct pci_dev *dev) static void __init pcibios_claim_one_bus(struct pci_bus *b) { - struct list_head *ld; + struct pci_dev *dev; struct pci_bus *child_bus; - for (ld = b->devices.next; ld != &b->devices; ld = ld->next) { - struct pci_dev *dev = pci_dev_b(ld); + list_for_each_entry(dev, &b->devices, bus_list) { int i; for (i = 0; i < PCI_NUM_RESOURCES; i++) { @@ -426,12 +422,10 @@ pcibios_claim_one_bus(struct pci_bus *b) static void __init pcibios_claim_console_setup(void) { - struct list_head *lb; + struct pci_bus *b; - for(lb = pci_root_buses.next; lb != &pci_root_buses; lb = lb->next) { - struct pci_bus *b = pci_bus_b(lb); + list_for_each_entry(b, &pci_root_buses, node) pcibios_claim_one_bus(b); - } } void __init diff --git a/arch/alpha/kernel/pci_impl.h b/arch/alpha/kernel/pci_impl.h index 54fb8f178..f8b74995a 100644 --- a/arch/alpha/kernel/pci_impl.h +++ b/arch/alpha/kernel/pci_impl.h @@ -166,7 +166,6 @@ struct pdev_srm_saved_conf { struct pdev_srm_saved_conf *next; struct pci_dev *dev; - u32 regs[16]; }; extern void pci_restore_srm_config(void); diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 84a9f3cfb..e1560fb15 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -167,9 +167,6 @@ extern void entSys(void); extern void entUna(void); extern void entDbg(void); -/* process.c */ -extern void cpu_idle(void) __attribute__((noreturn)); - /* ptrace.c */ extern int ptrace_set_bpt (struct task_struct *child); extern int ptrace_cancel_bpt (struct task_struct *child); diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index 8db4b56b6..379617048 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c @@ -357,7 +357,7 @@ do_sys_ptrace(long request, long pid, long addr, long data, */ case PTRACE_KILL: ret = 0; - if (child->state == TASK_ZOMBIE) + if (child->exit_state == EXIT_ZOMBIE) break; child->exit_code = SIGKILL; /* make sure single-step breakpoint is gone. */ diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 71d2205aa..a4724d995 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -213,14 +213,14 @@ static void __init reserve_std_resources(void) { static struct resource standard_io_resources[] = { - { "rtc", -1, -1 }, - { "dma1", 0x00, 0x1f }, - { "pic1", 0x20, 0x3f }, - { "timer", 0x40, 0x5f }, - { "keyboard", 0x60, 0x6f }, - { "dma page reg", 0x80, 0x8f }, - { "pic2", 0xa0, 0xbf }, - { "dma2", 0xc0, 0xdf }, + { .name = "rtc", .start = -1, .end = -1 }, + { .name = "dma1", .start = 0x00, .end = 0x1f }, + { .name = "pic1", .start = 0x20, .end = 0x3f }, + { .name = "timer", .start = 0x40, .end = 0x5f }, + { .name = "keyboard", .start = 0x60, .end = 0x6f }, + { .name = "dma page reg", .start = 0x80, .end = 0x8f }, + { .name = "pic2", .start = 0xa0, .end = 0xbf }, + { .name = "dma2", .start = 0xc0, .end = 0xdf }, }; struct resource *io = &ioport_resource; diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 94ff1b330..974329cf0 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c @@ -19,8 +19,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c index 363267242..fd467b207 100644 --- a/arch/alpha/kernel/smc37c669.c +++ b/arch/alpha/kernel/smc37c669.c @@ -1104,7 +1104,7 @@ static int SMC37c669_xlate_drq( int drq ); -static spinlock_t smc_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(smc_lock); /* **++ diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 6d4d09c43..04a4d366b 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 49c8c97ed..b5660fc3a 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -22,7 +22,7 @@ #include -static spinlock_t srmcons_callback_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(srmcons_callback_lock); static int srm_is_registered_console = 0; /* @@ -132,40 +132,11 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count) } static int -srmcons_write(struct tty_struct *tty, int from_user, +srmcons_write(struct tty_struct *tty, const unsigned char *buf, int count) { unsigned long flags; - if (from_user) { - char tmp[512]; - int ret = 0; - size_t c; - - while ((c = count) > 0) { - if (c > sizeof(tmp)) - c = sizeof(tmp); - - c -= copy_from_user(tmp, (const char __user *) buf, c); - - if (!c) { - printk("%s: EFAULT (count %d)\n", - __FUNCTION__, count); - return -EFAULT; - } - - spin_lock_irqsave(&srmcons_callback_lock, flags); - srmcons_do_write(tty, tmp, c); - spin_unlock_irqrestore(&srmcons_callback_lock, flags); - - buf += c; - count -= c; - ret += c; - } - - return ret; - } - spin_lock_irqsave(&srmcons_callback_lock, flags); srmcons_do_write(tty, (const char *) buf, count); spin_unlock_irqrestore(&srmcons_callback_lock, flags); @@ -189,7 +160,7 @@ static int srmcons_get_private_struct(struct srmcons_private **ps) { static struct srmcons_private *srmconsp = NULL; - static spinlock_t srmconsp_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(srmconsp_lock); unsigned long flags; int retval = 0; @@ -208,7 +179,7 @@ srmcons_get_private_struct(struct srmcons_private **ps) } srmconsp->tty = NULL; - srmconsp->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&srmconsp->lock); init_timer(&srmconsp->timer); *ps = srmconsp; diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index 6852eeedf..145dcde14 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -16,12 +16,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index c3f9dbc1e..8e3374d34 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -16,12 +16,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 10973586f..9e36b07fa 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -19,12 +19,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -43,7 +43,7 @@ static unsigned long cached_irq_mask; /* dp264 boards handle at max four CPUs */ static unsigned long cpu_irq_affinity[4] = { 0UL, 0UL, 0UL, 0UL }; -spinlock_t dp264_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dp264_irq_lock); static void tsunami_update_irq_hw(unsigned long mask) diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index 32d9c350b..61a79c354 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c index f98be3e85..bd6e5f0e4 100644 --- a/arch/alpha/kernel/sys_eiger.c +++ b/arch/alpha/kernel/sys_eiger.c @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 52873d5fc..804727853 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -10,12 +10,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c index a55c109f5..d78a0daa6 100644 --- a/arch/alpha/kernel/sys_mikasa.c +++ b/arch/alpha/kernel/sys_mikasa.c @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index dd3bdedb7..c0d696efe 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c @@ -32,12 +32,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index 02363fa79..65061f5d7 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c @@ -16,12 +16,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c index 38d32bc3e..05888a02a 100644 --- a/arch/alpha/kernel/sys_rawhide.c +++ b/arch/alpha/kernel/sys_rawhide.c @@ -42,7 +42,7 @@ static unsigned int hose_irq_masks[4] = { 0xff0000, 0xfe0000, 0xff0000, 0xff0000 }; static unsigned int cached_irq_masks[4]; -spinlock_t rawhide_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rawhide_irq_lock); static inline void rawhide_update_irq_hw(int hose, int mask) diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index dfe16bc12..584042430 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -14,12 +14,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index 17423dd8c..a7ff84474 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c @@ -31,7 +31,7 @@ #include "pci_impl.h" #include "machvec_impl.h" -spinlock_t sable_lynx_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(sable_lynx_irq_lock); typedef struct irq_swizzle_struct { diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c index 3ee73b68e..94ad68b7c 100644 --- a/arch/alpha/kernel/sys_sx164.c +++ b/arch/alpha/kernel/sys_sx164.c @@ -14,12 +14,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 4466af674..5f84417ee 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -19,12 +19,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -56,7 +56,7 @@ static unsigned long titan_cached_irq_mask; /* * Need SMP-safe access to interrupt CSRs */ -spinlock_t titan_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(titan_irq_lock); static void titan_update_irq_hw(unsigned long mask) diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c index 959e8d7df..1553f4702 100644 --- a/arch/alpha/kernel/sys_wildfire.c +++ b/arch/alpha/kernel/sys_wildfire.c @@ -12,12 +12,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -32,7 +32,7 @@ static unsigned long cached_irq_mask[WILDFIRE_NR_IRQS/(sizeof(long)*8)]; -spinlock_t wildfire_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(wildfire_irq_lock); static int doing_init_irq_hw = 0; diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index a36ae26cb..c008f7087 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S @@ -291,7 +291,7 @@ sys_call_table: .quad alpha_ni_syscall /* 270 */ .quad alpha_ni_syscall .quad alpha_ni_syscall - .quad sys_vserver /* 273 sys_vserver */ + .quad alpha_ni_syscall .quad alpha_ni_syscall .quad alpha_ni_syscall /* 275 */ .quad alpha_ni_syscall @@ -447,7 +447,7 @@ sys_call_table: .quad sys_stat64 /* 425 */ .quad sys_lstat64 .quad sys_fstat64 - .quad sys_ni_syscall /* sys_vserver */ + .quad sys_vserver /* sys_vserver */ .quad sys_ni_syscall /* sys_mbind */ .quad sys_ni_syscall /* sys_get_mempolicy */ .quad sys_ni_syscall /* sys_set_mempolicy */ diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 5ff439b04..8226c5cd7 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -63,7 +63,7 @@ extern unsigned long wall_jiffies; /* kernel/timer.c */ static int set_rtc_mmss(unsigned long); -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); #define TICK_SIZE (tick_nsec / 1000) @@ -138,6 +138,9 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) while (nticks > 0) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif nticks--; } diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c index 4af102219..a37948f30 100644 --- a/arch/alpha/lib/csum_partial_copy.c +++ b/arch/alpha/lib/csum_partial_copy.c @@ -251,7 +251,8 @@ out: * look at this too closely, you'll go blind. */ static inline unsigned long -csum_partial_cfu_unaligned(const unsigned long * src, unsigned long * dst, +csum_partial_cfu_unaligned(const unsigned long __user * src, + unsigned long * dst, unsigned long soff, unsigned long doff, long len, unsigned long checksum, unsigned long partial_dest, @@ -383,7 +384,8 @@ csum_partial_copy_from_user(const char __user *src, char *dst, int len, } unsigned int -csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum) +csum_partial_copy_nocheck(const char __user *src, char *dst, int len, + unsigned int sum) { return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); } diff --git a/arch/alpha/lib/dec_and_lock.c b/arch/alpha/lib/dec_and_lock.c index 5fc130388..6ae2500a9 100644 --- a/arch/alpha/lib/dec_and_lock.c +++ b/arch/alpha/lib/dec_and_lock.c @@ -9,10 +9,10 @@ #include asm (".text \n\ - .global atomic_dec_and_lock \n\ - .ent atomic_dec_and_lock \n\ + .global _atomic_dec_and_lock \n\ + .ent _atomic_dec_and_lock \n\ .align 4 \n\ -atomic_dec_and_lock: \n\ +_atomic_dec_and_lock: \n\ .prologue 0 \n\ 1: ldl_l $1, 0($16) \n\ subl $1, 1, $1 \n\ @@ -28,7 +28,7 @@ atomic_dec_and_lock: \n\ .subsection 2 \n\ 4: br 1b \n\ .previous \n\ - .end atomic_dec_and_lock"); + .end _atomic_dec_and_lock"); static int __attribute_used__ atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock) diff --git a/arch/alpha/lib/memmove.S b/arch/alpha/lib/memmove.S index 2f06e4603..eb3b6e022 100644 --- a/arch/alpha/lib/memmove.S +++ b/arch/alpha/lib/memmove.S @@ -11,18 +11,6 @@ .set noreorder .text - .align 4 - .globl bcopy - .ent bcopy -bcopy: - ldgp $29, 0($27) - .prologue 1 - mov $16,$0 - mov $17,$16 - mov $0,$17 - br $31, memmove !samegp - .end bcopy - .align 4 .globl memmove .ent memmove diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index 3ea81ca1c..90752f6d8 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c @@ -42,10 +42,9 @@ pgd_alloc(struct mm_struct *mm) { pgd_t *ret, *init; - ret = (pgd_t *)__get_free_page(GFP_KERNEL); + ret = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); init = pgd_offset(&init_mm, 0UL); if (ret) { - clear_page(ret); #ifdef CONFIG_ALPHA_LARGE_VMALLOC memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD - 1)*sizeof(pgd_t)); @@ -63,9 +62,7 @@ pgd_alloc(struct mm_struct *mm) pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); - if (pte) - clear_page(pte); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); return pte; } diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c index a839578e9..ba81c4422 100644 --- a/arch/alpha/mm/numa.c +++ b/arch/alpha/mm/numa.c @@ -246,7 +246,7 @@ setup_memory_node(int nid, void *kernel_end) reserve_bootmem_node(NODE_DATA(nid), PFN_PHYS(bootmap_start), bootmap_size); printk(" reserving pages %ld:%ld\n", bootmap_start, bootmap_start+PFN_UP(bootmap_size)); - numnodes++; + node_set_online(nid); } void __init @@ -256,7 +256,7 @@ setup_memory(void *kernel_end) show_mem_layout(); - numnodes = 0; + nodes_clear(node_online_map); min_low_pfn = ~0UL; max_low_pfn = 0UL; @@ -303,7 +303,7 @@ void __init paging_init(void) */ dma_local_pfn = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { unsigned long start_pfn = node_bdata[nid].node_boot_start >> PAGE_SHIFT; unsigned long end_pfn = node_bdata[nid].node_low_pfn; @@ -332,7 +332,7 @@ void __init mem_init(void) high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); reservedpages = 0; - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { /* * This will free up the bootmem, ie, slot 0 memory */ @@ -372,7 +372,7 @@ show_mem(void) printk("\nMem-info:\n"); show_free_areas(); printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { struct page * lmem_map = node_mem_map(nid); i = node_spanned_pages(nid); while (i-- > 0) { diff --git a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c index 4ab14ed40..908eb4af8 100644 --- a/arch/alpha/oprofile/common.c +++ b/arch/alpha/oprofile/common.c @@ -138,17 +138,8 @@ op_axp_create_files(struct super_block * sb, struct dentry * root) return 0; } -static struct oprofile_operations oprof_axp_ops = { - .create_files = op_axp_create_files, - .setup = op_axp_setup, - .shutdown = op_axp_shutdown, - .start = op_axp_start, - .stop = op_axp_stop, - .cpu_type = NULL /* To be filled in below. */ -}; - int __init -oprofile_arch_init(struct oprofile_operations **ops) +oprofile_arch_init(struct oprofile_operations *ops) { struct op_axp_model *lmodel = NULL; @@ -178,8 +169,12 @@ oprofile_arch_init(struct oprofile_operations **ops) return -ENODEV; model = lmodel; - oprof_axp_ops.cpu_type = lmodel->cpu_type; - *ops = &oprof_axp_ops; + ops->create_files = op_axp_create_files; + ops->setup = op_axp_setup; + ops->shutdown = op_axp_shutdown; + ops->start = op_axp_start; + ops->stop = op_axp_stop; + ops->cpu_type = lmodel->cpu_type; printk(KERN_INFO "oprofile: using %s performance monitoring.\n", lmodel->cpu_type); diff --git a/arch/alpha/oprofile/op_model_ev4.c b/arch/alpha/oprofile/op_model_ev4.c index 5f06d3198..80d764dbf 100644 --- a/arch/alpha/oprofile/op_model_ev4.c +++ b/arch/alpha/oprofile/op_model_ev4.c @@ -101,8 +101,7 @@ ev4_handle_interrupt(unsigned long which, struct pt_regs *regs, return; /* Record the sample. */ - oprofile_add_sample(regs->pc, !user_mode(regs), - which, smp_processor_id()); + oprofile_add_sample(regs, which); } diff --git a/arch/alpha/oprofile/op_model_ev5.c b/arch/alpha/oprofile/op_model_ev5.c index 05b7470ba..ceea6e1ad 100644 --- a/arch/alpha/oprofile/op_model_ev5.c +++ b/arch/alpha/oprofile/op_model_ev5.c @@ -186,8 +186,7 @@ ev5_handle_interrupt(unsigned long which, struct pt_regs *regs, struct op_counter_config *ctr) { /* Record the sample. */ - oprofile_add_sample(regs->pc, !user_mode(regs), - which, smp_processor_id()); + oprofile_add_sample(regs, which); } diff --git a/arch/alpha/oprofile/op_model_ev6.c b/arch/alpha/oprofile/op_model_ev6.c index 5ae6b5a30..0869f85f5 100644 --- a/arch/alpha/oprofile/op_model_ev6.c +++ b/arch/alpha/oprofile/op_model_ev6.c @@ -88,8 +88,7 @@ ev6_handle_interrupt(unsigned long which, struct pt_regs *regs, struct op_counter_config *ctr) { /* Record the sample. */ - oprofile_add_sample(regs->pc, !user_mode(regs), - which, smp_processor_id()); + oprofile_add_sample(regs, which); } diff --git a/arch/alpha/oprofile/op_model_ev67.c b/arch/alpha/oprofile/op_model_ev67.c index aaaef8687..703020862 100644 --- a/arch/alpha/oprofile/op_model_ev67.c +++ b/arch/alpha/oprofile/op_model_ev67.c @@ -138,8 +138,7 @@ op_add_pm(unsigned long pc, int kern, unsigned long counter, if (counter == 1) fake_counter += PM_NUM_COUNTERS; if (ctr[fake_counter].enabled) - oprofile_add_sample(pc, kern, fake_counter, - smp_processor_id()); + oprofile_add_pc(pc, kern, fake_counter); } static void @@ -197,8 +196,7 @@ ev67_handle_interrupt(unsigned long which, struct pt_regs *regs, to PALcode. Recognize ITB miss by PALcode offset address, and get actual PC from EXC_ADDR. */ - oprofile_add_sample(regs->pc, kern, which, - smp_processor_id()); + oprofile_add_pc(regs->pc, kern, which); if ((pmpc & ((1 << 15) - 1)) == 581) op_add_pm(regs->pc, kern, which, ctr, PM_ITB_MISS); @@ -241,7 +239,7 @@ ev67_handle_interrupt(unsigned long which, struct pt_regs *regs, } } - oprofile_add_sample(pmpc, kern, which, smp_processor_id()); + oprofile_add_pc(pmpc, kern, which); pctr_ctl = wrperfmon(5, 0); if (pctr_ctl & (1UL << 27)) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 096ea1dd3..d05e02497 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -57,6 +57,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_BUST_SPINLOCK bool @@ -83,6 +87,8 @@ config ARCH_CLPS711X config ARCH_CO285 bool "Co-EBSA285" + select FOOTBRIDGE + select FOOTBRIDGE_ADDIN config ARCH_EBSA110 bool "EBSA-110" @@ -101,6 +107,7 @@ config ARCH_CAMELOT config ARCH_FOOTBRIDGE bool "FootBridge" + select FOOTBRIDGE config ARCH_INTEGRATOR bool "Integrator" @@ -124,7 +131,7 @@ config ARCH_L7200 If you have any questions or comments about the Linux kernel port - to this board, send e-mail to sjhill@cotw.com. + to this board, send e-mail to . config ARCH_PXA bool "PXA2xx-based" @@ -142,7 +149,7 @@ config ARCH_S3C2410 bool "Samsung S3C2410" help Samsung S3C2410X CPU based systems, such as the Simtec Electronics - BAST (http://www.simtec.co.uk/products/EB110ITX/), the IPAQ 1940 or + BAST (), the IPAQ 1940 or the Samsung SMDK2410 development board (and derviatives). config ARCH_SHARK @@ -159,10 +166,10 @@ config ARCH_LH7A40X config ARCH_OMAP bool "TI OMAP" -config ARCH_VERSATILE_PB - bool "Versatile PB" +config ARCH_VERSATILE + bool "Versatile" help - This enables support for ARM Ltd Versatile PB board. + This enables support for ARM Ltd Versatile board. config ARCH_IMX bool "IMX" @@ -202,6 +209,8 @@ source "arch/arm/mach-imx/Kconfig" source "arch/arm/mach-h720x/Kconfig" +source "arch/arm/mach-versatile/Kconfig" + # Definitions to make life easier config ARCH_ACORN bool @@ -213,28 +222,6 @@ config TIMER_ACORN depends on ARCH_ACORN || ARCH_CLPS7500 default y -##################################################################### -# Footbridge support -config FOOTBRIDGE - bool - depends on ARCH_CO285 || ARCH_FOOTBRIDGE - default y - -config FOOTBRIDGE_HOST - bool - depends on ARCH_CATS || ARCH_EBSA285_HOST || ARCH_NETWINDER || ARCH_PERSONAL_SERVER - default y - -config FOOTBRIDGE_ADDIN - bool - depends on ARCH_CO285 || ARCH_EBSA285_ADDIN - default y - -config ARCH_EBSA285 - bool - depends on ARCH_EBSA285_HOST || ARCH_EBSA285_ADDIN - default y - ##################################################################### # SA1111 support config SA1111 @@ -247,6 +234,11 @@ config SHARP_LOCOMO depends on SA1100_COLLIE default y +config SHARP_SCOOP + bool + depends on PXA_SHARPSL || SA1100_COLLIE + default y + config FORCE_MAX_ZONEORDER int depends on SA1111 @@ -270,6 +262,33 @@ endmenu menu "General setup" # Select various configuration options depending on the machine type + +config SMP + bool "Symmetric Multi-Processing (EXPERIMENTAL)" + depends on EXPERIMENTAL && n + help + This enables support for systems with more than one CPU. If you have + a system with only one CPU, like most personal computers, say N. If + you have a system with more than one CPU, say Y. + + If you say N here, the kernel will run on single and multiprocessor + machines, but will use only one CPU of a multiprocessor machine. If + you say Y here, the kernel will run on many, but not all, single + processor machines. On a single processor machine, the kernel will + run faster if you say N here. + + See also the , + , , + and the SMP-HOWTO available at + . + + If you don't know what to do here, say N. + +config NR_CPUS + int "Maximum number of CPUs (2-32)" + depends on SMP + default "4" + config DISCONTIGMEM bool depends on ARCH_EDB7211 || ARCH_SA1100 || (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) @@ -306,9 +325,14 @@ config ICST525 depends on ARCH_INTEGRATOR default y +config ICST307 + bool + depends on ARCH_VERSATILE + default y + config ARM_AMBA bool - depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB + depends on ARCH_INTEGRATOR || ARCH_VERSATILE default y config ISA @@ -329,58 +353,84 @@ config ISA_DMA config FIQ bool - depends on ARCH_ACORN || ARCH_L7200 || ARCH_LH7A400 + depends on ARCH_ACORN || ARCH_L7200 default y # Compressed boot loader in ROM. Yes, we really want to ask about # TEXT and BSS so we preserve their values in the config files. -config ZBOOT_ROM - bool "Compressed boot loader in ROM/flash" - help - Say Y here if you intend to execute your compressed kernel image (zImage) - directly from ROM or flash. If unsure, say N. - config ZBOOT_ROM_TEXT hex "Compressed ROM boot loader base address" default "0" help - The base address for zImage. Unless you have special requirements, you - should not change this value. + The physical address at which the ROM-able zImage is to be + placed in the target. Platforms which normally make use of + ROM-able zImage formats normally set this to a suitable + value in their defconfig file. + + If ZBOOT_ROM is not enabled, this has no effect. config ZBOOT_ROM_BSS hex "Compressed ROM boot loader BSS address" default "0" help - The base address of 64KiB of read/write memory, which must be available - while the decompressor is running. Unless you have special requirements, - you should not change this value. + The base address of 64KiB of read/write memory in the target + for the ROM-able zImage, which must be available while the + decompressor is running. Platforms which normally make use of + ROM-able zImage formats normally set this to a suitable + value in their defconfig file. + + If ZBOOT_ROM is not enabled, this has no effect. -config CPU_FREQ - bool "Support CPU clock change (EXPERIMENTAL)" - depends on (ARCH_SA1100 || ARCH_INTEGRATOR) && EXPERIMENTAL +config ZBOOT_ROM + bool "Compressed boot loader in ROM/flash" + depends on ZBOOT_ROM_TEXT != ZBOOT_ROM_BSS help - CPU clock scaling allows you to change the clock speed of the - running CPU on the fly. This is a nice method to save battery power, - because the lower the clock speed, the less power the CPU - consumes. Note that this driver doesn't automatically change the CPU - clock speed, you need some userland tools (which still have to be - written) to implement the policy. If you don't understand what this - is all about, it's safe to say 'N'. + Say Y here if you intend to execute your compressed kernel image + (zImage) directly from ROM or flash. If unsure, say N. +config XIP_KERNEL + bool "Kernel Execute-In-Place from ROM" + depends on !ZBOOT_ROM + help + Execute-In-Place allows the kernel to run from non-volatile storage + directly addressable by the CPU, such as NOR flash. This saves RAM + space since the text section of the kernel is not loaded from flash + to RAM. Read-write sections, such as the data section and stack, + are still copied to RAM. The XIP kernel is not compressed since + it has to run directly from flash, so it will take more space to + store it. The flash address used to link the kernel object files, + and for storing it, is configuration dependent. Therefore, if you + say Y here, you must know the proper physical address where to + store the kernel image depending on your own flash memory usage. + + Also note that the make target becomes "make xipImage" rather than + "make zImage" or "make Image". The final kernel binary to put in + ROM memory will be arch/arm/boot/xipImage. + + If unsure, say N. + +config XIP_PHYS_ADDR + hex "XIP Kernel Physical Location" + depends on XIP_KERNEL + default "0x00080000" + help + This is the physical address in your flash memory the kernel will + be linked for and stored to. This address is dependent on your + own flash usage. -# CPUfreq on SA11x0 is special -- it _needs_ the userspace governor +if (ARCH_SA1100 || ARCH_INTEGRATOR) + +source "drivers/cpufreq/Kconfig" config CPU_FREQ_SA1100 bool - depends on CPU_FREQ && SA1100_LART + depends on CPU_FREQ && (SA1100_LART || SA1100_PLEB) default y - select CPU_FREQ_24_API if SYSCTL config CPU_FREQ_SA1110 bool depends on CPU_FREQ && (SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3) default y - select CPU_FREQ_24_API if SYSCTL config CPU_FREQ_INTEGRATOR tristate "CPUfreq driver for ARM Integrator CPUs" @@ -393,10 +443,6 @@ config CPU_FREQ_INTEGRATOR If in doubt, say Y. -if (CPU_FREQ_INTEGRATOR) || (CPU_FREQ_SA1110) || (CPU_FREQ_SA1100) - -source "drivers/cpufreq/Kconfig" - endif source "drivers/pci/Kconfig" @@ -572,7 +618,7 @@ config CMDLINE config LEDS bool "Timer and CPU usage LEDs" - depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB || ARCH_IMX + depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE || ARCH_IMX help If you say Y here, the LEDs on your machine will be used to provide useful information about your current system status. @@ -585,8 +631,8 @@ config LEDS system, but the driver will do nothing. config LEDS_TIMER - bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || MACH_MAINSTONE || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB || ARCH_IMX) - depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB || ARCH_IMX + bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || MACH_MAINSTONE || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE || ARCH_IMX || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2) + depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE || ARCH_IMX default y if ARCH_EBSA110 help If you say Y here, one of the system LEDs (the green one on the @@ -601,7 +647,7 @@ config LEDS_TIMER config LEDS_CPU bool "CPU usage LED" - depends on LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB || ARCH_IMX) + depends on LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE || ARCH_IMX || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2) help If you say Y here, the red LED will be used to give a good real time indication of CPU usage, by lighting whenever the idle task diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 266f46ca0..27542c0f9 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -104,7 +104,7 @@ config DEBUG_S3C2410_PORT before it is used. config DEBUG_S3C2410_UART - depends on DEBUG_LL && ARCH_S3C2410 + depends on ARCH_S3C2410 int "S3C2410 UART to use for low-level debug" default "0" help @@ -112,4 +112,7 @@ config DEBUG_S3C2410_UART should be between zero and two. The port must have been initalised by the boot-loader before use. + The uncompressor code port configuration is now handled + by CONFIG_S3C2410_LOWLEVEL_UART_PORT. + endmenu diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a4878a0ae..8b9760b93 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -13,6 +13,10 @@ OBJCOPYFLAGS :=-O binary -R .note -R .comment -S GZFLAGS :=-9 #CFLAGS +=-pipe +# Do not use arch/arm/defconfig - it's always outdated. +# Select a platform tht is kept up-to-date +KBUILD_DEFCONFIG := versatile_defconfig + ifeq ($(CONFIG_FRAME_POINTER),y) CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog endif @@ -54,14 +58,13 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) tune-$(CONFIG_CPU_V6) :=-mtune=strongarm # Need -Uarm for gcc < 3.x -CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call cc-option,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm -AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float +CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) +CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm +AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float CHECKFLAGS += -D__arm__ #Default value -DATAADDR := . - head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o textaddr-y := 0xC0008000 @@ -93,7 +96,7 @@ textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000 machine-$(CONFIG_ARCH_OMAP) := omap machine-$(CONFIG_ARCH_S3C2410) := s3c2410 machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x - machine-$(CONFIG_ARCH_VERSATILE_PB) := versatile + machine-$(CONFIG_ARCH_VERSATILE) := versatile machine-$(CONFIG_ARCH_IMX) := imx machine-$(CONFIG_ARCH_H720X) := h720x @@ -105,12 +108,27 @@ export CFLAGS_3c589_cs.o endif TEXTADDR := $(textaddr-y) +ifeq ($(CONFIG_XIP_KERNEL),y) + DATAADDR := $(TEXTADDR) + xipaddr-$(CONFIG_ARCH_CO285) := 0x5f000000 + xipaddr-y ?= 0xbf000000 + # Replace phys addr with virt addr while keeping offset from base. + TEXTADDR := $(shell echo $(CONFIG_XIP_PHYS_ADDR) $(xipaddr-y) | \ + awk --non-decimal-data '/[:xdigit:]/ \ + { printf("0x%x\n", and($$1, 0x000fffff) + $$2) }' ) +endif + ifeq ($(incdir-y),) incdir-y := $(machine-y) endif INCDIR := arch-$(incdir-y) +ifneq ($(machine-y),) +MACHINE := arch/arm/mach-$(machine-y)/ +else +MACHINE := +endif -export TEXTADDR GZFLAGS +export TEXTADDR DATAADDR GZFLAGS # Do we have FASTFPE? FASTFPE :=arch/arm/fastfpe @@ -120,9 +138,7 @@ endif # If we have a machine-specific directory, then include it in the build. core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ -ifneq ($(machine-y),) -core-y += arch/arm/mach-$(machine-y)/ -endif +core-y += $(MACHINE) core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) core-$(CONFIG_VFP) += arch/arm/vfp/ @@ -134,7 +150,11 @@ drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/ libs-y += arch/arm/lib/ # Default target when executing plain make +ifeq ($(CONFIG_XIP_KERNEL),y) +all: xipImage +else all: zImage +endif boot := arch/arm/boot @@ -161,11 +181,11 @@ maketools: include/asm-arm/constants.h include/linux/version.h FORCE # Convert bzImage to zImage bzImage: zImage -zImage Image bootpImage uImage: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ +zImage Image xipImage bootpImage uImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ zinstall install: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $@ + $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \ include/asm-arm/arch include/asm-arm/.arch @@ -175,8 +195,8 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) # My testing targets (bypasses dependencies) -bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage -i zi:; $(Q)$(MAKE) $(build)=$(boot) $@ +bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage +i zi:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ include/asm-arm/.arch @@ -187,6 +207,7 @@ include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' + echo '* xipImage - XIP kernel image, if configured (arch/$(ARCH)/boot/xipImage)' echo ' bootpImage - Combined zImage and initial RAM disk' echo ' (supply initrd image via make variable INITRD=)' echo ' install - Install uncompressed kernel' diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index cfb4a252a..937a353bc 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -10,76 +10,38 @@ MKIMAGE := $(srctree)/scripts/mkuboot.sh +ifneq ($(MACHINE),) +include $(srctree)/$(MACHINE)/Makefile.boot +endif + # Note: the following conditions must always be true: # ZRELADDR == virt_to_phys(TEXTADDR) -# PARAMS_PHYS must be with 4MB of ZRELADDR +# PARAMS_PHYS must be within 4MB of ZRELADDR # INITRD_PHYS must be in RAM - - zreladdr-$(CONFIG_ARCH_RPC) := 0x10008000 -params_phys-$(CONFIG_ARCH_RPC) := 0x10000100 -initrd_phys-$(CONFIG_ARCH_RPC) := 0x18000000 - zreladdr-$(CONFIG_ARCH_CLPS7500) := 0x10008000 - zreladdr-$(CONFIG_ARCH_CLPS7500) := 0x10008000 - zreladdr-$(CONFIG_ARCH_EBSA110) := 0x00008000 -params_phys-$(CONFIG_ARCH_EBSA110) := 0x00000400 -initrd_phys-$(CONFIG_ARCH_EBSA110) := 0x00800000 - ztextaddr-$(CONFIG_ARCH_SHARK) := 0x08508000 - zreladdr-$(CONFIG_ARCH_SHARK) := 0x08008000 - zreladdr-$(CONFIG_FOOTBRIDGE) := 0x00008000 -params_phys-$(CONFIG_FOOTBRIDGE) := 0x00000100 -initrd_phys-$(CONFIG_FOOTBRIDGE) := 0x00800000 - zreladdr-$(CONFIG_ARCH_INTEGRATOR) := 0x00008000 -params_phys-$(CONFIG_ARCH_INTEGRATOR) := 0x00000100 -initrd_phys-$(CONFIG_ARCH_INTEGRATOR) := 0x00800000 - zreladdr-$(CONFIG_ARCH_CAMELOT) := 0x00008000 - zreladdr-$(CONFIG_ARCH_NEXUSPCI) := 0x40008000 - zreladdr-$(CONFIG_ARCH_L7200) := 0xf0008000 -# The standard locations for stuff on CLPS711x type processors - zreladdr-$(CONFIG_ARCH_CLPS711X) := 0xc0028000 -params_phys-$(CONFIG_ARCH_CLPS711X) := 0xc0000100 -# Should probably have some agreement on these... -initrd_phys-$(CONFIG_ARCH_P720T) := 0xc0400000 -initrd_phys-$(CONFIG_ARCH_CDB89712) := 0x00700000 - zreladdr-$(CONFIG_ARCH_SA1100) := 0xc0008000 -ifeq ($(CONFIG_ARCH_SA1100),y) - zreladdr-$(CONFIG_SA1111) := 0xc0208000 -endif -params_phys-$(CONFIG_ARCH_SA1100) := 0xc0000100 -initrd_phys-$(CONFIG_ARCH_SA1100) := 0xc0800000 - zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000 - zreladdr-$(CONFIG_ARCH_MX1ADS) := 0x08008000 - zreladdr-$(CONFIG_ARCH_IOP3XX) := 0xa0008000 -params_phys-$(CONFIG_ARCH_IOP3XX) := 0xa0000100 -initrd_phys-$(CONFIG_ARCH_IOP3XX) := 0xa0800000 -ifeq ($(CONFIG_ARCH_IOP331),y) - zreladdr-$(CONFIG_ARCH_IOP3XX) := 0x00008000 -params_phys-$(CONFIG_ARCH_IOP3XX) := 0x00000100 -initrd_phys-$(CONFIG_ARCH_IOP3XX) := 0x00800000 -endif - zreladdr-$(CONFIG_ARCH_IXP4XX) := 0x00008000 -params-phys-$(CONFIG_ARCH_IXP4XX) := 0x00000100 - zreladdr-$(CONFIG_ARCH_IXP2000) := 0x00008000 -params-phys-$(CONFIG_ARCH_IXP2000) := 0x00000100 - zreladdr-$(CONFIG_ARCH_OMAP) := 0x10008000 -params_phys-$(CONFIG_ARCH_OMAP) := 0x10000100 -initrd_phys-$(CONFIG_ARCH_OMAP) := 0x10800000 - zreladdr-$(CONFIG_ARCH_LH7A40X) := 0xc0008000 -params_phys-$(CONFIG_ARCH_LH7A40X) := 0xc0000100 -initrd_phys-$(CONFIG_ARCH_LH7A40X) := 0xc4000000 - zreladdr-$(CONFIG_ARCH_S3C2410) := 0x30008000 -params_phys-$(CONFIG_ARCH_S3C2410) := 0x30000100 - zreladdr-$(CONFIG_ARCH_VERSATILE_PB) := 0x00008000 -params_phys-$(CONFIG_ARCH_VERSATILE_PB) := 0x00000100 -initrd_phys-$(CONFIG_ARCH_VERSATILE_PB) := 0x00800000 - zreladdr-$(CONFIG_ARCH_H720X) := 0x40008000 - ZRELADDR := $(zreladdr-y) PARAMS_PHYS := $(params_phys-y) INITRD_PHYS := $(initrd_phys-y) export ZRELADDR INITRD_PHYS PARAMS_PHYS -targets := Image zImage bootpImage uImage +targets := Image zImage xipImage bootpImage uImage + +ifeq ($(CONFIG_XIP_KERNEL),y) + +$(obj)/xipImage: vmlinux FORCE + $(call if_changed,objcopy) + @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' + +$(obj)/Image $(obj)/zImage: FORCE + @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' + @echo 'Only the xipImage target is available in this case' + @false + +else + +$(obj)/xipImage: FORCE + @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' + @false $(obj)/Image: vmlinux FORCE $(call if_changed,objcopy) @@ -92,6 +54,8 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) @echo ' Kernel: $@ is ready' +endif + quiet_cmd_uimage = UIMAGE $@ cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ -C none -a $(ZRELADDR) -e $(ZRELADDR) \ diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index e9e0c68a3..6b505ce41 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -40,15 +40,16 @@ endif ifeq ($(CONFIG_ARCH_SA1100),y) OBJS += head-sa1100.o -ifeq ($(CONFIG_SA1100_NANOENGINE),y) - OBJS += hw-bse.o -endif endif ifeq ($(CONFIG_CPU_XSCALE),y) OBJS += head-xscale.o endif +ifeq ($(CONFIG_PXA_SHARPSL),y) +OBJS += head-sharpsl.o +endif + ifeq ($(CONFIG_DEBUG_ICEDCC),y) OBJS += ice-dcc.o endif diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S index 26f7f77cb..5aefffd46 100644 --- a/arch/arm/boot/compressed/head-sa1100.S +++ b/arch/arm/boot/compressed/head-sa1100.S @@ -16,47 +16,13 @@ __SA1100_start: @ Preserve r8/r7 i.e. kernel entry values - -#if defined(CONFIG_SA1100_GRAPHICSCLIENT) && !defined(CONFIG_ANGELBOOT) - mov r7, #MACH_TYPE_GRAPHICSCLIENT - mov r8, #0 -#endif -#if defined(CONFIG_SA1100_GRAPHICSMASTER) && !defined(CONFIG_ANGELBOOT) - mov r7, #MACH_TYPE_GRAPHICSMASTER - mov r8, #0 -#endif -#if defined(CONFIG_SA1100_ADSBITSY) && !defined(CONFIG_ANGELBOOT) - mov r7, #MACH_TYPE_ADSBITSY - mov r8, #0 -#endif - #ifdef CONFIG_SA1100_COLLIE mov r7, #MACH_TYPE_COLLIE #endif -#ifdef CONFIG_SA1100_PFS168 - @ REVISIT_PFS168: Temporary until firmware updated to use assigned machine number - mov r7, #MACH_TYPE_PFS168 -#endif #ifdef CONFIG_SA1100_SIMPAD @ UNTIL we've something like an open bootldr - mov r7, #MACH_TYPE_SIMPAD @should be 87 + mov r7, #MACH_TYPE_SIMPAD @should be 87 #endif - -#ifdef CONFIG_SA1100_VICTOR - teq r7, #MACH_TYPE_VICTOR - bne 10f - - @ Copy cmdline to 0xc0000000 - mov r1, #0xc0000000 - cmp r0, #0 - moveq r2, #0 -1: ldrneb r2, [r0], #1 - cmpne r2, #0 - strb r2, [r1], #1 - bne 1b -10: -#endif - mrc p15, 0, r0, c1, c0, 0 @ read control reg ands r0, r0, #0x0d beq 99f diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S index 637e63773..665bd2c20 100644 --- a/arch/arm/boot/compressed/head-xscale.S +++ b/arch/arm/boot/compressed/head-xscale.S @@ -34,20 +34,6 @@ __XScale_start: bic r0, r0, #0x1000 @ clear Icache mcr p15, 0, r0, c1, c0, 0 -#ifdef CONFIG_ARCH_IQ80321 - mov r7, #MACH_TYPE_IQ80321 -#endif - -#ifdef CONFIG_ARCH_IQ31244 - mov r7, #(MACH_TYPE_IQ31244 & 0xff) - orr r7, r7, #(MACH_TYPE_IQ31244 & 0xff00) -#endif - -#ifdef CONFIG_ARCH_IQ80331 - mov r7, #(MACH_TYPE_IQ80331 & 0xff) - orr r7, r7, #(MACH_TYPE_IQ80331 & 0xff00) -#endif - #ifdef CONFIG_ARCH_LUBBOCK mov r7, #MACH_TYPE_LUBBOCK #endif @@ -56,3 +42,8 @@ __XScale_start: mov r7, #MACH_TYPE_COTULLA_IDP #endif +#ifdef CONFIG_MACH_GTWX5715 + mov r7, #(MACH_TYPE_GTWX5715 & 0xff) + orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00) +#endif + diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index f560cbf35..c0e7aff3d 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -117,6 +117,14 @@ .macro writeb, rb str \rb, [r3, #0] .endm +#elif defined(CONFIG_ARCH_S3C2410) + .macro loadsp, rb + mov \rb, #0x50000000 + add \rb, \rb, #0x4000 * CONFIG_S3C2410_LOWLEVEL_UART_PORT + .endm + .macro writeb, rb + strb \rb, [r3, #0x20] + .endm #else #error no serial architecture defined #endif diff --git a/arch/arm/boot/compressed/ofw-shark.c b/arch/arm/boot/compressed/ofw-shark.c index 0d62ff36f..7f6f5db0d 100644 --- a/arch/arm/boot/compressed/ofw-shark.c +++ b/arch/arm/boot/compressed/ofw-shark.c @@ -24,6 +24,8 @@ create_params (unsigned long *buffer) int j,i,m,k,nr_banks,size; unsigned char *c; + k = 0; + /* Head of the taglist */ tag->hdr.tag = ATAG_CORE; tag->hdr.size = tag_size(tag_core); diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index 50808a4e0..ba4a9d395 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile @@ -2,10 +2,13 @@ # Makefile for the linux kernel. # +obj-y += rtctime.o obj-$(CONFIG_ARM_AMBA) += amba.o obj-$(CONFIG_ICST525) += icst525.o +obj-$(CONFIG_ICST307) += icst307.o obj-$(CONFIG_SA1111) += sa1111.o obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o obj-$(CONFIG_DMABOUNCE) += dmabounce.o obj-$(CONFIG_TIMER_ACORN) += time-acorn.o obj-$(CONFIG_SHARP_LOCOMO) += locomo.o +obj-$(CONFIG_SHARP_SCOOP) += scoop.o diff --git a/arch/arm/common/amba.c b/arch/arm/common/amba.c index f7ddb16e9..a0507f8c3 100644 --- a/arch/arm/common/amba.c +++ b/arch/arm/common/amba.c @@ -59,7 +59,7 @@ static int amba_hotplug(struct device *dev, char **envp, int nr_env, char *buf, #define amba_hotplug NULL #endif -static int amba_suspend(struct device *dev, u32 state) +static int amba_suspend(struct device *dev, pm_message_t state) { struct amba_driver *drv = to_amba_driver(dev->driver); int ret = 0; @@ -194,7 +194,7 @@ amba_attr(resource, "\t%08lx\t%08lx\t%08lx\n", int amba_device_register(struct amba_device *dev, struct resource *parent) { u32 pid, cid; - void *tmp; + void __iomem *tmp; int i, ret; dev->dev.release = amba_device_release; diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 46550ddde..34c8cf33a 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -609,17 +609,15 @@ static void __locomo_remove(struct locomo *lchip) static int locomo_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); - struct resource *mem = NULL, *irq = NULL; - int i; - - for (i = 0; i < pdev->num_resources; i++) { - if (pdev->resource[i].flags & IORESOURCE_MEM) - mem = &pdev->resource[i]; - if (pdev->resource[i].flags & IORESOURCE_IRQ) - irq = &pdev->resource[i]; - } + struct resource *mem; + int irq; - return __locomo_probe(dev, mem, irq ? irq->start : NO_IRQ); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!mem) + return -EINVAL; + irq = platform_get_irq(pdev, 0); + + return __locomo_probe(dev, mem, irq); } static int locomo_remove(struct device *dev) @@ -629,9 +627,6 @@ static int locomo_remove(struct device *dev) if (lchip) { __locomo_remove(lchip); dev_set_drvdata(dev, NULL); - - kfree(dev->saved_state); - dev->saved_state = NULL; } return 0; @@ -673,7 +668,7 @@ static int locomo_match(struct device *_dev, struct device_driver *_drv) return dev->devid == drv->devid; } -static int locomo_bus_suspend(struct device *dev, u32 state) +static int locomo_bus_suspend(struct device *dev, pm_message_t state) { struct locomo_dev *ldev = LOCOMO_DEV(dev); struct locomo_driver *drv = LOCOMO_DRV(dev->driver); @@ -756,7 +751,7 @@ module_exit(locomo_exit); MODULE_DESCRIPTION("Sharp LoCoMo core driver"); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("John Lenz "); +MODULE_AUTHOR("John Lenz "); EXPORT_SYMBOL(locomo_driver_register); EXPORT_SYMBOL(locomo_driver_unregister); diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c index dc170b3c6..812dac1fa 100644 --- a/arch/arm/common/rtctime.c +++ b/arch/arm/common/rtctime.c @@ -28,7 +28,7 @@ static struct fasync_struct *rtc_async_queue; /* * rtc_lock protects rtc_irq_data */ -static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(rtc_lock); static unsigned long rtc_irq_data; /* diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index acc7d1af7..37a39f229 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -53,7 +53,7 @@ struct sa1111 { unsigned long phys; int irq; spinlock_t lock; - void *base; + void __iomem *base; }; /* @@ -141,15 +141,16 @@ static void sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { unsigned int stat0, stat1, i; + void __iomem *base = desc->data; - stat0 = sa1111_readl(desc->data + SA1111_INTSTATCLR0); - stat1 = sa1111_readl(desc->data + SA1111_INTSTATCLR1); + stat0 = sa1111_readl(base + SA1111_INTSTATCLR0); + stat1 = sa1111_readl(base + SA1111_INTSTATCLR1); - sa1111_writel(stat0, desc->data + SA1111_INTSTATCLR0); + sa1111_writel(stat0, base + SA1111_INTSTATCLR0); desc->chip->ack(irq); - sa1111_writel(stat1, desc->data + SA1111_INTSTATCLR1); + sa1111_writel(stat1, base + SA1111_INTSTATCLR1); if (stat0 == 0 && stat1 == 0) { do_bad_IRQ(irq, desc, regs); @@ -177,7 +178,7 @@ static void sa1111_ack_irq(unsigned int irq) static void sa1111_mask_lowirq(unsigned int irq) { - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ie0; ie0 = sa1111_readl(mapbase + SA1111_INTEN0); @@ -187,7 +188,7 @@ static void sa1111_mask_lowirq(unsigned int irq) static void sa1111_unmask_lowirq(unsigned int irq) { - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ie0; ie0 = sa1111_readl(mapbase + SA1111_INTEN0); @@ -205,7 +206,7 @@ static void sa1111_unmask_lowirq(unsigned int irq) static int sa1111_retrigger_lowirq(unsigned int irq) { unsigned int mask = SA1111_IRQMASK_LO(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ip0; int i; @@ -226,7 +227,7 @@ static int sa1111_retrigger_lowirq(unsigned int irq) static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) { unsigned int mask = SA1111_IRQMASK_LO(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ip0; if (flags == IRQT_PROBE) @@ -249,7 +250,7 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) { unsigned int mask = SA1111_IRQMASK_LO(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long we0; we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); @@ -273,7 +274,7 @@ static struct irqchip sa1111_low_chip = { static void sa1111_mask_highirq(unsigned int irq) { - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ie1; ie1 = sa1111_readl(mapbase + SA1111_INTEN1); @@ -283,7 +284,7 @@ static void sa1111_mask_highirq(unsigned int irq) static void sa1111_unmask_highirq(unsigned int irq) { - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ie1; ie1 = sa1111_readl(mapbase + SA1111_INTEN1); @@ -301,7 +302,7 @@ static void sa1111_unmask_highirq(unsigned int irq) static int sa1111_retrigger_highirq(unsigned int irq) { unsigned int mask = SA1111_IRQMASK_HI(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ip1; int i; @@ -322,7 +323,7 @@ static int sa1111_retrigger_highirq(unsigned int irq) static int sa1111_type_highirq(unsigned int irq, unsigned int flags) { unsigned int mask = SA1111_IRQMASK_HI(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long ip1; if (flags == IRQT_PROBE) @@ -345,7 +346,7 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags) static int sa1111_wake_highirq(unsigned int irq, unsigned int on) { unsigned int mask = SA1111_IRQMASK_HI(irq); - void *mapbase = get_irq_chipdata(irq); + void __iomem *mapbase = get_irq_chipdata(irq); unsigned long we1; we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); @@ -369,7 +370,7 @@ static struct irqchip sa1111_high_chip = { static void sa1111_setup_irq(struct sa1111 *sachip) { - void *irqbase = sachip->base + SA1111_INTC; + void __iomem *irqbase = sachip->base + SA1111_INTC; unsigned int irq; /* @@ -723,7 +724,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) static void __sa1111_remove(struct sa1111 *sachip) { struct list_head *l, *n; - void *irqbase = sachip->base + SA1111_INTC; + void __iomem *irqbase = sachip->base + SA1111_INTC; list_for_each_safe(l, n, &sachip->dev->children) { struct device *d = list_to_dev(l); @@ -797,22 +798,23 @@ struct sa1111_save_data { unsigned int wakeen1; }; +#ifdef CONFIG_PM + static int sa1111_suspend(struct device *dev, u32 state, u32 level) { struct sa1111 *sachip = dev_get_drvdata(dev); struct sa1111_save_data *save; unsigned long flags; unsigned int val; - char *base; + void __iomem *base; if (level != SUSPEND_DISABLE) return 0; - dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); - if (!dev->saved_state) + save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); + if (!save) return -ENOMEM; - - save = (struct sa1111_save_data *)dev->saved_state; + dev->power.saved_state = save; spin_lock_irqsave(&sachip->lock, flags); @@ -865,12 +867,12 @@ static int sa1111_resume(struct device *dev, u32 level) struct sa1111 *sachip = dev_get_drvdata(dev); struct sa1111_save_data *save; unsigned long flags, id; - char *base; + void __iomem *base; if (level != RESUME_ENABLE) return 0; - save = (struct sa1111_save_data *)dev->saved_state; + save = (struct sa1111_save_data *)dev->power.saved_state; if (!save) return 0; @@ -915,12 +917,17 @@ static int sa1111_resume(struct device *dev, u32 level) spin_unlock_irqrestore(&sachip->lock, flags); - dev->saved_state = NULL; + dev->power.saved_state = NULL; kfree(save); return 0; } +#else +#define sa1111_suspend NULL +#define sa1111_resume NULL +#endif + static int sa1111_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -943,8 +950,10 @@ static int sa1111_remove(struct device *dev) __sa1111_remove(sachip); dev_set_drvdata(dev, NULL); - kfree(dev->saved_state); - dev->saved_state = NULL; +#ifdef CONFIG_PM + kfree(dev->power.saved_state); + dev->power.saved_state = NULL; +#endif } return 0; @@ -1086,7 +1095,7 @@ void sa1111_set_io_dir(struct sa1111_dev *sadev, struct sa1111 *sachip = sa1111_chip_driver(sadev); unsigned long flags; unsigned int val; - void *gpio = sachip->base + SA1111_GPIO; + void __iomem *gpio = sachip->base + SA1111_GPIO; #define MODIFY_BITS(port, mask, dir) \ if (mask) { \ @@ -1112,7 +1121,7 @@ void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v) struct sa1111 *sachip = sa1111_chip_driver(sadev); unsigned long flags; unsigned int val; - void *gpio = sachip->base + SA1111_GPIO; + void __iomem *gpio = sachip->base + SA1111_GPIO; spin_lock_irqsave(&sachip->lock, flags); MODIFY_BITS(gpio + SA1111_GPIO_PADWR, bits & 15, v); @@ -1126,7 +1135,7 @@ void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned i struct sa1111 *sachip = sa1111_chip_driver(sadev); unsigned long flags; unsigned int val; - void *gpio = sachip->base + SA1111_GPIO; + void __iomem *gpio = sachip->base + SA1111_GPIO; spin_lock_irqsave(&sachip->lock, flags); MODIFY_BITS(gpio + SA1111_GPIO_PASSR, bits & 15, v); @@ -1185,7 +1194,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv) return dev->devid == drv->devid; } -static int sa1111_bus_suspend(struct device *dev, u32 state) +static int sa1111_bus_suspend(struct device *dev, pm_message_t state) { struct sa1111_dev *sadev = SA1111_DEV(dev); struct sa1111_driver *drv = SA1111_DRV(dev->driver); diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c index eb0628296..486add853 100644 --- a/arch/arm/common/time-acorn.c +++ b/arch/arm/common/time-acorn.c @@ -15,6 +15,7 @@ */ #include #include +#include #include #include @@ -22,7 +23,7 @@ #include -static unsigned long ioctime_gettimeoffset(void) +unsigned long ioc_timer_gettimeoffset(void) { unsigned int count1, count2, status; long offset; @@ -62,6 +63,34 @@ void __init ioctime_init(void) ioc_writeb(LATCH & 255, IOC_T0LTCHL); ioc_writeb(LATCH >> 8, IOC_T0LTCHH); ioc_writeb(0, IOC_T0GO); +} + +static irqreturn_t +ioc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + write_seqlock(&xtime_lock); + timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; +} + +static struct irqaction ioc_timer_irq = { + .name = "timer", + .flags = SA_INTERRUPT, + .handler = ioc_timer_interrupt +}; - gettimeoffset = ioctime_gettimeoffset; +/* + * Set up timer interrupt. + */ +static void __init ioc_timer_init(void) +{ + ioctime_init(); + setup_irq(IRQ_TIMER, &ioc_timer_irq); } + +struct sys_timer ioc_timer = { + .init = ioc_timer_init, + .offset = ioc_timer_gettimeoffset, +}; + diff --git a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c index b9d972397..ef716a5b0 100644 --- a/arch/arm/common/via82c505.c +++ b/arch/arm/common/via82c505.c @@ -59,7 +59,7 @@ static struct pci_ops via82c505_ops = { .write = via82c505_write_config, }; -void __init via82c505_preinit(void *sysdata) +void __init via82c505_preinit(void) { printk(KERN_DEBUG "PCI: VIA 82c505\n"); if (!request_region(0xA8,2,"via config")) { diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig index 45deb459d..dc986cace 100644 --- a/arch/arm/configs/bast_defconfig +++ b/arch/arm/configs/bast_defconfig @@ -1,31 +1,35 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc2 +# Mon Nov 15 15:32:48 2004 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set -CONFIG_STANDALONE=y CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_LOG_BUF_SHIFT=17 +CONFIG_LOG_BUF_SHIFT=16 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -33,11 +37,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,6 +52,7 @@ CONFIG_MODULES=y # CONFIG_MODULE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -60,6 +67,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -68,15 +76,28 @@ CONFIG_ARCH_S3C2410=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # -# S3C2410 Implementations +# S3C24XX Implementations # CONFIG_ARCH_BAST=y # CONFIG_ARCH_H1940 is not set # CONFIG_ARCH_SMDK2410 is not set CONFIG_MACH_VR1000=y +# CONFIG_MACH_RX3715 is not set +CONFIG_CPU_S3C2410=y + +# +# S3C2410 Setup +# +CONFIG_S3C2410_DMA=y +# CONFIG_S3C2410_DMA_DEBUG is not set +# CONFIG_S3C2410_PM_DEBUG is not set +# CONFIG_S3C2410_PM_CHECK is not set +CONFIG_S3C2410_LOWLEVEL_UART_PORT=0 # # Processor Type @@ -86,6 +107,7 @@ CONFIG_CPU_ARM920T=y CONFIG_CPU_32v4=y CONFIG_CPU_ABRT_EV4T=y CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_COPY_V4WB=y CONFIG_CPU_TLB_V4WBI=y @@ -103,14 +125,14 @@ CONFIG_CPU_TLB_V4WBI=y # CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set # # At least one math emulation must be selected # CONFIG_FPE_NWFPE=y -CONFIG_FPE_NWFPE_XP=y +# CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -118,13 +140,13 @@ CONFIG_BINFMT_AOUT=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_DEBUG_DRIVER is not set -# CONFIG_PM is not set +CONFIG_PM=y # CONFIG_PREEMPT is not set +CONFIG_APM=y # CONFIG_ARTHUR is not set -CONFIG_S3C2410_DMA=y -# CONFIG_S3C2410_DMA_DEBUG is not set CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0" CONFIG_ALIGNMENT_TRAP=y @@ -132,10 +154,7 @@ CONFIG_ALIGNMENT_TRAP=y # Parallel port support # CONFIG_PARPORT=y -CONFIG_PARPORT_PC=y -CONFIG_PARPORT_PC_CML1=y -CONFIG_PARPORT_PC_FIFO=y -CONFIG_PARPORT_PC_SUPERIO=y +# CONFIG_PARPORT_PC is not set # CONFIG_PARPORT_ARC is not set CONFIG_PARPORT_OTHER=y CONFIG_PARPORT_1284=y @@ -145,8 +164,13 @@ CONFIG_PARPORT_1284=y # CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_PARTITIONS is not set +CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set # # User Modules And Translation Layers @@ -161,12 +185,23 @@ CONFIG_MTD_BLOCK=y # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_JEDECPROBE=y CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +CONFIG_MTD_MAP_BANK_WIDTH_16=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_CFI_AMDSTD is not set # CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set @@ -179,11 +214,15 @@ CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set +# CONFIG_MTD_IMPA7 is not set +CONFIG_MTD_BAST=y +CONFIG_MTD_BAST_MAXSIZE=4 # # Self-contained MTD device drivers # # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set @@ -197,7 +236,13 @@ CONFIG_MTD_CFI_INTELEXT=y # # NAND Flash Device Drivers # -# CONFIG_MTD_NAND is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_S3C2410=y +# CONFIG_MTD_NAND_S3C2410_DEBUG is not set +# CONFIG_MTD_NAND_S3C2410_HWECC is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set # # Plug and Play support @@ -214,6 +259,16 @@ CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) @@ -246,6 +301,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -265,7 +323,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -338,13 +395,13 @@ CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDETAPE=m CONFIG_BLK_DEV_IDEFLOPPY=m # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDE_BAST=y # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set # CONFIG_BLK_DEV_HD is not set @@ -395,16 +452,16 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y -# CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ATKBD is not set +CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set @@ -431,8 +488,6 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set -# CONFIG_ISI is not set -# CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set # CONFIG_RISCOM8 is not set @@ -459,7 +514,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_S3C2410=y CONFIG_SERIAL_S3C2410_CONSOLE=y -# CONFIG_SERIAL_BAST_SIO is not set +CONFIG_SERIAL_BAST_SIO=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y @@ -469,7 +524,6 @@ CONFIG_PRINTER=y # CONFIG_LP_CONSOLE is not set CONFIG_PPDEV=y # CONFIG_TIPAR is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -479,18 +533,23 @@ CONFIG_PPDEV=y # # Watchdog Cards # -# CONFIG_WATCHDOG is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_S3C2410_WATCHDOG=y # CONFIG_NVRAM is not set -CONFIG_RTC=y +# CONFIG_RTC is not set +CONFIG_S3C2410_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -505,35 +564,42 @@ CONFIG_I2C_CHARDEV=m # CONFIG_I2C_ALGOBIT=m # CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_ISA is not set # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_SCx200_ACB is not set +CONFIG_I2C_S3C2410=y +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # CONFIG_I2C_SENSOR=m # CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set CONFIG_SENSORS_LM75=m +# CONFIG_SENSORS_LM77 is not set CONFIG_SENSORS_LM78=m # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set CONFIG_SENSORS_LM85=m +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set @@ -578,6 +644,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -621,9 +688,14 @@ CONFIG_RAMFS=y # CONFIG_EFS_FS is not set CONFIG_JFFS_FS=y CONFIG_JFFS_FS_VERBOSE=0 +# CONFIG_JFFS_PROC_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set @@ -644,6 +716,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -654,13 +727,7 @@ CONFIG_SUNRPC=y # Partition Types # CONFIG_PARTITION_ADVANCED=y -CONFIG_ACORN_PARTITION=y -CONFIG_ACORN_PARTITION_CUMANA=y -CONFIG_ACORN_PARTITION_EESOX=y -CONFIG_ACORN_PARTITION_ICS=y -CONFIG_ACORN_PARTITION_ADFS=y -CONFIG_ACORN_PARTITION_POWERTEC=y -CONFIG_ACORN_PARTITION_RISCIX=y +# CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set @@ -729,13 +796,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Graphics support # CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE is not set @@ -756,24 +824,34 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # -CONFIG_FRAME_POINTER=y -CONFIG_DEBUG_USER=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set # CONFIG_MAGIC_SYSRQ is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_WAITQ is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_BUGVERBOSE is not set +CONFIG_DEBUG_INFO=y +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_WAITQ is not set # CONFIG_DEBUG_ERRORS is not set CONFIG_DEBUG_LL=y # CONFIG_DEBUG_ICEDCC is not set @@ -783,6 +861,7 @@ CONFIG_DEBUG_S3C2410_UART=0 # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/arm/configs/ebsa110_defconfig b/arch/arm/configs/ebsa110_defconfig index 68f4047fc..5296812f8 100644 --- a/arch/arm/configs/ebsa110_defconfig +++ b/arch/arm/configs/ebsa110_defconfig @@ -239,7 +239,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y diff --git a/arch/arm/configs/ep80219_defconfig b/arch/arm/configs/ep80219_defconfig index fc4dbc248..2659f0d32 100644 --- a/arch/arm/configs/ep80219_defconfig +++ b/arch/arm/configs/ep80219_defconfig @@ -1,10 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10 +# Thu Jan 6 10:54:33 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -16,6 +19,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +29,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,6 +52,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -59,6 +67,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -67,7 +76,9 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # # IOP3xx Implementation Options @@ -79,6 +90,7 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IQ80321 is not set CONFIG_ARCH_IQ31244=y # CONFIG_ARCH_IQ80331 is not set +# CONFIG_MACH_IQ80332 is not set CONFIG_ARCH_EP80219=y CONFIG_ARCH_IOP321=y # CONFIG_ARCH_IOP331 is not set @@ -94,6 +106,7 @@ CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_MINICACHE=y @@ -107,9 +120,9 @@ CONFIG_XSCALE_PMU=y # General setup # CONFIG_PCI=y -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y @@ -119,7 +132,6 @@ CONFIG_PCI_NAMES=y CONFIG_FPE_NWFPE=y # CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -132,7 +144,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_PM is not set # CONFIG_PREEMPT is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=128M@0xa0000000" +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" CONFIG_ALIGNMENT_TRAP=y # @@ -148,8 +160,8 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set -# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set @@ -191,7 +203,10 @@ CONFIG_MTD_CFI_UTIL=y # Mapping drivers for chip access # # CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_START=0xf0000000 +CONFIG_MTD_PHYSMAP_LEN=0x00800000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set @@ -232,8 +247,19 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) @@ -243,9 +269,11 @@ CONFIG_BLK_DEV_MD=y # CONFIG_MD_LINEAR is not set CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=y # CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=y # CONFIG_DM_CRYPT is not set # CONFIG_DM_SNAPSHOT is not set @@ -280,6 +308,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -299,7 +330,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -362,19 +392,20 @@ CONFIG_E100_NAPI=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set -# CONFIG_E1000 is not set +CONFIG_E1000=y +CONFIG_E1000_NAPI=y # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -449,7 +480,8 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -458,6 +490,7 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -505,7 +538,7 @@ CONFIG_INPUT=y # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set @@ -519,7 +552,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set -# CONFIG_SERIO_I8042 is not set # # Input Device Drivers @@ -554,7 +586,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -567,7 +598,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -575,7 +605,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -590,6 +619,7 @@ CONFIG_I2C_CHARDEV=y # # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support @@ -612,9 +642,11 @@ CONFIG_I2C_IOP3XX=y # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support @@ -622,20 +654,25 @@ CONFIG_I2C_IOP3XX=y # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set @@ -685,6 +722,7 @@ CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -709,6 +747,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -754,6 +793,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -799,7 +839,6 @@ CONFIG_MSDOS_PARTITION=y # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # @@ -815,23 +854,35 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_INFO is not set CONFIG_FRAME_POINTER=y CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_KERNEL is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/arm/configs/integrator_defconfig b/arch/arm/configs/integrator_defconfig index 8e2413266..5efaeef3e 100644 --- a/arch/arm/configs/integrator_defconfig +++ b/arch/arm/configs/integrator_defconfig @@ -1,139 +1,167 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc3 +# Mon Dec 20 16:08:21 2004 # CONFIG_ARM=y -# CONFIG_EISA is not set -# CONFIG_SBUS is not set -# CONFIG_MCA is not set +CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_OBSOLETE is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set -# CONFIG_KMOD is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y # # System Type # -# CONFIG_ARCH_ARCA5K is not set # CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_CAMELOT is not set # CONFIG_ARCH_FOOTBRIDGE is not set CONFIG_ARCH_INTEGRATOR=y +# CONFIG_ARCH_IOP3XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set # CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_CLPS711X is not set - -# -# Archimedes/A5000 Implementations -# +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # -# Archimedes/A5000 Implementations (select only ONE) +# Integrator Options # -# CONFIG_ARCH_ARC is not set -# CONFIG_ARCH_A5K is not set - -# -# Footbridge Implementations -# -# CONFIG_ARCH_CATS is not set -# CONFIG_ARCH_PERSONAL_SERVER is not set -# CONFIG_ARCH_EBSA285_ADDIN is not set -# CONFIG_ARCH_EBSA285_HOST is not set -# CONFIG_ARCH_NETWINDER is not set - -# -# SA11x0 Implementations -# -# CONFIG_SA1100_ASSABET is not set -# CONFIG_ASSABET_NEPONSET is not set -# CONFIG_SA1100_BRUTUS is not set -# CONFIG_SA1100_CERF is not set -# CONFIG_SA1100_BITSY is not set -# CONFIG_SA1100_EXTENEX1 is not set -# CONFIG_SA1100_FREEBIRD is not set -# CONFIG_SA1100_GRAPHICSCLIENT is not set -# CONFIG_SA1100_JORNADA720 is not set -# CONFIG_SA1100_HUW_WEBPANEL is not set -# CONFIG_SA1100_ITSY is not set -# CONFIG_SA1100_LART is not set -# CONFIG_SA1100_NANOENGINE is not set -# CONFIG_SA1100_OMNIMETER is not set -# CONFIG_SA1100_PANGOLIN is not set -# CONFIG_SA1100_PLEB is not set -# CONFIG_SA1100_SHERMAN is not set -# CONFIG_SA1100_PFS168 is not set -# CONFIG_SA1100_VICTOR is not set -# CONFIG_SA1100_XP860 is not set -# CONFIG_SA1100_YOPY is not set - -# -# CLPS711X/EP721X Implementations -# -# CONFIG_ARCH_P720T is not set -# CONFIG_ARCH_ACORN is not set -# CONFIG_FOOTBRIDGE is not set -# CONFIG_FOOTBRIDGE_HOST is not set -# CONFIG_FOOTBRIDGE_ADDIN is not set -CONFIG_CPU_32=y -# CONFIG_CPU_26 is not set +CONFIG_ARCH_INTEGRATOR_AP=y +# CONFIG_ARCH_INTEGRATOR_CP is not set +# CONFIG_INTEGRATOR_IMPD1 is not set # # Processor Type # -# CONFIG_CPU_32v3 is not set -CONFIG_CPU_32v4=y -# CONFIG_CPU_ARM610 is not set -# CONFIG_CPU_ARM710 is not set +CONFIG_CPU_32=y CONFIG_CPU_ARM720T=y CONFIG_CPU_ARM920T=y -CONFIG_CPU_ARM920_CPU_IDLE=y -CONFIG_CPU_ARM920_I_CACHE_ON=y -CONFIG_CPU_ARM920_D_CACHE_ON=y -# CONFIG_CPU_ARM920_WRITETHROUGH is not set +# CONFIG_CPU_ARM926T is not set # CONFIG_CPU_ARM1020 is not set -# CONFIG_CPU_SA110 is not set -# CONFIG_CPU_SA1100 is not set -# CONFIG_DISCONTIGMEM is not set +# CONFIG_CPU_ARM1022 is not set +# CONFIG_CPU_ARM1026 is not set +# CONFIG_CPU_V6 is not set +CONFIG_CPU_32v4=y +CONFIG_CPU_ABRT_EV4T=y +CONFIG_CPU_ABRT_LV4T=y +CONFIG_CPU_CACHE_V4=y +CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WT=y +CONFIG_CPU_TLB_V4WBI=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set # # General setup # -CONFIG_PCI_INTEGRATOR=y CONFIG_PCI=y -# CONFIG_ISA is not set -# CONFIG_ISA_DMA is not set -CONFIG_CPU_CLOCK=y +CONFIG_ICST525=y +CONFIG_ARM_AMBA=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +# CONFIG_CPU_FREQ_PROC_INTF is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +# CONFIG_CPU_FREQ_24_API is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_INTEGRATOR=y +CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y -# CONFIG_HOTPLUG is not set -# CONFIG_PCMCIA is not set -CONFIG_NET=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_FPE_NWFPE is not set -CONFIG_FPE_FASTFPE=y -CONFIG_KCORE_ELF=y -# CONFIG_KCORE_AOUT is not set -CONFIG_BINFMT_AOUT=y + +# +# At least one math emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_DEBUG_DRIVER is not set CONFIG_PM=y +# CONFIG_PREEMPT is not set +# CONFIG_APM is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="root=1f03 mem=32M" +CONFIG_CMDLINE="console=ttyAM0,38400n8 root=/dev/nfs ip=bootp mem=32M" CONFIG_LEDS=y CONFIG_LEDS_TIMER=y CONFIG_LEDS_CPU=y @@ -150,8 +178,9 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_CONCAT is not set # CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_BOOTLDR_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_AFS_PARTS=y # @@ -161,259 +190,264 @@ CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set +# CONFIG_INFTL is not set # # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=y -# CONFIG_MTD_CFI_VIRTUAL_ER is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_NOSWAP=y # CONFIG_MTD_CFI_BE_BYTE_SWAP is not set # CONFIG_MTD_CFI_LE_BYTE_SWAP is not set -# CONFIG_MTD_CFI_LART_BIT_SWAP is not set # CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_CFI_AMDSTD is not set -# CONFIG_MTD_AMDSTD is not set -# CONFIG_MTD_SHARP is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set -# CONFIG_MTD_JEDEC is not set +# CONFIG_MTD_ABSENT is not set # # Mapping drivers for chip access # +# CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_SUN_UFLASH is not set -# CONFIG_MTD_NORA is not set -# CONFIG_MTD_PNC2000 is not set -# CONFIG_MTD_RPXLITE is not set -# CONFIG_MTD_SC520CDP is not set -# CONFIG_MTD_NETSC520 is not set -# CONFIG_MTD_SBC_GXX is not set -# CONFIG_MTD_ELAN_104NC is not set -# CONFIG_MTD_SA1100 is not set -# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set -# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set -# CONFIG_MTD_DC21285 is not set -# CONFIG_MTD_IQ80310 is not set -# CONFIG_MTD_DBOX2 is not set -# CONFIG_MTD_CSTM_MIPS_IXX is not set -# CONFIG_MTD_CFI_FLAGADM is not set -# CONFIG_MTD_MIXMEM is not set -# CONFIG_MTD_OCTAGON is not set -# CONFIG_MTD_VMAX is not set -CONFIG_MTD_ARMFLASH=y +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_EDB7312 is not set # # Self-contained MTD device drivers # # CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set # # Disk-On-Chip Device Drivers # -# CONFIG_MTD_DOC1000 is not set # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOCPROBE is not set +# CONFIG_MTD_DOC2001PLUS is not set # # NAND Flash Device Drivers # # CONFIG_MTD_NAND is not set -# CONFIG_MTD_NAND_SPIA is not set # -# Plug and Play configuration +# Plug and Play support # -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set # # Block devices # # CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set -# CONFIG_BLK_DEV_MD is not set -# CONFIG_MD_LINEAR is not set -# CONFIG_MD_RAID0 is not set -# CONFIG_MD_RAID1 is not set -# CONFIG_MD_RAID5 is not set -# CONFIG_BLK_DEV_LVM is not set + +# +# Networking support +# +CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y -CONFIG_NETLINK=y -# CONFIG_RTNETLINK is not set # CONFIG_NETLINK_DEV is not set -# CONFIG_NETFILTER is not set -# CONFIG_FILTER is not set CONFIG_UNIX=y +# CONFIG_NET_KEY is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y -# CONFIG_IP_PNP_DHCP is not set +CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set -CONFIG_INET_ECN=y +# CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set -# CONFIG_KHTTPD is not set -# CONFIG_ATM is not set +# CONFIG_NETFILTER is not set # -# +# SCTP Configuration (EXPERIMENTAL) # +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_LLC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # -# Network device support +# Network testing # +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_ETHERTAP is not set -# CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set -# CONFIG_LANCE is not set -# CONFIG_NET_VENDOR_SMC is not set -# CONFIG_NET_VENDOR_RACAL is not set -# CONFIG_AT1700 is not set -# CONFIG_DEPCA is not set +# CONFIG_SMC91X is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set -# CONFIG_NET_ISA 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_APRICOT is not set -# CONFIG_CS89x0 is not set -# CONFIG_TULIP is not set -# CONFIG_DE4X5 is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set -# CONFIG_DM9102 is not set -CONFIG_EEPRO100=y -CONFIG_EEPRO100_PM=y -# CONFIG_LNE390 is not set +# CONFIG_EEPRO100 is not set +CONFIG_E100=y +# CONFIG_E100_NAPI is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set -# CONFIG_NE3210 is not set -# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set # CONFIG_8139TOO is not set -# CONFIG_8139TOO_PIO is not set -# CONFIG_8139TOO_TUNE_TWISTER is not set -# CONFIG_8139TOO_8129 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_WINBOND_840 is not set -# CONFIG_HAPPYMEAL is not set -# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set # CONFIG_SK98LIN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_TIGON3 is not set # -# Wireless LAN (non-hamradio) +# Ethernet (10000 Mbit) # -# CONFIG_NET_RADIO is not set +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set -# CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set # -# Wan interfaces -# -# CONFIG_WAN is not set - -# -# Amateur Radio support +# Wireless LAN (non-hamradio) # -# CONFIG_HAMRADIO is not set +# CONFIG_NET_RADIO is not set # -# IrDA (infrared) support +# Wan interfaces # -# CONFIG_IRDA 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 # -# ATA/IDE/MFM/RLL support +# SCSI device support # -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_HD is not set +# CONFIG_SCSI is not set # -# SCSI support +# Fusion MPT device support # -# CONFIG_SCSI is not set # # IEEE 1394 (FireWire) support @@ -424,11 +458,6 @@ CONFIG_EEPRO100_PM=y # I2O device support # # CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set # # ISDN subsystem @@ -436,62 +465,85 @@ CONFIG_EEPRO100_PM=y # CONFIG_ISDN is not set # -# Input core support +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +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 + +# +# Input I/O drivers # -# CONFIG_INPUT is not set +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +CONFIG_SERIO=y +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_AMBAKMI is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set +CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_SERIAL_21285 is not set -# CONFIG_SERIAL_21285_OLD is not set -# CONFIG_SERIAL_21285_CONSOLE is not set -# CONFIG_SERIAL_SA1100 is not set -# CONFIG_SERIAL_SA1100_CONSOLE is not set -CONFIG_SERIAL_AMBA=y -CONFIG_SERIAL_AMBA_CONSOLE=y -CONFIG_SERIAL_INTEGRATOR=y -# CONFIG_SERIAL_CLPS711X is not set -# CONFIG_SERIAL_CLPS711X_CONSOLE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 # -# I2C support +# Serial drivers # -# CONFIG_I2C is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -CONFIG_MOUSE=y -CONFIG_PSMOUSE=y -# CONFIG_82C710_MOUSE is not set -# CONFIG_PC110_PAD is not set +# CONFIG_SERIAL_8250 is not set # -# Joysticks +# Non-8250 serial port support # -# CONFIG_JOYSTICK is not set +CONFIG_SERIAL_AMBA_PL010=y +CONFIG_SERIAL_AMBA_PL010_CONSOLE=y +# CONFIG_SERIAL_AMBA_PL011 is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 # -# Input core support is needed for joysticks +# IPMI # -# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_DTLK is not set @@ -501,85 +553,114 @@ CONFIG_PSMOUSE=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +# CONFIG_I2C is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + # # File systems # +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_REISERFS_CHECK is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# # CONFIG_ADFS_FS is not set -# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set -# CONFIG_FAT_FS is not set -# CONFIG_MSDOS_FS is not set -# CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 -# CONFIG_CRAMFS is not set -# CONFIG_TMPFS is not set -# CONFIG_RAMFS is not set -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set -CONFIG_MINIX_FS=y +# CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_CRAMFS=y # CONFIG_VXFS_FS is not set -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set -CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -# CONFIG_DEVFS_MOUNT is not set -# CONFIG_DEVFS_DEBUG is not set -CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -# CONFIG_QNX4FS_RW is not set -CONFIG_ROMFS_FS=y -CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_SYSV_FS_WRITE is not set -# CONFIG_UDF_FS is not set -# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set -# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # -# CONFIG_CODA_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y -CONFIG_SUNRPC=y +# CONFIG_NFSD_V4 is not set +# CONFIG_NFSD_TCP is not set +CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set # CONFIG_NCP_FS is not set -# CONFIG_NCPFS_PACKET_SIGNING is not set -# CONFIG_NCPFS_IOCTL_LOCKING is not set -# CONFIG_NCPFS_STRONG is not set -# CONFIG_NCPFS_NFS_NS is not set -# CONFIG_NCPFS_OS2_NS is not set -# CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_NLS is not set -# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set # # Partition Types @@ -590,71 +671,134 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set -# CONFIG_MSDOS_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set -# CONFIG_SMB_NLS is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# # CONFIG_NLS is not set # -# Console drivers +# Profiling support # -CONFIG_KMI_KEYB=y -CONFIG_KMI_MOUSE=y -CONFIG_PC_KEYMAP=y -CONFIG_VGA_CONSOLE=y -CONFIG_FB=y +# CONFIG_PROFILING is not set # -# Frame-buffer support +# Graphics support # CONFIG_FB=y -CONFIG_DUMMY_CONSOLE=y -# CONFIG_FB_RIVA is not set -# CONFIG_FB_CLGEN is not set +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set -# CONFIG_FB_ACORN is not set -# CONFIG_FB_CLPS711X is not set +# CONFIG_FB_ARMCLCD is not set # CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_SA1100 is not set -# CONFIG_FB_E1355 is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_ATY is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_RIVA is not set +CONFIG_FB_MATROX=y +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G450=y +CONFIG_FB_MATROX_G100=y +CONFIG_FB_MATROX_MULTIHEAD=y +# CONFIG_FB_RADEON_OLD is not set +# CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set -# CONFIG_FB_3DFX is not set +# CONFIG_FB_ATY 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_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set -# CONFIG_FBCON_ADVANCED is not set -# CONFIG_FBCON_FONTWIDTH8_ONLY is not set -CONFIG_FBCON_FONTS=y -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -# CONFIG_FONT_SUN8x16 is not set -# CONFIG_FONT_SUN12x22 is not set -# CONFIG_FONT_6x11 is not set -# CONFIG_FONT_PEARL_8x8 is not set -# CONFIG_FONT_ACORN_8x8 is not set + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +CONFIG_DUMMY_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE is not set + +# +# Logo configuration +# +# CONFIG_LOGO is not set # # Sound # # CONFIG_SOUND is not set +# +# Misc devices +# + # # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set # # Kernel hacking # +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_INFO is not set CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_WAITQ is not set CONFIG_DEBUG_ERRORS=y -CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -CONFIG_MAGIC_SYSRQ=y -# CONFIG_NO_PGT_CACHE is not set -CONFIG_DEBUG_LL=y -# CONFIG_DEBUG_DC21285_PORT is not set -# CONFIG_DEBUG_CLPS711X_UART2 is not set +# CONFIG_DEBUG_LL is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff --git a/arch/arm/configs/iq31244_defconfig b/arch/arm/configs/iq31244_defconfig index 64ebb89b6..5dd8397ca 100644 --- a/arch/arm/configs/iq31244_defconfig +++ b/arch/arm/configs/iq31244_defconfig @@ -1,10 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10 +# Thu Jan 6 10:53:05 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -16,6 +19,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +29,21 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set -# CONFIG_IKCONFIG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -59,6 +68,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -67,7 +77,9 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # # IOP3xx Implementation Options @@ -79,6 +91,7 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IQ80321 is not set CONFIG_ARCH_IQ31244=y # CONFIG_ARCH_IQ80331 is not set +# CONFIG_MACH_IQ80332 is not set # CONFIG_ARCH_EP80219 is not set CONFIG_ARCH_IOP321=y # CONFIG_ARCH_IOP331 is not set @@ -94,6 +107,7 @@ CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_MINICACHE=y @@ -107,9 +121,9 @@ CONFIG_XSCALE_PMU=y # General setup # CONFIG_PCI=y -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y @@ -119,7 +133,6 @@ CONFIG_PCI_NAMES=y CONFIG_FPE_NWFPE=y # CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -132,7 +145,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_PM is not set # CONFIG_PREEMPT is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=256M@0xa0000000" +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" CONFIG_ALIGNMENT_TRAP=y # @@ -148,8 +161,8 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set -# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set @@ -191,7 +204,10 @@ CONFIG_MTD_CFI_UTIL=y # Mapping drivers for chip access # # CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_START=0xf0000000 +CONFIG_MTD_PHYSMAP_LEN=0x00800000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set @@ -232,8 +248,19 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) @@ -243,9 +270,11 @@ CONFIG_BLK_DEV_MD=y # CONFIG_MD_LINEAR is not set CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=y # CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=y # CONFIG_DM_CRYPT is not set # CONFIG_DM_SNAPSHOT is not set @@ -280,6 +309,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -299,7 +331,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -418,7 +449,8 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -427,6 +459,7 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -474,7 +507,7 @@ CONFIG_INPUT=y # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set @@ -488,7 +521,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set -# CONFIG_SERIO_I8042 is not set # # Input Device Drivers @@ -523,7 +555,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -536,7 +567,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -544,7 +574,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -559,6 +588,7 @@ CONFIG_I2C_CHARDEV=y # # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support @@ -581,9 +611,11 @@ CONFIG_I2C_IOP3XX=y # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support @@ -591,20 +623,25 @@ CONFIG_I2C_IOP3XX=y # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set @@ -654,6 +691,7 @@ CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -678,6 +716,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -723,6 +762,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -768,7 +808,6 @@ CONFIG_MSDOS_PARTITION=y # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # @@ -784,23 +823,35 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_INFO is not set CONFIG_FRAME_POINTER=y CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_KERNEL is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/arm/configs/iq80321_defconfig b/arch/arm/configs/iq80321_defconfig index f19320b3b..527b62a0f 100644 --- a/arch/arm/configs/iq80321_defconfig +++ b/arch/arm/configs/iq80321_defconfig @@ -1,10 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10 +# Thu Jan 6 10:52:05 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -16,6 +19,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +29,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,6 +52,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -59,6 +67,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -67,7 +76,9 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # # IOP3xx Implementation Options @@ -79,6 +90,7 @@ CONFIG_ARCH_IOP3XX=y CONFIG_ARCH_IQ80321=y # CONFIG_ARCH_IQ31244 is not set # CONFIG_ARCH_IQ80331 is not set +# CONFIG_MACH_IQ80332 is not set # CONFIG_ARCH_EP80219 is not set CONFIG_ARCH_IOP321=y # CONFIG_ARCH_IOP331 is not set @@ -94,6 +106,7 @@ CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_MINICACHE=y @@ -107,9 +120,9 @@ CONFIG_XSCALE_PMU=y # General setup # CONFIG_PCI=y -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y @@ -119,7 +132,6 @@ CONFIG_PCI_NAMES=y CONFIG_FPE_NWFPE=y # CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -132,7 +144,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_PM is not set # CONFIG_PREEMPT is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=128M@0xa0000000" +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" CONFIG_ALIGNMENT_TRAP=y # @@ -148,8 +160,8 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set -# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set @@ -191,7 +203,10 @@ CONFIG_MTD_CFI_UTIL=y # Mapping drivers for chip access # # CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_START=0xf0000000 +CONFIG_MTD_PHYSMAP_LEN=0x00800000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1 # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set @@ -232,8 +247,19 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) @@ -268,6 +294,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -287,7 +316,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -399,7 +427,7 @@ CONFIG_INPUT=y # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set @@ -413,7 +441,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set -# CONFIG_SERIO_I8042 is not set # # Input Device Drivers @@ -448,7 +475,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -461,7 +487,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -469,14 +494,90 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set # # I2C support # -# CONFIG_I2C is not set +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +CONFIG_I2C_IOP3XX=y +# CONFIG_I2C_ISA is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set # # Multimedia devices @@ -510,6 +611,7 @@ CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -534,6 +636,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -579,6 +682,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -624,7 +728,6 @@ CONFIG_MSDOS_PARTITION=y # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # @@ -640,23 +743,35 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # -CONFIG_FRAME_POINTER=y -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/arm/configs/iq80331_defconfig b/arch/arm/configs/iq80331_defconfig index 9adbf9b09..43aeebbb9 100644 --- a/arch/arm/configs/iq80331_defconfig +++ b/arch/arm/configs/iq80331_defconfig @@ -1,10 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10 +# Thu Jan 6 10:44:16 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -16,6 +19,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,18 +29,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,6 +52,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -60,6 +67,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -68,7 +76,9 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # # IOP3xx Implementation Options @@ -80,12 +90,14 @@ CONFIG_ARCH_IOP3XX=y # CONFIG_ARCH_IQ80321 is not set # CONFIG_ARCH_IQ31244 is not set CONFIG_ARCH_IQ80331=y +# CONFIG_MACH_IQ80332 is not set # CONFIG_ARCH_EP80219 is not set CONFIG_ARCH_IOP331=y # # IOP3xx Chipset Features # +CONFIG_IOP331_STEPD=y # # Processor Type @@ -94,6 +106,7 @@ CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_MINICACHE=y @@ -107,9 +120,9 @@ CONFIG_XSCALE_PMU=y # General setup # CONFIG_PCI=y -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y @@ -119,7 +132,6 @@ CONFIG_PCI_NAMES=y CONFIG_FPE_NWFPE=y # CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -129,11 +141,10 @@ CONFIG_BINFMT_AOUT=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_DEBUG_DRIVER is not set # CONFIG_PM is not set # CONFIG_PREEMPT is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=128M@0x00000000" +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" CONFIG_ALIGNMENT_TRAP=y # @@ -149,8 +160,8 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set -# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +CONFIG_MTD_REDBOOT_PARTS_READONLY=y # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set @@ -196,7 +207,10 @@ CONFIG_MTD_CFI_UTIL=y # Mapping drivers for chip access # # CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_START=0xc0000000 +CONFIG_MTD_PHYSMAP_LEN=0x00800000 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1 # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set @@ -237,8 +251,19 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # Multi-device support (RAID and LVM) @@ -248,9 +273,11 @@ CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=y # CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=y # CONFIG_DM_CRYPT is not set # CONFIG_DM_SNAPSHOT is not set @@ -285,6 +312,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -304,7 +334,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -423,7 +452,8 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -432,6 +462,7 @@ CONFIG_CHR_DEV_SG=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -479,7 +510,7 @@ CONFIG_INPUT=y # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set @@ -493,7 +524,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set -# CONFIG_SERIO_I8042 is not set # # Input Device Drivers @@ -528,7 +558,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -541,7 +570,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -549,14 +577,90 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set # # I2C support # -# CONFIG_I2C is not set +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +CONFIG_I2C_IOP3XX=y +# CONFIG_I2C_ISA is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set # # Multimedia devices @@ -590,6 +694,7 @@ CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -614,6 +719,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -653,6 +759,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -698,7 +805,6 @@ CONFIG_MSDOS_PARTITION=y # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # @@ -714,30 +820,35 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_INFO is not set CONFIG_FRAME_POINTER=y CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_WAITQ is not set -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_ERRORS=y -# CONFIG_DEBUG_LL is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -749,5 +860,5 @@ CONFIG_DEBUG_ERRORS=y # Library routines # # CONFIG_CRC_CCITT is not set -CONFIG_CRC32=y +# CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig index 7b821f811..3a068df0e 100644 --- a/arch/arm/configs/ixp4xx_defconfig +++ b/arch/arm/configs/ixp4xx_defconfig @@ -399,7 +399,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/arm/configs/pleb_defconfig b/arch/arm/configs/pleb_defconfig index d9389a2a5..ca2cb5af5 100644 --- a/arch/arm/configs/pleb_defconfig +++ b/arch/arm/configs/pleb_defconfig @@ -1,132 +1,159 @@ # -# Automatically generated by make menuconfig: don't edit +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc2 +# Wed Nov 24 15:12:32 2004 # CONFIG_ARM=y -# CONFIG_EISA is not set -# CONFIG_SBUS is not set -# CONFIG_MCA is not set +CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_OBSOLETE is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +# CONFIG_KOBJECT_UEVENT is not set +# CONFIG_IKCONFIG is not set +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_SHMEM is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support # CONFIG_MODULES=y +# CONFIG_MODULE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # System Type # -# CONFIG_ARCH_ARCA5K is not set # CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_CAMELOT is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP3XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set CONFIG_ARCH_SA1100=y -# CONFIG_ARCH_CLPS711X is not set - -# -# Archimedes/A5000 Implementations -# -# CONFIG_ARCH_ARC is not set -# CONFIG_ARCH_A5K is not set - -# -# Footbridge Implementations -# -# CONFIG_ARCH_CATS is not set -# CONFIG_ARCH_PERSONAL_SERVER is not set -# CONFIG_ARCH_EBSA285_ADDIN is not set -# CONFIG_ARCH_EBSA285_HOST is not set -# CONFIG_ARCH_NETWINDER is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # # SA11x0 Implementations # # CONFIG_SA1100_ASSABET is not set -# CONFIG_ASSABET_NEPONSET is not set -# CONFIG_SA1100_BRUTUS is not set # CONFIG_SA1100_CERF is not set -# CONFIG_SA1100_BITSY is not set -# CONFIG_SA1100_EXTENEX1 is not set -# CONFIG_SA1100_FLEXANET is not set -# CONFIG_SA1100_FREEBIRD is not set -# CONFIG_SA1100_GRAPHICSCLIENT is not set +# CONFIG_SA1100_COLLIE is not set +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set +# CONFIG_SA1100_BADGE4 is not set # CONFIG_SA1100_JORNADA720 is not set -# CONFIG_SA1100_HUW_WEBPANEL is not set -# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_HACKKIT is not set # CONFIG_SA1100_LART is not set -# CONFIG_SA1100_NANOENGINE is not set -# CONFIG_SA1100_OMNIMETER is not set -# CONFIG_SA1100_PANGOLIN is not set CONFIG_SA1100_PLEB=y -# CONFIG_SA1100_SHERMAN is not set -# CONFIG_SA1100_PFS168 is not set -# CONFIG_SA1100_VICTOR is not set -# CONFIG_SA1100_XP860 is not set -# CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_SHANNON is not set +# CONFIG_SA1100_SIMPAD is not set +# CONFIG_SA1100_SSP is not set # CONFIG_SA1100_USB is not set -# CONFIG_SA1100_USB_NETLINK is not set -# CONFIG_SA1100_USB_CHAR is not set # -# CLPS711X/EP721X Implementations +# Processor Type # -# CONFIG_ARCH_P720T is not set -# CONFIG_ARCH_ACORN is not set -# CONFIG_FOOTBRIDGE is not set -# CONFIG_FOOTBRIDGE_HOST is not set -# CONFIG_FOOTBRIDGE_ADDIN is not set CONFIG_CPU_32=y -# CONFIG_CPU_26 is not set -# CONFIG_CPU_32v3 is not set -CONFIG_CPU_32v4=y -# CONFIG_CPU_ARM610 is not set -# CONFIG_CPU_ARM710 is not set -# CONFIG_CPU_ARM720T is not set -# CONFIG_CPU_ARM920T is not set -# CONFIG_CPU_ARM1020 is not set -# CONFIG_CPU_SA110 is not set CONFIG_CPU_SA1100=y -CONFIG_DISCONTIGMEM=y -# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_32v4=y +CONFIG_CPU_ABRT_EV4=y +CONFIG_CPU_CACHE_V4WB=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_TLB_V4WB=y +CONFIG_CPU_MINICACHE=y + +# +# Processor Features +# # # General setup # -# CONFIG_PCI is not set -# CONFIG_ISA is not set -# CONFIG_ISA_DMA is not set +CONFIG_DISCONTIGMEM=y +CONFIG_ISA=y +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set CONFIG_CPU_FREQ=y -# CONFIG_HOTPLUG is not set -# CONFIG_PCMCIA is not set -CONFIG_NET=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y +# CONFIG_CPU_FREQ_DEBUG is not set +# CONFIG_CPU_FREQ_PROC_INTF is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_SA1100=y + +# +# At least one math emulation must be selected +# CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -CONFIG_KCORE_ELF=y -# CONFIG_KCORE_AOUT is not set -CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_DEBUG_DRIVER is not set # CONFIG_PM is not set -# CONFIG_APM is not set +# CONFIG_PREEMPT is not set # CONFIG_ARTHUR is not set CONFIG_CMDLINE="console=ttySA0,9600 mem=16M@0xc0000000 mem=16M@0xc8000000 root=/dev/ram initrd=0xc0400000,4M" -# CONFIG_PFS168_CMDLINE is not set # CONFIG_LEDS is not set CONFIG_ALIGNMENT_TRAP=y @@ -138,56 +165,73 @@ CONFIG_ALIGNMENT_TRAP=y # # Memory Technology Devices (MTD) # -# CONFIG_MTD is not set +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set # # RAM/ROM/Flash chip drivers # -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_CFI_AMDSTD is not set -# CONFIG_MTD_AMDSTD is not set -# CONFIG_MTD_SHARP is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set -# CONFIG_MTD_JEDEC is not set +# CONFIG_MTD_ABSENT is not set # # Mapping drivers for chip access # +# CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_SUN_UFLASH is not set -# CONFIG_MTD_NORA is not set -# CONFIG_MTD_PNC2000 is not set -# CONFIG_MTD_RPXLITE is not set -# CONFIG_MTD_SC520CDP is not set -# CONFIG_MTD_NETSC520 is not set -# CONFIG_MTD_SBC_GXX is not set -# CONFIG_MTD_ELAN_104NC is not set -# CONFIG_MTD_SA1100 is not set -# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set -# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set -# CONFIG_MTD_DC21285 is not set -# CONFIG_MTD_IQ80310 is not set -# CONFIG_MTD_DBOX2 is not set -# CONFIG_MTD_CSTM_MIPS_IXX is not set -# CONFIG_MTD_CFI_FLAGADM is not set # CONFIG_MTD_ARM_INTEGRATOR is not set -# CONFIG_MTD_MIXMEM is not set -# CONFIG_MTD_OCTAGON is not set -# CONFIG_MTD_VMAX is not set -# CONFIG_MTD_OCELOT is not set +CONFIG_MTD_SA1100=y +# CONFIG_MTD_EDB7312 is not set # # Self-contained MTD device drivers # -# CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_BLKMTD is not set + +# +# Disk-On-Chip Device Drivers +# # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOCPROBE is not set +# CONFIG_MTD_DOC2001PLUS is not set # # NAND Flash Device Drivers @@ -195,155 +239,175 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_MTD_NAND is not set # -# Plug and Play configuration +# Plug and Play support # # CONFIG_PNP is not set -# CONFIG_ISAPNP is not set # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_LOOP is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set -# CONFIG_BLK_DEV_MD is not set -# CONFIG_MD_LINEAR is not set -# CONFIG_MD_RAID0 is not set -# CONFIG_MD_RAID1 is not set -# CONFIG_MD_RAID5 is not set -# CONFIG_BLK_DEV_LVM is not set + +# +# Networking support +# +CONFIG_NET=y # # Networking options # -CONFIG_PACKET=m +CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set -# CONFIG_NETLINK is not set -# CONFIG_NETFILTER is not set -# CONFIG_FILTER is not set +# CONFIG_NETLINK_DEV is not set CONFIG_UNIX=y +# CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set -CONFIG_INET_ECN=y +# CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_IP_TCPDIAG is not set +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set -# CONFIG_KHTTPD is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_LLC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # -# Network device support +# Network testing # +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set -CONFIG_DUMMY=m -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set # # Ethernet (10 or 100Mbit) # -# CONFIG_NET_ETHERNET is not set +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +CONFIG_SMC91X=y +# CONFIG_NET_VENDOR_RACAL 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_NET_PCI is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # -# CONFIG_ACENIC is not set -# CONFIG_ACENIC_OMIT_TIGON_I is not set -# CONFIG_MYRI_SBUS is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_SK98LIN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PLIP is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set # -# Wireless LAN (non-hamradio) +# Ethernet (10000 Mbit) # -# CONFIG_NET_RADIO is not set # # Token Ring devices # # CONFIG_TR is not set -# CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set # # Wan interfaces # # 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 # -# Amateur Radio support +# ATA/ATAPI/MFM/RLL support # -# CONFIG_HAMRADIO is not set +# CONFIG_IDE is not set # -# IrDA (infrared) support +# SCSI device support # -# CONFIG_IRDA is not set +# CONFIG_SCSI is not set # -# ATA/IDE/MFM/RLL support +# Fusion MPT device support # -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_HD is not set # -# SCSI support +# IEEE 1394 (FireWire) support # -# CONFIG_SCSI is not set # # I2O device support # -# CONFIG_I2O is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set # # ISDN subsystem @@ -351,183 +415,285 @@ CONFIG_DUMMY=m # CONFIG_ISDN is not set # -# Input core support +# Input device support # # CONFIG_INPUT is not set +# +# Userland interfaces +# + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_SERIO is not set + +# +# Input Device Drivers +# + # # Character devices # # CONFIG_VT is not set -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_SERIAL_21285 is not set -# CONFIG_SERIAL_21285_OLD is not set -# CONFIG_SERIAL_21285_CONSOLE is not set -CONFIG_SERIAL_SA1100=y -# CONFIG_SERIAL_SA1100_OLD is not set -CONFIG_SERIAL_SA1100_CONSOLE=y -CONFIG_SA1100_DEFAULT_BAUDRATE=9600 -# CONFIG_SERIAL_AMBA is not set -# CONFIG_SERIAL_AMBA_CONSOLE is not set -# CONFIG_SERIAL_CLPS711X is not set -# CONFIG_SERIAL_CLPS711X_CONSOLE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 -# CONFIG_UCB1200 is not set -# CONFIG_TOUCHSCREEN_UCB1200 is not set -# CONFIG_AUDIO_UCB1200 is not set -# CONFIG_ADC_UCB1200 is not set -# CONFIG_TOUCHSCREEN_BITSY is not set -CONFIG_PROFILER=y -# CONFIG_PFS168_SPI is not set -# CONFIG_PFS168_DTMF is not set -# CONFIG_PFS168_MISC is not set # -# I2C support +# Serial drivers # -# CONFIG_I2C is not set +# CONFIG_SERIAL_8250 is not set # -# Mice +# Non-8250 serial port support # -# CONFIG_BUSMOUSE is not set -# CONFIG_MOUSE is not set +CONFIG_SERIAL_SA1100=y +CONFIG_SERIAL_SA1100_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 # -# Joysticks +# IPMI # -# CONFIG_JOYSTICK is not set -# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -CONFIG_SA1100_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +# CONFIG_I2C is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + # # File systems # +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR 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_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS 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_REISERFS_FS is not set -# CONFIG_REISERFS_CHECK is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# # CONFIG_ADFS_FS is not set -# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set -# CONFIG_FAT_FS is not set -# CONFIG_MSDOS_FS is not set -# CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set -CONFIG_TMPFS=y -# CONFIG_RAMFS is not set -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set -# CONFIG_MINIX_FS is not set # CONFIG_VXFS_FS is not set -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set -CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -# CONFIG_DEVFS_MOUNT is not set -# CONFIG_DEVFS_DEBUG is not set -CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -# CONFIG_QNX4FS_RW is not set -# CONFIG_ROMFS_FS is not set -CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_UDF_FS is not set -# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set -# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # -# CONFIG_CODA_FS is not set -# CONFIG_NFS_FS is not set -# CONFIG_NFS_V3 is not set -# CONFIG_ROOT_NFS is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_V4 is not set +CONFIG_NFS_DIRECTIO=y # CONFIG_NFSD is not set -# CONFIG_NFSD_V3 is not set -# CONFIG_SUNRPC is not set -# CONFIG_LOCKD is not set +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=m +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set # CONFIG_NCP_FS is not set -# CONFIG_NCPFS_PACKET_SIGNING is not set -# CONFIG_NCPFS_IOCTL_LOCKING is not set -# CONFIG_NCPFS_STRONG is not set -# CONFIG_NCPFS_NFS_NS is not set -# CONFIG_NCPFS_OS2_NS is not set -# CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_NLS is not set -# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y -# CONFIG_SMB_NLS is not set -# CONFIG_NLS is not set + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Graphics support +# +# CONFIG_FB is not set # # Sound # # CONFIG_SOUND is not set +# +# Misc devices +# + # # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set # -# Bluetooth support +# USB Gadget Support # -# CONFIG_BT is not set +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set # # Kernel hacking # -CONFIG_FRAME_POINTER=y -CONFIG_DEBUG_ERRORS=y -CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y -# CONFIG_NO_PGT_CACHE is not set -CONFIG_DEBUG_LL=y -# CONFIG_DEBUG_DC21285_PORT is not set -# CONFIG_DEBUG_CLPS711X_UART2 is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_INFO is not set +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_WAITQ is not set +# CONFIG_DEBUG_ERRORS is not set +# CONFIG_DEBUG_LL is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig index 9919e7ff0..e8c2255aa 100644 --- a/arch/arm/configs/s3c2410_defconfig +++ b/arch/arm/configs/s3c2410_defconfig @@ -1,10 +1,14 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc1-bk5 +# Tue Jan 18 11:36:49 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -17,6 +21,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,6 +30,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=16 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -32,11 +38,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,6 +53,7 @@ CONFIG_MODULES=y # CONFIG_MODULE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -59,6 +68,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_RPC is not set @@ -67,21 +77,29 @@ CONFIG_ARCH_S3C2410=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_VERSATILE_PB is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set # -# S3C2410 Implementations +# S3C24XX Implementations # CONFIG_ARCH_BAST=y CONFIG_ARCH_H1940=y CONFIG_ARCH_SMDK2410=y CONFIG_MACH_VR1000=y +CONFIG_MACH_RX3715=y +CONFIG_CPU_S3C2410=y +CONFIG_CPU_S3C2440=y # # S3C2410 Setup # CONFIG_S3C2410_DMA=y # CONFIG_S3C2410_DMA_DEBUG is not set +# CONFIG_S3C2410_PM_DEBUG is not set +# CONFIG_S3C2410_PM_CHECK is not set +CONFIG_S3C2410_LOWLEVEL_UART_PORT=0 # # Processor Type @@ -91,6 +109,7 @@ CONFIG_CPU_ARM920T=y CONFIG_CPU_32v4=y CONFIG_CPU_ABRT_EV4T=y CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_COPY_V4WB=y CONFIG_CPU_TLB_V4WBI=y @@ -105,17 +124,25 @@ CONFIG_CPU_TLB_V4WBI=y # # General setup # -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_XIP_KERNEL is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# # # At least one math emulation must be selected # CONFIG_FPE_NWFPE=y -CONFIG_FPE_NWFPE_XP=y +# CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set -# CONFIG_VFP is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set @@ -125,9 +152,11 @@ CONFIG_BINFMT_AOUT=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# CONFIG_PM is not set +CONFIG_PM=y # CONFIG_PREEMPT is not set +CONFIG_APM=y # CONFIG_ARTHUR is not set CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0" CONFIG_ALIGNMENT_TRAP=y @@ -136,10 +165,7 @@ CONFIG_ALIGNMENT_TRAP=y # Parallel port support # CONFIG_PARPORT=y -CONFIG_PARPORT_PC=y -CONFIG_PARPORT_PC_CML1=y -CONFIG_PARPORT_PC_FIFO=y -CONFIG_PARPORT_PC_SUPERIO=y +# CONFIG_PARPORT_PC is not set # CONFIG_PARPORT_ARC is not set CONFIG_PARPORT_OTHER=y CONFIG_PARPORT_1284=y @@ -149,8 +175,14 @@ CONFIG_PARPORT_1284=y # CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_PARTITIONS is not set +CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set # # User Modules And Translation Layers @@ -165,27 +197,29 @@ CONFIG_MTD_BLOCK=y # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_JEDECPROBE=y CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_16=y # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set CONFIG_MTD_CFI_I1=y CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_I4 is not set # CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y -# CONFIG_MTD_CFI_AMDSTD is not set +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_AMDSTD_RETRY=0 # CONFIG_MTD_CFI_STAA is not set CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set +CONFIG_MTD_ROM=y # CONFIG_MTD_ABSENT is not set # CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_XIP is not set # # Mapping drivers for chip access @@ -194,6 +228,9 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_ARM_INTEGRATOR is not set # CONFIG_MTD_EDB7312 is not set +# CONFIG_MTD_IMPA7 is not set +CONFIG_MTD_BAST=y +CONFIG_MTD_BAST_MAXSIZE=4 # # Self-contained MTD device drivers @@ -202,6 +239,7 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -213,7 +251,14 @@ CONFIG_MTD_CFI_UTIL=y # # NAND Flash Device Drivers # -# CONFIG_MTD_NAND is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_S3C2410=y +# CONFIG_MTD_NAND_S3C2410_DEBUG is not set +# CONFIG_MTD_NAND_S3C2410_HWECC is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set # # Plug and Play support @@ -224,12 +269,25 @@ CONFIG_MTD_CFI_UTIL=y # # CONFIG_BLK_DEV_FD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # Multi-device support (RAID and LVM) @@ -262,6 +320,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -281,7 +342,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -354,13 +414,13 @@ CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDETAPE=m CONFIG_BLK_DEV_IDEFLOPPY=m # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDE_BAST=y # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set # CONFIG_BLK_DEV_HD is not set @@ -411,10 +471,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y -# CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -447,6 +508,7 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set # CONFIG_RISCOM8 is not set @@ -483,7 +545,6 @@ CONFIG_PRINTER=y # CONFIG_LP_CONSOLE is not set CONFIG_PPDEV=y # CONFIG_TIPAR is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -493,16 +554,23 @@ CONFIG_PPDEV=y # # Watchdog Cards # -# CONFIG_WATCHDOG is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_S3C2410_WATCHDOG=y # CONFIG_NVRAM is not set -CONFIG_RTC=y +# CONFIG_RTC is not set +CONFIG_S3C2410_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -517,16 +585,17 @@ CONFIG_I2C_CHARDEV=m # CONFIG_I2C_ALGOBIT=m # CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_ISA is not set # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_SCx200_ACB is not set +CONFIG_I2C_S3C2410=y +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support @@ -534,20 +603,26 @@ CONFIG_I2C_ALGOBIT=m CONFIG_I2C_SENSOR=m # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set CONFIG_SENSORS_LM75=m # CONFIG_SENSORS_LM77 is not set CONFIG_SENSORS_LM78=m # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set CONFIG_SENSORS_LM85=m +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set @@ -592,6 +667,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -639,6 +715,7 @@ CONFIG_JFFS_FS_VERBOSE=0 CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_FS_NOR_ECC is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -663,6 +740,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -742,13 +820,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Graphics support # CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE is not set @@ -756,6 +835,7 @@ CONFIG_DUMMY_CONSOLE=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -769,24 +849,39 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Kernel hacking # -CONFIG_FRAME_POINTER=y -CONFIG_DEBUG_USER=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set # CONFIG_MAGIC_SYSRQ is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_FS is not set +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y # CONFIG_DEBUG_WAITQ is not set -# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_ERRORS is not set CONFIG_DEBUG_LL=y # CONFIG_DEBUG_ICEDCC is not set @@ -796,6 +891,7 @@ CONFIG_DEBUG_S3C2410_UART=0 # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -803,6 +899,10 @@ CONFIG_DEBUG_S3C2410_UART=0 # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig index b5e260236..e98f061a8 100644 --- a/arch/arm/configs/versatile_defconfig +++ b/arch/arm/configs/versatile_defconfig @@ -65,7 +65,7 @@ CONFIG_KMOD=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_S3C2410 is not set # CONFIG_ARCH_OMAP is not set -CONFIG_ARCH_VERSATILE_PB=y +CONFIG_ARCH_VERSATILE=y # # CLPS711X/EP721X Implementations @@ -109,6 +109,12 @@ CONFIG_ARCH_VERSATILE_PB=y # S3C2410 Implementations # +# +# Versatile platform type +# +CONFIG_ARCH_VERSATILE_PB=y +# CONFIG_MACH_VERSATILE_AB is not set + # # Processor Type # @@ -144,8 +150,8 @@ CONFIG_ZBOOT_ROM_BSS=0x0 # # At least one math emulation must be selected # -# CONFIG_FPE_NWFPE is not set -CONFIG_FPE_FASTFPE=y +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 936dee40e..07a56ff61 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) +AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) # Object file lists. @@ -18,6 +18,7 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o obj-$(CONFIG_ARTHUR) += arthur.o obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_PCI) += bios32.o +obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IWMMXT) += iwmmxt.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index 70aade05b..b0bbd1e62 100644 --- a/arch/arm/kernel/apm.c +++ b/arch/arm/kernel/apm.c @@ -97,7 +97,7 @@ static LIST_HEAD(apm_user_list); */ static DECLARE_WAIT_QUEUE_HEAD(kapmd_wait); static DECLARE_COMPLETION(kapmd_exit); -static spinlock_t kapmd_queue_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(kapmd_queue_lock); static struct apm_queue kapmd_queue; diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index ae9203853..4c38bd8bc 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c @@ -60,7 +60,8 @@ EXPORT_SYMBOL_ALIAS(fp_send_sig,send_sig); EXPORT_SYMBOL(__backtrace); /* platform dependent support */ -EXPORT_SYMBOL(udelay); +EXPORT_SYMBOL(__udelay); +EXPORT_SYMBOL(__const_udelay); /* networking */ EXPORT_SYMBOL(csum_partial); @@ -149,6 +150,8 @@ EXPORT_SYMBOL(_change_bit_le); EXPORT_SYMBOL(_test_and_change_bit_le); EXPORT_SYMBOL(_find_first_zero_bit_le); EXPORT_SYMBOL(_find_next_zero_bit_le); +EXPORT_SYMBOL(_find_first_bit_le); +EXPORT_SYMBOL(_find_next_bit_le); #ifdef __ARMEB__ EXPORT_SYMBOL(_set_bit_be); @@ -159,6 +162,8 @@ EXPORT_SYMBOL(_change_bit_be); EXPORT_SYMBOL(_test_and_change_bit_be); EXPORT_SYMBOL(_find_first_zero_bit_be); EXPORT_SYMBOL(_find_next_zero_bit_be); +EXPORT_SYMBOL(_find_first_bit_be); +EXPORT_SYMBOL(_find_next_bit_be); #endif /* syscalls */ diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 3f22b6356..99d43259f 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * Make sure that the compiler and target are compatible. @@ -58,6 +59,7 @@ int main(void) DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); + DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value)); DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); @@ -72,6 +74,7 @@ int main(void) DEFINE(VM_EXEC, VM_EXEC); BLANK(); DEFINE(PAGE_SZ, PAGE_SIZE); + DEFINE(VIRT_OFFSET, PAGE_OFFSET); BLANK(); DEFINE(SYS_ERROR0, 0x9f0000); BLANK(); diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index ab2985877..ad26e98f1 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -574,13 +574,13 @@ void __init pci_common_init(struct hw_pci *hw) if (!use_firmware) { /* - * Size the bridge windows. - */ + * Size the bridge windows. + */ pci_bus_size_bridges(bus); /* - * Assign resources. - */ + * Assign resources. + */ pci_bus_assign_resources(bus); } @@ -681,7 +681,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, if (mmap_state == pci_mmap_io) { return -EINVAL; } else { - phys = root->mem_offset + (vma->vm_pgoff << PAGE_SHIFT); + phys = vma->vm_pgoff + (root->mem_offset >> PAGE_SHIFT); } /* @@ -690,7 +690,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - if (remap_page_range(vma, vma->vm_start, phys, + if (remap_pfn_range(vma, vma->vm_start, phys, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index d868099d1..4b9350e4b 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S @@ -134,7 +134,7 @@ __syscall_start: .long sys_ipc .long sys_fsync .long sys_sigreturn_wrapper -/* 120 */ .long sys_clone_wapper +/* 120 */ .long sys_clone_wrapper .long sys_setdomainname .long sys_newuname .long sys_ni_syscall @@ -254,7 +254,7 @@ __syscall_start: .long sys_fremovexattr .long sys_tkill .long sys_sendfile64 -/* 240 */ .long sys_futex +/* 240 */ .long sys_futex_wrapper .long sys_sched_setaffinity .long sys_sched_getaffinity .long sys_io_setup @@ -270,7 +270,7 @@ __syscall_start: .long sys_remap_file_pages .long sys_ni_syscall /* sys_set_thread_area */ /* 255 */ .long sys_ni_syscall /* sys_get_thread_area */ - .long sys_ni_syscall /* sys_set_tid_address */ + .long sys_set_tid_address .long sys_timer_create .long sys_timer_settime .long sys_timer_gettime @@ -295,6 +295,11 @@ __syscall_start: .long sys_mq_notify .long sys_mq_getsetattr /* 280 */ .long sys_waitid + + .rept 313 - (. - __syscall_start) / 4 + .long sys_ni_syscall + .endr + .long sys_vserver /* 313 */ __syscall_end: .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index 7b4e9721f..caaa919ab 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/debug-armv.S + * linux/arch/arm/kernel/debug.S * * Copyright (C) 1994-1999 Russell King * @@ -20,31 +20,8 @@ * printk isn't working). For DEBUGGING ONLY!!! Do not leave * references to these in a production kernel! */ -#if defined(CONFIG_ARCH_RPC) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x00010000 - orr \rx, \rx, #0x00000fe0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1001: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1001b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x18] - tst \rd, #0x10 - beq 1001b - .endm -#elif defined(CONFIG_DEBUG_ICEDCC) +#if defined(CONFIG_DEBUG_ICEDCC) @@ debug using ARM EmbeddedICE DCC channel .macro addruart, rx .endm @@ -71,642 +48,8 @@ bne 1001b 1002: .endm - -#elif defined(CONFIG_ARCH_EBSA110) - .macro addruart,rx - mov \rx, #0xf0000000 - orr \rx, \rx, #0x00000be0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x18] - tst \rd, #0x10 - beq 1001b - .endm - -#elif defined(CONFIG_ARCH_SHARK) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x000003f8 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx - mov \rd, #0 -1001: add \rd, \rd, #1 - teq \rd, #0x10000 - bne 1001b - .endm - - .macro waituart,rd,rx - .endm - -#elif defined(CONFIG_FOOTBRIDGE) - -#include - -#ifndef CONFIG_DEBUG_DC21285_PORT - /* For NetWinder debugging */ - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x7c000000 @ physical - movne \rx, #0xff000000 @ virtual - orr \rx, \rx, #0x000003f8 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x5] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x6] - tst \rd, #0x10 - beq 1001b - .endm -#else - /* For EBSA285 debugging */ - .equ dc21285_high, ARMCSR_BASE & 0xff000000 - .equ dc21285_low, ARMCSR_BASE & 0x00ffffff - - .macro addruart,rx - mov \rx, #dc21285_high - .if dc21285_low - orr \rx, \rx, #dc21285_low - .endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x160] @ UARTDR - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x178] @ UARTFLG - tst \rd, #1 << 3 - bne 1001b - .endm - - .macro waituart,rd,rx - .endm -#endif -#elif defined(CONFIG_ARCH_FTVPCI) - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - movne \rx, #0xe0000000 - moveq \rx, #0x10000000 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0xc] - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x4] - tst \rd, #1 << 2 - beq 1001b - .endm - - .macro waituart,rd,rx - .endm - -#elif defined(CONFIG_ARCH_SA1100) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x80000000 @ physical base address - movne \rx, #0xf8000000 @ virtual address - - @ We probe for the active serial port here, coherently with - @ the comment in include/asm-arm/arch-sa1100/uncompress.h. - @ We assume r1 can be clobbered. - - @ see if Ser3 is active - add \rx, \rx, #0x00050000 - ldr r1, [\rx, #UTCR3] - tst r1, #UTCR3_TXE - - @ if Ser3 is inactive, then try Ser1 - addeq \rx, \rx, #(0x00010000 - 0x00050000) - ldreq r1, [\rx, #UTCR3] - tsteq r1, #UTCR3_TXE - - @ if Ser1 is inactive, then try Ser2 - addeq \rx, \rx, #(0x00030000 - 0x00010000) - ldreq r1, [\rx, #UTCR3] - tsteq r1, #UTCR3_TXE - - @ if all ports are inactive, then there is nothing we can do - moveq pc, lr - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #UTDR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #UTSR1] - tst \rd, #UTSR1_TNF - beq 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #UTSR1] - tst \rd, #UTSR1_TBY - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_PXA) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x40000000 @ physical - movne \rx, #io_p2v(0x40000000) @ virtual - orr \rx, \rx, #0x00100000 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0] - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #0x14] - tst \rd, #(1 << 6) - beq 1002b - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x14] - tst \rd, #(1 << 5) - beq 1001b - .endm -#elif defined(CONFIG_ARCH_CLPS7500) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x00010000 - orr \rx, \rx, #0x00000be0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x14] - tst \rd, #0x20 - beq 1001b - .endm - -#elif defined(CONFIG_ARCH_L7200) - - .equ io_virt, IO_BASE - .equ io_phys, IO_START - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #io_phys @ physical base address - movne \rx, #io_virt @ virtual address - add \rx, \rx, #0x00044000 @ UART1 -@ add \rx, \rx, #0x00045000 @ UART2 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0] @ UARTDR - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_INTEGRATOR) - -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x16000000 @ physical base address - movne \rx, #0xf0000000 @ virtual base - addne \rx, \rx, #0x16000000 >> 4 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx, #UART01x_DR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_CLPS711X) - -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #CLPS7111_PHYS_BASE - movne \rx, #CLPS7111_VIRT_BASE -#ifndef CONFIG_DEBUG_CLPS711X_UART2 - add \rx, \rx, #0x0000 @ UART1 -#else - add \rx, \rx, #0x1000 @ UART2 -#endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0480] @ UARTDR - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 11 @ UBUSYx - bne 1001b - .endm - - .macro busyuart,rd,rx - tst \rx, #0x1000 @ UART2 does not have CTS here - bne 1002f -1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 8 @ CTS - bne 1001b -1002: - .endm - -#elif defined(CONFIG_ARCH_CAMELOT) - -#include -#define UART00_TYPE -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - ldr \rx, =EXC_UART00_BASE @ physical base address - orrne \rx, \rx, #0xff000000 @ virtual base - orrne \rx, \rx, #0x00f00000 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #UART_TD(0)] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #UART_TSR(0)] - and \rd, \rd, #UART_TSR_TX_LEVEL_MSK - cmp \rd, #15 - beq 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #UART_TSR(0)] - ands \rd, \rd, #UART_TSR_TX_LEVEL_MSK - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_IOP3XX) - - .macro addruart,rx - mov \rx, #0xfe000000 @ physical -#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) - orr \rx, \rx, #0x00800000 @ location of the UART -#elif defined(CONFIG_ARCH_IOP331) - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x000fe000 @ Physical Base - movne \rx, #0 - orr \rx, \rx, #0xfe000000 - orr \rx, \rx, #0x00f00000 @ Virtual Base - orr \rx, \rx, #0x00001700 @ location of the UART -#else -#error Unknown IOP3XX implementation -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x5] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331) -1001: ldrb \rd, [\rx, #0x6] - tst \rd, #0x10 - beq 1001b -#endif - .endm - -#elif defined(CONFIG_ARCH_IXP4XX) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xc8000000 - movne \rx, #0xff000000 - add \rx,\rx,#3 @ Uart regs are at off set of 3 if - @ byte writes used - Big Endian. - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro waituart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 @ check THRE and TEMT bits - teq \rd, #0x60 - bne 1002b - .endm - - .macro busyuart,rd,rx - .endm - -#elif defined(CONFIG_ARCH_IXP2000) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xc0000000 @ Physical base - movne \rx, #0xfe000000 @ virtual base - orrne \rx, \rx, #0x00f00000 - orr \rx, \rx, #0x00030000 -#ifdef __ARMEB__ - orr \rx, \rx, #0x00000003 -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - tst \rd, #0x20 - beq 1002b - .endm - - .macro waituart,rd,rx - nop - nop - nop - .endm - -#elif defined(CONFIG_ARCH_OMAP) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xff000000 @ physical base address - movne \rx, #0xfe000000 @ virtual base - orr \rx, \rx, #0x00fb0000 -#ifdef CONFIG_OMAP_LL_DEBUG_UART3 - orr \rx, \rx, #0x00009000 @ UART 3 -#endif -#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) - orr \rx, \rx, #0x00000800 @ UART 2 & 3 -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends - and \rd, \rd, #0x60 - teq \rd, #0x60 - beq 1002f - ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1001b -1002: - .endm - - .macro waituart,rd,rx - .endm - -#elif defined(CONFIG_ARCH_S3C2410) -#include -#include - - .macro addruart, rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 - ldreq \rx, = S3C2410_PA_UART - ldrne \rx, = S3C2410_VA_UART -#if CONFIG_DEBUG_S3C2410_UART != 0 - add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) -#endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, # S3C2410_UTXH ] - .endm - - .macro busyuart, rd, rx - ldr \rd, [ \rx, # S3C2410_UFCON ] - tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? - beq 1001f @ - @ FIFO enabled... -1003: - ldr \rd, [ \rx, # S3C2410_UFSTAT ] - tst \rd, #S3C2410_UFSTAT_TXFULL - bne 1003b - b 1002f - -1001: - @ busy waiting for non fifo - ldr \rd, [ \rx, # S3C2410_UTRSTAT ] - tst \rd, #S3C2410_UTRSTAT_TXFE - beq 1001b - -1002: @ exit busyuart - .endm - - .macro waituart,rd,rx - - ldr \rd, [ \rx, # S3C2410_UFCON ] - tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? - beq 1001f @ - @ FIFO enabled... -1003: - ldr \rd, [ \rx, # S3C2410_UFSTAT ] - ands \rd, \rd, #15< - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x10000000 - movne \rx, #0xf1000000 @ virtual base - orr \rx, \rx, #0x001F0000 - orr \rx, \rx, #0x00001000 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx, #UART01x_DR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_IMX) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x00000000 @ physical - movne \rx, #0xe0000000 @ virtual - orr \rx, \rx, #0x00200000 - orr \rx, \rx, #0x00006000 @ UART1 offset - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x40] @ TXDATA - .endm - - .macro waituart,rd,rx - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #0x98] @ SR2 - tst \rd, #1 << 3 @ TXDC - beq 1002b @ wait until transmit done - .endm - -#elif defined(CONFIG_ARCH_H720X) - - .equ io_virt, IO_BASE - .equ io_phys, IO_START - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #io_phys @ physical base address - movne \rx, #io_virt @ virtual address - add \rx, \rx, #0x00020000 @ UART1 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0] @ UARTDR - - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm #else -#error Unknown architecture +#include #endif /* diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c index 0e4b21e03..2b7883884 100644 --- a/arch/arm/kernel/dma.c +++ b/arch/arm/kernel/dma.c @@ -22,7 +22,7 @@ #include -spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dma_spin_lock); #if MAX_DMA_CHANNELS > 0 diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index 67ac4ec53..3f6b4b529 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c @@ -503,27 +503,33 @@ void ecard_disablefiq(unsigned int fiqnr) } } -static void -ecard_dump_irq_state(ecard_t *ec) +static void ecard_dump_irq_state(void) { - printk(" %d: %sclaimed, ", - ec->slot_no, - ec->claimed ? "" : "not "); - - if (ec->ops && ec->ops->irqpending && - ec->ops != &ecard_default_ops) - printk("irq %spending\n", - ec->ops->irqpending(ec) ? "" : "not "); - else - printk("irqaddr %p, mask = %02X, status = %02X\n", - ec->irqaddr, ec->irqmask, *ec->irqaddr); + ecard_t *ec; + + printk("Expansion card IRQ state:\n"); + + for (ec = cards; ec; ec = ec->next) { + if (ec->slot_no == 8) + continue; + + printk(" %d: %sclaimed, ", + ec->slot_no, ec->claimed ? "" : "not "); + + if (ec->ops && ec->ops->irqpending && + ec->ops != &ecard_default_ops) + printk("irq %spending\n", + ec->ops->irqpending(ec) ? "" : "not "); + else + printk("irqaddr %p, mask = %02X, status = %02X\n", + ec->irqaddr, ec->irqmask, *ec->irqaddr); + } } static void ecard_check_lockup(struct irqdesc *desc) { static unsigned long last; static int lockup; - ecard_t *ec; /* * If the timer interrupt has not run since the last million @@ -541,11 +547,7 @@ static void ecard_check_lockup(struct irqdesc *desc) "disabling all expansion card interrupts\n"); desc->chip->mask(IRQ_EXPANSIONCARD); - - printk("Expansion card IRQ state:\n"); - - for (ec = cards; ec; ec = ec->next) - ecard_dump_irq_state(ec); + ecard_dump_irq_state(); } } else lockup = 0; @@ -557,6 +559,7 @@ static void ecard_check_lockup(struct irqdesc *desc) if (!last || time_after(jiffies, last + 5*HZ)) { last = jiffies; printk(KERN_WARNING "Unrecognised interrupt from backplane\n"); + ecard_dump_irq_state(); } } diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 5639f1b61..69f82e03d 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -23,1273 +23,362 @@ #include "entry-header.S" -#ifdef IOC_BASE -/* IOC / IOMD based hardware */ -#include - - .equ ioc_base_high, IOC_BASE & 0xff000000 - .equ ioc_base_low, IOC_BASE & 0x00ff0000 - .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 - mov r4, #ioc_base_high @ point at IOC - .if ioc_base_low - orr r4, r4, #ioc_base_low - .endif - ldrb \irqstat, [r4, #IOMD_IRQREQB] @ get high priority first - ldr \base, =irq_prio_h - teq \irqstat, #0 -#ifdef IOMD_BASE - ldreqb \irqstat, [r4, #IOMD_DMAREQ] @ get dma - addeq \base, \base, #256 @ irq_prio_h table size - teqeq \irqstat, #0 - bne 2406f -#endif - ldreqb \irqstat, [r4, #IOMD_IRQREQA] @ get low priority - addeq \base, \base, #256 @ irq_prio_d table size - teqeq \irqstat, #0 -#ifdef IOMD_IRQREQC - ldreqb \irqstat, [r4, #IOMD_IRQREQC] - addeq \base, \base, #256 @ irq_prio_l table size - teqeq \irqstat, #0 -#endif -#ifdef IOMD_IRQREQD - ldreqb \irqstat, [r4, #IOMD_IRQREQD] - addeq \base, \base, #256 @ irq_prio_lc table size - teqeq \irqstat, #0 -#endif -2406: ldrneb \irqnr, [\base, \irqstat] @ get IRQ number - .endm - -/* - * Interrupt table (incorporates priority). Please note that we - * rely on the order of these tables (see above code). - */ - .macro irq_prio_table -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 - .endm - -#elif defined(CONFIG_ARCH_EBSA110) - -#define IRQ_STAT 0xff000000 /* read */ - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, stat, base, tmp - mov \base, #IRQ_STAT - ldrb \stat, [\base] @ get interrupts - mov \irqnr, #0 - tst \stat, #15 - addeq \irqnr, \irqnr, #4 - moveq \stat, \stat, lsr #4 - tst \stat, #3 - addeq \irqnr, \irqnr, #2 - moveq \stat, \stat, lsr #2 - tst \stat, #1 - addeq \irqnr, \irqnr, #1 - moveq \stat, \stat, lsr #1 - tst \stat, #1 @ bit 0 should be set - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_SHARK) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov r4, #0xe0000000 - - mov \irqstat, #0x0C - strb \irqstat, [r4, #0x20] @outb(0x0C, 0x20) /* Poll command */ - ldrb \irqnr, [r4, #0x20] @irq = inb(0x20) & 7 - and \irqstat, \irqnr, #0x80 - teq \irqstat, #0 - beq 43f - and \irqnr, \irqnr, #7 - teq \irqnr, #2 - bne 44f -43: mov \irqstat, #0x0C - strb \irqstat, [r4, #0xa0] @outb(0x0C, 0xA0) /* Poll command */ - ldrb \irqnr, [r4, #0xa0] @irq = (inb(0xA0) & 7) + 8 - and \irqstat, \irqnr, #0x80 - teq \irqstat, #0 - beq 44f - and \irqnr, \irqnr, #7 - add \irqnr, \irqnr, #8 -44: teq \irqstat, #0 - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_FOOTBRIDGE) -#include - - .macro disable_fiq - .endm - - .equ dc21285_high, ARMCSR_BASE & 0xff000000 - .equ dc21285_low, ARMCSR_BASE & 0x00ffffff - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov r4, #dc21285_high - .if dc21285_low - orr r4, r4, #dc21285_low - .endif - ldr \irqstat, [r4, #0x180] @ get interrupts - - mov \irqnr, #IRQ_SDRAMPARITY - tst \irqstat, #IRQ_MASK_SDRAMPARITY - bne 1001f - - tst \irqstat, #IRQ_MASK_UART_RX - movne \irqnr, #IRQ_CONRX - bne 1001f - - tst \irqstat, #IRQ_MASK_DMA1 - movne \irqnr, #IRQ_DMA1 - bne 1001f - - tst \irqstat, #IRQ_MASK_DMA2 - movne \irqnr, #IRQ_DMA2 - bne 1001f - - tst \irqstat, #IRQ_MASK_IN0 - movne \irqnr, #IRQ_IN0 - bne 1001f - - tst \irqstat, #IRQ_MASK_IN1 - movne \irqnr, #IRQ_IN1 - bne 1001f - - tst \irqstat, #IRQ_MASK_IN2 - movne \irqnr, #IRQ_IN2 - bne 1001f - - tst \irqstat, #IRQ_MASK_IN3 - movne \irqnr, #IRQ_IN3 - bne 1001f - - tst \irqstat, #IRQ_MASK_PCI - movne \irqnr, #IRQ_PCI - bne 1001f - - tst \irqstat, #IRQ_MASK_DOORBELLHOST - movne \irqnr, #IRQ_DOORBELLHOST - bne 1001f - - tst \irqstat, #IRQ_MASK_I2OINPOST - movne \irqnr, #IRQ_I2OINPOST - bne 1001f - - tst \irqstat, #IRQ_MASK_TIMER1 - movne \irqnr, #IRQ_TIMER1 - bne 1001f - - tst \irqstat, #IRQ_MASK_TIMER2 - movne \irqnr, #IRQ_TIMER2 - bne 1001f - - tst \irqstat, #IRQ_MASK_TIMER3 - movne \irqnr, #IRQ_TIMER3 - bne 1001f - - tst \irqstat, #IRQ_MASK_UART_TX - movne \irqnr, #IRQ_CONTX - bne 1001f - - tst \irqstat, #IRQ_MASK_PCI_ABORT - movne \irqnr, #IRQ_PCI_ABORT - bne 1001f - - tst \irqstat, #IRQ_MASK_PCI_SERR - movne \irqnr, #IRQ_PCI_SERR - bne 1001f - - tst \irqstat, #IRQ_MASK_DISCARD_TIMER - movne \irqnr, #IRQ_DISCARD_TIMER - bne 1001f - - tst \irqstat, #IRQ_MASK_PCI_DPERR - movne \irqnr, #IRQ_PCI_DPERR - bne 1001f - - tst \irqstat, #IRQ_MASK_PCI_PERR - movne \irqnr, #IRQ_PCI_PERR -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_NEXUSPCI) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, =INTCONT_BASE - ldr \base, =soft_irq_mask - ldr \irqstat, [\irqstat] @ get interrupts - ldr \base, [\base] - mov \irqnr, #0 - and \irqstat, \irqstat, \base @ mask out disabled ones -1001: tst \irqstat, #1 - addeq \irqnr, \irqnr, #1 - moveq \irqstat, \irqstat, lsr #1 - tsteq \irqnr, #32 - beq 1001b - teq \irqnr, #32 - .endm - - .macro irq_prio_table - .ltorg - .bss -ENTRY(soft_irq_mask) - .word 0 - .text - .endm - -#elif defined(CONFIG_ARCH_TBOX) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, =0xffff7000 - ldr \irqstat, [\irqstat] @ get interrupts - ldr \base, =soft_irq_mask - ldr \base, [\base] - mov \irqnr, #0 - and \irqstat, \irqstat, \base @ mask out disabled ones -1001: tst \irqstat, #1 - addeq \irqnr, \irqnr, #1 - moveq \irqstat, \irqstat, lsr #1 - tsteq \irqnr, #32 - beq 1001b - teq \irqnr, #32 - .endm - - .macro irq_prio_table - .ltorg - .bss -ENTRY(soft_irq_mask) - .word 0 - .text - .endm - -#elif defined(CONFIG_ARCH_SA1100) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov r4, #0xfa000000 @ ICIP = 0xfa050000 - add r4, r4, #0x00050000 - ldr \irqstat, [r4] @ get irqs - ldr \irqnr, [r4, #4] @ ICMR = 0xfa050004 - ands \irqstat, \irqstat, \irqnr - mov \irqnr, #0 - beq 1001f - tst \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tsteq \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tsteq \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tst \irqstat, #0x0f - moveq \irqstat, \irqstat, lsr #4 - addeq \irqnr, \irqnr, #4 - tst \irqstat, #0x03 - moveq \irqstat, \irqstat, lsr #2 - addeq \irqnr, \irqnr, #2 - tst \irqstat, #0x01 - addeqs \irqnr, \irqnr, #1 -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_L7200) -#include - - .equ irq_base_addr, IO_BASE_2 - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \irqstat, #irq_base_addr @ Virt addr IRQ regs - add \irqstat, \irqstat, #0x00001000 @ Status reg - ldr \irqstat, [\irqstat, #0] @ get interrupts - mov \irqnr, #0 -1001: tst \irqstat, #1 - addeq \irqnr, \irqnr, #1 - moveq \irqstat, \irqstat, lsr #1 - tsteq \irqnr, #32 - beq 1001b - teq \irqnr, #32 - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_INTEGRATOR) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp -/* FIXME: should not be using soo many LDRs here */ - ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE) - mov \irqnr, #IRQ_PIC_START - ldr \irqstat, [\base, #IRQ_STATUS] @ get masked status - ldr \base, =IO_ADDRESS(INTEGRATOR_HDR_BASE) - teq \irqstat, #0 - ldreq \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)] - moveq \irqnr, #IRQ_CIC_START - -1001: tst \irqstat, #15 - bne 1002f - add \irqnr, \irqnr, #4 - movs \irqstat, \irqstat, lsr #4 - bne 1001b -1002: tst \irqstat, #1 - bne 1003f - add \irqnr, \irqnr, #1 - movs \irqstat, \irqstat, lsr #1 - bne 1002b -1003: /* EQ will be set if no irqs pending */ - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_VERSATILE_PB) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE) - ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status - mov \irqnr, #0 - teq \irqstat, #0 - beq 1003f - -1001: tst \irqstat, #15 - bne 1002f - add \irqnr, \irqnr, #4 - movs \irqstat, \irqstat, lsr #4 - bne 1001b -1002: tst \irqstat, #1 - bne 1003f - add \irqnr, \irqnr, #1 - movs \irqstat, \irqstat, lsr #1 - bne 1002b -1003: /* EQ will be set if no irqs pending */ - -@ clz \irqnr, \irqstat -@1003: /* EQ will be set if we reach MAXIRQNUM */ - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_CLPS711X) - -#include - - .macro disable_fiq - .endm - -#if (INTSR2 - INTSR1) != (INTMR2 - INTMR1) -#error INTSR stride != INTMR stride -#endif - - .macro get_irqnr_and_base, irqnr, stat, base, mask - mov \base, #CLPS7111_BASE - ldr \stat, [\base, #INTSR1] - ldr \mask, [\base, #INTMR1] - mov \irqnr, #4 - mov \mask, \mask, lsl #16 - and \stat, \stat, \mask, lsr #16 - movs \stat, \stat, lsr #4 - bne 1001f - - add \base, \base, #INTSR2 - INTSR1 - ldr \stat, [\base, #INTSR1] - ldr \mask, [\base, #INTMR1] - mov \irqnr, #16 - mov \mask, \mask, lsl #16 - and \stat, \stat, \mask, lsr #16 - -1001: tst \stat, #255 - addeq \irqnr, \irqnr, #8 - moveq \stat, \stat, lsr #8 - tst \stat, #15 - addeq \irqnr, \irqnr, #4 - moveq \stat, \stat, lsr #4 - tst \stat, #3 - addeq \irqnr, \irqnr, #2 - moveq \stat, \stat, lsr #2 - tst \stat, #1 - addeq \irqnr, \irqnr, #1 - moveq \stat, \stat, lsr #1 - tst \stat, #1 @ bit 0 should be set - .endm - - .macro irq_prio_table - .endm - -#elif defined (CONFIG_ARCH_CAMELOT) -#include -#undef IRQ_MODE /* same name defined in asm/proc/ptrace.h */ -#include - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - - ldr \irqstat, =INT_ID(IO_ADDRESS(EXC_INT_CTRL00_BASE)) - ldr \irqnr,[\irqstat] - cmp \irqnr,#0 - subne \irqnr,\irqnr,#1 - - - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_IOP321) - .macro disable_fiq - .endm - - /* - * Note: only deal with normal interrupts, not FIQ - */ - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \irqnr, #0 - mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC - cmp \irqstat, #0 - beq 1001f - clz \irqnr, \irqstat - mov \base, #31 - subs \irqnr,\base,\irqnr - add \irqnr,\irqnr,#IRQ_IOP321_DMA0_EOT -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_IOP331) - .macro disable_fiq - .endm - - /* - * Note: only deal with normal interrupts, not FIQ - */ - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \irqnr, #0 - mrc p6, 0, \irqstat, c4, c0, 0 @ Read IINTSRC0 - cmp \irqstat, #0 - bne 1002f - mrc p6, 0, \irqstat, c5, c0, 0 @ Read IINTSRC1 - cmp \irqstat, #0 - beq 1001f - clz \irqnr, \irqstat -/* - * mov \base, #31 - * subs \irqnr,\base,\irqnr - */ - rsbs \irqnr,\irqnr,#31 @ recommend by RMK - add \irqnr,\irqnr,#IRQ_IOP331_XINT8 - b 1001f -1002: clz \irqnr, \irqstat - mov \base, #31 - subs \irqnr,\base,\irqnr - add \irqnr,\irqnr,#IRQ_IOP331_DMA0_EOT -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_PXA) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp -#ifdef CONFIG_PXA27x - mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP - mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR -#else - mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000 - add \base, \base, #0x00d00000 - ldr \irqstat, [\base, #0] @ ICIP - ldr \irqnr, [\base, #4] @ ICMR -#endif - ands \irqnr, \irqstat, \irqnr - beq 1001f - rsb \irqstat, \irqnr, #0 - and \irqstat, \irqstat, \irqnr - clz \irqnr, \irqstat - rsb \irqnr, \irqnr, #(31 - PXA_IRQ_SKIP) -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_IXP2000) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - - mov \irqnr, #0x0 @clear out irqnr as default - mov \base, #0xfe000000 - orr \base, \base, #0x00ff0000 - orr \base, \base, #0x0000a000 - orr \base, \base, #0x08 - ldr \irqstat, [\base] @ get interrupts - mov \tmp, #IXP2000_VALID_IRQ_MASK & 0xff000000 - orr \tmp, \tmp, #IXP2000_VALID_IRQ_MASK & 0x00ff0000 - orr \tmp, \tmp, #IXP2000_VALID_IRQ_MASK & 0x0000ff00 - orr \tmp, \tmp, #IXP2000_VALID_IRQ_MASK & 0x000000ff - and \irqstat, \irqstat, \tmp - - cmp \irqstat, #0 - beq 1001f - - clz \irqnr, \irqstat - mov \base, #31 - subs \irqnr, \base, \irqnr - - /* - * We handle PCIA and PCIB here so we don't have an - * extra layer of code just to check these two bits. - */ - cmp \irqnr, #IRQ_IXP2000_PCI - bne 1001f - - mov \base, #0xfe000000 - orr \base, \base, #0x00fd0000 - orr \base, \base, #0x0000e100 - orr \base, \base, #0x00000058 - ldr \irqstat, [\base] - - mov \tmp, #(1<<26) - tst \irqstat, \tmp - movne \irqnr, #IRQ_IXP2000_PCIA - bne 1001f - - mov \tmp, #(1<<27) - tst \irqstat, \tmp - movne \irqnr, #IRQ_IXP2000_PCIB - -1001: - .endm - - .macro irq_prio_table - .endm - -#elif defined (CONFIG_ARCH_IXP4XX) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) - ldr \irqstat, [\irqstat] @ get interrupts - cmp \irqstat, #0 - beq 1002f - clz \irqnr, \irqstat - mov \base, #31 - subs \irqnr, \base, \irqnr - -/* -1001: tst \irqstat, #1 - addeq \irqnr, \irqnr, #1 - moveq \irqstat, \irqstat, lsr #1 - tsteq \irqnr, #32 - beq 1001b - teq \irqnr, #32 -*/ -1002: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_OMAP) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \base, =IO_ADDRESS(OMAP_IH1_BASE) - ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] - ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET] - mov \irqstat, #0xffffffff - bic \tmp, \irqstat, \tmp - tst \irqnr, \tmp - beq 1510f - - ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET] - cmp \irqnr, #0 - ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] - cmpeq \irqnr, #INT_IH2_IRQ - ldreq \base, =IO_ADDRESS(OMAP_IH2_BASE) - ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] - addeqs \irqnr, \irqnr, #32 -1510: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_S3C2410) - /* S3C2410X IRQ Handler, */ - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - -30000: - mov \tmp, #S3C2410_VA_IRQ - ldr \irqnr, [ \tmp, #0x14 ] @ get irq no - teq \irqnr, #4 - teqne \irqnr, #5 - beq 1002f @ external irq reg - teq \irqnr, #16 - beq 1003f @ lcd controller - - @ debug check to see if interrupt reported is the same - @ as the offset.... - - teq \irqnr, #0 - beq 20002f - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND - mov \irqstat, \irqstat, lsr \irqnr - tst \irqstat, #1 - bne 20002f - -#if 1 - stmfd r13!, { r0 - r4 , r14 } - ldr r1, [ \tmp, #0x14 ] @ intoffset - ldr r2, [ \tmp, #0x10 ] @ INTPND - ldr r3, [ \tmp, #0x00 ] @ SRCPND - adr r0, 20003f - bl printk - b 20004f -#endif -20003: - .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n" - .byte 0 - .align 4 -20004: - mov r1, #1 - mov \tmp, #S3C2410_VA_IRQ - ldmfd r13!, { r0 - r4 , r14 } - - @ try working out interript number for ourselves - mov \irqnr, #0 - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND -10021: - movs \irqstat, \irqstat, lsr#1 - bcs 30000b @ try and re-start the proccess - add \irqnr, \irqnr, #1 - cmp \irqnr, #32 - ble 10021b - - @ found no interrupt, set Z flag and leave - movs \irqnr, #0 - b 1001f - -20005: -20002: @ exit - @ we base the s3c2410x interrupts at 16 and above to allow - @ isa peripherals to have their standard interrupts, also - @ ensure that Z flag is un-set on exit - - @ note, we cannot be sure if we get IRQ_EINT0 (0) that - @ there is simply no interrupt pending, so in all other - @ cases we jump to say we have found something, otherwise - @ we check to see if the interrupt really is assrted - adds \irqnr, \irqnr, #IRQ_EINT0 - teq \irqnr, #IRQ_EINT0 - bne 1001f @ exit - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND - teq \irqstat, #0 - moveq \irqnr, #0 - b 1001f - - @ we get here from no main or external interrupts pending -1002: - add \tmp, \tmp, #S3C2410_VA_GPIO - S3C2410_VA_IRQ - ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND - ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK - - bic \irqstat, \irqstat, \irqnr @ clear masked irqs - - mov \irqnr, #IRQ_EINT4 @ start extint nos - mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits -10021: - movs \irqstat, \irqstat, lsr#1 - bcs 1004f - add \irqnr, \irqnr, #1 - cmp \irqnr, #IRQ_EINT23 - ble 10021b - - @ found no interrupt, set Z flag and leave - movs \irqnr, #0 - b 1001f - -1003: - @ lcd interrupt has been asserted... - add \tmp, \tmp, #S3C2410_VA_LCD - S3C2410_VA_IRQ - ldr \irqstat, [ \tmp, # 0x54 ] @ lcd int pending - - tst \irqstat, #2 - movne \irqnr, #IRQ_LCD_FRAME - tst \irqstat, #1 - movne \irqnr, #IRQ_LCD_FIFO - - @ fall through to exit with flags updated - -1004: @ ensure Z flag clear in case our MOVS shifted out the last bit - teq \irqnr, #0 -1001: - @ exit irq routine - .endm - - - /* currently don't need an disable_fiq macro */ - - .macro disable_fiq - .endm - - /* we don't have an irq priority table */ - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_LH7A400) - -# if defined (CONFIG_ARCH_LH7A404) -# error "LH7A400 and LH7A404 are mutually exclusive" -# endif - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \irqnr, #0 - mov \base, #io_p2v(0x80000000) @ APB registers - ldr \irqstat, [\base, #0x500] @ PIC INTSR - -1001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry - bcs 1008f @ Bit set; irq found - add \irqnr, \irqnr, #1 - bne 1001b @ Until no bits - b 1009f @ Nothing? Hmm. -1008: movs \irqstat, #1 @ Force !Z -1009: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_LH7A404) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \irqnr, #0 @ VIC1 irq base - mov \base, #io_p2v(0x80000000) @ APB registers - add \base, \base, #0x8000 - ldr \tmp, [\base, #0x0030] @ VIC1_VECTADDR - tst \tmp, #VA_VECTORED @ Direct vectored - bne 1002f - tst \tmp, #VA_VIC1DEFAULT @ Default vectored VIC1 - ldrne \irqstat, [\base, #0] @ VIC1_IRQSTATUS - bne 1001f - add \base, \base, #(0xa000 - 0x8000) - ldr \tmp, [\base, #0x0030] @ VIC2_VECTADDR - tst \tmp, #VA_VECTORED @ Direct vectored - bne 1002f - ldr \irqstat, [\base, #0] @ VIC2_IRQSTATUS - mov \irqnr, #32 @ VIC2 irq base - -1001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry - bcs 1008f @ Bit set; irq found - add \irqnr, \irqnr, #1 - bne 1001b @ Until no bits - b 1009f @ Nothing? Hmm. -1002: and \irqnr, \tmp, #0x3f @ Mask for valid bits -1008: movs \irqstat, #1 @ Force !Z - str \tmp, [\base, #0x0030] @ Clear vector -1009: - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_IMX) - - .macro disable_fiq - .endm -#define AITC_NIVECSR 0x40 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, =IO_ADDRESS(IMX_AITC_BASE) - @ Load offset & priority of the highest priority - @ interrupt pending. - ldr \irqnr, [\irqstat, #AITC_NIVECSR] - @ Shift off the priority leaving the offset or - @ "interrupt number" - mov \irqnr, \irqnr, lsr #16 - ldr \irqstat, =1 @ dummy compare - ldr \base, =0xFFFF // invalid interrupt - cmp \irqnr, \base - bne 1001f - ldr \irqstat, =0 -1001: - tst \irqstat, #1 @ to make the condition code = TRUE - .endm - - .macro irq_prio_table - .endm - -#elif defined(CONFIG_ARCH_H720X) - - .macro disable_fiq - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp -#if defined (CONFIG_CPU_H7201) || defined (CONFIG_CPU_H7202) - @ we could use the id register on H7202, but this is not - @ properly updated when we come back from asm_do_irq - @ without a previous return from interrupt - @ (see loops below in irq_svc, irq_usr) - @ We see unmasked pending ints only, as the masked pending ints - @ are not visible here - - mov \base, #0xf0000000 @ base register - orr \base, \base, #0x24000 @ irqbase - ldr \irqstat, [\base, #0x04] @ get interrupt status -#if defined (CONFIG_CPU_H7201) - ldr \tmp, =0x001fffff -#else - mvn \tmp, #0xc0000000 -#endif - and \irqstat, \irqstat, \tmp @ mask out unused ints - mov \irqnr, #0 - - mov \tmp, #0xff00 - orr \tmp, \tmp, #0xff - tst \irqstat, \tmp - addeq \irqnr, \irqnr, #16 - moveq \irqstat, \irqstat, lsr #16 - tst \irqstat, #255 - addeq \irqnr, \irqnr, #8 - moveq \irqstat, \irqstat, lsr #8 - tst \irqstat, #15 - addeq \irqnr, \irqnr, #4 - moveq \irqstat, \irqstat, lsr #4 - tst \irqstat, #3 - addeq \irqnr, \irqnr, #2 - moveq \irqstat, \irqstat, lsr #2 - tst \irqstat, #1 - addeq \irqnr, \irqnr, #1 - moveq \irqstat, \irqstat, lsr #1 - tst \irqstat, #1 @ bit 0 should be set - .endm - - .macro irq_prio_table - .endm - -#else -#error hynix processor selection missmatch -#endif -#else -#error Unknown architecture -#endif - /* * Invalid mode handlers */ -__pabt_invalid: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go - stmia sp, {r0 - lr} @ Save XXX r0 - lr - ldr r4, .LCabt - mov r1, #BAD_PREFETCH - b 1f - -__dabt_invalid: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - lr} @ Save SVC r0 - lr [lr *should* be intact] - ldr r4, .LCabt - mov r1, #BAD_DATA - b 1f - -__irq_invalid: sub sp, sp, #S_FRAME_SIZE @ Allocate space on stack for frame - stmfd sp, {r0 - lr} @ Save r0 - lr - ldr r4, .LCirq - mov r1, #BAD_IRQ - b 1f - -__und_invalid: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - lr} - ldr r4, .LCund - mov r1, #BAD_UNDEFINSTR @ int reason - -1: zero_fp - ldmia r4, {r5 - r7} @ Get XXX pc, cpsr, old_r0 - add r4, sp, #S_PC - stmia r4, {r5 - r7} @ Save XXX pc, cpsr, old_r0 - mov r0, sp - and r2, r6, #31 @ int mode - b bad_mode + .macro inv_entry, sym, reason + sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go + stmia sp, {r0 - lr} @ Save XXX r0 - lr + ldr r4, .LC\sym + mov r1, #\reason + .endm + +__pabt_invalid: + inv_entry abt, BAD_PREFETCH + b 1f + +__dabt_invalid: + inv_entry abt, BAD_DATA + b 1f + +__irq_invalid: + inv_entry irq, BAD_IRQ + b 1f + +__und_invalid: + inv_entry und, BAD_UNDEFINSTR + +1: zero_fp + ldmia r4, {r5 - r7} @ Get XXX pc, cpsr, old_r0 + add r4, sp, #S_PC + stmia r4, {r5 - r7} @ Save XXX pc, cpsr, old_r0 + mov r0, sp + and r2, r6, #31 @ int mode + b bad_mode /* * SVC mode handlers */ - .align 5 -__dabt_svc: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r2, .LCabt - add r0, sp, #S_FRAME_SIZE - ldmia r2, {r2 - r4} @ get pc, cpsr - add r5, sp, #S_SP - mov r1, lr - stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_ro - mrs r9, cpsr @ Enable interrupts if they were - tst r3, #PSR_I_BIT - biceq r9, r9, #PSR_I_BIT @ previously -/* - * This routine must not corrupt r9 - */ + .macro svc_entry, sym + sub sp, sp, #S_FRAME_SIZE + stmia sp, {r0 - r12} @ save r0 - r12 + ldr r2, .LC\sym + add r0, sp, #S_FRAME_SIZE + ldmia r2, {r2 - r4} @ get pc, cpsr + add r5, sp, #S_SP + mov r1, lr + + @ + @ We are now ready to fill in the remaining blanks on the stack: + @ + @ r0 - sp_svc + @ r1 - lr_svc + @ r2 - lr_, already fixed up for correct return/restart + @ r3 - spsr_ + @ r4 - orig_r0 (see pt_regs definition in ptrace.h) + @ + stmia r5, {r0 - r4} + .endm + + .align 5 +__dabt_svc: + svc_entry abt + + @ + @ get ready to re-enable interrupts if appropriate + @ + mrs r9, cpsr + tst r3, #PSR_I_BIT + biceq r9, r9, #PSR_I_BIT + + @ + @ Call the processor-specific abort handler: + @ + @ r2 - aborted context pc + @ r3 - aborted context cpsr + @ + @ The abort handler must return the aborted address in r0, and + @ the fault status register in r1. r9 must be preserved. + @ #ifdef MULTI_ABORT - ldr r4, .LCprocfns @ pass r2, r3 to - mov lr, pc @ processor code - ldr pc, [r4] @ call processor specific code + ldr r4, .LCprocfns + mov lr, pc + ldr pc, [r4] #else - bl CPU_ABORT_HANDLER + bl CPU_ABORT_HANDLER #endif - msr cpsr_c, r9 - mov r2, sp - bl do_DataAbort - disable_irq r0 - ldr r0, [sp, #S_PSR] - msr spsr_cxsf, r0 - ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr - - .align 5 -__irq_svc: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r7, .LCirq - add r5, sp, #S_FRAME_SIZE - ldmia r7, {r7 - r9} - add r4, sp, #S_SP - mov r6, lr - stmia r4, {r5, r6, r7, r8, r9} @ save sp_SVC, lr_SVC, pc, cpsr, old_ro + + @ + @ set desired IRQ state, then call main handler + @ + msr cpsr_c, r9 + mov r2, sp + bl do_DataAbort + + @ + @ IRQs off again before pulling preserved data off the stack + @ + disable_irq r0 + + @ + @ restore SPSR and restart the instruction + @ + ldr r0, [sp, #S_PSR] + msr spsr_cxsf, r0 + ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr + + .align 5 +__irq_svc: + svc_entry irq #ifdef CONFIG_PREEMPT - get_thread_info r8 - ldr r9, [r8, #TI_PREEMPT] @ get preempt count - add r7, r9, #1 @ increment it - str r7, [r8, #TI_PREEMPT] + get_thread_info r8 + ldr r9, [r8, #TI_PREEMPT] @ get preempt count + add r7, r9, #1 @ increment it + str r7, [r8, #TI_PREEMPT] #endif -1: get_irqnr_and_base r0, r6, r5, lr - movne r1, sp - @ - @ routine called with r0 = irq number, r1 = struct pt_regs * - @ - adrsvc ne, lr, 1b - bne asm_do_IRQ +1: get_irqnr_and_base r0, r6, r5, lr + movne r1, sp + @ + @ routine called with r0 = irq number, r1 = struct pt_regs * + @ + adrne lr, 1b + bne asm_do_IRQ #ifdef CONFIG_PREEMPT - ldr r0, [r8, #TI_FLAGS] @ get flags - tst r0, #_TIF_NEED_RESCHED - blne svc_preempt + ldr r0, [r8, #TI_FLAGS] @ get flags + tst r0, #_TIF_NEED_RESCHED + blne svc_preempt preempt_return: - ldr r0, [r8, #TI_PREEMPT] @ read preempt value - teq r0, r7 - str r9, [r8, #TI_PREEMPT] @ restore preempt count - strne r0, [r0, -r0] @ bug() + ldr r0, [r8, #TI_PREEMPT] @ read preempt value + teq r0, r7 + str r9, [r8, #TI_PREEMPT] @ restore preempt count + strne r0, [r0, -r0] @ bug() #endif - ldr r0, [sp, #S_PSR] @ irqs are already disabled - msr spsr_cxsf, r0 - ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr + ldr r0, [sp, #S_PSR] @ irqs are already disabled + msr spsr_cxsf, r0 + ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr - .ltorg + .ltorg #ifdef CONFIG_PREEMPT -svc_preempt: teq r9, #0 @ was preempt count = 0 - ldreq r6, .LCirq_stat - movne pc, lr @ no - ldr r0, [r6, #4] @ local_irq_count - ldr r1, [r6, #8] @ local_bh_count - adds r0, r0, r1 - movne pc, lr - mov r7, #PREEMPT_ACTIVE - str r7, [r8, #TI_PREEMPT] @ set PREEMPT_ACTIVE -1: enable_irq r2 @ enable IRQs - bl schedule - disable_irq r0 @ disable IRQs - ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS - tst r0, #_TIF_NEED_RESCHED - beq preempt_return @ go again - b 1b +svc_preempt: + teq r9, #0 @ was preempt count = 0 + ldreq r6, .LCirq_stat + movne pc, lr @ no + ldr r0, [r6, #4] @ local_irq_count + ldr r1, [r6, #8] @ local_bh_count + adds r0, r0, r1 + movne pc, lr + mov r7, #0 @ preempt_schedule_irq + str r7, [r8, #TI_PREEMPT] @ expects preempt_count == 0 +1: bl preempt_schedule_irq @ irq en/disable is done inside + ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS + tst r0, #_TIF_NEED_RESCHED + beq preempt_return @ go again + b 1b #endif - .align 5 -__und_svc: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r3, .LCund - mov r4, lr - ldmia r3, {r5 - r7} - add r3, sp, #S_FRAME_SIZE - add r2, sp, #S_SP - stmia r2, {r3 - r7} @ save sp_SVC, lr_SVC, pc, cpsr, old_ro - - ldr r0, [r5, #-4] @ r0 = instruction - adrsvc al, r9, 1f @ r9 = normal FP return - bl call_fpe @ lr = undefined instr return - - mov r0, sp @ struct pt_regs *regs - bl do_undefinstr - -1: disable_irq r0 - ldr lr, [sp, #S_PSR] @ Get SVC cpsr - msr spsr_cxsf, lr - ldmia sp, {r0 - pc}^ @ Restore SVC registers - - .align 5 -__pabt_svc: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r2, .LCabt - add r0, sp, #S_FRAME_SIZE - ldmia r2, {r2 - r4} @ get pc, cpsr - add r5, sp, #S_SP - mov r1, lr - stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_ro - mrs r9, cpsr @ Enable interrupts if they were - tst r3, #PSR_I_BIT - biceq r9, r9, #PSR_I_BIT @ previously - msr cpsr_c, r9 - mov r0, r2 @ address (pc) - mov r1, sp @ regs - bl do_PrefetchAbort @ call abort handler - disable_irq r0 - ldr r0, [sp, #S_PSR] - msr spsr_cxsf, r0 - ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr - - .align 5 -.LCirq: .word __temp_irq -.LCund: .word __temp_und -.LCabt: .word __temp_abt + .align 5 +__und_svc: + svc_entry und + + @ + @ call emulation code, which returns using r9 if it has emulated + @ the instruction, or the more conventional lr if we are to treat + @ this as a real undefined instruction + @ + @ r0 - instruction + @ + ldr r0, [r2, #-4] + adr r9, 1f + bl call_fpe + + mov r0, sp @ struct pt_regs *regs + bl do_undefinstr + + @ + @ IRQs off again before pulling preserved data off the stack + @ +1: disable_irq r0 + + @ + @ restore SPSR and restart the instruction + @ + ldr lr, [sp, #S_PSR] @ Get SVC cpsr + msr spsr_cxsf, lr + ldmia sp, {r0 - pc}^ @ Restore SVC registers + + .align 5 +__pabt_svc: + svc_entry abt + + @ + @ re-enable interrupts if appropriate + @ + mrs r9, cpsr + tst r3, #PSR_I_BIT + biceq r9, r9, #PSR_I_BIT + msr cpsr_c, r9 + + @ + @ set args, then call main handler + @ + @ r0 - address of faulting instruction + @ r1 - pointer to registers on stack + @ + mov r0, r2 @ address (pc) + mov r1, sp @ regs + bl do_PrefetchAbort @ call abort handler + + @ + @ IRQs off again before pulling preserved data off the stack + @ + disable_irq r0 + + @ + @ restore SPSR and restart the instruction + @ + ldr r0, [sp, #S_PSR] + msr spsr_cxsf, r0 + ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr + + .align 5 +.LCirq: + .word __temp_irq +.LCund: + .word __temp_und +.LCabt: + .word __temp_abt #ifdef MULTI_ABORT -.LCprocfns: .word processor +.LCprocfns: + .word processor #endif -.LCfp: .word fp_enter +.LCfp: + .word fp_enter #ifdef CONFIG_PREEMPT -.LCirq_stat: .word irq_stat +.LCirq_stat: + .word irq_stat #endif - irq_prio_table - /* * User mode handlers */ - .align 5 -__dabt_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r7, .LCabt - add r5, sp, #S_PC - ldmia r7, {r2 - r4} @ Get USR pc, cpsr - stmia r5, {r2 - r4} @ Save USR pc, cpsr, old_r0 - stmdb r5, {sp, lr}^ - alignment_trap r7, r7, __temp_abt - zero_fp + .macro usr_entry, sym + sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go + stmia sp, {r0 - r12} @ save r0 - r12 + ldr r7, .LC\sym + add r5, sp, #S_PC + ldmia r7, {r2 - r4} @ Get USR pc, cpsr + + @ + @ We are now ready to fill in the remaining blanks on the stack: + @ + @ r2 - lr_, already fixed up for correct return/restart + @ r3 - spsr_ + @ r4 - orig_r0 (see pt_regs definition in ptrace.h) + @ + @ Also, separately save sp_usr and lr_usr + @ + stmia r5, {r2 - r4} + stmdb r5, {sp, lr}^ + .endm + + .align 5 +__dabt_usr: + usr_entry abt + alignment_trap r7, r0, __temp_abt + zero_fp + + @ + @ Call the processor-specific abort handler: + @ + @ r2 - aborted context pc + @ r3 - aborted context cpsr + @ + @ The abort handler must return the aborted address in r0, and + @ the fault status register in r1. + @ #ifdef MULTI_ABORT - ldr r4, .LCprocfns @ pass r2, r3 to - mov lr, pc @ processor code - ldr pc, [r4] @ call processor specific code + ldr r4, .LCprocfns + mov lr, pc + ldr pc, [r4] #else - bl CPU_ABORT_HANDLER + bl CPU_ABORT_HANDLER #endif - enable_irq r2 @ Enable interrupts - mov r2, sp - adrsvc al, lr, ret_from_exception - b do_DataAbort - - .align 5 -__irq_usr: sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ save r0 - r12 - ldr r4, .LCirq - add r8, sp, #S_PC - ldmia r4, {r5 - r7} @ get saved PC, SPSR - stmia r8, {r5 - r7} @ save pc, psr, old_r0 - stmdb r8, {sp, lr}^ - alignment_trap r4, r7, __temp_irq - zero_fp + + @ + @ IRQs on, then call the main handler + @ + enable_irq r2 + mov r2, sp + adr lr, ret_from_exception + b do_DataAbort + + .align 5 +__irq_usr: + usr_entry irq + alignment_trap r7, r0, __temp_irq + zero_fp #ifdef CONFIG_PREEMPT - get_thread_info r8 - ldr r9, [r8, #TI_PREEMPT] @ get preempt count - add r7, r9, #1 @ increment it - str r7, [r8, #TI_PREEMPT] + get_thread_info r8 + ldr r9, [r8, #TI_PREEMPT] @ get preempt count + add r7, r9, #1 @ increment it + str r7, [r8, #TI_PREEMPT] #endif -1: get_irqnr_and_base r0, r6, r5, lr - movne r1, sp - adrsvc ne, lr, 1b - @ - @ routine called with r0 = irq number, r1 = struct pt_regs * - @ - bne asm_do_IRQ +1: get_irqnr_and_base r0, r6, r5, lr + movne r1, sp + adrne lr, 1b + @ + @ routine called with r0 = irq number, r1 = struct pt_regs * + @ + bne asm_do_IRQ #ifdef CONFIG_PREEMPT - ldr r0, [r8, #TI_PREEMPT] - teq r0, r7 - str r9, [r8, #TI_PREEMPT] - strne r0, [r0, -r0] - mov tsk, r8 + ldr r0, [r8, #TI_PREEMPT] + teq r0, r7 + str r9, [r8, #TI_PREEMPT] + strne r0, [r0, -r0] + mov tsk, r8 #else - get_thread_info tsk + get_thread_info tsk #endif - mov why, #0 - b ret_to_user - - .ltorg - - .align 5 -__und_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go - stmia sp, {r0 - r12} @ Save r0 - r12 - ldr r4, .LCund - add r8, sp, #S_PC - ldmia r4, {r5 - r7} - stmia r8, {r5 - r7} @ Save USR pc, cpsr, old_r0 - stmdb r8, {sp, lr}^ @ Save user sp, lr - alignment_trap r4, r7, __temp_und - zero_fp - tst r6, #PSR_T_BIT @ Thumb mode? - bne fpundefinstr @ ignore FP - sub r4, r5, #4 -1: ldrt r0, [r4] @ r0 = instruction - adrsvc al, r9, ret_from_exception @ r9 = normal FP return - adrsvc al, lr, fpundefinstr @ lr = undefined instr return + mov why, #0 + b ret_to_user + + .ltorg + + .align 5 +__und_usr: + usr_entry und + alignment_trap r7, r0, __temp_und + zero_fp + tst r3, #PSR_T_BIT @ Thumb mode? + bne fpundefinstr @ ignore FP + sub r4, r2, #4 + + @ + @ fall through to the emulation code, which returns using r9 if + @ it has emulated the instruction, or the more conventional lr + @ if we are to treat this as a real undefined instruction + @ + @ r0 - instruction + @ +1: ldrt r0, [r4] + adr r9, ret_from_exception + adr lr, fpundefinstr + @ + @ fallthrough to call_fpe + @ /* * The out of line fixup for the ldrt above. */ - .section .fixup, "ax" -2: mov pc, r9 - .previous - .section __ex_table,"a" - .long 1b, 2b - .previous + .section .fixup, "ax" +2: mov pc, r9 + .previous + .section __ex_table,"a" + .long 1b, 2b + .previous /* - * r0 = instruction. - * * Check whether the instruction is a co-processor instruction. * If yes, we need to call the relevant co-processor handler. * @@ -1300,98 +389,96 @@ __und_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go * for the ARM6/ARM7 SWI bug. * * Emulators may wish to make use of the following registers: - * r0 - instruction opcode. - * r10 - this threads thread_info structure. + * r0 = instruction opcode. + * r2 = PC+4 + * r10 = this threads thread_info structure. */ call_fpe: - tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 + tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710) - and r8, r0, #0x0f000000 @ mask out op-code bits - teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)? + and r8, r0, #0x0f000000 @ mask out op-code bits + teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)? #endif - moveq pc, lr - get_thread_info r10 @ get current thread - and r8, r0, #0x00000f00 @ mask out CP number - mov r7, #1 - add r6, r10, #TI_USED_CP - strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[] + moveq pc, lr + get_thread_info r10 @ get current thread + and r8, r0, #0x00000f00 @ mask out CP number + mov r7, #1 + add r6, r10, #TI_USED_CP + strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[] #ifdef CONFIG_IWMMXT - @ Test if we need to give access to iWMMXt coprocessors - ldr r5, [r10, #TI_FLAGS] - rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only - movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) - bcs iwmmxt_task_enable + @ Test if we need to give access to iWMMXt coprocessors + ldr r5, [r10, #TI_FLAGS] + rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only + movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) + bcs iwmmxt_task_enable #endif - enable_irq r7 - add pc, pc, r8, lsr #6 - mov r0, r0 - - mov pc, lr @ CP#0 - b do_fpe @ CP#1 (FPE) - b do_fpe @ CP#2 (FPE) - mov pc, lr @ CP#3 - mov pc, lr @ CP#4 - mov pc, lr @ CP#5 - mov pc, lr @ CP#6 - mov pc, lr @ CP#7 - mov pc, lr @ CP#8 - mov pc, lr @ CP#9 + enable_irq r7 + add pc, pc, r8, lsr #6 + mov r0, r0 + + mov pc, lr @ CP#0 + b do_fpe @ CP#1 (FPE) + b do_fpe @ CP#2 (FPE) + mov pc, lr @ CP#3 + mov pc, lr @ CP#4 + mov pc, lr @ CP#5 + mov pc, lr @ CP#6 + mov pc, lr @ CP#7 + mov pc, lr @ CP#8 + mov pc, lr @ CP#9 #ifdef CONFIG_VFP - b do_vfp @ CP#10 (VFP) - b do_vfp @ CP#11 (VFP) + b do_vfp @ CP#10 (VFP) + b do_vfp @ CP#11 (VFP) #else - mov pc, lr @ CP#10 (VFP) - mov pc, lr @ CP#11 (VFP) + mov pc, lr @ CP#10 (VFP) + mov pc, lr @ CP#11 (VFP) #endif - mov pc, lr @ CP#12 - mov pc, lr @ CP#13 - mov pc, lr @ CP#14 (Debug) - mov pc, lr @ CP#15 (Control) + mov pc, lr @ CP#12 + mov pc, lr @ CP#13 + mov pc, lr @ CP#14 (Debug) + mov pc, lr @ CP#15 (Control) -do_fpe: ldr r4, .LCfp - add r10, r10, #TI_FPSTATE @ r10 = workspace - ldr pc, [r4] @ Call FP module USR entry point +do_fpe: + ldr r4, .LCfp + add r10, r10, #TI_FPSTATE @ r10 = workspace + ldr pc, [r4] @ Call FP module USR entry point /* * The FP module is called with these registers set: * r0 = instruction - * r5 = PC + * r2 = PC+4 * r9 = normal "successful" return address * r10 = FP workspace * lr = unrecognised FP instruction return address */ - .data + .data ENTRY(fp_enter) - .word fpundefinstr - .text - -fpundefinstr: mov r0, sp - adrsvc al, lr, ret_from_exception - b do_undefinstr - - .align 5 -__pabt_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go - stmia sp, {r0 - r12} @ Save r0 - r12 - ldr r4, .LCabt - add r8, sp, #S_PC - ldmia r4, {r5 - r7} @ Get USR pc, cpsr - stmia r8, {r5 - r7} @ Save USR pc, cpsr, old_r0 - stmdb r8, {sp, lr}^ @ Save sp_usr lr_usr - alignment_trap r4, r7, __temp_abt - zero_fp - enable_irq r0 @ Enable interrupts - mov r0, r5 @ address (pc) - mov r1, sp @ regs - bl do_PrefetchAbort @ call abort handler - /* fall through */ + .word fpundefinstr + .text + +fpundefinstr: + mov r0, sp + adr lr, ret_from_exception + b do_undefinstr + + .align 5 +__pabt_usr: + usr_entry abt + alignment_trap r7, r0, __temp_abt + zero_fp + enable_irq r0 @ Enable interrupts + mov r0, r2 @ address (pc) + mov r1, sp @ regs + bl do_PrefetchAbort @ call abort handler + /* fall through */ /* * This is the return code to user mode for abort handlers */ ENTRY(ret_from_exception) - get_thread_info tsk - mov why, #0 - b ret_to_user + get_thread_info tsk + mov why, #0 + b ret_to_user /* * Register switch for ARMv3 and ARMv4 processors @@ -1399,212 +486,160 @@ ENTRY(ret_from_exception) * previous and next are guaranteed not to be the same. */ ENTRY(__switch_to) - add ip, r1, #TI_CPU_SAVE - ldr r3, [r2, #TI_CPU_DOMAIN]! - stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack + add ip, r1, #TI_CPU_SAVE + ldr r3, [r2, #TI_TP_VALUE] + stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack + ldr r6, [r2, #TI_CPU_DOMAIN]! #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) - mra r4, r5, acc0 - stmia ip, {r4, r5} + mra r4, r5, acc0 + stmia ip, {r4, r5} #endif - mcr p15, 0, r3, c3, c0, 0 @ Set domain register + mov r4, #0xffff0fff + str r3, [r4, #-3] @ Set TLS ptr + mcr p15, 0, r6, c3, c0, 0 @ Set domain register #ifdef CONFIG_VFP - @ Always disable VFP so we can lazily save/restore the old - @ state. This occurs in the context of the previous thread. - VFPFMRX r4, FPEXC - bic r4, r4, #FPEXC_ENABLE - VFPFMXR FPEXC, r4 + @ Always disable VFP so we can lazily save/restore the old + @ state. This occurs in the context of the previous thread. + VFPFMRX r4, FPEXC + bic r4, r4, #FPEXC_ENABLE + VFPFMXR FPEXC, r4 #endif #if defined(CONFIG_IWMMXT) - bl iwmmxt_task_switch + bl iwmmxt_task_switch #elif defined(CONFIG_CPU_XSCALE) - add r4, r2, #40 @ cpu_context_save->extra - ldmib r4, {r4, r5} - mar acc0, r4, r5 + add r4, r2, #40 @ cpu_context_save->extra + ldmib r4, {r4, r5} + mar acc0, r4, r5 #endif - ldmib r2, {r4 - sl, fp, sp, pc} @ Load all regs saved previously + ldmib r2, {r4 - sl, fp, sp, pc} @ Load all regs saved previously - __INIT + __INIT /* - * Vector stubs. NOTE that we only align 'vector_IRQ' to a cache line boundary, - * and we rely on each stub being exactly 48 (1.5 cache lines) in size. This - * means that we only ever load two cache lines for this code, or one if we're - * lucky. We also copy this code to 0x200 so that we can use branches in the + * Vector stubs. + * + * This code is copied to 0x200 or 0xffff0200 so we can use branches in the * vectors, rather than ldr's. + * + * Common stub entry macro: + * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC */ - .align 5 + .macro vector_stub, name, sym, correction=0 + .align 5 + +vector_\name: + ldr r13, .LCs\sym + .if \correction + sub lr, lr, #\correction + .endif + str lr, [r13] @ save lr_IRQ + mrs lr, spsr + str lr, [r13, #4] @ save spsr_IRQ + @ + @ now branch to the relevant MODE handling routine + @ + mrs r13, cpsr + bic r13, r13, #MODE_MASK + orr r13, r13, #MODE_SVC + msr spsr_cxsf, r13 @ switch to SVC_32 mode + + and lr, lr, #15 + ldr lr, [pc, lr, lsl #2] + movs pc, lr @ Changes mode and branches + .endm + __stubs_start: /* * Interrupt dispatcher - * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC */ -vector_IRQ: @ - @ save mode specific registers - @ - ldr r13, .LCsirq - sub lr, lr, #4 - str lr, [r13] @ save lr_IRQ - mrs lr, spsr - str lr, [r13, #4] @ save spsr_IRQ - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_irq: .word __irq_usr @ 0 (USR_26 / USR_32) - .word __irq_invalid @ 1 (FIQ_26 / FIQ_32) - .word __irq_invalid @ 2 (IRQ_26 / IRQ_32) - .word __irq_svc @ 3 (SVC_26 / SVC_32) - .word __irq_invalid @ 4 - .word __irq_invalid @ 5 - .word __irq_invalid @ 6 - .word __irq_invalid @ 7 - .word __irq_invalid @ 8 - .word __irq_invalid @ 9 - .word __irq_invalid @ a - .word __irq_invalid @ b - .word __irq_invalid @ c - .word __irq_invalid @ d - .word __irq_invalid @ e - .word __irq_invalid @ f - - .align 5 + vector_stub irq, irq, 4 + + .long __irq_usr @ 0 (USR_26 / USR_32) + .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) + .long __irq_invalid @ 2 (IRQ_26 / IRQ_32) + .long __irq_svc @ 3 (SVC_26 / SVC_32) + .long __irq_invalid @ 4 + .long __irq_invalid @ 5 + .long __irq_invalid @ 6 + .long __irq_invalid @ 7 + .long __irq_invalid @ 8 + .long __irq_invalid @ 9 + .long __irq_invalid @ a + .long __irq_invalid @ b + .long __irq_invalid @ c + .long __irq_invalid @ d + .long __irq_invalid @ e + .long __irq_invalid @ f /* - * Data abort dispatcher - dispatches it to the correct handler for the processor mode + * Data abort dispatcher * Enter in ABT mode, spsr = USR CPSR, lr = USR PC */ -vector_data: @ - @ save mode specific registers - @ - ldr r13, .LCsabt - sub lr, lr, #8 - str lr, [r13] - mrs lr, spsr - str lr, [r13, #4] - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_dabt: .word __dabt_usr @ 0 (USR_26 / USR_32) - .word __dabt_invalid @ 1 (FIQ_26 / FIQ_32) - .word __dabt_invalid @ 2 (IRQ_26 / IRQ_32) - .word __dabt_svc @ 3 (SVC_26 / SVC_32) - .word __dabt_invalid @ 4 - .word __dabt_invalid @ 5 - .word __dabt_invalid @ 6 - .word __dabt_invalid @ 7 - .word __dabt_invalid @ 8 - .word __dabt_invalid @ 9 - .word __dabt_invalid @ a - .word __dabt_invalid @ b - .word __dabt_invalid @ c - .word __dabt_invalid @ d - .word __dabt_invalid @ e - .word __dabt_invalid @ f - - .align 5 + vector_stub dabt, abt, 8 + + .long __dabt_usr @ 0 (USR_26 / USR_32) + .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32) + .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32) + .long __dabt_svc @ 3 (SVC_26 / SVC_32) + .long __dabt_invalid @ 4 + .long __dabt_invalid @ 5 + .long __dabt_invalid @ 6 + .long __dabt_invalid @ 7 + .long __dabt_invalid @ 8 + .long __dabt_invalid @ 9 + .long __dabt_invalid @ a + .long __dabt_invalid @ b + .long __dabt_invalid @ c + .long __dabt_invalid @ d + .long __dabt_invalid @ e + .long __dabt_invalid @ f /* - * Prefetch abort dispatcher - dispatches it to the correct handler for the processor mode + * Prefetch abort dispatcher * Enter in ABT mode, spsr = USR CPSR, lr = USR PC */ -vector_prefetch: - @ - @ save mode specific registers - @ - ldr r13, .LCsabt - sub lr, lr, #4 - str lr, [r13] @ save lr_ABT - mrs lr, spsr - str lr, [r13, #4] @ save spsr_ABT - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - ands lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr - -.LCtab_pabt: .word __pabt_usr @ 0 (USR_26 / USR_32) - .word __pabt_invalid @ 1 (FIQ_26 / FIQ_32) - .word __pabt_invalid @ 2 (IRQ_26 / IRQ_32) - .word __pabt_svc @ 3 (SVC_26 / SVC_32) - .word __pabt_invalid @ 4 - .word __pabt_invalid @ 5 - .word __pabt_invalid @ 6 - .word __pabt_invalid @ 7 - .word __pabt_invalid @ 8 - .word __pabt_invalid @ 9 - .word __pabt_invalid @ a - .word __pabt_invalid @ b - .word __pabt_invalid @ c - .word __pabt_invalid @ d - .word __pabt_invalid @ e - .word __pabt_invalid @ f - - .align 5 + vector_stub pabt, abt, 4 + + .long __pabt_usr @ 0 (USR_26 / USR_32) + .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32) + .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32) + .long __pabt_svc @ 3 (SVC_26 / SVC_32) + .long __pabt_invalid @ 4 + .long __pabt_invalid @ 5 + .long __pabt_invalid @ 6 + .long __pabt_invalid @ 7 + .long __pabt_invalid @ 8 + .long __pabt_invalid @ 9 + .long __pabt_invalid @ a + .long __pabt_invalid @ b + .long __pabt_invalid @ c + .long __pabt_invalid @ d + .long __pabt_invalid @ e + .long __pabt_invalid @ f /* - * Undef instr entry dispatcher - dispatches it to the correct handler for the processor mode + * Undef instr entry dispatcher * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC */ -vector_undefinstr: - @ - @ save mode specific registers - @ - ldr r13, .LCsund - str lr, [r13] @ save lr_UND - mrs lr, spsr - str lr, [r13, #4] @ save spsr_UND - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_und: .word __und_usr @ 0 (USR_26 / USR_32) - .word __und_invalid @ 1 (FIQ_26 / FIQ_32) - .word __und_invalid @ 2 (IRQ_26 / IRQ_32) - .word __und_svc @ 3 (SVC_26 / SVC_32) - .word __und_invalid @ 4 - .word __und_invalid @ 5 - .word __und_invalid @ 6 - .word __und_invalid @ 7 - .word __und_invalid @ 8 - .word __und_invalid @ 9 - .word __und_invalid @ a - .word __und_invalid @ b - .word __und_invalid @ c - .word __und_invalid @ d - .word __und_invalid @ e - .word __und_invalid @ f - - .align 5 + vector_stub und, und + + .long __und_usr @ 0 (USR_26 / USR_32) + .long __und_invalid @ 1 (FIQ_26 / FIQ_32) + .long __und_invalid @ 2 (IRQ_26 / IRQ_32) + .long __und_svc @ 3 (SVC_26 / SVC_32) + .long __und_invalid @ 4 + .long __und_invalid @ 5 + .long __und_invalid @ 6 + .long __und_invalid @ 7 + .long __und_invalid @ 8 + .long __und_invalid @ 9 + .long __und_invalid @ a + .long __und_invalid @ b + .long __und_invalid @ c + .long __und_invalid @ d + .long __und_invalid @ e + .long __und_invalid @ f + + .align 5 /*============================================================================= * Undefined FIQs @@ -1616,8 +651,9 @@ vector_undefinstr: * other mode than FIQ... Ok you can switch to another mode, but you can't * get out of that mode without clobbering one register. */ -vector_FIQ: disable_fiq - subs pc, lr, #4 +vector_fiq: + disable_fiq + subs pc, lr, #4 /*============================================================================= * Address exception handler @@ -1627,68 +663,78 @@ vector_FIQ: disable_fiq */ vector_addrexcptn: - b vector_addrexcptn + b vector_addrexcptn /* * We group all the following data together to optimise * for CPUs with separate I & D caches. */ - .align 5 + .align 5 -.LCvswi: .word vector_swi +.LCvswi: + .word vector_swi -.LCsirq: .word __temp_irq -.LCsund: .word __temp_und -.LCsabt: .word __temp_abt +.LCsirq: + .word __temp_irq +.LCsund: + .word __temp_und +.LCsabt: + .word __temp_abt __stubs_end: - .equ __real_stubs_start, .LCvectors + 0x200 + .equ __real_stubs_start, .LCvectors + 0x200 -.LCvectors: swi SYS_ERROR0 - b __real_stubs_start + (vector_undefinstr - __stubs_start) - ldr pc, __real_stubs_start + (.LCvswi - __stubs_start) - b __real_stubs_start + (vector_prefetch - __stubs_start) - b __real_stubs_start + (vector_data - __stubs_start) - b __real_stubs_start + (vector_addrexcptn - __stubs_start) - b __real_stubs_start + (vector_IRQ - __stubs_start) - b __real_stubs_start + (vector_FIQ - __stubs_start) +.LCvectors: + swi SYS_ERROR0 + b __real_stubs_start + (vector_und - __stubs_start) + ldr pc, __real_stubs_start + (.LCvswi - __stubs_start) + b __real_stubs_start + (vector_pabt - __stubs_start) + b __real_stubs_start + (vector_dabt - __stubs_start) + b __real_stubs_start + (vector_addrexcptn - __stubs_start) + b __real_stubs_start + (vector_irq - __stubs_start) + b __real_stubs_start + (vector_fiq - __stubs_start) ENTRY(__trap_init) - stmfd sp!, {r4 - r6, lr} + stmfd sp!, {r4 - r6, lr} - adr r1, .LCvectors @ set up the vectors - ldmia r1, {r1, r2, r3, r4, r5, r6, ip, lr} - stmia r0, {r1, r2, r3, r4, r5, r6, ip, lr} + mov r0, #0xff000000 + orr r0, r0, #0x00ff0000 @ high vectors position + adr r1, .LCvectors @ set up the vectors + ldmia r1, {r1, r2, r3, r4, r5, r6, ip, lr} + stmia r0, {r1, r2, r3, r4, r5, r6, ip, lr} - add r2, r0, #0x200 - adr r0, __stubs_start @ copy stubs to 0x200 - adr r1, __stubs_end -1: ldr r3, [r0], #4 - str r3, [r2], #4 - cmp r0, r1 - blt 1b - LOADREGS(fd, sp!, {r4 - r6, pc}) + add r2, r0, #0x200 + adr r0, __stubs_start @ copy stubs to 0x200 + adr r1, __stubs_end +1: ldr r3, [r0], #4 + str r3, [r2], #4 + cmp r0, r1 + blt 1b + LOADREGS(fd, sp!, {r4 - r6, pc}) - .data + .data /* * Do not reorder these, and do not insert extra data between... */ -__temp_irq: .word 0 @ saved lr_irq - .word 0 @ saved spsr_irq - .word -1 @ old_r0 -__temp_und: .word 0 @ Saved lr_und - .word 0 @ Saved spsr_und - .word -1 @ old_r0 -__temp_abt: .word 0 @ Saved lr_abt - .word 0 @ Saved spsr_abt - .word -1 @ old_r0 - - .globl cr_alignment - .globl cr_no_alignment +__temp_irq: + .word 0 @ saved lr_irq + .word 0 @ saved spsr_irq + .word -1 @ old_r0 +__temp_und: + .word 0 @ Saved lr_und + .word 0 @ Saved spsr_und + .word -1 @ old_r0 +__temp_abt: + .word 0 @ Saved lr_abt + .word 0 @ Saved spsr_abt + .word -1 @ old_r0 + + .globl cr_alignment + .globl cr_no_alignment cr_alignment: - .space 4 + .space 4 cr_no_alignment: - .space 4 + .space 4 diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 3314274b7..53a7e0dea 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -11,6 +11,7 @@ #include #include +#include #include "entry-header.S" @@ -137,7 +138,7 @@ ENTRY(vector_swi) tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? bne __sys_trace - adrsvc al, lr, ret_fast_syscall @ return address + adr lr, ret_fast_syscall @ return address cmp scno, #NR_syscalls @ check upper syscall limit ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine @@ -157,7 +158,7 @@ __sys_trace: mov r0, #0 @ trace entry [IP = 0] bl syscall_trace - adrsvc al, lr, __sys_trace_return @ return address + adr lr, __sys_trace_return @ return address add r1, sp, #S_R0 + S_OFF @ pointer to regs cmp scno, #NR_syscalls @ check upper syscall limit ldmccia r1, {r0 - r3} @ have to reload r0 - r3 @@ -190,13 +191,14 @@ ENTRY(sys_call_table) .type sys_syscall, #function sys_syscall: eor scno, r0, #OS_NUMBER << 20 - cmp scno, #NR_syscalls @ check range - stmleia sp, {r5, r6} @ shuffle args - movle r0, r1 - movle r1, r2 - movle r2, r3 - movle r3, r4 - ldrle pc, [tbl, scno, lsl #2] + cmp scno, #__NR_syscall - __NR_SYSCALL_BASE + cmpne scno, #NR_syscalls @ check range + stmloia sp, {r5, r6} @ shuffle args + movlo r0, r1 + movlo r1, r2 + movlo r2, r3 + movlo r3, r4 + ldrlo pc, [tbl, scno, lsl #2] b sys_ni_syscall sys_fork_wrapper: @@ -211,8 +213,9 @@ sys_execve_wrapper: add r3, sp, #S_OFF b sys_execve -sys_clone_wapper: - add r2, sp, #S_OFF +sys_clone_wrapper: + add ip, sp, #S_OFF + str ip, [sp, #4] b sys_clone sys_sigsuspend_wrapper: @@ -235,6 +238,10 @@ sys_sigaltstack_wrapper: ldr r2, [sp, #S_OFF + S_SP] b do_sigaltstack +sys_futex_wrapper: + str r5, [sp, #4] @ push sixth arg + b sys_futex + /* * Note: off_4k (r5) is always units of 4K. If we can't do the requested * offset, we return EINVAL. diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index ef152e3b5..4039d8c12 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S @@ -6,6 +6,7 @@ #include #include #include +#include #ifndef MODE_SVC #define MODE_SVC 0x13 @@ -140,13 +141,6 @@ mov \rd, \rd, lsl #13 .endm -/* - * Like adr, but force SVC mode (if required) - */ - .macro adrsvc, cond, reg, label - adr\cond \reg, \label - .endm - .macro alignment_trap, rbase, rtemp, sym #ifdef CONFIG_ALIGNMENT_TRAP #define OFF_CR_ALIGNMENT(x) cr_alignment - x diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 6f7938162..a45c7874a 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c @@ -46,32 +46,22 @@ #include #include -#define FIQ_VECTOR (vectors_base() + 0x1c) +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#warning This file requires GCC 3.3.x or older to build. Alternatively, +#warning please talk to GCC people to resolve the issues with the +#warning assembly clobber list. +#endif static unsigned long no_fiq_insn; -static inline void unprotect_page_0(void) -{ - modify_domain(DOMAIN_USER, DOMAIN_MANAGER); -} - -static inline void protect_page_0(void) -{ - modify_domain(DOMAIN_USER, DOMAIN_CLIENT); -} - /* Default reacquire function * - we always relinquish FIQ control * - we always reacquire FIQ control */ static int fiq_def_op(void *ref, int relinquish) { - if (!relinquish) { - unprotect_page_0(); - *(unsigned long *)FIQ_VECTOR = no_fiq_insn; - protect_page_0(); - flush_icache_range(FIQ_VECTOR, FIQ_VECTOR + 4); - } + if (!relinquish) + set_fiq_handler(&no_fiq_insn, sizeof(no_fiq_insn)); return 0; } @@ -93,12 +83,10 @@ int show_fiq_list(struct seq_file *p, void *v) void set_fiq_handler(void *start, unsigned int length) { - unprotect_page_0(); - - memcpy((void *)FIQ_VECTOR, start, length); - - protect_page_0(); - flush_icache_range(FIQ_VECTOR, FIQ_VECTOR + length); + memcpy((void *)0xffff001c, start, length); + flush_icache_range(0xffff001c, 0xffff001c + length); + if (!vectors_high()) + flush_icache_range(0x1c, 0x1c + length); } /* @@ -107,16 +95,15 @@ void set_fiq_handler(void *start, unsigned int length) */ void set_fiq_regs(struct pt_regs *regs) { - register unsigned long tmp, tmp2; + register unsigned long tmp; __asm__ volatile ( "mrs %0, cpsr\n\ - mov %1, %3\n\ - msr cpsr_c, %1 @ select FIQ mode\n\ + msr cpsr_c, %2 @ select FIQ mode\n\ mov r0, r0\n\ - ldmia %2, {r8 - r14}\n\ + ldmia %1, {r8 - r14}\n\ msr cpsr_c, %0 @ return to SVC mode\n\ mov r0, r0" - : "=&r" (tmp), "=&r" (tmp2) + : "=&r" (tmp) : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE) /* These registers aren't modified by the above code in a way visible to the compiler, but we mark them as clobbers anyway @@ -127,16 +114,15 @@ void set_fiq_regs(struct pt_regs *regs) void get_fiq_regs(struct pt_regs *regs) { - register unsigned long tmp, tmp2; + register unsigned long tmp; __asm__ volatile ( "mrs %0, cpsr\n\ - mov %1, %3\n\ - msr cpsr_c, %1 @ select FIQ mode\n\ + msr cpsr_c, %2 @ select FIQ mode\n\ mov r0, r0\n\ - stmia %2, {r8 - r14}\n\ + stmia %1, {r8 - r14}\n\ msr cpsr_c, %0 @ return to SVC mode\n\ mov r0, r0" - : "=&r" (tmp), "=&r" (tmp2) + : "=&r" (tmp) : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE) /* These registers aren't modified by the above code in a way visible to the compiler, but we mark them as clobbers anyway @@ -198,6 +184,5 @@ EXPORT_SYMBOL(disable_fiq); void __init init_FIQ(void) { - no_fiq_insn = *(unsigned long *)FIQ_VECTOR; - set_fs(get_fs()); + no_fiq_insn = *(unsigned long *)0xffff001c; } diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 6958a8b3f..587ac6756 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/head-armv.S + * linux/arch/arm/kernel/head.S * * Copyright (C) 1994-2002 Russell King * @@ -14,22 +14,30 @@ #include #include +#include #include #include #include #include +#include +#define PROCINFO_MMUFLAGS 8 +#define PROCINFO_INITFUNC 12 + +#define MACHINFO_PHYSRAM 4 +#define MACHINFO_PHYSIO 8 +#define MACHINFO_PGOFFIO 12 + +#ifndef CONFIG_XIP_KERNEL /* * We place the page tables 16K below TEXTADDR. Therefore, we must make sure * that TEXTADDR is correctly set. Currently, we expect the least significant * 16 bits to be 0x8000, but we could probably relax this restriction to - * TEXTADDR > PAGE_OFFSET + 0x4000 + * TEXTADDR >= PAGE_OFFSET + 0x4000 * * Note that swapper_pg_dir is the virtual address of the page tables, and * pgtbl gives us a position-independent reference to these tables. We can * do this because stext == TEXTADDR - * - * swapper_pg_dir, pgtbl and krnladr are all closely related. */ #if (TEXTADDR & 0xffff) != 0x8000 #error TEXTADDR must start at 0xXXXX8000 @@ -38,19 +46,35 @@ .globl swapper_pg_dir .equ swapper_pg_dir, TEXTADDR - 0x4000 - .macro pgtbl, reg - adr \reg, stext - sub \reg, \reg, #0x4000 + .macro pgtbl, rd, phys + adr \rd, stext + sub \rd, \rd, #0x4000 .endm - +#else /* - * Since the page table is closely related to the kernel start address, we - * can convert the page table base address to the base address of the section - * containing both. + * XIP Kernel: + * + * We place the page tables 16K below DATAADDR. Therefore, we must make sure + * that DATAADDR is correctly set. Currently, we expect the least significant + * 16 bits to be 0x8000, but we could probably relax this restriction to + * DATAADDR >= PAGE_OFFSET + 0x4000 + * + * Note that pgtbl is meant to return the physical address of swapper_pg_dir. + * We can't make it relative to the kernel position in this case since + * the kernel can physically be anywhere. */ - .macro krnladr, rd, pgtable - bic \rd, \pgtable, #0x000ff000 +#if (DATAADDR & 0xffff) != 0x8000 +#error DATAADDR must start at 0xXXXX8000 +#endif + + .globl swapper_pg_dir + .equ swapper_pg_dir, DATAADDR - 0x4000 + + .macro pgtbl, rd, phys + ldr \rd, =((DATAADDR - 0x4000) - VIRT_OFFSET) + add \rd, \rd, \phys .endm +#endif /* * Kernel startup entry point. @@ -71,17 +95,16 @@ * circumstances, zImage) is for. */ __INIT - .type stext, #function + .type stext, %function ENTRY(stext) - mov r12, r0 - mov r0, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ make sure svc mode - msr cpsr_c, r0 @ and all irqs disabled - bl __lookup_processor_type - teq r10, #0 @ invalid processor? + msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode + @ and irqs disabled + bl __lookup_processor_type @ r5=procinfo r9=cpuid + movs r10, r5 @ invalid processor (r5=0)? moveq r0, #'p' @ yes, error 'p' beq __error - bl __lookup_architecture_type - teq r7, #0 @ invalid architecture? + bl __lookup_machine_type @ r5=machinfo + movs r8, r5 @ invalid machine (r5=0)? moveq r0, #'a' @ yes, error 'a' beq __error bl __create_page_tables @@ -89,124 +112,194 @@ ENTRY(stext) /* * The following calls CPU specific code in a position independent * manner. See arch/arm/mm/proc-*.S for details. r10 = base of - * xxx_proc_info structure selected by __lookup_architecture_type + * xxx_proc_info structure selected by __lookup_machine_type * above. On return, the CPU will be ready for the MMU to be * turned on, and r0 will hold the CPU control register value. */ - adr lr, __turn_mmu_on @ return (PIC) address - add pc, r10, #12 + ldr r13, __switch_data @ address to jump to after + @ mmu has been enabled + adr lr, __enable_mmu @ return (PIC) address + add pc, r10, #PROCINFO_INITFUNC .type __switch_data, %object __switch_data: .long __mmap_switched - .long __bss_start @ r4 - .long _end @ r5 - .long processor_id @ r6 - .long __machine_arch_type @ r7 - .long cr_alignment @ r8 + .long __data_loc @ r4 + .long __data_start @ r5 + .long __bss_start @ r6 + .long _end @ r7 + .long processor_id @ r4 + .long __machine_arch_type @ r5 + .long cr_alignment @ r6 .long init_thread_union+8192 @ sp -/* - * Enable the MMU. This completely changes the structure of the visible - * memory space. You will not be able to trace execution through this. - * If you have an enquiry about this, *please* check the linux-arm-kernel - * mailing list archives BEFORE sending another post to the list. - */ - .align 5 - .type __turn_mmu_on, %function -__turn_mmu_on: - ldr lr, __switch_data -#ifdef CONFIG_ALIGNMENT_TRAP - orr r0, r0, #2 @ ...........A. -#endif - mcr p15, 0, r0, c1, c0, 0 @ write control reg - mrc p15, 0, r3, c0, c0, 0 @ read id reg - mov r3, r3 - mov r3, r3 - mov pc, lr - /* * The following fragment of code is executed with the MMU on, and uses * absolute addresses; this is not position independent. * - * r0 = processor control register + * r0 = cp#15 control register * r1 = machine ID * r9 = processor ID - * r12 = value of r0 when kernel was called (currently always zero) */ - .align 5 + .type __mmap_switched, %function __mmap_switched: adr r3, __switch_data + 4 - ldmia r3, {r4, r5, r6, r7, r8, sp} + + ldmia r3!, {r4, r5, r6, r7} + cmp r4, r5 @ Copy data segment if needed +1: cmpne r5, r6 + ldrne fp, [r4], #4 + strne fp, [r5], #4 + bne 1b + mov fp, #0 @ Clear BSS (and zero fp) -1: cmp r4, r5 - strcc fp, [r4],#4 +1: cmp r6, r7 + strcc fp, [r6],#4 bcc 1b - str r9, [r6] @ Save processor ID - str r1, [r7] @ Save machine type - bic r2, r0, #2 @ Clear 'A' bit - stmia r8, {r0, r2} @ Save control register values + + ldmia r3, {r4, r5, r6, sp} + str r9, [r4] @ Save processor ID + str r1, [r5] @ Save machine type + bic r4, r0, #CR_A @ Clear 'A' bit + stmia r6, {r0, r4} @ Save control register values b start_kernel +/* + * Setup common bits before finally enabling the MMU. Essentially + * this is just loading the page table pointer and domain access + * registers. + */ + .type __enable_mmu, %function +__enable_mmu: +#ifdef CONFIG_ALIGNMENT_TRAP + orr r0, r0, #CR_A +#else + bic r0, r0, #CR_A +#endif +#ifdef CONFIG_CPU_DCACHE_DISABLE + bic r0, r0, #CR_C +#endif +#ifdef CONFIG_CPU_BPREDICT_DISABLE + bic r0, r0, #CR_Z +#endif +#ifdef CONFIG_CPU_ICACHE_DISABLE + bic r0, r0, #CR_I +#endif + mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ + domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ + domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ + domain_val(DOMAIN_IO, DOMAIN_CLIENT)) + mcr p15, 0, r5, c3, c0, 0 @ load domain access register + mcr p15, 0, r4, c2, c0, 0 @ load page table pointer + b __turn_mmu_on + +/* + * Enable the MMU. This completely changes the structure of the visible + * memory space. You will not be able to trace execution through this. + * If you have an enquiry about this, *please* check the linux-arm-kernel + * mailing list archives BEFORE sending another post to the list. + * + * r0 = cp#15 control register + * r13 = *virtual* address to jump to upon completion + * + * other registers depend on the function called upon completion + */ + .align 5 + .type __turn_mmu_on, %function +__turn_mmu_on: + mov r0, r0 + mcr p15, 0, r0, c1, c0, 0 @ write control reg + mrc p15, 0, r3, c0, c0, 0 @ read id reg + mov r3, r3 + mov r3, r3 + mov pc, r13 + + /* * Setup the initial page tables. We only setup the barest * amount which are required to get the kernel running, which * generally means mapping in the kernel code. * - * We only map in 4MB of RAM, which should be sufficient in - * all cases. + * r8 = machinfo + * r9 = cpuid + * r10 = procinfo * - * r5 = physical address of start of RAM - * r6 = physical IO address - * r7 = byte offset into page tables for IO - * r8 = page table flags + * Returns: + * r0, r3, r5, r6, r7 corrupted + * r4 = physical page table address */ + .type __create_page_tables, %function __create_page_tables: - pgtbl r4 @ page table address + ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram + pgtbl r4, r5 @ page table address /* * Clear the 16K level 1 swapper page table */ mov r0, r4 mov r3, #0 - add r2, r0, #0x4000 + add r6, r0, #0x4000 1: str r3, [r0], #4 str r3, [r0], #4 str r3, [r0], #4 str r3, [r0], #4 - teq r0, r2 + teq r0, r6 bne 1b + ldr r7, [r10, #PROCINFO_MMUFLAGS] @ mmuflags + /* * Create identity mapping for first MB of kernel to * cater for the MMU enable. This identity mapping - * will be removed by paging_init() + * will be removed by paging_init(). We use our current program + * counter to determine corresponding section base address. */ - krnladr r2, r4 @ start of kernel - add r3, r8, r2 @ flags + kernel base - str r3, [r4, r2, lsr #18] @ identity mapping + mov r6, pc, lsr #20 @ start of kernel section + orr r3, r7, r6, lsl #20 @ flags + kernel base + str r3, [r4, r6, lsl #2] @ identity mapping /* * Now setup the pagetables for our kernel direct * mapped region. We round TEXTADDR down to the - * nearest megabyte boundary. + * nearest megabyte boundary. It is assumed that + * the kernel fits within 4 contigous 1MB sections. */ - add r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel - bic r2, r3, #0x00f00000 - str r2, [r0] @ PAGE_OFFSET + 0MB - add r0, r0, #(TEXTADDR & 0x00f00000) >> 18 - str r3, [r0], #4 @ KERNEL + 0MB + add r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel + str r3, [r0, #(TEXTADDR & 0x00f00000) >> 18]! add r3, r3, #1 << 20 - str r3, [r0], #4 @ KERNEL + 1MB + str r3, [r0, #4]! @ KERNEL + 1MB add r3, r3, #1 << 20 - str r3, [r0], #4 @ KERNEL + 2MB + str r3, [r0, #4]! @ KERNEL + 2MB add r3, r3, #1 << 20 - str r3, [r0], #4 @ KERNEL + 3MB + str r3, [r0, #4] @ KERNEL + 3MB + + /* + * Then map first 1MB of ram in case it contains our boot params. + */ + add r0, r4, #VIRT_OFFSET >> 18 + orr r6, r5, r7 + str r6, [r0] - bic r8, r8, #0x0c @ turn off cacheable +#ifdef CONFIG_XIP_KERNEL + /* + * Map some ram to cover our .data and .bss areas. + * Mapping 3MB should be plenty. + */ + sub r3, r4, r5 + mov r3, r3, lsr #20 + add r0, r0, r3, lsl #2 + add r6, r6, r3, lsl #20 + str r6, [r0], #4 + add r6, r6, #(1 << 20) + str r6, [r0], #4 + add r6, r6, #(1 << 20) + str r6, [r0] +#endif + + bic r7, r7, #0x0c @ turn off cacheable @ and bufferable bits #ifdef CONFIG_DEBUG_LL /* @@ -214,15 +307,17 @@ __create_page_tables: * This allows debug messages to be output * via a serial console before paging_init. */ - add r0, r4, r7 - rsb r3, r7, #0x4000 @ PTRS_PER_PGD*sizeof(long) - cmp r3, #0x0800 - addge r2, r0, #0x0800 - addlt r2, r0, r3 - orr r3, r6, r8 + ldr r3, [r8, #MACHINFO_PGOFFIO] + add r0, r4, r3 + rsb r3, r3, #0x4000 @ PTRS_PER_PGD*sizeof(long) + cmp r3, #0x0800 @ limit to 512MB + movhi r3, #0x0800 + add r6, r0, r3 + ldr r3, [r8, #MACHINFO_PHYSIO] + orr r3, r3, r7 1: str r3, [r0], #4 add r3, r3, #1 << 20 - teq r0, r2 + teq r0, r6 bne 1b #if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS) /* @@ -234,7 +329,7 @@ __create_page_tables: bne 1f add r0, r4, #0x3fc0 @ ff000000 mov r3, #0x7c000000 - orr r3, r3, r8 + orr r3, r3, r7 str r3, [r0], #4 add r3, r3, #1 << 20 str r3, [r0], #4 @@ -249,12 +344,13 @@ __create_page_tables: */ add r0, r4, #0x80 @ 02000000 mov r3, #0x02000000 - orr r3, r3, r8 + orr r3, r3, r7 str r3, [r0] add r0, r4, #0x3600 @ d8000000 str r3, [r0] #endif mov pc, lr + .ltorg @@ -270,6 +366,7 @@ __create_page_tables: * * Generally, only serious errors cause this. */ + .type __error, %function __error: #ifdef CONFIG_DEBUG_LL mov r8, r0 @ preserve r0 @@ -295,6 +392,7 @@ __error: b 1b #ifdef CONFIG_DEBUG_LL + .type err_str, %object err_str: .asciz "\nError: " .align @@ -308,35 +406,44 @@ err_str: * calculate the offset. * * Returns: - * r5, r6, r7 corrupted - * r8 = page table flags - * r9 = processor ID - * r10 = pointer to processor structure + * r3, r4, r6 corrupted + * r5 = proc_info pointer in physical address space + * r9 = cpuid */ + .type __lookup_processor_type, %function __lookup_processor_type: - adr r5, 2f - ldmia r5, {r7, r9, r10} - sub r5, r5, r10 @ convert addresses - add r7, r7, r5 @ to our address space - add r10, r9, r5 + adr r3, 3f + ldmda r3, {r5, r6, r9} + sub r3, r3, r9 @ get offset between virt&phys + add r5, r5, r3 @ convert virt addresses to + add r6, r6, r3 @ physical address space mrc p15, 0, r9, c0, c0 @ get processor id -1: ldmia r10, {r5, r6, r8} @ value, mask, mmuflags - and r6, r6, r9 @ mask wanted bits - teq r5, r6 - moveq pc, lr - add r10, r10, #PROC_INFO_SZ @ sizeof(proc_info_list) - cmp r10, r7 +1: ldmia r5, {r3, r4} @ value, mask + and r4, r4, r9 @ mask wanted bits + teq r3, r4 + beq 2f + add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list) + cmp r5, r6 blt 1b - mov r10, #0 @ unknown processor - mov pc, lr + mov r5, #0 @ unknown processor +2: mov pc, lr + +/* + * This provides a C-API version of the above function. + */ +ENTRY(lookup_processor_type) + stmfd sp!, {r4 - r6, r9, lr} + bl __lookup_processor_type + mov r0, r5 + ldmfd sp!, {r4 - r6, r9, pc} /* * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for * more information about the __proc_info and __arch_info structures. */ -2: .long __proc_info_end .long __proc_info_begin - .long 2b + .long __proc_info_end +3: .long . .long __arch_info_begin .long __arch_info_end @@ -348,24 +455,31 @@ __lookup_processor_type: * * r1 = machine architecture number * Returns: - * r2, r3, r4 corrupted - * r5 = physical start address of RAM - * r6 = physical address of IO - * r7 = byte offset into page tables for IO + * r3, r4, r6 corrupted + * r5 = mach_info pointer in physical address space */ -__lookup_architecture_type: - adr r4, 2b - ldmia r4, {r2, r3, r5, r6, r7} @ throw away r2, r3 - sub r5, r4, r5 @ convert addresses - add r4, r6, r5 @ to our address space - add r7, r7, r5 -1: ldr r5, [r4] @ get machine type - teq r5, r1 @ matches loader number? + .type __lookup_machine_type, %function +__lookup_machine_type: + adr r3, 3b + ldmia r3, {r4, r5, r6} + sub r3, r3, r4 @ get offset between virt&phys + add r5, r5, r3 @ convert virt addresses to + add r6, r6, r3 @ physical address space +1: ldr r3, [r5] @ get machine type + teq r3, r1 @ matches loader number? beq 2f @ found - add r4, r4, #SIZEOF_MACHINE_DESC @ next machine_desc - cmp r4, r7 + add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc + cmp r5, r6 blt 1b - mov r7, #0 @ unknown architecture - mov pc, lr -2: ldmib r4, {r5, r6, r7} @ found, get results - mov pc, lr + mov r5, #0 @ unknown machine +2: mov pc, lr + +/* + * This provides a C-API version of the above function. + */ +ENTRY(lookup_machine_type) + stmfd sp!, {r4 - r6, lr} + mov r1, r0 + bl __lookup_machine_type + mov r0, r5 + ldmfd sp!, {r4 - r6, pc} diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c index 9e8868bc5..6c20c1188 100644 --- a/arch/arm/kernel/io.c +++ b/arch/arm/kernel/io.c @@ -7,7 +7,7 @@ * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */ -void _memcpy_fromio(void *to, unsigned long from, size_t count) +void _memcpy_fromio(void *to, void __iomem *from, size_t count) { unsigned char *t = to; while (count) { @@ -22,7 +22,7 @@ void _memcpy_fromio(void *to, unsigned long from, size_t count) * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void _memcpy_toio(unsigned long to, const void *from, size_t count) +void _memcpy_toio(void __iomem *to, const void *from, size_t count) { const unsigned char *f = from; while (count) { @@ -37,7 +37,7 @@ void _memcpy_toio(unsigned long to, const void *from, size_t count) * "memset" on IO memory space. * This needs to be optimized. */ -void _memset_io(unsigned long dst, int c, size_t count) +void _memset_io(void __iomem *dst, int c, size_t count) { while (count) { count--; diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 9c6501295..7d07277e6 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,7 +49,7 @@ static int noirqdebug; static volatile unsigned long irq_err_count; -static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_controller_lock); static LIST_HEAD(irq_pending); struct irqdesc irq_desc[NR_IRQS]; @@ -85,8 +86,25 @@ static struct irqdesc bad_irq_desc = { .disable_depth = 1, }; +#ifdef CONFIG_SMP +void synchronize_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + while (desc->running) + barrier(); +} +EXPORT_SYMBOL(synchronize_irq); + +#define smp_set_running(desc) do { desc->running = 1; } while (0) +#define smp_clear_running(desc) do { desc->running = 0; } while (0) +#else +#define smp_set_running(desc) do { } while (0) +#define smp_clear_running(desc) do { } while (0) +#endif + /** - * disable_irq - disable an irq and wait for completion + * disable_irq_nosync - disable an irq without waiting * @irq: Interrupt to disable * * Disable the selected interrupt line. Enables and disables @@ -94,7 +112,7 @@ static struct irqdesc bad_irq_desc = { * * This function may be called from IRQ context. */ -void disable_irq(unsigned int irq) +void disable_irq_nosync(unsigned int irq) { struct irqdesc *desc = irq_desc + irq; unsigned long flags; @@ -104,6 +122,28 @@ void disable_irq(unsigned int irq) list_del_init(&desc->pend); spin_unlock_irqrestore(&irq_controller_lock, flags); } +EXPORT_SYMBOL(disable_irq_nosync); + +/** + * disable_irq - disable an irq and wait for completion + * @irq: Interrupt to disable + * + * Disable the selected interrupt line. Enables and disables + * are nested. This functions waits for any pending IRQ + * handlers for this interrupt to complete before returning. + * If you use this function while holding a resource the IRQ + * handler may need you will deadlock. + * + * This function may be called - with care - from IRQ context. + */ +void disable_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + disable_irq_nosync(irq); + if (desc->action) + synchronize_irq(irq); +} EXPORT_SYMBOL(disable_irq); /** @@ -175,17 +215,30 @@ EXPORT_SYMBOL(disable_irq_wake); int show_interrupts(struct seq_file *p, void *v) { - int i = *(loff_t *) v; + int i = *(loff_t *) v, cpu; struct irqaction * action; unsigned long flags; + if (i == 0) { + char cpuname[12]; + + seq_printf(p, " "); + for_each_present_cpu(cpu) { + sprintf(cpuname, "CPU%d", cpu); + seq_printf(p, " %10s", cpuname); + } + seq_putc(p, '\n'); + } + if (i < NR_IRQS) { spin_lock_irqsave(&irq_controller_lock, flags); action = irq_desc[i].action; if (!action) goto unlock; - seq_printf(p, "%3d: %10u ", i, kstat_irqs(i)); + seq_printf(p, "%3d: ", i); + for_each_present_cpu(cpu) + seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); seq_printf(p, " %s", action->name); for (action = action->next; action; action = action->next) seq_printf(p, ", %s", action->name); @@ -196,6 +249,9 @@ unlock: } else if (i == NR_IRQS) { #ifdef CONFIG_ARCH_ACORN show_fiq_list(p, v); +#endif +#ifdef CONFIG_SMP + show_ipi_list(p); #endif seq_printf(p, "Err: %10lu\n", irq_err_count); } @@ -294,18 +350,22 @@ void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { struct irqaction *action; - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; kstat_cpu(cpu).irqs[irq]++; + smp_set_running(desc); + action = desc->action; if (action) { int ret = __do_irq(irq, action, regs); if (ret != IRQ_HANDLED) report_bad_irq(irq, regs, desc, ret); } + + smp_clear_running(desc); } /* @@ -315,7 +375,7 @@ do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; @@ -341,7 +401,6 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) do { struct irqaction *action; - int ret; action = desc->action; if (!action) @@ -352,9 +411,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) desc->chip->unmask(irq); } - ret = __do_irq(irq, action, regs); - if (ret != IRQ_HANDLED) - report_bad_irq(irq, regs, desc, ret); + __do_irq(irq, action, regs); } while (desc->pending && !desc->disable_depth); desc->running = 0; @@ -382,7 +439,7 @@ void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { struct irqaction *action; - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; @@ -394,6 +451,8 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) if (likely(!desc->disable_depth)) { kstat_cpu(cpu).irqs[irq]++; + smp_set_running(desc); + /* * Return with this interrupt masked if no action */ @@ -408,6 +467,8 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) !check_irq_lock(desc, irq, regs))) desc->chip->unmask(irq); } + + smp_clear_running(desc); } } @@ -846,8 +907,97 @@ out: EXPORT_SYMBOL(probe_irq_off); +#ifdef CONFIG_SMP +static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu) +{ + pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); + + spin_lock_irq(&irq_controller_lock); + desc->cpu = cpu; + desc->chip->set_cpu(desc, irq, cpu); + spin_unlock_irq(&irq_controller_lock); +} + +#ifdef CONFIG_PROC_FS +static int +irq_affinity_read_proc(char *page, char **start, off_t off, int count, + int *eof, void *data) +{ + struct irqdesc *desc = irq_desc + ((int)data); + int len = cpumask_scnprintf(page, count, desc->affinity); + + if (count - len < 2) + return -EINVAL; + page[len++] = '\n'; + page[len] = '\0'; + + return len; +} + +static int +irq_affinity_write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + unsigned int irq = (unsigned int)data; + struct irqdesc *desc = irq_desc + irq; + cpumask_t affinity, tmp; + int ret = -EIO; + + if (!desc->chip->set_cpu) + goto out; + + ret = cpumask_parse(buffer, count, affinity); + if (ret) + goto out; + + cpus_and(tmp, affinity, cpu_online_map); + if (cpus_empty(tmp)) { + ret = -EINVAL; + goto out; + } + + desc->affinity = affinity; + route_irq(desc, irq, first_cpu(tmp)); + ret = count; + + out: + return ret; +} +#endif +#endif + void __init init_irq_proc(void) { +#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS) + struct proc_dir_entry *dir; + int irq; + + dir = proc_mkdir("irq", 0); + if (!dir) + return; + + for (irq = 0; irq < NR_IRQS; irq++) { + struct proc_dir_entry *entry; + struct irqdesc *desc; + char name[16]; + + desc = irq_desc + irq; + memset(name, 0, sizeof(name)); + snprintf(name, sizeof(name) - 1, "%u", irq); + + desc->procdir = proc_mkdir(name, dir); + if (!desc->procdir) + continue; + + entry = create_proc_entry("smp_affinity", 0600, desc->procdir); + if (entry) { + entry->nlink = 1; + entry->data = (void *)irq; + entry->read_proc = irq_affinity_read_proc; + entry->write_proc = irq_affinity_write_proc; + } + } +#endif } void __init init_IRQ(void) @@ -856,6 +1006,11 @@ void __init init_IRQ(void) extern void init_dma(void); int irq; +#ifdef CONFIG_SMP + bad_irq_desc.affinity = CPU_MASK_ALL; + bad_irq_desc.cpu = smp_processor_id(); +#endif + for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) { *desc = bad_irq_desc; INIT_LIST_HEAD(&desc->pend); diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index a16951f49..eb9240e9a 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -9,6 +9,7 @@ * * Module allocation method suggested by Andi Kleen. */ +#include #include #include #include @@ -19,6 +20,18 @@ #include +#ifdef CONFIG_XIP_KERNEL +/* + * The XIP kernel text is mapped in the module area for modules and + * some other stuff to work without any indirect relocations. + * MODULE_START is redefined here and not in asm/memory.h to avoid + * recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off. + */ +extern void _etext; +#undef MODULE_START +#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK) +#endif + void *module_alloc(unsigned long size) { struct vm_struct *area; diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 1301b0378..dbd8ca89b 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -97,6 +97,8 @@ void default_idle(void) */ void cpu_idle(void) { + local_fiq_enable(); + /* endless idle loop with no priority at all */ while (1) { void (*idle)(void) = pm_idle; @@ -350,6 +352,9 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start, thread->cpu_context.sp = (unsigned long)childregs; thread->cpu_context.pc = (unsigned long)ret_from_fork; + if (clone_flags & CLONE_SETTLS) + thread->tp_value = regs->ARM_r3; + return 0; } diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 465861fcf..6dd2a7d88 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -677,7 +677,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat /* make sure single-step breakpoint is gone. */ child->ptrace &= ~PT_SINGLESTEP; ptrace_cancel_bpt(child); - if (child->state != TASK_ZOMBIE) { + if (child->exit_state != EXIT_ZOMBIE) { child->exit_code = SIGKILL; wake_up_process(child); } @@ -719,6 +719,11 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat ret = ptrace_setfpregs(child, (void __user *)data); break; + case PTRACE_GET_THREAD_AREA: + ret = put_user(child->thread_info->tp_value, + (unsigned long __user *) data); + break; + default: ret = ptrace_request(child, request, addr, data); break; diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c index c232d3777..ac423e3e2 100644 --- a/arch/arm/kernel/semaphore.c +++ b/arch/arm/kernel/semaphore.c @@ -54,7 +54,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { @@ -178,7 +178,7 @@ int __down_trylock(struct semaphore * sem) * registers (r0 to r3 and lr), but not ip, as we use it as a return * value in some cases.. */ -asm(" .section .sched.text \n\ +asm(" .section .sched.text,\"ax\" \n\ .align 5 \n\ .globl __down_failed \n\ __down_failed: \n\ diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 550cb831a..adfe4ada6 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,7 @@ extern void convert_to_tag_list(struct tag *tags); extern void squash_mem_tags(struct tag *tag); extern void reboot_setup(char *str); extern int root_mountflags; -extern int _stext, _text, _etext, _edata, _end; +extern void _stext, _text, _etext, __data_start, _edata, _end; unsigned int processor_id; unsigned int __machine_arch_type; @@ -108,12 +109,14 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; #define ENDIANNESS ((char)endian_test.l) +DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data); + /* * Standard memory resources */ static struct resource mem_res[] = { { "Video RAM", 0, 0, IORESOURCE_MEM }, - { "Kernel code", 0, 0, IORESOURCE_MEM }, + { "Kernel text", 0, 0, IORESOURCE_MEM }, { "Kernel data", 0, 0, IORESOURCE_MEM } }; @@ -132,21 +135,21 @@ static struct resource io_res[] = { #define lp2 io_res[2] static const char *cache_types[16] = { - "VIVT write-through", - "VIVT write-back", - "VIVT write-back", + "write-through", + "write-back", + "write-back", "undefined 3", "undefined 4", "undefined 5", - "VIVT write-back", - "VIVT write-back", + "write-back", + "write-back", "undefined 8", "undefined 9", "undefined 10", "undefined 11", "undefined 12", "undefined 13", - "VIPT write-back", + "write-back", "undefined 15", }; @@ -218,12 +221,12 @@ static const char *proc_arch[] = { #define CACHE_M(y) ((y) & (1 << 2)) #define CACHE_LINE(y) ((y) & 3) -static inline void dump_cache(const char *prefix, unsigned int cache) +static inline void dump_cache(const char *prefix, int cpu, unsigned int cache) { unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0); - printk("%s: %d bytes, associativity %d, %d byte lines, %d sets\n", - prefix, + printk("CPU%u: %s: %d bytes, associativity %d, %d byte lines, %d sets\n", + cpu, prefix, mult << (8 + CACHE_SIZE(cache)), (mult << CACHE_ASSOC(cache)) >> 1, 8 << CACHE_LINE(cache), @@ -231,17 +234,18 @@ static inline void dump_cache(const char *prefix, unsigned int cache) CACHE_LINE(cache))); } -static void __init dump_cpu_info(void) +static void __init dump_cpu_info(int cpu) { unsigned int info = read_cpuid(CPUID_CACHETYPE); if (info != processor_id) { - printk("CPU: D %s cache\n", cache_types[CACHE_TYPE(info)]); + printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT", + cache_types[CACHE_TYPE(info)]); if (CACHE_S(info)) { - dump_cache("CPU: I cache", CACHE_ISIZE(info)); - dump_cache("CPU: D cache", CACHE_DSIZE(info)); + dump_cache("I cache", cpu, CACHE_ISIZE(info)); + dump_cache("D cache", cpu, CACHE_DSIZE(info)); } else { - dump_cache("CPU: cache", CACHE_ISIZE(info)); + dump_cache("cache", cpu, CACHE_ISIZE(info)); } } } @@ -255,7 +259,7 @@ int cpu_architecture(void) } else if ((processor_id & 0x0000f000) == 0x00007000) { cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3; } else { - cpu_arch = (processor_id >> 16) & 15; + cpu_arch = (processor_id >> 16) & 7; if (cpu_arch) cpu_arch += CPU_ARCH_ARMv3; } @@ -263,9 +267,15 @@ int cpu_architecture(void) return cpu_arch; } +/* + * These functions re-use the assembly code in head.S, which + * already provide the required functionality. + */ +extern struct proc_info_list *lookup_processor_type(void); +extern struct machine_desc *lookup_machine_type(unsigned int); + static void __init setup_processor(void) { - extern struct proc_info_list __proc_info_begin, __proc_info_end; struct proc_info_list *list; /* @@ -273,15 +283,8 @@ static void __init setup_processor(void) * types. The linker builds this table for us from the * entries in arch/arm/mm/proc-*.S */ - for (list = &__proc_info_begin; list < &__proc_info_end ; list++) - if ((processor_id & list->cpu_mask) == list->cpu_val) - break; - - /* - * If processor type is unrecognised, then we - * can do nothing... - */ - if (list >= &__proc_info_end) { + list = lookup_processor_type(); + if (!list) { printk("CPU configuration botched (ID %08x), unable " "to continue.\n", processor_id); while (1); @@ -306,7 +309,7 @@ static void __init setup_processor(void) cpu_name, processor_id, (int)processor_id & 15, proc_arch[cpu_architecture()]); - dump_cpu_info(); + dump_cpu_info(smp_processor_id()); sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS); sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); @@ -317,22 +320,14 @@ static void __init setup_processor(void) static struct machine_desc * __init setup_machine(unsigned int nr) { - extern struct machine_desc __arch_info_begin, __arch_info_end; struct machine_desc *list; /* - * locate architecture in the list of supported architectures. + * locate machine in the list of supported machines. */ - for (list = &__arch_info_begin; list < &__arch_info_end; list++) - if (list->nr == nr) - break; - - /* - * If the architecture type is not recognised, then we - * can co nothing... - */ - if (list >= &__arch_info_end) { - printk("Architecture configuration botched (nr %d), unable " + list = lookup_machine_type(nr); + if (!list) { + printk("Machine configuration botched (nr %d), unable " "to continue.\n", nr); while (1); } @@ -447,10 +442,10 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc) struct resource *res; int i; - kernel_code.start = __virt_to_phys(init_mm.start_code); - kernel_code.end = __virt_to_phys(init_mm.end_code - 1); - kernel_data.start = __virt_to_phys(init_mm.end_code); - kernel_data.end = __virt_to_phys(init_mm.brk - 1); + kernel_code.start = virt_to_phys(&_text); + kernel_code.end = virt_to_phys(&_etext - 1); + kernel_data.start = virt_to_phys(&__data_start); + kernel_data.end = virt_to_phys(&_end - 1); for (i = 0; i < mi->nr_banks; i++) { unsigned long virt_start, virt_end; @@ -726,7 +721,7 @@ void __init setup_arch(char **cmdline_p) * Set up various architecture-specific pointers */ init_arch_irq = mdesc->init_irq; - init_arch_time = mdesc->init_time; + system_timer = mdesc->timer; init_machine = mdesc->init_machine; #ifdef CONFIG_VT @@ -738,11 +733,15 @@ void __init setup_arch(char **cmdline_p) #endif } -static struct cpu cpu[1]; static int __init topology_init(void) { - return register_cpu(cpu, 0, NULL); + int cpu; + + for_each_cpu(cpu) + register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL); + + return 0; } subsys_initcall(topology_init); @@ -783,9 +782,18 @@ static int c_show(struct seq_file *m, void *v) seq_printf(m, "Processor\t: %s rev %d (%s)\n", cpu_name, (int)processor_id & 15, elf_platform); +#if defined(CONFIG_SMP) + for_each_online_cpu(i) { + seq_printf(m, "Processor\t: %d\n", i); + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n", + per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), + (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); + } +#else /* CONFIG_SMP */ seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", loops_per_jiffy / (500000/HZ), (loops_per_jiffy / (5000/HZ)) % 100); +#endif /* dump out the processor features */ seq_puts(m, "Features\t: "); diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index d433d4784..ef7fa2c71 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -126,25 +125,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, return ret; } -/* - * Do a signal return; undo the signal stack. - */ -struct sigframe -{ - struct sigcontext sc; - unsigned long extramask[_NSIG_WORDS-1]; - unsigned long retcode; -}; - -struct rt_sigframe -{ - struct siginfo __user *pinfo; - void __user *puc; - struct siginfo info; - struct ucontext uc; - unsigned long retcode; -}; - #ifdef CONFIG_IWMMXT /* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */ @@ -152,8 +132,15 @@ struct rt_sigframe #define IWMMXT_MAGIC0 0x12ef842a #define IWMMXT_MAGIC1 0x1c07ca71 -static int page_present(struct mm_struct *mm, unsigned long addr, int wr) +struct iwmmxt_sigframe { + unsigned long magic0; + unsigned long magic1; + unsigned long storage[0x98/4]; +}; + +static int page_present(struct mm_struct *mm, void __user *uptr, int wr) { + unsigned long addr = (unsigned long)uptr; pgd_t *pgd = pgd_offset(mm, addr); if (pgd_present(*pgd)) { pmd_t *pmd = pmd_offset(pgd, addr); @@ -165,49 +152,66 @@ static int page_present(struct mm_struct *mm, unsigned long addr, int wr) return 0; } -static int -preserve_iwmmxt_context(void *iwmmxt_save_area) +static int copy_locked(void __user *uptr, void *kptr, size_t size, int write, + void (*copyfn)(void *, void __user *)) +{ + unsigned char v, __user *userptr = uptr; + int err = 0; + + do { + struct mm_struct *mm; + + if (write) { + __put_user_error(0, userptr, err); + __put_user_error(0, userptr + size - 1, err); + } else { + __get_user_error(v, userptr, err); + __get_user_error(v, userptr + size - 1, err); + } + + if (err) + break; + + mm = current->mm; + spin_lock(&mm->page_table_lock); + if (page_present(mm, userptr, write) && + page_present(mm, userptr + size - 1, write)) { + copyfn(kptr, uptr); + } else + err = 1; + spin_unlock(&mm->page_table_lock); + } while (err); + + return err; +} + +static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame) { int err = 0; /* the iWMMXt context must be 64 bit aligned */ - long *iwmmxt_storage = (long *)(((long)iwmmxt_save_area + 4) & ~7); + WARN_ON((unsigned long)frame & 7); + + __put_user_error(IWMMXT_MAGIC0, &frame->magic0, err); + __put_user_error(IWMMXT_MAGIC1, &frame->magic1, err); -again: - __put_user_error(IWMMXT_MAGIC0, iwmmxt_storage+0, err); - __put_user_error(IWMMXT_MAGIC1, iwmmxt_storage+1, err); /* * iwmmxt_task_copy() doesn't check user permissions. * Let's do a dummy write on the upper boundary to ensure * access to user mem is OK all way up. */ - __put_user_error(0, iwmmxt_storage+IWMMXT_STORAGE_SIZE/4-1, err); - if (!err) { - /* Let's make sure the user mapping won't disappear under us */ - struct mm_struct *mm = current->mm; - unsigned long addr = (unsigned long)iwmmxt_storage; - spin_lock(&mm->page_table_lock); - if ( !page_present(mm, addr, 1) || - !page_present(mm, addr+IWMMXT_STORAGE_SIZE-1, 1) ) { - /* our user area has gone before grabbing the lock */ - spin_unlock(&mm->page_table_lock); - goto again; - } - iwmmxt_task_copy(current_thread_info(), iwmmxt_storage+2); - spin_unlock(&mm->page_table_lock); - return 0; - } + err |= copy_locked(&frame->storage, current_thread_info(), + sizeof(frame->storage), 1, iwmmxt_task_copy); return err; } -static int -restore_iwmmxt_context(void *iwmmxt_save_area) +static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame) { + unsigned long magic0, magic1; int err = 0; - long *iwmmxt_storage, magic0, magic1, dummy; /* the iWMMXt context is 64 bit aligned */ - iwmmxt_storage = (long *)(((long)iwmmxt_save_area + 4) & ~7); + WARN_ON((unsigned long)frame & 7); /* * Validate iWMMXt context signature. @@ -215,32 +219,51 @@ restore_iwmmxt_context(void *iwmmxt_save_area) * Let's do a dummy write on the upper boundary to ensure * access to user mem is OK all way up. */ -again: - __get_user_error(magic0, iwmmxt_storage+0, err); - __get_user_error(magic1, iwmmxt_storage+1, err); - if (!err && magic0 == IWMMXT_MAGIC0 && magic1 == IWMMXT_MAGIC1 && - !__get_user(dummy, iwmmxt_storage+IWMMXT_STORAGE_SIZE/4-1)) { - /* Let's make sure the user mapping won't disappear under us */ - struct mm_struct *mm = current->mm; - unsigned long addr = (unsigned long)iwmmxt_storage; - spin_lock(&mm->page_table_lock); - if ( !page_present(mm, addr, 0) || - !page_present(mm, addr+IWMMXT_STORAGE_SIZE-1, 0) ) { - /* our user area has gone before grabbing the lock */ - spin_unlock(&mm->page_table_lock); - goto again; - } - iwmmxt_task_restore(current_thread_info(), iwmmxt_storage+2); - spin_unlock(&mm->page_table_lock); - return 0; - } - return -1; + __get_user_error(magic0, &frame->magic0, err); + __get_user_error(magic1, &frame->magic1, err); + if (!err && magic0 == IWMMXT_MAGIC0 && magic1 == IWMMXT_MAGIC1) + err = copy_locked(&frame->storage, current_thread_info(), + sizeof(frame->storage), 0, iwmmxt_task_restore); + return err; } #endif +/* + * Auxiliary signal frame. This saves stuff like FP state. + * The layout of this structure is not part of the user ABI. + */ +struct aux_sigframe { +#ifdef CONFIG_IWMMXT + struct iwmmxt_sigframe iwmmxt; +#endif +#ifdef CONFIG_VFP + union vfp_state vfp; +#endif +}; + +/* + * Do a signal return; undo the signal stack. These are aligned to 64-bit. + */ +struct sigframe { + struct sigcontext sc; + unsigned long extramask[_NSIG_WORDS-1]; + unsigned long retcode; + struct aux_sigframe aux __attribute__((aligned(8))); +}; + +struct rt_sigframe { + struct siginfo __user *pinfo; + void __user *puc; + struct siginfo info; + struct ucontext uc; + unsigned long retcode; + struct aux_sigframe aux __attribute__((aligned(8))); +}; + static int -restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, + struct aux_sigframe __user *aux) { int err = 0; @@ -264,6 +287,15 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) err |= !valid_user_regs(regs); +#ifdef CONFIG_IWMMXT + if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) + err |= restore_iwmmxt_context(&aux->iwmmxt); +#endif +#ifdef CONFIG_VFP +// if (err == 0) +// err |= vfp_restore_state(&aux->vfp); +#endif + return err; } @@ -299,13 +331,8 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs) recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - if (restore_sigcontext(regs, &frame->sc)) - goto badframe; - -#ifdef CONFIG_IWMMXT - if (test_thread_flag(TIF_USING_IWMMXT) && restore_iwmmxt_context(frame+1)) + if (restore_sigcontext(regs, &frame->sc, &frame->aux)) goto badframe; -#endif /* Send SIGTRAP if we're single-stepping */ if (current->ptrace & PT_SINGLESTEP) { @@ -349,17 +376,12 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) + if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &frame->aux)) goto badframe; if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) goto badframe; -#ifdef CONFIG_IWMMXT - if (test_thread_flag(TIF_USING_IWMMXT) && restore_iwmmxt_context(frame+1)) - goto badframe; -#endif - /* Send SIGTRAP if we're single-stepping */ if (current->ptrace & PT_SINGLESTEP) { ptrace_cancel_bpt(current); @@ -374,7 +396,7 @@ badframe: } static int -setup_sigcontext(struct sigcontext __user *sc, /*struct _fpstate *fpstate,*/ +setup_sigcontext(struct sigcontext __user *sc, struct aux_sigframe __user *aux, struct pt_regs *regs, unsigned long mask) { int err = 0; @@ -402,6 +424,15 @@ setup_sigcontext(struct sigcontext __user *sc, /*struct _fpstate *fpstate,*/ __put_user_error(current->thread.address, &sc->fault_address, err); __put_user_error(mask, &sc->oldmask, err); +#ifdef CONFIG_IWMMXT + if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) + err |= preserve_iwmmxt_context(&aux->iwmmxt); +#endif +#ifdef CONFIG_VFP +// if (err == 0) +// err |= vfp_save_state(&aux->vfp); +#endif + return err; } @@ -411,11 +442,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize) unsigned long sp = regs->ARM_sp; void __user *frame; -#ifdef CONFIG_IWMMXT - if (test_thread_flag(TIF_USING_IWMMXT)) - framesize = (framesize + 4 + IWMMXT_STORAGE_SIZE) & ~7; -#endif - /* * This is the X/Open sanctioned signal stack switching. */ @@ -505,18 +531,13 @@ setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *reg if (!frame) return 1; - err |= setup_sigcontext(&frame->sc, /*&frame->fpstate,*/ regs, set->sig[0]); + err |= setup_sigcontext(&frame->sc, &frame->aux, regs, set->sig[0]); if (_NSIG_WORDS > 1) { err |= __copy_to_user(frame->extramask, &set->sig[1], sizeof(frame->extramask)); } -#ifdef CONFIG_IWMMXT - if (test_thread_flag(TIF_USING_IWMMXT)) - err |= preserve_iwmmxt_context(frame+1); -#endif - if (err == 0) err = setup_return(regs, ka, &frame->retcode, frame, usig); @@ -547,15 +568,10 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, stack.ss_size = current->sas_ss_size; err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack)); - err |= setup_sigcontext(&frame->uc.uc_mcontext, /*&frame->fpstate,*/ + err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->aux, regs, set->sig[0]); err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); -#ifdef CONFIG_IWMMXT - if (test_thread_flag(TIF_USING_IWMMXT)) - err |= preserve_iwmmxt_context(frame+1); -#endif - if (err == 0) err = setup_return(regs, ka, &frame->retcode, frame, usig); @@ -672,10 +688,8 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall) if (!user_mode(regs)) return 0; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (current->ptrace & PT_SINGLESTEP) ptrace_cancel_bpt(current); diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index 7cbd18e95..c087e2602 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c @@ -51,6 +51,13 @@ asmlinkage int sys_pipe(unsigned long __user *fildes) return error; } +/* + * 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 MIN_MAP_ADDR (PAGE_SIZE) + /* common code for old and new mmaps */ inline long do_mmap2( unsigned long addr, unsigned long len, @@ -62,11 +69,7 @@ inline long do_mmap2( flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - /* - * If we are doing a fixed mapping, and address < PAGE_SIZE, - * then deny it. - */ - if (flags & MAP_FIXED && addr < PAGE_SIZE && vectors_base() == 0) + if (flags & MAP_FIXED && addr < MIN_MAP_ADDR) goto out; error = -EBADF; @@ -119,12 +122,7 @@ sys_arm_mremap(unsigned long addr, unsigned long old_len, { unsigned long ret = -EINVAL; - /* - * If we are doing a fixed mapping, and address < PAGE_SIZE, - * then deny it. - */ - if (flags & MREMAP_FIXED && new_addr < PAGE_SIZE && - vectors_base() == 0) + if (flags & MREMAP_FIXED && new_addr < MIN_MAP_ADDR) goto out; down_write(¤t->mm->mmap_sem); @@ -243,18 +241,14 @@ asmlinkage int sys_fork(struct pt_regs *regs) /* Clone a task - this clones the calling program thread. * This is called indirectly via a small wrapper */ -asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, struct pt_regs *regs) +asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, + int __user *parent_tidptr, int tls_val, + int __user *child_tidptr, struct pt_regs *regs) { - /* - * We don't support SETTID / CLEARTID - */ - if (clone_flags & (CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID)) - return -EINVAL; - if (!newsp) newsp = regs->ARM_sp; - return do_fork(clone_flags, newsp, regs, 0, NULL, NULL); + return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr); } asmlinkage int sys_vfork(struct pt_regs *regs) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 3043e6de7..3c62021fc 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -40,10 +40,15 @@ u64 jiffies_64 = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); +/* + * Our system timer. + */ +struct sys_timer *system_timer; + extern unsigned long wall_jiffies; /* this needs a better home */ -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); #ifdef CONFIG_SA1100_RTC_MODULE EXPORT_SYMBOL(rtc_lock); @@ -58,7 +63,7 @@ unsigned long profile_pc(struct pt_regs *regs) unsigned long fp, pc = instruction_pointer(regs); if (in_lock_functions(pc)) { - fp = thread_saved_fp(current); + fp = regs->ARM_fp; pc = pc_pointer(((unsigned long *)fp)[-1]); } @@ -77,12 +82,6 @@ static unsigned long dummy_gettimeoffset(void) return 0; } -/* - * hook for getting the time offset. Note that it is - * always called with interrupts disabled. - */ -unsigned long (*gettimeoffset)(void) = dummy_gettimeoffset; - /* * Scheduler clock - returns current time in nanosec units. * This is the default implementation. Sub-architecture @@ -247,7 +246,7 @@ void do_gettimeofday(struct timeval *tv) do { seq = read_seqbegin_irqsave(&xtime_lock, flags); - usec = gettimeoffset(); + usec = system_timer->offset(); lost = jiffies - wall_jiffies; if (lost) @@ -284,7 +283,7 @@ int do_settimeofday(struct timespec *tv) * wall time. Discover what correction gettimeofday() would have * done, and then undo it! */ - nsec -= gettimeoffset() * NSEC_PER_USEC; + nsec -= system_timer->offset() * NSEC_PER_USEC; nsec -= (jiffies - wall_jiffies) * TICK_NSEC; wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); @@ -337,18 +336,67 @@ void restore_time_delta(struct timespec *delta, struct timespec *rtc) } EXPORT_SYMBOL(restore_time_delta); +/* + * Kernel system timer support. + */ void timer_tick(struct pt_regs *regs) { profile_tick(CPU_PROFILING, regs); do_leds(); do_set_rtc(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif +} + +#ifdef CONFIG_PM +static int timer_suspend(struct sys_device *dev, u32 state) +{ + struct sys_timer *timer = container_of(dev, struct sys_timer, dev); + + if (timer->suspend != NULL) + timer->suspend(); + + return 0; +} + +static int timer_resume(struct sys_device *dev) +{ + struct sys_timer *timer = container_of(dev, struct sys_timer, dev); + + if (timer->resume != NULL) + timer->resume(); + + return 0; +} +#else +#define timer_suspend NULL +#define timer_resume NULL +#endif + +static struct sysdev_class timer_sysclass = { + set_kset_name("timer"), + .suspend = timer_suspend, + .resume = timer_resume, +}; + +static int __init timer_init_sysfs(void) +{ + int ret = sysdev_class_register(&timer_sysclass); + if (ret == 0) { + system_timer->dev.cls = &timer_sysclass; + ret = sysdev_register(&system_timer->dev); + } + return ret; } -void (*init_arch_time)(void); +device_initcall(timer_init_sysfs); void __init time_init(void) { - init_arch_time(); + if (system_timer->offset == NULL) + system_timer->offset = dummy_gettimeoffset; + system_timer->init(); } diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index d0f983705..760191e3b 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -200,7 +200,7 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) barrier(); } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); /* * This function is protected against re-entrancy. @@ -241,7 +241,7 @@ void die_if_kernel(const char *str, struct pt_regs *regs, int err) } static LIST_HEAD(undef_hook); -static spinlock_t undef_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(undef_lock); void register_undef_hook(struct undef_hook *hook) { @@ -328,20 +328,11 @@ asmlinkage void do_unexp_fiq (struct pt_regs *regs) */ asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode) { - unsigned int vectors = vectors_base(); - console_verbose(); printk(KERN_CRIT "Bad mode in %s handler detected: mode %s\n", handler[reason], processor_modes[proc_mode]); - /* - * Dump out the vectors and stub routines. Maybe a better solution - * would be to dump them out only if we detect that they are corrupted. - */ - dump_mem(KERN_CRIT "Vectors: ", vectors, vectors + 0x40); - dump_mem(KERN_CRIT "Stubs: ", vectors + 0x200, vectors + 0x4b8); - die("Oops - bad mode", regs, 0); local_irq_disable(); panic("bad mode"); @@ -402,6 +393,7 @@ do_cache_op(unsigned long start, unsigned long end, int flags) #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE) asmlinkage int arm_syscall(int no, struct pt_regs *regs) { + struct thread_info *thread = current_thread_info(); siginfo_t info; if ((no >> 16) != 0x9f) @@ -454,6 +446,17 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) regs->ARM_cpsr |= MODE32_BIT; return regs->ARM_r0; + case NR(set_tls): + thread->tp_value = regs->ARM_r0; + /* + * Our user accessible TLS ptr is located at 0xffff0ffc. + * On SMP read access to this address must raise a fault + * and be emulated from the data abort handler. + * m + */ + *((unsigned long *)0xffff0ffc) = thread->tp_value; + return 0; + default: /* Calls 9f00xx..9f07ff are defined to return -ENOSYS if not implemented, rather than raising SIGILL. This @@ -537,7 +540,7 @@ EXPORT_SYMBOL(__bug); void __readwrite_bug(const char *fn) { - printk("%s called, but not implemented", fn); + printk("%s called, but not implemented\n", fn); BUG(); } EXPORT_SYMBOL(__readwrite_bug); @@ -575,13 +578,9 @@ EXPORT_SYMBOL(abort); void __init trap_init(void) { - extern void __trap_init(unsigned long); - unsigned long base = vectors_base(); - - __trap_init(base); - flush_icache_range(base, base + PAGE_SIZE); - if (base != 0) - printk(KERN_DEBUG "Relocating machine vectors to 0x%08lx\n", - base); + extern void __trap_init(void); + + __trap_init(); + flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); modify_domain(DOMAIN_USER, DOMAIN_CLIENT); } diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 1131500de..b885d32d1 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -4,6 +4,7 @@ */ #include +#include OUTPUT_ARCH(arm) ENTRY(stext) @@ -17,7 +18,6 @@ SECTIONS . = TEXTADDR; .init : { /* Init code and data */ _stext = .; - __init_begin = .; _sinittext = .; *(.init.text) _einittext = .; @@ -30,7 +30,6 @@ SECTIONS __tagtable_begin = .; *(.taglist) __tagtable_end = .; - *(.init.data) . = ALIGN(16); __setup_start = .; *(.init.setup) @@ -57,8 +56,16 @@ SECTIONS __initramfs_start = .; usr/built-in.o(.init.ramfs) __initramfs_end = .; + . = ALIGN(64); + __per_cpu_start = .; + *(.data.percpu) + __per_cpu_end = .; +#ifndef CONFIG_XIP_KERNEL + __init_begin = _stext; + *(.init.data) . = ALIGN(4096); __init_end = .; +#endif } /DISCARD/ : { /* Exit code and data */ @@ -79,8 +86,6 @@ SECTIONS *(.glue_7) *(.glue_7t) *(.got) /* Global offset table */ - - _etext = .; /* End of text section */ } . = ALIGN(16); @@ -92,15 +97,33 @@ SECTIONS RODATA + _etext = .; /* End of text and rodata section */ + +#ifdef CONFIG_XIP_KERNEL + __data_loc = ALIGN(4); /* location in binary */ + . = DATAADDR; +#else . = ALIGN(8192); + __data_loc = .; +#endif + + .data : AT(__data_loc) { + __data_start = .; /* address in memory */ - .data : { /* * first, the init task union, aligned * to an 8192 byte boundary. */ *(.init.task) +#ifdef CONFIG_XIP_KERNEL + . = ALIGN(4096); + __init_begin = .; + *(.init.data) + . = ALIGN(4096); + __init_end = .; +#endif + . = ALIGN(4096); __nosave_begin = .; *(.data.nosave) @@ -126,7 +149,7 @@ SECTIONS __bss_start = .; /* BSS */ *(.bss) *(COMMON) - _end = . ; + _end = .; } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 007a5a012..c0e65833f 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -12,12 +12,12 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ testclearbit.o testsetbit.o uaccess.o getuser.o \ putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ ucmpdi2.o udivdi3.o lib1funcs.o div64.o \ - io-readsb.o io-writesb.o io-writesl.o + io-readsb.o io-writesb.o io-readsl.o io-writesl.o ifeq ($(CONFIG_CPU_32v3),y) - lib-y += io-readsw-armv3.o io-writesw-armv3.o io-readsl-armv3.o + lib-y += io-readsw-armv3.o io-writesw-armv3.o else - lib-y += io-readsw-armv4.o io-writesw-armv4.o io-readsl-armv4.o + lib-y += io-readsw-armv4.o io-writesw-armv4.o endif lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S index c5515f3be..cb5e3708f 100644 --- a/arch/arm/lib/csumpartial.S +++ b/arch/arm/lib/csumpartial.S @@ -73,8 +73,7 @@ td3 .req lr .done: adc r0, sum, #0 @ collect up the last carry ldr td0, [sp], #4 tst td0, #1 @ check buffer alignment - movne td0, r0, lsl #8 @ rotate checksum by 8 bits - orrne r0, td0, r0, lsr #24 + movne r0, r0, ror #8 @ rotate checksum by 8 bits ldr pc, [sp], #4 @ return .not_aligned: tst buf, #1 @ odd address diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S index b18b89715..d3a2f4667 100644 --- a/arch/arm/lib/csumpartialcopygeneric.S +++ b/arch/arm/lib/csumpartialcopygeneric.S @@ -160,8 +160,7 @@ FN_ENTRY .done: adc r0, sum, #0 ldr sum, [sp, #0] @ dst tst sum, #1 - movne sum, r0, lsl #8 - orrne r0, sum, r0, lsr #24 + movne r0, r0, ror #8 load_regs ea .src_not_aligned: diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S index 67cbd8697..3c7f7e675 100644 --- a/arch/arm/lib/delay.S +++ b/arch/arm/lib/delay.S @@ -16,15 +16,16 @@ LC0: .word loops_per_jiffy /* * 0 <= r0 <= 2000 */ -ENTRY(udelay) +ENTRY(__udelay) mov r2, #0x6800 orr r2, r2, #0x00db - mul r1, r0, r2 + mul r0, r2, r0 +ENTRY(__const_udelay) @ 0 <= r0 <= 0x01ffffff ldr r2, LC0 - ldr r2, [r2] - mov r1, r1, lsr #11 - mov r2, r2, lsr #11 - mul r0, r1, r2 + ldr r2, [r2] @ max = 0x0fffffff + mov r0, r0, lsr #11 @ max = 0x00003fff + mov r2, r2, lsr #11 @ max = 0x0003ffff + mul r0, r2, r0 @ max = 2^32-1 movs r0, r0, lsr #6 RETINSTR(moveq,pc,lr) diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 9478e01d1..64aa6f4fe 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S @@ -17,7 +17,7 @@ * * Inputs: r0 contains the address * Outputs: r0 is the error code - * r1, r2 contains the zero-extended value + * r2, r3 contains the zero-extended value * lr corrupted * * No other registers must be altered. (see include/asm-arm/uaccess.h @@ -32,39 +32,39 @@ .global __get_user_1 __get_user_1: -1: ldrbt r1, [r0] +1: ldrbt r2, [r0] mov r0, #0 mov pc, lr .global __get_user_2 __get_user_2: -2: ldrbt r1, [r0], #1 -3: ldrbt r2, [r0] +2: ldrbt r2, [r0], #1 +3: ldrbt r3, [r0] #ifndef __ARMEB__ - orr r1, r1, r2, lsl #8 + orr r2, r2, r3, lsl #8 #else - orr r1, r2, r1, lsl #8 + orr r2, r3, r2, lsl #8 #endif mov r0, #0 mov pc, lr .global __get_user_4 __get_user_4: -4: ldrt r1, [r0] +4: ldrt r2, [r0] mov r0, #0 mov pc, lr .global __get_user_8 __get_user_8: -5: ldrt r1, [r0], #4 -6: ldrt r2, [r0] +5: ldrt r2, [r0], #4 +6: ldrt r3, [r0] mov r0, #0 mov pc, lr __get_user_bad_8: - mov r2, #0 + mov r3, #0 __get_user_bad: - mov r1, #0 + mov r2, #0 mov r0, #-EFAULT mov pc, lr diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S index 28c8a3511..c92b66ecb 100644 --- a/arch/arm/lib/io-readsw-armv4.S +++ b/arch/arm/lib/io-readsw-armv4.S @@ -18,25 +18,14 @@ #endif .endm -.insw_bad_alignment: - adr r0, .insw_bad_align_msg - mov r2, lr - b panic -.insw_bad_align_msg: - .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n" - .align - -.insw_align: tst r1, #1 - bne .insw_bad_alignment - - ldrh r3, [r0] - strh r3, [r1], #2 - - subs r2, r2, #1 - RETINSTR(moveq, pc, lr) +.insw_align: movs ip, r1, lsl #31 + bne .insw_noalign + ldrh ip, [r0] + sub r2, r2, #1 + strh ip, [r1], #2 ENTRY(__raw_readsw) - teq r2, #0 @ do we have to check for the zero len? + teq r2, #0 moveq pc, lr tst r1, #3 bne .insw_align @@ -62,14 +51,10 @@ ENTRY(__raw_readsw) ldrh lr, [r0] pack ip, ip, lr - stmia r1!, {r3 - r5, ip} - subs r2, r2, #8 + stmia r1!, {r3 - r5, ip} bpl .insw_8_lp - tst r2, #7 - LOADREGS(eqfd, sp!, {r4, r5, pc}) - .no_insw_8: tst r2, #4 beq .no_insw_4 @@ -83,17 +68,63 @@ ENTRY(__raw_readsw) stmia r1!, {r3, r4} -.no_insw_4: tst r2, #2 - beq .no_insw_2 +.no_insw_4: movs r2, r2, lsl #31 + bcc .no_insw_2 ldrh r3, [r0] ldrh ip, [r0] pack r3, r3, ip - str r3, [r1], #4 -.no_insw_2: tst r2, #1 - ldrneh r3, [r0] +.no_insw_2: ldrneh r3, [r0] strneh r3, [r1] - LOADREGS(fd, sp!, {r4, r5, pc}) + ldmfd sp!, {r4, r5, pc} + +#ifdef __ARMEB__ +#define _BE_ONLY_(code...) code +#define _LE_ONLY_(code...) +#define push_hbyte0 lsr #8 +#define pull_hbyte1 lsl #24 +#else +#define _BE_ONLY_(code...) +#define _LE_ONLY_(code...) code +#define push_hbyte0 lsl #24 +#define pull_hbyte1 lsr #8 +#endif + +.insw_noalign: stmfd sp!, {r4, lr} + ldrccb ip, [r1, #-1]! + bcc 1f + + ldrh ip, [r0] + sub r2, r2, #1 + _BE_ONLY_( mov ip, ip, ror #8 ) + strb ip, [r1], #1 + _LE_ONLY_( mov ip, ip, lsr #8 ) + _BE_ONLY_( mov ip, ip, lsr #24 ) + +1: subs r2, r2, #2 + bmi 3f + _BE_ONLY_( mov ip, ip, lsl #24 ) + +2: ldrh r3, [r0] + ldrh r4, [r0] + subs r2, r2, #2 + orr ip, ip, r3, lsl #8 + orr ip, ip, r4, push_hbyte0 + str ip, [r1], #4 + mov ip, r4, pull_hbyte1 + bpl 2b + + _BE_ONLY_( mov ip, ip, lsr #24 ) + +3: tst r2, #1 + strb ip, [r1], #1 + ldrneh ip, [r0] + _BE_ONLY_( movne ip, ip, ror #8 ) + strneb ip, [r1], #1 + _LE_ONLY_( movne ip, ip, lsr #8 ) + _BE_ONLY_( movne ip, ip, lsr #24 ) + strneb ip, [r1] + ldmfd sp!, {r4, pc} diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S index 20b3ee2ef..f8f14dd22 100644 --- a/arch/arm/lib/io-writesl.S +++ b/arch/arm/lib/io-writesl.S @@ -9,53 +9,58 @@ */ #include #include -#include ENTRY(__raw_writesl) teq r2, #0 @ do we have to check for the zero len? moveq pc, lr ands ip, r1, #3 - bne 2f + bne 3f - tst r2, #1 - ldrne r3, [r1], #4 - strne r3, [r0, #0] -1: subs r2, r2, #2 - ldrcs r3, [r1], #4 - ldrcs ip, [r1], #4 + subs r2, r2, #4 + bmi 2f + stmfd sp!, {r4, lr} +1: ldmia r1!, {r3, r4, ip, lr} + subs r2, r2, #4 + str r3, [r0, #0] + str r4, [r0, #0] + str ip, [r0, #0] + str lr, [r0, #0] + bpl 1b + ldmfd sp!, {r4, lr} +2: movs r2, r2, lsl #31 + ldmcsia r1!, {r3, ip} strcs r3, [r0, #0] + ldrne r3, [r1, #0] strcs ip, [r0, #0] - bcs 1b + strne r3, [r0, #0] mov pc, lr -2: bic r1, r1, #3 - cmp ip, #2 +3: bic r1, r1, #3 ldr r3, [r1], #4 - bgt 4f + cmp ip, #2 blt 5f + bgt 6f -3: mov ip, r3, lsr #16 +4: mov ip, r3, pull #16 ldr r3, [r1], #4 subs r2, r2, #1 - orr ip, ip, r3, lsl #16 - str ip, [r0, #0] - bne 3b + orr ip, ip, r3, push #16 + str ip, [r0] + bne 4b mov pc, lr -4: mov ip, r3, lsr #24 +5: mov ip, r3, pull #8 ldr r3, [r1], #4 subs r2, r2, #1 - orr ip, ip, r3, lsl #8 - str ip, [r0, #0] - bne 4b + orr ip, ip, r3, push #24 + str ip, [r0] + bne 5b mov pc, lr -5: mov ip, r3, lsr #8 +6: mov ip, r3, pull #24 ldr r3, [r1], #4 subs r2, r2, #1 - orr ip, ip, r3, lsl #24 - str ip, [r0, #0] - bne 5b + orr ip, ip, r3, push #8 + str ip, [r0] + bne 6b mov pc, lr - - diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S index a4a444e11..6d1d7c278 100644 --- a/arch/arm/lib/io-writesw-armv4.S +++ b/arch/arm/lib/io-writesw-armv4.S @@ -22,27 +22,17 @@ #endif .endm -.outsw_bad_alignment: - adr r0, .outsw_bad_align_msg - mov r2, lr - b panic -.outsw_bad_align_msg: - .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n" - .align - -.outsw_align: tst r1, #1 - bne .outsw_bad_alignment +.outsw_align: movs ip, r1, lsl #31 + bne .outsw_noalign ldrh r3, [r1], #2 + sub r2, r2, #1 strh r3, [r0] - subs r2, r2, #1 - RETINSTR(moveq, pc, lr) - ENTRY(__raw_writesw) - teq r2, #0 @ do we have to check for the zero len? + teq r2, #0 moveq pc, lr - tst r1, #3 + ands r3, r1, #3 bne .outsw_align stmfd sp!, {r4, r5, lr} @@ -51,16 +41,13 @@ ENTRY(__raw_writesw) bmi .no_outsw_8 .outsw_8_lp: ldmia r1!, {r3, r4, r5, ip} + subs r2, r2, #8 outword r3 outword r4 outword r5 outword ip - subs r2, r2, #8 bpl .outsw_8_lp - tst r2, #7 - LOADREGS(eqfd, sp!, {r4, r5, pc}) - .no_outsw_8: tst r2, #4 beq .no_outsw_4 @@ -68,14 +55,41 @@ ENTRY(__raw_writesw) outword r3 outword ip -.no_outsw_4: tst r2, #2 - beq .no_outsw_2 +.no_outsw_4: movs r2, r2, lsl #31 + bcc .no_outsw_2 ldr r3, [r1], #4 outword r3 -.no_outsw_2: tst r2, #1 - ldrneh r3, [r1] +.no_outsw_2: ldrneh r3, [r1] strneh r3, [r0] - LOADREGS(fd, sp!, {r4, r5, pc}) + ldmfd sp!, {r4, r5, pc} + +#ifdef __ARMEB__ +#define pull_hbyte0 lsl #8 +#define push_hbyte1 lsr #24 +#else +#define pull_hbyte0 lsr #24 +#define push_hbyte1 lsl #8 +#endif + +.outsw_noalign: ldr r3, [r1, -r3]! + subcs r2, r2, #1 + bcs 2f + subs r2, r2, #2 + bmi 3f + +1: mov ip, r3, lsr #8 + strh ip, [r0] +2: mov ip, r3, pull_hbyte0 + ldr r3, [r1, #4]! + subs r2, r2, #2 + orr ip, ip, r3, push_hbyte1 + strh ip, [r0] + bpl 2b + +3: tst r2, #1 +2: movne ip, r3, lsr #8 + strneh ip, [r0] + mov pc, lr diff --git a/arch/arm/lib/longlong.h b/arch/arm/lib/longlong.h index 05ec1abd6..179eea4ed 100644 --- a/arch/arm/lib/longlong.h +++ b/arch/arm/lib/longlong.h @@ -161,7 +161,6 @@ #define UDIV_NEEDS_NORMALIZATION 1 #define udiv_qrnnd __udiv_qrnnd_c -extern const UQItype __clz_tab[]; #define count_leading_zeros(count, x) \ do { \ USItype __xr = (x); \ diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S index b978885a1..b09398d95 100644 --- a/arch/arm/lib/putuser.S +++ b/arch/arm/lib/putuser.S @@ -16,7 +16,7 @@ * __put_user_X * * Inputs: r0 contains the address - * r1, r2 contains the value + * r2, r3 contains the value * Outputs: r0 is the error code * lr corrupted * @@ -32,33 +32,33 @@ .global __put_user_1 __put_user_1: -1: strbt r1, [r0] +1: strbt r2, [r0] mov r0, #0 mov pc, lr .global __put_user_2 __put_user_2: - mov ip, r1, lsr #8 + mov ip, r2, lsr #8 #ifndef __ARMEB__ -2: strbt r1, [r0], #1 +2: strbt r2, [r0], #1 3: strbt ip, [r0] #else 2: strbt ip, [r0], #1 -3: strbt r1, [r0] +3: strbt r2, [r0] #endif mov r0, #0 mov pc, lr .global __put_user_4 __put_user_4: -4: strt r1, [r0] +4: strt r2, [r0] mov r0, #0 mov pc, lr .global __put_user_8 __put_user_8: -5: strt r1, [r0], #4 -6: strt r2, [r0] +5: strt r2, [r0], #4 +6: strt r3, [r0] mov r0, #0 mov pc, lr diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index e8a4d998b..c106704a2 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c @@ -35,9 +35,7 @@ #include #include -extern void clps711x_map_io(void); -extern void clps711x_init_irq(void); -extern void clps711x_init_time(void); +#include "common.h" /* * The on-chip registers are given a size of 1MB so that a section can @@ -66,6 +64,6 @@ MACHINE_START(AUTCPU12, "autronix autcpu12") BOOT_PARAMS(0xc0020000) MAPIO(autcpu12_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c index 870d4e4e8..7664f9cf8 100644 --- a/arch/arm/mach-clps711x/cdb89712.c +++ b/arch/arm/mach-clps711x/cdb89712.c @@ -32,9 +32,7 @@ #include #include -extern void clps711x_init_irq(void); -extern void clps711x_map_io(void); -extern void clps711x_init_time(void); +#include "common.h" /* * Map the CS89712 Ethernet port. That should be moved to the @@ -56,13 +54,5 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712") BOOT_PARAMS(0xc0000100) MAPIO(cdb89712_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END - -static int cdb89712_hw_init(void) -{ - return 0; -} - -__initcall(cdb89712_hw_init); - diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c index 44d4e5b8d..e4093be3c 100644 --- a/arch/arm/mach-clps711x/ceiva.c +++ b/arch/arm/mach-clps711x/ceiva.c @@ -34,8 +34,7 @@ #include -extern void clps711x_init_irq(void); -extern void clps711x_init_time(void); +#include "common.h" static struct map_desc ceiva_io_desc[] __initdata = { /* virtual, physical, length, type */ @@ -59,5 +58,5 @@ MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") BOOT_PARAMS(0xc0000100) MAPIO(ceiva_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c index 14fb9788c..9ca21cb48 100644 --- a/arch/arm/mach-clps711x/clep7312.c +++ b/arch/arm/mach-clps711x/clep7312.c @@ -23,9 +23,7 @@ #include #include -extern void clps711x_init_irq(void); -extern void clps711x_map_io(void); -extern void clps711x_init_time(void); +#include "common.h" static void __init fixup_clep7312(struct machine_desc *desc, struct tag *tags, @@ -45,6 +43,6 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") FIXUP(fixup_clep7312) MAPIO(clps711x_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c index 11aa05c24..c6c46324a 100644 --- a/arch/arm/mach-clps711x/edb7211-arch.c +++ b/arch/arm/mach-clps711x/edb7211-arch.c @@ -25,9 +25,9 @@ #include #include -extern void clps711x_init_irq(void); +#include "common.h" + extern void edb7211_map_io(void); -extern void clps711x_init_time(void); static void __init fixup_edb7211(struct machine_desc *desc, struct tag *tags, @@ -57,5 +57,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") FIXUP(fixup_edb7211) MAPIO(edb7211_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c index 7a4ba27df..c1c5b8e01 100644 --- a/arch/arm/mach-clps711x/fortunet.c +++ b/arch/arm/mach-clps711x/fortunet.c @@ -31,9 +31,7 @@ #include -extern void clps711x_map_io(void); -extern void clps711x_init_irq(void); -extern void clps711x_init_time(void); +#include "common.h" struct meminfo memmap = { .nr_banks = 1, @@ -83,5 +81,5 @@ MACHINE_START(FORTUNET, "ARM-FortuNet") FIXUP(fortunet_fixup) MAPIO(clps711x_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index eb75ae667..29269df05 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c @@ -34,9 +34,7 @@ #include #include -extern void clps711x_init_irq(void); -extern void clps711x_map_io(void); -extern void clps711x_init_time(void); +#include "common.h" /* * Map the P720T system PLD. It occupies two address spaces: @@ -87,7 +85,7 @@ MACHINE_START(P720T, "ARM-Prospector720T") FIXUP(fixup_p720t) MAPIO(p720t_map_io) INITIRQ(clps711x_init_irq) - INITTIME(clps711x_init_time) + .timer = &clps711x_timer, MACHINE_END static int p720t_hw_init(void) diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c index 58da84eff..383d4e0c6 100644 --- a/arch/arm/mach-clps711x/time.c +++ b/arch/arm/mach-clps711x/time.c @@ -49,7 +49,9 @@ static unsigned long clps711x_gettimeoffset(void) static irqreturn_t p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); timer_tick(regs); + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -59,7 +61,7 @@ static struct irqaction clps711x_timer_irq = { .handler = p720t_timer_interrupt }; -void __init clps711x_init_time(void) +static void __init clps711x_timer_init(void) { struct timespec tv; unsigned int syscon; @@ -71,9 +73,13 @@ void __init clps711x_init_time(void) clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ setup_irq(IRQ_TC2OI, &clps711x_timer_irq); - gettimeoffset = clps711x_gettimeoffset; tv.tv_nsec = 0; tv.tv_sec = clps_readl(RTCDR); do_settimeofday(&tv); } + +struct sys_timer clps711x_timer = { + .init = clps711x_timer_init, + .offset = clps711x_gettimeoffset, +}; diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c index 11fa530af..1b37ac188 100644 --- a/arch/arm/mach-clps7500/core.c +++ b/arch/arm/mach-clps7500/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -267,10 +268,13 @@ static void __init clps7500_map_io(void) } extern void ioctime_init(void); +extern unsigned long ioc_timer_gettimeoffset(void); static irqreturn_t clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + timer_tick(regs); /* Why not using do_leds interface?? */ @@ -283,6 +287,9 @@ clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) *((volatile unsigned int *)LED_ADDRESS) = state; } } + + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -295,18 +302,72 @@ static struct irqaction clps7500_timer_irq = { /* * Set up timer interrupt. */ -void __init clps7500_init_time(void) +static void __init clps7500_timer_init(void) { ioctime_init(); setup_irq(IRQ_TIMER, &clps7500_timer_irq); } +static struct clps7500_timer = { + .init = clps7500_timer_init, + .offset = ioc_timer_gettimeoffset, +}; + +static struct plat_serial8250_port serial_platform_data[] = { + { + .mapbase = 0x03010fe0, + .irq = 10, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST, + }, + { + .mapbase = 0x03010be0, + .irq = 0, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST, + }, + { + .iobase = ISASLOT_IO + 0x2e8, + .irq = 41, + .uartclk = 1843200, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = ISASLOT_IO + 0x3e8, + .irq = 40, + .uartclk = 1843200, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +static int __init clps7500_init(void) +{ + return platform_register_device(&serial_device); +} + MACHINE_START(CLPS7500, "CL-PS7500") MAINTAINER("Philip Blundell") BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) MAPIO(clps7500_map_io) INITIRQ(clps7500_init_irq) - INITTIME(clps7500_init_time) + .timer = &clps7500_timer, MACHINE_END diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index 07c556392..ef362d449 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -151,6 +152,8 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 count; + write_seqlock(&xtime_lock); + /* latch and read timer 1 */ __raw_writeb(0x40, PIT_CTRL); count = __raw_readb(PIT_T1); @@ -163,6 +166,8 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -175,7 +180,7 @@ static struct irqaction ebsa110_timer_irq = { /* * Set up timer interrupt. */ -static void __init ebsa110_init_time(void) +static void __init ebsa110_timer_init(void) { /* * Timer 1, mode 2, LSB/MSB @@ -184,11 +189,49 @@ static void __init ebsa110_init_time(void) __raw_writeb(COUNT & 0xff, PIT_T1); __raw_writeb(COUNT >> 8, PIT_T1); - gettimeoffset = ebsa110_gettimeoffset; - setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq); } +static struct sys_timer ebsa110_timer = { + .init = ebsa110_timer_init, + .offset = ebsa110_gettimeoffset, +}; + +static struct plat_serial8250_port serial_platform_data[] = { + { + .iobase = 0x3f8, + .irq = 1, + .uartclk = 1843200, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = 0x2f8, + .irq = 2, + .uartclk = 1843200, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +static int __init ebsa110_init(void) +{ + return platform_device_register(&serial_device); +} + +arch_initcall(ebsa110_init); + MACHINE_START(EBSA110, "EBSA110") MAINTAINER("Russell King") BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000) @@ -198,5 +241,5 @@ MACHINE_START(EBSA110, "EBSA110") SOFT_REBOOT MAPIO(ebsa110_map_io) INITIRQ(ebsa110_init_irq) - INITTIME(ebsa110_init_time) + .timer = &ebsa110_timer, MACHINE_END diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c index 9205e65fe..f5181ed48 100644 --- a/arch/arm/mach-ebsa110/io.c +++ b/arch/arm/mach-ebsa110/io.c @@ -27,9 +27,9 @@ #include #include -static u32 __isamem_convert_addr(void *addr) +static void __iomem *__isamem_convert_addr(void __iomem *addr) { - u32 ret, a = (u32) addr; + u32 ret, a = (u32 __force) addr; /* * The PCMCIA controller is wired up as follows: @@ -53,41 +53,43 @@ static u32 __isamem_convert_addr(void *addr) ret += 0xe8000000; if ((a & 0x20000) == (a & 0x40000) >> 1) - return ret; + return (void __iomem *)ret; BUG(); - return 0; + return NULL; } /* * read[bwl] and write[bwl] */ -u8 __readb(void *addr) +u8 __readb(void __iomem *addr) { - u32 ret, a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); + u32 ret; - if ((int)addr & 1) + if ((unsigned long)addr & 1) ret = __raw_readl(a); else ret = __raw_readb(a); return ret; } -u16 __readw(void *addr) +u16 __readw(void __iomem *addr) { - u32 a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); - if ((int)addr & 1) + if ((unsigned long)addr & 1) BUG(); return __raw_readw(a); } -u32 __readl(void *addr) +u32 __readl(void __iomem *addr) { - u32 ret, a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); + u32 ret; - if ((int)addr & 3) + if ((unsigned long)addr & 3) BUG(); ret = __raw_readw(a); @@ -99,31 +101,31 @@ EXPORT_SYMBOL(__readb); EXPORT_SYMBOL(__readw); EXPORT_SYMBOL(__readl); -void __writeb(u8 val, void *addr) +void __writeb(u8 val, void __iomem *addr) { - u32 a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); - if ((int)addr & 1) + if ((unsigned long)addr & 1) __raw_writel(val, a); else __raw_writeb(val, a); } -void __writew(u16 val, void *addr) +void __writew(u16 val, void __iomem *addr) { - u32 a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); - if ((int)addr & 1) + if ((unsigned long)addr & 1) BUG(); __raw_writew(val, a); } -void __writel(u32 val, void *addr) +void __writel(u32 val, void __iomem *addr) { - u32 a = __isamem_convert_addr(addr); + void __iomem *a = __isamem_convert_addr(addr); - if ((int)addr & 3) + if ((unsigned long)addr & 3) BUG(); __raw_writew(val, a); @@ -153,7 +155,7 @@ u8 __inb8(unsigned int port) if (SUPERIO_PORT(port)) ret = __raw_readb(ISAIO_BASE + (port << 2)); else { - u32 a = ISAIO_BASE + ((port & ~1) << 1); + void __iomem *a = ISAIO_BASE + ((port & ~1) << 1); /* * Shame nothing else does @@ -180,7 +182,7 @@ u8 __inb16(unsigned int port) if (SUPERIO_PORT(port)) ret = __raw_readb(ISAIO_BASE + (port << 2)); else { - u32 a = ISAIO_BASE + ((port & ~1) << 1); + void __iomem *a = ISAIO_BASE + ((port & ~1) << 1); /* * Shame nothing else does @@ -200,7 +202,7 @@ u16 __inw(unsigned int port) if (SUPERIO_PORT(port)) ret = __raw_readw(ISAIO_BASE + (port << 2)); else { - u32 a = ISAIO_BASE + ((port & ~1) << 1); + void __iomem *a = ISAIO_BASE + ((port & ~1) << 1); /* * Shame nothing else does @@ -218,7 +220,7 @@ u16 __inw(unsigned int port) */ u32 __inl(unsigned int port) { - u32 a; + void __iomem *a; if (SUPERIO_PORT(port) || port & 3) BUG(); @@ -241,7 +243,7 @@ void __outb8(u8 val, unsigned int port) if (SUPERIO_PORT(port)) __raw_writeb(val, ISAIO_BASE + (port << 2)); else { - u32 a = ISAIO_BASE + ((port & ~1) << 1); + void __iomem *a = ISAIO_BASE + ((port & ~1) << 1); /* * Shame nothing else does @@ -261,7 +263,7 @@ void __outb16(u8 val, unsigned int port) if (SUPERIO_PORT(port)) __raw_writeb(val, ISAIO_BASE + (port << 2)); else { - u32 a = ISAIO_BASE + ((port & ~1) << 1); + void __iomem *a = ISAIO_BASE + ((port & ~1) << 1); /* * Shame nothing else does diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c index ae9f7c864..1b40340e8 100644 --- a/arch/arm/mach-epxa10db/arch.c +++ b/arch/arm/mach-epxa10db/arch.c @@ -20,6 +20,7 @@ */ #include #include +#include #include #include @@ -27,15 +28,45 @@ #include +static struct plat_serial8250_port serial_platform_data[] = { + { + .iobase = 0x3f8, + .irq = IRQ_UARTINT0, +#error FIXME + .uartclk = 0, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = 0x2f8, + .irq = IRQ_UARTINT1, +#error FIXME + .uartclk = 0, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + extern void epxa10db_map_io(void); extern void epxa10db_init_irq(void); -extern void epxa10db_init_time(void); +extern struct sys_timer epxa10db_timer; MACHINE_START(CAMELOT, "Altera Epxa10db") MAINTAINER("Altera Corporation") BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000) MAPIO(epxa10db_map_io) INITIRQ(epxa10db_init_irq) - INITTIME(epxa10db_init_time) + .timer = &epxa10db_timer, MACHINE_END diff --git a/arch/arm/mach-epxa10db/time.c b/arch/arm/mach-epxa10db/time.c index 7d72a433d..1b991f3cc 100644 --- a/arch/arm/mach-epxa10db/time.c +++ b/arch/arm/mach-epxa10db/time.c @@ -43,11 +43,13 @@ __initcall(epxa10db_rtc_init); static irqreturn_t epxa10db_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); // ...clear the interrupt *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))|=TIMER0_CR_CI_MSK; timer_tick(regs); + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -61,7 +63,7 @@ static struct irqaction epxa10db_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init epxa10db_init_time(void) +static void __init epxa10db_timer_init(void) { /* Start the timer */ *TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/200); @@ -71,3 +73,6 @@ void __init epxa10db_init_time(void) setup_irq(IRQ_TIMER0, &epxa10db_timer_irq); } +struct sys_timer epxa10db_timer = { + .init = epxa10db_timer_init, +}; diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig index 1eaea0b87..1090c680b 100644 --- a/arch/arm/mach-footbridge/Kconfig +++ b/arch/arm/mach-footbridge/Kconfig @@ -4,6 +4,7 @@ menu "Footbridge Implementations" config ARCH_CATS bool "CATS" + select FOOTBRIDGE_HOST help Say Y here if you intend to run this kernel on the CATS. @@ -11,6 +12,7 @@ config ARCH_CATS config ARCH_PERSONAL_SERVER bool "Compaq Personal Server" + select FOOTBRIDGE_HOST ---help--- Say Y here if you intend to run this kernel on the Compaq Personal Server. @@ -24,10 +26,12 @@ config ARCH_PERSONAL_SERVER If you have any questions or comments about the Compaq Personal - Server, send e-mail to skiff@crl.dec.com. + Server, send e-mail to . config ARCH_EBSA285_ADDIN bool "EBSA285 (addin mode)" + select ARCH_EBSA285 + select FOOTBRIDGE_ADDIN help Say Y here if you intend to run this kernel on the EBSA285 card in addin mode. @@ -36,6 +40,8 @@ config ARCH_EBSA285_ADDIN config ARCH_EBSA285_HOST bool "EBSA285 (host mode)" + select ARCH_EBSA285 + select FOOTBRIDGE_HOST help Say Y here if you intend to run this kernel on the EBSA285 card in host ("central function") mode. @@ -44,6 +50,7 @@ config ARCH_EBSA285_HOST config ARCH_NETWINDER bool "NetWinder" + select FOOTBRIDGE_HOST help Say Y here if you intend to run this kernel on the Rebel.COM NetWinder. Information about this machine can be found at: @@ -54,4 +61,20 @@ config ARCH_NETWINDER endmenu +# Footbridge support +config FOOTBRIDGE + bool + +# Footbridge in host mode +config FOOTBRIDGE_HOST + bool + +# Footbridge in addin mode +config FOOTBRIDGE_ADDIN + bool + +# EBSA285 board in either host or addin mode +config ARCH_EBSA285 + bool + endif diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile index e0a289052..0694ad6b6 100644 --- a/arch/arm/mach-footbridge/Makefile +++ b/arch/arm/mach-footbridge/Makefile @@ -4,13 +4,13 @@ # Object file lists. -obj-y := arch.o dc21285.o dma.o irq.o isa-irq.o mm.o time.o +obj-y := common.o dc21285.o dma.o isa-irq.o time.o obj-m := obj-n := obj- := pci-$(CONFIG_ARCH_CATS) += cats-pci.o -pci-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o +pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o @@ -18,8 +18,13 @@ leds-$(CONFIG_ARCH_CO285) += ebsa285-leds.o leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o -obj-$(CONFIG_ARCH_CATS) += cats-hw.o -obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o +obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o +obj-$(CONFIG_ARCH_CO285) += co285.o dc21285-timer.o +obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o +obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o +obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o obj-$(CONFIG_PCI) +=$(pci-y) obj-$(CONFIG_LEDS) +=$(leds-y) + +obj-$(CONFIG_ISA) += isa.o diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c index 0aec69fb0..f94d176c3 100644 --- a/arch/arm/mach-footbridge/cats-hw.c +++ b/arch/arm/mach-footbridge/cats-hw.c @@ -9,8 +9,14 @@ #include #include +#include #include #include +#include + +#include + +#include "common.h" #define CFG_PORT 0x370 #define INDEX_PORT (CFG_PORT) @@ -62,3 +68,27 @@ static int __init cats_hw_init(void) } __initcall(cats_hw_init); + +/* + * CATS uses soft-reboot by default, since + * hard reboots fail on early boards. + */ +static void __init +fixup_cats(struct machine_desc *desc, struct tag *tags, + char **cmdline, struct meminfo *mi) +{ + ORIG_VIDEO_LINES = 25; + ORIG_VIDEO_POINTS = 16; + ORIG_Y = 24; +} + +MACHINE_START(CATS, "Chalice-CATS") + MAINTAINER("Philip Blundell") + BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) + BOOT_PARAMS(0x00000100) + SOFT_REBOOT + FIXUP(fixup_cats) + MAPIO(footbridge_map_io) + INITIRQ(footbridge_init_irq) + .timer = &isa_timer, +MACHINE_END diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c index 46ce71423..2c7c36304 100644 --- a/arch/arm/mach-footbridge/ebsa285-leds.c +++ b/arch/arm/mach-footbridge/ebsa285-leds.c @@ -32,7 +32,7 @@ static char led_state; static char hw_led_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); static void ebsa285_leds_event(led_event_t evt) { diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c index c81775b1a..1e1dfd79f 100644 --- a/arch/arm/mach-footbridge/netwinder-hw.c +++ b/arch/arm/mach-footbridge/netwinder-hw.c @@ -12,9 +12,15 @@ #include #include +#include #include #include #include +#include + +#include + +#include "common.h" #define IRDA_IO_BASE 0x180 #define GP1_IO_BASE 0x338 @@ -52,7 +58,7 @@ static inline void wb977_ww(int reg, int val) outb(reg, 0x370); outb(val >> 8, 0x371); outb(reg + 1, 0x370); - outb(val, 0x371); + outb(val & 255, 0x371); } #define wb977_device_select(dev) wb977_wb(0x07, dev) @@ -62,7 +68,7 @@ static inline void wb977_ww(int reg, int val) /* * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE */ -spinlock_t gpio_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(gpio_lock); static unsigned int current_gpio_op; static unsigned int current_gpio_io; @@ -482,7 +488,7 @@ static inline void rwa010_waveartist_init(int base, int irq, int dma) WRITE_RWA(7, 0); dprintk("WaveArtist base: "); - WRITE_RWA(0x61, base); + WRITE_RWA(0x61, base & 255); i = inb(0x203); WRITE_RWA(0x60, base >> 8); @@ -504,7 +510,7 @@ static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, i WRITE_RWA(7, 1); dprintk("SoundBlaster base: "); - WRITE_RWA(0x61, sb_base); + WRITE_RWA(0x61, sb_base & 255); i = inb(0x203); WRITE_RWA(0x60, sb_base >> 8); @@ -519,7 +525,7 @@ static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, i dprintk("%d (%d)\n", inb(0x203), dma); dprintk("AdLib base: "); - WRITE_RWA(0x63, al_base); + WRITE_RWA(0x63, al_base & 255); i = inb(0x203); WRITE_RWA(0x62, al_base >> 8); @@ -618,3 +624,37 @@ static int __init nw_hw_init(void) } __initcall(nw_hw_init); + +/* + * Older NeTTroms either do not provide a parameters + * page, or they don't supply correct information in + * the parameter page. + */ +static void __init +fixup_netwinder(struct machine_desc *desc, struct tag *tags, + char **cmdline, struct meminfo *mi) +{ +#ifdef CONFIG_ISAPNP + extern int isapnp_disable; + + /* + * We must not use the kernels ISAPnP code + * on the NetWinder - it will reset the settings + * for the WaveArtist chip and render it inoperable. + */ + isapnp_disable = 1; +#endif +} + +MACHINE_START(NETWINDER, "Rebel-NetWinder") + MAINTAINER("Russell King/Rebel.com") + BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) + BOOT_PARAMS(0x00000100) + VIDEO(0x000a0000, 0x000bffff) + DISABLE_PARPORT(0) + DISABLE_PARPORT(2) + FIXUP(fixup_netwinder) + MAPIO(footbridge_map_io) + INITIRQ(footbridge_init_irq) + .timer = &isa_timer, +MACHINE_END diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c index bcf6e6a7c..7451fc07b 100644 --- a/arch/arm/mach-footbridge/netwinder-leds.c +++ b/arch/arm/mach-footbridge/netwinder-leds.c @@ -32,7 +32,7 @@ static char led_state; static char hw_led_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); extern spinlock_t gpio_lock; static void netwinder_leds_event(led_event_t evt) diff --git a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c index e9f5708b4..2c64a0b05 100644 --- a/arch/arm/mach-footbridge/time.c +++ b/arch/arm/mach-footbridge/time.c @@ -19,75 +19,18 @@ #include #include -#include #include #include #include -#include - #include -#include -#include -#include #include -#include #include +#include "common.h" static int rtc_base; -#define mSEC_10_from_14 ((14318180 + 100) / 200) - -static unsigned long isa_gettimeoffset(void) -{ - int count; - - static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */ - static unsigned long jiffies_p = 0; - - /* - * cache volatile jiffies temporarily; we have IRQs turned off. - */ - unsigned long jiffies_t; - - /* timer count may underflow right here */ - outb_p(0x00, 0x43); /* latch the count ASAP */ - - count = inb_p(0x40); /* read the latched count */ - - /* - * We do this guaranteed double memory access instead of a _p - * postfix in the previous port access. Wheee, hackady hack - */ - jiffies_t = jiffies; - - count |= inb_p(0x40) << 8; - - /* Detect timer underflows. If we haven't had a timer tick since - the last time we were called, and time is apparently going - backwards, the counter must have wrapped during this routine. */ - if ((jiffies_t == jiffies_p) && (count > count_p)) - count -= (mSEC_10_from_14/6); - else - jiffies_p = jiffies_t; - - count_p = count; - - count = (((mSEC_10_from_14/6)-1) - count) * (tick_nsec / 1000); - count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6); - - return count; -} - -static irqreturn_t -isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - timer_tick(regs); - - return IRQ_HANDLED; -} - static unsigned long __init get_isa_cmos_time(void) { unsigned int year, mon, day, hour, min, sec; @@ -133,8 +76,7 @@ static unsigned long __init get_isa_cmos_time(void) return mktime(year, mon, day, hour, min, sec); } -static int -set_isa_cmos_time(void) +static int set_isa_cmos_time(void) { int retval = 0; int real_seconds, real_minutes, cmos_minutes; @@ -186,34 +128,7 @@ set_isa_cmos_time(void) return retval; } - -static unsigned long timer1_latch; - -static unsigned long timer1_gettimeoffset (void) -{ - unsigned long value = timer1_latch - *CSR_TIMER1_VALUE; - - return ((tick_nsec / 1000) * value) / timer1_latch; -} - -static irqreturn_t -timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - *CSR_TIMER1_CLR = 0; - - timer_tick(regs); - - return IRQ_HANDLED; -} - -static struct irqaction footbridge_timer_irq = { - .flags = SA_INTERRUPT -}; - -/* - * Set up timer interrupt. - */ -void __init footbridge_init_time(void) +void __init isa_rtc_init(void) { if (machine_is_co285() || machine_is_personal_server()) @@ -262,35 +177,4 @@ void __init footbridge_init_time(void) } else rtc_base = 0; } - - if (machine_is_ebsa285() || - machine_is_co285() || - machine_is_personal_server()) { - gettimeoffset = timer1_gettimeoffset; - - timer1_latch = (mem_fclk_21285 + 8 * HZ) / (16 * HZ); - - *CSR_TIMER1_CLR = 0; - *CSR_TIMER1_LOAD = timer1_latch; - *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; - - footbridge_timer_irq.name = "Timer1 Timer Tick"; - footbridge_timer_irq.handler = timer1_interrupt; - - setup_irq(IRQ_TIMER1, &footbridge_timer_irq); - - } else { - /* enable PIT timer */ - /* set for periodic (4) and LSB/MSB write (0x30) */ - outb(0x34, 0x43); - outb((mSEC_10_from_14/6) & 0xFF, 0x40); - outb((mSEC_10_from_14/6) >> 8, 0x40); - - gettimeoffset = isa_gettimeoffset; - - footbridge_timer_irq.name = "ISA Timer Tick"; - footbridge_timer_irq.handler = isa_timer_interrupt; - - setup_irq(IRQ_ISA_TIMER, &footbridge_timer_irq); - } } diff --git a/arch/arm/mach-h720x/Kconfig b/arch/arm/mach-h720x/Kconfig index 44a303d40..9b6982efb 100644 --- a/arch/arm/mach-h720x/Kconfig +++ b/arch/arm/mach-h720x/Kconfig @@ -1,3 +1,5 @@ +if ARCH_H720X + menu "h720x Implementations" config ARCH_H7201 @@ -25,3 +27,12 @@ config CPU_H7202 bool help Select code specific to h7202 variants +config H7202_SERIAL23 + depends on CPU_H7202 + bool "Use serial ports 2+3" + help + Say Y here if you wish to use serial ports 2+3. They share their + pins with the keyboard matrix controller, so you have to decide. + + +endif diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index 30f4d6118..743656881 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c @@ -22,18 +22,20 @@ #include #include #include - -extern unsigned long h720x_gettimeoffset(void); -extern void __init h720x_init_irq (void); - +#include "common.h" /* * Timer interrupt handler */ static irqreturn_t h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); timer_tick(regs); + + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -48,8 +50,6 @@ static struct irqaction h7201_timer_irq = { */ void __init h7201_init_time(void) { - gettimeoffset = h720x_gettimeoffset; - CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; @@ -57,3 +57,8 @@ void __init h7201_init_time(void) setup_irq(IRQ_TIMER0, &h7201_timer_irq); } + +struct sys_timer h7201_timer = { + .init = h7201_init_time, + .offset = h720x_gettimeoffset, +}; diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c index ee7abcd29..21b8fb612 100644 --- a/arch/arm/mach-h720x/cpu-h7202.c +++ b/arch/arm/mach-h720x/cpu-h7202.c @@ -5,7 +5,7 @@ * 2003 Robert Schwebel * 2004 Sascha Hauer * - * processor specific stuff for the Hynix h7201 + * processor specific stuff for the Hynix h7202 * * 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 @@ -23,6 +23,8 @@ #include #include #include +#include +#include "common.h" static struct resource h7202ps2_resources[] = { [0] = { @@ -44,13 +46,61 @@ static struct platform_device h7202ps2_device = { .resource = h7202ps2_resources, }; +static struct plat_serial8250_port serial_platform_data[] = { + { + .membase = (void*)SERIAL0_VIRT, + .mapbase = SERIAL0_BASE, + .irq = IRQ_UART0, + .uartclk = 2*1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .membase = (void*)SERIAL1_VIRT, + .mapbase = SERIAL1_BASE, + .irq = IRQ_UART1, + .uartclk = 2*1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, +#ifdef CONFIG_H7202_SERIAL23 + { + .membase = (void*)SERIAL2_VIRT, + .mapbase = SERIAL2_BASE, + .irq = IRQ_UART2, + .uartclk = 2*1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .membase = (void*)SERIAL3_VIRT, + .mapbase = SERIAL3_BASE, + .irq = IRQ_UART3, + .uartclk = 2*1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, +#endif + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + static struct platform_device *devices[] __initdata = { &h7202ps2_device, + &serial_device, }; -extern unsigned long h720x_gettimeoffset(void); -extern void __init h720x_init_irq (void); - /* Although we have two interrupt lines for the timers, we only have one * status register which clears all pending timer interrupts on reading. So * we have to handle all timer interrupts in one place. @@ -64,7 +114,9 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); if ( mask & TSTAT_T0INT ) { + write_seqlock(&xtime_lock); timer_tick(regs); + write_sequnlock(&xtime_lock); if( mask == TSTAT_T0INT ) return; } @@ -128,8 +180,6 @@ static struct irqaction h7202_timer_irq = { */ void __init h7202_init_time(void) { - gettimeoffset = h720x_gettimeoffset; - CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; @@ -138,6 +188,11 @@ void __init h7202_init_time(void) setup_irq(IRQ_TIMER0, &h7202_timer_irq); } +struct sys_timer h7202_timer = { + .init = h7202_init_time, + .offset = h720x_gettimeoffset, +}; + void __init h7202_init_irq (void) { int irq; @@ -161,5 +216,13 @@ void __init init_hw_h7202(void) /* Enable clocks */ CPU_REG (PMU_BASE, PMU_PLL_CTRL) |= PLL_2_EN | PLL_1_EN | PLL_3_MUTE; + CPU_REG (SERIAL0_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; + CPU_REG (SERIAL1_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; +#ifdef CONFIG_H7202_SERIAL23 + CPU_REG (SERIAL2_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; + CPU_REG (SERIAL3_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN; + CPU_IO (GPIO_AMULSEL) = AMULSEL_USIN2 | AMULSEL_USOUT2 | + AMULSEL_USIN3 | AMULSEL_USOUT3; +#endif (void) platform_add_devices(devices, ARRAY_SIZE(devices)); } diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c index d2208c1e5..9b24b9b0d 100644 --- a/arch/arm/mach-h720x/h7201-eval.c +++ b/arch/arm/mach-h720x/h7201-eval.c @@ -27,10 +27,7 @@ #include #include #include - -extern void h720x_init_irq (void); -extern void h7201_init_time(void); -extern void __init h720x_map_io(void); +#include "common.h" MACHINE_START(H7201, "Hynix GMS30C7201") MAINTAINER("Robert Schwebel, Pengutronix") @@ -38,5 +35,5 @@ MACHINE_START(H7201, "Hynix GMS30C7201") BOOT_PARAMS(0xc0001000) MAPIO(h720x_map_io) INITIRQ(h720x_init_irq) - INITTIME(h7201_init_time) + .timer = &h7201_timer, MACHINE_END diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c index 939873197..3456a00d5 100644 --- a/arch/arm/mach-h720x/h7202-eval.c +++ b/arch/arm/mach-h720x/h7202-eval.c @@ -27,11 +27,7 @@ #include #include #include - -extern void __init init_hw_h7202(void); -extern void __init h7202_init_irq (void); -extern void __init h7202_init_time(void); -extern void __init h720x_map_io(void); +#include "common.h" static struct resource cirrus_resources[] = { [0] = { @@ -80,6 +76,6 @@ MACHINE_START(H7202, "Hynix HMS30C7202") BOOT_PARAMS(0x40000100) MAPIO(h720x_map_io) INITIRQ(h7202_init_irq) - INITTIME(h7202_init_time) + .timer = &h7202_timer, INIT_MACHINE(init_eval_h7202) MACHINE_END diff --git a/arch/arm/mach-imx/dma.c b/arch/arm/mach-imx/dma.c index 7387ccbd8..2a44d53d2 100644 --- a/arch/arm/mach-imx/dma.c +++ b/arch/arm/mach-imx/dma.c @@ -136,7 +136,7 @@ dma_err_handler(int irq, void *dev_id, struct pt_regs *regs) i, channel->name); DBOSR |= (1 << i); } - DISR |= (1 << i); + DISR = (1 << i); } return IRQ_HANDLED; } @@ -158,10 +158,10 @@ dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) */ printk(KERN_WARNING "spurious IRQ for DMA channel %d\n", i); - DISR |= (1 << i); } } } + DISR = disr; return IRQ_HANDLED; } diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index 4954653ec..54377d0f5 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c @@ -100,8 +100,8 @@ EXPORT_SYMBOL(imx_gpio_mode); static unsigned int imx_decode_pll(unsigned int pll) { u32 mfi = (pll >> 10) & 0xf; - u32 mfn = pll & 0x3f; - u32 mfd = (pll >> 16) & 0x3f; + u32 mfn = pll & 0x3ff; + u32 mfd = (pll >> 16) & 0x3ff; u32 pd = (pll >> 26) & 0xf; u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512); diff --git a/arch/arm/mach-imx/generic.h b/arch/arm/mach-imx/generic.h index 31e1911b1..e91003e4b 100644 --- a/arch/arm/mach-imx/generic.h +++ b/arch/arm/mach-imx/generic.h @@ -11,4 +11,6 @@ extern void __init imx_map_io(void); extern void __init imx_init_irq(void); -extern void __init imx_init_time(void); + +struct sys_timer; +extern struct sys_timer imx_timer; diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c index bd92b909a..625dd01c2 100644 --- a/arch/arm/mach-imx/mx1ads.c +++ b/arch/arm/mach-imx/mx1ads.c @@ -83,6 +83,6 @@ MACHINE_START(MX1ADS, "Motorola MX1ADS") BOOT_PARAMS(0x08000100) MAPIO(mx1ads_map_io) INITIRQ(imx_init_irq) - INITTIME(imx_init_time) + .timer = &imx_timer, INIT_MACHINE(mx1ads_init) MACHINE_END diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index ac7cab9b0..11f1e56c3 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -28,8 +28,7 @@ * Returns number of us since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() */ -static unsigned long -imx_gettimeoffset(void) +static unsigned long imx_gettimeoffset(void) { unsigned long ticks; @@ -59,11 +58,15 @@ imx_gettimeoffset(void) static irqreturn_t imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + /* clear the interrupt */ if (IMX_TSTAT(TIMER_BASE)) IMX_TSTAT(TIMER_BASE) = 0; timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -76,8 +79,7 @@ static struct irqaction imx_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init -imx_init_time(void) +static void __init imx_timer_init(void) { /* * Initialise to a known state (all timers off, and timing reset) @@ -91,5 +93,9 @@ imx_init_time(void) * Make irqs happen for the system timer */ setup_irq(TIM1_INT, &imx_timer_irq); - gettimeoffset = imx_gettimeoffset; } + +struct sys_timer imx_timer = { + .init = imx_timer_init, + .offset = imx_gettimeoffset, +}; diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 7f6df02cf..86c50c388 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -24,6 +24,8 @@ #include #include +#include "common.h" + static struct amba_device rtc_device = { .dev = { .bus_id = "mb:15", @@ -113,7 +115,7 @@ arch_initcall(integrator_init); #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET -static spinlock_t cm_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cm_lock); /** * cm_control - update the CM_CTRL register. @@ -163,15 +165,13 @@ typedef struct TimerStruct { unsigned long TimerClear; } TimerStruct_t; -extern unsigned long (*gettimeoffset)(void); - static unsigned long timer_reload; /* * Returns number of ms since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() */ -static unsigned long integrator_gettimeoffset(void) +unsigned long integrator_gettimeoffset(void) { volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE; unsigned long ticks1, ticks2, status; @@ -214,11 +214,15 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; + write_seqlock(&xtime_lock); + // ...clear the interrupt timer1->TimerClear = 1; timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -264,5 +268,4 @@ void __init integrator_time_init(unsigned long reload, unsigned int ctrl) * Make irqs happen for the system timer */ setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); - gettimeoffset = integrator_gettimeoffset; } diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 0859557e7..c3c2f17d0 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -34,7 +35,7 @@ module_param_named(lmid, module_id, int, 0444); MODULE_PARM_DESC(lmid, "logic module stack position"); struct impd1_module { - void *base; + void __iomem *base; struct clk vcos[2]; }; @@ -259,6 +260,17 @@ static int impd1fb_clcd_setup(struct clcd_fb *fb) return ret; } +static int impd1fb_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) +{ + unsigned long start, size; + + start = vma->vm_pgoff + (fb->fb.fix.smem_start >> PAGE_SHIFT); + size = vma->vm_end - vma->vm_start; + + return remap_pfn_range(vma, vma->vm_start, start, size, + vma->vm_page_prot); +} + static void impd1fb_clcd_remove(struct clcd_fb *fb) { iounmap(fb->fb.screen_base); @@ -272,6 +284,7 @@ static struct clcd_board impd1_clcd_data = { .disable = impd1fb_clcd_disable, .enable = impd1fb_clcd_enable, .setup = impd1fb_clcd_setup, + .mmap = impd1fb_clcd_mmap, .remove = impd1fb_clcd_remove, }; diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index b07e39d21..219ae5080 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -40,7 +40,9 @@ #include #include #include +#include +#include "common.h" /* * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx @@ -66,7 +68,6 @@ * f1200000 12000000 EBI registers * f1300000 13000000 Counter/Timer * f1400000 14000000 Interrupt controller - * f1500000 15000000 RTC * f1600000 16000000 UART 0 * f1700000 17000000 UART 1 * f1a00000 1a000000 Debug LEDs @@ -79,7 +80,6 @@ static struct map_desc ap_io_desc[] __initdata = { { IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_RTC_BASE), INTEGRATOR_RTC_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, @@ -281,17 +281,22 @@ static void __init ap_init(void) } } -static void ap_time_init(void) +static void __init ap_init_timer(void) { integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0); } +static struct sys_timer ap_timer = { + .init = ap_init_timer, + .offset = integrator_gettimeoffset, +}; + MACHINE_START(INTEGRATOR, "ARM-Integrator") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) BOOT_PARAMS(0x00000100) MAPIO(ap_map_io) INITIRQ(ap_init_irq) - INITTIME(ap_time_init) + .timer = &ap_timer, INIT_MACHINE(ap_init) MACHINE_END diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 0f5fc7861..68e15c36e 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -35,7 +35,9 @@ #include #include #include +#include +#include "common.h" #include "clock.h" #define INTCP_PA_MMC_BASE 0x1c000000 @@ -442,6 +444,14 @@ static int cp_clcd_setup(struct clcd_fb *fb) return 0; } +static int cp_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) +{ + return dma_mmap_writecombine(&fb->dev->dev, vma, + fb->fb.screen_base, + fb->fb.fix.smem_start, + fb->fb.fix.smem_len); +} + static void cp_clcd_remove(struct clcd_fb *fb) { dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, @@ -454,6 +464,7 @@ static struct clcd_board clcd_data = { .decode = clcdfb_decode, .enable = cp_clcd_enable, .setup = cp_clcd_setup, + .mmap = cp_clcd_mmap, .remove = cp_clcd_remove, }; @@ -496,17 +507,22 @@ static void __init intcp_init(void) #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ -static void __init intcp_init_time(void) +static void __init intcp_timer_init(void) { integrator_time_init(1000000 / HZ, TIMER_CTRL_IE); } +static struct sys_timer cp_timer = { + .init = intcp_timer_init, + .offset = integrator_gettimeoffset, +}; + MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) BOOT_PARAMS(0x00000100) MAPIO(intcp_map_io) INITIRQ(intcp_init_irq) - INITTIME(intcp_init_time) + .timer = &cp_timer, INIT_MACHINE(intcp_init) MACHINE_END diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index e7f66ca57..229a63a52 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c @@ -163,7 +163,7 @@ * 7:2 register number * */ -static spinlock_t v3_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(v3_lock); #define PCI_BUS_NONMEM_START 0x00000000 #define PCI_BUS_NONMEM_SIZE SZ_256M diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c index 39606096f..249581f88 100644 --- a/arch/arm/mach-integrator/time.c +++ b/arch/arm/mach-integrator/time.c @@ -1,46 +1,213 @@ /* * linux/arch/arm/mach-integrator/time.c * - * Copyright (C) 2000-2001 Deep Blue Solutions + * 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 version 2 as * published by the Free Software Foundation. */ +#include #include #include +#include +#include #include +#include +#include #include #include +#include +#include -#define RTC_DR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 0) -#define RTC_MR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 4) -#define RTC_STAT (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 8) -#define RTC_EOI (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 8) -#define RTC_LR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 12) -#define RTC_CR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 16) +#include -#define RTC_CR_MIE 0x00000001 +#define RTC_DR (0) +#define RTC_MR (4) +#define RTC_STAT (8) +#define RTC_EOI (8) +#define RTC_LR (12) +#define RTC_CR (16) +#define RTC_CR_MIE (1 << 0) extern int (*set_rtc)(void); +static void __iomem *rtc_base; static int integrator_set_rtc(void) { - __raw_writel(xtime.tv_sec, RTC_LR); + __raw_writel(xtime.tv_sec, rtc_base + RTC_LR); return 1; } -static int integrator_rtc_init(void) +static void rtc_read_alarm(struct rtc_wkalrm *alrm) { - __raw_writel(0, RTC_CR); - __raw_writel(0, RTC_EOI); + rtc_time_to_tm(readl(rtc_base + RTC_MR), &alrm->time); +} + +static int rtc_set_alarm(struct rtc_wkalrm *alrm) +{ + unsigned long time; + int ret; + + ret = rtc_tm_to_time(&alrm->time, &time); + if (ret == 0) + writel(time, rtc_base + RTC_MR); + return ret; +} + +static void rtc_read_time(struct rtc_time *tm) +{ + rtc_time_to_tm(readl(rtc_base + RTC_DR), tm); +} - xtime.tv_sec = __raw_readl(RTC_DR); +/* + * Set the RTC time. Unfortunately, we can't accurately set + * the point at which the counter updates. + * + * Also, since RTC_LR is transferred to RTC_CR on next rising + * edge of the 1Hz clock, we must write the time one second + * in advance. + */ +static int rtc_set_time(struct rtc_time *tm) +{ + unsigned long time; + int ret; + + ret = rtc_tm_to_time(tm, &time); + if (ret == 0) + writel(time + 1, rtc_base + RTC_LR); + + return ret; +} + +static struct rtc_ops rtc_ops = { + .owner = THIS_MODULE, + .read_time = rtc_read_time, + .set_time = rtc_set_time, + .read_alarm = rtc_read_alarm, + .set_alarm = rtc_set_alarm, +}; + +static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + writel(0, rtc_base + RTC_EOI); + return IRQ_HANDLED; +} + +static int rtc_probe(struct amba_device *dev, void *id) +{ + int ret; + + if (rtc_base) + return -EBUSY; + + ret = amba_request_regions(dev, NULL); + if (ret) + goto out; + + rtc_base = ioremap(dev->res.start, SZ_4K); + if (!rtc_base) { + ret = -ENOMEM; + goto res_out; + } + + __raw_writel(0, rtc_base + RTC_CR); + __raw_writel(0, rtc_base + RTC_EOI); + + xtime.tv_sec = __raw_readl(rtc_base + RTC_DR); + + ret = request_irq(dev->irq[0], rtc_interrupt, SA_INTERRUPT, + "rtc-pl030", dev); + if (ret) + goto map_out; + + ret = register_rtc(&rtc_ops); + if (ret) + goto irq_out; set_rtc = integrator_set_rtc; + return 0; + + irq_out: + free_irq(dev->irq[0], dev); + map_out: + iounmap(rtc_base); + rtc_base = NULL; + res_out: + amba_release_regions(dev); + out: + return ret; +} + +static int rtc_remove(struct amba_device *dev) +{ + set_rtc = NULL; + + writel(0, rtc_base + RTC_CR); + + free_irq(dev->irq[0], dev); + unregister_rtc(&rtc_ops); + + iounmap(rtc_base); + rtc_base = NULL; + amba_release_regions(dev); + + return 0; +} + +static struct timespec rtc_delta; + +static int rtc_suspend(struct amba_device *dev, u32 state) +{ + struct timespec rtc; + + rtc.tv_sec = readl(rtc_base + RTC_DR); + rtc.tv_nsec = 0; + save_time_delta(&rtc_delta, &rtc); return 0; } -__initcall(integrator_rtc_init); +static int rtc_resume(struct amba_device *dev) +{ + struct timespec rtc; + + rtc.tv_sec = readl(rtc_base + RTC_DR); + rtc.tv_nsec = 0; + restore_time_delta(&rtc_delta, &rtc); + + return 0; +} + +static struct amba_id rtc_ids[] = { + { + .id = 0x00041030, + .mask = 0x000fffff, + }, + { 0, 0 }, +}; + +static struct amba_driver rtc_driver = { + .drv = { + .name = "rtc-pl030", + }, + .probe = rtc_probe, + .remove = rtc_remove, + .suspend = rtc_suspend, + .resume = rtc_resume, + .id_table = rtc_ids, +}; + +static int __init integrator_rtc_init(void) +{ + return amba_driver_register(&rtc_driver); +} + +static void __exit integrator_rtc_exit(void) +{ + amba_driver_unregister(&rtc_driver); +} + +module_init(integrator_rtc_init); +module_exit(integrator_rtc_exit); diff --git a/arch/arm/mach-iop3xx/Kconfig b/arch/arm/mach-iop3xx/Kconfig index 019b1bf25..2bfe8c729 100644 --- a/arch/arm/mach-iop3xx/Kconfig +++ b/arch/arm/mach-iop3xx/Kconfig @@ -25,6 +25,13 @@ config ARCH_IQ80331 Say Y here if you want to run your kernel on the Intel IQ80331 evaluation kit for the IOP331 chipset. +config MACH_IQ80332 + bool "Enable support for IQ80332" + select ARCH_IOP331 + help + Say Y here if you want to run your kernel on the Intel IQ80332 + evaluation kit for the IOP332 chipset + config ARCH_EP80219 bool "Enable support for EP80219" select ARCH_IOP321 @@ -41,10 +48,16 @@ config ARCH_IOP331 bool default ARCH_IQ80331 help - The IQ80331 uses the IOP331 variant. + The IQ80331, IQ80332, and IQ80333 uses the IOP331 variant. comment "IOP3xx Chipset Features" -endmenu +config IOP331_STEPD + bool "Chip stepping D of the IOP80331 processor or IOP80333" + depends on (ARCH_IOP331) + help + Say Y here if you have StepD of the IOP80331 or IOP8033 + based platforms. +endmenu endif diff --git a/arch/arm/mach-iop3xx/Makefile b/arch/arm/mach-iop3xx/Makefile index dcbffb66d..b17eb1f46 100644 --- a/arch/arm/mach-iop3xx/Makefile +++ b/arch/arm/mach-iop3xx/Makefile @@ -10,7 +10,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_ARCH_IOP321) += iop321-setup.o iop321-irq.o iop321-pci.o iop321-mm.o iop321-time.o +obj-$(CONFIG_ARCH_IOP321) += iop321-setup.o iop321-irq.o iop321-pci.o iop321-time.o obj-$(CONFIG_ARCH_IOP331) += iop331-setup.o iop331-irq.o iop331-pci.o iop331-time.o @@ -19,3 +19,5 @@ obj-$(CONFIG_ARCH_IQ80321) += iq80321-mm.o iq80321-pci.o obj-$(CONFIG_ARCH_IQ31244) += iq31244-mm.o iq31244-pci.o obj-$(CONFIG_ARCH_IQ80331) += iq80331-mm.o iq80331-pci.o + +obj-$(CONFIG_MACH_IQ80332) += iq80332-mm.o iq80332-pci.o diff --git a/arch/arm/mach-iop3xx/common.c b/arch/arm/mach-iop3xx/common.c index c0bbe5a18..bda7394ec 100644 --- a/arch/arm/mach-iop3xx/common.c +++ b/arch/arm/mach-iop3xx/common.c @@ -28,7 +28,6 @@ unsigned long iop3xx_pcibios_min_mem = 0; * Default power-off for EP80219 */ #include -#include static inline void ep80219_send_to_pic(__u8 c) { } diff --git a/arch/arm/mach-iop3xx/iop321-pci.c b/arch/arm/mach-iop3xx/iop321-pci.c index 8fdfc3a8f..8ba6a0e23 100644 --- a/arch/arm/mach-iop3xx/iop321-pci.c +++ b/arch/arm/mach-iop3xx/iop321-pci.c @@ -197,31 +197,24 @@ struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *sys) void iop321_init(void) { -#if CONFIG_ARCH_EP80219 - *IOP321_ATUCR = 0x2; - *IOP321_OIOWTVR = 0x90000000; - *IOP321_IABAR0 = 0x00000004; - *IOP321_IABAR2 = 0xa000000c; - *IOP321_IALR2 = 0xe0000000; -#endif - DBG("PCI: Intel 80321 PCI init code.\n"); - DBG("\tATU: IOP321_ATUCMD=0x%04x\n", *IOP321_ATUCMD); - DBG("\tATU: IOP321_OMWTVR0=0x%04x, IOP321_OIOWTVR=0x%04x\n", + DBG("ATU: IOP321_ATUCMD=0x%04x\n", *IOP321_ATUCMD); + DBG("ATU: IOP321_OMWTVR0=0x%04x, IOP321_OIOWTVR=0x%04x\n", *IOP321_OMWTVR0, *IOP321_OIOWTVR); - DBG("\tATU: IOP321_ATUCR=0x%08x\n", *IOP321_ATUCR); - DBG("\tATU: IOP321_IABAR0=0x%08x IOP321_IALR0=0x%08x IOP321_IATVR0=%08x\n", *IOP321_IABAR0, *IOP321_IALR0, *IOP321_IATVR0); - DBG("\tATU: IOP321_ERBAR=0x%08x IOP321_ERLR=0x%08x IOP321_ERTVR=%08x\n", *IOP321_ERBAR, *IOP321_ERLR, *IOP321_ERTVR); - DBG("\tATU: IOP321_IABAR2=0x%08x IOP321_IALR2=0x%08x IOP321_IATVR2=%08x\n", *IOP321_IABAR2, *IOP321_IALR2, *IOP321_IATVR2); - DBG("\tATU: IOP321_IABAR3=0x%08x IOP321_IALR3=0x%08x IOP321_IATVR3=%08x\n", *IOP321_IABAR3, *IOP321_IALR3, *IOP321_IATVR3); - -#if 0 - hook_fault_code(4, iop321_pci_abort, SIGBUS, "external abort on linefetch"); - hook_fault_code(6, iop321_pci_abort, SIGBUS, "external abort on linefetch"); - hook_fault_code(8, iop321_pci_abort, SIGBUS, "external abort on non-linefetch"); - hook_fault_code(10, iop321_pci_abort, SIGBUS, "external abort on non-linefetch"); -#endif + DBG("ATU: IOP321_ATUCR=0x%08x\n", *IOP321_ATUCR); + DBG("ATU: IOP321_IABAR0=0x%08x IOP321_IALR0=0x%08x IOP321_IATVR0=%08x\n", + *IOP321_IABAR0, *IOP321_IALR0, *IOP321_IATVR0); + DBG("ATU: IOP321_OMWTVR0=0x%08x\n", *IOP321_OMWTVR0); + DBG("ATU: IOP321_IABAR1=0x%08x IOP321_IALR1=0x%08x\n", + *IOP321_IABAR1, *IOP321_IALR1); + DBG("ATU: IOP321_ERBAR=0x%08x IOP321_ERLR=0x%08x IOP321_ERTVR=%08x\n", + *IOP321_ERBAR, *IOP321_ERLR, *IOP321_ERTVR); + DBG("ATU: IOP321_IABAR2=0x%08x IOP321_IALR2=0x%08x IOP321_IATVR2=%08x\n", + *IOP321_IABAR2, *IOP321_IALR2, *IOP321_IATVR2); + DBG("ATU: IOP321_IABAR3=0x%08x IOP321_IALR3=0x%08x IOP321_IATVR3=%08x\n", + *IOP321_IABAR3, *IOP321_IALR3, *IOP321_IATVR3); + hook_fault_code(16+6, iop321_pci_abort, SIGBUS, "imprecise external abort"); } diff --git a/arch/arm/mach-iop3xx/iop321-setup.c b/arch/arm/mach-iop3xx/iop321-setup.c index e92f77fbb..bf23e0fd2 100644 --- a/arch/arm/mach-iop3xx/iop321-setup.c +++ b/arch/arm/mach-iop3xx/iop321-setup.c @@ -3,17 +3,28 @@ * * Author: Nicolas Pitre * Copyright (C) 2001 MontaVista Software, Inc. + * Copyright (C) 2004 Intel Corporation. * * 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 +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -21,42 +32,137 @@ #include #include +#define IOP321_UART_XTAL 1843200 + +/* + * Standard IO mapping for all IOP321 based systems + */ +static struct map_desc iop321_std_desc[] __initdata = { + /* virtual physical length type */ + + /* mem mapped registers */ + { IOP321_VIRT_MEM_BASE, IOP321_PHYS_MEM_BASE, 0x00002000, MT_DEVICE }, + + /* PCI IO space */ + { IOP321_PCI_LOWER_IO_VA, IOP321_PCI_LOWER_IO_PA, IOP321_PCI_IO_WINDOW_SIZE, MT_DEVICE } +}; + +#ifdef CONFIG_ARCH_IQ80321 +#define UARTBASE IQ80321_UART +#define IRQ_UART IRQ_IQ80321_UART +#endif + +#ifdef CONFIG_ARCH_IQ31244 +#define UARTBASE IQ31244_UART +#define IRQ_UART IRQ_IQ31244_UART +#endif + +static struct uart_port iop321_serial_ports[] = { + { + .membase = (char*)(UARTBASE), + .mapbase = (UARTBASE), + .irq = IRQ_UART, + .flags = UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 0, + .uartclk = IOP321_UART_XTAL, + .line = 0, + .type = PORT_16550A, + .fifosize = 16 + } +}; + +static struct resource iop32x_i2c_0_resources[] = { + [0] = { + .start = 0xfffff680, + .end = 0xfffff698, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP321_I2C_0, + .end = IRQ_IOP321_I2C_0, + .flags = IORESOURCE_IRQ + } +}; + +static struct resource iop32x_i2c_1_resources[] = { + [0] = { + .start = 0xfffff6a0, + .end = 0xfffff6b8, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP321_I2C_1, + .end = IRQ_IOP321_I2C_1, + .flags = IORESOURCE_IRQ + } +}; + +static struct platform_device iop32x_i2c_0_controller = { + .name = "IOP3xx-I2C", + .id = 0, + .num_resources = 2, + .resource = iop32x_i2c_0_resources +}; + +static struct platform_device iop32x_i2c_1_controller = { + .name = "IOP3xx-I2C", + .id = 1, + .num_resources = 2, + .resource = iop32x_i2c_1_resources +}; + +static struct platform_device *iop32x_devices[] __initdata = { + &iop32x_i2c_0_controller, + &iop32x_i2c_1_controller +}; + +void __init iop32x_init(void) +{ + if(iop_is_321()) + { + platform_add_devices(iop32x_devices, + ARRAY_SIZE(iop32x_devices)); + } +} + +void __init iop321_map_io(void) +{ + iotable_init(iop321_std_desc, ARRAY_SIZE(iop321_std_desc)); + early_serial_setup(&iop321_serial_ports[0]); +} + #ifdef CONFIG_ARCH_IQ80321 extern void iq80321_map_io(void); -extern void iop321_init_irq(void); +extern struct sys_timer iop321_timer; extern void iop321_init_time(void); #endif #ifdef CONFIG_ARCH_IQ31244 extern void iq31244_map_io(void); -extern void iop321_init_irq(void); +extern struct sys_timer iop321_timer; extern void iop321_init_time(void); #endif -static void __init -fixup_iop321(struct machine_desc *desc, struct tag *tags, - char **cmdline, struct meminfo *mi) -{ -} - #if defined(CONFIG_ARCH_IQ80321) MACHINE_START(IQ80321, "Intel IQ80321") MAINTAINER("Intel Corporation") - BOOT_MEM(PHYS_OFFSET, IQ80321_UART, 0xfe800000) - FIXUP(fixup_iop321) + BOOT_MEM(PHYS_OFFSET, IQ80321_UART, IQ80321_UART) MAPIO(iq80321_map_io) INITIRQ(iop321_init_irq) - INITTIME(iop321_init_time) + .timer = &iop321_timer, BOOT_PARAMS(0xa0000100) + INIT_MACHINE(iop32x_init) MACHINE_END #elif defined(CONFIG_ARCH_IQ31244) - MACHINE_START(IQ31244, "Intel IQ31244") +MACHINE_START(IQ31244, "Intel IQ31244") MAINTAINER("Intel Corp.") BOOT_MEM(PHYS_OFFSET, IQ31244_UART, IQ31244_UART) MAPIO(iq31244_map_io) INITIRQ(iop321_init_irq) - INITTIME(iop321_init_time) + .timer = &iop321_timer, BOOT_PARAMS(0xa0000100) + INIT_MACHINE(iop32x_init) MACHINE_END #else #error No machine descriptor defined for this IOP3XX implementation diff --git a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c index b2135e18e..9b7dd64d1 100644 --- a/arch/arm/mach-iop3xx/iop321-time.c +++ b/arch/arm/mach-iop3xx/iop321-time.c @@ -29,11 +29,9 @@ #define IOP321_TIME_SYNC 0 -static unsigned long iop321_latch; - static inline unsigned long get_elapsed(void) { - return iop321_latch - *IOP321_TU_TCR0; + return LATCH - *IOP321_TU_TCR0; } static unsigned long iop321_gettimeoffset(void) @@ -55,14 +53,14 @@ static unsigned long iop321_gettimeoffset(void) asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr2)); if(tisr1 & 1) - elapsed += iop321_latch; + elapsed += LATCH; else if (tisr2 & 1) - elapsed = iop321_latch + get_elapsed(); + elapsed = LATCH + get_elapsed(); /* * Now convert them to usec. */ - usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / iop321_latch; + usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH; return usec; } @@ -71,35 +69,16 @@ static irqreturn_t iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 tisr; -#ifdef IOP321_TIME_SYNC - u32 passed; -#define TM_THRESH (iop321_latch*2) -#endif - asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr)); + write_seqlock(&xtime_lock); + asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr)); tisr |= 1; - asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr)); -#ifdef IOP321_TIME_SYNC - passed = 0xffffffff - *IOP321_TU_TCR1; - - do - { - do_timer(regs); - if(passed < TM_THRESH) - break; - if(passed > iop321_latch) - passed -= iop321_latch; - else - passed = 0; - } while(1); - - asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (0xffffffff)); -#else - do_timer(regs); -#endif + timer_tick(regs); + + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -110,32 +89,21 @@ static struct irqaction iop321_timer_irq = { .flags = SA_INTERRUPT }; -extern int setup_arm_irq(int, struct irqaction*); - -void __init iop321_init_time(void) +static void __init iop321_timer_init(void) { u32 timer_ctl; - iop321_latch = (CLOCK_TICK_RATE + HZ / 2) / HZ; - gettimeoffset = iop321_gettimeoffset; setup_irq(IRQ_IOP321_TIMER0, &iop321_timer_irq); timer_ctl = IOP321_TMR_EN | IOP321_TMR_PRIVILEGED | IOP321_TMR_RELOAD | IOP321_TMR_RATIO_1_1; - asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (iop321_latch)); + asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (LATCH)); asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (timer_ctl)); - -#ifdef IOP321_TIME_SYNC - /* Setup second timer */ - /* setup counter */ - timer_ctl = IOP321_TMR_EN | IOP321_TMR_PRIVILEGED | - IOP321_TMR_RATIO_1_1; - asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (0xffffffff)); - /* setup control */ - asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (timer_ctl)); -#endif } - +struct sys_timer iop321_timer = { + .init = &iop321_timer_init, + .offset = iop321_gettimeoffset, +}; diff --git a/arch/arm/mach-iop3xx/iop331-pci.c b/arch/arm/mach-iop3xx/iop331-pci.c index f6118dd10..44dd213b4 100644 --- a/arch/arm/mach-iop3xx/iop331-pci.c +++ b/arch/arm/mach-iop3xx/iop331-pci.c @@ -4,7 +4,7 @@ * PCI support for the Intel IOP331 chipset * * Author: Dave Jiang (dave.jiang@intel.com) - * Copyright (C) 2003 Intel Corp. + * Copyright (C) 2003, 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 @@ -26,7 +26,8 @@ #include -//#define DEBUG +#undef DEBUG +#undef DEBUG1 #ifdef DEBUG #define DBG(x...) printk(x) @@ -34,6 +35,12 @@ #define DBG(x...) do { } while (0) #endif +#ifdef DEBUG1 +#define DBG1(x...) printk(x) +#else +#define DBG1(x...) do { } while (0) +#endif + /* * This routine builds either a type0 or type1 configuration command. If the * bus is on the 80331 then a type0 made, else a type1 is created. @@ -197,21 +204,19 @@ struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *sys) void iop331_init(void) { - DBG("PCI: Intel 80331 PCI init code.\n"); - DBG("\tATU: IOP331_ATUCMD=0x%04x\n", *IOP331_ATUCMD); - DBG("\tATU: IOP331_OMWTVR0=0x%04x, IOP331_OIOWTVR=0x%04x\n", + DBG1("PCI: Intel 80331 PCI init code.\n"); + DBG1("\tATU: IOP331_ATUCMD=0x%04x\n", *IOP331_ATUCMD); + DBG1("\tATU: IOP331_OMWTVR0=0x%04x, IOP331_OIOWTVR=0x%04x\n", *IOP331_OMWTVR0, *IOP331_OIOWTVR); - DBG("\tATU: IOP331_ATUCR=0x%08x\n", *IOP331_ATUCR); - DBG("\tATU: IOP331_IABAR0=0x%08x IOP331_IALR0=0x%08x IOP331_IATVR0=%08x\n", *IOP331_IABAR0, *IOP331_IALR0, *IOP331_IATVR0); - DBG("\tATU: IOP331_ERBAR=0x%08x IOP331_ERLR=0x%08x IOP331_ERTVR=%08x\n", *IOP331_ERBAR, *IOP331_ERLR, *IOP331_ERTVR); - DBG("\tATU: IOP331_IABAR2=0x%08x IOP331_IALR2=0x%08x IOP331_IATVR2=%08x\n", *IOP331_IABAR2, *IOP331_IALR2, *IOP331_IATVR2); - DBG("\tATU: IOP331_IABAR3=0x%08x IOP331_IALR3=0x%08x IOP331_IATVR3=%08x\n", *IOP331_IABAR3, *IOP331_IALR3, *IOP331_IATVR3); - - /* redboot changed, reset IABAR0 to something sane */ - /* fixes master aborts in plugged in cards */ - /* will clean up later and work nicely with redboot */ - *IOP331_IABAR0 = 0x00000004; + DBG1("\tATU: IOP331_OMWTVR1=0x%04x\n", *IOP331_OMWTVR1); + DBG1("\tATU: IOP331_ATUCR=0x%08x\n", *IOP331_ATUCR); + DBG1("\tATU: IOP331_IABAR0=0x%08x IOP331_IALR0=0x%08x IOP331_IATVR0=%08x\n", *IOP331_IABAR0, *IOP331_IALR0, *IOP331_IATVR0); + DBG1("\tATU: IOP31_IABAR1=0x%08x IOP331_IALR1=0x%08x\n", *IOP331_IABAR1, *IOP331_IALR1); + DBG1("\tATU: IOP331_ERBAR=0x%08x IOP331_ERLR=0x%08x IOP331_ERTVR=%08x\n", *IOP331_ERBAR, *IOP331_ERLR, *IOP331_ERTVR); + DBG1("\tATU: IOP331_IABAR2=0x%08x IOP331_IALR2=0x%08x IOP331_IATVR2=%08x\n", *IOP331_IABAR2, *IOP331_IALR2, *IOP331_IATVR2); + DBG1("\tATU: IOP331_IABAR3=0x%08x IOP331_IALR3=0x%08x IOP331_IATVR3=%08x\n", *IOP331_IABAR3, *IOP331_IALR3, *IOP331_IATVR3); + hook_fault_code(16+6, iop331_pci_abort, SIGBUS, "imprecise external abort"); } diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c index 681e1ce78..622e79148 100644 --- a/arch/arm/mach-iop3xx/iop331-setup.c +++ b/arch/arm/mach-iop3xx/iop331-setup.c @@ -43,13 +43,13 @@ static struct map_desc iop331_std_desc[] __initdata = { { IOP331_VIRT_MEM_BASE, IOP331_PHYS_MEM_BASE, 0x00002000, MT_DEVICE }, /* PCI IO space */ - { 0xfe000000, 0x90000000, 0x00020000, MT_DEVICE } + { IOP331_PCI_LOWER_IO_VA, IOP331_PCI_LOWER_IO_PA, IOP331_PCI_IO_WINDOW_SIZE, MT_DEVICE } }; static struct uart_port iop331_serial_ports[] = { { - .membase = (char*)(IQ80331_UART0_VIRT), - .mapbase = (IQ80331_UART0_PHYS), + .membase = (char*)(IOP331_UART0_VIRT), + .mapbase = (IOP331_UART0_PHYS), .irq = IRQ_IOP331_UART0, .flags = UPF_SKIP_TEST, .iotype = UPIO_MEM, @@ -59,8 +59,8 @@ static struct uart_port iop331_serial_ports[] = { .type = PORT_XSCALE, .fifosize = 32 } , { - .membase = (char*)(IQ80331_UART1_VIRT), - .mapbase = (IQ80331_UART1_PHYS), + .membase = (char*)(IOP331_UART1_VIRT), + .mapbase = (IOP331_UART1_PHYS), .irq = IRQ_IOP331_UART1, .flags = UPF_SKIP_TEST, .iotype = UPIO_MEM, @@ -72,6 +72,60 @@ static struct uart_port iop331_serial_ports[] = { } }; +static struct resource iop33x_i2c_0_resources[] = { + [0] = { + .start = 0xfffff680, + .end = 0xfffff698, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP331_I2C_0, + .end = IRQ_IOP331_I2C_0, + .flags = IORESOURCE_IRQ + } +}; + +static struct resource iop33x_i2c_1_resources[] = { + [0] = { + .start = 0xfffff6a0, + .end = 0xfffff6b8, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP331_I2C_1, + .end = IRQ_IOP331_I2C_1, + .flags = IORESOURCE_IRQ + } +}; + +static struct platform_device iop33x_i2c_0_controller = { + .name = "IOP3xx-I2C", + .id = 0, + .num_resources = 2, + .resource = iop33x_i2c_0_resources +}; + +static struct platform_device iop33x_i2c_1_controller = { + .name = "IOP3xx-I2C", + .id = 1, + .num_resources = 2, + .resource = iop33x_i2c_1_resources +}; + +static struct platform_device *iop33x_devices[] __initdata = { + &iop33x_i2c_0_controller, + &iop33x_i2c_1_controller +}; + +void __init iop33x_init(void) +{ + if(iop_is_331()) + { + platform_add_devices(iop33x_devices, + ARRAY_SIZE(iop33x_devices)); + } +} + void __init iop331_map_io(void) { iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc)); @@ -79,22 +133,43 @@ void __init iop331_map_io(void) early_serial_setup(&iop331_serial_ports[1]); } -#ifdef CONFIG_ARCH_IQ80331 +#ifdef CONFIG_ARCH_IOP331 extern void iop331_init_irq(void); -extern void iop331_init_time(void); +extern struct sys_timer iop331_timer; +#endif + +#ifdef CONFIG_ARCH_IQ80331 extern void iq80331_map_io(void); #endif +#ifdef CONFIG_MACH_IQ80332 +extern void iq80332_map_io(void); +#endif + #if defined(CONFIG_ARCH_IQ80331) MACHINE_START(IQ80331, "Intel IQ80331") MAINTAINER("Intel Corp.") BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical - //BOOT_MEM(PHYS_OFFSET, IQ80331_UART0_VIRT, IQ80331_UART0_PHYS) + //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) MAPIO(iq80331_map_io) INITIRQ(iop331_init_irq) - INITTIME(iop331_init_time) + .timer = &iop331_timer, BOOT_PARAMS(0x0100) + INIT_MACHINE(iop33x_init) MACHINE_END + +#elif defined(CONFIG_MACH_IQ80332) +MACHINE_START(IQ80332, "Intel IQ80332") + MAINTAINER("Intel Corp.") + BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical + //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) + MAPIO(iq80332_map_io) + INITIRQ(iop331_init_irq) + .timer = &iop331_timer, + BOOT_PARAMS(0x0100) + INIT_MACHINE(iop33x_init) +MACHINE_END + #else #error No machine descriptor defined for this IOP3XX implementation #endif diff --git a/arch/arm/mach-iop3xx/iop331-time.c b/arch/arm/mach-iop3xx/iop331-time.c index c90a0c9bd..e01696769 100644 --- a/arch/arm/mach-iop3xx/iop331-time.c +++ b/arch/arm/mach-iop3xx/iop331-time.c @@ -27,13 +27,9 @@ #include #include -#undef IOP331_TIME_SYNC - -static unsigned long iop331_latch; - static inline unsigned long get_elapsed(void) { - return iop331_latch - *IOP331_TU_TCR0; + return LATCH - *IOP331_TU_TCR0; } static unsigned long iop331_gettimeoffset(void) @@ -55,14 +51,14 @@ static unsigned long iop331_gettimeoffset(void) asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr2)); if(tisr1 & 1) - elapsed += iop331_latch; + elapsed += LATCH; else if (tisr2 & 1) - elapsed = iop331_latch + get_elapsed(); + elapsed = LATCH + get_elapsed(); /* * Now convert them to usec. */ - usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / iop331_latch; + usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH; return usec; } @@ -71,36 +67,16 @@ static irqreturn_t iop331_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 tisr; -#ifdef IOP331_TIME_SYNC - u32 passed; -#define TM_THRESH (iop331_latch*2) -#endif - asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr)); + write_seqlock(&xtime_lock); + asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr)); tisr |= 1; - asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr)); -#ifdef IOP331_TIME_SYNC - passed = 0xffffffff - *IOP331_TU_TCR1; - - do - { - do_timer(regs); - if(passed < TM_THRESH) - break; - if(passed > iop331_latch) - passed -= iop331_latch; - else - passed = 0; - } while(1); - - asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (0xffffffff)); -#else - do_timer(regs); -#endif + timer_tick(regs); + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -110,32 +86,22 @@ static struct irqaction iop331_timer_irq = { .flags = SA_INTERRUPT }; -extern int setup_arm_irq(int, struct irqaction*); - -void __init iop331_init_time(void) +static void __init iop331_timer_init(void) { u32 timer_ctl; - iop331_latch = (CLOCK_TICK_RATE + HZ / 2) / HZ; - gettimeoffset = iop331_gettimeoffset; setup_irq(IRQ_IOP331_TIMER0, &iop331_timer_irq); timer_ctl = IOP331_TMR_EN | IOP331_TMR_PRIVILEGED | IOP331_TMR_RELOAD | IOP331_TMR_RATIO_1_1; - asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (iop331_latch)); + asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (LATCH)); asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (timer_ctl)); -#ifdef IOP331_TIME_SYNC - /* Setup second timer */ - /* setup counter */ - timer_ctl = IOP331_TMR_EN | IOP331_TMR_PRIVILEGED | - IOP331_TMR_RATIO_1_1; - asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (0xffffffff)); - /* setup control */ - asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (timer_ctl)); -#endif } - +struct sys_timer iop331_timer = { + .init = iop331_timer_init, + .offset = iop331_gettimeoffset, +}; diff --git a/arch/arm/mach-iop3xx/iq31244-pci.c b/arch/arm/mach-iop3xx/iq31244-pci.c index 5eac93eb9..f997daa80 100644 --- a/arch/arm/mach-iop3xx/iq31244-pci.c +++ b/arch/arm/mach-iop3xx/iq31244-pci.c @@ -5,6 +5,7 @@ * * Author: Rory Bolt * 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 @@ -77,28 +78,25 @@ static int iq31244_setup(int nr, struct pci_sys_data *sys) memset(res, 0, sizeof(struct resource) * 2); - res[0].start = IQ31244_PCI_IO_BASE + 0x6e000000; - res[0].end = IQ31244_PCI_IO_BASE + IQ31244_PCI_IO_SIZE - 1 + IQ31244_PCI_IO_OFFSET; + res[0].start = IOP321_PCI_LOWER_IO_VA; + res[0].end = IOP321_PCI_UPPER_IO_VA; res[0].name = "IQ31244 PCI I/O Space"; res[0].flags = IORESOURCE_IO; - res[1].start = IQ31244_PCI_MEM_BASE; - res[1].end = IQ31244_PCI_MEM_BASE + IQ31244_PCI_MEM_SIZE; + res[1].start = IOP321_PCI_LOWER_MEM_PA; + res[1].end = IOP321_PCI_UPPER_MEM_PA; res[1].name = "IQ31244 PCI Memory Space"; res[1].flags = IORESOURCE_MEM; request_resource(&ioport_resource, &res[0]); request_resource(&iomem_resource, &res[1]); + sys->mem_offset = IOP321_PCI_MEM_OFFSET; + sys->io_offset = IOP321_PCI_IO_OFFSET; + sys->resource[0] = &res[0]; sys->resource[1] = &res[1]; sys->resource[2] = NULL; - sys->io_offset = IQ31244_PCI_IO_OFFSET; - sys->mem_offset = IQ80321_PCI_MEM_BASE - - (*IOP321_IABAR1 & PCI_BASE_ADDRESS_MEM_MASK); - - iop3xx_pcibios_min_io = IQ31244_PCI_IO_BASE; - iop3xx_pcibios_min_mem = IQ31244_PCI_MEM_BASE; return 1; } @@ -106,9 +104,6 @@ static int iq31244_setup(int nr, struct pci_sys_data *sys) static void iq31244_preinit(void) { iop321_init(); - /* setting up the second translation window */ - *IOP321_OMWTVR1 = IQ31244_PCI_MEM_BASE + 0x04000000; - *IOP321_OUMWTVR1 = 0x0; } static struct hw_pci iq31244_pci __initdata = { diff --git a/arch/arm/mach-iop3xx/iq80321-pci.c b/arch/arm/mach-iop3xx/iq80321-pci.c index 5d9624863..79fea3d20 100644 --- a/arch/arm/mach-iop3xx/iq80321-pci.c +++ b/arch/arm/mach-iop3xx/iq80321-pci.c @@ -5,6 +5,7 @@ * * Author: Rory Bolt * 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 @@ -71,44 +72,25 @@ static int iq80321_setup(int nr, struct pci_sys_data *sys) memset(res, 0, sizeof(struct resource) * 2); - res[0].start = IQ80321_PCI_IO_BASE + IQ80321_PCI_IO_OFFSET; - res[0].end = IQ80321_PCI_IO_BASE + IQ80321_PCI_IO_SIZE - 1 + IQ80321_PCI_IO_OFFSET; + res[0].start = IOP321_PCI_LOWER_IO_VA; + res[0].end = IOP321_PCI_UPPER_IO_VA; res[0].name = "IQ80321 PCI I/O Space"; res[0].flags = IORESOURCE_IO; - res[1].start = IQ80321_PCI_MEM_BASE; - res[1].end = IQ80321_PCI_MEM_BASE + IQ80321_PCI_MEM_SIZE; + res[1].start = IOP321_PCI_LOWER_MEM_PA; + res[1].end = IOP321_PCI_UPPER_MEM_PA; res[1].name = "IQ80321 PCI Memory Space"; res[1].flags = IORESOURCE_MEM; request_resource(&ioport_resource, &res[0]); request_resource(&iomem_resource, &res[1]); - /* - * Since the IQ80321 is a slave card on a PCI backplane, - * it uses BAR1 to reserve a portion of PCI memory space for - * use with the private devices on the secondary bus - * (GigE and PCI-X slot). We read BAR1 and configure - * our outbound translation windows to target that - * address range and assign all devices in that - * address range. W/O this, certain BIOSes will fail - * to boot as the IQ80321 claims addresses that are - * in use by other devices. - * - * Note that the same cannot be done with I/O space, - * so hopefully the host will stick to the lower 64K for - * PCI I/O and leave us alone. - */ - sys->mem_offset = IQ80321_PCI_MEM_BASE - - (*IOP321_IABAR1 & PCI_BASE_ADDRESS_MEM_MASK); + sys->mem_offset = IOP321_PCI_MEM_OFFSET; + sys->io_offset = IOP321_PCI_IO_OFFSET; sys->resource[0] = &res[0]; sys->resource[1] = &res[1]; sys->resource[2] = NULL; - sys->io_offset = IQ80321_PCI_IO_OFFSET; - - iop3xx_pcibios_min_io = IQ80321_PCI_IO_BASE; - iop3xx_pcibios_min_mem = IQ80321_PCI_MEM_BASE; return 1; } diff --git a/arch/arm/mach-iop3xx/iq80331-pci.c b/arch/arm/mach-iop3xx/iq80331-pci.c index 1eff5573d..f37a0e26b 100644 --- a/arch/arm/mach-iop3xx/iq80331-pci.c +++ b/arch/arm/mach-iop3xx/iq80331-pci.c @@ -4,7 +4,7 @@ * PCI support for the Intel IQ80331 reference board * * Author: Dave Jiang - * Copyright (C) 2003 Intel Corp. + * Copyright (C) 2003, 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 @@ -68,44 +68,25 @@ static int iq80331_setup(int nr, struct pci_sys_data *sys) memset(res, 0, sizeof(struct resource) * 2); - res[0].start = IQ80331_PCI_IO_BASE + 0x6e000000; - res[0].end = IQ80331_PCI_IO_BASE + IQ80331_PCI_IO_SIZE - 1 + IQ80331_PCI_IO_OFFSET; + res[0].start = IOP331_PCI_LOWER_IO_VA; + res[0].end = IOP331_PCI_UPPER_IO_VA; res[0].name = "IQ80331 PCI I/O Space"; res[0].flags = IORESOURCE_IO; - res[1].start = IQ80331_PCI_MEM_BASE; - res[1].end = IQ80331_PCI_MEM_BASE + IQ80331_PCI_MEM_SIZE; + res[1].start = IOP331_PCI_LOWER_MEM_PA; + res[1].end = IOP331_PCI_UPPER_MEM_PA; res[1].name = "IQ80331 PCI Memory Space"; res[1].flags = IORESOURCE_MEM; request_resource(&ioport_resource, &res[0]); request_resource(&iomem_resource, &res[1]); - /* - * Since the IQ80331 is a slave card on a PCI backplane, - * it uses BAR1 to reserve a portion of PCI memory space for - * use with the private devices on the secondary bus - * (GigE and PCI-X slot). We read BAR1 and configure - * our outbound translation windows to target that - * address range and assign all devices in that - * address range. W/O this, certain BIOSes will fail - * to boot as the IQ80331 claims addresses that are - * in use by other devices. - * - * Note that the same cannot be done with I/O space, - * so hopefully the host will stick to the lower 64K for - * PCI I/O and leave us alone. - */ - sys->mem_offset = IQ80331_PCI_MEM_BASE - - (*IOP331_IABAR1 & PCI_BASE_ADDRESS_MEM_MASK); + sys->mem_offset = IOP331_PCI_MEM_OFFSET; + sys->io_offset = IOP331_PCI_IO_OFFSET; sys->resource[0] = &res[0]; sys->resource[1] = &res[1]; sys->resource[2] = NULL; - sys->io_offset = IQ80331_PCI_IO_OFFSET; - - iop3xx_pcibios_min_io = IQ80331_PCI_IO_BASE; - iop3xx_pcibios_min_mem = IQ80331_PCI_MEM_BASE; return 1; } diff --git a/arch/arm/mach-ixp2000/Kconfig b/arch/arm/mach-ixp2000/Kconfig index a22d220d6..9361e05f6 100644 --- a/arch/arm/mach-ixp2000/Kconfig +++ b/arch/arm/mach-ixp2000/Kconfig @@ -14,21 +14,21 @@ config ARCH_ENP2611 help Say 'Y' here if you want your kernel to support the Radisys ENP2611 PCI network processing card. For more information on - this card, see Documentation/arm/ENP2611. + this card, see . config ARCH_IXDP2400 bool "Support Intel IXDP2400" help Say 'Y' here if you want your kernel to support the Intel IXDP2400 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2800 bool "Support Intel IXDP2800" help Say 'Y' here if you want your kernel to support the Intel IXDP2800 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2X00 bool @@ -40,14 +40,14 @@ config ARCH_IXDP2401 help Say 'Y' here if you want your kernel to support the Intel IXDP2401 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2801 bool "Support Intel IXDP2801" help Say 'Y' here if you want your kernel to support the Intel IXDP2801 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2X01 bool diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c index 2d6633751..36d9eceda 100644 --- a/arch/arm/mach-ixp2000/core.c +++ b/arch/arm/mach-ixp2000/core.c @@ -9,7 +9,7 @@ * * Based on work Copyright (C) 2002-2003 Intel Corporation * - * This file is licensed under the terms of the GNU General Public + * 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. */ @@ -33,16 +33,14 @@ #include #include #include -#include #include #include -#include #include #include #include -static spinlock_t ixp2000_slowport_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ixp2000_slowport_lock); static unsigned long ixp2000_slowport_irq_flags; /************************************************************************* @@ -162,6 +160,9 @@ void __init ixp2000_map_io(void) iotable_init(ixp2000_small_io_desc, ARRAY_SIZE(ixp2000_small_io_desc)); iotable_init(ixp2000_large_io_desc, ARRAY_SIZE(ixp2000_large_io_desc)); early_serial_setup(&ixp2000_serial_port); + + /* Set slowport to 8-bit mode. */ + ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1); } /************************************************************************* @@ -169,23 +170,30 @@ void __init ixp2000_map_io(void) *************************************************************************/ static unsigned ticks_per_jiffy; static unsigned ticks_per_usec; +static unsigned next_jiffy_time; -static unsigned long ixp2000_gettimeoffset (void) +unsigned long ixp2000_gettimeoffset (void) { - unsigned long elapsed; + unsigned long offset; - /* Get ticks since last perfect jiffy */ - elapsed = ticks_per_jiffy - *IXP2000_T1_CSR; + offset = next_jiffy_time - *IXP2000_T4_CSR; - return elapsed / ticks_per_usec; + return offset / ticks_per_usec; } static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + /* clear timer 1 */ ixp2000_reg_write(IXP2000_T1_CLR, 1); - timer_tick(regs); + while ((next_jiffy_time - *IXP2000_T4_CSR) > ticks_per_jiffy) { + timer_tick(regs); + next_jiffy_time -= ticks_per_jiffy; + } + + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -198,10 +206,8 @@ static struct irqaction ixp2000_timer_irq = { void __init ixp2000_init_time(unsigned long tick_rate) { - gettimeoffset = ixp2000_gettimeoffset; - ixp2000_reg_write(IXP2000_T1_CLR, 0); - ixp2000_reg_write(IXP2000_T2_CLR, 0); + ixp2000_reg_write(IXP2000_T4_CLR, 0); ticks_per_jiffy = (tick_rate + HZ/2) / HZ; ticks_per_usec = tick_rate / 1000000; @@ -209,6 +215,13 @@ void __init ixp2000_init_time(unsigned long tick_rate) ixp2000_reg_write(IXP2000_T1_CLD, ticks_per_jiffy); ixp2000_reg_write(IXP2000_T1_CTL, (1 << 7)); + /* + * We use T4 as a monotonic counter to track missed jiffies + */ + ixp2000_reg_write(IXP2000_T4_CLD, -1); + ixp2000_reg_write(IXP2000_T4_CTL, (1 << 7)); + next_jiffy_time = 0xffffffff - ticks_per_jiffy; + /* register for interrupt */ setup_irq(IRQ_IXP2000_TIMER1, &ixp2000_timer_irq); } @@ -309,41 +322,6 @@ static struct irqchip ixp2000_pci_irq_chip = { .unmask = ixp2000_pci_irq_unmask }; -/* - * Error interrupts. These are used extensively by the microengine drivers - */ -static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) -{ - int i; - unsigned long status = *IXP2000_IRQ_ERR_STATUS; - - - for (i = 0; i <= 12; i++) { - if (status & (1 << i)) { - desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i; - desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); - } - } -} - -static void ixp2000_err_irq_mask(unsigned int irq) -{ - ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR, - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); -} - -static void ixp2000_err_irq_unmask(unsigned int irq) -{ - ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET, - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); -} - -static struct irqchip ixp2000_err_irq_chip = { - .ack = ixp2000_err_irq_mask, - .mask = ixp2000_err_irq_mask, - .unmask = ixp2000_err_irq_unmask -}; - static void ixp2000_irq_mask(unsigned int irq) { ixp2000_reg_write(IXP2000_IRQ_ENABLE_CLR, (1 << irq)); @@ -387,7 +365,7 @@ void __init ixp2000_init_irq(void) * we mark the reserved IRQs as invalid. This makes * our mask/unmask code much simpler. */ - for (irq = IRQ_IXP2000_SWI; irq <= IRQ_IXP2000_THDB3; irq++) { + for (irq = IRQ_IXP2000_SOFT_INT; irq <= IRQ_IXP2000_THDB3; irq++) { if((1 << irq) & IXP2000_VALID_IRQ_MASK) { set_irq_chip(irq, &ixp2000_irq_chip); set_irq_handler(irq, do_level_IRQ); @@ -409,18 +387,11 @@ void __init ixp2000_init_irq(void) /* * Enable PCI irq */ - *(IXP2000_IRQ_ENABLE_SET) = (1 << IRQ_IXP2000_PCI); + ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << IRQ_IXP2000_PCI)); for (irq = IRQ_IXP2000_PCIA; irq <= IRQ_IXP2000_PCIB; irq++) { set_irq_chip(irq, &ixp2000_pci_irq_chip); set_irq_handler(irq, do_level_IRQ); set_irq_flags(irq, IRQF_VALID); } - - for (irq = IRQ_IXP2000_DRAM0_MIN_ERR; irq <= IRQ_IXP2000_SP_INT; irq++) { - set_irq_chip(irq, &ixp2000_err_irq_chip); - set_irq_handler(irq, do_level_IRQ); - set_irq_flags(irq, IRQF_VALID); - } - set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler); } diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c index a6e30d079..e4d2992d9 100644 --- a/arch/arm/mach-ixp2000/enp2611.c +++ b/arch/arm/mach-ixp2000/enp2611.c @@ -26,9 +26,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -55,11 +52,16 @@ /************************************************************************* * ENP-2611 timer tick configuration *************************************************************************/ -static void __init enp2611_init_time(void) +static void __init enp2611_timer_init(void) { ixp2000_init_time(50 * 1000 * 1000); } +static struct sys_timer enp2611_timer = { + .init = enp2611_timer_init, + .offset = ixp2000_gettimeoffset, +}; + /************************************************************************* * ENP-2611 PCI @@ -122,20 +124,28 @@ static int __init enp2611_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { int irq; - if (dev->bus->number == 0x00 && PCI_SLOT(dev->devfn) == 0x01) { + if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 0) { + /* IXP2400. */ + irq = IRQ_IXP2000_PCIA; + } else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 1) { /* 21555 non-transparent bridge. */ irq = IRQ_IXP2000_PCIB; - } else if (dev->bus->number == 0x01 && PCI_SLOT(dev->devfn) == 0x00) { + } else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 4) { + /* PCI2050B transparent bridge. */ + irq = -1; + } else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 0) { /* 82559 ethernet. */ irq = IRQ_IXP2000_PCIA; + } else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 1) { + /* SPI-3 option board. */ + irq = IRQ_IXP2000_PCIB; } else { - printk(KERN_INFO "enp2611_pci_map_irq for unknown device\n"); - irq = IRQ_IXP2000_PCI; + printk(KERN_ERR "enp2611_pci_map_irq() called for unknown " + "device PCI:%d:%d:%d\n", dev->bus->number, + PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); + irq = -1; } - printk(KERN_INFO "Assigned IRQ %d to PCI:%d:%d:%d\n", irq, - dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - return irq; } @@ -149,7 +159,9 @@ struct hw_pci enp2611_pci __initdata = { int __init enp2611_pci_init(void) { - pci_common_init(&enp2611_pci); + if (machine_is_enp2611()) + pci_common_init(&enp2611_pci); + return 0; } @@ -202,7 +214,7 @@ MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board") BOOT_PARAMS(0x00000100) MAPIO(ixp2000_map_io) INITIRQ(ixp2000_init_irq) - INITTIME(enp2611_init_time) + .timer = &enp2611_timer, INIT_MACHINE(enp2611_init_machine) MACHINE_END #endif diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c index 39ef558df..df3ff26c8 100644 --- a/arch/arm/mach-ixp2000/ixdp2400.c +++ b/arch/arm/mach-ixp2000/ixdp2400.c @@ -23,9 +23,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -48,7 +45,7 @@ /************************************************************************* * IXDP2400 timer tick *************************************************************************/ -static void __init ixdp2400_init_time(void) +static void __init ixdp2400_timer_init(void) { int numerator, denominator; int denom_array[] = {2, 4, 8, 16, 1, 2, 4, 8}; @@ -59,6 +56,11 @@ static void __init ixdp2400_init_time(void) ixp2000_init_time(((3125000 * numerator) / (denominator)) / 2); } +static struct sys_timer ixdp2400_timer = { + .init = ixdp2400_timer_init, + .offset = ixp2000_gettimeoffset, +}; + /************************************************************************* * IXDP2400 PCI *************************************************************************/ @@ -171,7 +173,7 @@ MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform") BOOT_PARAMS(0x00000100) MAPIO(ixdp2x00_map_io) INITIRQ(ixdp2400_init_irq) - INITTIME(ixdp2400_init_time) + .timer = &ixdp2400_timer, INIT_MACHINE(ixdp2x00_init_machine) MACHINE_END diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c index 285eaf016..c4683aaff 100644 --- a/arch/arm/mach-ixp2000/ixdp2800.c +++ b/arch/arm/mach-ixp2000/ixdp2800.c @@ -23,9 +23,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -55,11 +52,16 @@ void ixdp2400_init_irq(void) * IXDP2800 timer tick *************************************************************************/ -static void __init ixdp2800_init_time(void) +static void __init ixdp2800_timer_init(void) { ixp2000_init_time(50000000); } +static struct sys_timer ixdp2800_timer = { + .init = ixdp2800_timer_init, + .offset = ixp2000_gettimeoffset, +}; + /************************************************************************* * IXDP2800 PCI *************************************************************************/ @@ -111,7 +113,7 @@ static int __init ixdp2800_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) * Device behind the first bridge */ if(dev->bus->self->devfn == IXDP2X00_P2P_DEVFN) { - switch(PCI_SLOT(dev->devfn)) { + switch(dev->devfn) { case IXDP2X00_PMC_DEVFN: return IRQ_IXDP2800_PMC; @@ -172,7 +174,7 @@ MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform") BOOT_PARAMS(0x00000100) MAPIO(ixdp2x00_map_io) INITIRQ(ixdp2800_init_irq) - INITTIME(ixdp2800_init_time) + .timer = &ixdp2800_timer, INIT_MACHINE(ixdp2x00_init_machine) MACHINE_END diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c index cda60b74c..21c41fe15 100644 --- a/arch/arm/mach-ixp2000/ixdp2x00.c +++ b/arch/arm/mach-ixp2000/ixdp2x00.c @@ -23,9 +23,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -94,7 +91,7 @@ static void ixdp2x00_irq_unmask(unsigned int irq) unsigned long dummy; static struct slowport_cfg old_cfg; -#ifdef CONFGI_ARCH_IXDP2400 +#ifdef CONFIG_ARCH_IXDP2400 if (machine_is_ixdp2400()) ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg); #endif @@ -197,7 +194,7 @@ void __init ixdp2x00_map_io(void) * Linux is a common design in telecom systems. The problem is that instead * of all the devices being controlled by a single host, different * devices are controlles by different NPUs on the same bus, leading to - * multiple hosts on the bus.i The exact bus layout looks like: + * multiple hosts on the bus. The exact bus layout looks like: * * Bus 0 * Master NPU <-------------------+-------------------> Slave NPU @@ -213,9 +210,9 @@ void __init ixdp2x00_map_io(void) * ... Dev PMC Media Eth0 Eth1 ... * * The master controlls all but Eth1, which is controlled by the - * slave. What this measn is that the both the master and the slave + * slave. What this means is that the both the master and the slave * have to scan the bus, but only one of them can enumerate the bus. - * In addition, after the bus is scaned, each kernel must remove + * In addition, after the bus is scanned, each kernel must remove * the device(s) it does not control from the PCI dev list otherwise * a driver on each NPU will try to manage it and we will have horrible * conflicts. Oh..and the slave NPU needs to see the master NPU diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c index 176114aad..0e919bbf9 100644 --- a/arch/arm/mach-ixp2000/ixdp2x01.c +++ b/arch/arm/mach-ixp2000/ixdp2x01.c @@ -23,9 +23,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -54,12 +51,14 @@ *************************************************************************/ static void ixdp2x01_irq_mask(unsigned int irq) { - *IXDP2X01_INT_MASK_SET_REG = IXP2000_BOARD_IRQ_MASK(irq); + ixp2000_reg_write(IXDP2X01_INT_MASK_SET_REG, + IXP2000_BOARD_IRQ_MASK(irq)); } static void ixdp2x01_irq_unmask(unsigned int irq) { - *IXDP2X01_INT_MASK_CLR_REG = IXP2000_BOARD_IRQ_MASK(irq); + ixp2000_reg_write(IXDP2X01_INT_MASK_CLR_REG, + IXP2000_BOARD_IRQ_MASK(irq)); } static u32 valid_irq_mask; @@ -114,8 +113,8 @@ void __init ixdp2x01_init_irq(void) valid_irq_mask = IXDP2801_VALID_IRQ_MASK; /* Mask all interrupts from CPLD, disable simulation */ - *IXDP2X01_INT_MASK_SET_REG = 0xffffffff; - *IXDP2X01_INT_SIM_REG = 0; + ixp2000_reg_write(IXDP2X01_INT_MASK_SET_REG, 0xffffffff); + ixp2000_reg_write(IXDP2X01_INT_SIM_REG, 0); for (irq = NR_IXP2000_IRQS; irq < NR_IXDP2X01_IRQS; irq++) { if (irq & valid_irq_mask) { @@ -193,7 +192,7 @@ static int __init ixdp2x01_clock_setup(char *str) __setup("ixdp2x01_clock=", ixdp2x01_clock_setup); -static void __init ixdp2x01_init_time(void) +static void __init ixdp2x01_timer_init(void) { if (!ixdp2x01_clock) ixdp2x01_clock = 50000000; @@ -201,6 +200,11 @@ static void __init ixdp2x01_init_time(void) ixp2000_init_time(ixdp2x01_clock); } +static struct sys_timer ixdp2x01_timer = { + .init = ixdp2x01_timer_init, + .offset = ixp2000_gettimeoffset, +}; + /************************************************************************* * IXDP2x01 PCI *************************************************************************/ @@ -312,8 +316,8 @@ static struct flash_platform_data ixdp2x01_flash_platform_data = { static unsigned long ixdp2x01_flash_bank_setup(unsigned long ofs) { - *IXDP2X01_CPLD_FLASH_REG = - ((ofs >> IXDP2X01_FLASH_WINDOW_BITS) | IXDP2X01_CPLD_FLASH_INTERN); + ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG, + ((ofs >> IXDP2X01_FLASH_WINDOW_BITS) | IXDP2X01_CPLD_FLASH_INTERN)); return (ofs & IXDP2X01_FLASH_WINDOW_MASK); } @@ -338,14 +342,29 @@ static struct platform_device ixdp2x01_flash = { .resource = &ixdp2x01_flash_resource, }; +static struct ixp2000_i2c_pins ixdp2x01_i2c_gpio_pins = { + .sda_pin = IXDP2X01_GPIO_SDA, + .scl_pin = IXDP2X01_GPIO_SCL, +}; + +static struct platform_device ixdp2x01_i2c_controller = { + .name = "IXP2000-I2C", + .id = 0, + .dev = { + .platform_data = &ixdp2x01_i2c_gpio_pins, + }, + .num_resources = 0 +}; + static struct platform_device *ixdp2x01_devices[] __initdata = { - &ixdp2x01_flash + &ixdp2x01_flash, + &ixdp2x01_i2c_controller }; static void __init ixdp2x01_init_machine(void) { - *IXDP2X01_CPLD_FLASH_REG = - (IXDP2X01_CPLD_FLASH_BANK_MASK | IXDP2X01_CPLD_FLASH_INTERN); + ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG, + (IXDP2X01_CPLD_FLASH_BANK_MASK | IXDP2X01_CPLD_FLASH_INTERN)); ixdp2x01_flash_data.nr_banks = ((*IXDP2X01_CPLD_FLASH_REG & IXDP2X01_CPLD_FLASH_BANK_MASK) + 1); @@ -361,7 +380,7 @@ MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") BOOT_PARAMS(0x00000100) MAPIO(ixdp2x01_map_io) INITIRQ(ixdp2x01_init_irq) - INITTIME(ixdp2x01_init_time) + .timer = &ixdp2x01_timer, INIT_MACHINE(ixdp2x01_init_machine) MACHINE_END #endif @@ -373,7 +392,7 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform") BOOT_PARAMS(0x00000100) MAPIO(ixdp2x01_map_io) INITIRQ(ixdp2x01_init_irq) - INITTIME(ixdp2x01_init_time) + .timer = &ixdp2x01_timer, INIT_MACHINE(ixdp2x01_init_machine) MACHINE_END #endif diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c index d08cebe00..831f8ffb6 100644 --- a/arch/arm/mach-ixp2000/pci.c +++ b/arch/arm/mach-ixp2000/pci.c @@ -142,23 +142,24 @@ int ixp2000_pci_abort_handler(unsigned long addr, unsigned int fsr, struct pt_re { volatile u32 temp; + unsigned long flags; pci_master_aborts = 1; - cli(); + local_irq_save(flags); temp = *(IXP2000_PCI_CONTROL); if (temp & ((1 << 8) | (1 << 5))) { - *(IXP2000_PCI_CONTROL) = temp; + ixp2000_reg_write(IXP2000_PCI_CONTROL, temp); } temp = *(IXP2000_PCI_CMDSTAT); if (temp & (1 << 29)) { while (temp & (1 << 29)) { - *(IXP2000_PCI_CMDSTAT) = temp; + ixp2000_reg_write(IXP2000_PCI_CMDSTAT, temp); temp = *(IXP2000_PCI_CMDSTAT); } } - sti(); + local_irq_restore(flags); /* * If it was an imprecise abort, then we need to correct the @@ -174,21 +175,22 @@ int clear_master_aborts(void) { volatile u32 temp; + unsigned long flags; - cli(); + local_irq_save(flags); temp = *(IXP2000_PCI_CONTROL); if (temp & ((1 << 8) | (1 << 5))) { - *(IXP2000_PCI_CONTROL) = temp; + ixp2000_reg_write(IXP2000_PCI_CONTROL, temp); } temp = *(IXP2000_PCI_CMDSTAT); if (temp & (1 << 29)) { while (temp & (1 << 29)) { - *(IXP2000_PCI_CMDSTAT) = temp; + ixp2000_reg_write(IXP2000_PCI_CMDSTAT, temp); temp = *(IXP2000_PCI_CMDSTAT); } } - sti(); + local_irq_restore(flags); return 0; } diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 46b72e106..aacb5f920 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig @@ -13,22 +13,37 @@ config ARCH_AVILA help Say 'Y' here if you want your kernel to support the Gateworks Avila Network Platform. For more information on this platform, - see Documentation/arm/IXP4xx. + see . config ARCH_ADI_COYOTE bool "Coyote" help Say 'Y' here if you want your kernel to support the ADI Engineering Coyote Gateway Reference Platform. For more - information on this platform, see Documentation/arm/IXP4xx. + information on this platform, see . config ARCH_IXDP425 bool "IXDP425" help Say 'Y' here if you want your kernel to support Intel's IXDP425 Development Platform (Also known as Richfield). + For more information on this platform, see . + +config MACH_IXDPG425 + bool "IXDPG425" + help + Say 'Y' here if you want your kernel to support Intel's + IXDPG425 Development Platform (Also known as Montajade). + For more information on this platform, see . + +config MACH_IXDP465 + bool "IXDP465" + help + Say 'Y' here if you want your kernel to support Intel's + IXDP465 Development Platform (Also known as BMP). For more information on this platform, see Documentation/arm/IXP4xx. + # # IXCDP1100 is the exact same HW as IXDP425, but with a different machine # number from the bootloader due to marketing monkeys, so we just enable it @@ -44,16 +59,42 @@ config ARCH_PRPMC1100 help Say 'Y' here if you want your kernel to support the Motorola PrPCM1100 Processor Mezanine Module. For more information on - this platform, see Documentation/arm/IXP4xx. + this platform, see . # # Avila and IXDP share the same source for now. Will change in future # config ARCH_IXDP4XX bool - depends on ARCH_IXDP425 || ARCH_AVILA + depends on ARCH_IXDP425 || ARCH_AVILA || MACH_IXDP465 + default y + +# +# Certain registers and IRQs are only enabled if supporting IXP465 CPUs +# +config CPU_IXP46X + bool + depends on MACH_IXDP465 default y +config MACH_GTWX5715 + bool "Gemtek WX5715 (Linksys WRV54G)" + depends on ARCH_IXP4XX + help + This board is currently inside the Linksys WRV54G Gateways. + + IXP425 - 266mhz + 32mb SDRAM + 8mb Flash + miniPCI slot 0 does not have a card connector soldered to the board + miniPCI slot 1 has an ISL3880 802.11g card (Prism54) + npe0 is connected to a Kendin KS8995M Switch (4 ports) + npe1 is the "wan" port + "Console" UART is available on J11 as console + "High Speed" UART is n/c (as far as I can tell) + 20 Pin ARM/Xscale JTAG interface on J2 + + comment "IXP4xx Options" config IXP4XX_INDIRECT_PCI @@ -64,7 +105,7 @@ config IXP4XX_INDIRECT_PCI 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB). To access PCI via this space, we simply ioremap() the BAR into the kernel and we can use the standard read[bwl]/write[bwl] - macros. This is the preffered method due to speed but it + macros. This is the preferred method due to speed but it limits the system to just 64MB of PCI memory. This can be problamatic if using video cards and other memory-heavy devices. diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile index f656397f8..16ecbb0f1 100644 --- a/arch/arm/mach-ixp4xx/Makefile +++ b/arch/arm/mach-ixp4xx/Makefile @@ -5,6 +5,8 @@ obj-y += common.o common-pci.o obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o ixdp425-setup.o +obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o obj-$(CONFIG_ARCH_PRPMC1100) += prpmc1100-pci.o prpmc1100-setup.o +obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index 664521892..94bcdb933 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c @@ -33,7 +33,6 @@ #include #include #include -#include /* @@ -54,7 +53,7 @@ unsigned long ixp4xx_pci_reg_base = 0; * these transactions are atomic or we will end up * with corrupt data on the bus or in a driver. */ -static spinlock_t ixp4xx_pci_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ixp4xx_pci_lock); /* * Read from PCI config space @@ -239,9 +238,10 @@ static u32 byte_lane_enable_bits(u32 n, int size) return 0xffffffff; } -static int read_config(u8 bus_num, u16 devfn, int where, int size, u32 *value) +static int ixp4xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { u32 n, byte_enables, addr, data; + u8 bus_num = bus->number; pr_debug("read_config from %d size %d dev %d:%d:%d\n", where, size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn)); @@ -261,9 +261,10 @@ static int read_config(u8 bus_num, u16 devfn, int where, int size, u32 *value) return PCIBIOS_SUCCESSFUL; } -static int write_config(u8 bus_num, u16 devfn, int where, int size, u32 value) +static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { u32 n, byte_enables, addr, data; + u8 bus_num = bus->number; pr_debug("write_config_byte %#x to %d size %d dev %d:%d:%d\n", value, where, size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn)); @@ -281,31 +282,11 @@ static int write_config(u8 bus_num, u16 devfn, int where, int size, u32 value) return PCIBIOS_SUCCESSFUL; } -/* - * Generalized PCI config access functions. - */ -static int ixp4xx_read_config(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 *value) -{ - if (bus->number && !PCI_SLOT(devfn)) - return local_read_config(where, size, value); - return read_config(bus->number, devfn, where, size, value); -} - -static int ixp4xx_write_config(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 value) -{ - if (bus->number && !PCI_SLOT(devfn)) - return local_write_config(where, size, value); - return write_config(bus->number, devfn, where, size, value); -} - struct pci_ops ixp4xx_ops = { - .read = ixp4xx_read_config, - .write = ixp4xx_write_config, + .read = ixp4xx_pci_read_config, + .write = ixp4xx_pci_write_config, }; - /* * PCI abort handler */ @@ -367,10 +348,11 @@ void __init ixp4xx_pci_preinit(void) asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :); /* - * Determine which PCI read method to use + * Determine which PCI read method to use. + * Rev 0 IXP425 requires workaround. */ - if (!(processor_id & 0xf)) { - printk("PCI: IXP4xx A0 silicon detected - " + if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { + printk("PCI: IXP42x A0 silicon detected - " "PCI Non-Prefetch Workaround Enabled\n"); ixp4xx_pci_read = ixp4xx_pci_read_errata; } else diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 24ffa3238..c3211bc6a 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -145,7 +145,10 @@ void __init ixp4xx_map_io(void) **************************************************************************/ static void ixp4xx_irq_mask(unsigned int irq) { - *IXP4XX_ICMR &= ~(1 << irq); + if (cpu_is_ixp46x() && irq >= 32) + *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); + else + *IXP4XX_ICMR &= ~(1 << irq); } static void ixp4xx_irq_mask_ack(unsigned int irq) @@ -155,13 +158,13 @@ static void ixp4xx_irq_mask_ack(unsigned int irq) static void ixp4xx_irq_unmask(unsigned int irq) { - static int irq2gpio[NR_IRQS] = { + static int irq2gpio[32] = { -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, }; - int line = irq2gpio[irq]; + int line = (irq < 32) ? irq2gpio[irq] : -1; /* * This only works for LEVEL gpio IRQs as per the IXP4xx developer's @@ -171,7 +174,10 @@ static void ixp4xx_irq_unmask(unsigned int irq) if (line >= 0) gpio_line_isr_clear(line); - *IXP4XX_ICMR |= (1 << irq); + if (cpu_is_ixp46x() && irq >= 32) + *IXP4XX_ICMR2 |= (1 << (irq - 32)); + else + *IXP4XX_ICMR |= (1 << irq); } static struct irqchip ixp4xx_irq_chip = { @@ -190,6 +196,14 @@ void __init ixp4xx_init_irq(void) /* Disable all interrupt */ *IXP4XX_ICMR = 0x0; + if (cpu_is_ixp46x()) { + /* Route upper 32 sources to IRQ instead of FIQ */ + *IXP4XX_ICLR2 = 0x00; + + /* Disable upper 32 interrupts */ + *IXP4XX_ICMR2 = 0x00; + } + for(i = 0; i < NR_IRQS; i++) { set_irq_chip(i, &ixp4xx_irq_chip); @@ -221,16 +235,20 @@ static unsigned long ixp4xx_gettimeoffset(void) static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + /* Clear Pending Interrupt by writing '1' to it */ *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; /* * Catch up with the real idea of time */ - do { + while ((*IXP4XX_OSTS - last_jiffy_time) > LATCH) { timer_tick(regs); last_jiffy_time += LATCH; - } while((*IXP4XX_OSTS - last_jiffy_time) > LATCH); + } + + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -241,10 +259,8 @@ static struct irqaction ixp4xx_timer_irq = { .handler = ixp4xx_timer_interrupt }; -void __init ixp4xx_init_time(void) +static void __init ixp4xx_timer_init(void) { - gettimeoffset = ixp4xx_gettimeoffset; - /* Clear Pending Interrupt by writing '1' to it */ *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; @@ -259,4 +275,44 @@ void __init ixp4xx_init_time(void) setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq); } +struct sys_timer ixp4xx_timer = { + .init = ixp4xx_timer_init, + .offset = ixp4xx_gettimeoffset, +}; + +static struct resource ixp46x_i2c_resources[] = { + [0] = { + .start = 0xc8011000, + .end = 0xc801101c, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IXP4XX_I2C, + .end = IRQ_IXP4XX_I2C, + .flags = IORESOURCE_IRQ + } +}; + +/* + * I2C controller. The IXP46x uses the same block as the IOP3xx, so + * we just use the same device name. + */ +static struct platform_device ixp46x_i2c_controller = { + .name = "IOP3xx-I2C", + .id = 0, + .num_resources = 2, + .resource = ixp46x_i2c_resources +}; + +static struct platform_device *ixp46x_devices[] __initdata = { + &ixp46x_i2c_controller +}; + +void __init ixp4xx_sys_init(void) +{ + if (cpu_is_ixp46x()) { + platform_add_devices(ixp46x_devices, + ARRAY_SIZE(ixp46x_devices)); + } +} diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c index b46c74351..afafb42ae 100644 --- a/arch/arm/mach-ixp4xx/coyote-pci.c +++ b/arch/arm/mach-ixp4xx/coyote-pci.c @@ -14,6 +14,7 @@ * */ +#include #include #include diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c index 03ad0b718..1d06d364c 100644 --- a/arch/arm/mach-ixp4xx/coyote-setup.c +++ b/arch/arm/mach-ixp4xx/coyote-setup.c @@ -1,13 +1,14 @@ /* * arch/arm/mach-ixp4xx/coyote-setup.c * - * ADI Engineering Coyote board-setup + * Board setup for ADI Engineering and IXDGP425 boards * * Copyright (C) 2003-2004 MontaVista Software, Inc. * * Author: Deepak Saxena */ +#include #include #include #include @@ -30,7 +31,7 @@ #endif /* - * Only one serial port is connected on the Coyote. + * Only one serial port is connected on the Coyote & IXDPG425 */ static struct uart_port coyote_serial_port = { .membase = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET), @@ -47,6 +48,13 @@ static struct uart_port coyote_serial_port = { void __init coyote_map_io(void) { + if (machine_is_ixdpg425()) { + coyote_serial_port.membase = + (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET); + coyote_serial_port.mapbase = IXP4XX_UART1_BASE_PHYS; + coyote_serial_port.irq = IRQ_IXP4XX_UART1; + } + early_serial_setup(&coyote_serial_port); ixp4xx_map_io(); @@ -79,17 +87,40 @@ static struct platform_device *coyote_devices[] __initdata = { static void __init coyote_init(void) { - platform_add_devices(&coyote_devices, ARRAY_SIZE(coyote_devices)); + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; + + ixp4xx_sys_init(); + platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices)); } -MACHINE_START(ADI_COYOTE, "ADI Engineering IXP4XX Coyote Development Platform") +#ifdef CONFIG_ARCH_ADI_COYOTE +MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") MAINTAINER("MontaVista Software, Inc.") BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(coyote_map_io) INITIRQ(ixp4xx_init_irq) - INITTIME(ixp4xx_init_time) + .timer = &ixp4xx_timer, BOOT_PARAMS(0x0100) INIT_MACHINE(coyote_init) MACHINE_END +#endif + +/* + * IXDPG425 is identical to Coyote except for which serial port + * is connected. + */ +#ifdef CONFIG_MACH_IXDPG425 +MACHINE_START(IXDPG425, "Intel IXDPG425") + MAINTAINER("MontaVista Software, Inc.") + BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, + IXP4XX_PERIPHERAL_BASE_VIRT) + MAPIO(coyote_map_io) + INITIRQ(ixp4xx_init_irq) + .timer = &ixp4xx_timer, + BOOT_PARAMS(0x0100) + INIT_MACHINE(coyote_init) +MACHINE_END +#endif diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c index 7baa60c2d..c2ab9ebb5 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c @@ -14,6 +14,7 @@ * */ +#include #include #include #include @@ -73,9 +74,8 @@ struct hw_pci ixdp425_pci __initdata = { int __init ixdp425_pci_init(void) { - if (machine_is_ixdp425() || - machine_is_ixcdp1100() || - machine_is_avila()) + if (machine_is_ixdp425() || machine_is_ixcdp1100() || + machine_is_avila() || machine_is_ixdp465()) pci_common_init(&ixdp425_pci); return 0; } diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index dbcaa464b..77006d96a 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c @@ -8,6 +8,7 @@ * Author: Deepak Saxena */ +#include #include #include #include @@ -108,7 +109,16 @@ static struct platform_device *ixdp425_devices[] __initdata = { static void __init ixdp425_init(void) { - platform_add_devices(&ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); + ixp4xx_sys_init(); + + /* + * IXP465 has 32MB window + */ + if (machine_is_ixdp465()) { + ixdp425_flash_resource.end += IXDP425_FLASH_SIZE; + } + + platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); } MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") @@ -117,7 +127,18 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) - INITTIME(ixp4xx_init_time) + .timer = &ixp4xx_timer, + BOOT_PARAMS(0x0100) + INIT_MACHINE(ixdp425_init) +MACHINE_END + +MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") + MAINTAINER("MontaVista Software, Inc.") + BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, + IXP4XX_PERIPHERAL_BASE_VIRT) + MAPIO(ixdp425_map_io) + INITIRQ(ixp4xx_init_irq) + .timer = &ixp4xx_timer, BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END @@ -128,7 +149,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) - INITTIME(ixp4xx_init_time) + .timer = &ixp4xx_timer, BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END @@ -146,7 +167,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform") IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) - INITTIME(ixp4xx_init_time) + .timer = &ixp4xx_timer, BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c index 0f9043362..ce4563f00 100644 --- a/arch/arm/mach-ixp4xx/ixdpg425-pci.c +++ b/arch/arm/mach-ixp4xx/ixdpg425-pci.c @@ -13,6 +13,7 @@ * */ +#include #include #include diff --git a/arch/arm/mach-ixp4xx/prpmc1100-pci.c b/arch/arm/mach-ixp4xx/prpmc1100-pci.c index a0aed9ca3..9ee0ab9da 100644 --- a/arch/arm/mach-ixp4xx/prpmc1100-pci.c +++ b/arch/arm/mach-ixp4xx/prpmc1100-pci.c @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/arch/arm/mach-ixp4xx/prpmc1100-setup.c b/arch/arm/mach-ixp4xx/prpmc1100-setup.c index 01e98fda0..ed4281565 100644 --- a/arch/arm/mach-ixp4xx/prpmc1100-setup.c +++ b/arch/arm/mach-ixp4xx/prpmc1100-setup.c @@ -8,6 +8,7 @@ * Author: Deepak Saxena */ +#include #include #include #include @@ -79,7 +80,9 @@ static struct platform_device *prpmc1100_devices[] __initdata = { static void __init prpmc1100_init(void) { - platform_add_devices(&prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices)); + ixp4xx_sys_init(); + + platform_add_devices(prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices)); } MACHINE_START(PRPMC1100, "Motorola PrPMC1100") @@ -88,7 +91,7 @@ MACHINE_START(PRPMC1100, "Motorola PrPMC1100") IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(prpmc1100_map_io) INITIRQ(ixp4xx_init_irq) - INITTIME(ixp4xx_init_time) + .timer = &ixp4xx_timer, BOOT_PARAMS(0x0100) INIT_MACHINE(prpmc1100_init) MACHINE_END diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c index 6fa2a981e..be5d17fe9 100644 --- a/arch/arm/mach-lh7a40x/arch-kev7a400.c +++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c @@ -11,21 +11,19 @@ #include #include #include +#include #include #include #include #include -#include /* io_p2v() */ #include #include #include -#include +#include "common.h" /* This function calls the board specific IRQ initialization function. */ -extern void lh7a400_init_irq (void); -extern void lh7a40x_init_time (void); static struct map_desc kev7a400_io_desc[] __initdata = { { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, @@ -109,5 +107,5 @@ MACHINE_START (KEV7A400, "Sharp KEV7a400") BOOT_PARAMS (0xc0000100) MAPIO (kev7a400_map_io) INITIRQ (lh7a400_init_irq) - INITTIME (lh7a40x_init_time) + .timer = &lh7a40x_timer, MACHINE_END diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c index bd82bebce..06373b295 100644 --- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c +++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c @@ -11,17 +11,17 @@ #include #include #include +#include #include #include #include #include -#include /* io_p2v() */ #include #include #include -#include +#include "common.h" static struct resource smc91x_resources[] = { [0] = { @@ -261,16 +261,13 @@ lpd7a400_map_io(void) #ifdef CONFIG_MACH_LPD7A400 -extern void lh7a400_init_irq (void); -extern void lh7a40x_init_time (void); - MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10") MAINTAINER ("Marc Singer") BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) BOOT_PARAMS (0xc0000100) MAPIO (lpd7a400_map_io) INITIRQ (lh7a400_init_irq) - INITTIME (lh7a40x_init_time) + .timer = &lh7a40x_timer, INIT_MACHINE (lpd7a40x_init) MACHINE_END @@ -278,16 +275,13 @@ MACHINE_END #ifdef CONFIG_MACH_LPD7A404 -extern void lh7a404_init_irq (void); -extern void lh7a40x_init_time (void); - MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") MAINTAINER ("Marc Singer") BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) BOOT_PARAMS (0xc0000100) MAPIO (lpd7a400_map_io) INITIRQ (lh7a404_init_irq) - INITTIME (lh7a40x_init_time) + .timer = &lh7a40x_timer, INIT_MACHINE (lpd7a40x_init) MACHINE_END diff --git a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c index f4943cacb..51e1c814b 100644 --- a/arch/arm/mach-lh7a40x/time.c +++ b/arch/arm/mach-lh7a40x/time.c @@ -20,6 +20,7 @@ #include #include +#include "common.h" #if HZ < 100 # define TIMER_CONTROL TIMER_CONTROL2 @@ -40,9 +41,13 @@ static irqreturn_t lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + TIMER_EOI = 0; timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -52,7 +57,7 @@ static struct irqaction lh7a40x_timer_irq = { .handler = lh7a40x_timer_interrupt }; -void __init lh7a40x_init_time(void) +static void __init lh7a40x_timer_init(void) { /* Stop/disable all timers */ TIMER_CONTROL1 = 0; @@ -65,3 +70,6 @@ void __init lh7a40x_init_time(void) TIMER_CONTROL = TIMER_MODE; } +struct sys_timer lh7a40x_timer = { + .init = &lh7a40x_timer_init, +}; diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index 9fb70d5dc..f8d265d70 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -5,58 +5,56 @@ menu "TI OMAP Implementations" comment "OMAP Core Type" config ARCH_OMAP730 + depends on ARCH_OMAP bool "OMAP730 Based System" - select CPU_ARM926T + select ARCH_OMAP_OTG config ARCH_OMAP1510 + depends on ARCH_OMAP default y bool "OMAP1510 Based System" - select CPU_ARM925T - select CPU_DCACHE_WRITETHROUGH -config ARCH_OMAP1610 - bool "OMAP1610 Based System" - select CPU_ARM926T +config ARCH_OMAP16XX + depends on ARCH_OMAP + bool "OMAP16XX Based System" + select ARCH_OMAP_OTG -config ARCH_OMAP5912 - bool "OMAP5912 Based System" - select CPU_ARM926T +config ARCH_OMAP_OTG + bool comment "OMAP Board Type" config MACH_OMAP_INNOVATOR bool "TI Innovator" - default y - depends on ARCH_OMAP1510 || ARCH_OMAP1610 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX help TI OMAP 1510 or 1610 Innovator board support. Say Y here if you have such a board. config MACH_OMAP_H2 bool "TI H2 Support" - depends on ARCH_OMAP1610 - select MACH_OMAP_INNOVATOR + depends on ARCH_OMAP16XX help - TI OMAP 1610 H2 board support. Say Y here if you have such + TI OMAP 1610/1611B H2 board support. Say Y here if you have such a board. config MACH_OMAP_H3 bool "TI H3 Support" - depends on ARCH_OMAP1610 + depends on ARCH_OMAP16XX help - TI OMAP 1610 H3 board support. Say Y here if you have such + TI OMAP 1710 H3 board support. Say Y here if you have such a board. config MACH_OMAP_H4 bool "TI H4 Support" - depends on ARCH_OMAP1610 + depends on ARCH_OMAP16XX help TI OMAP 1610 H4 board support. Say Y here if you have such a board. config MACH_OMAP_OSK bool "TI OSK Support" - depends on ARCH_OMAP5912 + depends on ARCH_OMAP16XX help TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here if you have such a board. @@ -64,19 +62,16 @@ config MACH_OMAP_OSK config MACH_OMAP_PERSEUS2 bool "TI Perseus2" depends on ARCH_OMAP730 - select LEDS - select LEDS_TIMER - select LEDS_CPU help Support for TI OMAP 730 Perseus2 board. Say Y here if you have such a board. config MACH_OMAP_GENERIC bool "Generic OMAP board" - depends on ARCH_OMAP1510 || ARCH_OMAP1610 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX help - Support for generic OMAP-1510 or 1610 board with no - FPGA. Can be used as template for porting Linux to + Support for generic OMAP-1510, 1610 or 1710 board with + no FPGA. Can be used as template for porting Linux to custom OMAP boards. Say Y here if you have a custom board. @@ -84,6 +79,7 @@ comment "OMAP Feature Selections" #config OMAP_BOOT_TAG # bool "OMAP bootloader information passing" +# depends on ARCH_OMAP # default n # help # Say Y, if you have a bootloader which passes information @@ -91,6 +87,7 @@ comment "OMAP Feature Selections" config OMAP_MUX bool "OMAP multiplexing support" + depends on ARCH_OMAP default y help Pin multiplexing support for OMAP boards. If your bootloader @@ -106,8 +103,18 @@ config OMAP_MUX_DEBUG This is useful if you want to find out the correct values of the multiplexing registers. +config OMAP_MUX_WARNINGS + bool "Warn about pins the bootloader didn't set up" + depends on OMAP_MUX + default y + help + Choose Y here to warn whenever driver initialization logic needs + to change the pin multiplexing setup. When there are no warnings + printed, it's safe to deselect OMAP_MUX for your product. + choice prompt "Low-level debug console UART" + depends on ARCH_OMAP default OMAP_LL_DEBUG_UART1 config OMAP_LL_DEBUG_UART1 @@ -129,7 +136,7 @@ config OMAP_ARM_195MHZ config OMAP_ARM_192MHZ bool "OMAP ARM 192 MHz CPU" - depends on ARCH_OMAP1610 || ARCH_OMAP5912 + depends on ARCH_OMAP16XX help Enable 192MHz clock for OMAP CPU. If unsure, say N. @@ -141,26 +148,26 @@ config OMAP_ARM_182MHZ config OMAP_ARM_168MHZ bool "OMAP ARM 168 MHz CPU" - depends on ARCH_OMAP1510 || ARCH_OMAP1610 || ARCH_OMAP730 || ARCH_OMAP5912 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730 help Enable 168MHz clock for OMAP CPU. If unsure, say N. config OMAP_ARM_120MHZ bool "OMAP ARM 120 MHz CPU" - depends on ARCH_OMAP1510 || ARCH_OMAP1610 || ARCH_OMAP730 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730 help Enable 120MHz clock for OMAP CPU. If unsure, say N. config OMAP_ARM_60MHZ bool "OMAP ARM 60 MHz CPU" - depends on ARCH_OMAP1510 || ARCH_OMAP1610 || ARCH_OMAP730 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730 default y help Enable 60MHz clock for OMAP CPU. If unsure, say Y. config OMAP_ARM_30MHZ bool "OMAP ARM 30 MHz CPU" - depends on ARCH_OMAP1510 || ARCH_OMAP1610 || ARCH_OMAP730 + depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730 help Enable 30MHz clock for OMAP CPU. If unsure, say N. diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile index b483092dd..2a6c49542 100644 --- a/arch/arm/mach-omap/Makefile +++ b/arch/arm/mach-omap/Makefile @@ -3,7 +3,7 @@ # # Common support -obj-y := common.o time.o irq.o dma.o clocks.o mux.o gpio.o mcbsp.o +obj-y := common.o time.o irq.o dma.o clock.o mux.o gpio.o mcbsp.o usb.o obj-m := obj-n := obj- := @@ -18,9 +18,7 @@ obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o # OCPI interconnect support for 1710, 1610 and 5912 -obj-$(CONFIG_ARCH_OMAP1710) += ocpi.o -obj-$(CONFIG_ARCH_OMAP1610) += ocpi.o -obj-$(CONFIG_ARCH_OMAP5912) += ocpi.o +obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # LEDs support led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c index 03da924c7..586bc1271 100644 --- a/arch/arm/mach-omap/board-generic.c +++ b/arch/arm/mach-omap/board-generic.c @@ -22,44 +22,21 @@ #include #include -#include #include #include #include #include +#include #include "common.h" -extern void __init omap_init_time(void); +static int __initdata generic_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; static void __init omap_generic_init_irq(void) { omap_init_irq(); } -/* - * Muxes the serial ports on - */ -#ifdef CONFIG_ARCH_OMAP1510 -static void __init omap_early_serial_init(void) -{ -#ifdef CONFIG_OMAP_LL_DEBUG_UART1 - omap_cfg_reg(UART1_TX); - omap_cfg_reg(UART1_RTS); -#endif - -#ifdef CONFIG_OMAP_LL_DEBUG_UART2 - omap_cfg_reg(UART2_TX); - omap_cfg_reg(UART2_RTS); -#endif - -#ifdef CONFIG_OMAP_LL_DEBUG_UART1 - omap_cfg_reg(UART3_TX); - omap_cfg_reg(UART3_RX); -#endif -} -#endif - /* assume no Mini-AB port */ #ifdef CONFIG_ARCH_OMAP1510 @@ -71,7 +48,7 @@ static struct omap_usb_config generic1510_usb_config __initdata = { }; #endif -#ifdef CONFIG_ARCH_OMAP1610 +#if defined(CONFIG_ARCH_OMAP16XX) static struct omap_usb_config generic1610_usb_config __initdata = { .register_host = 1, .register_dev = 1, @@ -93,17 +70,17 @@ static void __init omap_generic_init(void) */ #ifdef CONFIG_ARCH_OMAP1510 if (cpu_is_omap1510()) { - omap_early_serial_init(); generic_config[0].data = &generic1510_usb_config; } #endif -#ifdef CONFIG_ARCH_OMAP1610 +#if defined(CONFIG_ARCH_OMAP16XX) if (!cpu_is_omap1510()) { generic_config[0].data = &generic1610_usb_config; } #endif omap_board_config = generic_config; omap_board_config_size = ARRAY_SIZE(generic_config); + omap_serial_init(generic_serial_ports); } static void __init omap_generic_map_io(void) @@ -118,5 +95,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") MAPIO(omap_generic_map_io) INITIRQ(omap_generic_init_irq) INIT_MACHINE(omap_generic_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/board-h2.c b/arch/arm/mach-omap/board-h2.c index 1441089d9..c767d0810 100644 --- a/arch/arm/mach-omap/board-h2.c +++ b/arch/arm/mach-omap/board-h2.c @@ -35,13 +35,9 @@ #include "common.h" -extern void __init omap_init_time(void); +extern int omap_gpio_init(void); -static struct map_desc h2_io_desc[] __initdata = { -{ OMAP1610_ETHR_BASE, OMAP1610_ETHR_START, OMAP1610_ETHR_SIZE,MT_DEVICE }, -{ OMAP1610_NOR_FLASH_BASE, OMAP1610_NOR_FLASH_START, OMAP1610_NOR_FLASH_SIZE, - MT_DEVICE }, -}; +static int __initdata h2_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; static struct resource h2_smc91x_resources[] = { [0] = { @@ -50,8 +46,8 @@ static struct resource h2_smc91x_resources[] = { .flags = IORESOURCE_MEM, }, [1] = { - .start = 0, /* Really GPIO 0 */ - .end = 0, + .start = OMAP_GPIO_IRQ(0), + .end = OMAP_GPIO_IRQ(0), .flags = IORESOURCE_IRQ, }, }; @@ -67,9 +63,20 @@ static struct platform_device *h2_devices[] __initdata = { &h2_smc91x_device, }; +static void __init h2_init_smc91x(void) +{ + if ((omap_request_gpio(0)) < 0) { + printk("Error requesting gpio 0 for smc91x irq\n"); + return; + } + omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE); +} + void h2_init_irq(void) { omap_init_irq(); + omap_gpio_init(); + h2_init_smc91x(); } static struct omap_usb_config h2_usb_config __initdata = { @@ -80,15 +87,22 @@ static struct omap_usb_config h2_usb_config __initdata = { .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback) #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) - /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ + /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled #endif .pins[1] = 3, }; +static struct omap_mmc_config h2_mmc_config __initdata = { + .mmc_blocks = 1, + .mmc1_power_pin = -1, /* tps65010 gpio3 */ + .mmc1_switch_pin = OMAP_MPUIO(1), +}; + static struct omap_board_config_kernel h2_config[] = { { OMAP_TAG_USB, &h2_usb_config }, + { OMAP_TAG_MMC, &h2_mmc_config }, }; static void __init h2_init(void) @@ -101,7 +115,7 @@ static void __init h2_init(void) static void __init h2_map_io(void) { omap_map_io(); - iotable_init(h2_io_desc, ARRAY_SIZE(h2_io_desc)); + omap_serial_init(h2_serial_ports); } MACHINE_START(OMAP_H2, "TI-H2") @@ -111,5 +125,5 @@ MACHINE_START(OMAP_H2, "TI-H2") MAPIO(h2_map_io) INITIRQ(h2_init_irq) INIT_MACHINE(h2_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/board-h3.c b/arch/arm/mach-omap/board-h3.c index d573b0cdf..fd1d93626 100644 --- a/arch/arm/mach-omap/board-h3.c +++ b/arch/arm/mach-omap/board-h3.c @@ -28,16 +28,15 @@ #include #include #include +#include #include #include + #include "common.h" -extern void __init omap_init_time(void); +extern int omap_gpio_init(void); -void h3_init_irq(void) -{ - omap_init_irq(); -} +static int __initdata h3_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; static struct resource smc91x_resources[] = { [0] = { @@ -46,8 +45,8 @@ static struct resource smc91x_resources[] = { .flags = IORESOURCE_MEM, }, [1] = { - .start = 0, - .end = 0, + .start = OMAP_GPIO_IRQ(40), + .end = OMAP_GPIO_IRQ(40), .flags = IORESOURCE_IRQ, }, }; @@ -68,15 +67,27 @@ static void __init h3_init(void) (void) platform_add_devices(devices, ARRAY_SIZE(devices)); } -static struct map_desc h3_io_desc[] __initdata = { -{ OMAP1710_ETHR_BASE, OMAP1710_ETHR_START, OMAP1710_ETHR_SIZE, MT_DEVICE }, -{ OMAP_NOR_FLASH_BASE, OMAP_NOR_FLASH_START, OMAP_NOR_FLASH_SIZE, MT_DEVICE }, -}; +static void __init h3_init_smc91x(void) +{ + omap_cfg_reg(W15_1710_GPIO40); + if (omap_request_gpio(40) < 0) { + printk("Error requesting gpio 40 for smc91x irq\n"); + return; + } + omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE); +} + +void h3_init_irq(void) +{ + omap_init_irq(); + omap_gpio_init(); + h3_init_smc91x(); +} static void __init h3_map_io(void) { omap_map_io(); - iotable_init(h3_io_desc, ARRAY_SIZE(h3_io_desc)); + omap_serial_init(h3_serial_ports); } MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") @@ -86,5 +97,5 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") MAPIO(h3_map_io) INITIRQ(h3_init_irq) INIT_MACHINE(h3_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c index 8fd97e7af..dfc67021e 100644 --- a/arch/arm/mach-omap/board-innovator.c +++ b/arch/arm/mach-omap/board-innovator.c @@ -33,12 +33,10 @@ #include "common.h" -extern void __init omap_init_time(void); +static int __initdata innovator_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; #ifdef CONFIG_ARCH_OMAP1510 -extern int omap_gpio_init(void); - /* Only FPGA needs to be mapped here. All others are done with ioremap */ static struct map_desc innovator1510_io_desc[] __initdata = { { OMAP1510_FPGA_BASE, OMAP1510_FPGA_START, OMAP1510_FPGA_SIZE, @@ -71,23 +69,17 @@ static struct platform_device *innovator1510_devices[] __initdata = { #endif /* CONFIG_ARCH_OMAP1510 */ -#ifdef CONFIG_ARCH_OMAP1610 - -static struct map_desc innovator1610_io_desc[] __initdata = { -{ OMAP1610_ETHR_BASE, OMAP1610_ETHR_START, OMAP1610_ETHR_SIZE,MT_DEVICE }, -{ OMAP1610_NOR_FLASH_BASE, OMAP1610_NOR_FLASH_START, OMAP1610_NOR_FLASH_SIZE, - MT_DEVICE }, -}; +#ifdef CONFIG_ARCH_OMAP16XX static struct resource innovator1610_smc91x_resources[] = { [0] = { - .start = OMAP1610_ETHR_START, /* Physical */ - .end = OMAP1610_ETHR_START + SZ_4K, + .start = INNOVATOR1610_ETHR_START, /* Physical */ + .end = INNOVATOR1610_ETHR_START + SZ_4K, .flags = IORESOURCE_MEM, }, [1] = { - .start = 0, /* Really GPIO 0 */ - .end = 0, + .start = OMAP_GPIO_IRQ(0), + .end = OMAP_GPIO_IRQ(0), .flags = IORESOURCE_IRQ, }, }; @@ -103,31 +95,50 @@ static struct platform_device *innovator1610_devices[] __initdata = { &innovator1610_smc91x_device, }; -#endif /* CONFIG_ARCH_OMAP1610 */ +#endif /* CONFIG_ARCH_OMAP16XX */ + +static void __init innovator_init_smc91x(void) +{ + if (cpu_is_omap1510()) { + fpga_write(fpga_read(OMAP1510_FPGA_RST) & ~1, + OMAP1510_FPGA_RST); + udelay(750); + } else { + if ((omap_request_gpio(0)) < 0) { + printk("Error requesting gpio 0 for smc91x irq\n"); + return; + } + omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE); + } +} void innovator_init_irq(void) { omap_init_irq(); + omap_gpio_init(); #ifdef CONFIG_ARCH_OMAP1510 if (cpu_is_omap1510()) { - omap_gpio_init(); omap1510_fpga_init_irq(); } #endif + innovator_init_smc91x(); } #ifdef CONFIG_ARCH_OMAP1510 static struct omap_usb_config innovator1510_usb_config __initdata = { - /* has usb host and device, but no Mini-AB port */ + /* for bundled non-standard host and peripheral cables */ + .hmc_mode = 4, + .register_host = 1, + .pins[1] = 6, + .pins[2] = 6, /* Conflicts with UART2 */ + .register_dev = 1, - /* Assume bad Innovator wiring; Use internal host only with custom cable */ - .hmc_mode = 16, .pins[0] = 2, }; #endif -#ifdef CONFIG_ARCH_OMAP1610 +#ifdef CONFIG_ARCH_OMAP16XX static struct omap_usb_config h2_usb_config __initdata = { /* usb1 has a Mini-AB port and external isp1301 transceiver */ .otg = 2, @@ -155,7 +166,7 @@ static void __init innovator_init(void) platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); } #endif -#ifdef CONFIG_ARCH_OMAP1610 +#ifdef CONFIG_ARCH_OMAP16XX if (!cpu_is_omap1510()) { platform_add_devices(innovator1610_devices, ARRAY_SIZE(innovator1610_devices)); } @@ -165,7 +176,7 @@ static void __init innovator_init(void) if (cpu_is_omap1510()) innovator_config[0].data = &innovator1510_usb_config; #endif -#ifdef CONFIG_ARCH_OMAP1610 +#ifdef CONFIG_ARCH_OMAP16XX if (cpu_is_omap1610()) innovator_config[0].data = &h2_usb_config; #endif @@ -189,11 +200,7 @@ static void __init innovator_map_io(void) fpga_read(OMAP1510_FPGA_BOARD_REV)); } #endif -#ifdef CONFIG_ARCH_OMAP1610 - if (!cpu_is_omap1510()) { - iotable_init(innovator1610_io_desc, ARRAY_SIZE(innovator1610_io_desc)); - } -#endif + omap_serial_init(innovator_serial_ports); } MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") @@ -203,5 +210,5 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") MAPIO(innovator_map_io) INITIRQ(innovator_init_irq) INIT_MACHINE(innovator_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c index 85d9a0ac3..51c616812 100644 --- a/arch/arm/mach-omap/board-osk.c +++ b/arch/arm/mach-omap/board-osk.c @@ -38,17 +38,17 @@ #include #include #include +#include #include "common.h" -extern void __init omap_init_time(void); - static struct map_desc osk5912_io_desc[] __initdata = { -{ OMAP_OSK_ETHR_BASE, OMAP_OSK_ETHR_START, OMAP_OSK_ETHR_SIZE,MT_DEVICE }, { OMAP_OSK_NOR_FLASH_BASE, OMAP_OSK_NOR_FLASH_START, OMAP_OSK_NOR_FLASH_SIZE, MT_DEVICE }, }; +static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0}; + static struct resource osk5912_smc91x_resources[] = { [0] = { .start = OMAP_OSK_ETHR_START, /* Physical */ @@ -56,8 +56,8 @@ static struct resource osk5912_smc91x_resources[] = { .flags = IORESOURCE_MEM, }, [1] = { - .start = 0, /* Really GPIO 0 */ - .end = 0, + .start = OMAP_GPIO_IRQ(0), + .end = OMAP_GPIO_IRQ(0), .flags = IORESOURCE_IRQ, }, }; @@ -73,21 +73,45 @@ static struct platform_device *osk5912_devices[] __initdata = { &osk5912_smc91x_device, }; +static void __init osk_init_smc91x(void) +{ + if ((omap_request_gpio(0)) < 0) { + printk("Error requesting gpio 0 for smc91x irq\n"); + return; + } + omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE); +} + void osk_init_irq(void) { omap_init_irq(); + omap_gpio_init(); + osk_init_smc91x(); } +static struct omap_usb_config osk_usb_config __initdata = { + /* has usb host and device, but no Mini-AB port */ + .register_host = 1, + .hmc_mode = 16, + .pins[0] = 2, +}; + +static struct omap_board_config_kernel osk_config[] = { + { OMAP_TAG_USB, &osk_usb_config }, +}; + static void __init osk_init(void) { platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices)); + omap_board_config = osk_config; + omap_board_config_size = ARRAY_SIZE(osk_config); } static void __init osk_map_io(void) { omap_map_io(); iotable_init(osk5912_io_desc, ARRAY_SIZE(osk5912_io_desc)); - + omap_serial_init(osk_serial_ports); } MACHINE_START(OMAP_OSK, "TI-OSK") @@ -97,5 +121,5 @@ MACHINE_START(OMAP_OSK, "TI-OSK") MAPIO(osk_map_io) INITIRQ(osk_init_irq) INIT_MACHINE(osk_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c index 95833f3b9..4a5e54ca5 100644 --- a/arch/arm/mach-omap/board-perseus2.c +++ b/arch/arm/mach-omap/board-perseus2.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -24,16 +25,10 @@ #include #include #include +#include #include "common.h" -extern void __init omap_init_time(void); - -void omap_perseus2_init_irq(void) -{ - omap_init_irq(); -} - static struct resource smc91x_resources[] = { [0] = { .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ @@ -47,6 +42,8 @@ static struct resource smc91x_resources[] = { }, }; +static int __initdata p2_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 0}; + static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, @@ -63,6 +60,22 @@ static void __init omap_perseus2_init(void) (void) platform_add_devices(devices, ARRAY_SIZE(devices)); } +static void __init perseus2_init_smc91x(void) +{ + fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); + mdelay(50); + fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, + H2P2_DBG_FPGA_LAN_RESET); + mdelay(50); +} + +void omap_perseus2_init_irq(void) +{ + omap_init_irq(); + omap_gpio_init(); + perseus2_init_smc91x(); +} + /* Only FPGA needs to be mapped here. All others are done with ioremap */ static struct map_desc omap_perseus2_io_desc[] __initdata = { {H2P2_DBG_FPGA_BASE, H2P2_DBG_FPGA_START, H2P2_DBG_FPGA_SIZE, @@ -106,6 +119,7 @@ static void __init omap_perseus2_map_io(void) * It is used as the Ethernet controller interrupt */ omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); + omap_serial_init(p2_serial_ports); } MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") @@ -115,5 +129,5 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") MAPIO(omap_perseus2_map_io) INITIRQ(omap_perseus2_init_irq) INIT_MACHINE(omap_perseus2_init) - INITTIME(omap_init_time) + .timer = &omap_timer, MACHINE_END diff --git a/arch/arm/mach-omap/clock.c b/arch/arm/mach-omap/clock.c index 39d8503c0..be4cc1ffe 100644 --- a/arch/arm/mach-omap/clock.c +++ b/arch/arm/mach-omap/clock.c @@ -22,7 +22,7 @@ static LIST_HEAD(clocks); static DECLARE_MUTEX(clocks_sem); -static spinlock_t clockfw_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(clockfw_lock); static void propagate_rate(struct clk * clk); /* MPU virtual clock functions */ static int select_table_rate(unsigned long rate); diff --git a/arch/arm/mach-omap/common.c b/arch/arm/mach-omap/common.c index 17d82a7f3..6cc8c21ea 100644 --- a/arch/arm/mach-omap/common.c +++ b/arch/arm/mach-omap/common.c @@ -14,65 +14,193 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include -#include -#include +#include #include +#include + +#include +#include +#include + +#include "clock.h" + +#define DEBUG 1 + +struct omap_id { + u16 jtag_id; /* Used to determine OMAP type */ + u8 die_rev; /* Processor revision */ + u32 omap_id; /* OMAP revision */ + u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */ +}; + +/* Register values to detect the OMAP version */ +static struct omap_id omap_ids[] __initdata = { + { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100}, + { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300}, + { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000}, + { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000}, + { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000}, + { .jtag_id = 0xb576, .die_rev = 0x3, .omap_id = 0x03320100, .type = 0x16100c00}, + { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320200, .type = 0x16100d00}, + { .jtag_id = 0xb613, .die_rev = 0x0, .omap_id = 0x03320300, .type = 0x1610ef00}, + { .jtag_id = 0xb613, .die_rev = 0x0, .omap_id = 0x03320300, .type = 0x1610ef00}, + { .jtag_id = 0xb576, .die_rev = 0x1, .omap_id = 0x03320100, .type = 0x16110000}, + { .jtag_id = 0xb58c, .die_rev = 0x2, .omap_id = 0x03320200, .type = 0x16110b00}, + { .jtag_id = 0xb58c, .die_rev = 0x3, .omap_id = 0x03320200, .type = 0x16110c00}, + { .jtag_id = 0xb65f, .die_rev = 0x0, .omap_id = 0x03320400, .type = 0x16212300}, + { .jtag_id = 0xb65f, .die_rev = 0x1, .omap_id = 0x03320400, .type = 0x16212300}, + { .jtag_id = 0xb65f, .die_rev = 0x1, .omap_id = 0x03320500, .type = 0x16212300}, + { .jtag_id = 0xb5f7, .die_rev = 0x0, .omap_id = 0x03330000, .type = 0x17100000}, + { .jtag_id = 0xb5f7, .die_rev = 0x1, .omap_id = 0x03330100, .type = 0x17100000}, + { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000}, +}; /* - * ---------------------------------------------------------------------------- - * OMAP revision check - * - * Since we use the cpu_is_omapnnnn() macros, there's a chance that a board - * switches to an updated core. We want to print out the OMAP revision early. - * - * We use the system_serial registers for the revision information so we - * can see it in /proc/cpuinfo. - * - * If the OMAP detection gets more complicated, we may want to expand this - * to store the OMAP version and replace the current cpu_is_omapnnnn() macros. - * - * ---------------------------------------------------------------------------- + * Get OMAP type from PROD_ID. + * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM. + * 1510 PROD_ID is empty, and 1610 PROD_ID does not make sense. + * Undocumented register in TEST BLOCK is used as fallback; This seems to + * work on 1510, 1610 & 1710. The official way hopefully will work in future + * processors. + */ +static u16 __init omap_get_jtag_id(void) +{ + u32 prod_id, omap_id; + + prod_id = omap_readl(OMAP_PRODUCTION_ID_1); + omap_id = omap_readl(OMAP32_ID_1); + + /* Check for unusable OMAP_PRODUCTION_ID_1 on 1611B/5912 and 730 */ + if (((prod_id >> 20) == 0) || (prod_id == omap_id)) + prod_id = 0; + else + prod_id &= 0xffff; + + if (prod_id) + return prod_id; + + /* Use OMAP32_ID_1 as fallback */ + prod_id = ((omap_id >> 12) & 0xffff); + + return prod_id; +} + +/* + * Get OMAP revision from DIE_REV. + * Early 1710 processors may have broken OMAP_DIE_ID, it contains PROD_ID. + * Undocumented register in the TEST BLOCK is used as fallback. + * REVISIT: This does not seem to work on 1510 */ +static u8 __init omap_get_die_rev(void) +{ + u32 die_rev; + + die_rev = omap_readl(OMAP_DIE_ID_1); + + /* Check for broken OMAP_DIE_ID on early 1710 */ + if (((die_rev >> 12) & 0xffff) == omap_get_jtag_id()) + die_rev = 0; + + die_rev = (die_rev >> 17) & 0xf; + if (die_rev) + return die_rev; + + die_rev = (omap_readl(OMAP32_ID_1) >> 28) & 0xf; + + return die_rev; +} + static void __init omap_check_revision(void) { - system_serial_high = omap_readl(OMAP_ID_BASE); - system_serial_low = OMAP_ID_REG; - system_rev = (OMAP_ID_REG >> ID_SHIFT) & ID_MASK; - - printk("OMAP revision: %d.%d (0x%08x) id: 0x%08x detected as OMAP-", - (system_serial_high >> 20) & 0xf, - (system_serial_high >> 16) & 0xf, - system_serial_high, system_serial_low); - - switch (system_rev) { - case OMAP_ID_730: - printk("730\n"); - system_rev = 0x730; - break; - case OMAP_ID_1510: - printk("1510\n"); - system_rev = 0x1510; + int i; + u16 jtag_id; + u8 die_rev; + u32 omap_id; + u8 cpu_type; + + jtag_id = omap_get_jtag_id(); + die_rev = omap_get_die_rev(); + omap_id = omap_readl(OMAP32_ID_0); + +#ifdef DEBUG + printk("OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0)); + printk("OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n", + omap_readl(OMAP_DIE_ID_1), + (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf); + printk("OMAP_PRODUCTION_ID_0: 0x%08x\n", omap_readl(OMAP_PRODUCTION_ID_0)); + printk("OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n", + omap_readl(OMAP_PRODUCTION_ID_1), + omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff); + printk("OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0)); + printk("OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1)); + printk("JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev); +#endif + + system_serial_high = omap_readl(OMAP_DIE_ID_0); + system_serial_low = omap_readl(OMAP_DIE_ID_1); + + /* First check only the major version in a safe way */ + for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { + if (jtag_id == (omap_ids[i].jtag_id)) { + system_rev = omap_ids[i].type; + break; + } + } + + /* Check if we can find the die revision */ + for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { + if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) { + system_rev = omap_ids[i].type; + break; + } + } + + /* Finally check also the omap_id */ + for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { + if (jtag_id == omap_ids[i].jtag_id + && die_rev == omap_ids[i].die_rev + && omap_id == omap_ids[i].omap_id) { + system_rev = omap_ids[i].type; + break; + } + } + + /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */ + cpu_type = system_rev >> 24; + + switch (cpu_type) { + case 0x07: + system_rev |= 0x07; break; - case OMAP_ID_1610: - printk("1610\n"); - system_rev = 0x1610; + case 0x15: + system_rev |= 0x15; break; - case OMAP_ID_1710: - printk("1710\n"); - system_rev = 0x1710; + case 0x16: + case 0x17: + system_rev |= 0x16; break; - case OMAP_ID_5912: - printk("5912/1611B\n"); - system_rev = 0x5912; + case 0x24: + system_rev |= 0x24; break; default: - printk("unknown, please add support!\n"); + printk("Unknown OMAP cpu type: 0x%02x\n", cpu_type); } + + printk("OMAP%04x", system_rev >> 16); + if ((system_rev >> 8) & 0xff) + printk("%x", (system_rev >> 8) & 0xff); + printk(" revision %i handled as %02xxx id: %08x%08x\n", + die_rev, system_rev & 0xff, system_serial_low, + system_serial_high); } /* @@ -104,25 +232,23 @@ static struct map_desc omap1510_io_desc[] __initdata = { }; #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) static struct map_desc omap1610_io_desc[] __initdata = { - { OMAP1610_DSP_BASE, OMAP1610_DSP_START, OMAP1610_DSP_SIZE, MT_DEVICE }, - { OMAP1610_DSPREG_BASE, OMAP1610_DSPREG_START, OMAP1610_DSPREG_SIZE, MT_DEVICE }, - { OMAP1610_SRAM_BASE, OMAP1610_SRAM_START, OMAP1610_SRAM_SIZE, MT_DEVICE } + { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE }, + { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE }, + { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP1610_SRAM_SIZE, MT_DEVICE } }; -#endif -#ifdef CONFIG_ARCH_OMAP5912 static struct map_desc omap5912_io_desc[] __initdata = { - { OMAP5912_DSP_BASE, OMAP5912_DSP_START, OMAP5912_DSP_SIZE, MT_DEVICE }, - { OMAP5912_DSPREG_BASE, OMAP5912_DSPREG_START, OMAP5912_DSPREG_SIZE, MT_DEVICE }, + { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE }, + { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE }, /* * The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page * size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped. * Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte * can be used. */ - { OMAP5912_SRAM_BASE, OMAP5912_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE } + { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE } }; #endif @@ -137,6 +263,9 @@ static void __init _omap_map_io(void) iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); omap_check_revision(); + /* clear BM to canonicalize CS0 (not CS3) at 0000:0000 */ + omap_writel(omap_readl(EMIFS_CONFIG) & 0x0d, EMIFS_CONFIG); + #ifdef CONFIG_ARCH_OMAP730 if (cpu_is_omap730()) { iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc)); @@ -147,12 +276,10 @@ static void __init _omap_map_io(void) iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) if (cpu_is_omap1610() || cpu_is_omap1710()) { iotable_init(omap1610_io_desc, ARRAY_SIZE(omap1610_io_desc)); } -#endif -#ifdef CONFIG_ARCH_OMAP5912 if (cpu_is_omap5912()) { iotable_init(omap5912_io_desc, ARRAY_SIZE(omap5912_io_desc)); } @@ -166,7 +293,7 @@ static void __init _omap_map_io(void) /* Must init clocks early to assure that timer interrupt works */ - init_ck(); + clk_init(); } /* @@ -178,26 +305,175 @@ void omap_map_io(void) _omap_map_io(); } +static inline unsigned int omap_serial_in(struct plat_serial8250_port *up, + int offset) +{ + offset <<= up->regshift; + return (unsigned int)__raw_readb(up->membase + offset); +} + +static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset, + int value) +{ + offset <<= p->regshift; + __raw_writeb(value, p->membase + offset); +} + +/* + * Internal UARTs need to be initialized for the 8250 autoconfig to work + * properly. Note that the TX watermark initialization may not be needed + * once the 8250.c watermark handling code is merged. + */ +static void __init omap_serial_reset(struct plat_serial8250_port *p) +{ + omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */ + omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */ + omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */ + + if (!cpu_is_omap1510()) { + omap_serial_outp(p, UART_OMAP_SYSC, 0x01); + while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01)); + } +} + +static struct plat_serial8250_port serial_platform_data[] = { + { + .membase = (char*)IO_ADDRESS(OMAP_UART1_BASE), + .mapbase = (unsigned long)OMAP_UART1_BASE, + .irq = INT_UART1, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = OMAP16XX_BASE_BAUD * 16, + }, + { + .membase = (char*)IO_ADDRESS(OMAP_UART2_BASE), + .mapbase = (unsigned long)OMAP_UART2_BASE, + .irq = INT_UART2, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = OMAP16XX_BASE_BAUD * 16, + }, + { + .membase = (char*)IO_ADDRESS(OMAP_UART3_BASE), + .mapbase = (unsigned long)OMAP_UART3_BASE, + .irq = INT_UART3, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = OMAP16XX_BASE_BAUD * 16, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +/* + * Note that on Innovator-1510 UART2 pins conflict with USB2. + * By default UART2 does not work on Innovator-1510 if you have + * USB OHCI enabled. To use UART2, you must disable USB2 first. + */ +void __init omap_serial_init(int ports[OMAP_MAX_NR_PORTS]) +{ + int i; + + if (cpu_is_omap730()) { + serial_platform_data[0].regshift = 0; + serial_platform_data[1].regshift = 0; + serial_platform_data[0].irq = INT_730_UART_MODEM_1; + serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2; + } + + if (cpu_is_omap1510()) { + serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16; + serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16; + serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16; + } + + for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { + unsigned char reg; + + if (ports[i] == 0) { + serial_platform_data[i].membase = 0; + serial_platform_data[i].mapbase = 0; + continue; + } + + switch (i) { + case 0: + if (cpu_is_omap1510()) { + omap_cfg_reg(UART1_TX); + omap_cfg_reg(UART1_RTS); + if (machine_is_omap_innovator()) { + reg = fpga_read(OMAP1510_FPGA_POWER); + reg |= OMAP1510_FPGA_PCR_COM1_EN; + fpga_write(reg, OMAP1510_FPGA_POWER); + udelay(10); + } + } + break; + case 1: + if (cpu_is_omap1510()) { + omap_cfg_reg(UART2_TX); + omap_cfg_reg(UART2_RTS); + if (machine_is_omap_innovator()) { + reg = fpga_read(OMAP1510_FPGA_POWER); + reg |= OMAP1510_FPGA_PCR_COM2_EN; + fpga_write(reg, OMAP1510_FPGA_POWER); + udelay(10); + } + } + break; + case 2: + if (cpu_is_omap1510()) { + omap_cfg_reg(UART3_TX); + omap_cfg_reg(UART3_RX); + } + break; + } + omap_serial_reset(&serial_platform_data[i]); + } +} + +static int __init omap_init(void) +{ + return platform_device_register(&serial_device); +} +arch_initcall(omap_init); + +#define NO_LENGTH_CHECK 0xffffffff + extern int omap_bootloader_tag_len; extern u8 omap_bootloader_tag[]; struct omap_board_config_kernel *omap_board_config; int omap_board_config_size = 0; -const void *__omap_get_config(u16 tag, size_t len) +static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) { - struct omap_board_config_entry *info = NULL; struct omap_board_config_kernel *kinfo = NULL; int i; #ifdef CONFIG_OMAP_BOOT_TAG + struct omap_board_config_entry *info = NULL; + if (omap_bootloader_tag_len > 4) info = (struct omap_board_config_entry *) omap_bootloader_tag; while (info != NULL) { u8 *next; - if (info->tag == tag) - break; + if (info->tag == tag) { + if (skip == 0) + break; + skip--; + } next = (u8 *) info + sizeof(*info) + info->len; if (next >= omap_bootloader_tag + omap_bootloader_tag_len) @@ -208,11 +484,13 @@ const void *__omap_get_config(u16 tag, size_t len) if (info != NULL) { /* Check the length as a lame attempt to check for * binary inconsistancy. */ - if (info->len != len) { + if (len != NO_LENGTH_CHECK && info->len != len) { printk(KERN_ERR "OMAP peripheral config: Length mismatch with tag %x (want %d, got %d)\n", tag, len, info->len); return NULL; } + if (len_out != NULL) + *len_out = info->len; return info->data; } #endif @@ -228,8 +506,19 @@ const void *__omap_get_config(u16 tag, size_t len) return NULL; return kinfo->data; } + +const void *__omap_get_config(u16 tag, size_t len, int nr) +{ + return get_config(tag, len, nr, NULL); +} EXPORT_SYMBOL(__omap_get_config); +const void *omap_get_var_config(u16 tag, size_t *len) +{ + return get_config(tag, NO_LENGTH_CHECK, 0, len); +} +EXPORT_SYMBOL(omap_get_var_config); + static int __init omap_add_serial_console(void) { const struct omap_uart_config *info; diff --git a/arch/arm/mach-omap/common.h b/arch/arm/mach-omap/common.h index 1cc559dd2..9f62858c0 100644 --- a/arch/arm/mach-omap/common.h +++ b/arch/arm/mach-omap/common.h @@ -27,8 +27,10 @@ #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H #define __ARCH_ARM_MACH_OMAP_COMMON_H +struct sys_timer; + extern void omap_map_io(void); +extern struct sys_timer omap_timer; +extern void omap_serial_init(int ports[]); #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ - - diff --git a/arch/arm/mach-omap/dma.c b/arch/arm/mach-omap/dma.c index cfb23d894..515aa6a5e 100644 --- a/arch/arm/mach-omap/dma.c +++ b/arch/arm/mach-omap/dma.c @@ -4,6 +4,9 @@ * Copyright (C) 2003 Nokia Corporation * Author: Juha Yrjölä * DMA channel linking for 1610 by Samuel Ortiz + * Graphics DMA and LCD DMA graphics tranformations + * by Imre Deak + * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc. * * Support functions for the OMAP internal DMA channels. * @@ -26,6 +29,8 @@ #include #include +#include + #define OMAP_DMA_ACTIVE 0x01 #define OMAP_DMA_CCR_EN (1 << 7) @@ -87,6 +92,34 @@ static void clear_lch_regs(int lch) omap_writew(0, lch_base + i); } +void omap_set_dma_priority(int dst_port, int priority) +{ + unsigned long reg; + u32 l; + + switch (dst_port) { + case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */ + reg = OMAP_TC_OCPT1_PRIOR; + break; + case OMAP_DMA_PORT_OCP_T2: /* FFFECCD0 */ + reg = OMAP_TC_OCPT2_PRIOR; + break; + case OMAP_DMA_PORT_EMIFF: /* FFFECC08 */ + reg = OMAP_TC_EMIFF_PRIOR; + break; + case OMAP_DMA_PORT_EMIFS: /* FFFECC04 */ + reg = OMAP_TC_EMIFS_PRIOR; + break; + default: + BUG(); + return; + } + l = omap_readl(reg); + l &= ~(0xf << 8); + l |= (priority & 0xf) << 8; + omap_writel(l, reg); +} + void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, int frame_count, int sync_mode) { @@ -113,51 +146,38 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, omap_writew(frame_count, OMAP_DMA_CFN(lch)); } -void omap_set_dma_constant_fill(int lch, u32 color) +void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) { u16 w; -#ifdef CONFIG_DEBUG_KERNEL - if (omap_dma_in_1510_mode()) { - printk(KERN_ERR "OMAP DMA constant fill not available in 1510 mode."); - BUG(); - return; - } -#endif - w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03; - w |= 0x01; - omap_writew(w, OMAP_DMA_CCR2(lch)); - - omap_writew((u16)color, OMAP_DMA_COLOR_L(lch)); - omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch)); - - w = omap_readw(OMAP_DMA_LCH_CTRL(lch)) & ~0x0f; - w |= 1; /* Channel type G */ - omap_writew(w, OMAP_DMA_LCH_CTRL(lch)); -} - -void omap_set_dma_transparent_copy(int lch, u32 color) -{ - u16 w; + BUG_ON(omap_dma_in_1510_mode()); -#ifdef CONFIG_DEBUG_KERNEL - if (omap_dma_in_1510_mode()) { - printk(KERN_ERR "OMAP DMA transparent copy not available in 1510 mode."); + w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03; + switch (mode) { + case OMAP_DMA_CONSTANT_FILL: + w |= 0x01; + break; + case OMAP_DMA_TRANSPARENT_COPY: + w |= 0x02; + break; + case OMAP_DMA_COLOR_DIS: + break; + default: BUG(); } -#endif - w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03; - w |= 0x02; omap_writew(w, OMAP_DMA_CCR2(lch)); - omap_writew((u16)color, OMAP_DMA_COLOR_L(lch)); - omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch)); - w = omap_readw(OMAP_DMA_LCH_CTRL(lch)) & ~0x0f; - w |= 1; /* Channel type G */ + /* Default is channel type 2D */ + if (mode) { + omap_writew((u16)color, OMAP_DMA_COLOR_L(lch)); + omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch)); + w |= 1; /* Channel type G */ + } omap_writew(w, OMAP_DMA_LCH_CTRL(lch)); } + void omap_set_dma_src_params(int lch, int src_port, int src_amode, unsigned long src_start) { @@ -192,22 +212,24 @@ void omap_set_dma_src_data_pack(int lch, int enable) omap_writew(w, OMAP_DMA_CSDP(lch)); } -void omap_set_dma_src_burst_mode(int lch, int burst_mode) +void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) { u16 w; w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 7); switch (burst_mode) { + case OMAP_DMA_DATA_BURST_DIS: + break; case OMAP_DMA_DATA_BURST_4: w |= (0x01 << 7); break; case OMAP_DMA_DATA_BURST_8: - w |= (0x03 << 7); - break; + /* not supported by current hardware + * w |= (0x03 << 7); + * fall through + */ default: - printk(KERN_ERR "Invalid DMA burst mode\n"); BUG(); - return; } omap_writew(w, OMAP_DMA_CSDP(lch)); } @@ -246,12 +268,14 @@ void omap_set_dma_dest_data_pack(int lch, int enable) omap_writew(w, OMAP_DMA_CSDP(lch)); } -void omap_set_dma_dest_burst_mode(int lch, int burst_mode) +void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) { u16 w; w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 14); switch (burst_mode) { + case OMAP_DMA_DATA_BURST_DIS: + break; case OMAP_DMA_DATA_BURST_4: w |= (0x01 << 14); break; @@ -454,10 +478,6 @@ int omap_request_dma(int dev_id, const char *dev_name, if (dev_id == 0) break; } - if (dev_id != 0 && dma_chan[ch].dev_id == dev_id) { - spin_unlock_irqrestore(&dma_chan_lock, flags); - return -EAGAIN; - } } if (free_ch == -1) { spin_unlock_irqrestore(&dma_chan_lock, flags); @@ -474,7 +494,7 @@ int omap_request_dma(int dev_id, const char *dev_name, chan->data = data; chan->enabled_irqs = OMAP_DMA_TOUT_IRQ | OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; - if (cpu_is_omap1610() || cpu_is_omap5912() || cpu_is_omap730() || cpu_is_omap1710()) { + if (cpu_is_omap16xx() || cpu_is_omap730()) { /* If the sync device is set, configure it dynamically. */ if (dev_id != 0) { set_gdma_dev(free_ch + 1, dev_id); @@ -571,8 +591,15 @@ static struct lcd_dma_info { void (* callback)(u16 status, void *data); void *cb_data; + int active; unsigned long addr, size; int rotate, data_type, xres, yres; + int vxres; + int mirror; + int xscale, yscale; + int ext_ctrl; + int src_port; + int single_transfer; } lcd_dma; void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, @@ -584,14 +611,70 @@ void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, lcd_dma.yres = fb_yres; } +void omap_set_lcd_dma_src_port(int port) +{ + lcd_dma.src_port = port; +} + +void omap_set_lcd_dma_ext_controller(int external) +{ + lcd_dma.ext_ctrl = external; +} + +void omap_set_lcd_dma_single_transfer(int single) +{ + lcd_dma.single_transfer = single; +} + + +void omap_set_lcd_dma_b1_rotation(int rotate) +{ + if (omap_dma_in_1510_mode()) { + printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n"); + BUG(); + return; + } + lcd_dma.rotate = rotate; +} + +void omap_set_lcd_dma_b1_mirror(int mirror) +{ + if (omap_dma_in_1510_mode()) { + printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n"); + BUG(); + } + lcd_dma.mirror = mirror; +} + +void omap_set_lcd_dma_b1_vxres(unsigned long vxres) +{ + if (omap_dma_in_1510_mode()) { + printk(KERN_ERR "DMA virtual resulotion is not supported " + "in 1510 mode\n"); + BUG(); + } + lcd_dma.vxres = vxres; +} + +void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale) +{ + if (omap_dma_in_1510_mode()) { + printk(KERN_ERR "DMA scale is not supported in 1510 mode\n"); + BUG(); + } + lcd_dma.xscale = xscale; + lcd_dma.yscale = yscale; +} + static void set_b1_regs(void) { unsigned long top, bottom; int es; - u16 w, en, fn; - s16 ei; - s32 fi; - u32 l; + u16 w; + unsigned long en, fn; + long ei, fi; + unsigned long vxres; + unsigned int xscale, yscale; switch (lcd_dma.data_type) { case OMAP_DMA_DATA_TYPE_S8: @@ -608,25 +691,81 @@ static void set_b1_regs(void) return; } - if (lcd_dma.rotate == 0) { - top = lcd_dma.addr; - bottom = lcd_dma.addr + (lcd_dma.xres * lcd_dma.yres - 1) * es; - /* 1510 DMA requires the bottom address to be 2 more than the - * actual last memory access location. */ - if (omap_dma_in_1510_mode() && - lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32) - bottom += 2; + vxres = lcd_dma.vxres ? lcd_dma.vxres : lcd_dma.xres; + xscale = lcd_dma.xscale ? lcd_dma.xscale : 1; + yscale = lcd_dma.yscale ? lcd_dma.yscale : 1; + BUG_ON(vxres < lcd_dma.xres); +#define PIXADDR(x,y) (lcd_dma.addr + ((y) * vxres * yscale + (x) * xscale) * es) +#define PIXSTEP(sx, sy, dx, dy) (PIXADDR(dx, dy) - PIXADDR(sx, sy) - es + 1) + switch (lcd_dma.rotate) { + case 0: + if (!lcd_dma.mirror) { + top = PIXADDR(0, 0); + bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); + /* 1510 DMA requires the bottom address to be 2 more + * than the actual last memory access location. */ + if (omap_dma_in_1510_mode() && + lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32) + bottom += 2; + ei = PIXSTEP(0, 0, 1, 0); + fi = PIXSTEP(lcd_dma.xres - 1, 0, 0, 1); + } else { + top = PIXADDR(lcd_dma.xres - 1, 0); + bottom = PIXADDR(0, lcd_dma.yres - 1); + ei = PIXSTEP(1, 0, 0, 0); + fi = PIXSTEP(0, 0, lcd_dma.xres - 1, 1); + } en = lcd_dma.xres; fn = lcd_dma.yres; - ei = 0; - fi = 0; - } else { - top = lcd_dma.addr + (lcd_dma.xres - 1) * es; - bottom = lcd_dma.addr + (lcd_dma.yres - 1) * lcd_dma.xres * es; + break; + case 90: + if (!lcd_dma.mirror) { + top = PIXADDR(0, lcd_dma.yres - 1); + bottom = PIXADDR(lcd_dma.xres - 1, 0); + ei = PIXSTEP(0, 1, 0, 0); + fi = PIXSTEP(0, 0, 1, lcd_dma.yres - 1); + } else { + top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); + bottom = PIXADDR(0, 0); + ei = PIXSTEP(0, 1, 0, 0); + fi = PIXSTEP(1, 0, 0, lcd_dma.yres - 1); + } en = lcd_dma.yres; fn = lcd_dma.xres; - ei = (lcd_dma.xres - 1) * es + 1; - fi = -(lcd_dma.xres * (lcd_dma.yres - 1) + 2) * 2 + 1; + break; + case 180: + if (!lcd_dma.mirror) { + top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); + bottom = PIXADDR(0, 0); + ei = PIXSTEP(1, 0, 0, 0); + fi = PIXSTEP(0, 1, lcd_dma.xres - 1, 0); + } else { + top = PIXADDR(0, lcd_dma.yres - 1); + bottom = PIXADDR(lcd_dma.xres - 1, 0); + ei = PIXSTEP(0, 0, 1, 0); + fi = PIXSTEP(lcd_dma.xres - 1, 1, 0, 0); + } + en = lcd_dma.xres; + fn = lcd_dma.yres; + break; + case 270: + if (!lcd_dma.mirror) { + top = PIXADDR(lcd_dma.xres - 1, 0); + bottom = PIXADDR(0, lcd_dma.yres - 1); + ei = PIXSTEP(0, 0, 0, 1); + fi = PIXSTEP(1, lcd_dma.yres - 1, 0, 0); + } else { + top = PIXADDR(0, 0); + bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); + ei = PIXSTEP(0, 0, 0, 1); + fi = PIXSTEP(0, lcd_dma.yres - 1, 1, 0); + } + en = lcd_dma.yres; + fn = lcd_dma.xres; + break; + default: + BUG(); + return; /* Supress warning about uninitialized vars */ } if (omap_dma_in_1510_mode()) { @@ -652,33 +791,50 @@ static void set_b1_regs(void) w |= lcd_dma.data_type; omap_writew(w, OMAP1610_DMA_LCD_CSDP); - if (!lcd_dma.rotate) + w = omap_readw(OMAP1610_DMA_LCD_CTRL); + /* Always set the source port as SDRAM for now*/ + w &= ~(0x03 << 6); + if (lcd_dma.ext_ctrl) + w |= 1 << 8; + else + w &= ~(1 << 8); + if (lcd_dma.callback != NULL) + w |= 1 << 1; /* Block interrupt enable */ + else + w &= ~(1 << 1); + omap_writew(w, OMAP1610_DMA_LCD_CTRL); + + if (!(lcd_dma.rotate || lcd_dma.mirror || + lcd_dma.vxres || lcd_dma.xscale || lcd_dma.yscale)) return; - /* Rotation stuff */ - l = omap_readw(OMAP1610_DMA_LCD_CSDP); - /* Disable burst access */ - l &= ~(0x03 << 7); - omap_writew(l, OMAP1610_DMA_LCD_CSDP); - - l = omap_readw(OMAP1610_DMA_LCD_CCR); + w = omap_readw(OMAP1610_DMA_LCD_CCR); /* Set the double-indexed addressing mode */ - l |= (0x03 << 12); - omap_writew(l, OMAP1610_DMA_LCD_CCR); + w |= (0x03 << 12); + omap_writew(w, OMAP1610_DMA_LCD_CCR); omap_writew(ei, OMAP1610_DMA_LCD_SRC_EI_B1); omap_writew(fi >> 16, OMAP1610_DMA_LCD_SRC_FI_B1_U); omap_writew(fi, OMAP1610_DMA_LCD_SRC_FI_B1_L); } -void omap_set_lcd_dma_b1_rotation(int rotate) +static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) { - if (omap_dma_in_1510_mode()) { - printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n"); - BUG(); - return; + u16 w; + + w = omap_readw(OMAP1610_DMA_LCD_CTRL); + if (unlikely(!(w & (1 << 3)))) { + printk(KERN_WARNING "Spurious LCD DMA IRQ\n"); + return IRQ_NONE; } - lcd_dma.rotate = rotate; + /* Ack the IRQ */ + w |= (1 << 3); + omap_writew(w, OMAP1610_DMA_LCD_CTRL); + lcd_dma.active = 0; + if (lcd_dma.callback != NULL) + lcd_dma.callback(w, lcd_dma.cb_data); + + return IRQ_HANDLED; } int omap_request_lcd_dma(void (* callback)(u16 status, void *data), @@ -695,6 +851,15 @@ int omap_request_lcd_dma(void (* callback)(u16 status, void *data), spin_unlock_irq(&lcd_dma.lock); lcd_dma.callback = callback; lcd_dma.cb_data = data; + lcd_dma.active = 0; + lcd_dma.single_transfer = 0; + lcd_dma.rotate = 0; + lcd_dma.vxres = 0; + lcd_dma.mirror = 0; + lcd_dma.xscale = 0; + lcd_dma.yscale = 0; + lcd_dma.ext_ctrl = 0; + lcd_dma.src_port = 0; return 0; } @@ -714,23 +879,97 @@ void omap_free_lcd_dma(void) spin_unlock(&lcd_dma.lock); } -void omap_start_lcd_dma(void) +void omap_enable_lcd_dma(void) { + u16 w; + + /* Set the Enable bit only if an external controller is + * connected. Otherwise the OMAP internal controller will + * start the transfer when it gets enabled. + */ + if (enable_1510_mode || !lcd_dma.ext_ctrl) + return; + w = omap_readw(OMAP1610_DMA_LCD_CCR); + w |= 1 << 7; + omap_writew(w, OMAP1610_DMA_LCD_CCR); + lcd_dma.active = 1; +} + +void omap_setup_lcd_dma(void) +{ + BUG_ON(lcd_dma.active); if (!enable_1510_mode) { /* Set some reasonable defaults */ + omap_writew(0x5440, OMAP1610_DMA_LCD_CCR); omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP); omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL); - omap_writew(0x5740, OMAP1610_DMA_LCD_CCR); } set_b1_regs(); - if (!enable_1510_mode) - omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) | 1, OMAP1610_DMA_LCD_CCR); + if (!enable_1510_mode) { + u16 w; + + w = omap_readw(OMAP1610_DMA_LCD_CCR); + /* If DMA was already active set the end_prog bit to have + * the programmed register set loaded into the active + * register set. + */ + w |= 1 << 11; /* End_prog */ + if (!lcd_dma.single_transfer) + w |= (3 << 8); /* Auto_init, repeat */ + omap_writew(w, OMAP1610_DMA_LCD_CCR); + } } void omap_stop_lcd_dma(void) { - if (!enable_1510_mode) - omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1, OMAP1610_DMA_LCD_CCR); + lcd_dma.active = 0; + if (!enable_1510_mode && lcd_dma.ext_ctrl) + omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~(1 << 7), + OMAP1610_DMA_LCD_CCR); +} + +/* + * Clears any DMA state so the DMA engine is ready to restart with new buffers + * through omap_start_dma(). Any buffers in flight are discarded. + */ +void omap_clear_dma(int lch) +{ + unsigned long flags; + int status; + + local_irq_save(flags); + omap_writew(omap_readw(OMAP_DMA_CCR(lch)) & ~OMAP_DMA_CCR_EN, + OMAP_DMA_CCR(lch)); + status = OMAP_DMA_CSR(lch); /* clear pending interrupts */ + local_irq_restore(flags); +} + +/* + * Returns current physical source address for the given DMA channel. + * If the channel is running the caller must disable interrupts prior calling + * this function and process the returned value before re-enabling interrupt to + * prevent races with the interrupt handler. Note that in continuous mode there + * is a chance for CSSA_L register overflow inbetween the two reads resulting + * in incorrect return value. + */ +dma_addr_t omap_get_dma_src_pos(int lch) +{ + return (dma_addr_t) (OMAP_DMA_CSSA_L(lch) | + (OMAP_DMA_CSSA_U(lch) << 16)); +} + +/* + * Returns current physical destination address for the given DMA channel. + * If the channel is running the caller must disable interrupts prior calling + * this function and process the returned value before re-enabling interrupt to + * prevent races with the interrupt handler. Note that in continuous mode there + * is a chance for CDSA_L register overflow inbetween the two reads resulting + * in incorrect return value. + */ +dma_addr_t omap_get_dma_dst_pos(int lch) +{ + return (dma_addr_t) (OMAP_DMA_CDSA_L(lch) | + (OMAP_DMA_CDSA_U(lch) << 16)); } static int __init omap_init_dma(void) @@ -741,7 +980,7 @@ static int __init omap_init_dma(void) printk(KERN_INFO "DMA support for OMAP1510 initialized\n"); dma_chan_count = 9; enable_1510_mode = 1; - } else if (cpu_is_omap1610() || cpu_is_omap5912() || cpu_is_omap730() || cpu_is_omap1710()) { + } else if (cpu_is_omap16xx() || cpu_is_omap730()) { printk(KERN_INFO "OMAP DMA hardware version %d\n", omap_readw(OMAP_DMA_HW_ID)); printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n", @@ -756,7 +995,7 @@ static int __init omap_init_dma(void) w = omap_readw(OMAP_DMA_GSCR); w |= 1 << 3; omap_writew(w, OMAP_DMA_GSCR); - dma_chan_count = OMAP_LOGICAL_DMA_CH_COUNT; + dma_chan_count = 16; } else dma_chan_count = 9; } else { @@ -790,11 +1029,25 @@ static int __init omap_init_dma(void) return r; } } - + r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, "LCD DMA", NULL); + if (r != 0) { + int i; + + printk(KERN_ERR "unable to request IRQ for LCD DMA (error %d)\n", r); + for (i = 0; i < dma_chan_count; i++) + free_irq(dma_irq[i], (void *) (i + 1)); + return r; + } return 0; } + arch_initcall(omap_init_dma); + +EXPORT_SYMBOL(omap_get_dma_src_pos); +EXPORT_SYMBOL(omap_get_dma_dst_pos); +EXPORT_SYMBOL(omap_clear_dma); +EXPORT_SYMBOL(omap_set_dma_priority); EXPORT_SYMBOL(omap_request_dma); EXPORT_SYMBOL(omap_free_dma); EXPORT_SYMBOL(omap_start_dma); @@ -803,8 +1056,7 @@ EXPORT_SYMBOL(omap_enable_dma_irq); EXPORT_SYMBOL(omap_disable_dma_irq); EXPORT_SYMBOL(omap_set_dma_transfer_params); -EXPORT_SYMBOL(omap_set_dma_constant_fill); -EXPORT_SYMBOL(omap_set_dma_transparent_copy); +EXPORT_SYMBOL(omap_set_dma_color_mode); EXPORT_SYMBOL(omap_set_dma_src_params); EXPORT_SYMBOL(omap_set_dma_src_index); @@ -821,7 +1073,14 @@ EXPORT_SYMBOL(omap_dma_unlink_lch); EXPORT_SYMBOL(omap_request_lcd_dma); EXPORT_SYMBOL(omap_free_lcd_dma); -EXPORT_SYMBOL(omap_start_lcd_dma); +EXPORT_SYMBOL(omap_enable_lcd_dma); +EXPORT_SYMBOL(omap_setup_lcd_dma); EXPORT_SYMBOL(omap_stop_lcd_dma); EXPORT_SYMBOL(omap_set_lcd_dma_b1); +EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer); +EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller); EXPORT_SYMBOL(omap_set_lcd_dma_b1_rotation); +EXPORT_SYMBOL(omap_set_lcd_dma_b1_vxres); +EXPORT_SYMBOL(omap_set_lcd_dma_b1_scale); +EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror); + diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c index 206bee968..e66dcf6ff 100644 --- a/arch/arm/mach-omap/gpio.c +++ b/arch/arm/mach-omap/gpio.c @@ -94,7 +94,7 @@ struct gpio_bank { #define METHOD_GPIO_1610 2 #define METHOD_GPIO_730 3 -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) +#if defined(CONFIG_ARCH_OMAP16XX) static struct gpio_bank gpio_bank_1610[5] = { { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO}, { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 }, @@ -135,8 +135,8 @@ static inline struct gpio_bank *get_gpio_bank(int gpio) return &gpio_bank[1]; } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) - if (cpu_is_omap1610() || cpu_is_omap1710() || cpu_is_omap5912()) { +#if defined(CONFIG_ARCH_OMAP16XX) + if (cpu_is_omap16xx()) { if (OMAP_GPIO_IS_MPUIO(gpio)) return &gpio_bank[0]; return &gpio_bank[1 + (gpio >> 4)]; @@ -172,8 +172,8 @@ static inline int gpio_valid(int gpio) if (cpu_is_omap1510() && gpio < 16) return 0; #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) - if ((cpu_is_omap1610() || cpu_is_omap1710() || cpu_is_omap5912()) && gpio < 64) +#if defined(CONFIG_ARCH_OMAP16XX) + if ((cpu_is_omap16xx()) && gpio < 64) return 0; #endif #ifdef CONFIG_ARCH_OMAP730 @@ -554,7 +554,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, if (bank->method == METHOD_GPIO_1510) isr_reg = bank->base + OMAP1510_GPIO_INT_STATUS; #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) +#if defined(CONFIG_ARCH_OMAP16XX) if (bank->method == METHOD_GPIO_1610) isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1; #endif @@ -588,7 +588,7 @@ static void gpio_ack_irq(unsigned int irq) if (bank->method == METHOD_GPIO_1510) __raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1510_GPIO_INT_STATUS); #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) +#if defined(CONFIG_ARCH_OMAP16XX) if (bank->method == METHOD_GPIO_1610) __raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1610_GPIO_IRQSTATUS1); #endif @@ -668,8 +668,8 @@ static int __init _omap_gpio_init(void) gpio_bank = gpio_bank_1510; } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) - if (cpu_is_omap1610() || cpu_is_omap1710() || cpu_is_omap5912()) { +#if defined(CONFIG_ARCH_OMAP16XX) + if (cpu_is_omap16xx()) { int rev; gpio_bank_count = 5; @@ -702,7 +702,7 @@ static int __init _omap_gpio_init(void) __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS); } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) || defined(CONFIG_ARCH_OMAP5912) +#if defined(CONFIG_ARCH_OMAP16XX) if (bank->method == METHOD_GPIO_1610) { __raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1); __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1); @@ -722,7 +722,7 @@ static int __init _omap_gpio_init(void) set_irq_chip(j, &mpuio_irq_chip); else set_irq_chip(j, &gpio_irq_chip); - set_irq_handler(j, do_level_IRQ); + set_irq_handler(j, do_edge_IRQ); set_irq_flags(j, IRQF_VALID); } set_irq_chained_handler(bank->irq, gpio_irq_handler); diff --git a/arch/arm/mach-omap/irq.c b/arch/arm/mach-omap/irq.c index 3eec2986b..f01c99266 100644 --- a/arch/arm/mach-omap/irq.c +++ b/arch/arm/mach-omap/irq.c @@ -140,12 +140,11 @@ static struct omap_irq_bank omap1510_irq_banks[] = { }; #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912) \ - || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) static struct omap_irq_bank omap1610_irq_banks[] = { { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f }, - { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfffff7ff }, + { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb7c1fd }, { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0xfffff7ff }, { .base_reg = OMAP_IH2_BASE + 0x200, .trigger_map = 0xffffffff }, }; @@ -173,9 +172,8 @@ void __init omap_init_irq(void) irq_bank_count = ARRAY_SIZE(omap1510_irq_banks); } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912) \ - || defined(CONFIG_ARCH_OMAP1710) - if (cpu_is_omap1610() || cpu_is_omap5912() || cpu_is_omap1710()) { +#if defined(CONFIG_ARCH_OMAP16XX) + if (cpu_is_omap16xx()) { irq_banks = omap1610_irq_banks; irq_bank_count = ARRAY_SIZE(omap1610_irq_banks); } diff --git a/arch/arm/mach-omap/mcbsp.c b/arch/arm/mach-omap/mcbsp.c index d334395f1..7c4ad7713 100644 --- a/arch/arm/mach-omap/mcbsp.c +++ b/arch/arm/mach-omap/mcbsp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -28,6 +29,8 @@ #include #include +#include + #ifdef CONFIG_MCBSP_DEBUG #define DBG(x...) printk(x) #else @@ -61,6 +64,8 @@ struct omap_mcbsp { }; static struct omap_mcbsp mcbsp[OMAP_MAX_MCBSP_COUNT]; +static struct clk *mcbsp_dsp_ck = 0; +static struct clk *mcbsp_api_ck = 0; static void omap_mcbsp_dump_reg(u8 id) @@ -153,8 +158,8 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config OMAP_MCBSP_WRITE(io_base, XCR1, config->xcr1); OMAP_MCBSP_WRITE(io_base, SRGR2, config->srgr2); OMAP_MCBSP_WRITE(io_base, SRGR1, config->srgr1); - OMAP_MCBSP_WRITE(io_base, SRGR2, config->mcr2); - OMAP_MCBSP_WRITE(io_base, SRGR1, config->mcr1); + OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2); + OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1); OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0); } @@ -181,6 +186,7 @@ static int omap_mcbsp_check(unsigned int id) return -1; } +#define EN_XORPCK 1 #define DSP_RSTCT2 0xe1008014 static void omap_mcbsp_dsp_request(void) @@ -188,10 +194,8 @@ static void omap_mcbsp_dsp_request(void) if (cpu_is_omap1510() || cpu_is_omap1610() || cpu_is_omap1710()) { omap_writew((omap_readw(ARM_RSTCT1) | (1 << 1) | (1 << 2)), ARM_RSTCT1); - omap_writew((omap_readw(ARM_CKCTL) | 1 << EN_DSPCK), - ARM_CKCTL); - omap_writew((omap_readw(ARM_IDLECT2) | (1 << EN_APICK)), - ARM_IDLECT2); + clk_enable(mcbsp_dsp_ck); + clk_enable(mcbsp_api_ck); /* enable 12MHz clock to mcbsp 1 & 3 */ __raw_writew(__raw_readw(DSP_IDLECT2) | (1 << EN_XORPCK), @@ -588,7 +592,7 @@ static const struct omap_mcbsp_info mcbsp_1510[] = { }; #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) static const struct omap_mcbsp_info mcbsp_1610[] = { [0] = { .virt_base = OMAP1610_MCBSP1_BASE, .dma_rx_sync = OMAP_DMA_MCBSP1_RX, @@ -614,6 +618,18 @@ static int __init omap_mcbsp_init(void) static const struct omap_mcbsp_info *mcbsp_info; printk("Initializing OMAP McBSP system\n"); + + mcbsp_dsp_ck = clk_get(0, "dsp_ck"); + if (IS_ERR(mcbsp_dsp_ck)) { + printk(KERN_ERR "mcbsp: could not acquire dsp_ck handle.\n"); + return PTR_ERR(mcbsp_dsp_ck); + } + mcbsp_api_ck = clk_get(0, "api_ck"); + if (IS_ERR(mcbsp_dsp_ck)) { + printk(KERN_ERR "mcbsp: could not acquire api_ck handle.\n"); + return PTR_ERR(mcbsp_api_ck); + } + #ifdef CONFIG_ARCH_OMAP730 if (cpu_is_omap730()) { mcbsp_info = mcbsp_730; @@ -626,7 +642,7 @@ static int __init omap_mcbsp_init(void) mcbsp_count = ARRAY_SIZE(mcbsp_1510); } #endif -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) if (cpu_is_omap1610() || cpu_is_omap1710()) { mcbsp_info = mcbsp_1610; mcbsp_count = ARRAY_SIZE(mcbsp_1610); diff --git a/arch/arm/mach-omap/mux.c b/arch/arm/mach-omap/mux.c index 70665dfaf..bcf3c6e5e 100644 --- a/arch/arm/mach-omap/mux.c +++ b/arch/arm/mach-omap/mux.c @@ -32,18 +32,26 @@ #define __MUX_C__ #include +#ifdef CONFIG_OMAP_MUX + /* * Sets the Omap MUX and PULL_DWN registers based on the table */ -int omap_cfg_reg(const reg_cfg_t reg_cfg) +int __init_or_module +omap_cfg_reg(const reg_cfg_t reg_cfg) { -#ifdef CONFIG_OMAP_MUX - static spinlock_t mux_spin_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(mux_spin_lock); unsigned long flags; reg_cfg_set *cfg; unsigned int reg_orig = 0, reg = 0, pu_pd_orig = 0, pu_pd = 0, pull_orig = 0, pull = 0; + unsigned int mask, warn = 0; + + if (reg_cfg > ARRAY_SIZE(reg_cfg_table)) { + printk(KERN_ERR "MUX: reg_cfg %d\n", reg_cfg); + return -EINVAL; + } cfg = ®_cfg_table[reg_cfg]; @@ -56,12 +64,20 @@ int omap_cfg_reg(const reg_cfg_t reg_cfg) /* Check the mux register in question */ if (cfg->mux_reg) { + unsigned tmp1, tmp2; + reg_orig = omap_readl(cfg->mux_reg); /* The mux registers always seem to be 3 bits long */ - reg = reg_orig & ~(0x7 << cfg->mask_offset); + mask = (0x7 << cfg->mask_offset); + tmp1 = reg_orig & mask; + reg = reg_orig & ~mask; + + tmp2 = (cfg->mask << cfg->mask_offset); + reg |= tmp2; - reg |= (cfg->mask << cfg->mask_offset); + if (tmp1 != tmp2) + warn = 1; omap_writel(reg, cfg->mux_reg); } @@ -70,12 +86,18 @@ int omap_cfg_reg(const reg_cfg_t reg_cfg) if (!cpu_is_omap1510()) { if (cfg->pu_pd_reg && cfg->pull_val) { pu_pd_orig = omap_readl(cfg->pu_pd_reg); + mask = 1 << cfg->pull_bit; + if (cfg->pu_pd_val) { + if (!(pu_pd_orig & mask)) + warn = 1; /* Use pull up */ - pu_pd = pu_pd_orig | (1 << cfg->pull_bit); + pu_pd = pu_pd_orig | mask; } else { + if (pu_pd_orig & mask) + warn = 1; /* Use pull down */ - pu_pd = pu_pd_orig & ~(1 << cfg->pull_bit); + pu_pd = pu_pd_orig & ~mask; } omap_writel(pu_pd, cfg->pu_pd_reg); } @@ -84,21 +106,32 @@ int omap_cfg_reg(const reg_cfg_t reg_cfg) /* Check for an associated pull down register */ if (cfg->pull_reg) { pull_orig = omap_readl(cfg->pull_reg); + mask = 1 << cfg->pull_bit; if (cfg->pull_val) { + if (pull_orig & mask) + warn = 1; /* Low bit = pull enabled */ - pull = pull_orig & ~(1 << cfg->pull_bit); + pull = pull_orig & ~mask; } else { + if (!(pull_orig & mask)) + warn = 1; /* High bit = pull disabled */ - pull = pull_orig | (1 << cfg->pull_bit); + pull = pull_orig | mask; } omap_writel(pull, cfg->pull_reg); } + if (warn) { +#ifdef CONFIG_OMAP_MUX_WARNINGS + printk(KERN_WARNING "MUX: initialized %s\n", cfg->name); +#endif + } + #ifdef CONFIG_OMAP_MUX_DEBUG - if (cfg->debug) { - printk("Omap: Setting register %s\n", cfg->name); + if (cfg->debug || warn) { + printk("MUX: Setting register %s\n", cfg->name); printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg); @@ -118,8 +151,13 @@ int omap_cfg_reg(const reg_cfg_t reg_cfg) spin_unlock_irqrestore(&mux_spin_lock, flags); -#endif +#ifdef CONFIG_OMAP_MUX_ERRORS + return warn ? -ETXTBSY : 0; +#else return 0; +#endif } EXPORT_SYMBOL(omap_cfg_reg); + +#endif /* CONFIG_OMAP_MUX */ diff --git a/arch/arm/mach-omap/ocpi.c b/arch/arm/mach-omap/ocpi.c index 93c7f4aca..e27041ffe 100644 --- a/arch/arm/mach-omap/ocpi.c +++ b/arch/arm/mach-omap/ocpi.c @@ -59,20 +59,12 @@ int ocpi_enable(void) /* Make sure there's clock for OCPI */ -#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP1710) +#if defined(CONFIG_ARCH_OMAP16XX) if (cpu_is_omap1610() || cpu_is_omap1710()) { - val = omap_readl(OMAP1610_ARM_IDLECT3); + val = omap_readl(OMAP16XX_ARM_IDLECT3); val |= EN_OCPI_CK; val &= ~IDLOCPI_ARM; - omap_writel(val, OMAP1610_ARM_IDLECT3); - } -#endif -#ifdef CONFIG_ARCH_OMAP5912 - if (cpu_is_omap5912()) { - val = omap_readl(OMAP5912_ARM_IDLECT3); - val |= EN_OCPI_CK; - val &= ~IDLOCPI_ARM; - omap_writel(val, OMAP5912_ARM_IDLECT3); + omap_writel(val, OMAP16XX_ARM_IDLECT3); } #endif /* Enable access for OHCI in OCPI */ diff --git a/arch/arm/mach-omap/pm.c b/arch/arm/mach-omap/pm.c index 095322c8f..68a4ec092 100644 --- a/arch/arm/mach-omap/pm.c +++ b/arch/arm/mach-omap/pm.c @@ -81,6 +81,12 @@ void omap_pm_idle(void) mask32 = omap_readl(ARM_SYSST); local_fiq_enable(); local_irq_enable(); + +#if defined(CONFIG_OMAP_32K_TIMER) && defined(CONFIG_NO_IDLE_HZ) + /* Override timer to use VST for the next cycle */ + omap_32k_timer_next_vst_interrupt(); +#endif + if ((mask32 & DSP_IDLE) == 0) { __asm__ volatile ("mcr p15, 0, r0, c7, c0, 4"); } else { @@ -508,7 +514,7 @@ static void omap_pm_init_proc(void) */ //#include -static int omap_pm_prepare(u32 state) +static int omap_pm_prepare(suspend_state_t state) { int error = 0; @@ -535,7 +541,7 @@ static int omap_pm_prepare(u32 state) * */ -static int omap_pm_enter(u32 state) +static int omap_pm_enter(suspend_state_t state) { switch (state) { @@ -563,7 +569,7 @@ static int omap_pm_enter(u32 state) * failed). */ -static int omap_pm_finish(u32 state) +static int omap_pm_finish(suspend_state_t state) { return 0; } diff --git a/arch/arm/mach-omap/time.c b/arch/arm/mach-omap/time.c index cb3c5d6f7..f673eeedd 100644 --- a/arch/arm/mach-omap/time.c +++ b/arch/arm/mach-omap/time.c @@ -1,8 +1,14 @@ /* - * arch/arm/mach-omap/time.c + * linux/arch/arm/mach-omap/time.c * - * OMAP Timer Tick + * OMAP Timers * + * Copyright (C) 2004 Nokia Corporation + * Partial timer rewrite and additional VST timer support by + * Tony Lindgen and + * Tuukka Tikkanen + * + * MPU timer code based on the older MPU timer code for OMAP * Copyright (C) 2000 RidgeRun, Inc. * Author: Greg Lonnon * @@ -33,6 +39,7 @@ #include #include #include +#include #include #include @@ -41,177 +48,135 @@ #include #include #include -#include - -#ifndef __instrument -#define __instrument -#define __noinstrument __attribute__ ((no_instrument_function)) -#endif -typedef struct { - u32 cntl; /* CNTL_TIMER, R/W */ - u32 load_tim; /* LOAD_TIM, W */ - u32 read_tim; /* READ_TIM, R */ -} mputimer_regs_t; - -#define mputimer_base(n) \ - ((volatile mputimer_regs_t*)IO_ADDRESS(OMAP_MPUTIMER_BASE + \ - (n)*OMAP_MPUTIMER_OFFSET)) - -static inline unsigned long timer32k_read(int reg) { - unsigned long val; - val = omap_readw(reg + OMAP_32kHz_TIMER_BASE); - return val; -} -static inline void timer32k_write(int reg,int val) { - omap_writew(val, reg + OMAP_32kHz_TIMER_BASE); -} +struct sys_timer omap_timer; /* - * How long is the timer interval? 100 HZ, right... - * IRQ rate = (TVR + 1) / 32768 seconds - * TVR = 32768 * IRQ_RATE -1 - * IRQ_RATE = 1/100 - * TVR = 326 + * --------------------------------------------------------------------------- + * MPU timer + * --------------------------------------------------------------------------- */ -#define TIMER32k_PERIOD 326 -//#define TIMER32k_PERIOD 0x7ff +#define OMAP_MPU_TIMER1_BASE (0xfffec500) +#define OMAP_MPU_TIMER2_BASE (0xfffec600) +#define OMAP_MPU_TIMER3_BASE (0xfffec700) +#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE +#define OMAP_MPU_TIMER_OFFSET 0x100 -static inline void start_timer32k(void) { - timer32k_write(TIMER32k_CR, - TIMER32k_TSS | TIMER32k_TRB | - TIMER32k_INT | TIMER32k_ARL); -} +#define MPU_TIMER_FREE (1 << 6) +#define MPU_TIMER_CLOCK_ENABLE (1 << 5) +#define MPU_TIMER_AR (1 << 1) +#define MPU_TIMER_ST (1 << 0) -#ifdef CONFIG_MACH_OMAP_PERSEUS2 /* - * After programming PTV with 0 and setting the MPUTIM_CLOCK_ENABLE - * (external clock enable) bit, the timer count rate is 6.5 MHz (13 - * MHZ input/2). !! The divider by 2 is undocumented !! + * MPU_TICKS_PER_SEC must be an even number, otherwise machinecycles_to_usecs + * will break. On P2, the timer count rate is 6.5 MHz after programming PTV + * with 0. This divides the 13MHz input by 2, and is undocumented. */ -#define MPUTICKS_PER_SEC (13000000/2) -#else -/* - * After programming PTV with 0, the timer count rate is 6 MHz. - * WARNING! this must be an even number, or machinecycles_to_usecs - * below will break. +#ifdef CONFIG_MACH_OMAP_PERSEUS2 +/* REVISIT: This ifdef construct should be replaced by a query to clock + * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz. */ -#define MPUTICKS_PER_SEC (12000000/2) +#define MPU_TICKS_PER_SEC (13000000 / 2) +#else +#define MPU_TICKS_PER_SEC (12000000 / 2) #endif -static int mputimer_started[3] = {0,0,0}; +#define MPU_TIMER_TICK_PERIOD ((MPU_TICKS_PER_SEC / HZ) - 1) -static inline void __noinstrument start_mputimer(int n, - unsigned long load_val) -{ - volatile mputimer_regs_t* timer = mputimer_base(n); - - mputimer_started[n] = 0; - timer->cntl = MPUTIM_CLOCK_ENABLE; - udelay(1); - - timer->load_tim = load_val; - udelay(1); - timer->cntl = (MPUTIM_CLOCK_ENABLE | MPUTIM_AR | MPUTIM_ST); - mputimer_started[n] = 1; -} +typedef struct { + u32 cntl; /* CNTL_TIMER, R/W */ + u32 load_tim; /* LOAD_TIM, W */ + u32 read_tim; /* READ_TIM, R */ +} omap_mpu_timer_regs_t; -static inline unsigned long __noinstrument -read_mputimer(int n) -{ - volatile mputimer_regs_t* timer = mputimer_base(n); - return (mputimer_started[n] ? timer->read_tim : 0); -} +#define omap_mpu_timer_base(n) \ +((volatile omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ + (n)*OMAP_MPU_TIMER_OFFSET)) -void __noinstrument start_mputimer1(unsigned long load_val) -{ - start_mputimer(0, load_val); -} -void __noinstrument start_mputimer2(unsigned long load_val) +static inline unsigned long omap_mpu_timer_read(int nr) { - start_mputimer(1, load_val); -} -void __noinstrument start_mputimer3(unsigned long load_val) -{ - start_mputimer(2, load_val); + volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + return timer->read_tim; } -unsigned long __noinstrument read_mputimer1(void) -{ - return read_mputimer(0); -} -unsigned long __noinstrument read_mputimer2(void) -{ - return read_mputimer(1); -} -unsigned long __noinstrument read_mputimer3(void) +static inline void omap_mpu_timer_start(int nr, unsigned long load_val) { - return read_mputimer(2); -} + volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); -unsigned long __noinstrument do_getmachinecycles(void) -{ - return 0 - read_mputimer(0); + timer->cntl = MPU_TIMER_CLOCK_ENABLE; + udelay(1); + timer->load_tim = load_val; + udelay(1); + timer->cntl = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_AR | MPU_TIMER_ST); } -unsigned long __noinstrument machinecycles_to_usecs(unsigned long mputicks) +unsigned long omap_mpu_timer_ticks_to_usecs(unsigned long nr_ticks) { /* Round up to nearest usec */ - return ((mputicks * 1000) / (MPUTICKS_PER_SEC / 2 / 1000) + 1) >> 1; + return ((nr_ticks * 1000) / (MPU_TICKS_PER_SEC / 2 / 1000) + 1) >> 1; } /* - * This marks the time of the last system timer interrupt - * that was *processed by the ISR* (timer 2). + * Last processed system timer interrupt */ -static unsigned long systimer_mark; +static unsigned long omap_mpu_timer_last = 0; -static unsigned long omap_gettimeoffset(void) +/* + * Returns elapsed usecs since last system timer interrupt + */ +static unsigned long omap_mpu_timer_gettimeoffset(void) { - /* Return elapsed usecs since last system timer ISR */ - return machinecycles_to_usecs(do_getmachinecycles() - systimer_mark); + unsigned long now = 0 - omap_mpu_timer_read(0); + unsigned long elapsed = now - omap_mpu_timer_last; + + return omap_mpu_timer_ticks_to_usecs(elapsed); } -static irqreturn_t -omap_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +/* + * Elapsed time between interrupts is calculated using timer0. + * Latency during the interrupt is calculated using timer1. + * Both timer0 and timer1 are counting at 6MHz (P2 6.5MHz). + */ +static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id, + struct pt_regs *regs) { - unsigned long now, ilatency; - - /* - * Mark the time at which the timer interrupt ocurred using - * timer1. We need to remove interrupt latency, which we can - * retrieve from the current system timer2 counter. Both the - * offset timer1 and the system timer2 are counting at 6MHz, - * so we're ok. - */ - now = 0 - read_mputimer1(); - ilatency = MPUTICKS_PER_SEC / 100 - read_mputimer2(); - systimer_mark = now - ilatency; + unsigned long now, latency; + write_seqlock(&xtime_lock); + now = 0 - omap_mpu_timer_read(0); + latency = MPU_TICKS_PER_SEC / HZ - omap_mpu_timer_read(1); + omap_mpu_timer_last = now - latency; timer_tick(regs); + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } -static struct irqaction omap_timer_irq = { - .name = "OMAP Timer Tick", +static struct irqaction omap_mpu_timer_irq = { + .name = "mpu timer", .flags = SA_INTERRUPT, - .handler = omap_timer_interrupt + .handler = omap_mpu_timer_interrupt }; -void __init omap_init_time(void) +static __init void omap_init_mpu_timer(void) { - /* Since we don't call request_irq, we must init the structure */ - gettimeoffset = omap_gettimeoffset; - -#ifdef OMAP1510_USE_32KHZ_TIMER - timer32k_write(TIMER32k_CR, 0x0); - timer32k_write(TIMER32k_TVR,TIMER32k_PERIOD); - setup_irq(INT_OS_32kHz_TIMER, &omap_timer_irq); - start_timer32k(); -#else - setup_irq(INT_TIMER2, &omap_timer_irq); - start_mputimer2(MPUTICKS_PER_SEC / 100 - 1); -#endif + omap_timer.offset = omap_mpu_timer_gettimeoffset; + setup_irq(INT_TIMER2, &omap_mpu_timer_irq); + omap_mpu_timer_start(0, 0xffffffff); + omap_mpu_timer_start(1, MPU_TIMER_TICK_PERIOD); } +/* + * --------------------------------------------------------------------------- + * Timer initialization + * --------------------------------------------------------------------------- + */ +void __init omap_timer_init(void) +{ + omap_init_mpu_timer(); +} + +struct sys_timer omap_timer = { + .init = omap_timer_init, + .offset = NULL, /* Initialized later */ +}; diff --git a/arch/arm/mach-omap/usb.c b/arch/arm/mach-omap/usb.c index f3451d269..4eeabe4fe 100644 --- a/arch/arm/mach-omap/usb.c +++ b/arch/arm/mach-omap/usb.c @@ -48,8 +48,10 @@ */ /* TESTED ON: - * - 1611B H2 (with usb1 mini-AB) - * - 1510 Innovator with built-in transceiver (custom cable feeding 5V VBUS) + * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables + * - 1510 Innovator UDC with bundled usb0 cable + * - 1510 Innovator OHCI with bundled usb1/usb2 cable + * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS * - 1710 custom development board using alternate pin group */ @@ -92,7 +94,10 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device) u32 syscon1 = 0; if (nwires == 0) { - USB_TRANSCEIVER_CTRL_REG &= ~(1 << 3); + if (!cpu_is_omap15xx()) { + /* pulldown D+/D- */ + USB_TRANSCEIVER_CTRL_REG &= ~(3 << 1); + } return 0; } @@ -101,36 +106,30 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device) * USB0_VP and USB0_VM are always set on 1510, there's no muxing * available for them. */ - if (nwires >= 2 && !cpu_is_omap1510()) { + if (nwires >= 2 && !cpu_is_omap15xx()) { omap_cfg_reg(AA9_USB0_VP); omap_cfg_reg(R9_USB0_VM); } + if (is_device) + omap_cfg_reg(W4_USB_PUEN); /* internal transceiver */ if (nwires == 2) { - if (cpu_is_omap1510()) { - /* This works for OHCI on 1510-Innovator, nothing to mux */ + if (cpu_is_omap15xx()) { + /* This works for OHCI on 1510-Innovator */ return 0; } -#if 0 /* NOTE: host OR device mode for now, no OTG */ - USB_TRANSCEIVER_CTRL_REG &= ~(3 << 4); + USB_TRANSCEIVER_CTRL_REG &= ~(7 << 4); if (is_device) { - omap_cfg_reg(W4_USB_PUEN); omap_cfg_reg(R18_1510_USB_GPIO0); // omap_cfg_reg(USB0_VBUS); - // omap_cfg_reg(USB0_PUEN); // USB_TRANSCEIVER_CTRL_REG.CONF_USB0_PORT_R = 7 - // when USB0_PUEN is needed } else /* host mode needs D+ and D- pulldowns */ USB_TRANSCEIVER_CTRL_REG &= ~(3 << 1); + return 3 << 16; -#else - /* FIXME: 1610 needs to return the right value here */ - printk(KERN_ERR "usb0 internal transceiver, nyet\n"); - return 0; -#endif } /* alternate pin config, external transceiver */ @@ -170,7 +169,7 @@ static u32 __init omap_usb1_init(unsigned nwires) { u32 syscon1 = 0; - if (nwires != 6) + if (nwires != 6 && !cpu_is_omap15xx()) USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB1_UNI_R; if (nwires == 0) return 0; @@ -178,11 +177,11 @@ static u32 __init omap_usb1_init(unsigned nwires) /* external transceiver */ omap_cfg_reg(USB1_TXD); omap_cfg_reg(USB1_TXEN); - if (cpu_is_omap1510()) { + if (cpu_is_omap15xx()) { omap_cfg_reg(USB1_SEO); omap_cfg_reg(USB1_SPEED); // SUSP - } else if (cpu_is_omap1610() || cpu_is_omap5912() || cpu_is_omap1710()) { + } else if (cpu_is_omap16xx()) { omap_cfg_reg(W13_1610_USB1_SE0); omap_cfg_reg(R13_1610_USB1_SPEED); // SUSP @@ -203,7 +202,8 @@ static u32 __init omap_usb1_init(unsigned nwires) syscon1 = 3; omap_cfg_reg(USB1_VP); omap_cfg_reg(USB1_VM); - USB_TRANSCEIVER_CTRL_REG |= CONF_USB1_UNI_R; + if (!cpu_is_omap15xx()) + USB_TRANSCEIVER_CTRL_REG |= CONF_USB1_UNI_R; break; default: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", @@ -216,31 +216,32 @@ static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup) { u32 syscon1 = 0; - if (alt_pingroup) + if (alt_pingroup || nwires == 0) return 0; - if (nwires != 6) + if (nwires != 6 && !cpu_is_omap15xx()) USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB2_UNI_R; if (nwires == 0) return 0; /* external transceiver */ - if (cpu_is_omap1510()) { + if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_TXD); omap_cfg_reg(USB2_TXEN); omap_cfg_reg(USB2_SEO); if (nwires != 3) omap_cfg_reg(USB2_RCV); - } else if (cpu_is_omap1610() || cpu_is_omap5912() || cpu_is_omap1710()) { + /* there is no USB2_SPEED */ + } else if (cpu_is_omap16xx()) { omap_cfg_reg(V6_USB2_TXD); omap_cfg_reg(W9_USB2_TXEN); omap_cfg_reg(W5_USB2_SE0); if (nwires != 3) omap_cfg_reg(Y5_USB2_RCV); + // FIXME omap_cfg_reg(USB2_SPEED); } else { pr_debug("usb unrecognized\n"); } // omap_cfg_reg(USB2_SUSP); - // FIXME omap_cfg_reg(USB2_SPEED); switch (nwires) { case 3: @@ -251,14 +252,14 @@ static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup) break; case 6: syscon1 = 3; - if (cpu_is_omap1510()) { + if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_VP); omap_cfg_reg(USB2_VM); } else { omap_cfg_reg(AA9_USB2_VP); omap_cfg_reg(R9_USB2_VM); + USB_TRANSCEIVER_CTRL_REG |= CONF_USB2_UNI_R; } - USB_TRANSCEIVER_CTRL_REG |= CONF_USB2_UNI_R; break; default: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", @@ -337,7 +338,7 @@ static struct platform_device ohci_device = { .dev = { .release = usb_release, .dma_mask = &ohci_dmamask, - .coherent_dma_mask = 0x0fffffff, + .coherent_dma_mask = 0xffffffff, }, .num_resources = ARRAY_SIZE(ohci_resources), .resource = ohci_resources, @@ -375,7 +376,11 @@ static struct platform_device otg_device = { // FIXME correct answer depends on hmc_mode, // as does any nonzero value for config->otg port number +#ifdef CONFIG_USB_GADGET_OMAP +#define is_usb0_device(config) 1 +#else #define is_usb0_device(config) 0 +#endif /*-------------------------------------------------------------------------*/ @@ -420,7 +425,7 @@ omap_otg_init(struct omap_usb_config *config) if (alt_pingroup) printk(", usb2 alt %d wires", config->pins[2]); else if (config->pins[0]) - printk(", usb0 %d wires%s", config->pins[2], + printk(", usb0 %d wires%s", config->pins[0], is_usb0_device(config) ? " (dev)" : ""); if (config->pins[1]) printk(", usb1 %d wires", config->pins[1]); @@ -477,6 +482,19 @@ static inline void omap_otg_init(struct omap_usb_config *config) {} #ifdef CONFIG_ARCH_OMAP1510 +#define ULPD_SOFT_REQ_REG __REG16(ULPD_SOFT_REQ) +#define SOFT_UDC_REQ (1 << 4) +#define SOFT_DPLL_REQ (1 << 0) + +#define ULPD_DPLL_CTRL_REG __REG16(ULPD_DPLL_CTRL) +#define DPLL_IOB (1 << 13) +#define DPLL_PLL_ENABLE (1 << 4) +#define DPLL_LOCK (1 << 0) + +#define ULPD_APLL_CTRL_REG __REG16(ULPD_APLL_CTRL) +#define APLL_NDPLL_SWITCH (1 << 0) + + static void __init omap_1510_usb_init(struct omap_usb_config *config) { int status; @@ -490,16 +508,43 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config) val |= (config->hmc_mode << 1); omap_writel(val, MOD_CONF_CTRL_0); - // FIXME this has a UDC controller too + printk("USB: hmc %d", config->hmc_mode); + if (config->pins[0]) + printk(", usb0 %d wires%s", config->pins[0], + is_usb0_device(config) ? " (dev)" : ""); + if (config->pins[1]) + printk(", usb1 %d wires", config->pins[1]); + if (config->pins[2]) + printk(", usb2 %d wires", config->pins[2]); + printk("\n"); + + /* use DPLL for 48 MHz function clock */ + pr_debug("APLL %04x DPLL %04x REQ %04x\n", ULPD_APLL_CTRL_REG, + ULPD_DPLL_CTRL_REG, ULPD_SOFT_REQ_REG); + ULPD_APLL_CTRL_REG &= ~APLL_NDPLL_SWITCH; + ULPD_DPLL_CTRL_REG |= DPLL_IOB | DPLL_PLL_ENABLE; + ULPD_SOFT_REQ_REG |= SOFT_UDC_REQ | SOFT_DPLL_REQ; + while (!(ULPD_DPLL_CTRL_REG & DPLL_LOCK)) + cpu_relax(); + +#ifdef CONFIG_USB_GADGET_OMAP + if (config->register_dev) { + udc_device.dev.platform_data = config; + status = platform_device_register(&udc_device); + if (status) + pr_debug("can't register UDC device, %d\n", status); + /* udc driver gates 48MHz by D+ pullup */ + } +#endif #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) - if (config->otg || config->register_host) { + if (config->register_host) { ohci_device.dev.platform_data = config; status = platform_device_register(&ohci_device); if (status) pr_debug("can't register OHCI device, %d\n", status); + /* hcd explicitly gates 48MHz */ } - // FIXME completely untested ... #endif } @@ -524,12 +569,9 @@ omap_usb_init(void) } platform_data = *config; - if (cpu_is_omap730() - || cpu_is_omap1610() - || cpu_is_omap1710() - || cpu_is_omap5912()) + if (cpu_is_omap730() || cpu_is_omap16xx()) omap_otg_init(&platform_data); - else if (cpu_is_omap1510()) + else if (cpu_is_omap15xx()) omap_1510_usb_init(&platform_data); else { printk(KERN_ERR "USB: No init for your chip yet\n"); diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index bb28824d8..f09e49d30 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -18,10 +18,30 @@ config ARCH_PXA_IDP bool "Accelent Xscale IDP" select PXA25x +config PXA_SHARPSL + bool "SHARP SL-C7xx Models (Corgi, Shepherd and Husky)" + select PXA25x + help + Say Y here if you intend to run this kernel on a + Sharp SL-C700 (Corgi), SL-C750 (Shepherd) or a + Sharp SL-C760 (Husky) handheld computer. + endchoice endmenu +config MACH_CORGI + bool "Enable Sharp SL-C700 (Corgi) Support" + depends PXA_SHARPSL + +config MACH_SHEPHERD + bool "Enable Sharp SL-C750 (Shepherd) Support" + depends PXA_SHARPSL + +config MACH_HUSKY + bool "Enable Sharp SL-C760 (Husky) Support" + depends PXA_SHARPSL + config PXA25x bool help diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 23c51e388..d480bd54c 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_PXA27x) += pxa27x.o obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o +obj-$(CONFIG_PXA_SHARPSL) += corgi.o corgi_ssp.o ssp.o # Support for blinky lights led-y := leds.o diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 3f4755f70..b1575b8dc 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c @@ -49,6 +49,10 @@ void pxa_gpio_mode(int gpio_mode) int gafr; local_irq_save(flags); + if (gpio_mode & GPIO_DFLT_LOW) + GPCR(gpio) = GPIO_bit(gpio); + else if (gpio_mode & GPIO_DFLT_HIGH) + GPSR(gpio) = GPIO_bit(gpio); if (gpio_mode & GPIO_MD_MASK_DIR) GPDR(gpio) |= GPIO_bit(gpio); else @@ -88,7 +92,7 @@ EXPORT_SYMBOL(pxa_set_cken); */ static struct map_desc standard_io_desc[] __initdata = { /* virtual physical length type */ - { 0xf2000000, 0x40000000, 0x01800000, MT_DEVICE }, /* Devs */ + { 0xf2000000, 0x40000000, 0x02000000, MT_DEVICE }, /* Devs */ { 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */ { 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */ { 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */ @@ -134,7 +138,6 @@ void __init pxa_set_mci_info(struct pxamci_platform_data *info) { pxamci_device.dev.platform_data = info; } -EXPORT_SYMBOL(pxa_set_mci_info); static struct pxa2xx_udc_mach_info pxa_udc_info; @@ -143,7 +146,6 @@ void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info) { memcpy(&pxa_udc_info, info, sizeof *info); } -EXPORT_SYMBOL(pxa_set_udc_info); static struct resource pxa2xx_udc_resources[] = { [0] = { @@ -177,7 +179,6 @@ void __init set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info) { memcpy(&pxa_fb_info,hard_pxa_fb_info,sizeof(struct pxafb_mach_info)); } -EXPORT_SYMBOL(set_pxa_fb_info); static struct resource pxafb_resources[] = { [0] = { diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index f542ef4e7..e54a8dd63 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h @@ -9,9 +9,11 @@ * published by the Free Software Foundation. */ +struct sys_timer; + +extern struct sys_timer pxa_timer; extern void __init pxa_map_io(void); extern void __init pxa_init_irq(void); -extern void __init pxa_init_time(void); extern unsigned int get_clk_frequency_khz(int info); diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 6f8b4873e..4333a0f19 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -119,6 +119,6 @@ MACHINE_START(PXA_IDP, "Accelent Xscale IDP") BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(idp_map_io) INITIRQ(idp_init_irq) - INITTIME(pxa_init_time) + .timer = &pxa_timer, INIT_MACHINE(idp_init) MACHINE_END diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index a09d4c11b..d4516a8ad 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -29,15 +29,19 @@ #include #include +#include + #include #include #include #include -#include +#include #include "generic.h" +#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080) + void lubbock_set_misc_wr(unsigned int mask, unsigned int set) { unsigned long flags; @@ -181,10 +185,25 @@ static struct pxafb_mach_info sharp_lm8v31 __initdata = { .lccr3 = LCCR3_PCP | LCCR3_Acb(255), }; +static int lubbock_mci_init(struct device *dev, irqreturn_t (*lubbock_detect_int)(int, void *, struct pt_regs *), void *data) +{ + /* setup GPIO for PXA25x MMC controller */ + pxa_gpio_mode(GPIO6_MMCCLK_MD); + pxa_gpio_mode(GPIO8_MMCCS0_MD); + + return 0; +} + +static struct pxamci_platform_data lubbock_mci_platform_data = { + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, + .init = lubbock_mci_init, +}; + static void __init lubbock_init(void) { pxa_set_udc_info(&udc_info); set_pxa_fb_info(&sharp_lm8v31); + pxa_set_mci_info(&lubbock_mci_platform_data); (void) platform_add_devices(devices, ARRAY_SIZE(devices)); } @@ -221,6 +240,6 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(lubbock_map_io) INITIRQ(lubbock_init_irq) - INITTIME(pxa_init_time) + .timer = &pxa_timer, INIT_MACHINE(lubbock_init) MACHINE_END diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 219fd4ecd..2e5f1a954 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c @@ -33,7 +33,9 @@ #include #include +#include #include +#include #include "generic.h" @@ -119,6 +121,44 @@ static struct platform_device smc91x_device = { .resource = smc91x_resources, }; +static int mst_audio_startup(snd_pcm_substream_t *substream, void *priv) +{ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF; + return 0; +} + +static void mst_audio_shutdown(snd_pcm_substream_t *substream, void *priv) +{ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF; +} + +static long mst_audio_suspend_mask; + +static void mst_audio_suspend(void *priv) +{ + mst_audio_suspend_mask = MST_MSCWR2; + MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF; +} + +static void mst_audio_resume(void *priv) +{ + MST_MSCWR2 &= mst_audio_suspend_mask | ~MST_MSCWR2_AC97_SPKROFF; +} + +static pxa2xx_audio_ops_t mst_audio_ops = { + .startup = mst_audio_startup, + .shutdown = mst_audio_shutdown, + .suspend = mst_audio_suspend, + .resume = mst_audio_resume, +}; + +static struct platform_device mst_audio_device = { + .name = "pxa2xx-ac97", + .id = -1, + .dev = { .platform_data = &mst_audio_ops }, +}; static void mainstone_backlight_power(int on) { @@ -170,9 +210,71 @@ static struct pxafb_mach_info toshiba_ltm035a776c __initdata = { .pxafb_backlight_power = mainstone_backlight_power, }; +static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *, struct pt_regs *), void *data) +{ + int err; + + /* + * setup GPIO for PXA27x MMC controller + */ + pxa_gpio_mode(GPIO32_MMCCLK_MD); + pxa_gpio_mode(GPIO112_MMCCMD_MD); + pxa_gpio_mode(GPIO92_MMCDAT0_MD); + pxa_gpio_mode(GPIO109_MMCDAT1_MD); + pxa_gpio_mode(GPIO110_MMCDAT2_MD); + pxa_gpio_mode(GPIO111_MMCDAT3_MD); + + /* make sure SD/Memory Stick multiplexer's signals + * are routed to MMC controller + */ + MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL; + + err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, SA_INTERRUPT, + "MMC card detect", data); + if (err) { + printk(KERN_ERR "mainstone_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); + return -1; + } + + return 0; +} + +static void mainstone_mci_setpower(struct device *dev, unsigned int vdd) +{ + struct pxamci_platform_data* p_d = dev->platform_data; + + if (( 1 << vdd) & p_d->ocr_mask) { + printk(KERN_DEBUG "%s: on\n", __FUNCTION__); + MST_MSCWR1 |= MST_MSCWR1_MMC_ON; + MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL; + } else { + printk(KERN_DEBUG "%s: off\n", __FUNCTION__); + MST_MSCWR1 &= ~MST_MSCWR1_MMC_ON; + } +} + +static void mainstone_mci_exit(struct device *dev, void *data) +{ + free_irq(MAINSTONE_MMC_IRQ, data); +} + +static struct pxamci_platform_data mainstone_mci_platform_data = { + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, + .init = mainstone_mci_init, + .setpower = mainstone_mci_setpower, + .exit = mainstone_mci_exit, +}; + static void __init mainstone_init(void) { + /* + * On Mainstone, we route AC97_SYSCLK via GPIO45 to + * the audio daughter card + */ + pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); + platform_device_register(&smc91x_device); + platform_device_register(&mst_audio_device); /* reading Mainstone's "Virtual Configuration Register" might be handy to select LCD type here */ @@ -180,6 +282,8 @@ static void __init mainstone_init(void) set_pxa_fb_info(&toshiba_ltm04c380k); else set_pxa_fb_info(&toshiba_ltm035a776c); + + pxa_set_mci_info(&mainstone_mci_platform_data); } @@ -198,6 +302,6 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(mainstone_map_io) INITIRQ(mainstone_init_irq) - INITTIME(pxa_init_time) + .timer = &pxa_timer, INIT_MACHINE(mainstone_init) MACHINE_END diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 5e84864a8..901ee6880 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c @@ -47,9 +47,6 @@ extern void pxa_cpu_resume(void); */ enum { SLEEP_SAVE_START = 0, - SLEEP_SAVE_OIER, - SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3, - SLEEP_SAVE_GPLR0, SLEEP_SAVE_GPLR1, SLEEP_SAVE_GPLR2, SLEEP_SAVE_GPDR0, SLEEP_SAVE_GPDR1, SLEEP_SAVE_GPDR2, SLEEP_SAVE_GRER0, SLEEP_SAVE_GRER1, SLEEP_SAVE_GRER2, @@ -66,7 +63,7 @@ enum { SLEEP_SAVE_START = 0, }; -static int pxa_pm_enter(u32 state) +static int pxa_pm_enter(suspend_state_t state) { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long checksum = 0; @@ -81,13 +78,6 @@ static int pxa_pm_enter(u32 state) rtc.tv_nsec = 0; save_time_delta(&delta, &rtc); - /* save vital registers */ - SAVE(OSMR0); - SAVE(OSMR1); - SAVE(OSMR2); - SAVE(OSMR3); - SAVE(OIER); - SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2); SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2); SAVE(GRER0); SAVE(GRER1); SAVE(GRER2); @@ -148,15 +138,6 @@ static int pxa_pm_enter(u32 state) PSSR = PSSR_RDH | PSSR_PH; - RESTORE(OSMR0); - RESTORE(OSMR1); - RESTORE(OSMR2); - RESTORE(OSMR3); - RESTORE(OIER); - - /* OSMR0 is the system timer: make sure OSCR is sufficiently behind */ - OSCR = OSMR0 - LATCH; - RESTORE(CKEN); ICLR = 0; @@ -182,7 +163,7 @@ unsigned long sleep_phys_sp(void *sp) /* * Called after processes are frozen, but before we shut down devices. */ -static int pxa_pm_prepare(u32 state) +static int pxa_pm_prepare(suspend_state_t state) { return 0; } @@ -190,7 +171,7 @@ static int pxa_pm_prepare(u32 state) /* * Called after devices are re-setup, but before processes are thawed. */ -static int pxa_pm_finish(u32 state) +static int pxa_pm_finish(suspend_state_t state) { return 0; } diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index e5e97fef8..7e863afef 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -14,11 +14,13 @@ #include #include #include -#include #include #include +#include #include +#include +#include #include "generic.h" @@ -117,3 +119,45 @@ unsigned int get_lcdclk_frequency_10khz(void) EXPORT_SYMBOL(get_clk_frequency_khz); EXPORT_SYMBOL(get_memclk_frequency_10khz); EXPORT_SYMBOL(get_lcdclk_frequency_10khz); + + +/* + * device registration specific to PXA27x. + */ + +static u64 pxa27x_dmamask = 0xffffffffUL; + +static struct resource pxa27x_ohci_resources[] = { + [0] = { + .start = 0x4C000000, + .end = 0x4C00ff6f, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_USBH1, + .end = IRQ_USBH1, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ohci_device = { + .name = "pxa27x-ohci", + .id = -1, + .dev = { + .dma_mask = &pxa27x_dmamask, + .coherent_dma_mask = 0xffffffff, + }, + .num_resources = ARRAY_SIZE(pxa27x_ohci_resources), + .resource = pxa27x_ohci_resources, +}; + +static struct platform_device *devices[] __initdata = { + &ohci_device, +}; + +static int __init pxa27x_init(void) +{ + return platform_add_devices(devices, ARRAY_SIZE(devices)); +} + +subsys_initcall(pxa27x_init); diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c index 50132a7c6..4d826c021 100644 --- a/arch/arm/mach-pxa/ssp.c +++ b/arch/arm/mach-pxa/ssp.c @@ -17,7 +17,8 @@ * * Revision history: * 22nd Aug 2003 Initial version. - * + * 20th Dec 2004 Added ssp_config for changing port config without + * closing the port. */ #include @@ -34,6 +35,11 @@ #include #include +#define PXA_SSP_PORTS 3 + +static DECLARE_MUTEX(sem); +static int use_count[PXA_SSP_PORTS] = {0, 0, 0}; + static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct ssp_dev *dev = (struct ssp_dev*) dev_id; @@ -170,6 +176,30 @@ void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp) SSCR0_P(dev->port) = ssp->cr0; } +/** + * ssp_config - configure SSP port settings + * @mode: port operating mode + * @flags: port config flags + * @psp_flags: port PSP config flags + * @speed: port speed + * + * Port MUST be disabled by ssp_disable before making any config changes. + */ +int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed) +{ + dev->mode = mode; + dev->flags = flags; + dev->psp_flags = psp_flags; + dev->speed = speed; + + /* set up port type, speed, port settings */ + SSCR0_P(dev->port) = (dev->speed | dev->mode); + SSCR1_P(dev->port) = dev->flags; + SSPSP_P(dev->port) = dev->psp_flags; + + return 0; +} + /** * ssp_init - setup the SSP port * @@ -180,12 +210,23 @@ void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp) * %-EBUSY if the resources are already in use * %0 on success */ -int ssp_init(struct ssp_dev *dev, u32 port, u32 mode, u32 flags, u32 psp_flags, - u32 speed) +int ssp_init(struct ssp_dev *dev, u32 port) { int ret, irq; + if (port > PXA_SSP_PORTS || port == 0) + return -ENODEV; + + down(&sem); + if (use_count[port - 1]) { + up(&sem); + return -EBUSY; + } + use_count[port - 1]++; + if (!request_mem_region(__PREG(SSCR0_P(port)), 0x2c, "SSP")) { + use_count[port - 1]--; + up(&sem); return -EBUSY; } @@ -213,15 +254,6 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 mode, u32 flags, u32 psp_flags, } dev->port = port; - dev->mode = mode; - dev->flags = flags; - dev->psp_flags = psp_flags; - dev->speed = speed; - - /* set up port type, speed, port settings */ - SSCR0_P(dev->port) = (dev->speed | dev->mode); - SSCR1_P(dev->port) = dev->flags; - SSPSP_P(dev->port) = dev->psp_flags; ret = request_irq(irq, ssp_interrupt, 0, "SSP", dev); if (ret) @@ -252,10 +284,13 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 mode, u32 flags, u32 psp_flags, #endif } + up(&sem); return 0; out_region: - release_mem_region(__PREG(SSCR0_P(dev->port)), 0x2c); + release_mem_region(__PREG(SSCR0_P(port)), 0x2c); + use_count[port - 1]--; + up(&sem); return ret; } @@ -268,6 +303,7 @@ void ssp_exit(struct ssp_dev *dev) { int irq; + down(&sem); SSCR0_P(dev->port) &= ~SSCR0_SSE; /* find irq, save power and turn off SSP port clock */ @@ -306,6 +342,8 @@ void ssp_exit(struct ssp_dev *dev) free_irq(irq, dev); release_mem_region(__PREG(SSCR0_P(dev->port)), 0x2c); + use_count[dev->port - 1]--; + up(&sem); } EXPORT_SYMBOL(ssp_write_word); @@ -317,3 +355,9 @@ EXPORT_SYMBOL(ssp_save_state); EXPORT_SYMBOL(ssp_restore_state); EXPORT_SYMBOL(ssp_init); EXPORT_SYMBOL(ssp_exit); +EXPORT_SYMBOL(ssp_config); + +MODULE_DESCRIPTION("PXA SSP driver"); +MODULE_AUTHOR("Liam Girdwood"); +MODULE_LICENSE("GPL"); + diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index a49fc0299..473fb6173 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c @@ -75,6 +75,8 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int next_match; + write_seqlock(&xtime_lock); + /* Loop until we get ahead of the free running timer. * This ensures an exact clock tick count and time accuracy. * IRQs are disabled inside the loop to ensure coherence between @@ -96,6 +98,8 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) next_match = (OSMR0 += LATCH); } while( (signed long)(next_match - OSCR) <= 8 ); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -105,11 +109,10 @@ static struct irqaction pxa_timer_irq = { .handler = pxa_timer_interrupt }; -void __init pxa_init_time(void) +static void __init pxa_timer_init(void) { struct timespec tv; - gettimeoffset = pxa_gettimeoffset; set_rtc = pxa_set_rtc; tv.tv_nsec = 0; @@ -123,3 +126,39 @@ void __init pxa_init_time(void) OSCR = 0; /* initialize free-running timer, force first match */ } +#ifdef CONFIG_PM +static unsigned long osmr[4], oier; + +static void pxa_timer_suspend(void) +{ + osmr[0] = OSMR0; + osmr[1] = OSMR1; + osmr[2] = OSMR2; + osmr[3] = OSMR3; + oier = OIER; +} + +static void pxa_timer_resume(void) +{ + OSMR0 = osmr[0]; + OSMR1 = osmr[1]; + OSMR2 = osmr[2]; + OSMR3 = osmr[3]; + OIER = oier; + + /* + * OSMR0 is the system timer: make sure OSCR is sufficiently behind + */ + OSCR = OSMR0 - LATCH; +} +#else +#define pxa_timer_suspend NULL +#define pxa_timer_resume NULL +#endif + +struct sys_timer pxa_timer = { + .init = pxa_timer_init, + .suspend = pxa_timer_suspend, + .resume = pxa_timer_resume, + .offset = pxa_gettimeoffset, +}; diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c index d5a1a3af2..2f60dea2a 100644 --- a/arch/arm/mach-rpc/riscpc.c +++ b/arch/arm/mach-rpc/riscpc.c @@ -15,7 +15,8 @@ #include #include #include -#include +#include +#include #include #include @@ -66,11 +67,11 @@ __tagtable(ATAG_ACORN, parse_tag_acorn); static struct map_desc rpc_io_desc[] __initdata = { { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */ - { IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */ + { IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */ { EASI_BASE, EASI_START, EASI_SIZE, MT_DEVICE } /* EASI space */ }; -void __init rpc_map_io(void) +static void __init rpc_map_io(void) { iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc)); @@ -85,31 +86,87 @@ void __init rpc_map_io(void) elf_hwcap &= ~HWCAP_HALF; } -static irqreturn_t -rpc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - timer_tick(regs); +static struct resource acornfb_resources[] = { + { /* VIDC */ + .start = 0x03400000, + .end = 0x035fffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_VSYNCPULSE, + .end = IRQ_VSYNCPULSE, + .flags = IORESOURCE_IRQ, + }, +}; - return IRQ_HANDLED; -} +static struct platform_device acornfb_device = { + .name = "acornfb", + .id = -1, + .dev = { + .coherent_dma_mask = 0xffffffff, + }, + .num_resources = ARRAY_SIZE(acornfb_resources), + .resource = acornfb_resources, +}; -static struct irqaction rpc_timer_irq = { - .name = "RiscPC Timer Tick", - .flags = SA_INTERRUPT, - .handler = rpc_timer_interrupt +static struct resource iomd_resources[] = { + { + .start = 0x03200000, + .end = 0x0320ffff, + .flags = IORESOURCE_MEM, + }, }; -/* - * Set up timer interrupt. - */ -void __init rpc_init_time(void) -{ - extern void ioctime_init(void); - ioctime_init(); +static struct platform_device iomd_device = { + .name = "iomd", + .id = -1, + .num_resources = ARRAY_SIZE(iomd_resources), + .resource = iomd_resources, +}; + +static struct platform_device kbd_device = { + .name = "kart", + .id = -1, + .dev = { + .parent = &iomd_device.dev, + }, +}; - setup_irq(IRQ_TIMER, &rpc_timer_irq); +static struct plat_serial8250_port serial_platform_data[] = { + { + .mapbase = 0x03010fe0, + .irq = 10, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_MEM, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +static struct platform_device *devs[] __initdata = { + &iomd_device, + &kbd_device, + &serial_device, + &acornfb_device, +}; + +static int __init rpc_init(void) +{ + return platform_add_devices(devs, ARRAY_SIZE(devs)); } +arch_initcall(rpc_init); + +extern struct sys_timer ioc_timer; + MACHINE_START(RISCPC, "Acorn-RiscPC") MAINTAINER("Russell King") BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) @@ -118,5 +175,5 @@ MACHINE_START(RISCPC, "Acorn-RiscPC") DISABLE_PARPORT(1) MAPIO(rpc_map_io) INITIRQ(rpc_init_irq) - INITTIME(rpc_init_time) + .timer = &ioc_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index ee42fe2c2..b1b216ef0 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig @@ -35,6 +35,15 @@ config MACH_VR1000 This linux port is currently being maintained by Simtec, on behalf of Thorcom. Any queries, please contact Thorcom first. +config MACH_RX3715 + bool "HP iPAQ rx3715" + select CPU_S3C2440 + help + Say Y here if you are using the HP iPAQ rx3715. + + See for more + information on this project + endmenu config CPU_S3C2410 @@ -68,8 +77,47 @@ config S3C2410_DMA_DEBUG to the kernel log, at priority KERN_DEBUG. Note, it is easy to create and fill the log buffer in a small - amount of time, as well as using an significant percantage of + amount of time, as well as using an significant percentage of the CPU time doing so. +config S3C2410_PM_DEBUG + bool "S3C2410 PM Suspend debug" + depends on ARCH_S3C2410 && PM + help + Say Y here if you want verbose debugging from the PM Suspend and + Resume code. See `Documentation/arm/Samsing-S3C24XX/Suspend.txt` + for more information. + +config S3C2410_PM_CHECK + bool "S3C2410 PM Suspend Memory CRC" + depends on ARCH_S3C2410 && PM && CRC32 + help + Enable the PM code's memory area checksum over sleep. This option + will generate CRCs of all blocks of memory, and store them before + going to sleep. The blocks are then checked on resume for any + errors. + +config S3C2410_PM_CHECK_CHUNKSIZE + int "S3C2410 PM Suspend CRC Chunksize (KiB)" + depends on ARCH_S3C2410 && PM && S3C2410_PM_CHECK + default 64 + help + Set the chunksize in Kilobytes of the CRC for checking memory + corruption over suspend and resume. A smaller value will mean that + the CRC data block will take more memory, but wil identify any + faults with better precision. + +config S3C2410_LOWLEVEL_UART_PORT + int "S3C2410 UART to use for low-level messages" + default 0 + help + Choice of which UART port to use for the low-level messages, + such as the `Uncompressing...` at start time. The value of + this configuration should be between zero and two. The port + must have been initialised by the boot-loader before use. + + Note, this does not affect the port used by the debug messages, + which is a separate configuration. + endif diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile index 5d6d80e91..aa8b30874 100644 --- a/arch/arm/mach-s3c2410/Makefile +++ b/arch/arm/mach-s3c2410/Makefile @@ -15,6 +15,10 @@ obj- := obj-$(CONFIG_CPU_S3C2410) += s3c2410.o obj-$(CONFIG_S3C2410_DMA) += dma.o +# Power Management support + +obj-$(CONFIG_PM) += pm.o sleep.o + # S3C2440 support obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o @@ -25,4 +29,4 @@ obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o obj-$(CONFIG_ARCH_H1940) += mach-h1940.o obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o - +obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index a12ade71b..f6d7470fe 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -46,6 +47,12 @@ #include "clock.h" +/* clock information */ + +unsigned long s3c24xx_xtal = 12*1000*1000; /* default 12MHz */ +unsigned long s3c24xx_fclk; +unsigned long s3c24xx_hclk; +unsigned long s3c24xx_pclk; static LIST_HEAD(clocks); static DECLARE_MUTEX(clocks_sem); @@ -53,7 +60,7 @@ static DECLARE_MUTEX(clocks_sem); /* old functions */ -void s3c2410_clk_enable(unsigned int clocks, unsigned int enable) +void inline s3c24xx_clk_enable(unsigned int clocks, unsigned int enable) { unsigned long clkcon; unsigned long flags; @@ -66,11 +73,26 @@ void s3c2410_clk_enable(unsigned int clocks, unsigned int enable) if (enable) clkcon |= clocks; + /* ensure none of the special function bits set */ + clkcon &= ~(S3C2410_CLKCON_IDLE|S3C2410_CLKCON_POWER); + __raw_writel(clkcon, S3C2410_CLKCON); local_irq_restore(flags); } +/* enable and disable calls for use with the clk struct */ + +static int clk_null_enable(struct clk *clk, int enable) +{ + return 0; +} + +int s3c24xx_clkcon_enable(struct clk *clk, int enable) +{ + s3c24xx_clk_enable(clk->ctrlbit, enable); + return 0; +} /* Clock API calls */ @@ -78,17 +100,35 @@ struct clk *clk_get(struct device *dev, const char *id) { struct clk *p; struct clk *clk = ERR_PTR(-ENOENT); + int idno; + + idno = (dev == NULL) ? -1 : to_platform_device(dev)->id; down(&clocks_sem); + list_for_each_entry(p, &clocks, list) { - if (strcmp(id, p->name) == 0 && + if (p->id == idno && + strcmp(id, p->name) == 0 && try_module_get(p->owner)) { clk = p; break; } } - up(&clocks_sem); + /* check for the case where a device was supplied, but the + * clock that was being searched for is not device specific */ + + if (IS_ERR(clk)) { + list_for_each_entry(p, &clocks, list) { + if (p->id == -1 && strcmp(id, p->name) == 0 && + try_module_get(p->owner)) { + clk = p; + break; + } + } + } + + up(&clocks_sem); return clk; } @@ -99,15 +139,16 @@ void clk_put(struct clk *clk) int clk_enable(struct clk *clk) { - if (clk->ctrlbit != 0) - s3c2410_clk_enable(clk->ctrlbit, 1); + if (IS_ERR(clk)) + return -EINVAL; - return 0; + return (clk->enable)(clk, 1); } void clk_disable(struct clk *clk) { - s3c2410_clk_enable(clk->ctrlbit, 0); + if (!IS_ERR(clk)) + (clk->enable)(clk, 0); } @@ -125,8 +166,14 @@ void clk_unuse(struct clk *clk) unsigned long clk_get_rate(struct clk *clk) { - if (clk->parent != NULL) - return clk->parent->rate; + if (IS_ERR(clk)) + return 0; + + if (clk->rate != 0) + return clk->rate; + + while (clk->parent != NULL && clk->rate == 0) + clk = clk->parent; return clk->rate; } @@ -160,90 +207,151 @@ EXPORT_SYMBOL(clk_get_parent); /* base clocks */ static struct clk clk_f = { - .name = "fclk", - .rate = 0, - .parent = NULL, - .ctrlbit = 0 + .name = "fclk", + .id = -1, + .rate = 0, + .parent = NULL, + .ctrlbit = 0, }; static struct clk clk_h = { - .name = "hclk", - .rate = 0, - .parent = NULL, - .ctrlbit = 0 + .name = "hclk", + .id = -1, + .rate = 0, + .parent = NULL, + .ctrlbit = 0, }; static struct clk clk_p = { - .name = "pclk", - .rate = 0, - .parent = NULL, - .ctrlbit = 0 + .name = "pclk", + .id = -1, + .rate = 0, + .parent = NULL, + .ctrlbit = 0, }; +/* clocks that could be registered by external code */ + +struct clk s3c24xx_dclk0 = { + .name = "dclk0", + .id = -1, +}; + +struct clk s3c24xx_dclk1 = { + .name = "dclk1", + .id = -1, +}; + +struct clk s3c24xx_clkout0 = { + .name = "clkout0", + .id = -1, +}; + +struct clk s3c24xx_clkout1 = { + .name = "clkout1", + .id = -1, +}; + +struct clk s3c24xx_uclk = { + .name = "uclk", + .id = -1, +}; + + /* clock definitions */ static struct clk init_clocks[] = { { .name = "nand", + .id = -1, .parent = &clk_h, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_NAND }, { .name = "lcd", + .id = -1, .parent = &clk_h, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_LCDC }, { .name = "usb-host", + .id = -1, .parent = &clk_h, - .ctrlbit = S3C2410_CLKCON_USBH + .enable = s3c24xx_clkcon_enable, + .ctrlbit = S3C2410_CLKCON_USBH }, { .name = "usb-device", + .id = -1, .parent = &clk_h, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_USBD }, { .name = "timers", .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_PWMT }, { .name = "sdi", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_SDI }, - { .name = "uart0", + { .name = "uart", + .id = 0, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_UART0 }, - { .name = "uart1", + { .name = "uart", + .id = 1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_UART1 }, - { .name = "uart2", + { .name = "uart", + .id = 2, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_UART2 }, { .name = "gpio", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_GPIO }, { .name = "rtc", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_RTC }, { .name = "adc", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_ADC }, { .name = "i2c", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_IIC }, { .name = "iis", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_IIS }, { .name = "spi", + .id = -1, .parent = &clk_p, + .enable = s3c24xx_clkcon_enable, .ctrlbit = S3C2410_CLKCON_SPI }, { .name = "watchdog", + .id = -1, .parent = &clk_p, .ctrlbit = 0 } @@ -251,11 +359,14 @@ static struct clk init_clocks[] = { /* initialise the clock system */ -int s3c2410_register_clock(struct clk *clk) +int s3c24xx_register_clock(struct clk *clk) { clk->owner = THIS_MODULE; atomic_set(&clk->used, 0); + if (clk->enable == NULL) + clk->enable = clk_null_enable; + /* add to the list of available clocks */ down(&clocks_sem); @@ -267,7 +378,7 @@ int s3c2410_register_clock(struct clk *clk) /* initalise all the clocks */ -static int __init s3c2410_init_clocks(void) +int __init s3c24xx_setup_clocks(void) { struct clk *clkp = init_clocks; int ptr; @@ -277,26 +388,43 @@ static int __init s3c2410_init_clocks(void) /* initialise the main system clocks */ - clk_h.rate = s3c2410_hclk; - clk_p.rate = s3c2410_pclk; - clk_f.rate = s3c2410_fclk; - - /* set the enabled clocks to a minimal (known) state */ - __raw_writel(S3C2410_CLKCON_PWMT | S3C2410_CLKCON_UART0 | S3C2410_CLKCON_UART1 | S3C2410_CLKCON_UART2 | S3C2410_CLKCON_GPIO | S3C2410_CLKCON_RTC, S3C2410_CLKCON); + clk_h.rate = s3c24xx_hclk; + clk_p.rate = s3c24xx_pclk; + clk_f.rate = s3c24xx_fclk; + + /* it looks like just setting the register here is not good + * enough, and causes the odd hang at initial boot time, so + * do all of them indivdually. + * + * I think disabling the LCD clock if the LCD is active is + * very dangerous, and therefore the bootloader should be + * careful to not enable the LCD clock if it is not needed. + * + * and of course, this looks neater + */ + + s3c24xx_clk_enable(S3C2410_CLKCON_NAND, 0); + s3c24xx_clk_enable(S3C2410_CLKCON_USBH, 0); + s3c24xx_clk_enable(S3C2410_CLKCON_USBD, 0); + s3c24xx_clk_enable(S3C2410_CLKCON_ADC, 0); + s3c24xx_clk_enable(S3C2410_CLKCON_IIC, 0); + s3c24xx_clk_enable(S3C2410_CLKCON_SPI, 0); + + /* assume uart clocks are correctly setup */ /* register our clocks */ - if (s3c2410_register_clock(&clk_f) < 0) + if (s3c24xx_register_clock(&clk_f) < 0) printk(KERN_ERR "failed to register cpu fclk\n"); - if (s3c2410_register_clock(&clk_h) < 0) + if (s3c24xx_register_clock(&clk_h) < 0) printk(KERN_ERR "failed to register cpu hclk\n"); - if (s3c2410_register_clock(&clk_p) < 0) + if (s3c24xx_register_clock(&clk_p) < 0) printk(KERN_ERR "failed to register cpu pclk\n"); for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) { - ret = s3c2410_register_clock(clkp); + ret = s3c24xx_register_clock(clkp); if (ret < 0) { printk(KERN_ERR "Failed to register clock %s (%d)\n", clkp->name, ret); @@ -306,5 +434,4 @@ static int __init s3c2410_init_clocks(void) return 0; } -arch_initcall(s3c2410_init_clocks); diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h index 4c7b94e87..eae2c8337 100644 --- a/arch/arm/mach-s3c2410/clock.h +++ b/arch/arm/mach-s3c2410/clock.h @@ -2,7 +2,7 @@ * linux/arch/arm/mach-s3c2410/clock.h * * Copyright (c) 2004 Simtec Electronics - * Written by Ben Dooks, + * Written 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 @@ -14,7 +14,34 @@ struct clk { struct module *owner; struct clk *parent; const char *name; + int id; atomic_t used; unsigned long rate; unsigned long ctrlbit; + int (*enable)(struct clk *, int enable); }; + +/* other clocks which may be registered by board support */ + +extern struct clk s3c24xx_dclk0; +extern struct clk s3c24xx_dclk1; +extern struct clk s3c24xx_clkout0; +extern struct clk s3c24xx_clkout1; +extern struct clk s3c24xx_uclk; + +/* processor clock settings, in Hz */ + +extern unsigned long s3c24xx_xtal; +extern unsigned long s3c24xx_pclk; +extern unsigned long s3c24xx_hclk; +extern unsigned long s3c24xx_fclk; + +/* exports for arch/arm/mach-s3c2410 + * + * Please DO NOT use these outside of arch/arm/mach-s3c2410 +*/ + +extern int s3c24xx_clkcon_enable(struct clk *clk, int enable); +extern int s3c24xx_register_clock(struct clk *clk); + +extern int s3c24xx_setup_clocks(void); diff --git a/arch/arm/mach-s3c2410/cpu.c b/arch/arm/mach-s3c2410/cpu.c index 42eec7912..0a6606536 100644 --- a/arch/arm/mach-s3c2410/cpu.c +++ b/arch/arm/mach-s3c2410/cpu.c @@ -38,6 +38,7 @@ #include #include "cpu.h" +#include "clock.h" #include "s3c2410.h" #include "s3c2440.h" @@ -45,6 +46,8 @@ struct cpu_table { unsigned long idcode; unsigned long idmask; void (*map_io)(struct map_desc *mach_desc, int size); + void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no); + void (*init_clocks)(int xtal); int (*init)(void); const char *name; }; @@ -58,32 +61,40 @@ static const char name_s3c2440a[] = "S3C2440A"; static struct cpu_table cpu_ids[] __initdata = { { - .idcode = 0x32410000, - .idmask = 0xffffffff, - .map_io = s3c2410_map_io, - .init = s3c2410_init, - .name = name_s3c2410 + .idcode = 0x32410000, + .idmask = 0xffffffff, + .map_io = s3c2410_map_io, + .init_clocks = s3c2410_init_clocks, + .init_uarts = s3c2410_init_uarts, + .init = s3c2410_init, + .name = name_s3c2410 }, { - .idcode = 0x3241002, - .idmask = 0xffffffff, - .map_io = s3c2410_map_io, - .init = s3c2410_init, - .name = name_s3c2410a + .idcode = 0x32410002, + .idmask = 0xffffffff, + .map_io = s3c2410_map_io, + .init_clocks = s3c2410_init_clocks, + .init_uarts = s3c2410_init_uarts, + .init = s3c2410_init, + .name = name_s3c2410a }, { - .idcode = 0x32440000, - .idmask = 0xffffffff, - .map_io = s3c2440_map_io, - .init = s3c2440_init, - .name = name_s3c2440 + .idcode = 0x32440000, + .idmask = 0xffffffff, + .map_io = s3c2440_map_io, + .init_clocks = s3c2440_init_clocks, + .init_uarts = s3c2440_init_uarts, + .init = s3c2440_init, + .name = name_s3c2440 }, { - .idcode = 0x32440001, - .idmask = 0xffffffff, - .map_io = s3c2440_map_io, - .init = s3c2440_init, - .name = name_s3c2440a + .idcode = 0x32440001, + .idmask = 0xffffffff, + .map_io = s3c2440_map_io, + .init_clocks = s3c2440_init_clocks, + .init_uarts = s3c2440_init_uarts, + .init = s3c2440_init, + .name = name_s3c2440a } }; @@ -104,7 +115,7 @@ s3c_lookup_cpu(unsigned long idcode) int count; tab = cpu_ids; - for (count = 0; count < ARRAY_SIZE(cpu_ids); count++) { + for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) { if ((idcode & tab->idmask) == tab->idcode) return tab; } @@ -112,6 +123,26 @@ s3c_lookup_cpu(unsigned long idcode) return NULL; } +/* board information */ + +static struct s3c24xx_board *board; + +void s3c24xx_set_board(struct s3c24xx_board *b) +{ + int i; + + board = b; + + if (b->clocks_count != 0) { + struct clk **ptr = b->clocks;; + + for (i = b->clocks_count; i > 0; i--, ptr++) + s3c24xx_register_clock(*ptr); + } +} + +/* cpu information */ + static struct cpu_table *cpu; void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) @@ -139,14 +170,71 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) (cpu->map_io)(mach_desc, size); } +/* s3c24xx_init_clocks + * + * Initialise the clock subsystem and associated information from the + * given master crystal value. + * + * xtal = 0 -> use default PLL crystal value (normally 12MHz) + * != 0 -> PLL crystal value in Hz +*/ + +void __init s3c24xx_init_clocks(int xtal) +{ + if (xtal != 0) + s3c24xx_xtal = xtal; + + if (cpu == NULL) + panic("s3c24xx_init_clocks: no cpu setup?\n"); + + if (cpu->init_clocks == NULL) + panic("s3c24xx_init_clocks: cpu has no clock init\n"); + else + (cpu->init_clocks)(xtal); +} + +void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) +{ + if (cpu == NULL) + return; + + if (cpu->init_uarts == NULL) { + printk(KERN_ERR "s3c24xx_init_uarts: cpu has no uart init\n"); + } else + (cpu->init_uarts)(cfg, no); +} + static int __init s3c_arch_init(void) { + int ret; + // do the correct init for cpu if (cpu == NULL) panic("s3c_arch_init: NULL cpu\n"); - return (cpu->init)(); + ret = (cpu->init)(); + if (ret != 0) + return ret; + + if (board != NULL) { + struct platform_device **ptr = board->devices; + int i; + + for (i = 0; i < board->devices_count; i++, ptr++) { + ret = platform_device_register(*ptr); + + if (ret) { + printk(KERN_ERR "s3c24xx: failed to add board device %s (%d) @%p\n", (*ptr)->name, ret, *ptr); + } + } + + /* mask any error, we may not need all these board + * devices */ + ret = 0; + } + + return ret; } arch_initcall(s3c_arch_init); diff --git a/arch/arm/mach-s3c2410/cpu.h b/arch/arm/mach-s3c2410/cpu.h index b0053d76d..4418be659 100644 --- a/arch/arm/mach-s3c2410/cpu.h +++ b/arch/arm/mach-s3c2410/cpu.h @@ -1,7 +1,7 @@ /* arch/arm/mach-s3c2410/cpu.h * - * Copyright (c) 2004 Simtec Electronics - * Ben Dooks + * Copyright (c) 2004-2005 Simtec Electronics + * Ben Dooks * * Header file for S3C24XX CPU support * @@ -11,6 +11,10 @@ * * Modifications: * 24-Aug-2004 BJD Start of generic S3C24XX support + * 18-Oct-2004 BJD Moved board struct into this file + * 04-Jan-2005 BJD New uart initialisation + * 10-Jan-2005 BJD Moved generic init here, specific to cpu headers + * 14-Jan-2005 BJD Added s3c24xx_init_clocks() call */ #define IODESC_ENT(x) { S3C2410_VA_##x, S3C2410_PA_##x, S3C2410_SZ_##x, MT_DEVICE } @@ -21,21 +25,36 @@ #define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000) -#ifdef CONFIG_CPU_S3C2410 -extern int s3c2410_init(void); -extern void s3c2410_map_io(struct map_desc *mach_desc, int size); -#else -#define s3c2410_map_io NULL -#define s3c2410_init NULL -#endif +/* forward declaration */ +struct s3c2410_uartcfg; -#ifdef CONFIG_CPU_S3C2440 -extern int s3c2440_init(void); -extern void s3c2440_map_io(struct map_desc *mach_desc, int size); -#else -#define s3c2440_map_io NULL -#define s3c2440_init NULL -#endif +/* core initialisation functions */ + +extern void s3c24xx_init_irq(void); extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); +extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); + +extern void s3c24xx_init_clocks(int xtal); + +/* the board structure is used at first initialsation time + * to get info such as the devices to register for this + * board. This is done because platfrom_add_devices() cannot + * be called from the map_io entry. +*/ + +struct s3c24xx_board { + struct platform_device **devices; + unsigned int devices_count; + + struct clk **clocks; + unsigned int clocks_count; +}; + +extern void s3c24xx_set_board(struct s3c24xx_board *board); + +/* timer for 2410/2440 */ + +struct sys_timer; +extern struct sys_timer s3c24xx_timer; diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c index 7cf560cae..b1826df99 100644 --- a/arch/arm/mach-s3c2410/devs.c +++ b/arch/arm/mach-s3c2410/devs.c @@ -32,8 +32,14 @@ #include #include +#include + #include "devs.h" +/* Serial port registrations */ + +struct platform_device *s3c24xx_uart_devs[3]; + /* USB Host Controller */ static struct resource s3c_usb_resource[] = { diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c index 819e5af16..bc8cb6868 100644 --- a/arch/arm/mach-s3c2410/dma.c +++ b/arch/arm/mach-s3c2410/dma.c @@ -1,7 +1,7 @@ /* linux/arch/arm/mach-bast/dma.c * * (c) 2003,2004 Simtec Electronics - * Ben Dooks + * Ben Dooks * * S3C2410 DMA core * @@ -12,6 +12,9 @@ * published by the Free Software Foundation. * * Changelog: + * 18-Nov-2004 BJD Removed error for loading onto stopped channel + * 10-Nov-2004 BJD Ensure all external symbols exported for modules + * 10-Nov-2004 BJD Use sys_device and sysdev_class for power management * 08-Aug-2004 BJD Apply rmk's suggestions * 21-Jul-2004 BJD Ported to linux 2.6 * 12-Jul-2004 BJD Finished re-write and change of API @@ -38,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +56,7 @@ #include /* io map for dma */ -static void *dma_base; +static void __iomem *dma_base; /* dma channel state information */ s3c2410_dma_chan_t s3c2410_chans[S3C2410_DMA_CHANNELS]; @@ -490,10 +494,6 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id, } else if (chan->state == S3C2410_DMA_IDLE) { if (chan->flags & S3C2410_DMAF_AUTOSTART) { s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_START); - } else { - printk(KERN_DEBUG "dma%d: cannot load onto stopped channel'n", chan->number); - local_irq_restore(flags); - return -EINVAL; } } @@ -501,6 +501,8 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id, return 0; } +EXPORT_SYMBOL(s3c2410_dma_enqueue); + static inline void s3c2410_dma_freebuf(s3c2410_dma_buf_t *buf) { @@ -648,6 +650,9 @@ s3c2410_dma_irq(int irq, void *devpw, struct pt_regs *regs) break; + case S3C2410_DMALOAD_1LOADED_1RUNNING: + goto no_load; + default: printk(KERN_ERR "dma%d: unknown load_state in irq, %d\n", chan->number, chan->load_state); @@ -668,6 +673,7 @@ s3c2410_dma_irq(int irq, void *devpw, struct pt_regs *regs) } } + no_load: return IRQ_HANDLED; } @@ -736,6 +742,8 @@ int s3c2410_dma_request(unsigned int channel, s3c2410_dma_client_t *client, return 0; } +EXPORT_SYMBOL(s3c2410_dma_request); + /* s3c2410_dma_free * * release the given channel back to the system, will stop and flush @@ -780,6 +788,8 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client) return 0; } +EXPORT_SYMBOL(s3c2410_dma_free); + static int s3c2410_dma_dostop(s3c2410_dma_chan_t *chan) { unsigned long tmp; @@ -886,6 +896,7 @@ s3c2410_dma_ctrl(dmach_t channel, s3c2410_chan_op_t op) return -ENOENT; /* unknown, don't bother */ } +EXPORT_SYMBOL(s3c2410_dma_ctrl); /* DMA configuration for each channel * @@ -941,6 +952,7 @@ int s3c2410_dma_config(dmach_t channel, return 0; } +EXPORT_SYMBOL(s3c2410_dma_config); int s3c2410_dma_setflags(dmach_t channel, unsigned int flags) { @@ -955,6 +967,9 @@ int s3c2410_dma_setflags(dmach_t channel, unsigned int flags) return 0; } +EXPORT_SYMBOL(s3c2410_dma_setflags); + + /* do we need to protect the settings of the fields from * irq? */ @@ -972,6 +987,8 @@ int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn) return 0; } +EXPORT_SYMBOL(s3c2410_dma_set_opfn); + int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn) { s3c2410_dma_chan_t *chan = &s3c2410_chans[channel]; @@ -985,6 +1002,8 @@ int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn) return 0; } +EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); + /* s3c2410_dma_devconfig * * configure the dma source/destination hardware type and address @@ -1042,12 +1061,80 @@ int s3c2410_dma_devconfig(int channel, return -EINVAL; } +EXPORT_SYMBOL(s3c2410_dma_devconfig); + +/* s3c2410_dma_getposition + * + * returns the current transfer points for the dma source and destination +*/ + +int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst) +{ + s3c2410_dma_chan_t *chan = &s3c2410_chans[channel]; + + check_channel(channel); + + if (src != NULL) + *src = dma_rdreg(chan, S3C2410_DMA_DCSRC); + + if (dst != NULL) + *dst = dma_rdreg(chan, S3C2410_DMA_DCDST); + + return 0; +} + +EXPORT_SYMBOL(s3c2410_dma_getposition); + + +/* system device class */ + +#ifdef CONFIG_PM + +static int s3c2410_dma_suspend(struct sys_device *dev, u32 state) +{ + s3c2410_dma_chan_t *cp = container_of(dev, s3c2410_dma_chan_t, dev); + + printk(KERN_DEBUG "suspending dma channel %d\n", cp->number); + + if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) { + /* the dma channel is still working, which is probably + * a bad thing to do over suspend/resume. We stop the + * channel and assume that the client is either going to + * retry after resume, or that it is broken. + */ + + printk(KERN_INFO "dma: stopping channel %d due to suspend\n", + cp->number); + + s3c2410_dma_dostop(cp); + } + + return 0; +} + +static int s3c2410_dma_resume(struct sys_device *dev) +{ + return 0; +} + +#else +#define s3c2410_dma_suspend NULL +#define s3c2410_dma_resume NULL +#endif /* CONFIG_PM */ + +static struct sysdev_class dma_sysclass = { + set_kset_name("s3c24xx-dma"), + .suspend = s3c2410_dma_suspend, + .resume = s3c2410_dma_resume, +}; + /* initialisation code */ static int __init s3c2410_init_dma(void) { - int channel; s3c2410_dma_chan_t *cp; + int channel; + int ret; printk("S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics\n"); @@ -1057,6 +1144,12 @@ static int __init s3c2410_init_dma(void) return -ENOMEM; } + ret = sysdev_class_register(&dma_sysclass); + if (ret != 0) { + printk(KERN_ERR "dma sysclass registration failed\n"); + goto err; + } + for (channel = 0; channel < S3C2410_DMA_CHANNELS; channel++) { cp = &s3c2410_chans[channel]; @@ -1065,7 +1158,7 @@ static int __init s3c2410_init_dma(void) /* dma channel irqs are in order.. */ cp->number = channel; cp->irq = channel + IRQ_DMA0; - cp->regs = (unsigned long)dma_base + (channel*0x40); + cp->regs = dma_base + (channel*0x40); /* point current stats somewhere */ cp->stats = &cp->stats_store; @@ -1075,11 +1168,22 @@ static int __init s3c2410_init_dma(void) cp->load_timeout = 1<<18; - printk("DMA channel %d at %08lx, irq %d\n", + /* register system device */ + + cp->dev.cls = &dma_sysclass; + cp->dev.id = channel; + ret = sysdev_register(&cp->dev); + + printk("DMA channel %d at %p, irq %d\n", cp->number, cp->regs, cp->irq); } return 0; + + err: + iounmap(dma_base); + dma_base = NULL; + return ret; } __initcall(s3c2410_init_dma); diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c index 8996725e9..129f29dbd 100644 --- a/arch/arm/mach-s3c2410/gpio.c +++ b/arch/arm/mach-s3c2410/gpio.c @@ -28,6 +28,7 @@ * 01-Oct-2004 BJD Fixed mask bug in pullup() call * 01-Oct-2004 BJD Added getirq() to turn pin into irqno * 04-Oct-2004 BJD Added irq filter controls for GPIO + * 05-Nov-2004 BJD EXPORT_SYMBOL() added for all code */ @@ -66,6 +67,8 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) local_irq_restore(flags); } +EXPORT_SYMBOL(s3c2410_gpio_cfgpin); + unsigned int s3c2410_gpio_getcfg(unsigned int pin) { unsigned long base = S3C2410_GPIO_BASE(pin); @@ -80,6 +83,8 @@ unsigned int s3c2410_gpio_getcfg(unsigned int pin) return __raw_readl(base) & mask; } +EXPORT_SYMBOL(s3c2410_gpio_getcfg); + void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) { unsigned long base = S3C2410_GPIO_BASE(pin); @@ -100,6 +105,8 @@ void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) local_irq_restore(flags); } +EXPORT_SYMBOL(s3c2410_gpio_pullup); + void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) { unsigned long base = S3C2410_GPIO_BASE(pin); @@ -117,6 +124,8 @@ void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) local_irq_restore(flags); } +EXPORT_SYMBOL(s3c2410_gpio_setpin); + unsigned int s3c2410_gpio_getpin(unsigned int pin) { unsigned long base = S3C2410_GPIO_BASE(pin); @@ -125,6 +134,8 @@ unsigned int s3c2410_gpio_getpin(unsigned int pin) return __raw_readl(base + 0x04) & (1<< offs); } +EXPORT_SYMBOL(s3c2410_gpio_getpin); + unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change) { unsigned long flags; @@ -140,6 +151,8 @@ unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change) return misccr; } +EXPORT_SYMBOL(s3c2410_modify_misccr); + int s3c2410_gpio_getirq(unsigned int pin) { if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15_EINT23) @@ -157,6 +170,8 @@ int s3c2410_gpio_getirq(unsigned int pin) return (pin - S3C2410_GPG0) + IRQ_EINT8; } +EXPORT_SYMBOL(s3c2410_gpio_getirq); + int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, unsigned int config) { @@ -192,3 +207,5 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, return 0; } + +EXPORT_SYMBOL(s3c2410_gpio_irqfilter); diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c index 1951a0323..6b0b93e5a 100644 --- a/arch/arm/mach-s3c2410/irq.c +++ b/arch/arm/mach-s3c2410/irq.c @@ -33,9 +33,14 @@ * * 05-Oct-2004 Ben Dooks * Tidy up KF's patch and sort out new release + * + * 05-Oct-2004 Ben Dooks + * Add support for power management controls + * + * 04-Nov-2004 Ben Dooks + * Fix standard IRQ wake for EINT0..4 and RTC */ - #include #include #include @@ -52,10 +57,73 @@ #include #include +#include "pm.h" #define irqdbf(x...) #define irqdbf2(x...) +#define EXTINT_OFF (IRQ_EINT4 - 4) + +/* wakeup irq control */ + +#ifdef CONFIG_PM + +/* state for IRQs over sleep */ + +/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources + * + * set bit to 1 in allow bitfield to enable the wakeup settings on it +*/ + +unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; +unsigned long s3c_irqwake_intmask = 0xffffffffL; +unsigned long s3c_irqwake_eintallow = 0x0000fff0L; +unsigned long s3c_irqwake_eintmask = 0xffffffffL; + +static int +s3c_irq_wake(unsigned int irqno, unsigned int state) +{ + unsigned long irqbit = 1 << (irqno - IRQ_EINT0); + + if (!(s3c_irqwake_intallow & irqbit)) + return -ENOENT; + + printk(KERN_INFO "wake %s for irq %d\n", + state ? "enabled" : "disabled", irqno); + + if (!state) + s3c_irqwake_intmask |= irqbit; + else + s3c_irqwake_intmask &= ~irqbit; + + return 0; +} + +static int +s3c_irqext_wake(unsigned int irqno, unsigned int state) +{ + unsigned long bit = 1L << (irqno - EXTINT_OFF); + + if (!(s3c_irqwake_eintallow & bit)) + return -ENOENT; + + printk(KERN_INFO "wake %s for irq %d\n", + state ? "enabled" : "disabled", irqno); + + if (!state) + s3c_irqwake_eintmask |= bit; + else + s3c_irqwake_eintmask &= ~bit; + + return 0; +} + +#else +#define s3c_irqext_wake NULL +#define s3c_irq_wake NULL +#endif + + static void s3c_irq_mask(unsigned int irqno) { @@ -109,21 +177,21 @@ s3c_irq_unmask(unsigned int irqno) static struct irqchip s3c_irq_level_chip = { .ack = s3c_irq_maskack, .mask = s3c_irq_mask, - .unmask = s3c_irq_unmask + .unmask = s3c_irq_unmask, + .wake = s3c_irq_wake }; static struct irqchip s3c_irq_chip = { .ack = s3c_irq_ack, .mask = s3c_irq_mask, - .unmask = s3c_irq_unmask + .unmask = s3c_irq_unmask, + .wake = s3c_irq_wake }; /* S3C2410_EINTMASK * S3C2410_EINTPEND */ -#define EXTINT_OFF (IRQ_EINT4 - 4) - static void s3c_irqext_mask(unsigned int irqno) { @@ -276,14 +344,16 @@ static struct irqchip s3c_irqext_chip = { .mask = s3c_irqext_mask, .unmask = s3c_irqext_unmask, .ack = s3c_irqext_ack, - .type = s3c_irqext_type + .type = s3c_irqext_type, + .wake = s3c_irqext_wake }; static struct irqchip s3c_irq_eint0t4 = { .ack = s3c_irq_ack, .mask = s3c_irq_mask, .unmask = s3c_irq_unmask, - .type = s3c_irqext_type + .wake = s3c_irq_wake, + .type = s3c_irqext_type, }; /* mask values for the parent registers for each of the interrupt types */ @@ -558,12 +628,12 @@ s3c_irq_demux_uart2(unsigned int irq, s3c_irq_demux_uart(IRQ_S3CUART_RX2, regs); } -/* s3c2410_init_irq +/* s3c24xx_init_irq * * Initialise S3C2410 IRQ system */ -void __init s3c2410_init_irq(void) +void __init s3c24xx_init_irq(void) { unsigned long pend; unsigned long last; diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index f75266907..96292e632 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/mach-bast.c * - * Copyright (c) 2003,2004 Simtec Electronics + * Copyright (c) 2003-2005 Simtec Electronics * Ben Dooks * * http://www.simtec.co.uk/products/EB2410ITX/ @@ -18,6 +18,11 @@ * 05-Sep-2003 BJD Moved to v2.6 kernel * 06-Jan-2003 BJD Updates for * 18-Jan-2003 BJD Added serial port configuration + * 05-Oct-2004 BJD Power management code + * 04-Nov-2004 BJD Updated serial port clocks + * 04-Jan-2005 BJD New uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h + * 14-Jan-2005 BJD Add support for muitlple NAND devices */ #include @@ -33,6 +38,7 @@ #include #include +#include #include #include @@ -41,11 +47,22 @@ //#include #include +#include +#include +#include -#include "s3c2410.h" +#include +#include +#include +#include + +#include "clock.h" #include "devs.h" #include "cpu.h" #include "usb-simtec.h" +#include "pm.h" + +#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics" /* macros for virtual address mods for the io space entries */ #define VA_C5(item) ((item) + BAST_VAM_CS5) @@ -146,35 +163,50 @@ static struct map_desc bast_iodesc[] __initdata = { #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE -/* base baud rate for all our UARTs */ -static unsigned long bast_serial_clock = 24*1000*1000; +static struct s3c24xx_uart_clksrc bast_serial_clocks[] = { + [0] = { + .name = "uclk", + .divisor = 1, + .min_baud = 0, + .max_baud = 0, + }, + [1] = { + .name = "pclk", + .divisor = 1, + .min_baud = 0, + .max_baud = 0. + } +}; + static struct s3c2410_uartcfg bast_uartcfgs[] = { [0] = { .hwport = 0, .flags = 0, - .clock = &bast_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = bast_serial_clocks, + .clocks_size = ARRAY_SIZE(bast_serial_clocks) }, [1] = { .hwport = 1, .flags = 0, - - .clock = &bast_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = bast_serial_clocks, + .clocks_size = ARRAY_SIZE(bast_serial_clocks) }, /* port 2 is not actually used */ [2] = { .hwport = 2, .flags = 0, - .clock = &bast_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = bast_serial_clocks, + .clocks_size = ARRAY_SIZE(bast_serial_clocks) } }; @@ -195,6 +227,100 @@ static struct platform_device bast_device_nor = { .resource = bast_nor_resource, }; +/* NAND Flash on BAST board */ + + +static int smartmedia_map[] = { 0 }; +static int chip0_map[] = { 1 }; +static int chip1_map[] = { 2 }; +static int chip2_map[] = { 3 }; + +struct mtd_partition bast_default_nand_part[] = { + [0] = { + .name = "Boot Agent", + .size = SZ_16K, + .offset = 0 + }, + [1] = { + .name = "/boot", + .size = SZ_4M - SZ_16K, + .offset = SZ_16K, + }, + [2] = { + .name = "user", + .offset = SZ_4M, + .size = MTDPART_SIZ_FULL, + } +}; + +/* the bast has 4 selectable slots for nand-flash, the three + * on-board chip areas, as well as the external SmartMedia + * slot. + * + * Note, there is no current hot-plug support for the SmartMedia + * socket. +*/ + +static struct s3c2410_nand_set bast_nand_sets[] = { + [0] = { + .name = "SmartMedia", + .nr_chips = 1, + .nr_map = smartmedia_map, + .nr_partitions = ARRAY_SIZE(bast_default_nand_part), + .partitions = bast_default_nand_part + }, + [1] = { + .name = "chip0", + .nr_chips = 1, + .nr_map = chip0_map, + .nr_partitions = ARRAY_SIZE(bast_default_nand_part), + .partitions = bast_default_nand_part + }, + [2] = { + .name = "chip1", + .nr_chips = 1, + .nr_map = chip1_map, + .nr_partitions = ARRAY_SIZE(bast_default_nand_part), + .partitions = bast_default_nand_part + }, + [3] = { + .name = "chip2", + .nr_chips = 1, + .nr_map = chip2_map, + .nr_partitions = ARRAY_SIZE(bast_default_nand_part), + .partitions = bast_default_nand_part + } +}; + +static void bast_nand_select(struct s3c2410_nand_set *set, int slot) +{ + unsigned int tmp; + + slot = set->nr_map[slot] & 3; + + pr_debug("bast_nand: selecting slot %d (set %p,%p)\n", + slot, set, set->nr_map); + + tmp = __raw_readb(BAST_VA_CTRL2); + tmp &= BAST_CPLD_CTLR2_IDERST; + tmp |= slot; + tmp |= BAST_CPLD_CTRL2_WNAND; + + pr_debug("bast_nand: ctrl2 now %02x\n", tmp); + + __raw_writeb(tmp, BAST_VA_CTRL2); +} + +static struct s3c2410_platform_nand bast_nand_info = { + .tacls = 80, + .twrph0 = 80, + .twrph1 = 80, + .nr_sets = ARRAY_SIZE(bast_nand_sets), + .sets = bast_nand_sets, + .select_chip = bast_nand_select, +}; + + /* Standard BAST devices */ static struct platform_device *bast_devices[] __initdata = { @@ -204,37 +330,87 @@ static struct platform_device *bast_devices[] __initdata = { &s3c_device_i2c, &s3c_device_iis, &s3c_device_rtc, + &s3c_device_nand, &bast_device_nor }; -static struct s3c2410_board bast_board __initdata = { +static struct clk *bast_clocks[] = { + &s3c24xx_dclk0, + &s3c24xx_dclk1, + &s3c24xx_clkout0, + &s3c24xx_clkout1, + &s3c24xx_uclk, +}; + +static struct s3c24xx_board bast_board __initdata = { .devices = bast_devices, - .devices_count = ARRAY_SIZE(bast_devices) + .devices_count = ARRAY_SIZE(bast_devices), + .clocks = bast_clocks, + .clocks_count = ARRAY_SIZE(bast_clocks) }; void __init bast_map_io(void) { + /* initialise the clocks */ + + s3c24xx_dclk0.parent = NULL; + s3c24xx_dclk0.rate = 12*1000*1000; + + s3c24xx_dclk1.parent = NULL; + s3c24xx_dclk1.rate = 24*1000*1000; + + s3c24xx_clkout0.parent = &s3c24xx_dclk0; + s3c24xx_clkout1.parent = &s3c24xx_dclk1; + + s3c24xx_uclk.parent = &s3c24xx_clkout1; + + s3c_device_nand.dev.platform_data = &bast_nand_info; + s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); - s3c2410_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); - s3c2410_set_board(&bast_board); + s3c24xx_init_clocks(0); + s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); + s3c24xx_set_board(&bast_board); usb_simtec_init(); } void __init bast_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } -void __init bast_init_time(void) +#ifdef CONFIG_PM + +/* bast_init_machine + * + * enable the power management functions for the EB2410ITX +*/ + +static __init void bast_init_machine(void) { - s3c2410_init_time(); + unsigned long gstatus4; + + printk(KERN_INFO "BAST Power Manangement" COPYRIGHT "\n"); + + gstatus4 = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30; + gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28; + gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK); + + __raw_writel(gstatus4, S3C2410_GSTATUS4); + + s3c2410_pm_init(); } +#else +#define bast_init_machine NULL +#endif + + MACHINE_START(BAST, "Simtec-BAST") MAINTAINER("Ben Dooks ") BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(bast_map_io) INITIRQ(bast_init_irq) - INITTIME(bast_init_time) + .init_machine = bast_init_machine, + .timer = &s3c24xx_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 397c546b7..e834c00c3 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/mach-h1940.c * - * Copyright (c) 2003,2004 Simtec Electronics + * Copyright (c) 2003-2005 Simtec Electronics * Ben Dooks * * http://www.handhelds.org/projects/h1940.html @@ -18,6 +18,11 @@ * 17-Feb-2003 BJD Copied to mach-ipaq.c * 21-Aug-2004 BJD Added struct s3c2410_board * 04-Sep-2004 BJD Changed uart init, renamed ipaq_ -> h1940_ + * 18-Oct-2004 BJD Updated new board structure name + * 04-Nov-2004 BJD Change for new serial clock + * 04-Jan-2005 BJD Updated uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h + * 14-Jan-2005 BJD Added clock init */ #include @@ -40,7 +45,9 @@ //#include #include -#include "s3c2410.h" +#include + +#include "clock.h" #include "devs.h" #include "cpu.h" @@ -56,7 +63,6 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { [0] = { .hwport = 0, .flags = 0, - .clock = &s3c2410_pclk, .ucon = 0x3c5, .ulcon = 0x03, .ufcon = 0x51, @@ -64,7 +70,6 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { [1] = { .hwport = 1, .flags = 0, - .clock = &s3c2410_pclk, .ucon = 0x245, .ulcon = 0x03, .ufcon = 0x00, @@ -73,7 +78,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { [2] = { .hwport = 2, .flags = 0, - .clock = &s3c2410_pclk, + .uart_flags = UPF_CONS_FLOW, .ucon = 0x3c5, .ulcon = 0x43, .ufcon = 0x51, @@ -91,7 +96,7 @@ static struct platform_device *h1940_devices[] __initdata = { &s3c_device_iis, }; -static struct s3c2410_board h1940_board __initdata = { +static struct s3c24xx_board h1940_board __initdata = { .devices = h1940_devices, .devices_count = ARRAY_SIZE(h1940_devices) }; @@ -99,19 +104,15 @@ static struct s3c2410_board h1940_board __initdata = { void __init h1940_map_io(void) { s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); - s3c2410_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); - s3c2410_set_board(&h1940_board); + s3c24xx_init_clocks(0); + s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); + s3c24xx_set_board(&h1940_board); } void __init h1940_init_irq(void) { - s3c2410_init_irq(); - -} + s3c24xx_init_irq(); -void __init h1940_init_time(void) -{ - s3c2410_init_time(); } MACHINE_START(H1940, "IPAQ-H1940") @@ -120,5 +121,5 @@ MACHINE_START(H1940, "IPAQ-H1940") BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(h1940_map_io) INITIRQ(h1940_init_irq) - INITTIME(h1940_init_time) + .timer = &s3c24xx_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c index c577c5f23..cd8d4ff93 100644 --- a/arch/arm/mach-s3c2410/mach-rx3715.c +++ b/arch/arm/mach-s3c2410/mach-rx3715.c @@ -12,6 +12,8 @@ * Modifications: * 16-Sep-2004 BJD Copied from mach-h1940.c * 25-Oct-2004 BJD Updates for 2.6.10-rc1 + * 10-Jan-2005 BJD Removed include of s3c2410.h s3c2440.h + * 14-Jan-2005 BJD Added new clock init */ #include @@ -38,8 +40,6 @@ #include #include -#include "s3c2410.h" -#include "s3c2440.h" #include "clock.h" #include "devs.h" #include "cpu.h" @@ -92,16 +92,15 @@ static struct s3c24xx_board rx3715_board __initdata = { void __init rx3715_map_io(void) { - s3c24xx_xtal = 16934000; - s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); - s3c2440_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); + s3c24xx_init_clocks(16934000); + s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); s3c24xx_set_board(&rx3715_board); } void __init rx3715_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } #ifdef CONFIG_PM @@ -120,5 +119,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715") MAPIO(rx3715_map_io) INITIRQ(rx3715_init_irq) INIT_MACHINE(rx3715_init_machine) - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c index 9f4286569..cd272f79f 100644 --- a/arch/arm/mach-s3c2410/mach-smdk2410.c +++ b/arch/arm/mach-s3c2410/mach-smdk2410.c @@ -46,7 +46,6 @@ #include -#include "s3c2410.h" #include "devs.h" #include "cpu.h" @@ -58,14 +57,10 @@ static struct map_desc smdk2410_iodesc[] __initdata = { #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE -/* base baud rate for all our UARTs */ -static unsigned long smdk2410_serial_clock = 24*1000*1000; - static struct s3c2410_uartcfg smdk2410_uartcfgs[] = { [0] = { .hwport = 0, .flags = 0, - .clock = &smdk2410_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, @@ -73,7 +68,6 @@ static struct s3c2410_uartcfg smdk2410_uartcfgs[] = { [1] = { .hwport = 1, .flags = 0, - .clock = &smdk2410_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, @@ -81,7 +75,6 @@ static struct s3c2410_uartcfg smdk2410_uartcfgs[] = { [2] = { .hwport = 2, .flags = 0, - .clock = &smdk2410_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, @@ -96,7 +89,7 @@ static struct platform_device *smdk2410_devices[] __initdata = { &s3c_device_iis, }; -static struct s3c2410_board smdk2410_board __initdata = { +static struct s3c24xx_board smdk2410_board __initdata = { .devices = smdk2410_devices, .devices_count = ARRAY_SIZE(smdk2410_devices) }; @@ -104,18 +97,14 @@ static struct s3c2410_board smdk2410_board __initdata = { void __init smdk2410_map_io(void) { s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc)); - s3c2410_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs)); - s3c2410_set_board(&smdk2410_board); + s3c24xx_init_clocks(0); + s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs)); + s3c24xx_set_board(&smdk2410_board); } void __init smdk2410_init_irq(void) { - s3c2410_init_irq(); -} - -void __init smdk2410_init_time(void) -{ - s3c2410_init_time(); + s3c24xx_init_irq(); } MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch @@ -125,7 +114,7 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(smdk2410_map_io) INITIRQ(smdk2410_init_irq) - INITTIME(smdk2410_init_time) + .timer = &s3c24xx_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c index 4a07a40cc..0834322e0 100644 --- a/arch/arm/mach-s3c2410/mach-vr1000.c +++ b/arch/arm/mach-s3c2410/mach-vr1000.c @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/mach-vr1000.c * - * Copyright (c) 2003,2004 Simtec Electronics + * Copyright (c) 2003-2005 Simtec Electronics * Ben Dooks * * Machine support for Thorcom VR1000 board. Designed for Thorcom by @@ -16,6 +16,14 @@ * 21-Aug-2004 BJD Added struct s3c2410_board * 06-Aug-2004 BJD Fixed call to time initialisation * 05-Apr-2004 BJD Copied to make mach-vr1000.c + * 18-Oct-2004 BJD Updated board struct + * 04-Nov-2004 BJD Clock and serial configuration update + * + * 04-Jan-2005 BJD Updated uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h + * 14-Jan-2005 BJD Added clock init + * 15-Jan-2005 BJD Add serial port device definition + * 20-Jan-2005 BJD Use UPF_IOREMAP for ports */ #include @@ -25,12 +33,19 @@ #include #include +#include +#include +#include +#include + #include #include #include #include #include +#include +#include #include #include @@ -40,7 +55,7 @@ //#include #include -#include "s3c2410.h" +#include "clock.h" #include "devs.h" #include "cpu.h" #include "usb-simtec.h" @@ -112,67 +127,174 @@ static struct map_desc vr1000_iodesc[] __initdata = { #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE -/* base baud rate for all our UARTs */ -static unsigned long vr1000_serial_clock = 3692307; +/* uart clock source(s) */ + +static struct s3c24xx_uart_clksrc vr1000_serial_clocks[] = { + [0] = { + .name = "uclk", + .divisor = 1, + .min_baud = 0, + .max_baud = 0, + }, + [1] = { + .name = "pclk", + .divisor = 1, + .min_baud = 0, + .max_baud = 0. + } +}; static struct s3c2410_uartcfg vr1000_uartcfgs[] = { [0] = { .hwport = 0, .flags = 0, - .clock = &vr1000_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = vr1000_serial_clocks, + .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), }, [1] = { .hwport = 1, .flags = 0, - .clock = &vr1000_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = vr1000_serial_clocks, + .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), }, /* port 2 is not actually used */ [2] = { .hwport = 2, .flags = 0, - .clock = &vr1000_serial_clock, .ucon = UCON, .ulcon = ULCON, .ufcon = UFCON, + .clocks = vr1000_serial_clocks, + .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), + + } +}; + +/* definitions for the vr1000 extra 16550 serial ports */ + +#define VR1000_BAUDBASE (3692307) + +#define VR1000_SERIAL_MAPBASE(x) (VR1000_PA_SERIAL + 0x80 + ((x) << 5)) + +static struct plat_serial8250_port serial_platform_data[] = { + [0] = { + .mapbase = VR1000_SERIAL_MAPBASE(0), + .irq = IRQ_VR1000_SERIAL + 0, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, + .iotype = UPIO_MEM, + .regshift = 0, + .uartclk = VR1000_BAUDBASE, + }, + [1] = { + .mapbase = VR1000_SERIAL_MAPBASE(1), + .irq = IRQ_VR1000_SERIAL + 1, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, + .iotype = UPIO_MEM, + .regshift = 0, + .uartclk = VR1000_BAUDBASE, + }, + [2] = { + .mapbase = VR1000_SERIAL_MAPBASE(2), + .irq = IRQ_VR1000_SERIAL + 2, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, + .iotype = UPIO_MEM, + .regshift = 0, + .uartclk = VR1000_BAUDBASE, + }, + [3] = { + .mapbase = VR1000_SERIAL_MAPBASE(3), + .irq = IRQ_VR1000_SERIAL + 3, + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, + .iotype = UPIO_MEM, + .regshift = 0, + .uartclk = VR1000_BAUDBASE, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +/* MTD NOR Flash */ + +static struct resource vr1000_nor_resource[] = { + [0] = { + .start = S3C2410_CS1 + 0x4000000, + .end = S3C2410_CS1 + 0x4000000 + SZ_16M - 1, + .flags = IORESOURCE_MEM, } }; +static struct platform_device vr1000_nor = { + .name = "bast-nor", + .id = -1, + .num_resources = ARRAY_SIZE(vr1000_nor_resource), + .resource = vr1000_nor_resource, +}; + + static struct platform_device *vr1000_devices[] __initdata = { &s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_iis, + &serial_device, + &vr1000_nor, }; -static struct s3c2410_board vr1000_board __initdata = { +static struct clk *vr1000_clocks[] = { + &s3c24xx_dclk0, + &s3c24xx_dclk1, + &s3c24xx_clkout0, + &s3c24xx_clkout1, + &s3c24xx_uclk, +}; + +static struct s3c24xx_board vr1000_board __initdata = { .devices = vr1000_devices, - .devices_count = ARRAY_SIZE(vr1000_devices) + .devices_count = ARRAY_SIZE(vr1000_devices), + .clocks = vr1000_clocks, + .clocks_count = ARRAY_SIZE(vr1000_clocks), }; void __init vr1000_map_io(void) { + /* initialise clock sources */ + + s3c24xx_dclk0.parent = NULL; + s3c24xx_dclk0.rate = 12*1000*1000; + + s3c24xx_dclk1.parent = NULL; + s3c24xx_dclk1.rate = 3692307; + + s3c24xx_clkout0.parent = &s3c24xx_dclk0; + s3c24xx_clkout1.parent = &s3c24xx_dclk1; + + s3c24xx_uclk.parent = &s3c24xx_clkout1; + s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc)); - s3c2410_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); - s3c2410_set_board(&vr1000_board); + s3c24xx_init_clocks(0); + s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); + s3c24xx_set_board(&vr1000_board); usb_simtec_init(); } void __init vr1000_init_irq(void) { - s3c2410_init_irq(); -} - -void __init vr1000_init_time(void) -{ - s3c2410_init_time(); + s3c24xx_init_irq(); } MACHINE_START(VR1000, "Thorcom-VR1000") @@ -181,5 +303,5 @@ MACHINE_START(VR1000, "Thorcom-VR1000") BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(vr1000_map_io) INITIRQ(vr1000_init_irq) - INITTIME(vr1000_init_time) + .timer = &s3c24xx_timer, MACHINE_END diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index 7709e8dde..b8270f26b 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c @@ -1,7 +1,7 @@ /* linux/arch/arm/mach-s3c2410/s3c2410.c * - * Copyright (c) 2003,2004 Simtec Electronics - * Ben Dooks + * Copyright (c) 2003-2005 Simtec Electronics + * Ben Dooks * * http://www.simtec.co.uk/products/EB2410ITX/ * @@ -15,6 +15,9 @@ * 05-Sep-2003 BJD Moved to kernel v2.6 * 18-Jan-2004 BJD Added serial port configuration * 21-Aug-2004 BJD Added new struct s3c2410_board handler + * 28-Sep-2004 BJD Updates for new serial port bits + * 04-Nov-2004 BJD Updated UART configuration process + * 10-Jan-2004 BJD Removed s3c2410_clock_tick_rate */ #include @@ -38,18 +41,9 @@ #include "s3c2410.h" #include "cpu.h" +#include "clock.h" -int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */ - -/* serial port setup */ - -struct s3c2410_uartcfg *s3c2410_uartcfgs; - -/* clock info */ - -unsigned long s3c2410_fclk; -unsigned long s3c2410_hclk; -unsigned long s3c2410_pclk; +/* Initial IO mappings */ static struct map_desc s3c2410_iodesc[] __initdata = { IODESC_ENT(USBHOST), @@ -131,72 +125,75 @@ static struct platform_device *uart_devices[] __initdata = { &s3c_uart2 }; -void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size) +/* store our uart devices for the serial driver console */ +struct platform_device *s3c2410_uart_devices[3]; + +static int s3c2410_uart_count = 0; + +/* uart registration process */ + +void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no) { - unsigned long tmp; + struct platform_device *platdev; + int uart; + + for (uart = 0; uart < no; uart++, cfg++) { + platdev = uart_devices[cfg->hwport]; + + s3c24xx_uart_devs[uart] = platdev; + platdev->dev.platform_data = cfg; + } + + s3c2410_uart_count = uart; +} + +/* s3c2410_map_io + * + * register the standard cpu IO areas, and any passed in from the + * machine specific initialisation. +*/ +void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size) +{ /* register our io-tables */ iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); iotable_init(mach_desc, mach_size); +} - printk("machine_initted %p,%d\n", mach_desc, mach_size); +void __init s3c2410_init_clocks(int xtal) +{ + unsigned long tmp; /* now we've got our machine bits initialised, work out what * clocks we've got */ - s3c2410_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), 12*MHZ); + s3c24xx_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), + s3c24xx_xtal); tmp = __raw_readl(S3C2410_CLKDIVN); - //printk("tmp=%08x, fclk=%d\n", tmp, s3c2410_fclk); /* work out clock scalings */ - s3c2410_hclk = s3c2410_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1); - s3c2410_pclk = s3c2410_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1); + s3c24xx_hclk = s3c24xx_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1); + s3c24xx_pclk = s3c24xx_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1); /* print brieft summary of clocks, etc */ printk("S3C2410: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n", - print_mhz(s3c2410_fclk), print_mhz(s3c2410_hclk), - print_mhz(s3c2410_pclk)); -} + print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk), + print_mhz(s3c24xx_pclk)); -static struct s3c2410_board *board; - -void s3c2410_set_board(struct s3c2410_board *b) -{ - board = b; -} + /* initialise the clocks here, to allow other things like the + * console to use them + */ -void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no) -{ - s3c2410_uartcfgs = cfg; + s3c24xx_setup_clocks(); } int __init s3c2410_init(void) { - int ret; - printk("S3C2410: Initialising architecture\n"); - ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices)); - if (ret) - return ret; - - if (board != NULL) { - if (board->devices != NULL) { - ret = platform_add_devices(board->devices, - board->devices_count); - - if (ret) { - printk(KERN_ERR "s3c2410: failed to add board devices (%d)\n", ret); - } - } - - /* not adding board devices may not be fatal */ - ret = 0; - } - - return ret; + return platform_add_devices(s3c24xx_uart_devs, s3c2410_uart_count); } diff --git a/arch/arm/mach-s3c2410/s3c2410.h b/arch/arm/mach-s3c2410/s3c2410.h index 09742c9bc..4d5312a48 100644 --- a/arch/arm/mach-s3c2410/s3c2410.h +++ b/arch/arm/mach-s3c2410/s3c2410.h @@ -1,7 +1,7 @@ /* arch/arm/mach-s3c2410/s3c2410.h * * Copyright (c) 2004 Simtec Electronics - * Ben Dooks + * Ben Dooks * * Header file for s3c2410 machine directory * @@ -13,26 +13,25 @@ * 18-Aug-2004 BJD Created initial version * 20-Aug-2004 BJD Added s3c2410_board struct * 04-Sep-2004 BJD Added s3c2410_init_uarts() call + * 17-Oct-2004 BJD Moved board out to cpu + * 04-Jan-2005 BJD Changed uart init + * 10-Jan-2005 BJD Removed timer to cpu.h, moved 2410 specific bits here + * 14-Jan-2005 BJD Added s3c2410_init_clocks call */ -extern void s3c2410_map_io(struct map_desc *, int count); +#ifdef CONFIG_CPU_S3C2410 -extern void s3c2410_init_irq(void); +extern int s3c2410_init(void); -extern void s3c2410_init_time(void); +extern void s3c2410_map_io(struct map_desc *mach_desc, int size); -/* the board structure is used at first initialsation time - * to get info such as the devices to register for this - * board. This is done because platfrom_add_devices() cannot - * be called from the map_io entry. - * -*/ - -struct s3c2410_board { - struct platform_device **devices; - unsigned int devices_count; -}; +extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); -extern void s3c2410_set_board(struct s3c2410_board *board); +extern void s3c2410_init_clocks(int xtal); -extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); +#else +#define s3c2410_init_clocks NULL +#define s3c2410_init_uarts NULL +#define s3c2410_map_io NULL +#define s3c2410_init NULL +#endif diff --git a/arch/arm/mach-s3c2410/s3c2440-dsc.c b/arch/arm/mach-s3c2410/s3c2440-dsc.c index fb3078379..50ccc673f 100644 --- a/arch/arm/mach-s3c2410/s3c2440-dsc.c +++ b/arch/arm/mach-s3c2410/s3c2440-dsc.c @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c * - * Copyright (c) 2004 Simtec Electronics + * Copyright (c) 2004-2005 Simtec Electronics * Ben Dooks * * Samsung S3C2440 Drive Strength Control support @@ -11,15 +11,15 @@ * * Modifications: * 29-Aug-2004 BJD Start of drive-strength control + * 09-Nov-2004 BJD Added symbol export + * 11-Jan-2005 BJD Include fix */ #include #include #include -#include -#include #include -#include +#include #include #include @@ -32,8 +32,8 @@ #include #include -#include "s3c2440.h" #include "cpu.h" +#include "s3c2440.h" int s3c2440_set_dsc(unsigned int pin, unsigned int value) { @@ -55,3 +55,5 @@ int s3c2440_set_dsc(unsigned int pin, unsigned int value) local_irq_restore(flags); return 0; } + +EXPORT_SYMBOL(s3c2440_set_dsc); diff --git a/arch/arm/mach-s3c2410/s3c2440.c b/arch/arm/mach-s3c2410/s3c2440.c index f4bb10c58..58146b8f6 100644 --- a/arch/arm/mach-s3c2410/s3c2440.c +++ b/arch/arm/mach-s3c2410/s3c2440.c @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/s3c2440.c * - * Copyright (c) 2004 Simtec Electronics + * Copyright (c) 2004-2005 Simtec Electronics * Ben Dooks * * Samsung S3C2440 Mobile CPU support @@ -10,7 +10,14 @@ * published by the Free Software Foundation. * * Modifications: - * 24-Aug-2004 BJD Start of s3c2440 support + * 24-Aug-2004 BJD Start of s3c2440 support + * 12-Oct-2004 BJD Moved clock info out to clock.c + * 01-Nov-2004 BJD Fixed clock build code + * 09-Nov-2004 BJD Added sysdev for power management + * 04-Nov-2004 BJD New serial registration + * 15-Nov-2004 BJD Rename the i2c device for the s3c2440 + * 14-Jan-2005 BJD Moved clock init code into seperate function + * 14-Jan-2005 BJD Removed un-used clock bits */ #include @@ -20,6 +27,7 @@ #include #include #include +#include #include #include @@ -28,23 +36,20 @@ #include #include #include +#include #include #include +#include +#include +#include #include "s3c2440.h" +#include "clock.h" +#include "devs.h" #include "cpu.h" +#include "pm.h" -int s3c2440_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */ - -/* clock info */ - -unsigned long s3c2440_baseclk = 12*1000*1000; /* assume base is 12MHz */ -unsigned long s3c2440_hdiv; - -unsigned long s3c2440_fclk; -unsigned long s3c2440_hclk; -unsigned long s3c2440_pclk; static struct map_desc s3c2440_iodesc[] __initdata = { IODESC_ENT(USBHOST), @@ -52,6 +57,7 @@ static struct map_desc s3c2440_iodesc[] __initdata = { IODESC_ENT(LCD), IODESC_ENT(TIMER), IODESC_ENT(ADC), + IODESC_ENT(WATCHDOG), }; static struct resource s3c_uart0_resource[] = { @@ -124,28 +130,105 @@ static struct platform_device *uart_devices[] __initdata = { &s3c_uart2 }; -void __init s3c2440_map_io(struct map_desc *mach_desc, int size) +/* uart initialisation */ + +static int __initdata s3c2440_uart_count; + +void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no) { - unsigned long tmp; - unsigned long camdiv; + struct platform_device *platdev; + int uart; + + for (uart = 0; uart < no; uart++, cfg++) { + platdev = uart_devices[cfg->hwport]; + + s3c24xx_uart_devs[uart] = platdev; + platdev->dev.platform_data = cfg; + } + + s3c2440_uart_count = uart; +} + +/* s3c2440 specific clock sources */ + +static struct clk s3c2440_clk_cam = { + .name = "camera", + .enable = s3c24xx_clkcon_enable, + .ctrlbit = S3C2440_CLKCON_CAMERA +}; + +static struct clk s3c2440_clk_ac97 = { + .name = "ac97", + .enable = s3c24xx_clkcon_enable, + .ctrlbit = S3C2440_CLKCON_CAMERA +}; + +#ifdef CONFIG_PM + +struct sleep_save s3c2440_sleep[] = { + SAVE_ITEM(S3C2440_DSC0), + SAVE_ITEM(S3C2440_DSC1), + SAVE_ITEM(S3C2440_GPJDAT), + SAVE_ITEM(S3C2440_GPJCON), + SAVE_ITEM(S3C2440_GPJUP) +}; + +static int s3c2440_suspend(struct sys_device *dev, u32 state) +{ + s3c2410_pm_do_save(s3c2440_sleep, ARRAY_SIZE(s3c2440_sleep)); + return 0; +} +static int s3c2440_resume(struct sys_device *dev) +{ + s3c2410_pm_do_restore(s3c2440_sleep, ARRAY_SIZE(s3c2440_sleep)); + return 0; +} + +#else +#define s3c2440_suspend NULL +#define s3c2440_resume NULL +#endif + +static struct sysdev_class s3c2440_sysclass = { + set_kset_name("s3c2440-core"), + .suspend = s3c2440_suspend, + .resume = s3c2440_resume +}; + +static struct sys_device s3c2440_sysdev = { + .cls = &s3c2440_sysclass, +}; + +void __init s3c2440_map_io(struct map_desc *mach_desc, int size) +{ /* register our io-tables */ iotable_init(s3c2440_iodesc, ARRAY_SIZE(s3c2440_iodesc)); iotable_init(mach_desc, size); + /* rename any peripherals used differing from the s3c2410 */ + + s3c_device_i2c.name = "s3c2440-i2c"; +} + +void __init s3c2440_init_clocks(int xtal) +{ + unsigned long clkdiv; + unsigned long camdiv; + int s3c2440_hdiv = 1; /* now we've got our machine bits initialised, work out what * clocks we've got */ - s3c2440_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), - s3c2440_baseclk); + s3c24xx_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), + s3c24xx_xtal) * 2; - tmp = __raw_readl(S3C2410_CLKDIVN); + clkdiv = __raw_readl(S3C2410_CLKDIVN); camdiv = __raw_readl(S3C2440_CAMDIVN); /* work out clock scalings */ - switch (tmp & S3C2440_CLKDIVN_HDIVN_MASK) { + switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) { case S3C2440_CLKDIVN_HDIVN_1: s3c2440_hdiv = 1; break; @@ -159,21 +242,36 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size) break; case S3C2440_CLKDIVN_HDIVN_3_6: - s3c2440_hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 6 : 3; + s3c2440_hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3; break; } - s3c2440_hclk = s3c2440_fclk / s3c2440_hdiv; - s3c2440_pclk = s3c2440_hclk / ((tmp & S3C2440_CLKDIVN_PDIVN) ? 2 : 1); + s3c24xx_hclk = s3c24xx_fclk / s3c2440_hdiv; + s3c24xx_pclk = s3c24xx_hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1); - /* print brieft summary of clocks, etc */ + /* print brief summary of clocks, etc */ printk("S3C2440: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n", - print_mhz(s3c2440_fclk), print_mhz(s3c2440_hclk), - print_mhz(s3c2440_pclk)); -} + print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk), + print_mhz(s3c24xx_pclk)); + + /* initialise the clocks here, to allow other things like the + * console to use them, and to add new ones after the initialisation + */ + + s3c24xx_setup_clocks(); + /* add s3c2440 specific clocks */ + s3c2440_clk_cam.parent = clk_get(NULL, "hclk"); + s3c2440_clk_ac97.parent = clk_get(NULL, "pclk"); + + s3c24xx_register_clock(&s3c2440_clk_ac97); + s3c24xx_register_clock(&s3c2440_clk_cam); + + clk_disable(&s3c2440_clk_ac97); + clk_disable(&s3c2440_clk_cam); +} int __init s3c2440_init(void) { @@ -181,12 +279,15 @@ int __init s3c2440_init(void) printk("S3C2440: Initialising architecture\n"); - ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices)); - if (ret) - return ret; + ret = sysdev_class_register(&s3c2440_sysclass); + if (ret == 0) + ret = sysdev_register(&s3c2440_sysdev); - // todo: board specific inits? + if (ret != 0) + printk(KERN_ERR "failed to register sysdev for s3c2440\n"); + + if (ret == 0) + ret = platform_add_devices(s3c24xx_uart_devs, s3c2440_uart_count); return ret; } - diff --git a/arch/arm/mach-s3c2410/s3c2440.h b/arch/arm/mach-s3c2410/s3c2440.h index bf49a66d5..29cb6df65 100644 --- a/arch/arm/mach-s3c2410/s3c2440.h +++ b/arch/arm/mach-s3c2410/s3c2440.h @@ -1,7 +1,7 @@ /* arch/arm/mach-s3c2410/s3c2440.h * - * Copyright (c) 2004 Simtec Electronics - * Ben Dooks + * Copyright (c) 2004-2005 Simtec Electronics + * Ben Dooks * * Header file for s3c2440 cpu support * @@ -10,9 +10,26 @@ * published by the Free Software Foundation. * * Modifications: - * 24-Aug-2004 BJD Start of S3C2440 CPU support + * 24-Aug-2004 BJD Start of S3C2440 CPU support + * 04-Nov-2004 BJD Added s3c2440_init_uarts() + * 04-Jan-2005 BJD Moved uart init to cpu code + * 10-Jan-2005 BJD Moved 2440 specific init here + * 14-Jan-2005 BJD Split the clock initialisation code */ -extern void s3c2440_init_irq(void); +#ifdef CONFIG_CPU_S3C2440 -extern void s3c2440_init_time(void); +extern int s3c2440_init(void); + +extern void s3c2440_map_io(struct map_desc *mach_desc, int size); + +extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no); + +extern void s3c2440_init_clocks(int xtal); + +#else +#define s3c2440_init_clocks NULL +#define s3c2440_init_uarts NULL +#define s3c2440_map_io NULL +#define s3c2440_init NULL +#endif diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c index 04ba5dfe0..715d65a40 100644 --- a/arch/arm/mach-s3c2410/time.c +++ b/arch/arm/mach-s3c2410/time.c @@ -1,7 +1,7 @@ -/* linux/include/asm-arm/arch-s3c2410/time.h +/* linux/arch/arm/mach-s3c2410/time.c * - * Copyright (C) 2003 Simtec Electronics - * Ben Dooks, + * Copyright (C) 2003,2004 Simtec Electronics + * Ben Dooks, * * 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 @@ -34,13 +34,52 @@ #include #include +#include "clock.h" + static unsigned long timer_startval; -static unsigned long timer_ticks_usec; +static unsigned long timer_usec_ticks; +#define TIMER_USEC_SHIFT 16 -/* with an 12MHz clock, we get 12 ticks per-usec - */ +/* we use the shifted arithmetic to work out the ratio of timer ticks + * to usecs, as often the peripheral clock is not a nice even multiple + * of 1MHz. + * + * shift of 14 and 15 are too low for the 12MHz, 16 seems to be ok + * for the current HZ value of 200 without producing overflows. + * + * Original patch by Dimitry Andric, updated by Ben Dooks +*/ + + +/* timer_mask_usec_ticks + * + * given a clock and divisor, make the value to pass into timer_ticks_to_usec + * to scale the ticks into usecs +*/ + +static inline unsigned long +timer_mask_usec_ticks(unsigned long scaler, unsigned long pclk) +{ + unsigned long den = pclk / 1000; + return ((1000 << TIMER_USEC_SHIFT) * scaler + (den >> 1)) / den; +} + +/* timer_ticks_to_usec + * + * convert timer ticks to usec. +*/ + +static inline unsigned long timer_ticks_to_usec(unsigned long ticks) +{ + unsigned long res; + + res = ticks * timer_usec_ticks; + res += 1 << (TIMER_USEC_SHIFT - 4); /* round up slightly */ + + return res >> TIMER_USEC_SHIFT; +} /*** * Returns microsecond since last clock interrupt. Note that interrupts @@ -53,31 +92,31 @@ static unsigned long timer_ticks_usec; static unsigned long s3c2410_gettimeoffset (void) { unsigned long tdone; - unsigned long usec; unsigned long irqpend; + unsigned long tval; /* work out how many ticks have gone since last timer interrupt */ - tdone = timer_startval - __raw_readl(S3C2410_TCNTO(4)); + tval = __raw_readl(S3C2410_TCNTO(4)); + tdone = timer_startval - tval; /* check to see if there is an interrupt pending */ irqpend = __raw_readl(S3C2410_SRCPND); if (irqpend & SRCPND_TIMER4) { /* re-read the timer, and try and fix up for the missed - * interrupt */ + * interrupt. Note, the interrupt may go off before the + * timer has re-loaded from wrapping. + */ - tdone = timer_startval - __raw_readl(S3C2410_TCNTO(4)); - tdone += 1<<16; - } - - /* currently, tcnt is in 12MHz units, but this may change - * for non-bast machines... - */ + tval = __raw_readl(S3C2410_TCNTO(4)); + tdone = timer_startval - tval; - usec = tdone / timer_ticks_usec; + if (tval != 0) + tdone += timer_startval; + } - return usec; + return timer_ticks_to_usec(tdone); } @@ -87,13 +126,14 @@ static unsigned long s3c2410_gettimeoffset (void) static irqreturn_t s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); timer_tick(regs); - + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } static struct irqaction s3c2410_timer_irq = { - .name = "S32410 Timer Tick", + .name = "S3C2410 Timer Tick", .flags = SA_INTERRUPT, .handler = s3c2410_timer_interrupt }; @@ -104,15 +144,13 @@ static struct irqaction s3c2410_timer_irq = { * Currently we only use timer4, as it is the only timer which has no * other function that can be exploited externally */ -void __init s3c2410_init_time (void) +static void s3c2410_timer_setup (void) { unsigned long tcon; unsigned long tcnt; unsigned long tcfg1; unsigned long tcfg0; - gettimeoffset = s3c2410_gettimeoffset; - tcnt = 0xffff; /* default value for tcnt */ /* read the current timer configuration bits */ @@ -124,23 +162,25 @@ void __init s3c2410_init_time (void) /* configure the system for whichever machine is in use */ if (machine_is_bast() || machine_is_vr1000()) { - timer_ticks_usec = 12; /* timer is at 12MHz */ - tcnt = (timer_ticks_usec * (1000*1000)) / HZ; - } + /* timer is at 12MHz, scaler is 1 */ + timer_usec_ticks = timer_mask_usec_ticks(1, 12000000); + tcnt = 12000000 / HZ; + + tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; + tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1; + } else { + /* for the h1940 (and others), we use the pclk from the core + * to generate the timer values. since values around 50 to + * 70MHz are not values we can directly generate the timer + * value from, we need to pre-scale and divide before using it. + * + * for instance, using 50.7MHz and dividing by 6 gives 8.45MHz + * (8.45 ticks per usec) + */ - /* for the h1940, we use the pclk from the core to generate - * the timer values. since 67.5MHz is not a value we can directly - * generate the timer value from, we need to pre-scale and - * divied before using it. - * - * overall divsior to get 200Hz is 337500 - * we can fit tcnt if we pre-scale by 6, producing a tick rate - * of 11.25MHz, and a tcnt of 56250. - */ + /* this is used as default if no other timer can be found */ - if (machine_is_h1940() || machine_is_smdk2410() ) { - timer_ticks_usec = s3c2410_pclk / (1000*1000); - timer_ticks_usec /= 6; + timer_usec_ticks = timer_mask_usec_ticks(6, s3c24xx_pclk); tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; tcfg1 |= S3C2410_TCFG1_MUX4_DIV2; @@ -148,12 +188,15 @@ void __init s3c2410_init_time (void) tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT; - tcnt = (s3c2410_pclk / 6) / HZ; + tcnt = (s3c24xx_pclk / 6) / HZ; } + /* timers reload after counting zero, so reduce the count by 1 */ - printk("setup_timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx\n", - tcon, tcnt, tcfg0, tcfg1); + tcnt--; + + printk("timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx, usec %08lx\n", + tcon, tcnt, tcfg0, tcfg1, timer_usec_ticks); /* check to see if timer is within 16bit range... */ if (tcnt > 0xffff) { @@ -177,13 +220,20 @@ void __init s3c2410_init_time (void) __raw_writel(tcnt, S3C2410_TCNTB(4)); __raw_writel(tcnt, S3C2410_TCMPB(4)); - setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); - /* start the timer running */ tcon |= S3C2410_TCON_T4START; tcon &= ~S3C2410_TCON_T4MANUALUPD; __raw_writel(tcon, S3C2410_TCON); } +static void __init s3c2410_timer_init (void) +{ + s3c2410_timer_setup(); + setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); +} - +struct sys_timer s3c24xx_timer = { + .init = s3c2410_timer_init, + .offset = s3c2410_gettimeoffset, + .resume = s3c2410_timer_setup +}; diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c index b8f8ded4b..7f2b61362 100644 --- a/arch/arm/mach-s3c2410/usb-simtec.c +++ b/arch/arm/mach-s3c2410/usb-simtec.c @@ -13,6 +13,7 @@ * * Modifications: * 14-Sep-2004 BJD Created + * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared */ #define DEBUG @@ -51,10 +52,8 @@ usb_simtec_powercontrol(int port, int to) { pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); - if (port == 1) { + if (port == 1) s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); - pr_debug("GPBDAT now %08x\n", __raw_readl(S3C2410_GPBDAT)); - } } static irqreturn_t @@ -67,6 +66,7 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs) s3c2410_report_oc(info, 3); } else { pr_debug("usb_simtec: over-current irq (oc cleared)\n"); + s3c2410_report_oc(info, 0); } return IRQ_HANDLED; @@ -77,16 +77,15 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on) int ret; if (on) { - pr_debug("claiming usb overccurent\n"); ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT, - "usb-oc", info); + "USB Over-current", info); if (ret != 0) { printk(KERN_ERR "failed to request usb oc irq\n"); } set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE); } else { - free_irq(IRQ_USBOC, NULL); + free_irq(IRQ_USBOC, info); } } @@ -110,14 +109,5 @@ int usb_simtec_init(void) s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP); s3c2410_gpio_setpin(S3C2410_GPB4, 1); - - pr_debug("GPB: CON=%08x, DAT=%08x\n", - __raw_readl(S3C2410_GPBCON), __raw_readl(S3C2410_GPBDAT)); - - if (0) { - s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST, - S3C2410_MISCCR_USBDEV); - } - return 0; } diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index b586220d7..aa7d1c792 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig @@ -16,21 +16,6 @@ config ASSABET_NEPONSET Microprocessor Development Board (Assabet) with the SA-1111 Development Board (Nepon). -config SA1100_ADSBITSY - bool "ADS Bitsy" - help - Say Y here if you are using Applied Data Systems Intel(R) - StrongARM(R) 1110 based Bitsy, 3 x 5 inches in size, Compaq - IPAQ - - like platform. See - for more - information. - -config SA1100_BRUTUS - bool "Brutus" - help - Say Y here if you are using the Intel(R) StrongARM(R) SA-1100 - Microprocessor Development Board (also known as the Brutus). - config SA1100_CERF bool "CerfBoard" help @@ -98,44 +83,6 @@ config SA1100_H3XXX depends on SA1100_H3100 || SA1100_H3600 || SA1100_H3800 default y -#dep_bool ' Consus' CONFIG_SA1100_CONSUS $CONFIG_ARCH_SA1100 -#dep_bool ' Empeg' CONFIG_SA1100_EMPEG $CONFIG_ARCH_SA1100 -config SA1100_EXTENEX1 - bool "Extenex HandHeld Theater (Squashtail)" - -config SA1100_EXTENEX1_16MB - bool "Support 16 MB of DRAM (not just 8)" - depends on SA1100_EXTENEX1 - -config SA1100_FLEXANET - bool "FlexaNet" - help - Say Y here if you intend to run this kernel on the FlexaNet - handheld instruments. Information about this machine can be - found at: . - -config SA1100_FREEBIRD - bool "FreeBird-v1.1" - help - Support the FreeBird board used in Coventive embedded products. See - Documentation/arm/SA1100/Freebird for more. - -config SA1100_GRAPHICSCLIENT - bool "GraphicsClient Plus" - help - Say Y here if you are using an Applied Data Systems Intel(R) - StrongARM(R) SA-1100 based Graphics Client SBC. See - for information on this system. - -config SA1100_GRAPHICSMASTER - bool "GraphicsMaster" - help - Say Y here if you are using an Applied Data Systems Intel(R) - StrongARM(R) SA-1100 based Graphics Master SBC with SA-1111 - StrongARM companion chip. See - for information - on this system. - config SA1100_BADGE4 bool "HP Labs BadgePAD 4" help @@ -155,21 +102,6 @@ config SA1100_HACKKIT Say Y here to support the HackKit Core CPU Board ; -config SA1100_HUW_WEBPANEL - bool "HuW WebPanel" - help - Say Y here to support the HuW Webpanel produced by Hoeft & Wessel - AG. English-language website is at - ; credits and build instructions - at Documentation/arm/SA1100/HUW_WEBPANEL. - -config SA1100_ITSY - bool "Itsy" - help - Say Y here if you are using the Compaq Itsy experimental pocket - computer. See for - more information. - config SA1100_LART bool "LART" help @@ -177,47 +109,14 @@ config SA1100_LART (also known as the LART). See for information on the LART. -config SA1100_NANOENGINE - bool "nanoEngine" - help - The nanoEngine is a StrongARM 1110-based single board computer - from Bright Star Engineering. More information is available at: - . - - Say Y if configuring for a nanoEngine. - Say N otherwise. - -config SA1100_OMNIMETER - bool "OmniMeter" - help - Say Y here if you are using the inhand electronics OmniMeter. See - for details. - -config SA1100_PANGOLIN - bool "Pangolin" - help - Pangolin is a StrongARM 1110-based evaluation platform produced - by Dialogue Technology. It has EISA slots for ease of configuration - with SDRAM/Flash memory card, USB/Serial/Audio card, Compact Flash - card, and TFT-LCD card. - - Say Y if configuring for a Pangolin. - Say N otherwise. - config SA1100_PLEB bool "PLEB" help - Say Y here if you are using a Portable Linux Embedded Board - (also known as PLEB). See + Say Y here if you are using version 1 of the Portable Linux + Embedded Board (also known as PLEB). + See for more information. -config SA1100_PT_SYSTEM3 - bool "PT System 3" - help - Say Y here if you intend to build a kernel suitable to run on - a Pruftechnik Digital Board. For more information see - - config SA1100_SHANNON bool "Shannon" help @@ -226,15 +125,6 @@ config SA1100_SHANNON platform with a 640x480 LCD, touchscreen, CIR keyboard, PCMCIA slots, and a telco interface. -config SA1100_SHERMAN - bool "Sherman" - help - Say Y here to support the Blazie Engineering `Sherman' StrongARM - 1110-based SBC, used primarily in assistance products for the - visually impaired. The company is now Freedom Scientific, with - a website at . The Sherman - product, however, appears to have been discontinued. - config SA1100_SIMPAD bool "Simpad" help @@ -245,53 +135,6 @@ config SA1100_SIMPAD like CL4 in additional it has a PCMCIA-Slot. For more information visit or . -config SA1100_PFS168 - bool "Tulsa" - help - The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based - computer which includes the SA-1111 Microprocessor Companion Chip and other - custom I/O designed to add connectivity and multimedia features for vending - and business machine applications. Say Y here if you require support for - this target. - -config SA1100_VICTOR - bool "Victor" - help - Say Y here if you are using a Visu Aide Intel(R) StrongARM(R) - SA-1100 based Victor Digital Talking Book Reader. See - for information on - this system. - -config SA1100_XP860 - bool "XP860" - help - :: Config help missing :: - :: 06 August 2002 :: - -config SA1100_YOPY - bool "Yopy" - help - Say Y here to support the Yopy PDA. Product information at - . See Documentation/arm/SA1100/Yopy - for more. - -config SA1100_STORK - bool "Stork" - help - Say Y here if you intend to run this kernel on the Stork - handheld computer. - -#config SA1100_TRIZEPS -# bool "Trizeps" -# help -# :: write me :: - -#config TRIZEPS_MFTB2 -# bool "MFTB2" -# depends on SA1100_TRIZEPS -# help -# :: write me :: - config SA1100_SSP tristate "Generic PIO SSP" help @@ -300,17 +143,6 @@ config SA1100_SSP other devices, eg for BadgePAD 4 sensor support, or Jornada 720 touchscreen support. -config SA1100_USB - tristate "SA1100 USB function support" - -config SA1100_USB_NETLINK - tristate "Support for SA11x0 USB network link function" - depends on SA1100_USB - -config SA1100_USB_CHAR - tristate "Support for SA11x0 USB character device emulation" - depends on SA1100_USB - config H3600_SLEEVE tristate "Compaq iPAQ Handheld sleeve support" depends on SA1100_H3600 diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 898f27891..e4a4a3e8a 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile @@ -13,9 +13,6 @@ obj-$(CONFIG_CPU_FREQ_SA1100) += cpu-sa1100.o obj-$(CONFIG_CPU_FREQ_SA1110) += cpu-sa1110.o # Specific board support -obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o -led-$(CONFIG_SA1100_ADSBITSY) += leds-adsbitsy.o - obj-$(CONFIG_SA1100_ASSABET) += assabet.o led-$(CONFIG_SA1100_ASSABET) += leds-assabet.o obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o @@ -23,68 +20,27 @@ obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o obj-$(CONFIG_SA1100_BADGE4) += badge4.o led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o -obj-$(CONFIG_SA1100_BRUTUS) += brutus.o -led-$(CONFIG_SA1100_BRUTUS) += leds-brutus.o - obj-$(CONFIG_SA1100_CERF) += cerf.o led-$(CONFIG_SA1100_CERF) += leds-cerf.o obj-$(CONFIG_SA1100_COLLIE) += collie.o -obj-$(CONFIG_SA1100_EMPEG) += empeg.o - -obj-$(CONFIG_SA1100_FLEXANET) += flexanet.o -led-$(CONFIG_SA1100_FLEXANET) += leds-flexanet.o - -obj-$(CONFIG_SA1100_FREEBIRD) += freebird.o -obj-$(CONFIG_SA1100_GRAPHICSCLIENT) += graphicsclient.o -led-$(CONFIG_SA1100_GRAPHICSCLIENT) += leds-graphicsclient.o - -obj-$(CONFIG_SA1100_GRAPHICSMASTER) += graphicsmaster.o -led-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o - obj-$(CONFIG_SA1100_H3600) += h3600.o obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o -obj-$(CONFIG_SA1100_HUW_WEBPANEL) += huw_webpanel.o - -obj-$(CONFIG_SA1100_ITSY) += itsy.o - obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o obj-$(CONFIG_SA1100_LART) += lart.o led-$(CONFIG_SA1100_LART) += leds-lart.o -obj-$(CONFIG_SA1100_NANOENGINE) += nanoengine.o - -obj-$(CONFIG_SA1100_OMNIMETER) += omnimeter.o - -obj-$(CONFIG_SA1100_PANGOLIN) += pangolin.o - -obj-$(CONFIG_SA1100_PFS168) += pfs168.o -led-$(CONFIG_SA1100_PFS168) += leds-pfs168.o - obj-$(CONFIG_SA1100_PLEB) += pleb.o -obj-$(CONFIG_SA1100_PT_SYSTEM3) += system3.o -led-$(CONFIG_SA1100_PT_SYSTEM3) += leds-system3.o - obj-$(CONFIG_SA1100_SHANNON) += shannon.o -obj-$(CONFIG_SA1100_SHERMAN) += sherman.o - obj-$(CONFIG_SA1100_SIMPAD) += simpad.o -led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o - -obj-$(CONFIG_SA1100_STORK) += stork.o - -obj-$(CONFIG_SA1100_TRIZEPS) += trizeps.o - -obj-$(CONFIG_SA1100_XP860) += xp860.o - -obj-$(CONFIG_SA1100_YOPY) += yopy.o +led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o # LEDs support obj-$(CONFIG_LEDS) += $(led-y) diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index e5098cf9c..a3003b867 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -9,16 +9,17 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - #include #include #include -#include #include -#include #include +#include #include +#include +#include #include +#include #include #include @@ -29,6 +30,8 @@ #include #include +#include +#include #include #include #include @@ -92,6 +95,109 @@ static void assabet_lcd_power(int on) ASSABET_BCR_clear(ASSABET_BCR_LCD_ON); } + +/* + * Assabet flash support code. + */ + +#ifdef ASSABET_REV_4 +/* + * Phase 4 Assabet has two 28F160B3 flash parts in bank 0: + */ +static struct mtd_partition assabet_partitions[] = { + { + .name = "bootloader", + .size = 0x00020000, + .offset = 0, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "bootloader params", + .size = 0x00020000, + .offset = MTDPART_OFS_APPEND, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "jffs", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; +#else +/* + * Phase 5 Assabet has two 28F128J3A flash parts in bank 0: + */ +static struct mtd_partition assabet_partitions[] = { + { + .name = "bootloader", + .size = 0x00040000, + .offset = 0, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "bootloader params", + .size = 0x00040000, + .offset = MTDPART_OFS_APPEND, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "jffs", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; +#endif + +static struct flash_platform_data assabet_flash_data = { + .map_name = "cfi_probe", + .parts = assabet_partitions, + .nr_parts = ARRAY_SIZE(assabet_partitions), +}; + +static struct resource assabet_flash_resources[] = { + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + } +}; + + +/* + * Assabet IrDA support code. + */ + +static int assabet_irda_set_power(struct device *dev, unsigned int state) +{ + static unsigned int bcr_state[4] = { + ASSABET_BCR_IRDA_MD0, + ASSABET_BCR_IRDA_MD1|ASSABET_BCR_IRDA_MD0, + ASSABET_BCR_IRDA_MD1, + 0 + }; + + if (state < 4) { + state = bcr_state[state]; + ASSABET_BCR_clear(state ^ (ASSABET_BCR_IRDA_MD1| + ASSABET_BCR_IRDA_MD0)); + ASSABET_BCR_set(state); + } + return 0; +} + +static void assabet_irda_set_speed(struct device *dev, unsigned int speed) +{ + if (speed < 4000000) + ASSABET_BCR_clear(ASSABET_BCR_IRDA_FSEL); + else + ASSABET_BCR_set(ASSABET_BCR_IRDA_FSEL); +} + +static struct irda_platform_data assabet_irda_data = { + .set_power = assabet_irda_set_power, + .set_speed = assabet_irda_set_speed, +}; + static void __init assabet_init(void) { /* @@ -136,6 +242,10 @@ static void __init assabet_init(void) "hasn't been configured in the kernel\n" ); #endif } + + sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources, + ARRAY_SIZE(assabet_flash_resources)); + sa11x0_set_irda_data(&assabet_irda_data); } /* @@ -324,6 +434,6 @@ MACHINE_START(ASSABET, "Intel-Assabet") FIXUP(fixup_assabet) MAPIO(assabet_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) - INIT_MACHINE(assabet_init) + .timer = &sa1100_timer, + .init_machine = assabet_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c index cef71047c..6a60b497a 100644 --- a/arch/arm/mach-sa1100/badge4.c +++ b/arch/arm/mach-sa1100/badge4.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -27,6 +29,7 @@ #include #include +#include #include #include #include @@ -54,7 +57,7 @@ static struct platform_device sa1111_device = { .name = "sa1111", .id = 0, .dev = { - .dma_mask = &sa1111_dmamask; + .dma_mask = &sa1111_dmamask, .coherent_dma_mask = 0xffffffff, }, .num_resources = ARRAY_SIZE(sa1111_resources), @@ -80,6 +83,45 @@ static int __init badge4_sa1111_init(void) } +/* + * 1 x Intel 28F320C3 Advanced+ Boot Block Flash (32 Mi bit) + * Eight 4 KiW Parameter Bottom Blocks (64 KiB) + * Sixty-three 32 KiW Main Blocks (4032 Ki b) + * + * + * + * 1 x Intel 28F640C3 Advanced+ Boot Block Flash (64 Mi bit) + * Eight 4 KiW Parameter Bottom Blocks (64 KiB) + * One-hundred-twenty-seven 32 KiW Main Blocks (8128 Ki b) + */ +static struct mtd_partition badge4_partitions[] = { + { + .name = "BLOB boot loader", + .offset = 0, + .size = 0x0000A000 + }, { + .name = "params", + .offset = MTDPART_OFS_APPEND, + .size = 0x00006000 + }, { + .name = "root", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL + } +}; + +static struct flash_platform_data badge4_flash_data = { + .map_name = "cfi_probe", + .parts = badge4_partitions, + .nr_parts = ARRAY_SIZE(badge4_partitions), +}; + +static struct resource badge4_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_64M - 1, + .flags = IORESOURCE_MEM, +}; + static int five_v_on __initdata = 0; static int __init five_v_on_setup(char *ignore) @@ -170,6 +212,8 @@ static int __init badge4_init(void) /* maybe turn on 5v0 from the start */ badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on); + sa11x0_set_flash_data(&badge4_flash_data, &badge4_flash_resource, 1); + return 0; } @@ -245,5 +289,5 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") BOOT_PARAMS(0xc0000100) MAPIO(badge4_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, MACHINE_END diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c index 2c4c05013..f8edde5e7 100644 --- a/arch/arm/mach-sa1100/cerf.c +++ b/arch/arm/mach-sa1100/cerf.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include @@ -22,6 +24,7 @@ #include #include +#include #include #include @@ -47,6 +50,48 @@ static struct platform_device *cerf_devices[] __initdata = { &cerfuart2_device, }; +#ifdef CONFIG_SA1100_CERF_FLASH_32MB +# define CERF_FLASH_SIZE 0x02000000 +#elif defined CONFIG_SA1100_CERF_FLASH_16MB +# define CERF_FLASH_SIZE 0x01000000 +#elif defined CONFIG_SA1100_CERF_FLASH_8MB +# define CERF_FLASH_SIZE 0x00800000 +#else +# error "Undefined flash size for CERF" +#endif + +static struct mtd_partition cerf_partitions[] = { + { + .name = "Bootloader", + .size = 0x00020000, + .offset = 0x00000000, + }, { + .name = "Params", + .size = 0x00040000, + .offset = 0x00020000, + }, { + .name = "Kernel", + .size = 0x00100000, + .offset = 0x00060000, + }, { + .name = "Filesystem", + .size = CERF_FLASH_SIZE-0x00160000, + .offset = 0x00160000, + } +}; + +static struct flash_platform_data cerf_flash_data = { + .map_name = "cfi_probe", + .parts = cerf_partitions, + .nr_parts = ARRAY_SIZE(cerf_partitions), +}; + +static struct resource cerf_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; + static void __init cerf_init_irq(void) { sa1100_init_irq(); @@ -71,26 +116,17 @@ static void __init cerf_map_io(void) GPDR |= CERF_GPIO_CF_RESET; } -static int __init cerf_init(void) +static void __init cerf_init(void) { - int ret; - - if (!machine_is_cerf()) - return -ENODEV; - - ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); - if (ret < 0) - return ret; - - return 0; + platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); + sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); } -arch_initcall(cerf_init); - MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") MAINTAINER("support@intrinsyc.com") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(cerf_map_io) INITIRQ(cerf_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = cerf_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 23bf73ef8..2bc071a7b 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -31,39 +33,38 @@ #include #include +#include #include #include +#include #include #include "generic.h" -static void __init scoop_init(void) -{ +static struct resource collie_scoop_resources[] = { + [0] = { + .start = 0x40800000, + .end = 0x40800fff, + .flags = IORESOURCE_MEM, + }, +}; -#define COLLIE_SCP_INIT_DATA(adr,dat) (((adr)<<16)|(dat)) -#define COLLIE_SCP_INIT_DATA_END ((unsigned long)-1) - static const unsigned long scp_init[] = { - COLLIE_SCP_INIT_DATA(COLLIE_SCP_MCR, 0x0140), // 00 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_MCR, 0x0100), - COLLIE_SCP_INIT_DATA(COLLIE_SCP_CDR, 0x0000), // 04 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_CPR, 0x0000), // 0C - COLLIE_SCP_INIT_DATA(COLLIE_SCP_CCR, 0x0000), // 10 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_IMR, 0x0000), // 18 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_IRM, 0x00FF), // 14 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_ISR, 0x0000), // 1C - COLLIE_SCP_INIT_DATA(COLLIE_SCP_IRM, 0x0000), - COLLIE_SCP_INIT_DATA(COLLIE_SCP_GPCR, COLLIE_SCP_IO_DIR), // 20 - COLLIE_SCP_INIT_DATA(COLLIE_SCP_GPWR, COLLIE_SCP_IO_OUT), // 24 - COLLIE_SCP_INIT_DATA_END - }; - int i; - for (i = 0; scp_init[i] != COLLIE_SCP_INIT_DATA_END; i++) { - int adr = scp_init[i] >> 16; - COLLIE_SCP_REG(adr) = scp_init[i] & 0xFFFF; - } +static struct scoop_config collie_scoop_setup = { + .io_dir = COLLIE_SCOOP_IO_DIR, + .io_out = COLLIE_SCOOP_IO_OUT, +}; + +static struct platform_device colliescoop_device = { + .name = "sharp-scoop", + .id = -1, + .dev = { + .platform_data = &collie_scoop_setup, + }, + .num_resources = ARRAY_SIZE(collie_scoop_resources), + .resource = collie_scoop_resources, +}; -} static struct resource locomo_resources[] = { [0] = { @@ -87,6 +88,49 @@ static struct platform_device locomo_device = { static struct platform_device *devices[] __initdata = { &locomo_device, + &colliescoop_device, +}; + +static struct mtd_partition collie_partitions[] = { + { + .name = "bootloader", + .offset = 0, + .size = 0x000C0000, + .mask_flags = MTD_WRITEABLE + }, { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = 0x00100000, + }, { + .name = "rootfs", + .offset = MTDPART_OFS_APPEND, + .size = 0x00e20000, + } +}; + +static void collie_set_vpp(int vpp) +{ + write_scoop_reg(SCOOP_GPCR, read_scoop_reg(SCOOP_GPCR) | COLLIE_SCP_VPEN); + if (vpp) { + write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) | COLLIE_SCP_VPEN); + } else { + write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) & ~COLLIE_SCP_VPEN); + } +} + +static struct flash_platform_data collie_flash_data = { + .map_name = "cfi_probe", + .set_vpp = collie_set_vpp, + .parts = collie_partitions, + .nr_parts = ARRAY_SIZE(collie_partitions), +}; + +static struct resource collie_flash_resources[] = { + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + } }; static void __init collie_init(void) @@ -115,19 +159,19 @@ static void __init collie_init(void) GPDR |= GPIO_32_768kHz; TUCR = TUCR_32_768kHz; - scoop_init(); - ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret) { printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); } + + sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, + ARRAY_SIZE(collie_flash_resources)); } static struct map_desc collie_io_desc[] __initdata = { /* virtual physical length type */ {0xe8000000, 0x00000000, 0x02000000, MT_DEVICE}, /* 32M main flash (cs0) */ {0xea000000, 0x08000000, 0x02000000, MT_DEVICE}, /* 32M boot flash (cs1) */ - {0xf0000000, 0x40000000, 0x01000000, MT_DEVICE}, /* 16M LOCOMO & SCOOP (cs4) */ }; static void __init collie_map_io(void) @@ -140,6 +184,6 @@ MACHINE_START(COLLIE, "Sharp-Collie") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(collie_map_io) INITIRQ(sa1100_init_irq) - INIT_MACHINE(collie_init) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = collie_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 4fe5a5a4a..95ae217be 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -161,7 +161,7 @@ static u64 sa11x0udc_dma_mask = 0xffffffffUL; static struct platform_device sa11x0udc_device = { .name = "sa11x0-udc", - .id = 0, + .id = -1, .dev = { .dma_mask = &sa11x0udc_dma_mask, .coherent_dma_mask = 0xffffffff, @@ -212,7 +212,7 @@ static u64 sa11x0mcp_dma_mask = 0xffffffffUL; static struct platform_device sa11x0mcp_device = { .name = "sa11x0-mcp", - .id = 0, + .id = -1, .dev = { .dma_mask = &sa11x0mcp_dma_mask, .coherent_dma_mask = 0xffffffff, @@ -233,7 +233,7 @@ static u64 sa11x0ssp_dma_mask = 0xffffffffUL; static struct platform_device sa11x0ssp_device = { .name = "sa11x0-ssp", - .id = 0, + .id = -1, .dev = { .dma_mask = &sa11x0ssp_dma_mask, .coherent_dma_mask = 0xffffffff, @@ -257,7 +257,7 @@ static struct resource sa11x0fb_resources[] = { static struct platform_device sa11x0fb_device = { .name = "sa11x0-fb", - .id = 0, + .id = -1, .dev = { .coherent_dma_mask = 0xffffffff, }, @@ -267,9 +267,54 @@ static struct platform_device sa11x0fb_device = { static struct platform_device sa11x0pcmcia_device = { .name = "sa11x0-pcmcia", - .id = 0, + .id = -1, }; +static struct platform_device sa11x0mtd_device = { + .name = "flash", + .id = -1, +}; + +void sa11x0_set_flash_data(struct flash_platform_data *flash, + struct resource *res, int nr) +{ + sa11x0mtd_device.dev.platform_data = flash; + sa11x0mtd_device.resource = res; + sa11x0mtd_device.num_resources = nr; +} + +static struct resource sa11x0ir_resources[] = { + { + .start = __PREG(Ser2UTCR0), + .end = __PREG(Ser2UTCR0) + 0x24 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = __PREG(Ser2HSCR0), + .end = __PREG(Ser2HSCR0) + 0x1c - 1, + .flags = IORESOURCE_MEM, + }, { + .start = __PREG(Ser2HSCR2), + .end = __PREG(Ser2HSCR2) + 0x04 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_Ser2ICP, + .end = IRQ_Ser2ICP, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device sa11x0ir_device = { + .name = "sa11x0-ir", + .id = -1, + .num_resources = ARRAY_SIZE(sa11x0ir_resources), + .resource = sa11x0ir_resources, +}; + +void sa11x0_set_irda_data(struct irda_platform_data *irda) +{ + sa11x0ir_device.dev.platform_data = irda; +} + static struct platform_device *sa11x0_devices[] __initdata = { &sa11x0udc_device, &sa11x0uart1_device, @@ -278,12 +323,16 @@ static struct platform_device *sa11x0_devices[] __initdata = { &sa11x0ssp_device, &sa11x0pcmcia_device, &sa11x0fb_device, + &sa11x0mtd_device, }; static int __init sa1100_init(void) { pm_power_off = sa1100_power_off; + if (sa11x0ir_device.dev.platform_data) + platform_device_register(&sa11x0ir_device); + return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices)); } diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 04bcfeb3b..bfe41da99 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -4,9 +4,11 @@ * Author: Nicolas Pitre */ +struct sys_timer; + +extern struct sys_timer sa1100_timer; extern void __init sa1100_map_io(void); extern void __init sa1100_init_irq(void); -extern void __init sa1100_init_time(void); #define SET_BANK(__nr,__start,__size) \ mi->bank[__nr].start = (__start), \ @@ -25,3 +27,12 @@ extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); extern int sa11x0_verify_speed(struct cpufreq_policy *policy); extern unsigned int sa11x0_getspeed(unsigned int cpu); extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx); + +struct flash_platform_data; +struct resource; + +extern void sa11x0_set_flash_data(struct flash_platform_data *flash, + struct resource *res, int nr); + +struct irda_platform_data; +void sa11x0_set_irda_data(struct irda_platform_data *irda); diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 54ab44452..9788d3aef 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include #include #include @@ -34,6 +37,8 @@ #include #include +#include +#include #include #include @@ -52,6 +57,99 @@ struct ipaq_model_ops ipaq_model_ops; EXPORT_SYMBOL(ipaq_model_ops); +static struct mtd_partition h3xxx_partitions[] = { + { + .name = "H3XXX boot firmware", + .size = 0x00040000, + .offset = 0, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, { +#ifdef CONFIG_MTD_2PARTS_IPAQ + .name = "H3XXX root jffs2", + .size = MTDPART_SIZ_FULL, + .offset = 0x00040000, +#else + .name = "H3XXX kernel", + .size = 0x00080000, + .offset = 0x00040000, + }, { + .name = "H3XXX params", + .size = 0x00040000, + .offset = 0x000C0000, + }, { +#ifdef CONFIG_JFFS2_FS + .name = "H3XXX root jffs2", + .size = MTDPART_SIZ_FULL, + .offset = 0x00100000, +#else + .name = "H3XXX initrd", + .size = 0x00100000, + .offset = 0x00100000, + }, { + .name = "H3XXX root cramfs", + .size = 0x00300000, + .offset = 0x00200000, + }, { + .name = "H3XXX usr cramfs", + .size = 0x00800000, + .offset = 0x00500000, + }, { + .name = "H3XXX usr local", + .size = MTDPART_SIZ_FULL, + .offset = 0x00d00000, +#endif +#endif + } +}; + +static void h3xxx_set_vpp(int vpp) +{ + assign_h3600_egpio(IPAQ_EGPIO_VPP_ON, vpp); +} + +static struct flash_platform_data h3xxx_flash_data = { + .map_name = "cfi_probe", + .set_vpp = h3xxx_set_vpp, + .parts = h3xxx_partitions, + .nr_parts = ARRAY_SIZE(h3xxx_partitions), +}; + +static struct resource h3xxx_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; + +/* + * This turns the IRDA power on or off on the Compaq H3600 + */ +static int h3600_irda_set_power(struct device *dev, unsigned int state) +{ + assign_h3600_egpio( IPAQ_EGPIO_IR_ON, state ); + + return 0; +} + +static void h3600_irda_set_speed(struct device *dev, int speed) +{ + if (speed < 4000000) { + clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL); + } else { + set_h3600_egpio(IPAQ_EGPIO_IR_FSEL); + } +} + +static struct irda_platform_data h3600_irda_data = { + .set_power = h3600_irda_set_power, + .set_speed = h3600_irda_set_speed, +}; + +static void h3xxx_mach_init(void) +{ + sa11x0_set_flash_data(&h3xxx_flash_data, &h3xxx_flash_resource, 1); + sa11x0_set_irda_data(&h3600_irda_data); +} + /* * low-level UART features */ @@ -286,7 +384,8 @@ MACHINE_START(H3100, "Compaq iPAQ H3100") BOOT_PARAMS(0xc0000100) MAPIO(h3100_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = h3xxx_mach_init, MACHINE_END #endif /* CONFIG_SA1100_H3100 */ @@ -401,7 +500,8 @@ MACHINE_START(H3600, "Compaq iPAQ H3600") BOOT_PARAMS(0xc0000100) MAPIO(h3600_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = h3xxx_mach_init, MACHINE_END #endif /* CONFIG_SA1100_H3600 */ @@ -785,7 +885,8 @@ MACHINE_START(H3800, "Compaq iPAQ H3800") BOOT_PARAMS(0xc0000100) MAPIO(h3800_map_io) INITIRQ(h3800_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = h3xxx_mach_init, MACHINE_END #endif /* CONFIG_SA1100_H3800 */ diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c index e24be9716..570841779 100644 --- a/arch/arm/mach-sa1100/hackkit.c +++ b/arch/arm/mach-sa1100/hackkit.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -28,6 +30,7 @@ #include #include +#include #include #include #include @@ -39,8 +42,6 @@ */ /* init funcs */ -static int __init hackkit_init(void); -static void __init hackkit_init_irq(void); static void __init hackkit_map_io(void); static u_int hackkit_get_mctrl(struct uart_port *port); @@ -83,11 +84,6 @@ static void __init hackkit_map_io(void) Ser1SDCR0 |= SDCR0_SUS; } -static void __init hackkit_init_irq(void) -{ - /* none used yet */ -} - /** * hackkit_uart_pm - powermgmt callback function for system 3 UART * @port: uart port structure @@ -144,35 +140,61 @@ static u_int hackkit_get_mctrl(struct uart_port *port) return ret; } -static int __init hackkit_init(void) -{ - int ret = 0; - - if ( !machine_is_hackkit() ) { - ret = -EINVAL; - goto DONE; +static struct mtd_partition hackkit_partitions[] = { + { + .name = "BLOB", + .size = 0x00040000, + .offset = 0x00000000, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, { + .name = "config", + .size = 0x00040000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "kernel", + .size = 0x00100000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "initrd", + .size = 0x00180000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "rootfs", + .size = 0x700000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "data", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, } +}; + +static struct flash_platform_data hackkit_flash_data = { + .map_name = "cfi_probe", + .parts = hackkit_partitions, + .nr_parts = ARRAY_SIZE(hackkit_partitions), +}; - hackkit_init_irq(); +static struct resource hackkit_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M, + .flags = IORESOURCE_MEM, +}; - ret = 0; -DONE: - return ret; +static void __init hackkit_init(void) +{ + sa11x0_set_flash_data(&hackkit_flash_data, &hackkit_flash_resource, 1); } /********************************************************************** * Exported Functions */ -/********************************************************************** - * kernel magic macros - */ -arch_initcall(hackkit_init); - MACHINE_START(HACKKIT, "HackKit Cpu Board") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_PARAMS(0xc0000100) MAPIO(hackkit_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = hackkit_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index 8943e816a..6be78291a 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c @@ -101,5 +101,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720") BOOT_PARAMS(0xc0000100) MAPIO(jornada720_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, MACHINE_END diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c index 34ab20118..51c08ccfb 100644 --- a/arch/arm/mach-sa1100/lart.c +++ b/arch/arm/mach-sa1100/lart.c @@ -17,6 +17,8 @@ #include "generic.h" +#warning "include/asm/arch-sa1100/ide.h needs fixing for lart" + static struct map_desc lart_io_desc[] __initdata = { /* virtual physical length type */ { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */ @@ -43,5 +45,5 @@ MACHINE_START(LART, "LART") BOOT_PARAMS(0xc0000100) MAPIO(lart_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, MACHINE_END diff --git a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c index da426bcd1..6a27a2d32 100644 --- a/arch/arm/mach-sa1100/leds-simpad.c +++ b/arch/arm/mach-sa1100/leds-simpad.c @@ -28,11 +28,7 @@ extern void clear_cs3_bit(int value); void simpad_leds_event(led_event_t evt) { - unsigned long flags; - - //local_irq_save(flags); - - switch (evt) + switch (evt) { case led_start: hw_led_state = LED_GREEN; @@ -101,6 +97,5 @@ void simpad_leds_event(led_event_t evt) set_cs3_bit(LED2_ON); else clear_cs3_bit(LED2_ON); - //local_irq_restore(flags); } diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index a747fd0bd..e3dc13832 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -173,6 +173,8 @@ static int neponset_probe(struct device *dev) return 0; } +#ifdef CONFIG_PM + /* * LDM power management. */ @@ -184,12 +186,12 @@ static int neponset_suspend(struct device *dev, u32 state, u32 level) if (level == SUSPEND_SAVE_STATE || level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) { - if (!dev->saved_state) - dev->saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); - if (!dev->saved_state) + if (!dev->power.saved_state) + dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); + if (!dev->power.saved_state) return -ENOMEM; - *(unsigned int *)dev->saved_state = NCR_0; + *(unsigned int *)dev->power.saved_state = NCR_0; } return 0; @@ -198,16 +200,21 @@ static int neponset_suspend(struct device *dev, u32 state, u32 level) static int neponset_resume(struct device *dev, u32 level) { if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) { - if (dev->saved_state) { - NCR_0 = *(unsigned int *)dev->saved_state; - kfree(dev->saved_state); - dev->saved_state = NULL; + if (dev->power.saved_state) { + NCR_0 = *(unsigned int *)dev->power.saved_state; + kfree(dev->power.saved_state); + dev->power.saved_state = NULL; } } return 0; } +#else +#define neponset_suspend NULL +#define neponset_resume NULL +#endif + static struct device_driver neponset_device_driver = { .name = "neponset", .bus = &platform_bus_type, diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c index 2cdfef622..5606bd71b 100644 --- a/arch/arm/mach-sa1100/pleb.c +++ b/arch/arm/mach-sa1100/pleb.c @@ -5,31 +5,150 @@ #include #include #include +#include +#include + +#include #include +#include #include +#include #include #include +#include #include +#include #include "generic.h" + +/* + * Ethernet IRQ mappings + */ + +#define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */ +#define PLEB_ETH0_V (0xf6000300) + +#define GPIO_ETH0_IRQ GPIO_GPIO(21) +#define GPIO_ETH0_EN GPIO_GPIO(26) + +#define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21 + +static struct resource smc91x_resources[] = { + [0] = { + .start = PLEB_ETH0_P, + .end = PLEB_ETH0_P | 0x03ffffff, + .flags = IORESOURCE_MEM, + }, +#if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */ + [1] = { + .start = IRQ_GPIO_ETH0_IRQ, + .end = IRQ_GPIO_ETH0_IRQ, + .flags = IORESOURCE_IRQ, + }, +#endif +}; + + +static struct platform_device smc91x_device = { + .name = "smc91x", + .id = 0, + .num_resources = ARRAY_SIZE(smc91x_resources), + .resource = smc91x_resources, +}; + +static struct platform_device *devices[] __initdata = { + &smc91x_device, +}; + + +/* + * Pleb's memory map + * has flash memory (typically 4 or 8 meg) selected by + * the two SA1100 lowest chip select outputs. + */ +static struct resource pleb_flash_resources[] = { + [0] = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_8M - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_8M - 1, + .flags = IORESOURCE_MEM, + } +}; + + +static struct mtd_partition pleb_partitions[] = { + { + .name = "blob", + .offset = 0, + .size = 0x00020000, + }, { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = 0x000e0000, + }, { + .name = "rootfs", + .offset = MTDPART_OFS_APPEND, + .size = 0x00300000, + } +}; + + +static struct flash_platform_data pleb_flash_data = { + .map_name = "cfi_probe", + .parts = pleb_partitions, + .nr_parts = ARRAY_SIZE(pleb_partitions), +}; + + +static void __init pleb_init(void) +{ + sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources, + ARRAY_SIZE(pleb_flash_resources)); + + + platform_add_devices(devices, ARRAY_SIZE(devices)); +} + + static void __init pleb_map_io(void) { sa1100_map_io(); sa1100_register_uart(0, 3); sa1100_register_uart(1, 1); + GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD); GPDR |= GPIO_UART_TXD; GPDR &= ~GPIO_UART_RXD; PPAR |= PPAR_UPR; + + /* + * Fix expansion memory timing for network card + */ + MECR = ((2<<10) | (2<<5) | (2<<0)); + + /* + * Enable the SMC ethernet controller + */ + GPDR |= GPIO_ETH0_EN; /* set to output */ + GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */ + + GPDR &= ~GPIO_ETH0_IRQ; + + set_irq_type(GPIO_ETH0_IRQ, IRQT_FALLING); } MACHINE_START(PLEB, "PLEB") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(pleb_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = pleb_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c index 7120ec5aa..379ea5e39 100644 --- a/arch/arm/mach-sa1100/pm.c +++ b/arch/arm/mach-sa1100/pm.c @@ -45,9 +45,6 @@ extern void sa1100_cpu_resume(void); */ enum { SLEEP_SAVE_SP = 0, - SLEEP_SAVE_OIER, - SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3, - SLEEP_SAVE_GPDR, SLEEP_SAVE_GAFR, SLEEP_SAVE_PPDR, SLEEP_SAVE_PPSR, SLEEP_SAVE_PPAR, SLEEP_SAVE_PSDR, @@ -57,7 +54,7 @@ enum { SLEEP_SAVE_SP = 0, }; -static int sa11x0_pm_enter(u32 state) +static int sa11x0_pm_enter(suspend_state_t state) { unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE]; struct timespec delta, rtc; @@ -72,12 +69,6 @@ static int sa11x0_pm_enter(u32 state) gpio = GPLR; /* save vital registers */ - SAVE(OSMR0); - SAVE(OSMR1); - SAVE(OSMR2); - SAVE(OSMR3); - SAVE(OIER); - SAVE(GPDR); SAVE(GAFR); @@ -129,15 +120,6 @@ static int sa11x0_pm_enter(u32 state) */ PSSR = PSSR_PH; - RESTORE(OSMR0); - RESTORE(OSMR1); - RESTORE(OSMR2); - RESTORE(OSMR3); - RESTORE(OIER); - - /* OSMR0 is the system timer: make sure OSCR is sufficiently behind */ - OSCR = OSMR0 - LATCH; - /* restore current time */ rtc.tv_sec = RCNR; restore_time_delta(&delta, &rtc); @@ -153,7 +135,7 @@ unsigned long sleep_phys_sp(void *sp) /* * Called after processes are frozen, but before we shut down devices. */ -static int sa11x0_pm_prepare(u32 state) +static int sa11x0_pm_prepare(suspend_state_t state) { return 0; } @@ -161,7 +143,7 @@ static int sa11x0_pm_prepare(u32 state) /* * Called after devices are re-setup, but before processes are thawed. */ -static int sa11x0_pm_finish(u32 state) +static int sa11x0_pm_finish(suspend_state_t state) { return 0; } diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c index 8bec82676..edddd559b 100644 --- a/arch/arm/mach-sa1100/shannon.c +++ b/arch/arm/mach-sa1100/shannon.c @@ -2,21 +2,60 @@ * linux/arch/arm/mach-sa1100/shannon.c */ +#include #include +#include #include #include +#include +#include #include +#include #include -#include #include +#include #include #include #include #include "generic.h" +static struct mtd_partition shannon_partitions[] = { + { + .name = "BLOB boot loader", + .offset = 0, + .size = 0x20000 + }, + { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = 0xe0000 + }, + { + .name = "initrd", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL + } +}; + +static struct flash_platform_data shannon_flash_data = { + .map_name = "cfi_probe", + .parts = shannon_partitions, + .nr_parts = ARRAY_SIZE(shannon_partitions), +}; + +static struct resource shannon_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_4M - 1, + .flags = IORESOURCE_MEM, +}; + +static void __init shannon_init(void) +{ + sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1); +} static void __init shannon_map_io(void) { @@ -41,5 +80,6 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") BOOT_PARAMS(0xc0000100) MAPIO(shannon_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, + .init_machine = shannon_init, MACHINE_END diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index b73ec2e18..8d113d629 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c @@ -10,6 +10,9 @@ #include #include #include +#include +#include +#include #include #include @@ -17,10 +20,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -83,6 +86,45 @@ static struct sa1100_port_fns simpad_port_fns __initdata = { .pm = simpad_uart_pm, }; + +static struct mtd_partition simpad_partitions[] = { + { + .name = "SIMpad boot firmware", + .size = 0x00080000, + .offset = 0, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "SIMpad kernel", + .size = 0x0010000, + .offset = MTDPART_OFS_APPEND, + }, { + .name = "SIMpad root jffs2", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; + +static struct flash_platform_data simpad_flash_data = { + .map_name = "cfi_probe", + .parts = simpad_partitions, + .nr_parts = ARRAY_SIZE(simpad_partitions), +}; + + +static struct resource simpad_flash_resources [] = { + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_16M -1, + .flags = IORESOURCE_MEM, + }, { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_16M -1, + .flags = IORESOURCE_MEM, + } +}; + + + static void __init simpad_map_io(void) { sa1100_map_io(); @@ -113,85 +155,10 @@ static void __init simpad_map_io(void) PCFR = 0; PSDR = 0; - -} - -#ifdef CONFIG_PROC_FS - -static char* name[]={ - "VCC_5V_EN", - "VCC_3V_EN", - "EN1", - "EN0", - "DISPLAY_ON", - "PCMCIA_BUFF_DIS", - "MQ_RESET", - "PCMCIA_RESET", - "DECT_POWER_ON", - "IRDA_SD", - "RS232_ON", - "SD_MEDIAQ", - "LED2_ON", - "IRDA_MODE", - "ENABLE_5V", - "RESET_SIMCARD" -}; - -static int proc_cs3_read(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - char *p = page; - int len, i; - - p += sprintf(p, "Chipselect3 : %x\n", (uint)cs3_shadow); - for (i = 0; i <= 15; i++) { - if(cs3_shadow & (1<read_proc = proc_cs3_read; - proc_cs3->write_proc = (void*)proc_cs3_write; - } -#endif - - - - return 0; -} - -arch_initcall(cs3_init); - static void simpad_power_off(void) { local_irq_disable(); // was cli @@ -216,9 +183,31 @@ static void simpad_power_off(void) } + +/* + * MediaQ Video Device + */ +static struct platform_device simpad_mq200fb = { + .name = "simpad-mq200", + .id = 0, +}; + +static struct platform_device *devices[] __initdata = { + &simpad_mq200fb +}; + + + static int __init simpad_init(void) { - set_power_off_handler( simpad_power_off ); + int ret; + + pm_power_off = simpad_power_off; + + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); + if(ret) + printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device"); + return 0; } @@ -226,10 +215,10 @@ arch_initcall(simpad_init); MACHINE_START(SIMPAD, "Simpad") - MAINTAINER("Juergen Messerer") + MAINTAINER("Holger Freyther") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_PARAMS(0xc0000100) MAPIO(simpad_map_io) INITIRQ(sa1100_init_irq) - INITTIME(sa1100_init_time) + .timer = &sa1100_timer, MACHINE_END diff --git a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S index 03b8af5e0..2fa1e289d 100644 --- a/arch/arm/mach-sa1100/sleep.S +++ b/arch/arm/mach-sa1100/sleep.S @@ -70,12 +70,12 @@ ENTRY(sa1100_cpu_suspend) @ delay 90us and set CPU PLL to lowest speed @ fixes resume problem on high speed SA1110 mov r0, #90 - bl udelay + bl __udelay ldr r0, =PPCR mov r1, #0 str r1, [r0] mov r0, #90 - bl udelay + bl __udelay /* * SA1110 SDRAM controller workaround. register values: diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 1c3d082f8..19b0c0fd6 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c @@ -84,12 +84,16 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned int next_match; + write_seqlock(&xtime_lock); + do { timer_tick(regs); OSSR = OSSR_M0; /* Clear match on timer 0 */ next_match = (OSMR0 += LATCH); } while ((signed long)(next_match - OSCR) <= 0); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -99,11 +103,10 @@ static struct irqaction sa1100_timer_irq = { .handler = sa1100_timer_interrupt }; -void __init sa1100_init_time(void) +static void __init sa1100_timer_init(void) { struct timespec tv; - gettimeoffset = sa1100_gettimeoffset; set_rtc = sa1100_set_rtc; tv.tv_nsec = 0; @@ -117,3 +120,40 @@ void __init sa1100_init_time(void) OSCR = 0; /* initialize free-running timer, force first match */ } +#ifdef CONFIG_PM +unsigned long osmr[4], oier; + +static void sa1100_timer_suspend(void) +{ + osmr[0] = OSMR0; + osmr[1] = OSMR1; + osmr[2] = OSMR2; + osmr[3] = OSMR3; + oier = OIER; +} + +static void sa1100_timer_resume(void) +{ + OSSR = 0x0f; + OSMR0 = osmr[0]; + OSMR1 = osmr[1]; + OSMR2 = osmr[2]; + OSMR3 = osmr[3]; + OIER = oier; + + /* + * OSMR0 is the system timer: make sure OSCR is sufficiently behind + */ + OSCR = OSMR0 - LATCH; +} +#else +#define sa1100_timer_suspend NULL +#define sa1100_timer_resume NULL +#endif + +struct sys_timer sa1100_timer = { + .init = sa1100_timer_init, + .suspend = sa1100_timer_suspend, + .resume = sa1100_timer_resume, + .offset = sa1100_gettimeoffset, +}; diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index e4ae68889..a9bc5d0db 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,46 @@ #include #include +static struct plat_serial8250_port serial_platform_data[] = { + { + .iobase = 0x3f8, + .irq = 4, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = 0x2f8, + .irq = 3, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { }, +}; + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_platform_data, + }, +}; + +static int __init shark_init(void) +{ + int ret; + + if (machine_is_shark()) + ret = platform_device_register(&serial_device); + + return ret; +} + +arch_initcall(shark_init); + extern void shark_init_irq(void); static struct map_desc shark_io_desc[] __initdata = { @@ -35,8 +76,9 @@ static void __init shark_map_io(void) static irqreturn_t shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); timer_tick(regs); - + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -49,10 +91,8 @@ static struct irqaction shark_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init shark_init_time(void) +static void __init shark_timer_init(void) { - unsigned long flags; - outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */ outb(HZ_TIME & 0xff, 0x40); /* LSB of count */ outb(HZ_TIME >> 8, 0x40); @@ -60,6 +100,9 @@ void __init shark_init_time(void) setup_irq(IRQ_TIMER, &shark_timer_irq); } +static struct sys_timer shark_timer = { + .init = shark_timer_init, +}; MACHINE_START(SHARK, "Shark") MAINTAINER("Alexander Schulz") @@ -67,5 +110,5 @@ MACHINE_START(SHARK, "Shark") BOOT_PARAMS(0x08003000) MAPIO(shark_map_io) INITIRQ(shark_init_irq) - INITTIME(shark_init_time) + .timer = &shark_timer, MACHINE_END diff --git a/arch/arm/mach-shark/irq.c b/arch/arm/mach-shark/irq.c index fb8e6b3c5..6cb67bd3d 100644 --- a/arch/arm/mach-shark/irq.c +++ b/arch/arm/mach-shark/irq.c @@ -61,9 +61,10 @@ static void shark_enable_8259A_irq(unsigned int irq) static void shark_ack_8259A_irq(unsigned int irq){} -static void bogus_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs) { printk("Got interrupt %i!\n",irq); + return IRQ_NONE; } static struct irqaction cascade; @@ -102,11 +103,7 @@ void __init shark_init_irq(void) //request_region(0xA0,0x2,"pic2"); cascade.handler = bogus_int; - cascade.flags = 0; - cascade.mask = 0; cascade.name = "cascade"; - cascade.next = NULL; - cascade.dev_id = NULL; setup_irq(2,&cascade); } diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c index 7a2d1e908..7bdeb70a0 100644 --- a/arch/arm/mach-shark/leds.c +++ b/arch/arm/mach-shark/leds.c @@ -33,7 +33,7 @@ static char led_state; static short hw_led_state; static short saved_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); short sequoia_read(int addr) { outw(addr,0x24); diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c index 05e992d35..37a7112d4 100644 --- a/arch/arm/mach-shark/pci.c +++ b/arch/arm/mach-shark/pci.c @@ -21,7 +21,7 @@ static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin) else return 255; } -extern void __init via82c505_preinit(void *sysdata); +extern void __init via82c505_preinit(void); static struct hw_pci shark_pci __initdata = { .setup = via82c505_setup, @@ -29,7 +29,7 @@ static struct hw_pci shark_pci __initdata = { .map_irq = shark_map_irq, .nr_controllers = 1, .scan = via82c505_scan_bus, - .preinit = via82c505_preinit + .preinit = via82c505_preinit, }; static int __init shark_pci_init(void) diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile index ff886e33e..5d6088377 100644 --- a/arch/arm/mach-versatile/Makefile +++ b/arch/arm/mach-versatile/Makefile @@ -3,3 +3,5 @@ # obj-y := core.o clock.o +obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o +obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c index 24f12bdfb..48025c2b9 100644 --- a/arch/arm/mach-versatile/clock.c +++ b/arch/arm/mach-versatile/clock.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include "clock.h" @@ -83,12 +83,12 @@ EXPORT_SYMBOL(clk_round_rate); int clk_set_rate(struct clk *clk, unsigned long rate) { int ret = -EIO; -#if 0 // Not yet + if (clk->setvco) { - struct icst525_vco vco; + struct icst307_vco vco; - vco = icst525_khz_to_vco(clk->params, rate / 1000); - clk->rate = icst525_khz(clk->params, vco) * 1000; + vco = icst307_khz_to_vco(clk->params, rate / 1000); + clk->rate = icst307_khz(clk->params, vco) * 1000; printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", clk->name, vco.s, vco.r, vco.v); @@ -96,7 +96,6 @@ int clk_set_rate(struct clk *clk, unsigned long rate) clk->setvco(clk, vco); ret = 0; } -#endif return ret; } EXPORT_SYMBOL(clk_set_rate); diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h index 12e68ecde..8b0b61dd1 100644 --- a/arch/arm/mach-versatile/clock.h +++ b/arch/arm/mach-versatile/clock.h @@ -9,16 +9,16 @@ * published by the Free Software Foundation. */ struct module; -struct icst525_params; +struct icst307_params; struct clk { struct list_head node; unsigned long rate; struct module *owner; const char *name; - const struct icst525_params *params; + const struct icst307_params *params; void *data; - void (*setvco)(struct clk *, struct icst525_vco vco); + void (*setvco)(struct clk *, struct icst307_vco vco); }; int clk_register(struct clk *clk); diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 239d9897d..554e1bd30 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -33,15 +33,17 @@ #include #include #include +#include #include #include #include #include #include -#ifdef CONFIG_MMC #include -#endif + +#include "core.h" +#include "clock.h" /* * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx @@ -111,19 +113,17 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) #if 1 #define IRQ_MMCI0A IRQ_VICSOURCE22 -#define IRQ_MMCI1A IRQ_VICSOURCE23 #define IRQ_AACI IRQ_VICSOURCE24 #define IRQ_ETH IRQ_VICSOURCE25 #define PIC_MASK 0xFFD00000 #else #define IRQ_MMCI0A IRQ_SIC_MMCI0A -#define IRQ_MMCI1A IRQ_SIC_MMCI1A #define IRQ_AACI IRQ_SIC_AACI #define IRQ_ETH IRQ_SIC_ETH #define PIC_MASK 0 #endif -static void __init versatile_init_irq(void) +void __init versatile_init_irq(void) { unsigned int i, value; @@ -189,6 +189,10 @@ static struct map_desc versatile_io_desc[] __initdata = { { IO_ADDRESS(VERSATILE_SIC_BASE), VERSATILE_SIC_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(VERSATILE_VIC_BASE), VERSATILE_VIC_BASE, SZ_4K, MT_DEVICE }, { IO_ADDRESS(VERSATILE_SCTL_BASE), VERSATILE_SCTL_BASE, SZ_4K * 9, MT_DEVICE }, +#ifdef CONFIG_MACH_VERSATILE_AB + { IO_ADDRESS(VERSATILE_GPIO0_BASE), VERSATILE_GPIO0_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(VERSATILE_IB2_BASE), VERSATILE_IB2_BASE, SZ_64M, MT_DEVICE }, +#endif #ifdef CONFIG_DEBUG_LL { IO_ADDRESS(VERSATILE_UART0_BASE), VERSATILE_UART0_BASE, SZ_4K, MT_DEVICE }, #endif @@ -200,7 +204,7 @@ static struct map_desc versatile_io_desc[] __initdata = { #endif }; -static void __init versatile_map_io(void) +void __init versatile_map_io(void) { iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); } @@ -208,7 +212,7 @@ static void __init versatile_map_io(void) #define VERSATILE_REFCOUNTER (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) /* - * This is the VersatilePB sched_clock implementation. This has + * This is the Versatile sched_clock implementation. This has * a resolution of 41.7ns, and a maximum value of about 179s. */ unsigned long long sched_clock(void) @@ -302,8 +306,7 @@ static struct platform_device smc91x_device = { #define VERSATILE_SYSMCI (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET) -#ifdef CONFIG_MMC -static unsigned int mmc_status(struct device *dev) +unsigned int mmc_status(struct device *dev) { struct amba_device *adev = container_of(dev, struct amba_device, dev); u32 mask; @@ -321,20 +324,50 @@ static struct mmc_platform_data mmc0_plat_data = { .status = mmc_status, }; -static struct mmc_platform_data mmc1_plat_data = { - .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, - .status = mmc_status, +/* + * Clock handling + */ +static const struct icst307_params versatile_oscvco_params = { + .ref = 24000, + .vco_max = 200000, + .vd_min = 4 + 8, + .vd_max = 511 + 8, + .rd_min = 1 + 2, + .rd_max = 127 + 2, }; + +static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) +{ + unsigned long sys_lock = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; +#if defined(CONFIG_ARCH_VERSATILE_PB) + unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET; +#elif defined(CONFIG_MACH_VERSATILE_AB) + unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET; #endif + u32 val; + + val = readl(sys_osc) & ~0x7ffff; + val |= vco.v | (vco.r << 9) | (vco.s << 16); + + writel(0xa05f, sys_lock); + writel(val, sys_osc); + writel(0, sys_lock); +} + +static struct clk versatile_clcd_clk = { + .name = "CLCDCLK", + .params = &versatile_oscvco_params, + .setvco = versatile_oscvco_set, +}; /* * CLCD support. */ #define SYS_CLCD_MODE_MASK (3 << 0) -#define SYS_CLCD_MODE_5551 (0 << 0) -#define SYS_CLCD_MODE_565 (1 << 0) -#define SYS_CLCD_MODE_888 (2 << 0) -#define SYS_CLCD_MODE_LT (3 << 0) +#define SYS_CLCD_MODE_888 (0 << 0) +#define SYS_CLCD_MODE_5551 (1 << 0) +#define SYS_CLCD_MODE_565_RLSB (2 << 0) +#define SYS_CLCD_MODE_565_BLSB (3 << 0) #define SYS_CLCD_NLCDIOON (1 << 2) #define SYS_CLCD_VDDPOSSWITCH (1 << 3) #define SYS_CLCD_PWR3V5SWITCH (1 << 4) @@ -342,6 +375,7 @@ static struct mmc_platform_data mmc1_plat_data = { #define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8) #define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8) #define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8) +#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8) #define SYS_CLCD_ID_VGA (0x1f << 8) static struct clcd_panel vga = { @@ -390,6 +424,29 @@ static struct clcd_panel sanyo_3_8_in = { .bpp = 16, }; +static struct clcd_panel sanyo_2_5_in = { + .mode = { + .name = "Sanyo QVGA Portrait", + .refresh = 116, + .xres = 240, + .yres = 320, + .pixclock = 100000, + .left_margin = 20, + .right_margin = 10, + .upper_margin = 2, + .lower_margin = 2, + .hsync_len = 10, + .vsync_len = 2, + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .vmode = FB_VMODE_NONINTERLACED, + }, + .width = -1, + .height = -1, + .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC, + .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), + .bpp = 16, +}; + static struct clcd_panel epson_2_2_in = { .mode = { .name = "Epson QCIF", @@ -428,6 +485,8 @@ static struct clcd_panel *versatile_clcd_panel(void) val = readl(sys_clcd) & SYS_CLCD_ID_MASK; if (val == SYS_CLCD_ID_SANYO_3_8) panel = &sanyo_3_8_in; + else if (val == SYS_CLCD_ID_SANYO_2_5) + panel = &sanyo_2_5_in; else if (val == SYS_CLCD_ID_EPSON_2_2) panel = &epson_2_2_in; else if (val == SYS_CLCD_ID_VGA) @@ -435,9 +494,10 @@ static struct clcd_panel *versatile_clcd_panel(void) else { printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n", val); + panel = &vga; } - return &vga; + return panel; } /* @@ -451,6 +511,20 @@ static void versatile_clcd_disable(struct clcd_fb *fb) val = readl(sys_clcd); val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH; writel(val, sys_clcd); + +#ifdef CONFIG_MACH_VERSATILE_AB + /* + * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off + */ + if (fb->panel == &sanyo_2_5_in) { + unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL); + unsigned long ctrl; + + ctrl = readl(versatile_ib2_ctrl); + ctrl &= ~0x01; + writel(ctrl, versatile_ib2_ctrl); + } +#endif } /* @@ -466,19 +540,10 @@ static void versatile_clcd_enable(struct clcd_fb *fb) switch (fb->fb.var.green.length) { case 5: -#if 0 - /* - * For some undocumented reason, we need to select 565 mode - * even when using 555 with VGA. Maybe this is only true - * for the VGA output and needs to be done for LCD panels? - * I can't get an explaination from the people who should - * know. - */ val |= SYS_CLCD_MODE_5551; break; -#endif case 6: - val |= SYS_CLCD_MODE_565; + val |= SYS_CLCD_MODE_565_BLSB; break; case 8: val |= SYS_CLCD_MODE_888; @@ -495,6 +560,20 @@ static void versatile_clcd_enable(struct clcd_fb *fb) */ val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH; writel(val, sys_clcd); + +#ifdef CONFIG_MACH_VERSATILE_AB + /* + * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on + */ + if (fb->panel == &sanyo_2_5_in) { + unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL); + unsigned long ctrl; + + ctrl = readl(versatile_ib2_ctrl); + ctrl |= 0x01; + writel(ctrl, versatile_ib2_ctrl); + } +#endif } static unsigned long framesize = SZ_1M; @@ -518,6 +597,14 @@ static int versatile_clcd_setup(struct clcd_fb *fb) return 0; } +static int versatile_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) +{ + return dma_mmap_writecombine(&fb->dev->dev, vma, + fb->fb.screen_base, + fb->fb.fix.smem_start, + fb->fb.fix.smem_len); +} + static void versatile_clcd_remove(struct clcd_fb *fb) { dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, @@ -525,32 +612,16 @@ static void versatile_clcd_remove(struct clcd_fb *fb) } static struct clcd_board clcd_plat_data = { - .name = "Versatile PB", + .name = "Versatile", .check = clcdfb_check, .decode = clcdfb_decode, .disable = versatile_clcd_disable, .enable = versatile_clcd_enable, .setup = versatile_clcd_setup, + .mmap = versatile_clcd_mmap, .remove = versatile_clcd_remove, }; -#define AMBA_DEVICE(name,busid,base,plat) \ -static struct amba_device name##_device = { \ - .dev = { \ - .coherent_dma_mask = ~0, \ - .bus_id = busid, \ - .platform_data = plat, \ - }, \ - .res = { \ - .start = VERSATILE_##base##_BASE, \ - .end = (VERSATILE_##base##_BASE) + SZ_4K - 1,\ - .flags = IORESOURCE_MEM, \ - }, \ - .dma_mask = ~0, \ - .irq = base##_IRQ, \ - /* .dma = base##_DMA,*/ \ -} - #define AACI_IRQ { IRQ_AACI, NO_IRQ } #define AACI_DMA { 0x80, 0x81 } #define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B } @@ -559,12 +630,6 @@ static struct amba_device name##_device = { \ #define KMI0_DMA { 0, 0 } #define KMI1_IRQ { IRQ_SIC_KMI1, NO_IRQ } #define KMI1_DMA { 0, 0 } -#define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ } -#define UART3_DMA { 0x86, 0x87 } -#define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ } -#define SCI1_DMA { 0x88, 0x89 } -#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B } -#define MMCI1_DMA { 0x85, 0 } /* * These devices are connected directly to the multi-layer AHB switch @@ -589,10 +654,6 @@ static struct amba_device name##_device = { \ #define GPIO0_DMA { 0, 0 } #define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ } #define GPIO1_DMA { 0, 0 } -#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ } -#define GPIO2_DMA { 0, 0 } -#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ } -#define GPIO3_DMA { 0, 0 } #define RTC_IRQ { IRQ_RTCINT, NO_IRQ } #define RTC_DMA { 0, 0 } @@ -612,16 +673,9 @@ static struct amba_device name##_device = { \ /* FPGA Primecells */ AMBA_DEVICE(aaci, "fpga:04", AACI, NULL); -#ifdef CONFIG_MMC AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &mmc0_plat_data); -#endif AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL); AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL); -AMBA_DEVICE(uart3, "fpga:09", UART3, NULL); -AMBA_DEVICE(sci1, "fpga:0a", SCI1, NULL); -#ifdef CONFIG_MMC -AMBA_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data); -#endif /* DevChip Primecells */ AMBA_DEVICE(smc, "dev:00", SMC, NULL); @@ -632,8 +686,6 @@ AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL); AMBA_DEVICE(wdog, "dev:e1", WATCHDOG, NULL); AMBA_DEVICE(gpio0, "dev:e4", GPIO0, NULL); AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL); -AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL); -AMBA_DEVICE(gpio3, "dev:e7", GPIO3, NULL); AMBA_DEVICE(rtc, "dev:e8", RTC, NULL); AMBA_DEVICE(sci0, "dev:f0", SCI, NULL); AMBA_DEVICE(uart0, "dev:f1", UART0, NULL); @@ -646,7 +698,6 @@ static struct amba_device *amba_devs[] __initdata = { &uart0_device, &uart1_device, &uart2_device, - &uart3_device, &smc_device, &mpmc_device, &clcd_device, @@ -654,23 +705,16 @@ static struct amba_device *amba_devs[] __initdata = { &wdog_device, &gpio0_device, &gpio1_device, - &gpio2_device, - &gpio3_device, &rtc_device, &sci0_device, &ssp0_device, &aaci_device, -#ifdef CONFIG_MMC &mmc0_device, -#endif &kmi0_device, &kmi1_device, - &sci1_device, -#ifdef CONFIG_MMC - &mmc1_device, -#endif }; +#ifdef CONFIG_LEDS #define VA_LEDS_BASE (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET) static void versatile_leds_event(led_event_t ledevt) @@ -705,11 +749,14 @@ static void versatile_leds_event(led_event_t ledevt) writel(val, VA_LEDS_BASE); local_irq_restore(flags); } +#endif /* CONFIG_LEDS */ -static void __init versatile_init(void) +void __init versatile_init(void) { int i; + clk_register(&versatile_clcd_clk); + platform_device_register(&versatile_flash_device); platform_device_register(&smc91x_device); @@ -718,7 +765,9 @@ static void __init versatile_init(void) amba_device_register(d, &iomem_resource); } +#ifdef CONFIG_LEDS leds_event = versatile_leds_event; +#endif } /* @@ -760,8 +809,6 @@ typedef struct TimerStruct { unsigned long TimerClear; } TimerStruct_t; -extern unsigned long (*gettimeoffset)(void); - /* * Returns number of ms since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() @@ -810,11 +857,15 @@ static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_re { volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; + write_seqlock(&xtime_lock); + // ...clear the interrupt timer0->TimerClear = 1; timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -827,7 +878,7 @@ static struct irqaction versatile_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init versatile_init_time(void) +static void __init versatile_timer_init(void) { volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; @@ -859,15 +910,9 @@ void __init versatile_init_time(void) * Make irqs happen for the system timer */ setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); - gettimeoffset = versatile_gettimeoffset; } -MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") - MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") - BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) - BOOT_PARAMS(0x00000100) - MAPIO(versatile_map_io) - INITIRQ(versatile_init_irq) - INITTIME(versatile_init_time) - INIT_MACHINE(versatile_init) -MACHINE_END +struct sys_timer versatile_timer = { + .init = versatile_timer_init, + .offset = versatile_gettimeoffset, +}; diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index f0a878204..5b670c9ac 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -14,6 +14,7 @@ config CPU_ARM610 depends on ARCH_RPC select CPU_32v3 select CPU_CACHE_V3 + select CPU_CACHE_VIVT select CPU_COPY_V3 select CPU_TLB_V3 help @@ -29,6 +30,7 @@ config CPU_ARM710 default y if ARCH_CLPS7500 select CPU_32v3 select CPU_CACHE_V3 + select CPU_CACHE_VIVT select CPU_COPY_V3 select CPU_TLB_V3 help @@ -47,6 +49,7 @@ config CPU_ARM720T select CPU_32v4 select CPU_ABRT_LV4T select CPU_CACHE_V4 + select CPU_CACHE_VIVT select CPU_COPY_V4WT select CPU_TLB_V4WT help @@ -64,6 +67,7 @@ config CPU_ARM920T select CPU_32v4 select CPU_ABRT_EV4T select CPU_CACHE_V4WT + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI help @@ -78,12 +82,13 @@ config CPU_ARM920T # ARM922T config CPU_ARM922T - bool - depends on ARCH_CAMELOT || ARCH_LH7A40X - default y + bool "Support ARM922T processor" if ARCH_INTEGRATOR + depends on ARCH_CAMELOT || ARCH_LH7A40X || ARCH_INTEGRATOR + default y if ARCH_CAMELOT || ARCH_LH7A40X select CPU_32v4 select CPU_ABRT_EV4T select CPU_CACHE_V4WT + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI help @@ -96,12 +101,13 @@ config CPU_ARM922T # ARM925T config CPU_ARM925T - bool + bool "Support ARM925T processor" if ARCH_OMAP depends on ARCH_OMAP1510 - default y + default y if ARCH_OMAP1510 select CPU_32v4 select CPU_ABRT_EV4T select CPU_CACHE_V4WT + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI help @@ -115,10 +121,11 @@ config CPU_ARM925T # ARM926T config CPU_ARM926T bool "Support ARM926T processor" if ARCH_INTEGRATOR - depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || ARCH_OMAP730 || ARCH_OMAP1610 || ARCH_OMAP5912 - default y if ARCH_VERSATILE_PB + depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX + default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX select CPU_32v5 select CPU_ABRT_EV5TJ + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI help @@ -136,6 +143,7 @@ config CPU_ARM1020 select CPU_32v5 select CPU_ABRT_EV4T select CPU_CACHE_V4WT + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI help @@ -152,6 +160,7 @@ config CPU_ARM1020E select CPU_32v5 select CPU_ABRT_EV4T select CPU_CACHE_V4WT + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WBI depends on n @@ -162,6 +171,7 @@ config CPU_ARM1022 depends on ARCH_INTEGRATOR select CPU_32v5 select CPU_ABRT_EV4T + select CPU_CACHE_VIVT select CPU_COPY_V4WB # can probably do better select CPU_TLB_V4WBI help @@ -178,6 +188,7 @@ config CPU_ARM1026 depends on ARCH_INTEGRATOR select CPU_32v5 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 + select CPU_CACHE_VIVT select CPU_COPY_V4WB # can probably do better select CPU_TLB_V4WBI help @@ -195,6 +206,7 @@ config CPU_SA110 select CPU_32v4 if !ARCH_RPC select CPU_ABRT_EV4 select CPU_CACHE_V4WB + select CPU_CACHE_VIVT select CPU_COPY_V4WB select CPU_TLB_V4WB help @@ -214,6 +226,7 @@ config CPU_SA1100 select CPU_32v4 select CPU_ABRT_EV4 select CPU_CACHE_V4WB + select CPU_CACHE_VIVT select CPU_TLB_V4WB select CPU_MINICACHE @@ -224,6 +237,7 @@ config CPU_XSCALE default y select CPU_32v5 select CPU_ABRT_EV5T + select CPU_CACHE_VIVT select CPU_TLB_V4WBI select CPU_MINICACHE @@ -234,6 +248,7 @@ config CPU_V6 select CPU_32v6 select CPU_ABRT_EV6 select CPU_CACHE_V6 + select CPU_CACHE_VIPT select CPU_COPY_V6 select CPU_TLB_V6 @@ -286,6 +301,12 @@ config CPU_CACHE_V4WB config CPU_CACHE_V6 bool +config CPU_CACHE_VIVT + bool + +config CPU_CACHE_VIPT + bool + # The copy-page model config CPU_COPY_V3 bool @@ -371,8 +392,9 @@ config CPU_DCACHE_DISABLE config CPU_DCACHE_WRITETHROUGH bool "Force write through D-cache" depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE + default y if CPU_ARM925T help - Say Y here to use the data cache in writethough mode. Unless you + Say Y here to use the data cache in writethrough mode. Unless you specifically require this or are unsure, say N. config CPU_CACHE_ROUND_ROBIN diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index 828faadc4..81f4a8a2d 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c @@ -3,6 +3,9 @@ * * Copyright (C) 1995 Linus Torvalds * Modifications for ARM processor (c) 1995-2001 Russell King + * Thumb aligment fault fixups (c) 2004 MontaVista Software, Inc. + * - Adapted from gdb/sim/arm/thumbemu.c -- Thumb instruction emulation. + * Copyright (C) 1996, Cygnus Software Technologies 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 @@ -130,6 +133,18 @@ union offset_union { #define TYPE_LDST 2 #define TYPE_DONE 3 +#ifdef __ARMEB__ +#define BE 1 +#define FIRST_BYTE_16 "mov %1, %1, ror #8\n" +#define FIRST_BYTE_32 "mov %1, %1, ror #24\n" +#define NEXT_BYTE "ror #24" +#else +#define BE 0 +#define FIRST_BYTE_16 +#define FIRST_BYTE_32 +#define NEXT_BYTE "lsr #8" +#endif + #define __get8_unaligned_check(ins,val,addr,err) \ __asm__( \ "1: "ins" %1, [%2], #1\n" \ @@ -149,9 +164,10 @@ union offset_union { #define __get16_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v, a = addr; \ - __get8_unaligned_check(ins,val,a,err); \ __get8_unaligned_check(ins,v,a,err); \ - val |= v << 8; \ + val = v << ((BE) ? 8 : 0); \ + __get8_unaligned_check(ins,v,a,err); \ + val |= v << ((BE) ? 0 : 8); \ if (err) \ goto fault; \ } while (0) @@ -165,13 +181,14 @@ union offset_union { #define __get32_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v, a = addr; \ - __get8_unaligned_check(ins,val,a,err); \ __get8_unaligned_check(ins,v,a,err); \ - val |= v << 8; \ + val = v << ((BE) ? 24 : 0); \ __get8_unaligned_check(ins,v,a,err); \ - val |= v << 16; \ + val |= v << ((BE) ? 16 : 8); \ __get8_unaligned_check(ins,v,a,err); \ - val |= v << 24; \ + val |= v << ((BE) ? 8 : 16); \ + __get8_unaligned_check(ins,v,a,err); \ + val |= v << ((BE) ? 0 : 24); \ if (err) \ goto fault; \ } while (0) @@ -185,9 +202,9 @@ union offset_union { #define __put16_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v = val, a = addr; \ - __asm__( \ + __asm__( FIRST_BYTE_16 \ "1: "ins" %1, [%2], #1\n" \ - " mov %1, %1, lsr #8\n" \ + " mov %1, %1, "NEXT_BYTE"\n" \ "2: "ins" %1, [%2]\n" \ "3:\n" \ " .section .fixup,\"ax\"\n" \ @@ -215,13 +232,13 @@ union offset_union { #define __put32_unaligned_check(ins,val,addr) \ do { \ unsigned int err = 0, v = val, a = addr; \ - __asm__( \ + __asm__( FIRST_BYTE_32 \ "1: "ins" %1, [%2], #1\n" \ - " mov %1, %1, lsr #8\n" \ + " mov %1, %1, "NEXT_BYTE"\n" \ "2: "ins" %1, [%2], #1\n" \ - " mov %1, %1, lsr #8\n" \ + " mov %1, %1, "NEXT_BYTE"\n" \ "3: "ins" %1, [%2], #1\n" \ - " mov %1, %1, lsr #8\n" \ + " mov %1, %1, "NEXT_BYTE"\n" \ "4: "ins" %1, [%2]\n" \ "5:\n" \ " .section .fixup,\"ax\"\n" \ @@ -449,16 +466,146 @@ bad: return TYPE_ERROR; } +/* + * Convert Thumb ld/st instruction forms to equivalent ARM instructions so + * we can reuse ARM userland alignment fault fixups for Thumb. + * + * This implementation was initially based on the algorithm found in + * gdb/sim/arm/thumbemu.c. It is basically just a code reduction of same + * to convert only Thumb ld/st instruction forms to equivalent ARM forms. + * + * NOTES: + * 1. Comments below refer to ARM ARM DDI0100E Thumb Instruction sections. + * 2. If for some reason we're passed an non-ld/st Thumb instruction to + * decode, we return 0xdeadc0de. This should never happen under normal + * circumstances but if it does, we've got other problems to deal with + * elsewhere and we obviously can't fix those problems here. + */ + +static unsigned long +thumb2arm(u16 tinstr) +{ + u32 L = (tinstr & (1<<11)) >> 11; + + switch ((tinstr & 0xf800) >> 11) { + /* 6.5.1 Format 1: */ + case 0x6000 >> 11: /* 7.1.52 STR(1) */ + case 0x6800 >> 11: /* 7.1.26 LDR(1) */ + case 0x7000 >> 11: /* 7.1.55 STRB(1) */ + case 0x7800 >> 11: /* 7.1.30 LDRB(1) */ + return 0xe5800000 | + ((tinstr & (1<<12)) << (22-12)) | /* fixup */ + (L<<20) | /* L==1? */ + ((tinstr & (7<<0)) << (12-0)) | /* Rd */ + ((tinstr & (7<<3)) << (16-3)) | /* Rn */ + ((tinstr & (31<<6)) >> /* immed_5 */ + (6 - ((tinstr & (1<<12)) ? 0 : 2))); + case 0x8000 >> 11: /* 7.1.57 STRH(1) */ + case 0x8800 >> 11: /* 7.1.32 LDRH(1) */ + return 0xe1c000b0 | + (L<<20) | /* L==1? */ + ((tinstr & (7<<0)) << (12-0)) | /* Rd */ + ((tinstr & (7<<3)) << (16-3)) | /* Rn */ + ((tinstr & (7<<6)) >> (6-1)) | /* immed_5[2:0] */ + ((tinstr & (3<<9)) >> (9-8)); /* immed_5[4:3] */ + + /* 6.5.1 Format 2: */ + case 0x5000 >> 11: + case 0x5800 >> 11: + { + static const u32 subset[8] = { + 0xe7800000, /* 7.1.53 STR(2) */ + 0xe18000b0, /* 7.1.58 STRH(2) */ + 0xe7c00000, /* 7.1.56 STRB(2) */ + 0xe19000d0, /* 7.1.34 LDRSB */ + 0xe7900000, /* 7.1.27 LDR(2) */ + 0xe19000b0, /* 7.1.33 LDRH(2) */ + 0xe7d00000, /* 7.1.31 LDRB(2) */ + 0xe19000f0 /* 7.1.35 LDRSH */ + }; + return subset[(tinstr & (7<<9)) >> 9] | + ((tinstr & (7<<0)) << (12-0)) | /* Rd */ + ((tinstr & (7<<3)) << (16-3)) | /* Rn */ + ((tinstr & (7<<6)) >> (6-0)); /* Rm */ + } + + /* 6.5.1 Format 3: */ + case 0x4800 >> 11: /* 7.1.28 LDR(3) */ + /* NOTE: This case is not technically possible. We're + * loading 32-bit memory data via PC relative + * addressing mode. So we can and should eliminate + * this case. But I'll leave it here for now. + */ + return 0xe59f0000 | + ((tinstr & (7<<8)) << (12-8)) | /* Rd */ + ((tinstr & 255) << (2-0)); /* immed_8 */ + + /* 6.5.1 Format 4: */ + case 0x9000 >> 11: /* 7.1.54 STR(3) */ + case 0x9800 >> 11: /* 7.1.29 LDR(4) */ + return 0xe58d0000 | + (L<<20) | /* L==1? */ + ((tinstr & (7<<8)) << (12-8)) | /* Rd */ + ((tinstr & 255) << 2); /* immed_8 */ + + /* 6.6.1 Format 1: */ + case 0xc000 >> 11: /* 7.1.51 STMIA */ + case 0xc800 >> 11: /* 7.1.25 LDMIA */ + { + u32 Rn = (tinstr & (7<<8)) >> 8; + u32 W = ((L<> 11: /* 7.1.48 PUSH */ + case 0xb800 >> 11: /* 7.1.47 POP */ + if ((tinstr & (3 << 9)) == 0x0400) { + static const u32 subset[4] = { + 0xe92d0000, /* STMDB sp!,{registers} */ + 0xe92d4000, /* STMDB sp!,{registers,lr} */ + 0xe8bd0000, /* LDMIA sp!,{registers} */ + 0xe8bd8000 /* LDMIA sp!,{registers,pc} */ + }; + return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] | + (tinstr & 255); /* register_list */ + } + /* Else fall through for illegal instruction case */ + + default: + return 0xdeadc0de; + } +} + static int do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { union offset_union offset; - unsigned long instr, instrptr; + unsigned long instr = 0, instrptr; int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); unsigned int type; + mm_segment_t fs; + unsigned int fault; + u16 tinstr = 0; instrptr = instruction_pointer(regs); - instr = *(unsigned long *)instrptr; + + fs = get_fs(); + set_fs(KERNEL_DS); + if thumb_mode(regs) { + fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); + if (!(fault)) + instr = thumb2arm(tinstr); + } else + fault = __get_user(instr, (u32 *)instrptr); + set_fs(fs); + + if (fault) { + type = TYPE_FAULT; + goto bad_or_fault; + } if (user_mode(regs)) goto user; @@ -467,7 +614,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) fixup: - regs->ARM_pc += 4; + regs->ARM_pc += thumb_mode(regs) ? 2 : 4; switch (CODING_BITS(instr)) { case 0x00000000: /* ldrh or strh */ @@ -537,7 +684,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) bad_or_fault: if (type == TYPE_ERROR) goto bad; - regs->ARM_pc -= 4; + regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; /* * We got a fault - fix it up, or die. */ @@ -549,7 +696,9 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) * Oops, we didn't handle the instruction. */ printk(KERN_ERR "Alignment trap: not handling instruction " - "%08lx at [<%08lx>]\n", instr, instrptr); + "%0*lx at [<%08lx>]\n", + thumb_mode(regs) ? 4 : 8, + thumb_mode(regs) ? tinstr : instr, instrptr); ai_skipped += 1; return 1; @@ -557,9 +706,12 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ai_user += 1; if (ai_usermode & 1) - printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%08lx " + printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx " "Address=0x%08lx FSR 0x%03x\n", current->comm, - current->pid, instrptr, instr, addr, fsr); + current->pid, instrptr, + thumb_mode(regs) ? 4 : 8, + thumb_mode(regs) ? tinstr : instr, + addr, fsr); if (ai_usermode & 2) goto fixup; diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 57b0be2ab..915cee5c1 100644 --- a/arch/arm/mm/consistent.c +++ b/arch/arm/mm/consistent.c @@ -1,7 +1,7 @@ /* * linux/arch/arm/mm/consistent.c * - * Copyright (C) 2000-2002 Russell King + * Copyright (C) 2000-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 @@ -30,7 +30,7 @@ * This is the page table (2MB) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte; -static spinlock_t consistent_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(consistent_lock); /* * VM region handling support. @@ -65,6 +65,7 @@ struct vm_region { struct list_head vm_list; unsigned long vm_start; unsigned long vm_end; + struct page *vm_pages; }; static struct vm_region consistent_head = { @@ -206,6 +207,8 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, int gfp, pte_t *pte = consistent_pte + CONSISTENT_OFFSET(c->vm_start); struct page *end = page + (1 << order); + c->vm_pages = page; + /* * Set the "dma handle" */ @@ -215,6 +218,9 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, int gfp, BUG_ON(!pte_none(*pte)); set_page_count(page, 1); + /* + * x86 does not mark the pages reserved... + */ SetPageReserved(page); set_pte(pte, mk_pte(page, prot)); page++; @@ -264,6 +270,53 @@ dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int } EXPORT_SYMBOL(dma_alloc_writecombine); +static int dma_mmap(struct device *dev, struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t dma_addr, size_t size) +{ + unsigned long flags, user_size, kern_size; + struct vm_region *c; + int ret = -ENXIO; + + user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + + spin_lock_irqsave(&consistent_lock, flags); + c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); + spin_unlock_irqrestore(&consistent_lock, flags); + + if (c) { + unsigned long off = vma->vm_pgoff; + + kern_size = (c->vm_end - c->vm_start) >> PAGE_SHIFT; + + if (off < kern_size && + user_size <= (kern_size - off)) { + vma->vm_flags |= VM_RESERVED; + ret = remap_pfn_range(vma, vma->vm_start, + page_to_pfn(c->vm_pages) + off, + user_size << PAGE_SHIFT, + vma->vm_page_prot); + } + } + + return ret; +} + +int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t dma_addr, size_t size) +{ + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + return dma_mmap(dev, vma, cpu_addr, dma_addr, size); +} +EXPORT_SYMBOL(dma_mmap_coherent); + +int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t dma_addr, size_t size) +{ + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); + return dma_mmap(dev, vma, cpu_addr, dma_addr, size); +} +EXPORT_SYMBOL(dma_mmap_writecombine); + /* * free a page as defined by the above mapping. */ @@ -300,6 +353,10 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr if (pfn_valid(pfn)) { struct page *page = pfn_to_page(pfn); + + /* + * x86 does not mark the pages reserved... + */ ClearPageReserved(page); __free_page(page); diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c index 402dad21a..694ac8208 100644 --- a/arch/arm/mm/copypage-v6.c +++ b/arch/arm/mm/copypage-v6.c @@ -15,6 +15,7 @@ #include #include #include +#include #if SHMLBA > 16384 #error FIX ME @@ -27,7 +28,7 @@ static pte_t *from_pte; static pte_t *to_pte; -static spinlock_t v6_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(v6_lock); #define DCACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index d7b4441ac..e9c99c2f1 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -30,7 +31,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; -extern char _stext, _text, _etext, _end, __init_begin, __init_end; +extern void _stext, _text, _etext, __data_start, _end, __init_begin, __init_end; extern unsigned long phys_initrd_start; extern unsigned long phys_initrd_size; @@ -55,7 +56,7 @@ void show_mem(void) show_free_areas(); printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { struct page *page, *end; page = NODE_MEM_MAP(node); @@ -178,18 +179,14 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np) node = mi->bank[i].node; - if (node >= numnodes) { - numnodes = node + 1; - - /* - * Make sure we haven't exceeded the maximum number - * of nodes that we have in this configuration. If - * we have, we're in trouble. (maybe we ought to - * limit, instead of bugging?) - */ - if (numnodes > MAX_NUMNODES) - BUG(); - } + /* + * Make sure we haven't exceeded the maximum number of nodes + * that we have in this configuration. If we have, we're in + * trouble. (maybe we ought to limit, instead of bugging?) + */ + if (node >= MAX_NUMNODES) + BUG(); + node_set_online(node); /* * Get the start and end pfns for this bank @@ -211,7 +208,7 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np) * Calculate the number of pages we require to * store the bootmem bitmaps. */ - for (i = 0; i < numnodes; i++) { + for_each_online_node(i) { if (np[i].end == 0) continue; @@ -282,7 +279,11 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot * Register the kernel text and data with bootmem. * Note that this can only be in node 0. */ +#ifdef CONFIG_XIP_KERNEL + reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start); +#else reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext); +#endif /* * Reserve the page tables. These are already in use, @@ -376,13 +377,13 @@ static void __init bootmem_init(struct meminfo *mi) * (we could also do with rolling bootmem_init and paging_init * into one generic "memory_init" type function). */ - np += numnodes - 1; - for (node = numnodes - 1; node >= 0; node--, np--) { + np += num_online_nodes() - 1; + for (node = num_online_nodes() - 1; node >= 0; node--, np--) { /* * If there are no pages in this node, ignore it. * Note that node 0 must always have some pages. */ - if (np->end == 0) { + if (np->end == 0 || !node_online(node)) { if (node == 0) BUG(); continue; @@ -445,7 +446,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc) /* * initialise the zones within each node */ - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { unsigned long zone_size[MAX_NR_ZONES]; unsigned long zhole_size[MAX_NR_ZONES]; struct bootmem_data *bdata; @@ -540,7 +541,7 @@ void __init mem_init(void) int i, node; codepages = &_etext - &_text; - datapages = &_end - &_etext; + datapages = &_end - &__data_start; initpages = &__init_end - &__init_begin; #ifndef CONFIG_DISCONTIGMEM @@ -554,7 +555,7 @@ void __init mem_init(void) create_memmap_holes(&meminfo); /* this will put all unused low memory onto the freelists */ - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { pg_data_t *pgdat = NODE_DATA(node); if (pgdat->node_spanned_pages != 0) diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index e2daf066e..00bb8fd37 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -130,7 +130,7 @@ remap_area_pages(unsigned long start, unsigned long phys_addr, * '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. */ -void * +void __iomem * __ioremap(unsigned long phys_addr, size_t size, unsigned long flags, unsigned long align) { @@ -148,7 +148,7 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags, */ offset = phys_addr & ~PAGE_MASK; phys_addr &= PAGE_MASK; - size = PAGE_ALIGN(last_addr) - phys_addr; + size = PAGE_ALIGN(last_addr + 1) - phys_addr; /* * Ok, go for it.. @@ -161,11 +161,11 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags, vfree(addr); return NULL; } - return (void *) (offset + (char *)addr); + return (void __iomem *) (offset + (char *)addr); } EXPORT_SYMBOL(__ioremap); -void __iounmap(void *addr) +void __iounmap(void __iomem *addr) { vfree((void *) (PAGE_MASK & (unsigned long) addr)); } diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index 50c2c0f8d..a9c9c33df 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -158,7 +159,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) init_pgd = pgd_offset_k(0); - if (vectors_base() == 0) { + if (!vectors_high()) { /* * This lock is here just to satisfy pmd_alloc and pte_lock */ @@ -239,7 +240,8 @@ free: /* * Create a SECTION PGD between VIRT and PHYS in domain - * DOMAIN with protection PROT + * DOMAIN with protection PROT. This operates on half- + * pgdir entry increments. */ static inline void alloc_init_section(unsigned long virt, unsigned long phys, int prot) @@ -317,15 +319,25 @@ static struct mem_types mem_types[] __initdata = { .prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE, .domain = DOMAIN_KERNEL, }, - [MT_VECTORS] = { + [MT_LOW_VECTORS] = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_EXEC, .prot_l1 = PMD_TYPE_TABLE, .domain = DOMAIN_USER, }, + [MT_HIGH_VECTORS] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | + L_PTE_USER | L_PTE_EXEC, + .prot_l1 = PMD_TYPE_TABLE, + .domain = DOMAIN_USER, + }, [MT_MEMORY] = { .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, .domain = DOMAIN_KERNEL, + }, + [MT_ROM] = { + .prot_sect = PMD_TYPE_SECT, + .domain = DOMAIN_KERNEL, } }; @@ -353,12 +365,12 @@ static void __init build_mem_type_table(void) } if (cpu_arch <= CPU_ARCH_ARMv5) { - mem_types[MT_DEVICE].prot_l1 |= PMD_BIT4; - mem_types[MT_DEVICE].prot_sect |= PMD_BIT4; - mem_types[MT_CACHECLEAN].prot_sect |= PMD_BIT4; - mem_types[MT_MINICLEAN].prot_sect |= PMD_BIT4; - mem_types[MT_VECTORS].prot_l1 |= PMD_BIT4; - mem_types[MT_MEMORY].prot_sect |= PMD_BIT4; + for (i = 0; i < ARRAY_SIZE(mem_types); i++) { + if (mem_types[i].prot_l1) + mem_types[i].prot_l1 |= PMD_BIT4; + if (mem_types[i].prot_sect) + mem_types[i].prot_sect |= PMD_BIT4; + } } /* @@ -370,6 +382,7 @@ static void __init build_mem_type_table(void) * kernel memory mapping. */ mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4; + mem_types[MT_ROM].prot_sect &= ~PMD_BIT4; /* * Mark cache clean areas read only from SVC mode * and no access from userspace. @@ -381,14 +394,18 @@ static void __init build_mem_type_table(void) cp = &cache_policies[cachepolicy]; if (cpu_arch >= CPU_ARCH_ARMv5) { - mem_types[MT_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; + mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; + mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; } else { - mem_types[MT_VECTORS].prot_pte |= cp->pte; + mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte; + mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte; mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1); } - mem_types[MT_VECTORS].prot_l1 |= ecc_mask; + mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; + mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; + mem_types[MT_ROM].prot_sect |= cp->pmd; for (i = 0; i < 16; i++) { unsigned long v = pgprot_val(protection_map[i]); @@ -413,6 +430,8 @@ static void __init build_mem_type_table(void) ecc_mask ? "en" : "dis", cp->policy); } +#define vectors_base() (vectors_high() ? 0xffff0000 : 0) + /* * Create the page directory entries and any necessary * page tables for the mapping specified by `md'. We @@ -426,14 +445,14 @@ static void __init create_mapping(struct map_desc *md) pgprot_t prot_pte; long off; - if (md->virtual != vectors_base() && md->virtual < PAGE_OFFSET) { + if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { printk(KERN_WARNING "BUG: not creating mapping for " "0x%08lx at 0x%08lx in user region\n", md->physical, md->virtual); return; } - if (md->type == MT_DEVICE && + if ((md->type == MT_DEVICE || md->type == MT_ROM) && md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { printk(KERN_WARNING "BUG: mapping for 0x%08lx at 0x%08lx " "overlaps vmalloc space\n", @@ -464,6 +483,9 @@ static void __init create_mapping(struct map_desc *md) length -= PAGE_SIZE; } + /* + * A section mapping covers half a "pgdir" entry. + */ while (length >= (PGDIR_SIZE / 2)) { alloc_init_section(virt, virt + off, prot_sect); @@ -505,9 +527,12 @@ void setup_mm_for_reboot(char mode) pmdval |= PMD_BIT4; pmd = pmd_offset(pgd + i, i << PGDIR_SHIFT); set_pmd(pmd, __pmd(pmdval)); + set_pmd(pmd + 1, __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)))); } } +extern void _stext, _etext; + /* * Setup initial mappings. We use the page we allocated for zero page to hold * the mappings, which will get overwritten by the vectors in traps_init(). @@ -523,6 +548,14 @@ void __init memtable_init(struct meminfo *mi) init_maps = p = alloc_bootmem_low_pages(PAGE_SIZE); +#ifdef CONFIG_XIP_KERNEL + p->physical = CONFIG_XIP_PHYS_ADDR & PMD_MASK; + p->virtual = (unsigned long)&_stext & PMD_MASK; + p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK; + p->type = MT_ROM; + p ++; +#endif + for (i = 0; i < mi->nr_banks; i++) { if (mi->bank[i].size == 0) continue; @@ -570,16 +603,22 @@ void __init memtable_init(struct meminfo *mi) } while (address != 0); /* - * Create a mapping for the machine vectors at virtual address 0 - * or 0xffff0000. We should always try the high mapping. + * Create a mapping for the machine vectors at the high-vectors + * location (0xffff0000). If we aren't using high-vectors, also + * create a mapping at the low-vectors virtual address. */ init_maps->physical = virt_to_phys(init_maps); - init_maps->virtual = vectors_base(); + init_maps->virtual = 0xffff0000; init_maps->length = PAGE_SIZE; - init_maps->type = MT_VECTORS; - + init_maps->type = MT_HIGH_VECTORS; create_mapping(init_maps); + if (!vectors_high()) { + init_maps->virtual = 0; + init_maps->type = MT_LOW_VECTORS; + create_mapping(init_maps); + } + flush_cache_all(); flush_tlb_all(); } @@ -663,6 +702,6 @@ void __init create_memmap_holes(struct meminfo *mi) { int node; - for (node = 0; node < numnodes; node++) + for_each_online_node(node) free_unused_memmap_node(node, mi); } diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S index 1267ab586..1f325231b 100644 --- a/arch/arm/mm/proc-arm1020.S +++ b/arch/arm/mm/proc-arm1020.S @@ -431,36 +431,29 @@ __arm1020_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - bic r0, r0, #0x1e00 @ i...??r......... - bic r0, r0, #0x000e @ ............wca. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 @ ..........DP...M - orr r0, r0, #0x0100 @ .......S........ - + ldr r5, arm1020_cr1_clear + bic r0, r0, r5 + ldr r5, arm1020_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN - orr r0, r0, #0x4000 @ .R.............. -#endif -#ifndef CONFIG_CPU_BPREDICT_DISABLE - orr r0, r0, #0x0800 @ ....Z........... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ Enable D cache -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ I Cache on + orr r0, r0, #0x4000 @ .R.. .... .... .... #endif mov pc, lr .size __arm1020_setup, . - __arm1020_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ + */ + .type arm1020_cr1_clear, #object + .type arm1020_cr1_set, #object +arm1020_cr1_clear: + .word 0x593f +arm1020_cr1_set: + .word 0x1935 + __INITDATA /* @@ -522,7 +515,9 @@ cpu_arm1020_name: __arm1020_proc_info: .long 0x4104a200 @ ARM 1020T (Architecture v5T) .long 0xff0ffff0 - .long 0x00000c02 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm1020_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S index 947790dd3..142a2c2d6 100644 --- a/arch/arm/mm/proc-arm1020e.S +++ b/arch/arm/mm/proc-arm1020e.S @@ -413,36 +413,29 @@ __arm1020e_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - bic r0, r0, #0x1e00 @ i...??r......... - bic r0, r0, #0x000e @ ............wca. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 @ ..........DP...M - orr r0, r0, #0x0100 @ .......S........ - + ldr r5, arm1020e_cr1_clear + bic r0, r0, r5 + ldr r5, arm1020e_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN - orr r0, r0, #0x4000 @ .R.............. -#endif -#ifndef CONFIG_CPU_BPREDICT_DISABLE - orr r0, r0, #0x0800 @ ....Z........... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ Enable D cache -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ I Cache on + orr r0, r0, #0x4000 @ .R.. .... .... .... #endif mov pc, lr .size __arm1020e_setup, . - __arm1020e_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ + */ + .type arm1020e_cr1_clear, #object + .type arm1020e_cr1_set, #object +arm1020e_cr1_clear: + .word 0x5f3f +arm1020e_cr1_set: + .word 0x1935 + __INITDATA /* @@ -504,7 +497,10 @@ cpu_arm1020e_name: __arm1020e_proc_info: .long 0x4105a200 @ ARM 1020TE (Architecture v5TE) .long 0xff0ffff0 - .long 0x00000c12 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm1020e_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S index 7c8426384..747ed963e 100644 --- a/arch/arm/mm/proc-arm1022.S +++ b/arch/arm/mm/proc-arm1022.S @@ -394,36 +394,30 @@ __arm1022_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - bic r0, r0, #0x1e00 @ ...i??r......... - bic r0, r0, #0x000e @ ............wca. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 @ ..........DP...M - orr r0, r0, #0x2100 @ ..V....S........ - + ldr r5, arm1022_cr1_clear + bic r0, r0, r5 + ldr r5, arm1022_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .R.............. -#endif -#ifndef CONFIG_CPU_BPREDICT_DISABLE - orr r0, r0, #0x0800 @ ....Z........... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .............C.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...I............ #endif mov pc, lr .size __arm1022_setup, . - __arm1022_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .011 1001 ..11 0101 + * + */ + .type arm1022_cr1_clear, #object + .type arm1022_cr1_set, #object +arm1022_cr1_clear: + .word 0x7f3f +arm1022_cr1_set: + .word 0x3935 + __INITDATA /* @@ -485,7 +479,10 @@ cpu_arm1022_name: __arm1022_proc_info: .long 0x4105a220 @ ARM 1022E (v5TE) .long 0xff0ffff0 - .long 0x00000c12 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm1022_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S index 38a06cb1e..248110c9c 100644 --- a/arch/arm/mm/proc-arm1026.S +++ b/arch/arm/mm/proc-arm1026.S @@ -389,35 +389,30 @@ __arm1026_setup: mov r0, #4 @ explicitly disable writeback mcr p15, 7, r0, c15, c0, 0 #endif - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - bic r0, r0, #0x1e00 @ ...i??r......... - bic r0, r0, #0x000e @ ............wca. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 @ ..........DP...M - orr r0, r0, #0x2100 @ ..V....S........ - + ldr r5, arm1026_cr1_clear + bic r0, r0, r5 + ldr r5, arm1026_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN - orr r0, r0, #0x4000 @ .R.............. -#endif -#ifndef CONFIG_CPU_BPREDICT_DISABLE - orr r0, r0, #0x0800 @ ....Z........... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .............C.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...I............ + orr r0, r0, #0x4000 @ .R.. .... .... .... #endif mov pc, lr .size __arm1026_setup, . - __arm1026_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .011 1001 ..11 0101 + * + */ + .type arm1026_cr1_clear, #object + .type arm1026_cr1_set, #object +arm1026_cr1_clear: + .word 0x7f3f +arm1026_cr1_set: + .word 0x3935 + __INITDATA /* @@ -480,7 +475,10 @@ cpu_arm1026_name: __arm1026_proc_info: .long 0x4106a260 @ ARM 1026EJ-S (v5TEJ) .long 0xff0ffff0 - .long 0x00000c12 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm1026_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S index 1fdb39451..0ee214b82 100644 --- a/arch/arm/mm/proc-arm6_7.S +++ b/arch/arm/mm/proc-arm6_7.S @@ -253,9 +253,6 @@ ENTRY(cpu_arm7_reset) __arm6_setup: mov r0, #0 mcr p15, 0, r0, c7, c0 @ flush caches on v3 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mov r0, #0x3d @ . ..RS BLDP WCAM orr r0, r0, #0x100 @ . ..01 0011 1101 mov pc, lr @@ -265,8 +262,6 @@ __arm6_setup: mov r0, #0 __arm7_setup: mov r0, #0 mcr p15, 0, r0, c7, c0 @ flush caches on v3 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client mcr p15, 0, r0, c3, c0 @ load domain access register mov r0, #0x7d @ . ..RS BLDP WCAM orr r0, r0, #0x100 @ . ..01 0111 1101 @@ -391,7 +386,12 @@ __arm7_proc_info: __arm710_proc_info: .long 0x41007100 .long 0xfff8ff00 - .long 0x00000c1e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm7_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S index 3bddde053..57cfa6a2f 100644 --- a/arch/arm/mm/proc-arm720.S +++ b/arch/arm/mm/proc-arm720.S @@ -124,37 +124,59 @@ ENTRY(cpu_arm720_reset) mcr p15, 0, ip, c1, c0, 0 @ ctrl register mov pc, r0 - __INIT - - .type __arm710_setup, #function -__arm710_setup: mov r0, #0 - mcr p15, 0, r0, c7, c7, 0 @ invalidate caches - mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register - - mrc p15, 0, r0, c1, c0 @ get control register - bic r0, r0, #0x0e00 @ ..V. ..RS BLDP WCAM - orr r0, r0, #0x0100 @ .... .... .111 .... (old) - orr r0, r0, #0x003d @ .... ..01 ..11 1101 (new) - mov pc, lr @ __ret (head-armv.S) - .size __arm710_setup, . - __arm710_setup - - .type __arm720_setup, #function -__arm720_setup: mov r0, #0 - mcr p15, 0, r0, c7, c7, 0 @ invalidate caches - mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register - - mrc p15, 0, r0, c1, c0 @ get control register - bic r0, r0, #0x0e00 @ ..V. ..RS BLDP WCAM - orr r0, r0, #0x2100 @ .... .... .111 .... (old) - orr r0, r0, #0x003d @ ..1. ..01 ..11 1101 (new) - mov pc, lr @ __ret (head-armv.S) - .size __arm720_setup, . - __arm720_setup + __INIT + + .type __arm710_setup, #function +__arm710_setup: + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 @ invalidate caches + mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) + mrc p15, 0, r0, c1, c0 @ get control register + ldr r5, arm710_cr1_clear + bic r0, r0, r5 + ldr r5, arm710_cr1_set + orr r0, r0, r5 + mov pc, lr @ __ret (head.S) + .size __arm710_setup, . - __arm710_setup + + /* + * R + * .RVI ZFRS BLDP WCAM + * .... 0001 ..11 1101 + * + */ + .type arm710_cr1_clear, #object + .type arm710_cr1_set, #object +arm710_cr1_clear: + .word 0x0f3f +arm710_cr1_set: + .word 0x013d + + .type __arm720_setup, #function +__arm720_setup: + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 @ invalidate caches + mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) + mrc p15, 0, r0, c1, c0 @ get control register + ldr r5, arm720_cr1_clear + bic r0, r0, r5 + ldr r5, arm720_cr1_set + orr r0, r0, r5 + mov pc, lr @ __ret (head.S) + .size __arm720_setup, . - __arm720_setup + + /* + * R + * .RVI ZFRS BLDP WCAM + * ..1. 1001 ..11 1101 + * + */ + .type arm720_cr1_clear, #object + .type arm720_cr1_set, #object +arm720_cr1_clear: + .word 0x2f3f +arm720_cr1_set: + .word 0x213d __INITDATA @@ -206,7 +228,12 @@ cpu_arm720_name: __arm710_proc_info: .long 0x41807100 @ cpu_val .long 0xffffff00 @ cpu_mask - .long 0x00000c1e @ section_mmu_flags + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm710_setup @ cpu_flush .long cpu_arch_name @ arch_name .long cpu_elf_name @ elf_name @@ -222,7 +249,12 @@ __arm710_proc_info: __arm720_proc_info: .long 0x41807200 @ cpu_val .long 0xffffff00 @ cpu_mask - .long 0x00000c1e @ section_mmu_flags + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm720_setup @ cpu_flush .long cpu_arch_name @ arch_name .long cpu_elf_name @ elf_name diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index 8c9204a7c..0f490a0fc 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S @@ -382,33 +382,27 @@ __arm920_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - @ VI ZFRS BLDP WCAM - bic r0, r0, #0x0e00 - bic r0, r0, #0x0002 - bic r0, r0, #0x000c - bic r0, r0, #0x1000 @ ...0 000. .... 000. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 - orr r0, r0, #0x2100 @ ..1. ...1 ..11 ...1 - -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .... .... .... .1.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...1 .... .... .... -#endif + ldr r5, arm920_cr1_clear + bic r0, r0, r5 + ldr r5, arm920_cr1_set + orr r0, r0, r5 mov pc, lr .size __arm920_setup, . - __arm920_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * ..11 0001 ..11 0101 + * + */ + .type arm920_cr1_clear, #object + .type arm920_cr1_set, #object +arm920_cr1_clear: + .word 0x3f3f +arm920_cr1_set: + .word 0x3135 + __INITDATA /* @@ -464,7 +458,12 @@ cpu_arm920_name: __arm920_proc_info: .long 0x41009200 .long 0xff00fff0 - .long 0x00000c1e @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm920_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S index 13e65cb8a..62bc34a13 100644 --- a/arch/arm/mm/proc-arm922.S +++ b/arch/arm/mm/proc-arm922.S @@ -386,33 +386,27 @@ __arm922_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - @ VI ZFRS BLDP WCAM - bic r0, r0, #0x0e00 - bic r0, r0, #0x0002 - bic r0, r0, #0x000c - bic r0, r0, #0x1000 @ ...0 000. .... 000. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 - orr r0, r0, #0x2100 @ ..1. ...1 ..11 ...1 - -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .... .... .... .1.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...1 .... .... .... -#endif + ldr r5, arm922_cr1_clear + bic r0, r0, r5 + ldr r5, arm922_cr1_set + orr r0, r0, r5 mov pc, lr .size __arm922_setup, . - __arm922_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * ..11 0001 ..11 0101 + * + */ + .type arm922_cr1_clear, #object + .type arm922_cr1_set, #object +arm922_cr1_clear: + .word 0x3f3f +arm922_cr1_set: + .word 0x3135 + __INITDATA /* @@ -468,7 +462,12 @@ cpu_arm922_name: __arm922_proc_info: .long 0x41009220 .long 0xff00fff0 - .long 0x00000c1e @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm922_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S index e8b3ff1fb..ee49aa2ca 100644 --- a/arch/arm/mm/proc-arm925.S +++ b/arch/arm/mm/proc-arm925.S @@ -439,45 +439,36 @@ __arm925_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-back on caches explicitly mcr p15, 7, r0, c15, c0, 0 #endif - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - @ VI ZFRS BLDP WCAM - bic r0, r0, #0x0e00 - bic r0, r0, #0x0002 - bic r0, r0, #0x000c - bic r0, r0, #0x1000 @ ...0 000. .... 000. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 - orr r0, r0, #0x2100 @ ..1. ...1 ..11 ...1 - - /* Writebuffer on */ - orr r0, r0, #0x0008 @ .... .... .... 1... - + ldr r5, arm925_cr1_clear + bic r0, r0, r5 + ldr r5, arm925_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .1.. .... .... .... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .... .... .... .1.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...1 .... .... .... #endif mov pc, lr .size __arm925_setup, . - __arm925_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .011 0001 ..11 1101 + * + */ + .type arm925_cr1_clear, #object + .type arm925_cr1_set, #object +arm925_cr1_clear: + .word 0x7f3f +arm925_cr1_set: + .word 0x313d + __INITDATA /* @@ -536,7 +527,10 @@ cpu_arm925_name: __arm925_proc_info: .long 0x54029250 .long 0xfffffff0 - .long 0x00000c12 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm925_setup .long cpu_arch_name .long cpu_elf_name @@ -552,7 +546,10 @@ __arm925_proc_info: __arm915_proc_info: .long 0x54029150 .long 0xfffffff0 - .long 0x00000c12 @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm925_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S index 5631c8bbd..bb95cc9fe 100644 --- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S @@ -388,7 +388,6 @@ __arm926_setup: mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH @@ -396,35 +395,30 @@ __arm926_setup: mcr p15, 7, r0, c15, c0, 0 #endif - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register mrc p15, 0, r0, c1, c0 @ get control register v4 -/* - * Clear out 'unwanted' bits (then put them in if we need them) - */ - @ VI ZFRS BLDP WCAM - bic r0, r0, #0x0e00 - bic r0, r0, #0x0002 - bic r0, r0, #0x000c - bic r0, r0, #0x1000 @ ...0 000. .... 000. -/* - * Turn on what we want - */ - orr r0, r0, #0x0031 - orr r0, r0, #0x2100 @ ..1. ...1 ..11 ...1 - + ldr r5, arm926_cr1_clear + bic r0, r0, r5 + ldr r5, arm926_cr1_set + orr r0, r0, r5 #ifdef CONFIG_CPU_CACHE_ROUND_ROBIN orr r0, r0, #0x4000 @ .1.. .... .... .... -#endif -#ifndef CONFIG_CPU_DCACHE_DISABLE - orr r0, r0, #0x0004 @ .... .... .... .1.. -#endif -#ifndef CONFIG_CPU_ICACHE_DISABLE - orr r0, r0, #0x1000 @ ...1 .... .... .... #endif mov pc, lr .size __arm926_setup, . - __arm926_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * .011 0001 ..11 0101 + * + */ + .type arm926_cr1_clear, #object + .type arm926_cr1_set, #object +arm926_cr1_clear: + .word 0x7f3f +arm926_cr1_set: + .word 0x3135 + __INITDATA /* @@ -483,7 +477,12 @@ cpu_arm926_name: __arm926_proc_info: .long 0x41069260 @ ARM926EJ-S (v5TEJ) .long 0xff0ffff0 - .long 0x00000c1e @ mmuflags + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_BIT4 | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __arm926_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S index d58fce5cc..360cae905 100644 --- a/arch/arm/mm/proc-sa110.S +++ b/arch/arm/mm/proc-sa110.S @@ -186,21 +186,31 @@ ENTRY(cpu_sa110_set_pte) .type __sa110_setup, #function __sa110_setup: - mrc p15, 0, r0, c1, c0 @ get control register v4 - bic r0, r0, #0x2e00 @ ..VI ZFRS BLDP WCAM - bic r0, r0, #0x0002 @ ..0. 000. .... ..0. - orr r0, r0, #0x003d - orr r0, r0, #0x1100 @ ...1 ...1 ..11 11.1 mov r10, #0 mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4 mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4 mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 - mcr p15, 0, r4, c2, c0 @ load page table pointer - mov r10, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r10, c3, c0 @ load domain access register + mrc p15, 0, r0, c1, c0 @ get control register v4 + ldr r5, sa110_cr1_clear + bic r0, r0, r5 + ldr r5, sa110_cr1_set + orr r0, r0, r5 mov pc, lr .size __sa110_setup, . - __sa110_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * ..01 0001 ..11 1101 + * + */ + .type sa110_cr1_clear, #object + .type sa110_cr1_set, #object +sa110_cr1_clear: + .word 0x3f3f +sa110_cr1_set: + .word 0x113d + __INITDATA /* @@ -245,7 +255,11 @@ cpu_sa110_name: __sa110_proc_info: .long 0x4401a100 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __sa110_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S index 5d444e49b..d447cd5f3 100644 --- a/arch/arm/mm/proc-sa1100.S +++ b/arch/arm/mm/proc-sa1100.S @@ -209,21 +209,31 @@ ENTRY(cpu_sa1100_set_pte) .type __sa1100_setup, #function __sa1100_setup: - mov r10, #0 - mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4 - mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4 - mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0 @ load domain access register - mcr p15, 0, r4, c2, c0 @ load page table pointer + mov r0, #0 + mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 + mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 mrc p15, 0, r0, c1, c0 @ get control register v4 - bic r0, r0, #0x0e00 @ ..VI ZFRS BLDP WCAM - bic r0, r0, #0x0002 @ .... 000. .... ..0. - orr r0, r0, #0x003d - orr r0, r0, #0x3100 @ ..11 ...1 ..11 11.1 + ldr r5, sa1100_cr1_clear + bic r0, r0, r5 + ldr r5, sa1100_cr1_set + orr r0, r0, r5 mov pc, lr .size __sa1100_setup, . - __sa1100_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * ..11 0001 ..11 1101 + * + */ + .type sa1100_cr1_clear, #object + .type sa1100_cr1_set, #object +sa1100_cr1_clear: + .word 0x3f3f +sa1100_cr1_set: + .word 0x313d + __INITDATA /* @@ -276,7 +286,11 @@ cpu_sa1110_name: __sa1100_proc_info: .long 0x4401a110 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __sa1100_setup .long cpu_arch_name .long cpu_elf_name @@ -292,7 +306,11 @@ __sa1100_proc_info: __sa1110_proc_info: .long 0x6901b110 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __sa1100_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 0a4ff2624..0aa73d414 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S @@ -105,6 +105,7 @@ ENTRY(cpu_v6_dcache_clean_area) ENTRY(cpu_v6_switch_mm) mov r2, #0 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id + mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB mcr p15, 0, r2, c7, c10, 4 @ drain write buffer mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 mcr p15, 0, r1, c13, c0, 1 @ set context ID @@ -189,22 +190,24 @@ cpu_v6_name: * - cache type register is implemented */ __v6_setup: - mov r10, #0 - mcr p15, 0, r10, c7, c14, 0 @ clean+invalidate D cache - mcr p15, 0, r10, c7, c5, 0 @ invalidate I cache - mcr p15, 0, r10, c7, c15, 0 @ clean+invalidate cache - mcr p15, 0, r10, c7, c10, 4 @ drain write buffer - mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs - mcr p15, 0, r10, c2, c0, 2 @ TTB control register - mcr p15, 0, r4, c2, c0, 0 @ load TTB0 + mov r0, #0 + mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache + mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache + mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer + mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs + mcr p15, 0, r0, c2, c0, 2 @ TTB control register mcr p15, 0, r4, c2, c0, 1 @ load TTB1 - mov r10, #0x1f @ domains 0, 1 = manager - mcr p15, 0, r10, c3, c0, 0 @ load domain access register +#ifdef CONFIG_VFP + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #(3 << 20) + mcr p15, 0, r0, c1, c0, 2 @ Enable full access to VFP +#endif mrc p15, 0, r0, c1, c0, 0 @ read control register - ldr r10, cr1_clear @ get mask for bits to clear - bic r0, r0, r10 @ clear bits them - ldr r10, cr1_set @ get mask for bits to set - orr r0, r0, r10 @ set them + ldr r5, v6_cr1_clear @ get mask for bits to clear + bic r0, r0, r5 @ clear bits them + ldr r5, v6_cr1_set @ get mask for bits to set + orr r0, r0, r5 @ set them mov pc, lr @ return to head.S:__ret /* @@ -213,11 +216,11 @@ __v6_setup: * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced * 0 110 0011 1.00 .111 1101 < we want */ - .type cr1_clear, #object - .type cr1_set, #object -cr1_clear: - .word 0x0120c302 -cr1_set: + .type v6_cr1_clear, #object + .type v6_cr1_set, #object +v6_cr1_clear: + .word 0x01e0fb7f +v6_cr1_set: .word 0x00c0387d .type v6_processor_functions, #object @@ -250,9 +253,13 @@ cpu_elf_name: */ .type __v6_proc_info, #object __v6_proc_info: - .long 0x00070000 - .long 0x00ff0000 - .long 0x00000c0e + .long 0x0007b000 + .long 0x0007f000 + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __v6_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index 2be02f7f5..2d977b4ee 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S @@ -594,14 +594,9 @@ ENTRY(cpu_xscale_set_pte) .type __xscale_setup, #function __xscale_setup: - mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE - msr cpsr_c, r0 mcr p15, 0, ip, c7, c7, 0 @ invalidate I, D caches & BTB mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer mcr p15, 0, ip, c8, c7, 0 @ invalidate I, D TLBs - mcr p15, 0, r4, c2, c0, 0 @ load page table pointer - mov r0, #0x1f @ Domains 0, 1 = client - mcr p15, 0, r0, c3, c0, 0 @ load domain access register #ifdef CONFIG_IWMMXT mov r0, #0 @ initially disallow access to CP0/CP1 #else @@ -611,13 +606,26 @@ __xscale_setup: orr r0, r0, #1 << 13 @ Its undefined whether this mcr p15, 0, r0, c15, c1, 0 @ affects USR or SVC modes mrc p15, 0, r0, c1, c0, 0 @ get control register - bic r0, r0, #0x0200 @ .... ..R. .... .... - bic r0, r0, #0x0002 @ .... .... .... ..A. - orr r0, r0, #0x0005 @ .... .... .... .C.M - orr r0, r0, #0x3900 @ ..VI Z..S .... .... + ldr r5, xscale_cr1_clear + bic r0, r0, r5 + ldr r5, xscale_cr1_set + orr r0, r0, r5 mov pc, lr .size __xscale_setup, . - __xscale_setup + /* + * R + * .RVI ZFRS BLDP WCAM + * ..11 1.01 .... .101 + * + */ + .type xscale_cr1_clear, #object + .type xscale_cr1_set, #object +xscale_cr1_clear: + .word 0x3b07 +xscale_cr1_set: + .word 0x3905 + __INITDATA /* @@ -679,6 +687,11 @@ cpu_ixp42x_name: .asciz "XScale-IXP42x Family" .size cpu_ixp42x_name, . - cpu_ixp42x_name + .type cpu_ixp46x_name, #object +cpu_ixp46x_name: + .asciz "XScale-IXP46x Family" + .size cpu_ixp46x_name, . - cpu_ixp46x_name + .type cpu_ixp2400_name, #object cpu_ixp2400_name: .asciz "XScale-IXP2400" @@ -707,7 +720,11 @@ cpu_pxa270_name: __80200_proc_info: .long 0x69052000 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -723,7 +740,11 @@ __80200_proc_info: __8032x_proc_info: .long 0x69052420 .long 0xfffff5e0 @ mask should accomodate IOP80219 also - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -737,9 +758,13 @@ __8032x_proc_info: .type __8033x_proc_info,#object __8033x_proc_info: - .long 0x69054090 - .long 0xffffffb0 - .long 0x00000c0e + .long 0x69054010 + .long 0xffffff30 + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -755,7 +780,11 @@ __8033x_proc_info: __pxa250_proc_info: .long 0x69052100 .long 0xfffff7f0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -771,7 +800,11 @@ __pxa250_proc_info: __pxa210_proc_info: .long 0x69052120 .long 0xfffff3f0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -787,7 +820,11 @@ __pxa210_proc_info: __ixp2400_proc_info: .long 0x69054190 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -803,7 +840,11 @@ __ixp2400_proc_info: __ixp2800_proc_info: .long 0x690541a0 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -819,7 +860,11 @@ __ixp2800_proc_info: __ixp42x_proc_info: .long 0x690541c0 .long 0xffffffc0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -831,11 +876,31 @@ __ixp42x_proc_info: .long xscale_cache_fns .size __ixp42x_proc_info, . - __ixp42x_proc_info + .type __ixp46x_proc_info, #object +__ixp46x_proc_info: + .long 0x69054200 + .long 0xffffff00 + .long 0x00000c0e + b __xscale_setup + .long cpu_arch_name + .long cpu_elf_name + .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP + .long cpu_ixp46x_name + .long xscale_processor_functions + .long v4wbi_tlb_fns + .long xscale_mc_user_fns + .long xscale_cache_fns + .size __ixp46x_proc_info, . - __ixp46x_proc_info + .type __pxa255_proc_info,#object __pxa255_proc_info: .long 0x69052d00 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name @@ -851,7 +916,11 @@ __pxa255_proc_info: __pxa270_proc_info: .long 0x69054110 .long 0xfffffff0 - .long 0x00000c0e + .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ + PMD_SECT_AP_WRITE | \ + PMD_SECT_AP_READ b __xscale_setup .long cpu_arch_name .long cpu_elf_name diff --git a/arch/arm/mm/tlb-v4.S b/arch/arm/mm/tlb-v4.S index 0c7329f9c..db82ee468 100644 --- a/arch/arm/mm/tlb-v4.S +++ b/arch/arm/mm/tlb-v4.S @@ -44,7 +44,7 @@ ENTRY(v4_flush_user_tlb_range) mov pc, lr /* - * v4_flush_kerm_tlb_range(start, end) + * v4_flush_kern_tlb_range(start, end) * * Invalidate a range of TLB entries in the specified kernel * address range. diff --git a/arch/arm/mm/tlb-v4wb.S b/arch/arm/mm/tlb-v4wb.S index 15dc83d10..7908d5f1f 100644 --- a/arch/arm/mm/tlb-v4wb.S +++ b/arch/arm/mm/tlb-v4wb.S @@ -47,7 +47,7 @@ ENTRY(v4wb_flush_user_tlb_range) mov pc, lr /* - * v4_flush_kerm_tlb_range(start, end) + * v4_flush_kern_tlb_range(start, end) * * Invalidate a range of TLB entries in the specified kernel * address range. diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c index a1dc5eec0..7ffd8cb9b 100644 --- a/arch/arm/nwfpe/double_cpdo.c +++ b/arch/arm/nwfpe/double_cpdo.c @@ -75,7 +75,11 @@ static float64 float64_mnf(float64 rFm) union float64_components u; u.f64 = rFm; +#ifdef __ARMEB__ + u.i[0] ^= 0x80000000; +#else u.i[1] ^= 0x80000000; +#endif return u.f64; } @@ -85,7 +89,11 @@ static float64 float64_abs(float64 rFm) union float64_components u; u.f64 = rFm; +#ifdef __ARMEB__ + u.i[0] &= 0x7fffffff; +#else u.i[1] &= 0x7fffffff; +#endif return u.f64; } diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 100fe5882..615a3ccfe 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "op_counter.h" #include "op_arm_model.h" @@ -24,15 +25,27 @@ static int pmu_setup(void); static void pmu_stop(void); static int pmu_create_files(struct super_block *, struct dentry *); -static struct oprofile_operations pmu_ops = { - .create_files = pmu_create_files, - .setup = pmu_setup, - .shutdown = pmu_stop, - .start = pmu_start, - .stop = pmu_stop, +#ifdef CONFIG_PM +static int pmu_suspend(struct sys_device *dev, u32 state) +{ + if (pmu_enabled) + pmu_stop(); + return 0; +} + +static int pmu_resume(struct sys_device *dev) +{ + if (pmu_enabled) + pmu_start(); + return 0; +} + +static struct sysdev_class oprofile_sysclass = { + set_kset_name("oprofile"), + .resume = pmu_resume, + .suspend = pmu_suspend, }; -#ifdef CONFIG_PM static struct sys_device device_oprofile = { .id = 0, .cls = &oprofile_sysclass, @@ -43,14 +56,14 @@ static int __init init_driverfs(void) int ret; if (!(ret = sysdev_class_register(&oprofile_sysclass))) - ret = sys_device_register(&device_oprofile); + ret = sysdev_register(&device_oprofile); return ret; } -static void __exit exit_driverfs(void) +static void exit_driverfs(void) { - sys_device_unregister(&device_oprofile); + sysdev_unregister(&device_oprofile); sysdev_class_unregister(&oprofile_sysclass); } #else @@ -113,7 +126,7 @@ static void pmu_stop(void) up(&pmu_sem); } -int __init pmu_init(struct oprofile_operations **ops, struct op_arm_model_spec *spec) +int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) { init_MUTEX(&pmu_sem); @@ -122,9 +135,14 @@ int __init pmu_init(struct oprofile_operations **ops, struct op_arm_model_spec * pmu_model = spec; init_driverfs(); - *ops = &pmu_ops; - pmu_ops.cpu_type = pmu_model->name; + ops->create_files = pmu_create_files; + ops->setup = pmu_setup; + ops->shutdown = pmu_stop; + ops->start = pmu_start; + ops->stop = pmu_stop; + ops->cpu_type = pmu_model->name; printk(KERN_INFO "oprofile: using %s PMU\n", spec->name); + return 0; } diff --git a/arch/arm/oprofile/init.c b/arch/arm/oprofile/init.c index ac7dc6bd5..cce3d3015 100644 --- a/arch/arm/oprofile/init.c +++ b/arch/arm/oprofile/init.c @@ -12,13 +12,14 @@ #include #include "op_arm_model.h" -int __init oprofile_arch_init(struct oprofile_operations **ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { int ret = -ENODEV; #ifdef CONFIG_CPU_XSCALE ret = pmu_init(ops, &op_xscale_spec); #endif + return ret; } diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h index 8a04cbe59..2d4caf478 100644 --- a/arch/arm/oprofile/op_arm_model.h +++ b/arch/arm/oprofile/op_arm_model.h @@ -24,6 +24,6 @@ struct op_arm_model_spec { extern struct op_arm_model_spec op_xscale_spec; #endif -extern int pmu_init(struct oprofile_operations **ops, struct op_arm_model_spec *spec); +extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); extern void pmu_exit(void); #endif /* OP_ARM_MODEL_H */ diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c index 447653df1..e0f0b320d 100644 --- a/arch/arm/oprofile/op_model_xscale.c +++ b/arch/arm/oprofile/op_model_xscale.c @@ -42,6 +42,9 @@ #ifdef CONFIG_ARCH_IOP331 #define XSCALE_PMU_IRQ IRQ_IOP331_CORE_PMU #endif +#ifdef CONFIG_ARCH_PXA +#define XSCALE_PMU_IRQ IRQ_PMU +#endif /* * Different types of events that can be counted by the XScale PMU @@ -305,9 +308,9 @@ static void inline __xsc1_check_ctrs(void) /* Overflow bit gets cleared. There's no workaround. */ /* Fixed in B stepping or later */ - pmnc &= ~(PMU_ENABLE | pmu->cnt_ovf[PMN0] | pmu->cnt_ovf[PMN1] | - pmu->cnt_ovf[CCNT]); - write_pmnc(pmnc); + /* Write the value back to clear the overflow flags. Overflow */ + /* flags remain in pmnc for use below */ + write_pmnc(pmnc & ~PMU_ENABLE); for (i = CCNT; i <= PMN1; i++) { if (!(pmu->int_mask[i] & pmu->int_enable)) @@ -343,8 +346,7 @@ static void inline __xsc2_check_ctrs(void) static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) { - unsigned long pc = profile_pc(regs); - int i, is_kernel = !user_mode(regs); + int i; u32 pmnc; if (pmu->id == PMU_XSC1) @@ -357,7 +359,7 @@ static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs continue; write_counter(i, -(u32)results[i].reset_counter); - oprofile_add_sample(pc, is_kernel, i, smp_processor_id()); + oprofile_add_sample(regs, i); results[i].ovf--; } diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 4df5b0f30..0678f4fcb 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types @@ -6,7 +6,7 @@ # To add an entry into this database, please see Documentation/arm/README, # or contact rmk@arm.linux.org.uk # -# Last update: Thu Sep 30 15:23:21 2004 +# Last update: Thu Jan 6 00:10:23 2005 # # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # @@ -226,7 +226,7 @@ dnp1110 SA1100_DNP1110 DNP1110 214 pnp1110 SA1100_PNP1110 PNP1110 215 csb226 ARCH_CSB226 CSB226 216 arnold SA1100_ARNOLD ARNOLD 217 -psiboard SA1100_PSIBOARD PSIBOARD 218 +voiceblue SA1100_PSIBOARD PSIBOARD 218 jz8028 ARCH_JZ8028 JZ8028 219 h5400 ARCH_H5400 H5400 220 forte SA1100_FORTE FORTE 221 @@ -250,8 +250,8 @@ pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238 pdb ARCH_PDB PDB 239 blue_2g SA1100_BLUE_2G BLUE_2G 240 bluearch SA1100_BLUEARCH BLUEARCH 241 -ixdp2400 ARCH_IXDB2400 IXDB2400 242 -ixdp2800 ARCH_IXDB2800 IXDB2800 243 +ixdp2400 ARCH_IXDP2400 IXDP2400 242 +ixdp2800 ARCH_IXDP2800 IXDP2800 243 explorer SA1100_EXPLORER EXPLORER 244 ixdp425 ARCH_IXDP425 IXDP425 245 chimp ARCH_CHIMP CHIMP 246 @@ -595,8 +595,8 @@ pxa_dnp2110 MACH_PXA_DNP2110 PXA_DNP2110 584 xaeniax MACH_XAENIAX XAENIAX 585 somn4250 MACH_SOMN4250 SOMN4250 586 pleb2 MACH_PLEB2 PLEB2 587 -cwl MACH_CWL CWL 588 -gd MACH_GD GD 589 +cornwallis MACH_CORNWALLIS CORNWALLIS 588 +gurney_drv MACH_GURNEY_DRV GURNEY_DRV 589 chaffee MACH_CHAFFEE CHAFFEE 590 rms101 MACH_RMS101 RMS101 591 rx3715 MACH_RX3715 RX3715 592 @@ -615,3 +615,55 @@ ixdpg425 MACH_IXDPG425 IXDPG425 604 tomtomgo MACH_TOMTOMGO TOMTOMGO 605 versatile_ab MACH_VERSATILE_AB VERSATILE_AB 606 edb9307 MACH_EDB9307 EDB9307 607 +sg565 MACH_SG565 SG565 608 +lpd79524 MACH_LPD79524 LPD79524 609 +lpd79525 MACH_LPD79525 LPD79525 610 +rms100 MACH_RMS100 RMS100 611 +kb9200 MACH_KB9200 KB9200 612 +sx1 MACH_SX1 SX1 613 +hms39c7092 MACH_HMS39C7092 HMS39C7092 614 +armadillo MACH_ARMADILLO ARMADILLO 615 +ipcu MACH_IPCU IPCU 616 +loox720 MACH_LOOX720 LOOX720 617 +ixdp465 MACH_IXDP465 IXDP465 618 +ixdp2351 MACH_IXDP2351 IXDP2351 619 +adsvix MACH_ADSVIX ADSVIX 620 +dm270 MACH_DM270 DM270 621 +socltplus MACH_SOCLTPLUS SOCLTPLUS 622 +ecia MACH_ECIA ECIA 623 +cm4008 MACH_CM4008 CM4008 624 +p2001 MACH_P2001 P2001 625 +twister MACH_TWISTER TWISTER 626 +mudshark MACH_MUDSHARK MUDSHARK 627 +hb2 MACH_HB2 HB2 628 +iq80332 MACH_IQ80332 IQ80332 629 +sendt MACH_SENDT SENDT 630 +mx2jazz MACH_MX2JAZZ MX2JAZZ 631 +multiio MACH_MULTIIO MULTIIO 632 +hrdisplay MACH_HRDISPLAY HRDISPLAY 633 +scma11bb MACH_SCMA11BB SCMA11BB 634 +trizeps3 MACH_TRIZEPS3 TRIZEPS3 635 +zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636 +zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637 +zefeerdzg MACH_ZEFEERDZG ZEFEERDZG 638 +zefeerdzn MACH_ZEFEERDZN ZEFEERDZN 639 +zefeerdzq MACH_ZEFEERDZQ ZEFEERDZQ 640 +gtwx5715 MACH_GTWX5715 GTWX5715 641 +unknown MACH_VL420 VL420 642 +astro_jack MACH_ASTRO_JACK ASTRO_JACK 643 +tip03 MACH_TIP03 TIP03 644 +a9200ec MACH_A9200EC A9200EC 645 +pnx0105 MACH_PNX0105 PNX0105 646 +adcpoecpu MACH_ADCPOECPU ADCPOECPU 647 +csb637 MACH_CSB637 CSB637 648 +ml69q6203 MACH_ML69Q6203 ML69Q6203 649 +mb9200 MACH_MB9200 MB9200 650 +kulun MACH_KULUN KULUN 651 +snapper MACH_SNAPPER SNAPPER 652 +optima MACH_OPTIMA OPTIMA 653 +dlhsbc MACH_DLHSBC DLHSBC 654 +x30 MACH_X30 X30 655 +n30 MACH_N30 N30 656 +manga_ks8695 MACH_MANGA_KS8695 MANGA_KS8695 657 +ajax MACH_AJAX AJAX 658 +nec_mp900 MACH_NEC_MP900 NEC_MP900 659 diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S index e9e583b2b..e73c8deca 100644 --- a/arch/arm/vfp/entry.S +++ b/arch/arm/vfp/entry.S @@ -17,7 +17,7 @@ */ #include #include -#include +#include #include .globl do_vfp diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h index 98e0f526e..55a02bc99 100644 --- a/arch/arm/vfp/vfp.h +++ b/arch/arm/vfp/vfp.h @@ -249,6 +249,12 @@ struct vfp_double { u64 significand; }; +/* + * VFP_REG_ZERO is a special register number for vfp_get_double + * which returns (double)0.0. This is useful for the compare with + * zero instructions. + */ +#define VFP_REG_ZERO 16 extern u64 vfp_get_double(unsigned int reg); extern void vfp_put_double(unsigned int reg, u64 val); @@ -331,3 +337,8 @@ extern u32 vfp_get_sys(unsigned int reg); extern void vfp_put_sys(unsigned int reg, u32 val); u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand); + +/* + * A special flag to tell the normalisation code not to normalise. + */ +#define VFP_NAN_FLAG 0x100 diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c index 54649c1ee..fa3053e84 100644 --- a/arch/arm/vfp/vfpdouble.c +++ b/arch/arm/vfp/vfpdouble.c @@ -31,7 +31,7 @@ * =========================================================================== */ #include -#include +#include #include #include @@ -195,7 +195,7 @@ u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exce dd, d, exceptions); vfp_put_double(dd, d); } - return exceptions; + return exceptions & ~VFP_NAN_FLAG; } /* @@ -240,7 +240,7 @@ vfp_propagate_nan(struct vfp_double *vdd, struct vfp_double *vdn, /* * If one was a signalling NAN, raise invalid operation. */ - return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : 0x100; + return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : VFP_NAN_FLAG; } /* @@ -427,12 +427,12 @@ static u32 vfp_double_fcmpe(int dd, int unused, int dm, u32 fpscr) static u32 vfp_double_fcmpz(int dd, int unused, int dm, u32 fpscr) { - return vfp_compare(dd, 0, -1, fpscr); + return vfp_compare(dd, 0, VFP_REG_ZERO, fpscr); } static u32 vfp_double_fcmpez(int dd, int unused, int dm, u32 fpscr) { - return vfp_compare(dd, 1, -1, fpscr); + return vfp_compare(dd, 1, VFP_REG_ZERO, fpscr); } static u32 vfp_double_fcvts(int sd, int unused, int dm, u32 fpscr) diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index ad3626103..de4ca1223 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S @@ -62,14 +62,14 @@ @ VFP hardware support entry point. @ @ r0 = faulted instruction -@ r5 = faulted PC+4 +@ r2 = faulted PC+4 @ r9 = successful return @ r10 = vfp_state union @ lr = failure return .globl vfp_support_entry vfp_support_entry: - DBGSTR3 "instr %08x pc %08x state %p", r0, r5, r10 + DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10 VFPFMRX r1, FPEXC @ Is the VFP enabled? DBGSTR1 "fpexc %08x", r1 @@ -80,14 +80,14 @@ vfp_support_entry: ldr r3, last_VFP_context_address orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set ldr r4, [r3] @ last_VFP_context pointer - bic r2, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled + bic r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled cmp r4, r10 beq check_for_exception @ we are returning to the same @ process, so the registers are @ still there. In this case, we do @ not want to drop a pending exception. - VFPFMXR FPEXC, r2 @ enable VFP, disable any pending + VFPFMXR FPEXC, r5 @ enable VFP, disable any pending @ exceptions, so we can get at the @ rest of it @@ -96,14 +96,14 @@ vfp_support_entry: DBGSTR1 "save old state %p", r4 cmp r4, #0 beq no_old_VFP_process - VFPFMRX r2, FPSCR @ current status + VFPFMRX r5, FPSCR @ current status VFPFMRX r6, FPINST @ FPINST (always there, rev0 onwards) tst r1, #FPEXC_FPV2 @ is there an FPINST2 to read? VFPFMRX r8, FPINST2, NE @ FPINST2 if needed - avoids reading @ nonexistant reg on rev0 VFPFSTMIA r4 @ save the working registers add r4, r4, #8*16+4 - stmia r4, {r1, r2, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 + stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 @ and point r4 at the word at the @ start of the register dump @@ -112,14 +112,14 @@ no_old_VFP_process: str r10, [r3] @ update the last_VFP_context pointer @ Load the saved state back into the VFP add r4, r10, #8*16+4 - ldmia r4, {r1, r2, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 + ldmia r4, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 VFPFLDMIA r10 @ reload the working registers while @ FPEXC is in a safe state tst r1, #FPEXC_FPV2 @ is there an FPINST2 to write? VFPFMXR FPINST2, r8, NE @ FPINST2 if needed - avoids writing @ nonexistant reg on rev0 VFPFMXR FPINST, r6 - VFPFMXR FPSCR, r2 @ restore status + VFPFMXR FPSCR, r5 @ restore status check_for_exception: tst r1, #FPEXC_EXCEPTION @@ -128,16 +128,16 @@ check_for_exception: @ out before setting an FPEXC that @ stops us reading stuff VFPFMXR FPEXC, r1 @ restore FPEXC last - sub r5, r5, #4 - str r5, [sp, #S_PC] @ retry the instruction + sub r2, r2, #4 + str r2, [sp, #S_PC] @ retry the instruction mov pc, r9 @ we think we have handled things look_for_VFP_exceptions: tst r1, #FPEXC_EXCEPTION bne process_exception - VFPFMRX r2, FPSCR - tst r2, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION ! + VFPFMRX r5, FPSCR + tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION ! bne process_exception @ Fall into hand on to next handler - appropriate coproc instr @@ -148,8 +148,8 @@ look_for_VFP_exceptions: process_exception: DBGSTR "bounce" - sub r5, r5, #4 - str r5, [sp, #S_PC] @ retry the instruction on exit from + sub r2, r2, #4 + str r2, [sp, #S_PC] @ retry the instruction on exit from @ the imprecise exception handling in @ the support code mov r2, sp @ nothing stacked - regdump is at TOS @@ -199,6 +199,11 @@ vfp_get_double: mov pc, lr .endr + @ virtual register 16 for compare with zero + mov r0, #0 + mov r1, #0 + mov pc, lr + .globl vfp_put_double vfp_put_double: mov r0, r0, lsr #1 diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c index 92aa84127..6849fe35c 100644 --- a/arch/arm/vfp/vfpsingle.c +++ b/arch/arm/vfp/vfpsingle.c @@ -31,7 +31,7 @@ * =========================================================================== */ #include -#include +#include #include #include @@ -201,7 +201,7 @@ u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exce vfp_put_float(sd, d); } - return exceptions; + return exceptions & ~VFP_NAN_FLAG; } /* @@ -246,7 +246,7 @@ vfp_propagate_nan(struct vfp_single *vsd, struct vfp_single *vsn, /* * If one was a signalling NAN, raise invalid operation. */ - return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : 0x100; + return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : VFP_NAN_FLAG; } diff --git a/arch/arm26/ACKNOWLEDGEMENTS b/arch/arm26/ACKNOWLEDGEMENTS index ad6141421..0a17a4511 100644 --- a/arch/arm26/ACKNOWLEDGEMENTS +++ b/arch/arm26/ACKNOWLEDGEMENTS @@ -15,6 +15,8 @@ Philip Blundell Russell King Keith Owens +also thanks to Nicholas Pitre for hints, and for the basis or our XIP support. + Currently maintaing the code are Ian Molton (Maintainer / Archimedes) diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig index 500780d9d..dd39dc761 100644 --- a/arch/arm26/Kconfig +++ b/arch/arm26/Kconfig @@ -45,6 +45,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_BUST_SPINLOCK bool @@ -223,4 +227,3 @@ source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/arm26/Makefile b/arch/arm26/Makefile index 631c20aef..ada898553 100644 --- a/arch/arm26/Makefile +++ b/arch/arm26/Makefile @@ -6,6 +6,7 @@ # for more details. # # Copyright (C) 1995-2001 by Russell King +# Copyright (c) 2004 Ian Molton LDFLAGS_vmlinux :=-p -X CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) @@ -20,13 +21,9 @@ ifeq ($(CONFIG_DEBUG_INFO),y) CFLAGS +=-g endif -# Force -mno-fpu to be passed to the assembler. Some versions of gcc don't -# do this with -msoft-float -CFLAGS_BOOT :=-mapcs-26 -mcpu=arm3 -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm -CFLAGS +=-mapcs-26 -mcpu=arm3 -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm -AFLAGS +=-mapcs-26 -mcpu=arm3 -mno-fpu -msoft-float -Wa,-mno-fpu - -head-y := arch/arm26/machine/head.o arch/arm26/kernel/init_task.o +CFLAGS_BOOT :=-mapcs-26 -mcpu=arm3 -msoft-float -Uarm +CFLAGS +=-mapcs-26 -mcpu=arm3 -msoft-float -Uarm +AFLAGS +=-mapcs-26 -mcpu=arm3 -msoft-float ifeq ($(CONFIG_XIP_KERNEL),y) TEXTADDR := 0x03880000 @@ -36,6 +33,8 @@ else DATAADDR := . endif +head-y := arch/arm26/kernel/head.o arch/arm26/kernel/init_task.o + ifeq ($(incdir-y),) incdir-y := endif @@ -109,6 +108,7 @@ define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' echo ' bootpImage - Combined zImage and initial RAM disk' + echo ' xipImage - eXecute In Place capable image for ROM use (arch/$(ARCH)/boot/xipImage)' echo ' initrd - Create an initial image' echo ' install - Install uncompressed kernel' echo ' zinstall - Install compressed kernel' diff --git a/arch/arm26/boot/Makefile b/arch/arm26/boot/Makefile index 004dd81f9..b5c227765 100644 --- a/arch/arm26/boot/Makefile +++ b/arch/arm26/boot/Makefile @@ -1,5 +1,5 @@ # -# arch/arm/boot/Makefile +# arch/arm26/boot/Makefile # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive @@ -51,8 +51,10 @@ $(obj)/compressed/vmlinux: vmlinux FORCE ifeq ($(CONFIG_XIP_KERNEL),y) $(obj)/xipImage: vmlinux FORCE - $(OBJCOPY) -S -O binary -R .data -R .comment vmlinux vmlinux-text.bin - $(OBJCOPY) -S -O binary -R .init -R .text -R .comment -R __ex_table -R __ksymtab vmlinux vmlinux-data.bin +# $(OBJCOPY) -S -O binary -R .data -R .comment vmlinux vmlinux-text.bin +# FIXME - where has .pci_fixup crept in from? + $(OBJCOPY) -S -O binary -R .data -R .pci_fixup -R .comment vmlinux vmlinux-text.bin + $(OBJCOPY) -S -O binary -R .init -R .text -R __ex_table -R .pci_fixup -R __ksymtab -R __ksymtab_gpl -R __kcrctab -R __kcrctab_gpl -R __param -R .comment vmlinux vmlinux-data.bin cat vmlinux-text.bin vmlinux-data.bin > $@ $(RM) -f vmlinux-text.bin vmlinux-data.bin @echo ' Kernel: $@ is ready' diff --git a/arch/arm26/boot/compressed/head.S b/arch/arm26/boot/compressed/head.S index 81512b57c..0307804a6 100644 --- a/arch/arm26/boot/compressed/head.S +++ b/arch/arm26/boot/compressed/head.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/boot/compressed/head.S + * linux/arch/arm26/boot/compressed/head.S * * Copyright (C) 1996-2002 Russell King * diff --git a/arch/arm26/boot/compressed/ll_char_wr.S b/arch/arm26/boot/compressed/ll_char_wr.S index c25ce8129..f024c3ebd 100644 --- a/arch/arm26/boot/compressed/ll_char_wr.S +++ b/arch/arm26/boot/compressed/ll_char_wr.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/ll_char_wr.S + * linux/arch/arm26/lib/ll_char_wr.S * * Copyright (C) 1995, 1996 Russell King. * diff --git a/arch/arm26/boot/compressed/uncompress.h b/arch/arm26/boot/compressed/uncompress.h index df2cba816..66d9b938a 100644 --- a/arch/arm26/boot/compressed/uncompress.h +++ b/arch/arm26/boot/compressed/uncompress.h @@ -1,5 +1,4 @@ /* - * linux/include/asm-arm/arch-arc/uncompress.h * * Copyright (C) 1996 Russell King * diff --git a/arch/arm26/boot/compressed/vmlinux.lds.in b/arch/arm26/boot/compressed/vmlinux.lds.in index ca8db6690..86d821d5a 100644 --- a/arch/arm26/boot/compressed/vmlinux.lds.in +++ b/arch/arm26/boot/compressed/vmlinux.lds.in @@ -1,5 +1,5 @@ /* - * linux/arch/arm/boot/compressed/vmlinux.lds.in + * linux/arch/arm26/boot/compressed/vmlinux.lds.in * * Copyright (C) 2000 Russell King * diff --git a/arch/arm26/boot/install.sh b/arch/arm26/boot/install.sh index b163fd1cf..c628328dd 100644 --- a/arch/arm26/boot/install.sh +++ b/arch/arm26/boot/install.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# arch/arm/boot/install.sh +# arch/arm26/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive @@ -10,7 +10,7 @@ # # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin # Adapted from code in arch/i386/boot/install.sh by Russell King -# Stolen from arch/arm/boot/install.sh by Ian Molton +# Stolen from arm32 by Ian Molton # # "make install" script for arm architecture # diff --git a/arch/arm26/kernel/Makefile b/arch/arm26/kernel/Makefile index e2e5503f7..ee9fb49fd 100644 --- a/arch/arm26/kernel/Makefile +++ b/arch/arm26/kernel/Makefile @@ -2,17 +2,16 @@ # Makefile for the linux kernel. # -ENTRY_OBJ = entry.o - # Object file lists. -obj-y := compat.o dma.o entry.o irq.o \ - process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \ - time.o traps.o ecard.o time-acorn.o dma.o \ - ecard.o fiq.o time.o +AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) + +obj-y := compat.o dma.o entry.o irq.o process.o ptrace.o \ + semaphore.o setup.o signal.o sys_arm.o time.o traps.o \ + ecard.o dma.o ecard.o fiq.o time.o + +extra-y := head.o init_task.o vmlinux.lds obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_MODULES) += armksyms.o -extra-y := init_task.o vmlinux.lds - diff --git a/arch/arm26/kernel/armksyms.c b/arch/arm26/kernel/armksyms.c index bd6c30669..35514b398 100644 --- a/arch/arm26/kernel/armksyms.c +++ b/arch/arm26/kernel/armksyms.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -27,8 +28,6 @@ #include #include #include -#include -//#include #include #include #include @@ -69,8 +68,9 @@ extern void fp_enter(void); /* * This has a special calling convention; it doesn't * modify any of the usual registers, except for LR. + * FIXME - we used to use our own local version - looks to be in kernel/softirq now */ -extern void __do_softirq(void); +//extern void __do_softirq(void); #define EXPORT_SYMBOL_ALIAS(sym,orig) \ const char __kstrtab_##sym[] \ @@ -95,7 +95,7 @@ EXPORT_SYMBOL(ret_from_exception); EXPORT_SYMBOL(kd_mksound); #endif -EXPORT_SYMBOL(__do_softirq); +//EXPORT_SYMBOL(__do_softirq); /* platform dependent support */ EXPORT_SYMBOL(dump_thread); @@ -213,12 +213,6 @@ EXPORT_SYMBOL(sys_open); EXPORT_SYMBOL(sys_exit); EXPORT_SYMBOL(sys_wait4); - /* semaphores */ -EXPORT_SYMBOL(__down_failed); -EXPORT_SYMBOL(__down_interruptible_failed); -EXPORT_SYMBOL(__down_trylock_failed); -EXPORT_SYMBOL(__up_wakeup); - EXPORT_SYMBOL(get_wchan); #ifdef CONFIG_PREEMPT diff --git a/arch/arm26/kernel/asm-offsets.c b/arch/arm26/kernel/asm-offsets.c index b8d0442de..4ccacaef9 100644 --- a/arch/arm26/kernel/asm-offsets.c +++ b/arch/arm26/kernel/asm-offsets.c @@ -42,7 +42,6 @@ int main(void) { - DEFINE(TSK_USED_MATH, offsetof(struct task_struct, used_math)); DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); BLANK(); DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); diff --git a/arch/arm26/kernel/calls.S b/arch/arm26/kernel/calls.S index e3d276827..3e8672a31 100644 --- a/arch/arm26/kernel/calls.S +++ b/arch/arm26/kernel/calls.S @@ -257,6 +257,11 @@ __syscall_start: .long sys_lremovexattr .long sys_fremovexattr .long sys_tkill + + .rept 313 - (. - __syscall_start) / 4 + .long sys_ni_syscall + .endr + .long sys_vserver /* 313 */ __syscall_end: .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 diff --git a/arch/arm26/kernel/compat.c b/arch/arm26/kernel/compat.c index e3717ab1c..db0310db8 100644 --- a/arch/arm26/kernel/compat.c +++ b/arch/arm26/kernel/compat.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/compat.c + * linux/arch/arm26/kernel/compat.c * * Copyright (C) 2001 Russell King * 2003 Ian Molton diff --git a/arch/arm26/kernel/dma.c b/arch/arm26/kernel/dma.c index b4b8c7c4b..80b5a774d 100644 --- a/arch/arm26/kernel/dma.c +++ b/arch/arm26/kernel/dma.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/dma.c + * linux/arch/arm26/kernel/dma.c * * Copyright (C) 1995-2000 Russell King * 2003 Ian Molton @@ -22,9 +22,7 @@ #include -spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED; - -#if MAX_DMA_CHANNELS > 0 +DEFINE_SPINLOCK(dma_spin_lock); static dma_t dma_chan[MAX_DMA_CHANNELS]; @@ -260,33 +258,6 @@ void __init init_dma(void) arch_dma_init(dma_chan); } -#else - -int request_dma(dmach_t channel, const char *device_id) -{ - return -EINVAL; -} - -int get_dma_residue(dmach_t channel) -{ - return 0; -} - -#define GLOBAL_ALIAS(_a,_b) asm (".set " #_a "," #_b "; .globl " #_a) -GLOBAL_ALIAS(disable_dma, get_dma_residue); -GLOBAL_ALIAS(enable_dma, get_dma_residue); -GLOBAL_ALIAS(free_dma, get_dma_residue); -GLOBAL_ALIAS(get_dma_list, get_dma_residue); -GLOBAL_ALIAS(set_dma_mode, get_dma_residue); -GLOBAL_ALIAS(set_dma_page, get_dma_residue); -GLOBAL_ALIAS(set_dma_count, get_dma_residue); -GLOBAL_ALIAS(set_dma_addr, get_dma_residue); -GLOBAL_ALIAS(set_dma_sg, get_dma_residue); -GLOBAL_ALIAS(set_dma_speed, get_dma_residue); -GLOBAL_ALIAS(init_dma, get_dma_residue); - -#endif - EXPORT_SYMBOL(request_dma); EXPORT_SYMBOL(free_dma); EXPORT_SYMBOL(enable_dma); diff --git a/arch/arm26/kernel/ecard.c b/arch/arm26/kernel/ecard.c index 8434f0f0c..824c6b571 100644 --- a/arch/arm26/kernel/ecard.c +++ b/arch/arm26/kernel/ecard.c @@ -42,9 +42,7 @@ #include #include #include -#include #include -#include #include #include @@ -137,65 +135,23 @@ ecard_task_readbytes(struct ecard_request *req) unsigned int len = req->length; unsigned int off = req->address; - if (req->ec->slot_no == 8) { - /* - * The card maintains an index which increments the address - * into a 4096-byte page on each access. We need to keep - * track of the counter. - */ - static unsigned int index; - unsigned int page; - - page = (off >> 12) * 4; - if (page > 256 * 4) - return; - - off &= 4095; - - /* - * If we are reading offset 0, or our current index is - * greater than the offset, reset the hardware index counter. - */ - if (off == 0 || index > off) { - *base_addr = 0; - index = 0; - } - - /* - * Increment the hardware index counter until we get to the - * required offset. The read bytes are discarded. - */ - while (index < off) { - unsigned char byte; - byte = base_addr[page]; - index += 1; - } - + if (!req->use_loader || !req->ec->loader) { + off *= 4; while (len--) { - *buf++ = base_addr[page]; - index += 1; + *buf++ = base_addr[off]; + off += 4; } } else { - - if (!req->use_loader || !req->ec->loader) { - off *= 4; - while (len--) { - *buf++ = base_addr[off]; - off += 4; - } - } else { - while(len--) { - /* - * The following is required by some - * expansion card loader programs. - */ - *(unsigned long *)0x108 = 0; - *buf++ = ecard_loader_read(off++, base_addr, - req->ec->loader); - } + while(len--) { + /* + * The following is required by some + * expansion card loader programs. + */ + *(unsigned long *)0x108 = 0; + *buf++ = ecard_loader_read(off++, base_addr, + req->ec->loader); } } - } static void ecard_do_request(struct ecard_request *req) @@ -466,7 +422,7 @@ ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) for (ec = cards; ec; ec = ec->next) { int pending; - if (!ec->claimed || ec->irq == NO_IRQ || ec->slot_no == 8) + if (!ec->claimed || ec->irq == NO_IRQ) continue; if (ec->ops && ec->ops->irqpending) @@ -494,22 +450,15 @@ unsigned int ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) unsigned long address = 0; int slot = ec->slot_no; - if (ec->slot_no == 8) - return 0; - ectcr &= ~(1 << slot); switch (type) { case ECARD_MEMC: - if (slot < 4) - address = IO_EC_MEMC_BASE + (slot << 12); + address = IO_EC_MEMC_BASE + (slot << 12); break; case ECARD_IOC: - if (slot < 4) - address = IO_EC_IOC_BASE + (slot << 12); - if (address) - address += speed << 17; + address = IO_EC_IOC_BASE + (slot << 12) + (speed << 17); break; default: @@ -592,11 +541,9 @@ static void __init ecard_init_resources(struct expansion_card *ec) unsigned int slot = ec->slot_no; int i; - if (slot < 4) { - ec_set_resource(ec, ECARD_RES_MEMC, - PODSLOT_MEMC_BASE + (slot << 14), - PODSLOT_MEMC_SIZE, IORESOURCE_MEM); - } + ec_set_resource(ec, ECARD_RES_MEMC, + PODSLOT_MEMC_BASE + (slot << 14), + PODSLOT_MEMC_SIZE, IORESOURCE_MEM); for (i = 0; i < ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++) { ec_set_resource(ec, i + ECARD_RES_IOCSLOW, @@ -739,12 +686,10 @@ ecard_probe(int slot, card_type_t type) /* * hook the interrupt handlers */ - if (slot < 8) { - ec->irq = 32 + slot; - set_irq_chip(ec->irq, &ecard_chip); - set_irq_handler(ec->irq, do_level_IRQ); - set_irq_flags(ec->irq, IRQF_VALID); - } + ec->irq = 32 + slot; + set_irq_chip(ec->irq, &ecard_chip); + set_irq_handler(ec->irq, do_level_IRQ); + set_irq_flags(ec->irq, IRQF_VALID); for (ecp = &cards; *ecp; ecp = &(*ecp)->next); @@ -777,7 +722,7 @@ static int __init ecard_init(void) printk("Probing expansion cards\n"); - for (slot = 0; slot < 4; slot ++) { + for (slot = 0; slot < MAX_ECARDS; slot ++) { ecard_probe(slot, ECARD_IOC); } diff --git a/arch/arm26/kernel/entry.S b/arch/arm26/kernel/entry.S index 8f44503d8..a231dd88d 100644 --- a/arch/arm26/kernel/entry.S +++ b/arch/arm26/kernel/entry.S @@ -3,10 +3,10 @@ * Assembled from chunks of code in arch/arm * * Copyright (C) 2003 Ian Molton + * Based on the work of RMK. * */ -#include /* for CONFIG_ARCH_xxxx */ #include #include @@ -35,8 +35,6 @@ #define BAD_IRQ 3 #define BAD_UNDEFINSTR 4 -#define PT_TRACESYS 0x00000002 - @ OS version number used in SWIs @ RISC OS is 0 @ RISC iX is 8 @@ -46,10 +44,12 @@ @ @ Stack format (ensured by USER_* and SVC_*) +@ PSR and PC are comined on arm26 @ -#define S_FRAME_SIZE 72 @ FIXME: Really? + +#define S_OFF 8 + #define S_OLD_R0 64 -#define S_PSR 60 #define S_PC 60 #define S_LR 56 #define S_SP 52 @@ -66,19 +66,18 @@ #define S_R2 8 #define S_R1 4 #define S_R0 0 -#define S_OFF 8 .macro save_user_regs - str r0, [sp, #-4]! - str lr, [sp, #-4]! + str r0, [sp, #-4]! @ Store SVC r0 + str lr, [sp, #-4]! @ Store user mode PC sub sp, sp, #15*4 - stmia sp, {r0 - lr}^ + stmia sp, {r0 - lr}^ @ Store the other user-mode regs mov r0, r0 .endm .macro slow_restore_user_regs - ldmia sp, {r0 - lr}^ @ restore the user regs - mov r0, r0 @ no-op + ldmia sp, {r0 - lr}^ @ restore the user regs not including PC + mov r0, r0 ldr lr, [sp, #15*4] @ get user PC add sp, sp, #15*4+8 @ free stack movs pc, lr @ return @@ -93,6 +92,32 @@ movs pc, lr .endm + .macro save_svc_regs + str sp, [sp, #-16]! + str lr, [sp, #8] + str lr, [sp, #4] + stmfd sp!, {r0 - r12} + mov r0, #-1 + str r0, [sp, #S_OLD_R0] + zero_fp + .endm + + .macro save_svc_regs_irq + str sp, [sp, #-16]! + str lr, [sp, #4] + ldr lr, .LCirq + ldr lr, [lr] + str lr, [sp, #8] + stmfd sp!, {r0 - r12} + mov r0, #-1 + str r0, [sp, #S_OLD_R0] + zero_fp + .endm + + .macro restore_svc_regs + ldmfd sp, {r0 - pc}^ + .endm + .macro mask_pc, rd, rm bic \rd, \rm, #PCMASK .endm @@ -117,21 +142,10 @@ mov \rd, \rd, lsl #13 .endm - /* - * Like adr, but force SVC mode (if required) - */ - .macro adrsvc, cond, reg, label - adr\cond \reg, \label - orr\cond \reg, \reg, #PSR_I_BIT | MODE_SVC26 - .endm - - /* * These are the registers used in the syscall handler, and allow us to * have in theory up to 7 arguments to a function - r0 to r6. * - * r7 is reserved for the system call number for thumb mode. - * * Note that tbl == why is intentional. * * We must set at least "tsk" and "why" when calling ret_with_reschedule. @@ -160,17 +174,6 @@ tsk .req r9 @ current thread_info #error "Please fix" #endif -/* - * Our do_softirq out of line code. See include/asm-arm26/hardirq.h for - * the calling assembly. - */ -ENTRY(__do_softirq) - stmfd sp!, {r0 - r3, ip, lr} - bl do_softirq - ldmfd sp!, {r0 - r3, ip, pc} - - .align 5 - /* * This is the fast syscall return path. We do as little as * possible here, and this includes saving r0 back into the SVC @@ -228,7 +231,8 @@ ENTRY(ret_from_fork) bl syscall_trace b ret_slow_syscall -#include +// FIXME - is this strictly necessary? +#include "calls.S" /*============================================================================= * SWI handler @@ -258,7 +262,8 @@ ENTRY(vector_swi) tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? bne __sys_trace - adrsvc al, lr, ret_fast_syscall @ return address + adral lr, ret_fast_syscall @ set return address + orral lr, lr, #PSR_I_BIT | MODE_SVC26 @ Force SVC mode on return cmp scno, #NR_syscalls @ check upper syscall limit ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine @@ -278,7 +283,8 @@ __sys_trace: mov r0, #0 @ trace entry [IP = 0] bl syscall_trace - adrsvc al, lr, __sys_trace_return @ return address + adral lr, __sys_trace_return @ set return address + orral lr, lr, #PSR_I_BIT | MODE_SVC26 @ Force SVC mode on return add r1, sp, #S_R0 + S_OFF @ pointer to regs cmp scno, #NR_syscalls @ check upper syscall limit ldmccia r1, {r0 - r3} @ have to reload r0 - r3 @@ -301,7 +307,7 @@ __cr_alignment: .type sys_call_table, #object ENTRY(sys_call_table) -#include +#include "calls.S" /*============================================================================ * Special system call wrappers @@ -387,27 +393,22 @@ sys_mmap2: .text - .equ ioc_base_high, IOC_BASE & 0xff000000 - .equ ioc_base_low, IOC_BASE & 0x00ff0000 - .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 + .macro handle_irq +1: mov r4, #IOC_BASE + ldrb r6, [r4, #0x24] @ get high priority first + adr r5, irq_prio_h + teq r6, #0 + ldreqb r6, [r4, #0x14] @ get low priority + adreq r5, irq_prio_l + + teq r6, #0 @ If an IRQ happened... + ldrneb r0, [r5, r6] @ get IRQ number + movne r1, sp @ get struct pt_regs + adrne lr, 1b @ Set return address to 1b + orrne lr, lr, #PSR_I_BIT | MODE_SVC26 @ (and force SVC mode) + bne asm_do_IRQ @ process IRQ (if asserted) .endm - .macro get_irqnr_and_base, irqnr, base - mov r4, #ioc_base_high @ point at IOC - .if ioc_base_low - orr r4, r4, #ioc_base_low - .endif - ldrb \irqnr, [r4, #0x24] @ get high priority first - adr \base, irq_prio_h - teq \irqnr, #0 - ldreqb \irqnr, [r4, #0x14] @ get low priority - adreq \base, irq_prio_l - .endm /* * Interrupt table (incorporates priority) @@ -448,9 +449,9 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 .endm #if 1 -/* FIXME (well, ok, dont - but its easy to grep for :) */ /* * Uncomment these if you wish to get more debugging into about data aborts. + * FIXME - I bet we can find a way to encode these and keep performance. */ #define FAULT_CODE_LDRSTRPOST 0x80 #define FAULT_CODE_LDRSTRPRE 0x40 @@ -462,29 +463,6 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 #define FAULT_CODE_WRITE 0x02 #define FAULT_CODE_FORCECOW 0x01 -#define SVC_SAVE_ALL \ - str sp, [sp, #-16]! ;\ - str lr, [sp, #8] ;\ - str lr, [sp, #4] ;\ - stmfd sp!, {r0 - r12} ;\ - mov r0, #-1 ;\ - str r0, [sp, #S_OLD_R0] ;\ - zero_fp - -#define SVC_IRQ_SAVE_ALL \ - str sp, [sp, #-16]! ;\ - str lr, [sp, #4] ;\ - ldr lr, .LCirq ;\ - ldr lr, [lr] ;\ - str lr, [sp, #8] ;\ - stmfd sp!, {r0 - r12} ;\ - mov r0, #-1 ;\ - str r0, [sp, #S_OLD_R0] ;\ - zero_fp - -#define SVC_RESTORE_ALL \ - ldmfd sp, {r0 - pc}^ - /*============================================================================= * Undefined FIQs *----------------------------------------------------------------------------- @@ -526,13 +504,13 @@ vector_undefinstr: /* FIXME - should we trap for a null pointer here? */ /* The SVC mode case */ -__und_svc: SVC_SAVE_ALL @ Non-user mode +__und_svc: save_svc_regs @ Non-user mode mask_pc r0, lr and r2, lr, #3 sub r0, r0, #4 mov r1, sp bl do_undefinstr - SVC_RESTORE_ALL + restore_svc_regs /* We get here if the FP emulator doesnt handle the undef instr. * If the insn WAS handled, the emulator jumps to ret_from_exception by itself/ @@ -614,7 +592,7 @@ vector_prefetch: ldr lr, [sp,#S_PC] @ FIXME program to test this on. I think its b .Lbug_undef @ broken at the moment though!) -__pabt_invalid: SVC_SAVE_ALL +__pabt_invalid: save_svc_regs mov r0, sp @ Prefetch aborts are definitely *not* mov r1, #BAD_PREFETCH @ allowed in non-user modes. We cant and r2, lr, #3 @ recover from this problem. @@ -648,7 +626,7 @@ vector_addrexcptn: b ret_from_exception Laddrexcptn_not_user: - SVC_SAVE_ALL + save_svc_regs and r2, lr, #3 teq r2, #3 bne Laddrexcptn_illegal_mode @@ -686,56 +664,50 @@ Laddrexcptn_illegal_mode: /*============================================================================= * Interrupt (IRQ) handler *----------------------------------------------------------------------------- - * Note: if in user mode, then *no* kernel routine is running, so do not have - * to save svc lr - * (r13 points to irq temp save area) + * Note: if the IRQ was taken whilst in user mode, then *no* kernel routine + * is running, so do not have to save svc lr. + * + * Entered in IRQ mode. */ -vector_IRQ: ldr r13, .LCirq @ I will leave this one in just in case... - sub lr, lr, #4 - str lr, [r13] - tst lr, #3 - bne __irq_svc - teqp pc, #PSR_I_BIT | MODE_SVC26 +vector_IRQ: ldr sp, .LCirq @ Setup some temporary stack + sub lr, lr, #4 + str lr, [sp] @ push return address + + tst lr, #3 + bne __irq_non_usr + +__irq_usr: teqp pc, #PSR_I_BIT | MODE_SVC26 @ Enter SVC mode mov r0, r0 + ldr lr, .LCirq - ldr lr, [lr] + ldr lr, [lr] @ Restore lr for jump back to USR + save_user_regs -1: get_irqnr_and_base r6, r5 - teq r6, #0 - ldrneb r0, [r5, r6] @ get IRQ number - movne r1, sp - @ - @ routine called with r0 = irq number, r1 = struct pt_regs * - @ - adr lr, 1b - orr lr, lr, #PSR_I_BIT | MODE_SVC26 @ Force SVC - bne asm_do_IRQ + handle_irq mov why, #0 - get_thread_info tsk @ FIXME - was r5, but seemed wrong. + get_thread_info tsk b ret_to_user +@ Place the IRQ priority table here so that the handle_irq macros above +@ and below here can access it. + irq_prio_table -__irq_svc: teqp pc, #PSR_I_BIT | MODE_SVC26 +__irq_non_usr: teqp pc, #PSR_I_BIT | MODE_SVC26 @ Enter SVC mode mov r0, r0 - SVC_IRQ_SAVE_ALL + + save_svc_regs_irq + and r2, lr, #3 teq r2, #3 - bne __irq_invalid -1: get_irqnr_and_base r6, r5 - teq r6, #0 - ldrneb r0, [r5, r6] @ get IRQ number - movne r1, sp - @ - @ routine called with r0 = irq number, r1 = struct pt_regs * - @ - adr lr, 1b - orr lr, lr, #PSR_I_BIT | MODE_SVC26 @ Force SVC - bne asm_do_IRQ @ Returns to 1b - SVC_RESTORE_ALL + bne __irq_invalid @ IRQ not from SVC mode + + handle_irq + + restore_svc_regs __irq_invalid: mov r0, sp mov r1, #BAD_IRQ @@ -762,7 +734,7 @@ vector_data: sub lr, lr, #8 @ Correct lr b ret_from_exception Ldata_not_user: - SVC_SAVE_ALL + save_svc_regs and r2, lr, #3 teq r2, #3 bne Ldata_illegal_mode @@ -770,7 +742,7 @@ Ldata_not_user: teqeqp pc, #MODE_SVC26 mask_pc r0, lr bl Ldata_do - SVC_RESTORE_ALL + restore_svc_regs Ldata_illegal_mode: mov r0, sp diff --git a/arch/arm26/kernel/init_task.c b/arch/arm26/kernel/init_task.c index 5b510232a..4191565b8 100644 --- a/arch/arm26/kernel/init_task.c +++ b/arch/arm26/kernel/init_task.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/init_task.c + * linux/arch/arm26/kernel/init_task.c * * Copyright (C) 2003 Ian Molton * @@ -29,7 +29,9 @@ EXPORT_SYMBOL(init_mm); * We need to make sure that this is 8192-byte aligned due to the * way process stacks are handled. This is done by making sure * the linker maps this in the .text segment right after head.S, - * and making head.S ensure the proper alignment. + * and making the linker scripts ensure the proper alignment. + * + * FIXME - should this be 32K alignment on arm26? * * The things we do for performance... */ diff --git a/arch/arm26/kernel/irq.c b/arch/arm26/kernel/irq.c index be2ebeaa8..f3cc1036e 100644 --- a/arch/arm26/kernel/irq.c +++ b/arch/arm26/kernel/irq.c @@ -50,7 +50,7 @@ void __init arc_init_irq(void); #define MAX_IRQ_CNT 100000 static volatile unsigned long irq_err_count; -static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_controller_lock); struct irqdesc irq_desc[NR_IRQS]; diff --git a/arch/arm26/kernel/process.c b/arch/arm26/kernel/process.c index 5b4efd620..46aea6ac1 100644 --- a/arch/arm26/kernel/process.c +++ b/arch/arm26/kernel/process.c @@ -67,42 +67,22 @@ static int __init hlt_setup(char *__unused) __setup("nohlt", nohlt_setup); __setup("hlt", hlt_setup); -/* - * The following aren't currently used. - */ -void (*pm_idle)(void); -void (*pm_power_off)(void); - /* * This is our default idle handler. We need to disable * interrupts here to ensure we don't miss a wakeup call. */ -void default_idle(void) -{ - local_irq_disable(); - if (!need_resched() && !hlt_counter) - local_irq_enable(); -} - -/* - * The idle thread. We try to conserve power, while trying to keep - * overall latency low. The architecture specific idle is passed - * a value to indicate the level of "idleness" of the system. - */ void cpu_idle(void) { /* endless idle loop with no priority at all */ preempt_disable(); while (1) { - void (*idle)(void) = pm_idle; - if (!idle) - idle = default_idle; - leds_event(led_idle_start); - while (!need_resched()) - idle(); - leds_event(led_idle_end); - schedule(); + while (!need_resched()) { + local_irq_disable(); + if (!need_resched() && !hlt_counter) + local_irq_enable(); + } } + schedule(); } static char reboot_mode = 'h'; @@ -115,20 +95,15 @@ int __init reboot_setup(char *str) __setup("reboot=", reboot_setup); +/* ARM26 cant do these but we still need to define them. */ void machine_halt(void) { - leds_event(led_halted); } - -EXPORT_SYMBOL(machine_halt); - void machine_power_off(void) { - leds_event(led_halted); - if (pm_power_off) - pm_power_off(); } +EXPORT_SYMBOL(machine_halt); EXPORT_SYMBOL(machine_power_off); void machine_restart(char * __unused) @@ -296,7 +271,7 @@ void flush_thread(void) memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); memset(&thread->fpstate, 0, sizeof(union fp_state)); - current->used_math = 0; + clear_used_math(); } void release_thread(struct task_struct *dead_task) @@ -306,7 +281,7 @@ void release_thread(struct task_struct *dead_task) asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); int -copy_thread(int nr, unsigned long clone_flags, unsigned long esp, +copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start, unsigned long unused, struct task_struct *p, struct pt_regs *regs) { struct thread_info *thread = p->thread_info; @@ -315,7 +290,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long esp, childregs = __get_user_regs(thread); *childregs = *regs; childregs->ARM_r0 = 0; - childregs->ARM_sp = esp; + childregs->ARM_sp = stack_start; memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); thread->cpu_context.sp = (unsigned long)childregs; @@ -330,7 +305,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long esp, int dump_fpu (struct pt_regs *regs, struct user_fp *fp) { struct thread_info *thread = current_thread_info(); - int used_math = current->used_math; + int used_math = !!used_math(); if (used_math) memcpy(fp, &thread->fpstate.soft, sizeof (*fp)); @@ -367,35 +342,42 @@ void dump_thread(struct pt_regs * regs, struct user * dump) } /* - * This is the mechanism for creating a new kernel thread. - * - * NOTE! 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. - * FIXME - taken from arm32 + * Shuffle the argument into the correct register before calling the + * thread function. r1 is the thread argument, r2 is the pointer to + * the thread function, and r3 points to the exit function. + * FIXME - make sure this is right - the older code used to zero fp + * and cause the parent to call sys_exit (do_exit in this version) + */ +extern void kernel_thread_helper(void); + +asm( ".section .text\n" +" .align\n" +" .type kernel_thread_helper, #function\n" +"kernel_thread_helper:\n" +" mov r0, r1\n" +" mov lr, r3\n" +" mov pc, r2\n" +" .size kernel_thread_helper, . - kernel_thread_helper\n" +" .previous"); + +/* + * Create a kernel thread. */ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { - register unsigned int r0 asm("r0") = flags | CLONE_VM | CLONE_UNTRACED; - register unsigned int r1 asm("r1") = 0; - register pid_t __ret asm("r0"); - - __asm__ __volatile__( - __syscall(clone)" @ kernel_thread sys_clone \n\ - movs %0, r0 @ if we are the child \n\ - bne 1f \n\ - mov fp, #0 @ ensure that fp is zero \n\ - mov r0, %4 \n\ - mov lr, pc \n\ - mov pc, %3 \n\ - b sys_exit \n\ -1: " - : "=r" (__ret) - : "0" (r0), "r" (r1), "r" (fn), "r" (arg) - : "lr"); - return __ret; + struct pt_regs regs; + + memset(®s, 0, sizeof(regs)); + + regs.ARM_r1 = (unsigned long)arg; + regs.ARM_r2 = (unsigned long)fn; + regs.ARM_r3 = (unsigned long)do_exit; + regs.ARM_pc = (unsigned long)kernel_thread_helper | MODE_SVC26; + + return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); } +EXPORT_SYMBOL(kernel_thread); + unsigned long get_wchan(struct task_struct *p) { diff --git a/arch/arm26/kernel/ptrace.c b/arch/arm26/kernel/ptrace.c index ae9c558b2..d2e818901 100644 --- a/arch/arm26/kernel/ptrace.c +++ b/arch/arm26/kernel/ptrace.c @@ -540,7 +540,7 @@ static int ptrace_getfpregs(struct task_struct *tsk, void *ufp) */ static int ptrace_setfpregs(struct task_struct *tsk, void *ufp) { - tsk->used_math = 1; + set_stopped_child_used_math(tsk); return copy_from_user(&tsk->thread_info->fpstate, ufp, sizeof(struct user_fp)) ? -EFAULT : 0; } @@ -614,7 +614,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat /* make sure single-step breakpoint is gone. */ child->ptrace &= ~PT_SINGLESTEP; ptrace_cancel_bpt(child); - if (child->state != TASK_ZOMBIE) { + if (child->exit_state != EXIT_ZOMBIE) { child->exit_code = SIGKILL; wake_up_process(child); } diff --git a/arch/arm26/kernel/semaphore.c b/arch/arm26/kernel/semaphore.c index 60591a738..3023a5343 100644 --- a/arch/arm26/kernel/semaphore.c +++ b/arch/arm26/kernel/semaphore.c @@ -12,6 +12,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -55,7 +56,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { @@ -179,7 +180,7 @@ int __down_trylock(struct semaphore * sem) * registers (r0 to r3 and lr), but not ip, as we use it as a return * value in some cases.. */ -asm(" .section .sched.text \n\ +asm(" .section .sched.text , #alloc, #execinstr \n\ .align 5 \n\ .globl __down_failed \n\ __down_failed: \n\ @@ -215,3 +216,8 @@ __up_wakeup: \n\ ldmfd sp!, {r0 - r3, pc}^ \n\ "); +EXPORT_SYMBOL(__down_failed); +EXPORT_SYMBOL(__down_interruptible_failed); +EXPORT_SYMBOL(__down_trylock_failed); +EXPORT_SYMBOL(__up_wakeup); + diff --git a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c index e02d41867..2909b2499 100644 --- a/arch/arm26/kernel/setup.c +++ b/arch/arm26/kernel/setup.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/setup.c + * linux/arch/arm26/kernel/setup.c * * Copyright (C) 1995-2001 Russell King * Copyright (C) 2003 Ian Molton @@ -37,7 +37,7 @@ #endif #ifdef CONFIG_PREEMPT -spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(kernel_flag); #endif #if defined(CONFIG_FPE_NWFPE) @@ -119,7 +119,7 @@ static void __init setup_processor(void) /* * locate processor in the list of supported processor * types. The linker builds this table for us from the - * entries in arch/arm/mm/proc-*.S + * entries in arch/arm26/mm/proc-*.S */ for (list = &__proc_info_begin; list < &__proc_info_end ; list++) if ((processor_id & list->cpu_mask) == list->cpu_val) diff --git a/arch/arm26/kernel/sys_arm.c b/arch/arm26/kernel/sys_arm.c index 431f9f85e..e7edd2015 100644 --- a/arch/arm26/kernel/sys_arm.c +++ b/arch/arm26/kernel/sys_arm.c @@ -13,6 +13,7 @@ * have a non-standard calling sequence on the Linux/arm * platform. */ +#include #include #include #include @@ -281,3 +282,43 @@ asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, struct pt_r out: return error; } + +/* FIXME - see if this is correct for arm26 */ +long execve(const char *filename, char **argv, char **envp) +{ + struct pt_regs regs; + int ret; + memset(®s, 0, sizeof(struct pt_regs)); + ret = do_execve((char *)filename, (char __user * __user *)argv, (char __user * __user *)envp, ®s); + if (ret < 0) + goto out; + + /* + * Save argc to the register structure for userspace. + */ + regs.ARM_r0 = ret; + + /* + * We were successful. We won't be returning to our caller, but + * instead to user space by manipulating the kernel stack. + */ + asm( "add r0, %0, %1\n\t" + "mov r1, %2\n\t" + "mov r2, %3\n\t" + "bl memmove\n\t" /* copy regs to top of stack */ + "mov r8, #0\n\t" /* not a syscall */ + "mov r9, %0\n\t" /* thread structure */ + "mov sp, r0\n\t" /* reposition stack pointer */ + "b ret_to_user" + : + : "r" (current_thread_info()), + "Ir" (THREAD_SIZE - 8 - sizeof(regs)), + "r" (®s), + "Ir" (sizeof(regs)) + : "r0", "r1", "r2", "r3", "ip", "memory"); + + out: + return ret; +} + +EXPORT_SYMBOL(execve); diff --git a/arch/arm26/kernel/time.c b/arch/arm26/kernel/time.c index dbbc21404..549a6b2e1 100644 --- a/arch/arm26/kernel/time.c +++ b/arch/arm26/kernel/time.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include u64 jiffies_64 = INITIAL_JIFFIES; @@ -41,7 +41,7 @@ EXPORT_SYMBOL(jiffies_64); extern unsigned long wall_jiffies; /* this needs a better home */ -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); /* change this if you have some constant time drift */ #define USECS_PER_JIFFY (1000000/HZ) @@ -56,16 +56,53 @@ static int dummy_set_rtc(void) */ int (*set_rtc)(void) = dummy_set_rtc; -static unsigned long dummy_gettimeoffset(void) +/* + * Get time offset based on IOCs timer. + * FIXME - if this is called with interrutps off, why the shennanigans + * below ? + */ +static unsigned long gettimeoffset(void) { - return 0; + unsigned int count1, count2, status; + long offset; + + ioc_writeb (0, IOC_T0LATCH); + barrier (); + count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); + barrier (); + status = ioc_readb(IOC_IRQREQA); + barrier (); + ioc_writeb (0, IOC_T0LATCH); + barrier (); + count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); + + offset = count2; + if (count2 < count1) { + /* + * We have not had an interrupt between reading count1 + * and count2. + */ + if (status & (1 << 5)) + offset -= LATCH; + } else if (count2 > count1) { + /* + * We have just had another interrupt between reading + * count1 and count2. + */ + offset -= LATCH; + } + + offset = (LATCH - offset) * (tick_nsec / 1000); + return (offset + LATCH/2) / LATCH; } /* - * hook for getting the time offset. Note that it is - * always called with interrupts disabled. + * Scheduler clock - returns current time in nanosec units. */ -unsigned long (*gettimeoffset)(void) = dummy_gettimeoffset; +unsigned long long sched_clock(void) +{ + return (unsigned long long)jiffies * (1000000000 / HZ); +} static unsigned long next_rtc_update; @@ -166,6 +203,9 @@ EXPORT_SYMBOL(do_settimeofday); static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif do_set_rtc(); //FIME - EVERY timer IRQ? profile_tick(CPU_PROFILING, regs); return IRQ_HANDLED; //FIXME - is this right? @@ -184,7 +224,10 @@ extern void ioctime_init(void); */ void __init time_init(void) { - ioctime_init(); + ioc_writeb(LATCH & 255, IOC_T0LTCHL); + ioc_writeb(LATCH >> 8, IOC_T0LTCHH); + ioc_writeb(0, IOC_T0GO); + setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/arch/arm26/kernel/traps.c b/arch/arm26/kernel/traps.c index f0a49fec0..f64f59022 100644 --- a/arch/arm26/kernel/traps.c +++ b/arch/arm26/kernel/traps.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/traps.c + * linux/arch/arm26/kernel/traps.c * * Copyright (C) 1995-2002 Russell King * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds @@ -10,9 +10,11 @@ * published by the Free Software Foundation. * * 'traps.c' handles hardware exceptions after we have saved some state in - * 'linux/arch/arm/lib/traps.S'. Mostly a debugging aid, but will probably + * 'linux/arch/arm26/lib/traps.S'. Mostly a debugging aid, but will probably * kill the offending process. */ + +#include #include #include #include @@ -28,7 +30,6 @@ #include #include -#include #include #include #include @@ -134,8 +135,6 @@ static void dump_instr(struct pt_regs *regs) dump_mem("Stack: ", sp, 8192+(unsigned long)tsk->thread_info); } -EXPORT_SYMBOL(dump_stack); - void dump_stack(void) { #ifdef CONFIG_DEBUG_ERRORS @@ -143,6 +142,8 @@ void dump_stack(void) #endif } +EXPORT_SYMBOL(dump_stack); + //FIXME - was a static fn void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) { @@ -170,7 +171,7 @@ void show_stack(struct task_struct *task, unsigned long *sp) { dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task->thread_info); } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); /* * This function is protected against re-entrancy. @@ -425,7 +426,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) return 0; case NR(usr26): - case NR(usr32): break; default: diff --git a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in index cbbda2766..ca61ec821 100644 --- a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in +++ b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in @@ -64,6 +64,7 @@ SECTIONS _text = .; /* Text and read-only data */ *(.text) SCHED_TEXT + LOCK_TEXT /* FIXME - borrowed from arm32 - check*/ *(.fixup) *(.gnu.warning) *(.rodata) @@ -91,9 +92,11 @@ SECTIONS _sdata = .; .data : { + . = ALIGN(8192); /* * first, the init thread union, aligned - * to an 8192 byte boundary. + * to an 8192 byte boundary. (see arm26/kernel/init_task.c) + * FIXME - sould this be 32K aligned on arm26? */ *(.init.task) diff --git a/arch/arm26/kernel/vmlinux-arm26.lds.in b/arch/arm26/kernel/vmlinux-arm26.lds.in index 128eb9195..d1d3418d7 100644 --- a/arch/arm26/kernel/vmlinux-arm26.lds.in +++ b/arch/arm26/kernel/vmlinux-arm26.lds.in @@ -65,6 +65,7 @@ SECTIONS _text = .; /* Text and read-only data */ *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) *(.rodata) @@ -90,7 +91,7 @@ SECTIONS .data : { /* * first, the init task union, aligned - * to an 8192 byte boundary. + * to an 8192 byte boundary. (see arm26/kernel/init_task.c) */ *(.init.task) diff --git a/arch/arm26/lib/Makefile b/arch/arm26/lib/Makefile index d05d6b0fd..6df2b793d 100644 --- a/arch/arm26/lib/Makefile +++ b/arch/arm26/lib/Makefile @@ -1,5 +1,5 @@ # -# linux/arch/arm/lib/Makefile +# linux/arch/arm26/lib/Makefile # # Copyright (C) 1995-2000 Russell King # @@ -7,15 +7,15 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ copy_page.o delay.o findbit.o memchr.o memcpy.o \ - memset.o memzero.o setbit.o \ - strchr.o strrchr.o testchangebit.o \ + memset.o memzero.o setbit.o \ + strchr.o strrchr.o testchangebit.o \ testclearbit.o testsetbit.o getuser.o \ putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ ucmpdi2.o udivdi3.o lib1funcs.o ecard.o io-acorn.o \ floppydma.o io-readsb.o io-writesb.o io-writesl.o \ - uaccess-kernel.o uaccess-user.o io-readsw-armv3.o \ - io-writesw-armv3.o io-readsl-armv3.o ecard.o \ - io-acorn.o floppydma.o + uaccess-kernel.o uaccess-user.o io-readsw.o \ + io-writesw.o io-readsl.o ecard.o io-acorn.o \ + floppydma.o lib-n := diff --git a/arch/arm26/lib/backtrace.S b/arch/arm26/lib/backtrace.S index 660c5b699..d793fe433 100644 --- a/arch/arm26/lib/backtrace.S +++ b/arch/arm26/lib/backtrace.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/backtrace.S + * linux/arch/arm26/lib/backtrace.S * * Copyright (C) 1995, 1996 Russell King * diff --git a/arch/arm26/lib/changebit.S b/arch/arm26/lib/changebit.S index 3af45cab7..1b6a077be 100644 --- a/arch/arm26/lib/changebit.S +++ b/arch/arm26/lib/changebit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/changebit.S + * linux/arch/arm26/lib/changebit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/lib/clearbit.S b/arch/arm26/lib/clearbit.S index 069a2ce41..0a895b0c7 100644 --- a/arch/arm26/lib/clearbit.S +++ b/arch/arm26/lib/clearbit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/clearbit.S + * linux/arch/arm26/lib/clearbit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/lib/copy_page.S b/arch/arm26/lib/copy_page.S index 0140cc380..2d79ee12e 100644 --- a/arch/arm26/lib/copy_page.S +++ b/arch/arm26/lib/copy_page.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/copypage.S + * linux/arch/arm26/lib/copypage.S * * Copyright (C) 1995-1999 Russell King * diff --git a/arch/arm26/lib/csumipv6.S b/arch/arm26/lib/csumipv6.S index 7065a20ee..62831155a 100644 --- a/arch/arm26/lib/csumipv6.S +++ b/arch/arm26/lib/csumipv6.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/csumipv6.S + * linux/arch/arm26/lib/csumipv6.S * * Copyright (C) 1995-1998 Russell King * diff --git a/arch/arm26/lib/csumpartial.S b/arch/arm26/lib/csumpartial.S index e6c946e71..e53e7109e 100644 --- a/arch/arm26/lib/csumpartial.S +++ b/arch/arm26/lib/csumpartial.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/csumpartial.S + * linux/arch/arm26/lib/csumpartial.S * * Copyright (C) 1995-1998 Russell King * diff --git a/arch/arm26/lib/csumpartialcopy.S b/arch/arm26/lib/csumpartialcopy.S index 990ee63b2..a1c4b5fdd 100644 --- a/arch/arm26/lib/csumpartialcopy.S +++ b/arch/arm26/lib/csumpartialcopy.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/csumpartialcopy.S + * linux/arch/arm26/lib/csumpartialcopy.S * * Copyright (C) 1995-1998 Russell King * diff --git a/arch/arm26/lib/csumpartialcopygeneric.S b/arch/arm26/lib/csumpartialcopygeneric.S index 65428f50e..5249c3ad1 100644 --- a/arch/arm26/lib/csumpartialcopygeneric.S +++ b/arch/arm26/lib/csumpartialcopygeneric.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/csumpartialcopygeneric.S + * linux/arch/arm26/lib/csumpartialcopygeneric.S * * Copyright (C) 1995-2001 Russell King * diff --git a/arch/arm26/lib/delay.S b/arch/arm26/lib/delay.S index 67cbd8697..66f2b68e1 100644 --- a/arch/arm26/lib/delay.S +++ b/arch/arm26/lib/delay.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/delay.S + * linux/arch/arm26/lib/delay.S * * Copyright (C) 1995, 1996 Russell King * diff --git a/arch/arm26/lib/ecard.S b/arch/arm26/lib/ecard.S index 000eb5f24..b4633150f 100644 --- a/arch/arm26/lib/ecard.S +++ b/arch/arm26/lib/ecard.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/ecard.S + * linux/arch/arm26/lib/ecard.S * * Copyright (C) 1995, 1996 Russell King * diff --git a/arch/arm26/lib/floppydma.S b/arch/arm26/lib/floppydma.S index 617150b1b..e99ebbb20 100644 --- a/arch/arm26/lib/floppydma.S +++ b/arch/arm26/lib/floppydma.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/floppydma.S + * linux/arch/arm26/lib/floppydma.S * * Copyright (C) 1995, 1996 Russell King * diff --git a/arch/arm26/lib/getuser.S b/arch/arm26/lib/getuser.S index cad19c773..e6d59b334 100644 --- a/arch/arm26/lib/getuser.S +++ b/arch/arm26/lib/getuser.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/getuser.S + * linux/arch/arm26/lib/getuser.S * * Copyright (C) 2001 Russell King * @@ -28,6 +28,7 @@ */ #include #include +#include .global __get_user_1 __get_user_1: @@ -98,7 +99,7 @@ __get_user_bad_8: mov r2, #0 __get_user_bad: mov r1, #0 - mov r0, #-14 + mov r0, #-EFAULT ldmfd sp!, {pc}^ .section __ex_table, "a" diff --git a/arch/arm26/lib/io-acorn.S b/arch/arm26/lib/io-acorn.S index 810d89dc4..f6c3e30b1 100644 --- a/arch/arm26/lib/io-acorn.S +++ b/arch/arm26/lib/io-acorn.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/io-acorn.S + * linux/arch/arm26/lib/io-acorn.S * * Copyright (C) 1995, 1996 Russell King * diff --git a/arch/arm26/lib/io-readsb.S b/arch/arm26/lib/io-readsb.S index 854138c41..4c4d99c05 100644 --- a/arch/arm26/lib/io-readsb.S +++ b/arch/arm26/lib/io-readsb.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/io-readsb.S + * linux/arch/arm26/lib/io-readsb.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/io-writesb.S b/arch/arm26/lib/io-writesb.S index 873b3697a..16251b4d5 100644 --- a/arch/arm26/lib/io-writesb.S +++ b/arch/arm26/lib/io-writesb.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/io-writesb.S + * linux/arch/arm26/lib/io-writesb.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/io-writesl.S b/arch/arm26/lib/io-writesl.S index 12092e256..4d6049b16 100644 --- a/arch/arm26/lib/io-writesl.S +++ b/arch/arm26/lib/io-writesl.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/io-writesl.S + * linux/arch/arm26/lib/io-writesl.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/memchr.S b/arch/arm26/lib/memchr.S index ac34fe55d..34e7c14c0 100644 --- a/arch/arm26/lib/memchr.S +++ b/arch/arm26/lib/memchr.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/memchr.S + * linux/arch/arm26/lib/memchr.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/memcpy.S b/arch/arm26/lib/memcpy.S index 50ec63192..3f719e412 100644 --- a/arch/arm26/lib/memcpy.S +++ b/arch/arm26/lib/memcpy.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/memcpy.S + * linux/arch/arm26/lib/memcpy.S * * Copyright (C) 1995-1999 Russell King * diff --git a/arch/arm26/lib/memset.S b/arch/arm26/lib/memset.S index a1795f599..aedec10b5 100644 --- a/arch/arm26/lib/memset.S +++ b/arch/arm26/lib/memset.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/memset.S + * linux/arch/arm26/lib/memset.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/memzero.S b/arch/arm26/lib/memzero.S index 51ccc6016..cc5bf6860 100644 --- a/arch/arm26/lib/memzero.S +++ b/arch/arm26/lib/memzero.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/memzero.S + * linux/arch/arm26/lib/memzero.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/putuser.S b/arch/arm26/lib/putuser.S index 90003c516..87588cbe4 100644 --- a/arch/arm26/lib/putuser.S +++ b/arch/arm26/lib/putuser.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/putuser.S + * linux/arch/arm26/lib/putuser.S * * Copyright (C) 2001 Russell King * @@ -28,6 +28,7 @@ */ #include #include +#include .global __put_user_1 __put_user_1: @@ -95,7 +96,7 @@ __put_user_8: ldmfd sp!, {pc}^ __put_user_bad: - mov r0, #-14 + mov r0, #-EFAULT mov pc, lr .section __ex_table, "a" diff --git a/arch/arm26/lib/setbit.S b/arch/arm26/lib/setbit.S index 8f337df5d..e180c1a1b 100644 --- a/arch/arm26/lib/setbit.S +++ b/arch/arm26/lib/setbit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/setbit.S + * linux/arch/arm26/lib/setbit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/lib/strchr.S b/arch/arm26/lib/strchr.S index 49b96bc02..ecfff21aa 100644 --- a/arch/arm26/lib/strchr.S +++ b/arch/arm26/lib/strchr.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/strchr.S + * linux/arch/arm26/lib/strchr.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/strrchr.S b/arch/arm26/lib/strrchr.S index fa923f026..db43b28e7 100644 --- a/arch/arm26/lib/strrchr.S +++ b/arch/arm26/lib/strrchr.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/strrchr.S + * linux/arch/arm26/lib/strrchr.S * * Copyright (C) 1995-2000 Russell King * diff --git a/arch/arm26/lib/testchangebit.S b/arch/arm26/lib/testchangebit.S index 4aba4676b..17049a2d9 100644 --- a/arch/arm26/lib/testchangebit.S +++ b/arch/arm26/lib/testchangebit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/testchangebit.S + * linux/arch/arm26/lib/testchangebit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/lib/testclearbit.S b/arch/arm26/lib/testclearbit.S index e07c5bd24..2506bd743 100644 --- a/arch/arm26/lib/testclearbit.S +++ b/arch/arm26/lib/testclearbit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/testclearbit.S + * linux/arch/arm26/lib/testclearbit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/lib/testsetbit.S b/arch/arm26/lib/testsetbit.S index a570fc74c..f827de64b 100644 --- a/arch/arm26/lib/testsetbit.S +++ b/arch/arm26/lib/testsetbit.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/testsetbit.S + * linux/arch/arm26/lib/testsetbit.S * * Copyright (C) 1995-1996 Russell King * diff --git a/arch/arm26/machine/Makefile b/arch/arm26/machine/Makefile index 84642feba..86ea97cc0 100644 --- a/arch/arm26/machine/Makefile +++ b/arch/arm26/machine/Makefile @@ -4,9 +4,5 @@ # Object file lists. -obj-y := dma.o irq.o oldlatches.o \ - small_page.o +obj-y := dma.o irq.o latches.o -extra-y := head.o - -AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) diff --git a/arch/arm26/machine/dma.c b/arch/arm26/machine/dma.c index 44090c40c..cbc7c61d5 100644 --- a/arch/arm26/machine/dma.c +++ b/arch/arm26/machine/dma.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/kernel/dma-arc.c + * linux/arch/arm26/kernel/dma.c * * Copyright (C) 1998-1999 Dave Gilbert / Russell King * Copyright (C) 2003 Ian Molton @@ -47,7 +47,7 @@ static void arc_floppy_data_enable_dma(dmach_t channel, dma_t *dma) &fdc1772_dma_read_end - &fdc1772_dma_read); fdc1772_setupdma(dma->buf.length, dma->buf.__address); /* Sets data pointer up */ enable_fiq(FIQ_FLOPPYDATA); - loacl_irq_restore(flags); + local_irq_restore(flags); } break; diff --git a/arch/arm26/machine/irq.c b/arch/arm26/machine/irq.c index 158a7d29e..4361863f7 100644 --- a/arch/arm26/machine/irq.c +++ b/arch/arm26/machine/irq.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mach-arc/irq.c + * linux/arch/arm26/mach-arc/irq.c * * Copyright (C) 1996 Russell King * diff --git a/arch/arm26/mm/Makefile b/arch/arm26/mm/Makefile index feec2212d..a8fb166d5 100644 --- a/arch/arm26/mm/Makefile +++ b/arch/arm26/mm/Makefile @@ -2,4 +2,5 @@ # Makefile for the linux arm26-specific parts of the memory manager. # -obj-y := init.o extable.o proc-funcs.o mm-memc.o fault.o +obj-y := init.o extable.o proc-funcs.o memc.o fault.o \ + small_page.o diff --git a/arch/arm26/mm/extable.c b/arch/arm26/mm/extable.c index 72644dd07..2d9f5b5a7 100644 --- a/arch/arm26/mm/extable.c +++ b/arch/arm26/mm/extable.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mm/extable.c + * linux/arch/arm26/mm/extable.c */ #include @@ -11,6 +11,12 @@ int fixup_exception(struct pt_regs *regs) const struct exception_table_entry *fixup; fixup = search_exception_tables(instruction_pointer(regs)); + + /* + * The kernel runs in SVC mode - make sure we keep running in SVC mode + * by frobbing the PSR appropriately (PSR and PC are in the same reg. + * on ARM26) + */ if (fixup) regs->ARM_pc = fixup->fixup | PSR_I_BIT | MODE_SVC26; diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c index beef99b48..dacca8bb7 100644 --- a/arch/arm26/mm/fault.c +++ b/arch/arm26/mm/fault.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mm/fault-common.c + * linux/arch/arm26/mm/fault.c * * Copyright (C) 1995 Linus Torvalds * Modifications for ARM processor (c) 1995-2001 Russell King @@ -212,7 +212,6 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) tsk = current; mm = tsk->mm; - printk("do_page_fault: pid: %d %08x\n", tsk->pid, addr); /* * If we're in an interrupt or have no user * context, we must not take the fault.. diff --git a/arch/arm26/mm/init.c b/arch/arm26/mm/init.c index 17f7dc3e9..1dba6bf03 100644 --- a/arch/arm26/mm/init.c +++ b/arch/arm26/mm/init.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mm/init.c + * linux/arch/arm26/mm/init.c * * Copyright (C) 1995-2002 Russell King * @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -84,7 +83,7 @@ void show_mem(void) else if (!page_count(page)) free++; else - shared += atomic_read(&page->count) - 1; + shared += page_count(page) - 1; page++; } while (page < end); @@ -156,7 +155,8 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np) { unsigned int memend_pfn = 0; - numnodes = 1; + nodes_clear(node_online_map); + node_set_online(0); np->bootmap_pages = 0; diff --git a/arch/arm26/mm/proc-funcs.S b/arch/arm26/mm/proc-funcs.S index be34cb854..c3d4cd3f4 100644 --- a/arch/arm26/mm/proc-funcs.S +++ b/arch/arm26/mm/proc-funcs.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mm/proc-arm2,3.S + * linux/arch/arm26/mm/proc-arm2,3.S * * Copyright (C) 1997-1999 Russell King * diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index a8e4c25c7..112ba2771 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -20,6 +20,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config CRIS bool default y diff --git a/arch/cris/Kconfig.debug b/arch/cris/Kconfig.debug index 9864aade2..f42918bf2 100644 --- a/arch/cris/Kconfig.debug +++ b/arch/cris/Kconfig.debug @@ -1,15 +1,11 @@ menu "Kernel hacking" -source "lib/Kconfig.debug" - #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC -config PROFILE +config PROFILING bool "Kernel profiling support" -config PROFILE_SHIFT - int "Profile shift count" - depends on PROFILE - default "2" +config SYSTEM_PROFILER + bool "System profiling support" config ETRAX_KGDB bool "Use kernel GDB debugger" @@ -25,4 +21,21 @@ config ETRAX_KGDB didn't before). The kernel halts when it boots, waiting for gdb if this option is turned on! + +config DEBUG_INFO + bool "Compile the kernel with debug info" + help + If you say Y here the resulting kernel image will include + debugging info resulting in a larger kernel image. + Say Y here only if you plan to use gdb to debug the kernel. + If you don't debug the kernel, you can say N. + +config FRAME_POINTER + bool "Compile the kernel with frame pointers" + help + If you say Y here the resulting kernel image will be slightly larger + and slower, but it will give very useful debugging information. + If you don't debug the kernel, you can say N, but we may not be able + to solve problems without frame pointers. + endmenu diff --git a/arch/cris/Makefile b/arch/cris/Makefile index 0c6944c7c..9d28fa856 100644 --- a/arch/cris/Makefile +++ b/arch/cris/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.20 2004/05/14 14:35:58 orjanf Exp $ +# $Id: Makefile,v 1.23 2004/10/19 13:07:34 starvik Exp $ # cris/Makefile # # This file is included by the global makefile so that you can add your own @@ -80,7 +80,7 @@ compressed: zImage archmrproper: archclean: $(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot - rm -f timage vmlinux.bin cramfs.img + rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img rm -rf $(LD_SCRIPT).tmp prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \ diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig index 482ac6659..748374f25 100644 --- a/arch/cris/arch-v10/drivers/Kconfig +++ b/arch/cris/arch-v10/drivers/Kconfig @@ -549,44 +549,17 @@ config ETRAX_RS485_DISABLE_RECEIVER config ETRAX_IDE bool "ATA/IDE support" + select IDE + select BLK_DEV_IDE + select BLK_DEV_IDEDISK + select BLK_DEV_IDECD + select BLK_DEV_IDEDMA + select DMA_NONPCI help Enable this to get support for ATA/IDE. - You can't use parallell ports or SCSI ports + You can't use paralell ports or SCSI ports at the same time. -# here we should add the CONFIG_'s necessary to enable the basic -# general ide drivers so the common case does not need to go -# into that config submenu. enable disk and CD support. others -# need to go fiddle in the submenu.. -config IDE - tristate - depends on ETRAX_IDE - default y - -config BLK_DEV_IDE - tristate - depends on ETRAX_IDE - default y - -config BLK_DEV_IDEDISK - tristate - depends on ETRAX_IDE - default y - -config BLK_DEV_IDECD - tristate - depends on ETRAX_IDE - default y - -config BLK_DEV_IDEDMA - bool - depends on ETRAX_IDE - default y - -config DMA_NONPCI - bool - depends on ETRAX_IDE - default y config ETRAX_IDE_DELAY int "Delay for drives to regain consciousness" diff --git a/arch/cris/arch-v10/drivers/Makefile b/arch/cris/arch-v10/drivers/Makefile index 7036fc050..20258e36f 100644 --- a/arch/cris/arch-v10/drivers/Makefile +++ b/arch/cris/arch-v10/drivers/Makefile @@ -2,15 +2,11 @@ # Makefile for Etrax-specific drivers # -obj-$(CONFIG_ETRAX_ETHERNET) += ethernet.o -obj-$(CONFIG_ETRAX_SERIAL) += serial.o obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o obj-$(CONFIG_ETRAX_I2C) += i2c.o obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o obj-$(CONFIG_ETRAX_GPIO) += gpio.o obj-$(CONFIG_ETRAX_DS1302) += ds1302.o obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o -obj-$(CONFIG_ETRAX_IDE) += ide.o -obj-$(CONFIG_ETRAX_USB_HOST) += usb-host.o diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c index 3277019e3..fb7d4855e 100644 --- a/arch/cris/arch-v10/drivers/axisflashmap.c +++ b/arch/cris/arch-v10/drivers/axisflashmap.c @@ -11,6 +11,9 @@ * partition split defined below. * * $Log: axisflashmap.c,v $ + * Revision 1.10 2004/08/16 12:37:22 starvik + * Merge of Linux 2.6.8 + * * Revision 1.8 2004/05/14 07:58:03 starvik * Merge of changes from 2.4 * @@ -153,6 +156,14 @@ #define FLASH_CACHED_ADDR KSEG_F #endif +#if CONFIG_ETRAX_FLASH_BUSWIDTH==1 +#define flash_data __u8 +#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2 +#define flash_data __u16 +#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4 +#define flash_data __u16 +#endif + /* From head.S */ extern unsigned long romfs_start, romfs_length, romfs_in_flash; @@ -161,19 +172,11 @@ struct mtd_info* axisflash_mtd = NULL; /* Map driver functions. */ -static __u8 flash_read8(struct map_info *map, unsigned long ofs) -{ - return *(__u8 *)(map->map_priv_1 + ofs); -} - -static __u16 flash_read16(struct map_info *map, unsigned long ofs) +static map_word flash_read(struct map_info *map, unsigned long ofs) { - return *(__u16 *)(map->map_priv_1 + ofs); -} - -static __u32 flash_read32(struct map_info *map, unsigned long ofs) -{ - return *(volatile unsigned int *)(map->map_priv_1 + ofs); + map_word tmp; + tmp.x[0] = *(flash_data *)(map->map_priv_1 + ofs); + return tmp; } static void flash_copy_from(struct map_info *map, void *to, @@ -182,19 +185,9 @@ static void flash_copy_from(struct map_info *map, void *to, memcpy(to, (void *)(map->map_priv_1 + from), len); } -static void flash_write8(struct map_info *map, __u8 d, unsigned long adr) -{ - *(__u8 *)(map->map_priv_1 + adr) = d; -} - -static void flash_write16(struct map_info *map, __u16 d, unsigned long adr) -{ - *(__u16 *)(map->map_priv_1 + adr) = d; -} - -static void flash_write32(struct map_info *map, __u32 d, unsigned long adr) +static void flash_write(struct map_info *map, map_word d, unsigned long adr) { - *(__u32 *)(map->map_priv_1 + adr) = d; + *(flash_data *)(map->map_priv_1 + adr) = (flash_data)d.x[0]; } /* @@ -215,14 +208,10 @@ static void flash_write32(struct map_info *map, __u32 d, unsigned long adr) static struct map_info map_cse0 = { .name = "cse0", .size = MEM_CSE0_SIZE, - .buswidth = CONFIG_ETRAX_FLASH_BUSWIDTH, - .read8 = flash_read8, - .read16 = flash_read16, - .read32 = flash_read32, + .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH, + .read = flash_read, .copy_from = flash_copy_from, - .write8 = flash_write8, - .write16 = flash_write16, - .write32 = flash_write32, + .write = flash_write, .map_priv_1 = FLASH_UNCACHED_ADDR }; @@ -235,14 +224,10 @@ static struct map_info map_cse0 = { static struct map_info map_cse1 = { .name = "cse1", .size = MEM_CSE1_SIZE, - .buswidth = CONFIG_ETRAX_FLASH_BUSWIDTH, - .read8 = flash_read8, - .read16 = flash_read16, - .read32 = flash_read32, + .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH, + .read = flash_read, .copy_from = flash_copy_from, - .write8 = flash_write8, - .write16 = flash_write16, - .write32 = flash_write32, + .write = flash_write, .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE }; diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 78a200afa..fba530fcf 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c @@ -7,6 +7,9 @@ *! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init *! *! $Log: ds1302.c,v $ +*! Revision 1.14 2004/08/24 06:48:43 starvik +*! Whitespace cleanup +*! *! Revision 1.13 2004/05/28 09:26:59 starvik *! Modified I2C initialization to work in 2.6. *! @@ -123,7 +126,7 @@ *! *! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN *! -*! $Id: ds1302.c,v 1.13 2004/05/28 09:26:59 starvik Exp $ +*! $Id: ds1302.c,v 1.14 2004/08/24 06:48:43 starvik Exp $ *! *!***************************************************************************/ diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index 167291073..50548a234 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c @@ -1,4 +1,4 @@ -/* $Id: gpio.c,v 1.11 2004/05/14 07:58:03 starvik Exp $ +/* $Id: gpio.c,v 1.12 2004/08/24 07:19:59 starvik Exp $ * * Etrax general port I/O device * @@ -9,6 +9,9 @@ * Johan Adolfsson (read/set directions, write, port G) * * $Log: gpio.c,v $ + * Revision 1.12 2004/08/24 07:19:59 starvik + * Whitespace cleanup + * * Revision 1.11 2004/05/14 07:58:03 starvik * Merge of changes from 2.4 * diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c index 52a299d89..8bbe233ba 100644 --- a/arch/cris/arch-v10/drivers/i2c.c +++ b/arch/cris/arch-v10/drivers/i2c.c @@ -12,6 +12,12 @@ *! don't use PB_I2C if DS1302 uses same bits, *! use PB. *! $Log: i2c.c,v $ +*! Revision 1.9 2004/08/24 06:49:14 starvik +*! Whitespace cleanup +*! +*! Revision 1.8 2004/06/08 08:48:26 starvik +*! Removed unused code +*! *! Revision 1.7 2004/05/28 09:26:59 starvik *! Modified I2C initialization to work in 2.6. *! @@ -69,7 +75,7 @@ *! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN *! *!***************************************************************************/ -/* $Id: i2c.c,v 1.7 2004/05/28 09:26:59 starvik Exp $ */ +/* $Id: i2c.c,v 1.9 2004/08/24 06:49:14 starvik Exp $ */ /****************** INCLUDE FILES SECTION ***********************************/ @@ -110,14 +116,6 @@ static const char i2c_name[] = "i2c"; #define I2C_DATA_HIGH 1 #define I2C_DATA_LOW 0 -#if 0 -/* TODO: fix this so the CONFIG_ETRAX_I2C_USES... is set in Config.in instead */ -#if defined(CONFIG_DS1302) && (CONFIG_DS1302_SDABIT==0) && \ - (CONFIG_DS1302_SCLBIT == 1) -#define CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C -#endif -#endif - #ifdef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C /* Use PB and not PB_I2C */ #ifndef CONFIG_ETRAX_I2C_DATA_PORT @@ -441,7 +439,7 @@ i2c_sendack(void) */ i2c_data(I2C_DATA_HIGH); i2c_delay(CLOCK_LOW_TIME); - + i2c_dir_in(); } diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 8cf5f620e..b3dfdf7b8 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c @@ -15,7 +15,7 @@ * * Author: Tobias Anderberg . * - * $Id: pcf8563.c,v 1.4 2004/05/28 09:26:59 starvik Exp $ + * $Id: pcf8563.c,v 1.8 2004/08/24 06:42:51 starvik Exp $ */ #include @@ -40,7 +40,7 @@ #define PCF8563_MAJOR 121 /* Local major number. */ #define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */ #define PCF8563_NAME "PCF8563" -#define DRIVER_VERSION "$Revision: 1.4 $" +#define DRIVER_VERSION "$Revision: 1.8 $" /* I2C bus slave registers. */ #define RTC_I2C_READ 0xa3 diff --git a/arch/cris/arch-v10/kernel/Makefile b/arch/cris/arch-v10/kernel/Makefile index 20a56080a..52761603b 100644 --- a/arch/cris/arch-v10/kernel/Makefile +++ b/arch/cris/arch-v10/kernel/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2003/07/04 12:57:13 tobiasa Exp $ +# $Id: Makefile,v 1.5 2004/06/02 08:24:38 starvik Exp $ # # Makefile for the linux kernel. # @@ -11,6 +11,7 @@ obj-y := entry.o traps.o shadows.o debugport.o irq.o \ obj-$(CONFIG_ETRAX_KGDB) += kgdb.o obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o +obj-$(CONFIG_MODULES) += crisksyms.o clean: diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c index d8f20d79f..6cf069e5e 100644 --- a/arch/cris/arch-v10/kernel/debugport.c +++ b/arch/cris/arch-v10/kernel/debugport.c @@ -12,6 +12,21 @@ * init_etrax_debug() * * $Log: debugport.c,v $ + * Revision 1.19 2004/10/21 07:26:16 starvik + * Made it possible to specify console settings on kernel command line. + * + * Revision 1.18 2004/10/19 13:07:37 starvik + * Merge of Linux 2.6.9 + * + * Revision 1.17 2004/09/29 10:33:46 starvik + * Resolved a dealock when printing debug from kernel. + * + * Revision 1.16 2004/08/24 06:12:19 starvik + * Whitespace cleanup + * + * Revision 1.15 2004/08/16 12:37:19 starvik + * Merge of Linux 2.6.8 + * * Revision 1.14 2004/05/17 13:11:29 starvik * Disable DMA until real serial driver is up * @@ -73,111 +88,275 @@ #include #include /* Get SIMCOUT. */ -/* Which serial-port is our debug port ? */ - -#if defined(CONFIG_ETRAX_DEBUG_PORT0) || defined(CONFIG_ETRAX_DEBUG_PORT_NULL) -#define DEBUG_PORT_IDX 0 -#define DEBUG_OCMD R_DMA_CH6_CMD -#define DEBUG_FIRST R_DMA_CH6_FIRST -#define DEBUG_OCLRINT R_DMA_CH6_CLR_INTR -#define DEBUG_STATUS R_DMA_CH6_STATUS -#define DEBUG_READ R_SERIAL0_READ -#define DEBUG_WRITE R_SERIAL0_TR_DATA -#define DEBUG_TR_CTRL R_SERIAL0_TR_CTRL -#define DEBUG_REC_CTRL R_SERIAL0_REC_CTRL -#define DEBUG_IRQ IO_STATE(R_IRQ_MASK1_SET, ser0_data, set) -#define DEBUG_DMA_IRQ_CLR IO_STATE(R_IRQ_MASK2_CLR, dma6_descr, clr) -#endif +struct dbg_port +{ + unsigned int index; + const volatile unsigned* read; + volatile char* write; + volatile unsigned* xoff; + volatile char* baud; + volatile char* tr_ctrl; + volatile char* rec_ctrl; + unsigned long irq; + unsigned int started; + unsigned long baudrate; + unsigned char parity; + unsigned int bits; +}; -#ifdef CONFIG_ETRAX_DEBUG_PORT1 -#define DEBUG_PORT_IDX 1 -#define DEBUG_OCMD R_DMA_CH8_CMD -#define DEBUG_FIRST R_DMA_CH8_FIRST -#define DEBUG_OCLRINT R_DMA_CH8_CLR_INTR -#define DEBUG_STATUS R_DMA_CH8_STATUS -#define DEBUG_READ R_SERIAL1_READ -#define DEBUG_WRITE R_SERIAL1_TR_DATA -#define DEBUG_TR_CTRL R_SERIAL1_TR_CTRL -#define DEBUG_REC_CTRL R_SERIAL1_REC_CTRL -#define DEBUG_IRQ IO_STATE(R_IRQ_MASK1_SET, ser1_data, set) -#define DEBUG_DMA_IRQ_CLR IO_STATE(R_IRQ_MASK2_CLR, dma8_descr, clr) -#endif +struct dbg_port ports[]= +{ + { + 0, + R_SERIAL0_READ, + R_SERIAL0_TR_DATA, + R_SERIAL0_XOFF, + R_SERIAL0_BAUD, + R_SERIAL0_TR_CTRL, + R_SERIAL0_REC_CTRL, + IO_STATE(R_IRQ_MASK1_SET, ser0_data, set) + }, + { + 1, + R_SERIAL1_READ, + R_SERIAL1_TR_DATA, + R_SERIAL1_XOFF, + R_SERIAL1_BAUD, + R_SERIAL1_TR_CTRL, + R_SERIAL1_REC_CTRL, + IO_STATE(R_IRQ_MASK1_SET, ser1_data, set) + }, + { + 2, + R_SERIAL2_READ, + R_SERIAL2_TR_DATA, + R_SERIAL2_XOFF, + R_SERIAL2_BAUD, + R_SERIAL2_TR_CTRL, + R_SERIAL2_REC_CTRL, + IO_STATE(R_IRQ_MASK1_SET, ser2_data, set) + }, + { + 3, + R_SERIAL3_READ, + R_SERIAL3_TR_DATA, + R_SERIAL3_XOFF, + R_SERIAL3_BAUD, + R_SERIAL3_TR_CTRL, + R_SERIAL3_REC_CTRL, + IO_STATE(R_IRQ_MASK1_SET, ser3_data, set) + } +}; -#ifdef CONFIG_ETRAX_DEBUG_PORT2 -#define DEBUG_PORT_IDX 2 -#define DEBUG_OCMD R_DMA_CH2_CMD -#define DEBUG_FIRST R_DMA_CH2_FIRST -#define DEBUG_OCLRINT R_DMA_CH2_CLR_INTR -#define DEBUG_STATUS R_DMA_CH2_STATUS -#define DEBUG_READ R_SERIAL2_READ -#define DEBUG_WRITE R_SERIAL2_TR_DATA -#define DEBUG_TR_CTRL R_SERIAL2_TR_CTRL -#define DEBUG_REC_CTRL R_SERIAL2_REC_CTRL -#define DEBUG_IRQ IO_STATE(R_IRQ_MASK1_SET, ser2_data, set) -#define DEBUG_DMA_IRQ_CLR IO_STATE(R_IRQ_MASK2_CLR, dma2_descr, clr) -#endif +static struct tty_driver *serial_driver; -#ifdef CONFIG_ETRAX_DEBUG_PORT3 -#define DEBUG_PORT_IDX 3 -#define DEBUG_OCMD R_DMA_CH4_CMD -#define DEBUG_FIRST R_DMA_CH4_FIRST -#define DEBUG_OCLRINT R_DMA_CH4_CLR_INTR -#define DEBUG_STATUS R_DMA_CH4_STATUS -#define DEBUG_READ R_SERIAL3_READ -#define DEBUG_WRITE R_SERIAL3_TR_DATA -#define DEBUG_TR_CTRL R_SERIAL3_TR_CTRL -#define DEBUG_REC_CTRL R_SERIAL3_REC_CTRL -#define DEBUG_IRQ IO_STATE(R_IRQ_MASK1_SET, ser3_data, set) -#define DEBUG_DMA_IRQ_CLR IO_STATE(R_IRQ_MASK2_CLR, dma4_descr, clr) +struct dbg_port* port = +#if defined(CONFIG_ETRAX_DEBUG_PORT0) + &ports[0]; +#elif defined(CONFIG_ETRAX_DEBUG_PORT1) + &ports[1]; +#elif defined(CONFIG_ETRAX_DEBUG_PORT2) + &ports[2]; +#elif defined(CONFIG_ETRAX_DEBUG_PORT3) + &ports[3]; +#else + NULL; #endif +/* Used by serial.c to register a debug_write_function so that the normal + * serial driver is used for kernel debug output + */ +typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len); -#define MIN_SIZE 32 /* Size that triggers the FIFO to flush characters to interface */ +debugport_write_function debug_write_function = NULL; -static struct tty_driver *serial_driver; +static void +start_port(void) +{ + unsigned long rec_ctrl = 0; + unsigned long tr_ctrl = 0; -typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len); + if (!port) + return; -debugport_write_function debug_write_function = NULL; + if (port->started) + return; + port->started = 1; + + if (port->index == 0) + { + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma6); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused); + } + else if (port->index == 1) + { + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma8); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb); + } + else if (port->index == 2) + { + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma2); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0); + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma3); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma3, par0); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, ser2, select); + } + else + { + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma4); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1); + genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma5); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma5, par1); + genconfig_shadow |= IO_STATE(R_GEN_CONFIG, ser3, select); + } + + *R_GEN_CONFIG = genconfig_shadow; + + *port->xoff = + IO_STATE(R_SERIAL0_XOFF, tx_stop, enable) | + IO_STATE(R_SERIAL0_XOFF, auto_xoff, disable) | + IO_FIELD(R_SERIAL0_XOFF, xoff_char, 0); + + switch (port->baudrate) + { + case 0: + case 115200: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz); + break; + case 1200: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c1200Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c1200Hz); + break; + case 2400: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c2400Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c2400Hz); + break; + case 4800: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c4800Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c4800Hz); + break; + case 9600: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c9600Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c9600Hz); + break; + case 19200: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c19k2Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c19k2Hz); + break; + case 38400: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c38k4Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c38k4Hz); + break; + case 57600: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c57k6Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c57k6Hz); + break; + default: + *port->baud = + IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) | + IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz); + break; + } + + if (port->parity == 'E') { + rec_ctrl = + IO_STATE(R_SERIAL0_REC_CTRL, rec_par, even) | + IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable); + tr_ctrl = + IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) | + IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, enable); + } else if (port->parity == 'O') { + rec_ctrl = + IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd) | + IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable); + tr_ctrl = + IO_STATE(R_SERIAL0_TR_CTRL, tr_par, odd) | + IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, enable); + } else { + rec_ctrl = + IO_STATE(R_SERIAL0_REC_CTRL, rec_par, even) | + IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, disable); + tr_ctrl = + IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) | + IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, disable); + } + + if (port->bits == 7) + { + rec_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_bitnr, rec_7bit); + tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_7bit); + } + else + { + rec_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_bitnr, rec_8bit); + tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_8bit); + } + + *port->rec_ctrl = + IO_STATE(R_SERIAL0_REC_CTRL, dma_err, stop) | + IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable) | + IO_STATE(R_SERIAL0_REC_CTRL, rts_, active) | + IO_STATE(R_SERIAL0_REC_CTRL, sampling, middle) | + IO_STATE(R_SERIAL0_REC_CTRL, rec_stick_par, normal) | + rec_ctrl; + + *port->tr_ctrl = + IO_FIELD(R_SERIAL0_TR_CTRL, txd, 0) | + IO_STATE(R_SERIAL0_TR_CTRL, tr_enable, enable) | + IO_STATE(R_SERIAL0_TR_CTRL, auto_cts, disabled) | + IO_STATE(R_SERIAL0_TR_CTRL, stop_bits, one_bit) | + IO_STATE(R_SERIAL0_TR_CTRL, tr_stick_par, normal) | + tr_ctrl; +} static void console_write_direct(struct console *co, const char *buf, unsigned int len) { int i; + unsigned long flags; + local_irq_save(flags); /* Send data */ for (i = 0; i < len; i++) { /* Wait until transmitter is ready and send.*/ - while(!(*DEBUG_READ & IO_MASK(R_SERIAL0_READ, tr_ready))); - *DEBUG_WRITE = buf[i]; + while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready))) + ; + *port->write = buf[i]; } + local_irq_restore(flags); } -static void +static void console_write(struct console *co, const char *buf, unsigned int len) { - unsigned long flags; -#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL - /* no debug printout at all */ - return; -#endif + if (!port) + return; #ifdef CONFIG_SVINTO_SIM /* no use to simulate the serial debug output */ - SIMCOUT(buf,len); + SIMCOUT(buf, len); return; #endif + start_port(); + #ifdef CONFIG_ETRAX_KGDB /* kgdb needs to output debug info using the gdb protocol */ putDebugString(buf, len); return; #endif - local_irq_save(flags); if (debug_write_function) - if (debug_write_function(co->index, buf, len)) - return; - console_write_direct(co, buf, len); - local_irq_restore(flags); + debug_write_function(co->index, buf, len); + else + console_write_direct(co, buf, len); } /* legacy function */ @@ -194,10 +373,10 @@ int getDebugChar(void) { unsigned long readval; - + do { - readval = *DEBUG_READ; - } while(!(readval & IO_MASK(R_SERIAL0_READ, data_avail))); + readval = *port->read; + } while (!(readval & IO_MASK(R_SERIAL0_READ, data_avail))); return (readval & IO_MASK(R_SERIAL0_READ, data_in)); } @@ -207,9 +386,9 @@ getDebugChar(void) void putDebugChar(int val) { - while(!(*DEBUG_READ & IO_MASK(R_SERIAL0_READ, tr_ready))) ; -; - *DEBUG_WRITE = val; + while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready))) + ; + *port->write = val; } /* Enable irq for receiving chars on the debug port, used by kgdb */ @@ -217,68 +396,127 @@ putDebugChar(int val) void enableDebugIRQ(void) { - *R_IRQ_MASK1_SET = DEBUG_IRQ; + *R_IRQ_MASK1_SET = port->irq; /* use R_VECT_MASK directly, since we really bypass Linux normal * IRQ handling in kgdb anyway, we don't need to use enable_irq */ *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, serial, set); - *DEBUG_REC_CTRL = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable); + *port->rec_ctrl = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable); } static struct tty_driver* -console_device(struct console *c, int *index) +etrax_console_device(struct console* co, int *index) { - *index = c->index; return serial_driver; } -static int __init +static int __init console_setup(struct console *co, char *options) { - return 0; + char* s; + + if (options) { + port = &ports[co->index]; + port->baudrate = 115200; + port->parity = 'N'; + port->bits = 8; + port->baudrate = simple_strtoul(options, NULL, 10); + s = options; + while(*s >= '0' && *s <= '9') + s++; + if (*s) port->parity = *s++; + if (*s) port->bits = *s++ - '0'; + port->started = 0; + start_port(); + } + return 0; } static struct console sercons = { - .name = "ttyS", - .write = console_write, - .read = NULL, - .device = console_device, - .unblank = NULL, - .setup = console_setup, - .flags = CON_PRINTBUFFER, - .index = DEBUG_PORT_IDX, - .cflag = 0, - .next = NULL + name : "ttyS", + write: console_write, + read : NULL, + device : etrax_console_device, + unblank : NULL, + setup : console_setup, + flags : CON_PRINTBUFFER, + index : -1, + cflag : 0, + next : NULL +}; +static struct console sercons0 = { + name : "ttyS", + write: console_write, + read : NULL, + device : etrax_console_device, + unblank : NULL, + setup : console_setup, + flags : CON_PRINTBUFFER, + index : 0, + cflag : 0, + next : NULL }; +static struct console sercons1 = { + name : "ttyS", + write: console_write, + read : NULL, + device : etrax_console_device, + unblank : NULL, + setup : console_setup, + flags : CON_PRINTBUFFER, + index : 1, + cflag : 0, + next : NULL +}; +static struct console sercons2 = { + name : "ttyS", + write: console_write, + read : NULL, + device : etrax_console_device, + unblank : NULL, + setup : console_setup, + flags : CON_PRINTBUFFER, + index : 2, + cflag : 0, + next : NULL +}; +static struct console sercons3 = { + name : "ttyS", + write: console_write, + read : NULL, + device : etrax_console_device, + unblank : NULL, + setup : console_setup, + flags : CON_PRINTBUFFER, + index : 3, + cflag : 0, + next : NULL +}; /* * Register console (for printk's etc) */ -void __init +int __init init_etrax_debug(void) { -#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL - return; -#endif - -#if DEBUG_PORT_IDX == 0 - genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma6); - genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused); -#elif DEBUG_PORT_IDX == 1 - genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma8); - genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb); -#elif DEBUG_PORT_IDX == 2 - genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma2); - genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0); -#elif DEBUG_PORT_IDX == 3 - genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma4); - genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1); -#endif - *R_GEN_CONFIG = genconfig_shadow; - - register_console(&sercons); + static int first = 1; + + if (!first) { + if (!port) { + register_console(&sercons0); + register_console(&sercons1); + register_console(&sercons2); + register_console(&sercons3); + unregister_console(&sercons); + } + return 0; + } + first = 0; + if (port) + register_console(&sercons); + return 0; } int __init @@ -289,3 +527,5 @@ init_console(void) return -ENOMEM; return 0; } + +__initcall(init_etrax_debug); diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index ddd947d1c..1bc44f481 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.18 2004/05/11 12:28:25 starvik Exp $ +/* $Id: entry.S,v 1.23 2004/10/19 13:07:37 starvik Exp $ * * linux/arch/cris/entry.S * @@ -7,6 +7,23 @@ * Authors: Bjorn Wesen (bjornw@axis.com) * * $Log: entry.S,v $ + * Revision 1.23 2004/10/19 13:07:37 starvik + * Merge of Linux 2.6.9 + * + * Revision 1.22 2004/06/21 10:29:55 starvik + * Merge of Linux 2.6.7 + * + * Revision 1.21 2004/06/09 05:30:27 starvik + * Clean up multiple interrupt handling. + * Prevent interrupts from interrupting each other. + * Handle all active interrupts. + * + * Revision 1.20 2004/06/08 08:55:32 starvik + * Removed unused code + * + * Revision 1.19 2004/06/04 11:56:15 starvik + * Implemented page table lookup for refills in assembler for improved performance. + * * Revision 1.18 2004/05/11 12:28:25 starvik * Merge of Linux 2.6.6 * @@ -238,7 +255,9 @@ #include #include #include - +#include +#include + ;; functions exported from this file .globl system_call @@ -539,11 +558,63 @@ resume: ;; It needs to stack the CPU status and overall is different ;; from the other interrupt handlers. -mmu_bus_fault: - sbfs [$sp=$sp-16] ; push the internal CPU status +mmu_bus_fault: + ;; For refills we try to do a quick page table lookup. If it is + ;; a real fault we let the mm subsystem handle it. + ;; the first longword in the sbfs frame was the interrupted PC ;; which fits nicely with the "IRP" slot in pt_regs normally used to - ;; contain the return address. used by Oops to print kernel errors.. + ;; contain the return address. used by Oops to print kernel errors. + sbfs [$sp=$sp-16] ; push the internal CPU status + push $dccr + di + subq 2*4, $sp + movem $r1, [$sp] + move.d [R_MMU_CAUSE], $r1 + ;; ETRAX 100LX TR89 bugfix: if the second half of an unaligned + ;; write causes a MMU-fault, it will not be restarted correctly. + ;; This could happen if a write crosses a page-boundary and the + ;; second page is not yet COW'ed or even loaded. The workaround + ;; is to clear the unaligned bit in the CPU status record, so + ;; that the CPU will rerun both the first and second halves of + ;; the instruction. This will not have any sideeffects unless + ;; the first half goes to any device or memory that can't be + ;; written twice, and which is mapped through the MMU. + ;; + ;; We only need to do this for writes. + btstq 8, $r1 ; Write access? + bpl 1f + nop + move.d [$sp+16], $r0 ; Clear unaligned bit in csrinstr + and.d ~(1<<5), $r0 + move.d $r0, [$sp+16] +1: btstq 12, $r1 ; Refill? + bpl 2f + lsrq PMD_SHIFT, $r1 ; Get PMD index into PGD (bit 24-31) + move.d [current_pgd], $r0 ; PGD for the current process + move.d [$r0+$r1.d], $r0 ; Get PMD + beq 2f + nop + and.w PAGE_MASK, $r0 ; Remove PMD flags + move.d [R_MMU_CAUSE], $r1 + lsrq PAGE_SHIFT, $r1 + and.d 0x7ff, $r1 ; Get PTE index into PMD (bit 13-24) + move.d [$r0+$r1.d], $r1 ; Get PTE + beq 2f + nop + ;; Store in TLB + move.d $r1, [R_TLB_LO] + ;; Return + movem [$sp+], $r1 + pop $dccr + rbf [$sp+] ; return by popping the CPU status + +2: ; PMD or PTE missing, let the mm subsystem fix it up. + movem [$sp+], $r1 + pop $dccr + + ; Ok, not that easy, pass it on to the mm subsystem + ; The MMU status record is now on the stack push $srp ; make a stackframe similar to pt_regs push $dccr push $mof @@ -556,7 +627,7 @@ mmu_bus_fault: move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault - jsr handle_mmu_bus_fault ; in arch/cris/mm/fault.c + jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c ;; now we need to return through the normal path, we cannot just ;; do the RBFexit since we might have killed off the running @@ -569,48 +640,20 @@ mmu_bus_fault: nop ;; special handlers for breakpoint and NMI -#if 0 -hwbreakpoint: - push $dccr - di - push $r10 - push $r11 - push $r12 - push $r13 - clearf b - move $brp,$r11 - move.d [hw_bp_msg],$r10 - jsr printk - setf b - pop $r13 - pop $r12 - pop $r11 - pop $r10 - pop $dccr - retb - nop -#else hwbreakpoint: push $dccr di -#if 1 push $r10 push $r11 move.d [hw_bp_trig_ptr],$r10 - move.d [$r10],$r11 - cmp.d 42,$r11 - beq 1f - nop move $brp,$r11 move.d $r11,[$r10+] move.d $r10,[hw_bp_trig_ptr] 1: pop $r11 pop $r10 -#endif pop $dccr retb nop -#endif IRQ1_interrupt: @@ -719,29 +762,23 @@ multiple_interrupt: push $r10 ; push orig_r10 clear.d [$sp=$sp-4] ; frametype == 0, normal frame - move.d irq_shortcuts + 8, $r1 moveq 2, $r2 ; first bit we care about is the timer0 irq move.d [R_VECT_MASK_RD], $r0; read the irq bits that triggered the multiple irq + move.d $r0, [R_VECT_MASK_CLR] ; Block all active IRQs 1: btst $r2, $r0 ; check for the irq given by bit r2 - bmi _do_shortcut ; actually do the shortcut - nop + bpl 2f + move.d $r2, $r10 ; First argument to do_IRQ + move.d $sp, $r11 ; second argument to do_IRQ + jsr do_IRQ +2: addq 1, $r2 ; next vector bit - addq 4, $r1 ; next vector cmp.b 32, $r2 bne 1b ; process all irq's up to and including number 31 - nop + moveq 0, $r9 ; make ret_from_intr realise we came from an ir - ;; strange, we didn't get any set vector bits.. oh well, just return - - ba _Rexit - nop - -_do_shortcut: - test.d [$r1] - beq _Rexit - nop - jump [$r1] ; jump to the irq handlers shortcut + move.d $r0, [R_VECT_MASK_SET] ; Unblock all the IRQs + jump ret_from_intr do_sigtrap: ;; @@ -1079,7 +1116,9 @@ sys_call_table: .long sys_mq_timedreceive /* 280 */ .long sys_mq_notify .long sys_mq_getsetattr - + .long sys_ni_syscall /* reserved for kexec */ + .long sys_waitid + /* * NOTE!! This doesn't have to be exact - we just have * to make sure we have _enough_ of the "sys_ni_syscall" diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c index 53b94eb3e..4717f7ae8 100644 --- a/arch/cris/arch-v10/kernel/fasttimer.c +++ b/arch/cris/arch-v10/kernel/fasttimer.c @@ -599,23 +599,8 @@ void schedule_usleep(unsigned long us) #ifdef CONFIG_PROC_FS static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) - ,int *eof, void *data_unused -#else - ,int unused -#endif - ); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) + ,int *eof, void *data_unused); static struct proc_dir_entry *fasttimer_proc_entry; -#else -static struct proc_dir_entry fasttimer_proc_entry = -{ - 0, 9, "fasttimer", - S_IFREG | S_IRUGO, 1, 0, 0, - 0, NULL /* ops -- default to array */, - &proc_fasttimer_read /* get_info */, -}; -#endif #endif /* CONFIG_PROC_FS */ #ifdef CONFIG_PROC_FS @@ -624,12 +609,7 @@ static struct proc_dir_entry fasttimer_proc_entry = #define BIG_BUF_SIZE (500 + NUM_TIMER_STATS * 300) static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) - ,int *eof, void *data_unused -#else - ,int unused -#endif - ) + ,int *eof, void *data_unused) { unsigned long flags; int i = 0; @@ -805,9 +785,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len memcpy(buf, bigbuf + offset, len); *start = buf; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) *eof = 1; -#endif return len; } @@ -982,12 +960,8 @@ void fast_timer_init(void) } #endif #ifdef CONFIG_PROC_FS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 ))) fasttimer_proc_entry->read_proc = proc_fasttimer_read; -#else - proc_register_dynamic(&proc_root, &fasttimer_proc_entry); -#endif #endif /* PROC_FS */ if(request_irq(TIMER1_IRQ_NBR, timer1_handler, SA_SHIRQ, "fast timer int", NULL)) diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c index c5e6348ab..b2f16d6fc 100644 --- a/arch/cris/arch-v10/kernel/irq.c +++ b/arch/cris/arch-v10/kernel/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.1 2002/12/11 15:42:02 starvik Exp $ +/* $Id: irq.c,v 1.2 2004/06/09 05:30:27 starvik Exp $ * * linux/arch/cris/kernel/irq.c * @@ -23,12 +23,8 @@ irqvectptr irq_shortcuts[NR_IRQS]; /* vector of shortcut jumps after the irq pro */ void -set_int_vector(int n, irqvectptr addr, irqvectptr saddr) +set_int_vector(int n, irqvectptr addr) { - /* remember the shortcut entry point, after the prologue */ - - irq_shortcuts[n] = saddr; - etrax_irv->v[n + 0x20] = (irqvectptr)addr; } @@ -106,17 +102,6 @@ static void (*interrupt[NR_IRQS])(void) = { IRQ31_interrupt }; -static void (*sinterrupt[NR_IRQS])(void) = { - NULL, NULL, sIRQ2_interrupt, sIRQ3_interrupt, - sIRQ4_interrupt, sIRQ5_interrupt, sIRQ6_interrupt, sIRQ7_interrupt, - sIRQ8_interrupt, sIRQ9_interrupt, sIRQ10_interrupt, sIRQ11_interrupt, - sIRQ12_interrupt, sIRQ13_interrupt, NULL, NULL, - sIRQ16_interrupt, sIRQ17_interrupt, sIRQ18_interrupt, sIRQ19_interrupt, - sIRQ20_interrupt, sIRQ21_interrupt, sIRQ22_interrupt, sIRQ23_interrupt, - sIRQ24_interrupt, sIRQ25_interrupt, NULL, NULL, NULL, NULL, NULL, - sIRQ31_interrupt -}; - static void (*bad_interrupt[NR_IRQS])(void) = { NULL, NULL, NULL, bad_IRQ3_interrupt, @@ -137,12 +122,12 @@ static void (*bad_interrupt[NR_IRQS])(void) = { void arch_setup_irq(int irq) { - set_int_vector(irq, interrupt[irq], sinterrupt[irq]); + set_int_vector(irq, interrupt[irq]); } void arch_free_irq(int irq) { - set_int_vector(irq, bad_interrupt[irq], 0); + set_int_vector(irq, bad_interrupt[irq]); } void weird_irq(void); @@ -187,20 +172,20 @@ init_IRQ(void) /* set all etrax irq's to the bad handlers */ for (i = 2; i < NR_IRQS; i++) - set_int_vector(i, bad_interrupt[i], 0); + set_int_vector(i, bad_interrupt[i]); /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */ - set_int_vector(15, multiple_interrupt, 0); + set_int_vector(15, multiple_interrupt); /* 0 and 1 which are special breakpoint/NMI traps */ - set_int_vector(0, hwbreakpoint, 0); - set_int_vector(1, IRQ1_interrupt, 0); + set_int_vector(0, hwbreakpoint); + set_int_vector(1, IRQ1_interrupt); /* and irq 14 which is the mmu bus fault handler */ - set_int_vector(14, mmu_bus_fault, 0); + set_int_vector(14, mmu_bus_fault); /* setup the system-call trap, which is reached by BREAK 13 */ diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c index 4e5d50d28..7d368c877 100644 --- a/arch/cris/arch-v10/kernel/kgdb.c +++ b/arch/cris/arch-v10/kernel/kgdb.c @@ -18,6 +18,9 @@ *! Jul 21 1999 Bjorn Wesen eLinux port *! *! $Log: kgdb.c,v $ +*! Revision 1.5 2004/10/07 13:59:08 starvik +*! Corrected call to set_int_vector +*! *! Revision 1.4 2003/04/09 05:20:44 starvik *! Merge of Linux 2.5.67 *! @@ -68,7 +71,7 @@ *! *!--------------------------------------------------------------------------- *! -*! $Id: kgdb.c,v 1.4 2003/04/09 05:20:44 starvik Exp $ +*! $Id: kgdb.c,v 1.5 2004/10/07 13:59:08 starvik Exp $ *! *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN *! @@ -1557,7 +1560,7 @@ kgdb_init(void) /* could initialize debug port as well but it's done in head.S already... */ /* breakpoint handler is now set in irq.c */ - set_int_vector(8, kgdb_handle_serial, 0); + set_int_vector(8, kgdb_handle_serial); enableDebugIRQ(); } diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index d0993bf72..87ff37790 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.6 2004/05/11 12:28:25 starvik Exp $ +/* $Id: process.c,v 1.9 2004/10/19 13:07:37 starvik Exp $ * * linux/arch/cris/kernel/process.c * @@ -34,6 +34,15 @@ void default_idle(void) #endif } +/* + * Free current thread data structures etc.. + */ + +void exit_thread(void) +{ + /* Nothing needs to be done. */ +} + /* if the watchdog is enabled, we can simply disable interrupts and go * into an eternal loop, and the watchdog will reset the CPU after 0.1s * if on the other hand the watchdog wasn't enabled, we just enable it and wait @@ -123,7 +132,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, *childregs = *regs; /* struct copy of pt_regs */ p->set_child_tid = p->clear_child_tid = NULL; - + childregs->r10 = 0; /* child returns 0 after a fork/clone */ /* put the switch stack right below the pt_regs */ @@ -214,13 +223,6 @@ asmlinkage int sys_execve(const char *fname, char **argv, char **envp, return error; } -/* - * These bracket the sleeping functions.. - */ - -#define first_sched ((unsigned long)__sched_text_start) -#define last_sched ((unsigned long)__sched_text_end) - unsigned long get_wchan(struct task_struct *p) { #if 0 @@ -241,8 +243,8 @@ unsigned long get_wchan(struct task_struct *p) if (ebp < stack_page || ebp > 8184+stack_page) return 0; eip = *(unsigned long *) (ebp+4); - if (eip < first_sched || eip >= last_sched) - return eip; + if (!in_sched_functions(eip)) + return eip; ebp = *(unsigned long *) ebp; } while (count++ < 16); #endif diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c index 3c7e0a51a..da15db8ae 100644 --- a/arch/cris/arch-v10/kernel/ptrace.c +++ b/arch/cris/arch-v10/kernel/ptrace.c @@ -23,8 +23,37 @@ */ #define DCCR_MASK 0x0000001f /* XNZVC */ -extern inline long get_reg(struct task_struct *, unsigned int); -extern inline long put_reg(struct task_struct *, unsigned int, unsigned long); +/* + * Get contents of register REGNO in task TASK. + */ +inline long get_reg(struct task_struct *task, unsigned int regno) +{ + /* USP is a special case, it's not in the pt_regs struct but + * in the tasks thread struct + */ + + if (regno == PT_USP) + return task->thread.usp; + else if (regno < PT_MAX) + return ((unsigned long *)user_regs(task->thread_info))[regno]; + else + return 0; +} + +/* + * Write contents of register REGNO in task TASK. + */ +inline int put_reg(struct task_struct *task, unsigned int regno, + unsigned long data) +{ + if (regno == PT_USP) + task->thread.usp = data; + else if (regno < PT_MAX) + ((unsigned long *)user_regs(task->thread_info))[regno] = data; + else + return -1; + return 0; +} /* * Called by kernel/ptrace.c when detaching. @@ -50,6 +79,7 @@ sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; + unsigned long __user *datap = (unsigned long __user *)data; lock_kernel(); ret = -EPERM; @@ -102,7 +132,7 @@ sys_ptrace(long request, long pid, long addr, long data) if (copied != sizeof(tmp)) break; - ret = put_user(tmp,(unsigned long *) data); + ret = put_user(tmp,datap); break; } @@ -115,7 +145,7 @@ sys_ptrace(long request, long pid, long addr, long data) break; tmp = get_reg(child, addr >> 2); - ret = put_user(tmp, (unsigned long *)data); + ret = put_user(tmp, datap); break; } @@ -213,7 +243,7 @@ sys_ptrace(long request, long pid, long addr, long data) for (i = 0; i <= PT_MAX; i++) { tmp = get_reg(child, i); - if (put_user(tmp, (unsigned long *) data)) { + if (put_user(tmp, datap)) { ret = -EFAULT; goto out_tsk; } @@ -231,7 +261,7 @@ sys_ptrace(long request, long pid, long addr, long data) unsigned long tmp; for (i = 0; i <= PT_MAX; i++) { - if (get_user(tmp, (unsigned long *) data)) { + if (get_user(tmp, datap)) { ret = -EFAULT; goto out_tsk; } diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 19f93fe42..97b7af26a 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c @@ -264,7 +264,6 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, { struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); sigset_t set; - stack_t st; /* * Since we stacked the signal on a dword boundary, @@ -288,11 +287,8 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) goto badframe; - if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) + if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) goto badframe; - /* It is more difficult to avoid calling this function than to - call it and ignore errors. */ - do_sigaltstack(&st, NULL, rdusp()); return regs->r10; @@ -388,9 +384,9 @@ static void setup_frame(int sig, struct k_sigaction *ka, /* trampoline - the desired return ip is the retcode itself */ return_ip = (unsigned long)&frame->retcode; /* This is movu.w __NR_sigreturn, r9; break 13; */ - err |= __put_user(0x9c5f, (short *)(frame->retcode+0)); - err |= __put_user(__NR_sigreturn, (short *)(frame->retcode+2)); - err |= __put_user(0xe93d, (short *)(frame->retcode+4)); + err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0)); + err |= __put_user(__NR_sigreturn, (short __user*)(frame->retcode+2)); + err |= __put_user(0xe93d, (short __user*)(frame->retcode+4)); } if (err) @@ -448,9 +444,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, /* trampoline - the desired return ip is the retcode itself */ return_ip = (unsigned long)&frame->retcode; /* This is movu.w __NR_rt_sigreturn, r9; break 13; */ - err |= __put_user(0x9c5f, (short *)(frame->retcode+0)); - err |= __put_user(__NR_rt_sigreturn, (short *)(frame->retcode+2)); - err |= __put_user(0xe93d, (short *)(frame->retcode+4)); + err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0)); + err |= __put_user(__NR_rt_sigreturn, (short __user*)(frame->retcode+2)); + err |= __put_user(0xe93d, (short __user*)(frame->retcode+4)); } if (err) @@ -482,10 +478,9 @@ give_sigsegv: extern inline void handle_signal(int canrestart, unsigned long sig, - siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) + siginfo_t *info, struct k_sigaction *ka, + sigset_t *oldset, struct pt_regs * regs) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - /* Are we from a system call? */ if (canrestart) { /* If so, check system call restarting.. */ @@ -547,6 +542,7 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs) { siginfo_t info; int signr; + struct k_sigaction ka; /* * We want the common case to go fast, which @@ -560,10 +556,10 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs) if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs, NULL); + signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ - handle_signal(canrestart, signr, &info, oldset, regs); + handle_signal(canrestart, signr, &info, &ka, oldset, regs); return 1; } diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index 298e86a01..6b7b4e080 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.3 2004/06/01 05:38:42 starvik Exp $ +/* $Id: time.c,v 1.5 2004/09/29 06:12:46 starvik Exp $ * * linux/arch/cris/arch-v10/kernel/time.c * @@ -200,6 +200,8 @@ static long last_rtc_update = 0; //static unsigned short myjiff; /* used by our debug routine print_timestamp */ +extern void cris_do_profile(struct pt_regs *regs); + static inline irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -228,6 +230,8 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer(regs); + cris_do_profile(regs); /* Save profiling information */ + /* * If we have an externally synchronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be diff --git a/arch/cris/arch-v10/mm/fault.c b/arch/cris/arch-v10/mm/fault.c index 0c6bac018..6805cdb25 100644 --- a/arch/cris/arch-v10/mm/fault.c +++ b/arch/cris/arch-v10/mm/fault.c @@ -40,23 +40,25 @@ void handle_mmu_bus_fault(struct pt_regs *regs) { int cause; -#ifdef DEBUG int select; +#ifdef DEBUG int index; int page_id; int acc, inv; #endif - int miss, we, writeac; + pgd_t* pgd = (pgd_t*)current_pgd; pmd_t *pmd; pte_t pte; + int miss, we, writeac; unsigned long address; + unsigned long flags; cause = *R_MMU_CAUSE; address = cause & PAGE_MASK; /* get faulting address */ + select = *R_TLB_SELECT; #ifdef DEBUG - select = *R_TLB_SELECT; page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause); acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause); inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause); @@ -66,85 +68,31 @@ handle_mmu_bus_fault(struct pt_regs *regs) we = IO_EXTRACT(R_MMU_CAUSE, we_excp, cause); writeac = IO_EXTRACT(R_MMU_CAUSE, wr_rd, cause); - /* ETRAX 100LX TR89 bugfix: if the second half of an unaligned - * write causes a MMU-fault, it will not be restarted correctly. - * This could happen if a write crosses a page-boundary and the - * second page is not yet COW'ed or even loaded. The workaround - * is to clear the unaligned bit in the CPU status record, so - * that the CPU will rerun both the first and second halves of - * the instruction. This will not have any sideeffects unless - * the first half goes to any device or memory that can't be - * written twice, and which is mapped through the MMU. - * - * We only need to do this for writes. - */ - - if(writeac) - regs->csrinstr &= ~(1 << 5); - D(printk("bus_fault from IRP 0x%lx: addr 0x%lx, miss %d, inv %d, we %d, acc %d, dx %d pid %d\n", regs->irp, address, miss, inv, we, acc, index, page_id)); - /* for a miss, we need to reload the TLB entry */ - - if (miss) { - /* see if the pte exists at all - * refer through current_pgd, dont use mm->pgd - */ - - pmd = (pmd_t *)(current_pgd + pgd_index(address)); - if (pmd_none(*pmd)) { - do_page_fault(address, regs, 0, writeac); - return; - } - if (pmd_bad(*pmd)) { - printk("bad pgdir entry 0x%lx at 0x%p\n", *(unsigned long*)pmd, pmd); - pmd_clear(pmd); - return; - } - pte = *pte_offset_kernel(pmd, address); - if (!pte_present(pte)) { - do_page_fault(address, regs, 0, writeac); - return; - } - -#ifdef DEBUG - printk(" found pte %lx pg %p ", pte_val(pte), pte_page(pte)); - if (pte_val(pte) & _PAGE_SILENT_WRITE) - printk("Silent-W "); - if (pte_val(pte) & _PAGE_KERNEL) - printk("Kernel "); - if (pte_val(pte) & _PAGE_SILENT_READ) - printk("Silent-R "); - if (pte_val(pte) & _PAGE_GLOBAL) - printk("Global "); - if (pte_val(pte) & _PAGE_PRESENT) - printk("Present "); - if (pte_val(pte) & _PAGE_ACCESSED) - printk("Accessed "); - if (pte_val(pte) & _PAGE_MODIFIED) - printk("Modified "); - if (pte_val(pte) & _PAGE_READ) - printk("Readable "); - if (pte_val(pte) & _PAGE_WRITE) - printk("Writeable "); - printk("\n"); -#endif - - /* load up the chosen TLB entry - * this assumes the pte format is the same as the TLB_LO layout. - * - * the write to R_TLB_LO also writes the vpn and page_id fields from - * R_MMU_CAUSE, which we in this case obviously want to keep - */ - - *R_TLB_LO = pte_val(pte); - - return; - } - /* leave it to the MM system fault handler */ - do_page_fault(address, regs, 1, we); + if (miss) + do_page_fault(address, regs, 0, writeac); + else + do_page_fault(address, regs, 1, we); + + /* Reload TLB with new entry to avoid an extra miss exception. + * do_page_fault may have flushed the TLB so we have to restore + * the MMU registers. + */ + local_save_flags(flags); + local_irq_disable(); + pmd = (pmd_t *)(pgd + pgd_index(address)); + if (pmd_none(*pmd)) + return; + pte = *pte_offset_kernel(pmd, address); + if (!pte_present(pte)) + return; + *R_TLB_SELECT = select; + *R_TLB_HI = cause; + *R_TLB_LO = pte_val(pte); + local_irq_restore(flags); } /* Called from arch/cris/mm/fault.c to find fixup code. */ diff --git a/arch/cris/arch-v10/mm/tlb.c b/arch/cris/arch-v10/mm/tlb.c index 62fd0143c..9d06125ff 100644 --- a/arch/cris/arch-v10/mm/tlb.c +++ b/arch/cris/arch-v10/mm/tlb.c @@ -65,7 +65,7 @@ void flush_tlb_mm(struct mm_struct *mm) { int i; - int page_id = mm->context; + int page_id = mm->context.page_id; unsigned long flags; D(printk("tlb: flush mm context %d (%p)\n", page_id, mm)); @@ -103,7 +103,7 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { struct mm_struct *mm = vma->vm_mm; - int page_id = mm->context; + int page_id = mm->context.page_id; int i; unsigned long flags; @@ -147,7 +147,7 @@ flush_tlb_range(struct vm_area_struct *vma, unsigned long end) { struct mm_struct *mm = vma->vm_mm; - int page_id = mm->context; + int page_id = mm->context.page_id; int i; unsigned long flags; @@ -208,6 +208,18 @@ dump_tlb_all(void) } #endif +/* + * Initialize the context related info for a new mm_struct + * instance. + */ + +int +init_new_context(struct task_struct *tsk, struct mm_struct *mm) +{ + mm->context.page_id = NO_CONTEXT; + return 0; +} + /* called in schedule() just before actually doing the switch_to */ void @@ -231,6 +243,6 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, D(printk("switching mmu_context to %d (%p)\n", next->context, next)); - *R_MMU_CONTEXT = IO_FIELD(R_MMU_CONTEXT, page_id, next->context); + *R_MMU_CONTEXT = IO_FIELD(R_MMU_CONTEXT, page_id, next->context.page_id); } diff --git a/arch/cris/arch-v10/vmlinux.lds.S b/arch/cris/arch-v10/vmlinux.lds.S index 9e134c688..71ba736be 100644 --- a/arch/cris/arch-v10/vmlinux.lds.S +++ b/arch/cris/arch-v10/vmlinux.lds.S @@ -26,6 +26,7 @@ SECTIONS .text : { *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.text.__*) } diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c index bb8d2e4e7..d848b9407 100644 --- a/arch/cris/kernel/irq.c +++ b/arch/cris/kernel/irq.c @@ -36,9 +36,9 @@ #include #include #include +#include #include -#include /* Defined in arch specific irq.c */ extern void arch_setup_irq(int irq); @@ -158,11 +158,6 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) local_irq_disable(); } irq_exit(); - - if (softirq_pending(cpu)) - do_softirq(); - - /* unmasking and bottom half handling is done magically for us. */ } /* this function links in a handler into the chain of handlers for the diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index d0b845ac0..b8499363a 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -33,6 +33,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default n +config GENERIC_CALIBRATE_DELAY + bool + default y + config ISA bool default y diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile index 5c6d67116..c9b80cffd 100644 --- a/arch/h8300/Makefile +++ b/arch/h8300/Makefile @@ -7,9 +7,6 @@ # # (C) Copyright 2002,2003 Yoshinori Sato # -ifndef include-config --include $(TOPDIR)/.config -endif platform-$(CONFIG_CPU_H8300H) := h8300h platform-$(CONFIG_CPU_H8S) := h8s @@ -47,9 +44,11 @@ LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(CFLAGS) -print-libgcc-file-name) head-y := arch/$(ARCH)/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o core-y += arch/$(ARCH)/kernel/ \ - arch/$(ARCH)/mm/ \ - arch/$(ARCH)/platform/$(PLATFORM)/ \ + arch/$(ARCH)/mm/ +ifdef PLATFORM +core-y += arch/$(ARCH)/platform/$(PLATFORM)/ \ arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/ +endif libs-y += arch/$(ARCH)/lib/ $(LIBGCC) diff --git a/arch/h8300/defconfig b/arch/h8300/defconfig index 49cb366a8..9d9b491cf 100644 --- a/arch/h8300/defconfig +++ b/arch/h8300/defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc1 +# Sun Jan 16 17:24:38 2005 # CONFIG_H8300=y # CONFIG_MMU is not set @@ -8,32 +10,37 @@ CONFIG_H8300=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ISA=y +# CONFIG_PCI is not set # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # -# CONFIG_SYSVIPC is not set +CONFIG_LOCALVERSION="" # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_SYSCTL is not set +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y +# CONFIG_KALLSYMS is not set +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support @@ -43,32 +50,42 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y # # Processor type and features # -# CONFIG_H8300H_GENERIC is not set +CONFIG_H8300H_GENERIC=y # CONFIG_H8300H_AKI3068NET is not set # CONFIG_H8300H_H8MAX is not set -CONFIG_H8300H_SIM=y +# CONFIG_H8300H_SIM is not set +# CONFIG_H8S_GENERIC is not set # CONFIG_H8S_EDOSK2674 is not set # CONFIG_H8S_SIM is not set + +# +# Detail Selection +# # CONFIG_H83002 is not set -CONFIG_H83007=y +# CONFIG_H83007 is not set # CONFIG_H83048 is not set -# CONFIG_H83068 is not set -# CONFIG_H8S2678 is not set -CONFIG_CPU_H8300H=y -CONFIG_CPU_CLOCK=16000 +CONFIG_H83068=y +CONFIG_CPU_CLOCK=20000 # CONFIG_RAMKERNEL is not set CONFIG_ROMKERNEL=y +CONFIG_CPU_H8300H=y +# CONFIG_PREEMPT is not set # # Executable file formats # CONFIG_BINFMT_FLAT=y -# CONFIG_BINFMT_ZFLAT is not set +CONFIG_BINFMT_ZFLAT=y +# CONFIG_BINFMT_SHARED_FLAT is not set # CONFIG_BINFMT_MISC is not set # # Generic Driver Options # +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -76,7 +93,7 @@ CONFIG_BINFMT_FLAT=y CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_CONCAT=y # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_CMDLINE_PARTS is not set @@ -94,10 +111,19 @@ CONFIG_MTD_BLOCK=y # # CONFIG_MTD_CFI is not set # CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_RAM=y -# CONFIG_MTD_ROM is not set +CONFIG_MTD_ROM=y # CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set # # Mapping drivers for chip access @@ -109,8 +135,10 @@ CONFIG_MTD_UCLINUX=y # Self-contained MTD device drivers # # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -130,114 +158,30 @@ CONFIG_MTD_UCLINUX=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set # -# ATA/ATAPI/MFM/RLL support +# IO Schedulers # -# CONFIG_IDE is not set +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set # -# IDE Extra configuration +# ATA/ATAPI/MFM/RLL support # +# CONFIG_IDE is not set # # Networking support # -CONFIG_NET=y - -# -# Networking options -# -# CONFIG_PACKET is not set -# CONFIG_NETLINK_DEV is not set -# CONFIG_UNIX is not set -# CONFIG_NET_KEY is not set -# CONFIG_INET is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set -# CONFIG_NETFILTER is not set -# CONFIG_ATM is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set - -# -# QoS and/or fair queueing -# -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -CONFIG_NETDEVICES=y - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set - -# -# Ethernet (10 or 100Mbit) -# -# CONFIG_NET_ETHERNET is not set - -# -# Ethernet (1000 Mbit) -# - -# -# Ethernet (10000 Mbit) -# -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set -# CONFIG_SHAPER is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# -# Bluetooth support -# -# CONFIG_BT is not set +# CONFIG_NET is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set # # Input device support @@ -264,9 +208,6 @@ CONFIG_SOUND_GAMEPORT=y # Character devices # # CONFIG_VT is not set -# CONFIG_SERIAL is not set -CONFIG_SH_SCI=y -CONFIG_SERIAL_CONSOLE=y # # Unix98 PTY support @@ -281,6 +222,10 @@ CONFIG_SERIAL_CONSOLE=y # # Non-8250 serial port support # +CONFIG_SERIAL_SH_SCI=y +CONFIG_SERIAL_SH_SCI_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y # # I2C support @@ -290,6 +235,12 @@ CONFIG_SERIAL_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support @@ -308,6 +259,7 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y # CONFIG_QUOTA is not set +# CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -320,14 +272,15 @@ CONFIG_ROMFS_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y +# CONFIG_SYSFS is not set # CONFIG_DEVFS_FS is not set # CONFIG_TMPFS is not set # CONFIG_HUGETLB_PAGE is not set @@ -339,6 +292,7 @@ CONFIG_RAMFS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -351,11 +305,6 @@ CONFIG_RAMFS=y # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set -# -# Network File Systems -# -# CONFIG_EXPORTFS is not set - # # Partition Types # @@ -370,18 +319,23 @@ CONFIG_MSDOS_PARTITION=y # # Kernel hacking # +CONFIG_DEBUG_KERNEL=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_FS is not set CONFIG_FULLDEBUG=y -# CONFIG_MAGIC_SYSRQ is not set # CONFIG_HIGHPROFILE is not set CONFIG_NO_KERNEL_MSG=y -CONFIG_GDB_MAGICPRINT=y # CONFIG_SYSCALL_PRINT is not set +# CONFIG_GDB_DEBUG is not set +# CONFIG_CONFIG_SH_STANDARD_BIOS is not set # CONFIG_DEFAULT_CMDLINE is not set # CONFIG_BLKDEV_RESERVE is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -389,7 +343,14 @@ CONFIG_GDB_MAGICPRINT=y # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -# CONFIG_CRC32 is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c index 838e0c993..7e5cce33b 100644 --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c @@ -194,7 +194,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; h8300_disable_trace(child); diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c index 2742e5389..f469d9160 100644 --- a/arch/h8300/kernel/setup.c +++ b/arch/h8300/kernel/setup.c @@ -218,7 +218,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) "BogoMips:\t%lu.%02lu\n" "Calibration:\t%lu loops\n", cpu,mode, - clockfreq/100,clockfreq%100, + clockfreq/1000,clockfreq%1000, (loops_per_jiffy*HZ)/500000,((loops_per_jiffy*HZ)/5000)%100, (loops_per_jiffy*HZ)); diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c index 5fd383a6a..962d4305a 100644 --- a/arch/h8300/kernel/signal.c +++ b/arch/h8300/kernel/signal.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); +asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset); /* * Atomically swap in the new signal mask, and wait for a signal. @@ -68,7 +69,7 @@ asmlinkage int do_sigsuspend(struct pt_regs *regs) while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (do_signal(&saveset, regs)) + if (do_signal(regs, &saveset)) return -EINTR; } } @@ -98,7 +99,7 @@ do_rt_sigsuspend(struct pt_regs *regs) while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (do_signal(&saveset, regs)) + if (do_signal(regs, &saveset)) return -EINTR; } } @@ -161,6 +162,7 @@ struct sigframe unsigned char retcode[8]; unsigned long extramask[_NSIG_WORDS-1]; struct sigcontext sc; + int sig; } __attribute__((aligned(2),packed)); struct rt_sigframe @@ -172,73 +174,44 @@ struct rt_sigframe #endif long dummy_pc; char *pretcode; + struct siginfo *pinfo; + void *puc; unsigned char retcode[8]; struct siginfo info; struct ucontext uc; + int sig; } __attribute__((aligned(2),packed)); static inline int -restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, +restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, int *pd0) { - struct sigcontext context; int err = 0; - - /* get previous context */ - if (copy_from_user(&context, usc, sizeof(context))) - goto badframe; - - /* restore passed registers */ - regs->er1 = context.sc_er1; - regs->er2 = context.sc_er2; - regs->er3 = context.sc_er3; - regs->er5 = context.sc_er5; - regs->ccr = (regs->ccr & 0x10)|(context.sc_ccr & 0xef); - regs->pc = context.sc_pc; + unsigned int ccr; + unsigned int usp; + unsigned int er0; + + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + +#define COPY(r) err |= __get_user(regs->r, &usc->sc_##r) /* restore passed registers */ + COPY(er1); + COPY(er2); + COPY(er3); + COPY(er5); + COPY(pc); + ccr = regs->ccr & 0x10; + COPY(ccr); +#undef COPY + regs->ccr &= 0xef; + regs->ccr |= ccr; regs->orig_er0 = -1; /* disable syscall checks */ - wrusp(context.sc_usp); - - *pd0 = context.sc_er0; - return err; - -badframe: - return 1; -} - -static inline int -rt_restore_ucontext(struct pt_regs *regs, struct ucontext *uc, int *pd0) -{ - int temp; - greg_t *gregs = uc->uc_mcontext.gregs; - unsigned long usp; - int err; - - err = __get_user(temp, &uc->uc_mcontext.version); - if (temp != MCONTEXT_VERSION) - goto badframe; - /* restore passed registers */ - err |= __get_user(regs->er0, &gregs[0]); - err |= __get_user(regs->er1, &gregs[1]); - err |= __get_user(regs->er2, &gregs[2]); - err |= __get_user(regs->er3, &gregs[3]); - err |= __get_user(regs->er4, &gregs[4]); - err |= __get_user(regs->er5, &gregs[5]); - err |= __get_user(regs->er6, &gregs[6]); - err |= __get_user(usp, &gregs[7]); + err |= __get_user(usp, &usc->sc_usp); wrusp(usp); - err |= __get_user(regs->pc, &gregs[8]); - err |= __get_user(temp, &gregs[9]); - regs->ccr = (regs->ccr & 0x10) | (temp & 0xef); - regs->orig_er0 = -1; /* disable syscall checks */ - if (do_sigaltstack(&uc->uc_stack, NULL, usp) == -EFAULT) - goto badframe; - - *pd0 = regs->er0; + err |= __get_user(er0, &usc->sc_er0); + *pd0 = er0; return err; - -badframe: - return 1; } asmlinkage int do_sigreturn(unsigned long __unused,...) @@ -263,7 +236,7 @@ asmlinkage int do_sigreturn(unsigned long __unused,...) recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - if (restore_sigcontext(regs, &frame->sc, frame + 1, &er0)) + if (restore_sigcontext(regs, &frame->sc, &er0)) goto badframe; return er0; @@ -291,8 +264,12 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused,...) recalc_sigpending(); spin_lock_irq(¤t->sighand->siglock); - if (rt_restore_ucontext(regs, &frame->uc, &er0)) + if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0)) goto badframe; + + if (do_sigaltstack(&frame->uc.uc_stack, NULL, usp) == -EFAULT) + goto badframe; + return er0; badframe: @@ -300,36 +277,23 @@ badframe: return 0; } -static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, +static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask) { - sc->sc_mask = mask; - sc->sc_usp = rdusp(); - sc->sc_er0 = regs->er0; - sc->sc_er1 = regs->er1; - sc->sc_er2 = regs->er2; - sc->sc_er3 = regs->er3; - sc->sc_er5 = regs->er5; - sc->sc_ccr = regs->ccr; - sc->sc_pc = regs->pc; -} - -static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) -{ - greg_t *gregs = uc->uc_mcontext.gregs; int err = 0; - err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); - err |= __put_user(regs->er0, &gregs[0]); - err |= __put_user(regs->er1, &gregs[1]); - err |= __put_user(regs->er2, &gregs[2]); - err |= __put_user(regs->er3, &gregs[3]); - err |= __put_user(regs->er4, &gregs[4]); - err |= __put_user(regs->er5, &gregs[5]); - err |= __put_user(regs->er6, &gregs[6]); - err |= __put_user(rdusp(), &gregs[7]); - err |= __put_user(regs->pc, &gregs[8]); - err |= __put_user(regs->ccr, &gregs[9]); + err |= __put_user(regs->er0, &sc->sc_er0); + err |= __put_user(regs->er1, &sc->sc_er1); + err |= __put_user(regs->er2, &sc->sc_er2); + err |= __put_user(regs->er3, &sc->sc_er3); + err |= __put_user(regs->er4, &sc->sc_er4); + err |= __put_user(regs->er5, &sc->sc_er5); + err |= __put_user(regs->er6, &sc->sc_er6); + err |= __put_user(rdusp(), &sc->sc_usp); + err |= __put_user(regs->pc, &sc->sc_pc); + err |= __put_user(regs->ccr, &sc->sc_ccr); + err |= __put_user(mask, &sc->sc_mask); + return err; } @@ -353,26 +317,48 @@ static void setup_frame (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *regs) { struct sigframe *frame; - struct sigcontext context; int err = 0; + int usig; + unsigned char *ret; frame = get_sigframe(ka, regs, sizeof(*frame)); - if (_NSIG_WORDS > 1) + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) + goto give_sigsegv; + + usig = current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig; + + err |= __put_user(usig, &frame->sig); + if (err) + goto give_sigsegv; + + err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); + if (err) + goto give_sigsegv; + + if (_NSIG_WORDS > 1) { err |= copy_to_user(frame->extramask, &set->sig[1], sizeof(frame->extramask)); + if (err) + goto give_sigsegv; + } - setup_sigcontext(&context, regs, set->sig[0]); - err |= copy_to_user (&frame->sc, &context, sizeof(context)); + ret = frame->retcode; + if (ka->sa.sa_flags & SA_RESTORER) + ret = (unsigned char *)(ka->sa.sa_restorer); + else { + /* sub.l er0,er0; mov.b #__NR_sigreturn,r0l; trapa #0 */ + err != __put_user(0x1a80f800 + (__NR_sigreturn & 0xff), + (unsigned long *)(frame->retcode + 0)); + err |= __put_user(0x5700, (unsigned short *)(frame->retcode + 4)); + } /* Set up to return from userspace. */ - err |= __put_user(frame->retcode, &frame->pretcode); - - /* sub.l er0,er0; mov.b #__NR_sigreturn,r0l; trapa #0 */ - err != __put_user(0x1a80f800 + (__NR_sigreturn & 0xff), - (unsigned long *)(frame->retcode + 0)); - err |= __put_user(0x5700, (unsigned short *)(frame->retcode + 4)); - + err |= __put_user(ret, &frame->pretcode); if (err) goto give_sigsegv; @@ -399,10 +385,29 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, { struct rt_sigframe *frame; int err = 0; + int usig; + unsigned char *ret; frame = get_sigframe(ka, regs, sizeof(*frame)); + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) + goto give_sigsegv; + + usig = current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig; + + err |= __put_user(usig, &frame->sig); + if (err) + goto give_sigsegv; + + err |= __put_user(&frame->info, &frame->pinfo); + err |= __put_user(&frame->uc, &frame->puc); err |= copy_siginfo_to_user(&frame->info, info); + if (err) + goto give_sigsegv; /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); @@ -412,16 +417,22 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags); err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); - err |= rt_setup_ucontext(&frame->uc, regs); + err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); + if (err) + goto give_sigsegv; /* Set up to return from userspace. */ - err |= __put_user(frame->retcode, &frame->pretcode); - - /* sub.l er0,er0; mov.b #__NR_rt_sigreturn,r0l; trapa #0 */ - err != __put_user(0x1a80f800 + (__NR_rt_sigreturn & 0xff), - (long *)(frame->retcode + 0)); - err |= __put_user(0x5700, (short *)(frame->retcode + 4)); + ret = frame->retcode; + if (ka->sa.sa_flags & SA_RESTORER) + ret = (unsigned char *)(ka->sa.sa_restorer); + else { + /* sub.l er0,er0; mov.b #__NR_sigreturn,r0l; trapa #0 */ + err != __put_user(0x1a80f800 + (__NR_sigreturn & 0xff), + (unsigned long *)(frame->retcode + 0)); + err |= __put_user(0x5700, (unsigned short *)(frame->retcode + 4)); + } + err |= __put_user(ret, &frame->pretcode); if (err) goto give_sigsegv; @@ -444,41 +455,32 @@ give_sigsegv: force_sigsegv(sig, current); } -static inline void -handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) -{ - switch (regs->er0) { - case -ERESTARTNOHAND: - if (!has_handler) - goto do_restart; - regs->er0 = -EINTR; - break; - - case -ERESTARTSYS: - if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { - regs->er0 = -EINTR; - break; - } - /* fallthrough */ - case -ERESTARTNOINTR: - do_restart: - regs->er0 = regs->orig_er0; - regs->pc -= 2; - break; - } -} - /* * OK, we're invoking a handler */ static void -handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, - sigset_t *oldset, struct pt_regs *regs) +handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, + sigset_t *oldset, struct pt_regs * regs) { /* are we from a system call? */ - if (regs->orig_er0 >= 0) - /* If so, check system call restarting.. */ - handle_restart(regs, ka, 1); + if (regs->orig_er0 >= 0) { + switch (regs->er0) { + case -ERESTART_RESTARTBLOCK: + case -ERESTARTNOHAND: + regs->er0 = -EINTR; + break; + + case -ERESTARTSYS: + if (!(ka->sa.sa_flags & SA_RESTART)) { + regs->er0 = -EINTR; + break; + } + /* fallthrough */ + case -ERESTARTNOINTR: + regs->er0 = regs->orig_er0; + regs->pc -= 2; + } + } /* set up the stack frame */ if (ka->sa.sa_flags & SA_SIGINFO) @@ -486,9 +488,6 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, else setup_frame(sig, ka, oldset, regs); - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; - if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -502,137 +501,52 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, * Note that 'init' is a special process: it doesn't get signals it doesn't * want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. - * - * Note that we go through the signals twice: once to check the signals - * that the kernel can handle, and then we build all the user-level signal - * handling stack-frames in one go after that. */ -asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) +asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset) { siginfo_t info; - struct k_sigaction *ka; + int signr; + struct k_sigaction ka; + + /* + * We want the common case to go fast, which + * is why we may in certain cases get here from + * kernel mode. Just return without doing anything + * if so. + */ + if ((regs->ccr & 0x10)) + return 1; + + if (current->flags & PF_FREEZE) { + refrigerator(0); + goto no_signal; + } current->thread.esp0 = (unsigned long) regs; if (!oldset) oldset = ¤t->blocked; - for (;;) { - int signr; - - signr = get_signal_to_deliver(&info, regs, NULL); - - if (!signr) - break; - - if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { - current->exit_code = signr; - current->state = TASK_STOPPED; - - /* Did we come from a system call? */ - if (regs->orig_er0 >= 0) { - /* Restart the system call the same way as - if the process were not traced. */ - struct k_sigaction *ka = - ¤t->sighand->action[signr-1]; - int has_handler = - (ka->sa.sa_handler != SIG_IGN && - ka->sa.sa_handler != SIG_DFL); - handle_restart(regs, ka, has_handler); - } - notify_parent(current, SIGCHLD); - schedule(); - - /* We're back. Did the debugger cancel the sig? */ - if (!(signr = current->exit_code)) { - discard_frame: - continue; - } - current->exit_code = 0; - - /* The debugger continued. Ignore SIGSTOP. */ - if (signr == SIGSTOP) - goto discard_frame; - - /* Update the siginfo structure. Is this good? */ - if (signr != info.si_signo) { - info.si_signo = signr; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->parent->pid; - info.si_uid = current->parent->uid; - } - - /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(¤t->blocked, signr)) { - send_sig_info(signr, &info, current); - continue; - } - } - - ka = ¤t->sighand->action[signr-1]; - if (ka->sa.sa_handler == SIG_IGN) { - if (signr != SIGCHLD) - continue; - /* Check for SIGCHLD: it's special. */ - while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - /* nothing */; - continue; - } - - if (ka->sa.sa_handler == SIG_DFL) { - int exit_code = signr; - - if (current->pid == 1) - continue; - - switch (signr) { - case SIGCONT: case SIGCHLD: - case SIGWINCH: case SIGURG: - continue; - - case SIGTSTP: case SIGTTIN: case SIGTTOU: - if (is_orphaned_pgrp(process_group(current))) - continue; - /* FALLTHRU */ - - case SIGSTOP: { - struct sighand_struct *sig; - current->state = TASK_STOPPED; - current->exit_code = signr; - sig = current->parent->sighand; - if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags -& SA_NOCLDSTOP)) - notify_parent(current, SIGCHLD); - schedule(); - continue; - } - - case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGIOT: case SIGFPE: case SIGSEGV: - case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if (do_coredump(signr, exit_code, regs)) - exit_code |= 0x80; - /* FALLTHRU */ - - default: - sigaddset(¤t->pending.signal, signr); - recalc_sigpending(); - current->flags |= PF_SIGNALED; - do_exit(exit_code); - /* NOTREACHED */ - } - } - + signr = get_signal_to_deliver(&info, &ka, regs, NULL); + if (signr > 0) { /* Whee! Actually deliver the signal. */ - handle_signal(signr, ka, &info, oldset, regs); + handle_signal(signr, &info, &ka, oldset, regs); return 1; } - + no_signal: /* Did we come from a system call? */ - if (regs->orig_er0 >= 0) + if (regs->orig_er0 >= 0) { /* Restart the system call - no handlers present */ - handle_restart(regs, NULL, 0); - + if (regs->er0 == -ERESTARTNOHAND || + regs->er0 == -ERESTARTSYS || + regs->er0 == -ERESTARTNOINTR) { + regs->er0 = regs->orig_er0; + regs->pc -= 2; + } + if (regs->er0 == -ERESTART_RESTARTBLOCK){ + regs->er0 = __NR_restart_syscall; + regs->pc -= 2; + } + } return 0; } diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 1055a1bf7..79b3bda5c 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S @@ -289,6 +289,21 @@ SYMBOL_NAME_LABEL(sys_call_table) .long SYMBOL_NAME(sys_utimes) .long SYMBOL_NAME(sys_fadvise64_64) .long SYMBOL_NAME(sys_ni_syscall) /* sys_vserver */ + .long SYMBOL_NAME(sys_mbind) + .long SYMBOL_NAME(sys_get_mempolicy) + .long SYMBOL_NAME(sys_set_mempolicy) + .long SYMBOL_NAME(sys_mq_open) + .long SYMBOL_NAME(sys_mq_unlink) + .long SYMBOL_NAME(sys_mq_timedsend) + .long SYMBOL_NAME(sys_mq_timedreceive) /* 280 */ + .long SYMBOL_NAME(sys_mq_notify) + .long SYMBOL_NAME(sys_mq_getsetattr) + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for kexec */ + .long SYMBOL_NAME(sys_waitid) + .long SYMBOL_NAME(sys_ni_syscall) /* 285 */ /* available */ + .long SYMBOL_NAME(sys_add_key) + .long SYMBOL_NAME(sys_request_key) + .long SYMBOL_NAME(sys_keyctl) .rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4 .long SYMBOL_NAME(sys_ni_syscall) diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index 0b293d652..8a6002183 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c @@ -46,6 +46,9 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs) platform_timer_eoi(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); } diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S index 427f1891c..17fa11da1 100644 --- a/arch/h8300/kernel/vmlinux.lds.S +++ b/arch/h8300/kernel/vmlinux.lds.S @@ -1,60 +1,48 @@ #define VMLINUX_SYMBOL(_sym_) _##_sym_ #include -#include #include +/* target memory map */ #ifdef CONFIG_H8300H_GENERIC -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8300h/generic/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8300h/generic/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x400000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x400000 #endif #ifdef CONFIG_H8300H_AKI3068NET -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8300h/aki3068net/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8300h/aki3068net/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x080000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x200000 #endif #ifdef CONFIG_H8300H_H8MAX -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8300h/h8max/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8300h/h8max/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x080000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x200000 #endif #ifdef CONFIG_H8300H_SIM -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8300h/generic/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8300h/generic/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x400000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x400000 #endif #ifdef CONFIG_H8S_SIM -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8s/generic/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8s/generic/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x400000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x800000 #endif #ifdef CONFIG_H8S_EDOSK2674 -#ifdef CONFIG_ROMKERNEL -#include "../platform/h8s/edosk2674/rom.ld" -#endif -#ifdef CONFIG_RAMKERNEL -#include "../platform/h8s/edosk2674/ram.ld" -#endif +#define ROMTOP 0x000000 +#define ROMSIZE 0x400000 +#define RAMTOP 0x400000 +#define RAMSIZE 0x800000 #endif #if defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM) @@ -63,71 +51,51 @@ INPUT(romfs.o) _jiffies = _jiffies_64 + 4; +ENTRY(__start) + SECTIONS { #if defined(CONFIG_ROMKERNEL) + . = ROMTOP; .vectors : { __vector = . ; *(.vectors*) - } > vector -#endif -#if defined(CONFIG_RAMKERNEL) - .bootvec : + } +#else + . = RAMTOP; + .bootvec : { *(.bootvec) - } > ram + } #endif .text : { #if defined(CONFIG_ROMKERNEL) - *(.int_redirect) + *(.int_redirect) #endif __stext = . ; *(.text) SCHED_TEXT - . = ALIGN(0x4) ; - *(.exit.text) - *(.text.*) - . = ALIGN(0x4) ; - *(.exitcall.exit) - . = ALIGN(0x4) ; - *(.kstrtab) - . = ALIGN(0x4) ; - *(.rodata*) + LOCK_TEXT + __etext = . ; . = ALIGN(16); /* Exception table */ ___start___ex_table = .; *(__ex_table) ___stop___ex_table = .; + } - ___start___ksymtab = .; /* Kernel symbol table */ - *(__ksymtab) - ___stop___ksymtab = .; - - ___start___ksymtab_gpl = .; /* Kernel symbol table: GPL-only symbols */ - - *(__ksymtab_gpl) - ___stop___ksymtab_gpl = .; - - ___start___kcrctab = .; /* Kernel symbol table: Normal symbols */ - *(__kcrctab) - ___stop___kcrctab = .; - - ___start___kcrctab_gpl = .; /* Kernel symbol table: GPL-only symbols */ - *(__kcrctab_gpl) - ___stop___kcrctab_gpl = .; - - *(__ksymtab_strings) /* Kernel symbol table: strings */ - - . = ALIGN(0x4) ; - __etext = . ; + RODATA #if defined(CONFIG_ROMKERNEL) - } > rom + SECURITY_INIT #endif -#if defined(CONFIG_RAMKERNEL) - } > ram + ROEND = .; +#if defined(CONFIG_ROMKERNEL) + . = RAMTOP; + .data : AT(ROEND) +#else + .data : #endif - .data : AT( ADDR(.text)+SIZEOF(.text)) { __sdata = . ; ___data_start = . ; @@ -162,6 +130,8 @@ SECTIONS ___con_initcall_start = .; *(.con_initcall.init) ___con_initcall_end = .; + *(.exit.text) + *(.exit.data) . = ALIGN(4); ___initramfs_start = .; *(.init.ramfs) @@ -169,14 +139,11 @@ SECTIONS . = ALIGN(0x4) ; ___init_end = .; __edata = . ; - } > ram - __begin_data = LOADADDR(.data) ; -#if defined(CONFIG_ROMKERNEL) - .erom : - { - __erom = . ; - } > erom + } +#if defined(CONFIG_RAMKERNEL) + SECURITY_INIT #endif + __begin_data = LOADADDR(.data); .bss : { . = ALIGN(0x4) ; @@ -188,15 +155,18 @@ SECTIONS __ebss = . ; __end = . ; __ramstart = .; - } > ram + } + /DISCARD/ : { + *(.exitcall.exit) + } .romfs : { *(.romfs*) - } > ram + } + . = RAMTOP+RAMSIZE; .dummy : { COMMAND_START = . - 0x200 ; __ramend = . ; - } > eram + } } - diff --git a/arch/h8300/platform/h8300h/entry.S b/arch/h8300/platform/h8300h/entry.S index bd0cf695b..2052dbb94 100644 --- a/arch/h8300/platform/h8300h/entry.S +++ b/arch/h8300/platform/h8300h/entry.S @@ -247,9 +247,9 @@ SYMBOL_NAME_LABEL(ret_from_interrupt) mov.l @(TI_FLAGS:16,er4),er1 btst #TIF_NEED_RESCHED,r1l bne SYMBOL_NAME(reschedule):16 - mov.l sp,er1 - subs #4,er1 /* adjust retpc */ - mov.l er2,er0 + mov.l sp,er0 + subs #4,er0 /* adjust retpc */ + mov.l er2,er1 jsr @SYMBOL_NAME(do_signal) #if defined(CONFIG_PREEMPT) bra done:8 /* userspace thoru */ diff --git a/arch/h8300/platform/h8s/edosk2674/crt0_rom.S b/arch/h8300/platform/h8s/edosk2674/crt0_rom.S index 09007786e..65748bf18 100644 --- a/arch/h8300/platform/h8s/edosk2674/crt0_rom.S +++ b/arch/h8300/platform/h8s/edosk2674/crt0_rom.S @@ -181,7 +181,7 @@ __command_line: .long __start .long __start vector = 2 - .rept 126-1 + .rept 126 .long _interrupt_redirect_table+vector*4 vector = vector + 1 .endr diff --git a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S index 68e5cae80..a7a53c84c 100644 --- a/arch/h8300/platform/h8s/entry.S +++ b/arch/h8300/platform/h8s/entry.S @@ -244,9 +244,9 @@ SYMBOL_NAME_LABEL(ret_from_interrupt) mov.l @(TI_FLAGS:16,er4),er1 btst #TIF_NEED_RESCHED,r1l bne SYMBOL_NAME(reschedule):16 - mov.l sp,er1 - subs #4,er1 /* adjust retpc */ - mov.l er2,er0 + mov.l sp,er0 + subs #4,er0 /* adjust retpc */ + mov.l er2,er1 jsr @SYMBOL_NAME(do_signal) #if defined(CONFIG_PREEMPT) bra done:8 /* userspace thoru */ diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 9323ae3e3..72fcbe530 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -179,6 +179,7 @@ config M386 - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D). - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird). - "Crusoe" for the Transmeta Crusoe series. + - "Efficeon" for the Transmeta Efficeon series. - "Winchip-C6" for original IDT Winchip. - "Winchip-2" for IDT Winchip 2. - "Winchip-2A" for IDT Winchips with 3dNow! capabilities. @@ -199,7 +200,7 @@ config M586 bool "586/K5/5x86/6x86/6x86MX" help Select this for an 586 or 686 series processor such as the AMD K5, - the Intel 5x86 or 6x86, or the Intel 6x86MX. This choice does not + the Cyrix 5x86, 6x86 and 6x86MX. This choice does not assume the RDTSC (Read Time Stamp Counter) instruction. config M586TSC @@ -281,6 +282,11 @@ config MCRUSOE like a 586 with TSC, and sets some GCC optimization flags (like a Pentium Pro with no alignment requirements). +config MEFFICEON + bool "Efficeon" + help + Select this for a Transmeta Efficeon processor. + config MWINCHIPC6 bool "Winchip-C6" help @@ -354,7 +360,7 @@ config X86_L1_CACHE_SHIFT int default "7" if MPENTIUM4 || X86_GENERIC default "4" if X86_ELAN || M486 || M386 - default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 + default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 default "6" if MK7 || MK8 || MPENTIUMM config RWSEM_GENERIC_SPINLOCK @@ -367,6 +373,10 @@ config RWSEM_XCHGADD_ALGORITHM depends on !M386 default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config X86_PPRO_FENCE bool depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 @@ -404,17 +414,17 @@ config X86_ALIGNMENT_16 config X86_GOOD_APIC bool - depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 + depends on MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || MK8 || MEFFICEON default y config X86_INTEL_USERCOPY bool - depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 + depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON default y config X86_USE_PPRO_CHECKSUM bool - depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON default y config X86_USE_3DNOW @@ -507,6 +517,17 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +config PREEMPT_BKL + bool "Preempt The Big Kernel Lock" + depends on PREEMPT + default y + help + This option reduces the latency of the kernel by making the + big kernel lock preemptible. + + Say Y here if you are building a kernel for a desktop system. + Say N if you are unsure. + config X86_UP_APIC bool "Local APIC support on uniprocessors" if !SMP depends on !(X86_VISWS || X86_VOYAGER) @@ -547,9 +568,17 @@ config X86_IO_APIC depends on !SMP && X86_UP_IOAPIC default y +config KERNEL_HZ + int "Timer Frequency (100-20000)" + range 100 20000 + default "1000" + help + This allows you to specify the frequency at which the + kernel timer interrupt will occur. + config X86_TSC bool - depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ + depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ default y config X86_MCE @@ -584,7 +613,7 @@ config X86_MCE_NONFATAL config X86_MCE_P4THERMAL bool "check for P4 thermal throttling interrupt." - depends on X86_MCE && (X86_UP_APIC || SMP) + depends on X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS help Enabling this feature will cause a message to be printed when the P4 enters thermal throttling. @@ -861,7 +890,6 @@ config EFI depends on ACPI default n ---help--- - This enables the the kernel to boot on EFI platforms using system configuration information passed to it from the firmware. This also enables the kernel to use any EFI runtime services that are @@ -900,7 +928,7 @@ config REGPARM depends on EXPERIMENTAL default n help - Compile the kernel with -mregparm=3. This uses an different ABI + Compile the kernel with -mregparm=3. This uses a different ABI and passes the first three arguments of a function call in registers. This will probably break binary only modules. @@ -919,7 +947,7 @@ source kernel/power/Kconfig source "drivers/acpi/Kconfig" menu "APM (Advanced Power Management) BIOS Support" -depends on PM +depends on PM && !X86_VISWS config APM tristate "APM (Advanced Power Management) BIOS support" @@ -1151,6 +1179,8 @@ config PCI_MMCONFIG select ACPI_BOOT default y +source "drivers/pci/pcie/Kconfig" + source "drivers/pci/Kconfig" config ISA @@ -1236,6 +1266,17 @@ source "crypto/Kconfig" source "lib/Kconfig" +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + +config GENERIC_IRQ_PROBE + bool + default y + config X86_SMP bool depends on SMP && !X86_VOYAGER diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug index cf069b721..ffb664225 100644 --- a/arch/i386/Kconfig.debug +++ b/arch/i386/Kconfig.debug @@ -55,18 +55,6 @@ config 4KSTACKS on the VM subsystem for higher order allocations. This option will also use IRQ stacks to compensate for the reduced stackspace. -config SCHEDSTATS - bool "Collect scheduler statistics" - depends on DEBUG_KERNEL && PROC_FS - help - If you say Y here, additional code will be inserted into the - scheduler and related routines to collect statistics about - scheduler behavior and provide them in /proc/schedstat. These - stats may be useful for both tuning and debugging the scheduler - If you aren't debugging the scheduler or trying to tune a specific - application, you can say N to avoid the very slight overhead - this adds. - config X86_FIND_SMP_CONFIG bool depends on X86_LOCAL_APIC || X86_VOYAGER diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 8fc05ee7c..8be151e67 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -25,23 +25,24 @@ CFLAGS += -pipe -msoft-float # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) -align := $(subst -functions=0,,$(call cc-option,-falign-functions=0,-malign-functions=0)) +align := $(cc-option-align) cflags-$(CONFIG_M386) += -march=i386 cflags-$(CONFIG_M486) += -march=i486 cflags-$(CONFIG_M586) += -march=i586 cflags-$(CONFIG_M586TSC) += -march=i586 cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586) cflags-$(CONFIG_M686) += -march=i686 -cflags-$(CONFIG_MPENTIUMII) += $(call cc-option,-march=pentium2,-march=i686) -cflags-$(CONFIG_MPENTIUMIII) += $(call cc-option,-march=pentium3,-march=i686) -cflags-$(CONFIG_MPENTIUMM) += $(call cc-option,-march=pentium3,-march=i686) -cflags-$(CONFIG_MPENTIUM4) += $(call cc-option,-march=pentium4,-march=i686) +cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call cc-option,-mtune=pentium2) +cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call cc-option,-mtune=pentium3) +cflags-$(CONFIG_MPENTIUMM) += -march=i686 $(call cc-option,-mtune=pentium3) +cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call cc-option,-mtune=pentium4) cflags-$(CONFIG_MK6) += -march=k6 # Please note, that patches that add -march=athlon-xp and friends are pointless. # They make zero difference whatsosever to performance at this time. cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4) cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)) cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 +cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call cc-option,-mtune=pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586) cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) diff --git a/arch/i386/boot/edd.S b/arch/i386/boot/edd.S index 889790693..027d6b354 100644 --- a/arch/i386/boot/edd.S +++ b/arch/i386/boot/edd.S @@ -1,5 +1,6 @@ /* * BIOS Enhanced Disk Drive support + * Copyright (C) 2002, 2003, 2004 Dell, Inc. * by Matt Domsch October 2002 * conformant to T13 Committee www.t13.org * projects 1572D, 1484D, 1386D, 1226DT @@ -7,14 +8,52 @@ * and Andrew Wilks September 2003, June 2004 * legacy CHS retreival by Patrick J. LoPresti * March 2004 + * Command line option parsing, Matt Domsch, November 2004 */ #include +#include #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) + movb $0, (EDD_MBR_SIG_NR_BUF) + movb $0, (EDDNR) + +# Check the command line for two options: +# edd=of disables EDD completely (edd=off) +# edd=sk skips the MBR test (edd=skipmbr) + pushl %esi + cmpl $0, %cs:cmd_line_ptr + jz done_cl + movl %cs:(cmd_line_ptr), %esi +# ds:esi has the pointer to the command line now + movl $(COMMAND_LINE_SIZE-7), %ecx +# loop through kernel command line one byte at a time +cl_loop: + cmpl $EDD_CL_EQUALS, (%si) + jz found_edd_equals + incl %esi + loop cl_loop + jmp done_cl +found_edd_equals: +# only looking at first two characters after equals + addl $4, %esi + cmpw $EDD_CL_OFF, (%si) # edd=of + jz do_edd_off + cmpw $EDD_CL_SKIP, (%si) # edd=sk + jz do_edd_skipmbr + jmp done_cl +do_edd_skipmbr: + popl %esi + jmp edd_start +do_edd_off: + popl %esi + jmp edd_done +done_cl: + popl %esi + + # Read the first sector of each BIOS disk device and store the 4-byte signature edd_mbr_sig_start: - movb $0, (EDD_MBR_SIG_NR_BUF) # zero value at EDD_MBR_SIG_NR_BUF movb $0x80, %dl # from device 80 movw $EDD_MBR_SIG_BUF, %bx # store buffer ptr in bx edd_mbr_sig_read: @@ -76,7 +115,6 @@ edd_start: # result buffer for fn48 movw $EDDBUF+EDDEXTSIZE, %si # in ds:si, fn41 results # kept just before that - movb $0, (EDDNR) # zero value at EDDNR movb $0x80, %dl # BIOS device 0x80 edd_check_ext: diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S index 5623e821f..a934ab32b 100644 --- a/arch/i386/boot/setup.S +++ b/arch/i386/boot/setup.S @@ -162,7 +162,9 @@ ramdisk_max: .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff # the contents of an initrd trampoline: call start_of_setup - .space 1024 + .align 16 + # The offset at this point is 0x240 + .space (0x7ff-0x240+1) # E820 & EDD space (ending at 0x7ff) # End of setup header ##################################################### start_of_setup: diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S index a6e043c46..925d3f5a3 100644 --- a/arch/i386/boot/video.S +++ b/arch/i386/boot/video.S @@ -1936,7 +1936,7 @@ store_edid: movl $0x13131313, %eax # memset block with 0x13 movw $32, %cx - movw $0x440, %di + movw $0x140, %di cld rep stosl @@ -1945,7 +1945,7 @@ store_edid: movw $0x01, %bx movw $0x00, %cx movw $0x01, %dx - movw $0x440, %di + movw $0x140, %di int $0x10 popw %di # restore all registers diff --git a/arch/i386/crypto/aes-i586-asm.S b/arch/i386/crypto/aes-i586-asm.S index e8a04713d..7b73c67cb 100644 --- a/arch/i386/crypto/aes-i586-asm.S +++ b/arch/i386/crypto/aes-i586-asm.S @@ -61,7 +61,6 @@ #define r3 edx #define r4 esi #define r5 edi -#define r6 ebp #define eaxl al #define eaxh ah @@ -84,60 +83,63 @@ // output registers r0, r1, r4 or r5. // Parameters: +// table table base address // %1 out_state[0] // %2 out_state[1] // %3 out_state[2] // %4 out_state[3] -// %5 table base address -// %6 input register for the round (destroyed) -// %7 scratch register for the round - -#define do_col(a1, a2, a3, a4, a5, a6, a7) \ - movzx %l(a6),%a7; \ - xor a5(,%a7,4),%a1; \ - movzx %h(a6),%a7; \ - shr $16,%a6; \ - xor a5+tlen(,%a7,4),%a2; \ - movzx %l(a6),%a7; \ - movzx %h(a6),%a6; \ - xor a5+2*tlen(,%a7,4),%a3; \ - xor a5+3*tlen(,%a6,4),%a4; +// idx input register for the round (destroyed) +// tmp scratch register for the round +// sched key schedule + +#define do_col(table, a1,a2,a3,a4, idx, tmp) \ + movzx %l(idx),%tmp; \ + xor table(,%tmp,4),%a1; \ + movzx %h(idx),%tmp; \ + shr $16,%idx; \ + xor table+tlen(,%tmp,4),%a2; \ + movzx %l(idx),%tmp; \ + movzx %h(idx),%idx; \ + xor table+2*tlen(,%tmp,4),%a3; \ + xor table+3*tlen(,%idx,4),%a4; // initialise output registers from the key schedule - -#define do_fcol(a1, a2, a3, a4, a5, a6, a7, a8) \ - mov 0 a8,%a1; \ - movzx %l(a6),%a7; \ - mov 12 a8,%a2; \ - xor a5(,%a7,4),%a1; \ - mov 4 a8,%a4; \ - movzx %h(a6),%a7; \ - shr $16,%a6; \ - xor a5+tlen(,%a7,4),%a2; \ - movzx %l(a6),%a7; \ - movzx %h(a6),%a6; \ - xor a5+3*tlen(,%a6,4),%a4; \ - mov %a3,%a6; \ - mov 8 a8,%a3; \ - xor a5+2*tlen(,%a7,4),%a3; +// NB1: original value of a3 is in idx on exit +// NB2: original values of a1,a2,a4 aren't used +#define do_fcol(table, a1,a2,a3,a4, idx, tmp, sched) \ + mov 0 sched,%a1; \ + movzx %l(idx),%tmp; \ + mov 12 sched,%a2; \ + xor table(,%tmp,4),%a1; \ + mov 4 sched,%a4; \ + movzx %h(idx),%tmp; \ + shr $16,%idx; \ + xor table+tlen(,%tmp,4),%a2; \ + movzx %l(idx),%tmp; \ + movzx %h(idx),%idx; \ + xor table+3*tlen(,%idx,4),%a4; \ + mov %a3,%idx; \ + mov 8 sched,%a3; \ + xor table+2*tlen(,%tmp,4),%a3; // initialise output registers from the key schedule - -#define do_icol(a1, a2, a3, a4, a5, a6, a7, a8) \ - mov 0 a8,%a1; \ - movzx %l(a6),%a7; \ - mov 4 a8,%a2; \ - xor a5(,%a7,4),%a1; \ - mov 12 a8,%a4; \ - movzx %h(a6),%a7; \ - shr $16,%a6; \ - xor a5+tlen(,%a7,4),%a2; \ - movzx %l(a6),%a7; \ - movzx %h(a6),%a6; \ - xor a5+3*tlen(,%a6,4),%a4; \ - mov %a3,%a6; \ - mov 8 a8,%a3; \ - xor a5+2*tlen(,%a7,4),%a3; +// NB1: original value of a3 is in idx on exit +// NB2: original values of a1,a2,a4 aren't used +#define do_icol(table, a1,a2,a3,a4, idx, tmp, sched) \ + mov 0 sched,%a1; \ + movzx %l(idx),%tmp; \ + mov 4 sched,%a2; \ + xor table(,%tmp,4),%a1; \ + mov 12 sched,%a4; \ + movzx %h(idx),%tmp; \ + shr $16,%idx; \ + xor table+tlen(,%tmp,4),%a2; \ + movzx %l(idx),%tmp; \ + movzx %h(idx),%idx; \ + xor table+3*tlen(,%idx,4),%a4; \ + mov %a3,%idx; \ + mov 8 sched,%a3; \ + xor table+2*tlen(,%tmp,4),%a3; // original Gladman had conditional saves to MMX regs. @@ -147,44 +149,75 @@ #define restore(a1, a2) \ mov 4*a2(%esp),%a1 -// This macro performs a forward encryption cycle. It is entered with -// the first previous round column values in r0, r1, r4 and r5 and -// exits with the final values in the same registers, using the MMX -// registers mm0-mm1 or the stack for temporary storage - -// mov current column values into the MMX registers -#define fwd_rnd(arg, table) \ - /* mov current column values into the MMX registers */ \ - mov %r0,%r2; \ - save (0,r1); \ - save (1,r5); \ - \ - /* compute new column values */ \ - do_fcol(r0,r5,r4,r1,table, r2,r3, arg); \ - do_col (r4,r1,r0,r5,table, r2,r3); \ - restore(r2,0); \ - do_col (r1,r0,r5,r4,table, r2,r3); \ - restore(r2,1); \ - do_col (r5,r4,r1,r0,table, r2,r3); - -// This macro performs an inverse encryption cycle. It is entered with -// the first previous round column values in r0, r1, r4 and r5 and -// exits with the final values in the same registers, using the MMX -// registers mm0-mm1 or the stack for temporary storage - -#define inv_rnd(arg, table) \ - /* mov current column values into the MMX registers */ \ - mov %r0,%r2; \ - save (0,r1); \ - save (1,r5); \ - \ - /* compute new column values */ \ - do_icol(r0,r1,r4,r5, table, r2,r3, arg); \ - do_col (r4,r5,r0,r1, table, r2,r3); \ - restore(r2,0); \ - do_col (r1,r4,r5,r0, table, r2,r3); \ - restore(r2,1); \ - do_col (r5,r0,r1,r4, table, r2,r3); +// These macros perform a forward encryption cycle. They are entered with +// the first previous round column values in r0,r1,r4,r5 and +// exit with the final values in the same registers, using stack +// for temporary storage. + +// round column values +// on entry: r0,r1,r4,r5 +// on exit: r2,r1,r4,r5 +#define fwd_rnd1(arg, table) \ + save (0,r1); \ + save (1,r5); \ + \ + /* compute new column values */ \ + do_fcol(table, r2,r5,r4,r1, r0,r3, arg); /* idx=r0 */ \ + do_col (table, r4,r1,r2,r5, r0,r3); /* idx=r4 */ \ + restore(r0,0); \ + do_col (table, r1,r2,r5,r4, r0,r3); /* idx=r1 */ \ + restore(r0,1); \ + do_col (table, r5,r4,r1,r2, r0,r3); /* idx=r5 */ + +// round column values +// on entry: r2,r1,r4,r5 +// on exit: r0,r1,r4,r5 +#define fwd_rnd2(arg, table) \ + save (0,r1); \ + save (1,r5); \ + \ + /* compute new column values */ \ + do_fcol(table, r0,r5,r4,r1, r2,r3, arg); /* idx=r2 */ \ + do_col (table, r4,r1,r0,r5, r2,r3); /* idx=r4 */ \ + restore(r2,0); \ + do_col (table, r1,r0,r5,r4, r2,r3); /* idx=r1 */ \ + restore(r2,1); \ + do_col (table, r5,r4,r1,r0, r2,r3); /* idx=r5 */ + +// These macros performs an inverse encryption cycle. They are entered with +// the first previous round column values in r0,r1,r4,r5 and +// exit with the final values in the same registers, using stack +// for temporary storage + +// round column values +// on entry: r0,r1,r4,r5 +// on exit: r2,r1,r4,r5 +#define inv_rnd1(arg, table) \ + save (0,r1); \ + save (1,r5); \ + \ + /* compute new column values */ \ + do_icol(table, r2,r1,r4,r5, r0,r3, arg); /* idx=r0 */ \ + do_col (table, r4,r5,r2,r1, r0,r3); /* idx=r4 */ \ + restore(r0,0); \ + do_col (table, r1,r4,r5,r2, r0,r3); /* idx=r1 */ \ + restore(r0,1); \ + do_col (table, r5,r2,r1,r4, r0,r3); /* idx=r5 */ + +// round column values +// on entry: r2,r1,r4,r5 +// on exit: r0,r1,r4,r5 +#define inv_rnd2(arg, table) \ + save (0,r1); \ + save (1,r5); \ + \ + /* compute new column values */ \ + do_icol(table, r0,r1,r4,r5, r2,r3, arg); /* idx=r2 */ \ + do_col (table, r4,r5,r0,r1, r2,r3); /* idx=r4 */ \ + restore(r2,0); \ + do_col (table, r1,r4,r5,r0, r2,r3); /* idx=r1 */ \ + restore(r2,1); \ + do_col (table, r5,r0,r1,r4, r2,r3); /* idx=r5 */ // AES (Rijndael) Encryption Subroutine @@ -198,7 +231,6 @@ aes_enc_blk: push %ebp mov ctx(%esp),%ebp // pointer to context - xor %eax,%eax // CAUTION: the order and the values used in these assigns // rely on the register mappings @@ -208,7 +240,9 @@ aes_enc_blk: push %esi mov nrnd(%ebp),%r3 // number of rounds push %edi - lea ekey(%ebp),%r6 // key pointer +#if ekey != 0 + lea ekey(%ebp),%ebp // key pointer +#endif // input four columns and xor in first round key @@ -216,47 +250,47 @@ aes_enc_blk: mov 4(%r2),%r1 mov 8(%r2),%r4 mov 12(%r2),%r5 - xor (%r6),%r0 - xor 4(%r6),%r1 - xor 8(%r6),%r4 - xor 12(%r6),%r5 + xor (%ebp),%r0 + xor 4(%ebp),%r1 + xor 8(%ebp),%r4 + xor 12(%ebp),%r5 sub $8,%esp // space for register saves on stack - add $16,%r6 // increment to next round key + add $16,%ebp // increment to next round key sub $10,%r3 je 4f // 10 rounds for 128-bit key - add $32,%r6 + add $32,%ebp sub $2,%r3 je 3f // 12 rounds for 128-bit key - add $32,%r6 - -2: fwd_rnd( -64(%r6) ,ft_tab) // 14 rounds for 128-bit key - fwd_rnd( -48(%r6) ,ft_tab) -3: fwd_rnd( -32(%r6) ,ft_tab) // 12 rounds for 128-bit key - fwd_rnd( -16(%r6) ,ft_tab) -4: fwd_rnd( (%r6) ,ft_tab) // 10 rounds for 128-bit key - fwd_rnd( +16(%r6) ,ft_tab) - fwd_rnd( +32(%r6) ,ft_tab) - fwd_rnd( +48(%r6) ,ft_tab) - fwd_rnd( +64(%r6) ,ft_tab) - fwd_rnd( +80(%r6) ,ft_tab) - fwd_rnd( +96(%r6) ,ft_tab) - fwd_rnd(+112(%r6) ,ft_tab) - fwd_rnd(+128(%r6) ,ft_tab) - fwd_rnd(+144(%r6) ,fl_tab) // last round uses a different table + add $32,%ebp + +2: fwd_rnd1( -64(%ebp) ,ft_tab) // 14 rounds for 128-bit key + fwd_rnd2( -48(%ebp) ,ft_tab) +3: fwd_rnd1( -32(%ebp) ,ft_tab) // 12 rounds for 128-bit key + fwd_rnd2( -16(%ebp) ,ft_tab) +4: fwd_rnd1( (%ebp) ,ft_tab) // 10 rounds for 128-bit key + fwd_rnd2( +16(%ebp) ,ft_tab) + fwd_rnd1( +32(%ebp) ,ft_tab) + fwd_rnd2( +48(%ebp) ,ft_tab) + fwd_rnd1( +64(%ebp) ,ft_tab) + fwd_rnd2( +80(%ebp) ,ft_tab) + fwd_rnd1( +96(%ebp) ,ft_tab) + fwd_rnd2(+112(%ebp) ,ft_tab) + fwd_rnd1(+128(%ebp) ,ft_tab) + fwd_rnd2(+144(%ebp) ,fl_tab) // last round uses a different table // move final values to the output array. CAUTION: the // order of these assigns rely on the register mappings add $8,%esp - mov out_blk+12(%esp),%r6 - mov %r5,12(%r6) + mov out_blk+12(%esp),%ebp + mov %r5,12(%ebp) pop %edi - mov %r4,8(%r6) + mov %r4,8(%ebp) pop %esi - mov %r1,4(%r6) + mov %r1,4(%ebp) pop %ebx - mov %r0,(%r6) + mov %r0,(%ebp) pop %ebp mov $1,%eax ret @@ -273,7 +307,6 @@ aes_enc_blk: aes_dec_blk: push %ebp mov ctx(%esp),%ebp // pointer to context - xor %eax,%eax // CAUTION: the order and the values used in these assigns // rely on the register mappings @@ -283,10 +316,12 @@ aes_dec_blk: push %esi mov nrnd(%ebp),%r3 // number of rounds push %edi - lea dkey(%ebp),%r6 // key pointer +#if dkey != 0 + lea dkey(%ebp),%ebp // key pointer +#endif mov %r3,%r0 shl $4,%r0 - add %r0,%r6 + add %r0,%ebp // input four columns and xor in first round key @@ -294,47 +329,47 @@ aes_dec_blk: mov 4(%r2),%r1 mov 8(%r2),%r4 mov 12(%r2),%r5 - xor (%r6),%r0 - xor 4(%r6),%r1 - xor 8(%r6),%r4 - xor 12(%r6),%r5 + xor (%ebp),%r0 + xor 4(%ebp),%r1 + xor 8(%ebp),%r4 + xor 12(%ebp),%r5 - sub $8,%esp // space for register saves on stack - sub $16,%r6 // increment to next round key + sub $8,%esp // space for register saves on stack + sub $16,%ebp // increment to next round key sub $10,%r3 je 4f // 10 rounds for 128-bit key - sub $32,%r6 + sub $32,%ebp sub $2,%r3 je 3f // 12 rounds for 128-bit key - sub $32,%r6 - -2: inv_rnd( +64(%r6), it_tab) // 14 rounds for 128-bit key - inv_rnd( +48(%r6), it_tab) -3: inv_rnd( +32(%r6), it_tab) // 12 rounds for 128-bit key - inv_rnd( +16(%r6), it_tab) -4: inv_rnd( (%r6), it_tab) // 10 rounds for 128-bit key - inv_rnd( -16(%r6), it_tab) - inv_rnd( -32(%r6), it_tab) - inv_rnd( -48(%r6), it_tab) - inv_rnd( -64(%r6), it_tab) - inv_rnd( -80(%r6), it_tab) - inv_rnd( -96(%r6), it_tab) - inv_rnd(-112(%r6), it_tab) - inv_rnd(-128(%r6), it_tab) - inv_rnd(-144(%r6), il_tab) // last round uses a different table + sub $32,%ebp + +2: inv_rnd1( +64(%ebp), it_tab) // 14 rounds for 128-bit key + inv_rnd2( +48(%ebp), it_tab) +3: inv_rnd1( +32(%ebp), it_tab) // 12 rounds for 128-bit key + inv_rnd2( +16(%ebp), it_tab) +4: inv_rnd1( (%ebp), it_tab) // 10 rounds for 128-bit key + inv_rnd2( -16(%ebp), it_tab) + inv_rnd1( -32(%ebp), it_tab) + inv_rnd2( -48(%ebp), it_tab) + inv_rnd1( -64(%ebp), it_tab) + inv_rnd2( -80(%ebp), it_tab) + inv_rnd1( -96(%ebp), it_tab) + inv_rnd2(-112(%ebp), it_tab) + inv_rnd1(-128(%ebp), it_tab) + inv_rnd2(-144(%ebp), il_tab) // last round uses a different table // move final values to the output array. CAUTION: the // order of these assigns rely on the register mappings add $8,%esp - mov out_blk+12(%esp),%r6 - mov %r5,12(%r6) + mov out_blk+12(%esp),%ebp + mov %r5,12(%ebp) pop %edi - mov %r4,8(%r6) + mov %r4,8(%ebp) pop %esi - mov %r1,4(%r6) + mov %r1,4(%ebp) pop %ebx - mov %r0,(%r6) + mov %r0,(%ebp) pop %ebp mov $1,%eax ret diff --git a/arch/i386/crypto/aes.c b/arch/i386/crypto/aes.c index 5a34ee9e4..1019430fc 100644 --- a/arch/i386/crypto/aes.c +++ b/arch/i386/crypto/aes.c @@ -93,12 +93,12 @@ static u32 rcon_tab[RC_LENGTH]; u32 ft_tab[4][256]; u32 fl_tab[4][256]; -u32 ls_tab[4][256]; -u32 im_tab[4][256]; +static u32 ls_tab[4][256]; +static u32 im_tab[4][256]; u32 il_tab[4][256]; u32 it_tab[4][256]; -void gen_tabs(void) +static void gen_tabs(void) { u32 i, w; u8 pow[512], log[256]; diff --git a/arch/i386/defconfig b/arch/i386/defconfig index aed3bc298..8b91f12fd 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -71,6 +71,7 @@ CONFIG_MPENTIUM4=y # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set @@ -533,7 +534,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 3d828bbac..711a5249f 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -5,9 +5,9 @@ extra-y := head.o init_task.o vmlinux.lds obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ + ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ - doublefault.o + doublefault.o quirks.o obj-y += cpu/ obj-y += timers/ diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile index 2cf76a941..ee75cb286 100644 --- a/arch/i386/kernel/acpi/Makefile +++ b/arch/i386/kernel/acpi/Makefile @@ -1,3 +1,4 @@ obj-$(CONFIG_ACPI_BOOT) := boot.o +obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 8a0536250..9ba0b957d 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c @@ -40,7 +40,7 @@ #ifdef CONFIG_X86_64 static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) { } -static inline void clustered_apic_check(void) { } +extern void __init clustered_apic_check(void); static inline int ioapic_setup_disabled(void) { return 0; } #include @@ -409,28 +409,38 @@ acpi_parse_nmi_src ( void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) { - unsigned char mask = 1 << (irq & 7); - unsigned int port = 0x4d0 + (irq >> 3); - unsigned char val = inb(port); + unsigned int mask = 1 << irq; + unsigned int old, new; - - printk(PREFIX "IRQ%d SCI:", irq); - if (!(val & mask)) { - printk(" Edge"); + /* Real old ELCR mask */ + old = inb(0x4d0) | (inb(0x4d1) << 8); - if (trigger == 3) { - printk(" set to Level"); - outb(val | mask, port); - } - } else { - printk(" Level"); + /* + * If we use ACPI to set PCI irq's, then we should clear ELCR + * since we will set it correctly as we enable the PCI irq + * routing. + */ + new = acpi_noirq ? old : 0; - if (trigger == 1) { - printk(" set to Edge"); - outb(val & ~mask, port); - } + /* + * Update SCI information in the ELCR, it isn't in the PCI + * routing tables.. + */ + switch (trigger) { + case 1: /* Edge - clear */ + new &= ~mask; + break; + case 3: /* Level - set */ + new |= mask; + break; } - printk(" Trigger.\n"); + + if (old == new) + return; + + printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old); + outb(new, 0x4d0); + outb(new >> 8, 0x4d1); } @@ -450,35 +460,52 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) { unsigned int irq; + unsigned int plat_gsi = gsi; #ifdef CONFIG_PCI /* * Make sure all (legacy) PCI IRQs are set as level-triggered. */ if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { - static u16 irq_mask; extern void eisa_set_level_irq(unsigned int irq); - if (edge_level == ACPI_LEVEL_SENSITIVE) { - if ((gsi < 16) && !((1 << gsi) & irq_mask)) { - Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi); - irq_mask |= (1 << gsi); + if (edge_level == ACPI_LEVEL_SENSITIVE) eisa_set_level_irq(gsi); - } - } } #endif #ifdef CONFIG_X86_IO_APIC if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) { - mp_register_gsi(gsi, edge_level, active_high_low); + plat_gsi = mp_register_gsi(gsi, edge_level, active_high_low); } #endif - acpi_gsi_to_irq(gsi, &irq); + acpi_gsi_to_irq(plat_gsi, &irq); return irq; } EXPORT_SYMBOL(acpi_register_gsi); +/* + * ACPI based hotplug support for CPU + */ +#ifdef CONFIG_ACPI_HOTPLUG_CPU +int +acpi_map_lsapic(acpi_handle handle, int *pcpu) +{ + /* TBD */ + return -EINVAL; +} +EXPORT_SYMBOL(acpi_map_lsapic); + + +int +acpi_unmap_lsapic(int cpu) +{ + /* TBD */ + return -EINVAL; +} +EXPORT_SYMBOL(acpi_unmap_lsapic); +#endif /* CONFIG_ACPI_HOTPLUG_CPU */ + static unsigned long __init acpi_scan_rsdp ( unsigned long start, @@ -748,7 +775,7 @@ acpi_process_madt(void) int count, error; count = acpi_table_parse(ACPI_APIC, acpi_parse_madt); - if (count == 1) { + if (count >= 1) { /* * Parse MADT LAPIC entries @@ -783,13 +810,16 @@ acpi_process_madt(void) } /* - * acpi_boot_init() + * acpi_boot_table_init() and acpi_boot_init() * called from setup_arch(), always. * 1. checksums all tables * 2. enumerates lapics * 3. enumerates io-apics * - * side effects: + * acpi_table_init() is separate to allow reading SRAT without + * other side effects. + * + * side effects of acpi_boot_init: * acpi_lapic = 1 if LAPIC found * acpi_ioapic = 1 if IOAPIC found * if (acpi_lapic && acpi_ioapic) smp_found_config = 1; @@ -803,7 +833,7 @@ acpi_process_madt(void) */ int __init -acpi_boot_init (void) +acpi_boot_table_init(void) { int error; @@ -823,6 +853,10 @@ acpi_boot_init (void) return error; } +#ifdef __i386__ + check_acpi_pci(); +#endif + acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); /* @@ -841,6 +875,21 @@ acpi_boot_init (void) } } + return 0; +} + + +int __init acpi_boot_init(void) +{ + /* + * If acpi_disabled, bail out + * One exception: acpi=ht continues far enough to enumerate LAPICs + */ + if (acpi_disabled && !acpi_ht) + return 1; + + acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); + /* * set sci_int and PM timer address */ diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c index 2a12d12e3..be4df5548 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/i386/kernel/acpi/sleep.c @@ -56,7 +56,7 @@ int acpi_save_state_disk (void) } /* - * acpi_restore_state + * acpi_restore_state - undo effects of acpi_save_state_mem */ void acpi_restore_state_mem (void) { diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S index 2c5de1d7f..39d32484f 100644 --- a/arch/i386/kernel/acpi/wakeup.S +++ b/arch/i386/kernel/acpi/wakeup.S @@ -59,6 +59,14 @@ wakeup_code: movl $swapper_pg_dir-__PAGE_OFFSET, %eax movl %eax, %cr3 + testl $1, real_efer_save_restore - wakeup_code + jz 4f + # restore efer setting + movl real_save_efer_edx - wakeup_code, %edx + movl real_save_efer_eax - wakeup_code, %eax + mov $0xc0000080, %ecx + wrmsr +4: # make sure %cr4 is set correctly (features, etc) movl real_save_cr4 - wakeup_code, %eax movl %eax, %cr4 @@ -89,6 +97,9 @@ real_save_cr4: .long 0 real_magic: .long 0 video_mode: .long 0 video_flags: .long 0 +real_efer_save_restore: .long 0 +real_save_efer_edx: .long 0 +real_save_efer_eax: .long 0 bogus_real_magic: movw $0x0e00 + 'B', %fs:(0x12) @@ -223,6 +234,20 @@ ENTRY(acpi_copy_wakeup_routine) sldt saved_ldt str saved_tss + movl nx_enabled, %edx + movl %edx, real_efer_save_restore - wakeup_start (%eax) + testl $1, real_efer_save_restore - wakeup_start (%eax) + jz 2f + # save efer setting + pushl %eax + movl %eax, %ebx + mov $0xc0000080, %ecx + rdmsr + movl %edx, real_save_efer_edx - wakeup_start (%ebx) + movl %eax, real_save_efer_eax - wakeup_start (%ebx) + popl %eax +2: + movl %cr3, %edx movl %edx, real_save_cr3 - wakeup_start (%eax) movl %cr4, %edx @@ -253,7 +278,7 @@ save_registers: movl %edi, saved_context_edi pushfl ; popl saved_context_eflags - movl $ret_point,saved_eip + movl $ret_point, saved_eip ret @@ -270,7 +295,7 @@ ENTRY(do_suspend_lowlevel) call save_registers pushl $3 call acpi_enter_sleep_state - addl $4,%esp + addl $4, %esp ret .p2align 4,,7 ret_point: diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 64c175ff4..7f98d17a4 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -47,6 +47,24 @@ int apic_verbosity; static void apic_pm_activate(void); +/* + * 'what should we do if we get a hw irq event on an illegal vector'. + * each architecture has to answer this themselves. + */ +void ack_bad_irq(unsigned int irq) +{ + printk("unexpected IRQ trap at vector %02x\n", irq); + /* + * Currently unexpected vectors happen only on SMP and APIC. + * We _must_ ack these because every local APIC has only N + * irq slots per priority level, and a 'hanging, unacked' IRQ + * holds up an irq slot - in excessive cases (when multiple + * unexpected vectors occur) that might lock up the APIC + * completely. + */ + ack_APIC_irq(); +} + void __init apic_intr_init(void) { #ifdef CONFIG_SMP @@ -282,6 +300,10 @@ int __init verify_local_APIC(void) void __init sync_Arb_IDs(void) { + /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 */ + unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); + if (ver >= 0x14) /* P4 or higher */ + return; /* * Wait for idle. */ @@ -491,12 +513,24 @@ void __init setup_local_APIC (void) apic_pm_activate(); } +/* + * If Linux enabled the LAPIC against the BIOS default + * disable it down before re-entering the BIOS on shutdown. + * Otherwise the BIOS may get confused and not power-off. + */ +void lapic_shutdown(void) +{ + if (!cpu_has_apic || !enabled_via_apicbase) + return; + + local_irq_disable(); + disable_local_APIC(); + local_irq_enable(); +} + #ifdef CONFIG_PM static struct { - /* 'active' is true if the local APIC was enabled by us and - not the BIOS; this signifies that we are also responsible - for disabling it before entering apm/acpi suspend */ int active; /* r/w apic fields */ unsigned int apic_id; @@ -584,6 +618,10 @@ static int lapic_resume(struct sys_device *dev) return 0; } +/* + * This device has no shutdown method - fully functioning local APICs + * are needed on every CPU up until machine_halt/restart/poweroff. + */ static struct sysdev_class lapic_sysclass = { set_kset_name("lapic"), @@ -667,7 +705,7 @@ static int __init detect_init_APIC (void) u32 h, l, features; extern void get_cpu_vendor(struct cpuinfo_x86*); - /* Disabled by DMI scan or kernel option? */ + /* Disabled by kernel option? */ if (enable_local_apic < 0) return -1; @@ -681,8 +719,7 @@ static int __init detect_init_APIC (void) break; goto no_apic; case X86_VENDOR_INTEL: - if (boot_cpu_data.x86 == 6 || - (boot_cpu_data.x86 == 15 && (cpu_has_apic || enable_local_apic > 0)) || + if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 || (boot_cpu_data.x86 == 5 && cpu_has_apic)) break; goto no_apic; @@ -692,20 +729,23 @@ static int __init detect_init_APIC (void) if (!cpu_has_apic) { /* - * Over-ride BIOS and try to enable LAPIC - * only if "lapic" specified + * Over-ride BIOS and try to enable the local + * APIC only if "lapic" specified. */ - if (enable_local_apic != 1) - goto no_apic; + if (enable_local_apic <= 0) { + printk("Local APIC disabled by BIOS -- " + "you can enable it with \"lapic\"\n"); + return -1; + } /* * Some BIOSes disable the local APIC in the * APIC_BASE MSR. This can only be done in - * software for Intel P6 and AMD K7 (Model > 1). + * software for Intel P6 or later and AMD K7 + * (Model > 1) or later. */ rdmsr(MSR_IA32_APICBASE, l, h); if (!(l & MSR_IA32_APICBASE_ENABLE)) { - apic_printk(APIC_VERBOSE, "Local APIC disabled " - "by BIOS -- reenabling.\n"); + printk("Local APIC disabled by BIOS -- reenabling.\n"); l &= ~MSR_IA32_APICBASE_BASE; l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE; wrmsr(MSR_IA32_APICBASE, l, h); @@ -732,7 +772,7 @@ static int __init detect_init_APIC (void) if (nmi_watchdog != NMI_NONE) nmi_watchdog = NMI_LOCAL_APIC; - apic_printk(APIC_VERBOSE, "Found and enabled local APIC!\n"); + printk("Found and enabled local APIC!\n"); apic_pm_activate(); @@ -759,8 +799,8 @@ void __init init_apic_mappings(void) apic_phys = mp_lapic_addr; set_fixmap_nocache(FIX_APIC_BASE, apic_phys); - apic_printk(APIC_DEBUG, "mapped APIC to %08lx (%08lx)\n", APIC_BASE, - apic_phys); + printk(KERN_DEBUG "mapped APIC to %08lx (%08lx)\n", APIC_BASE, + apic_phys); /* * Fetch the APIC ID of the BSP in case we have a @@ -778,21 +818,23 @@ void __init init_apic_mappings(void) if (smp_found_config) { ioapic_phys = mp_ioapics[i].mpc_apicaddr; if (!ioapic_phys) { - printk(KERN_ERR "WARNING: bogus zero IO-APIC address found in MPTABLE, disabling IO/APIC support!\n"); - + printk(KERN_ERR + "WARNING: bogus zero IO-APIC " + "address found in MPTABLE, " + "disabling IO/APIC support!\n"); smp_found_config = 0; skip_ioapic_setup = 1; goto fake_ioapic_page; } } else { fake_ioapic_page: - ioapic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); + ioapic_phys = (unsigned long) + alloc_bootmem_pages(PAGE_SIZE); ioapic_phys = __pa(ioapic_phys); } set_fixmap_nocache(idx, ioapic_phys); - apic_printk(APIC_DEBUG, "mapped IOAPIC to " - "%08lx (%08lx)\n", - __fix_to_virt(idx), ioapic_phys); + printk(KERN_DEBUG "mapped IOAPIC to %08lx (%08lx)\n", + __fix_to_virt(idx), ioapic_phys); idx++; } } @@ -834,30 +876,25 @@ static unsigned int __init get_8254_timer_count(void) /* next tick in 8254 can be caught by catching timer wraparound */ static void __init wait_8254_wraparound(void) { - unsigned int curr_count, prev_count=~0; - int delta; + unsigned int curr_count, prev_count; curr_count = get_8254_timer_count(); - do { prev_count = curr_count; curr_count = get_8254_timer_count(); - delta = curr_count-prev_count; - /* - * This limit for delta seems arbitrary, but it isn't, it's - * slightly above the level of error a buggy Mercury/Neptune - * chipset timer can cause. - */ + /* workaround for broken Mercury/Neptune */ + if (prev_count >= curr_count + 0x100) + curr_count = get_8254_timer_count(); - } while (delta < 300); + } while (prev_count >= curr_count); } /* * Default initialization for 8254 timers. If we use other timers like HPET, * we override this later */ -void (*wait_timer_tick)(void) = wait_8254_wraparound; +void (*wait_timer_tick)(void) __initdata = wait_8254_wraparound; /* * This function sets up the local APIC timer, with a timeout of @@ -893,7 +930,7 @@ void __setup_APIC_LVTT(unsigned int clocks) apic_write_around(APIC_TMICT, clocks/APIC_DIVISOR); } -static void setup_APIC_timer(unsigned int clocks) +static void __init setup_APIC_timer(unsigned int clocks) { unsigned long flags; @@ -1008,9 +1045,7 @@ void __init setup_boot_APIC_clock(void) void __init setup_secondary_APIC_clock(void) { - local_irq_disable(); /* FIXME: Do we need this? --RR */ setup_APIC_timer(calibration_result); - local_irq_enable(); } void __init disable_APIC_timer(void) @@ -1123,7 +1158,7 @@ inline void smp_local_timer_interrupt(struct pt_regs * regs) * interrupt as well. Thus we cannot inline the local irq ... ] */ -void smp_apic_timer_interrupt(struct pt_regs regs) +fastcall void smp_apic_timer_interrupt(struct pt_regs *regs) { int cpu = smp_processor_id(); @@ -1143,14 +1178,14 @@ void smp_apic_timer_interrupt(struct pt_regs regs) * interrupt lock, which is the WrongThing (tm) to do. */ irq_enter(); - smp_local_timer_interrupt(®s); + smp_local_timer_interrupt(regs); irq_exit(); } /* * This interrupt should _never_ happen with our APIC/SMP architecture */ -asmlinkage void smp_spurious_interrupt(void) +fastcall void smp_spurious_interrupt(struct pt_regs *regs) { unsigned long v; @@ -1174,7 +1209,7 @@ asmlinkage void smp_spurious_interrupt(void) * This interrupt should never happen with our APIC/SMP architecture */ -asmlinkage void smp_error_interrupt(void) +fastcall void smp_error_interrupt(struct pt_regs *regs) { unsigned long v, v1; diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index d9a80ba23..a00511649 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -424,7 +424,7 @@ static int broken_psr; static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue); static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); static struct apm_user * user_list; -static spinlock_t user_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(user_list_lock); static struct desc_struct bad_bios_desc = { 0, 0x00409200 }; static char driver_version[] = "1.16ac"; /* no spaces */ @@ -1201,8 +1201,8 @@ static int suspend(int vetoable) printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n"); } - device_suspend(3); - device_power_down(3); + device_suspend(PMSG_SUSPEND); + device_power_down(PMSG_SUSPEND); /* serialize with the timer interrupt */ write_seqlock_irq(&xtime_lock); @@ -1255,7 +1255,7 @@ static void standby(void) { int err; - device_power_down(3); + device_power_down(PMSG_SUSPEND); /* serialize with the timer interrupt */ write_seqlock_irq(&xtime_lock); /* If needed, notify drivers here */ @@ -2369,7 +2369,7 @@ static void __exit apm_exit(void) * (pm_idle), Wait for all processors to update cached/local * copies of pm_idle before proceeding. */ - synchronize_kernel(); + cpu_idle_wait(); } if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0) && (apm_info.connection_version > 0x0100)) { @@ -2393,27 +2393,27 @@ module_exit(apm_exit); MODULE_AUTHOR("Stephen Rothwell"); MODULE_DESCRIPTION("Advanced Power Management"); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, "Enable debug mode"); -MODULE_PARM(power_off, "i"); +module_param(power_off, bool, 0444); MODULE_PARM_DESC(power_off, "Enable power off"); -MODULE_PARM(bounce_interval, "i"); +module_param(bounce_interval, int, 0444); MODULE_PARM_DESC(bounce_interval, "Set the number of ticks to ignore suspend bounces"); -MODULE_PARM(allow_ints, "i"); +module_param(allow_ints, bool, 0444); MODULE_PARM_DESC(allow_ints, "Allow interrupts during BIOS calls"); -MODULE_PARM(broken_psr, "i"); +module_param(broken_psr, bool, 0444); MODULE_PARM_DESC(broken_psr, "BIOS has a broken GetPowerStatus call"); -MODULE_PARM(realmode_power_off, "i"); +module_param(realmode_power_off, bool, 0444); MODULE_PARM_DESC(realmode_power_off, "Switch to real mode before powering off"); -MODULE_PARM(idle_threshold, "i"); +module_param(idle_threshold, int, 0444); MODULE_PARM_DESC(idle_threshold, "System idle percentage above which to make APM BIOS idle calls"); -MODULE_PARM(idle_period, "i"); +module_param(idle_period, int, 0444); MODULE_PARM_DESC(idle_period, "Period (in sec/100) over which to caculate the idle percentage"); -MODULE_PARM(smp, "i"); +module_param(smp, bool, 0444); MODULE_PARM_DESC(smp, "Set this to enable APM use on an SMP platform. Use with caution on older systems"); MODULE_ALIAS_MISCDEV(APM_MINOR_DEV); diff --git a/arch/i386/kernel/cpu/Makefile b/arch/i386/kernel/cpu/Makefile index bcc15802e..010aecfff 100644 --- a/arch/i386/kernel/cpu/Makefile +++ b/arch/i386/kernel/cpu/Makefile @@ -8,7 +8,7 @@ obj-y += amd.o obj-y += cyrix.o obj-y += centaur.o obj-y += transmeta.o -obj-y += intel.o +obj-y += intel.o intel_cacheinfo.o obj-y += rise.o obj-y += nexgen.o obj-y += umc.o diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 091b98ae9..ae94585d0 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c @@ -188,6 +188,23 @@ static void __init init_amd(struct cpuinfo_x86 *c) } display_cacheinfo(c); + detect_ht(c); + +#ifdef CONFIG_X86_HT + /* AMD dual core looks like HT but isn't really. Hide it from the + scheduler. This works around problems with the domain scheduler. + Also probably gives slightly better scheduling and disables + SMT nice which is harmful on dual core. + TBD tune the domain scheduler for dual core. */ + if (cpu_has(c, X86_FEATURE_CMP_LEGACY)) + smp_num_siblings = 1; +#endif + + if (cpuid_eax(0x80000000) >= 0x80000008) { + c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; + if (c->x86_num_cores & (c->x86_num_cores - 1)) + c->x86_num_cores = 1; + } } static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 89dc79a65..026167739 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c @@ -10,6 +10,11 @@ #include #include #include +#ifdef CONFIG_X86_LOCAL_APIC +#include +#include +#include +#endif #include "cpu.h" @@ -274,8 +279,10 @@ void __init generic_identify(struct cpuinfo_x86 * c) /* AMD-defined flags: level 0x80000001 */ xlvl = cpuid_eax(0x80000000); if ( (xlvl & 0xffff0000) == 0x80000000 ) { - if ( xlvl >= 0x80000001 ) + if ( xlvl >= 0x80000001 ) { c->x86_capability[1] = cpuid_edx(0x80000001); + c->x86_capability[6] = cpuid_ecx(0x80000001); + } if ( xlvl >= 0x80000004 ) get_model_name(c); /* Default name */ } @@ -321,6 +328,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c) c->x86_model = c->x86_mask = 0; /* So far unknown... */ c->x86_vendor_id[0] = '\0'; /* Unset */ c->x86_model_id[0] = '\0'; /* Unset */ + c->x86_num_cores = 1; memset(&c->x86_capability, 0, sizeof c->x86_capability); if (!have_cpuid_p()) { @@ -334,21 +342,19 @@ void __init identify_cpu(struct cpuinfo_x86 *c) generic_identify(c); - printk(KERN_DEBUG "CPU: After generic identify, caps: %08lx %08lx %08lx %08lx\n", - c->x86_capability[0], - c->x86_capability[1], - c->x86_capability[2], - c->x86_capability[3]); + printk(KERN_DEBUG "CPU: After generic identify, caps:"); + for (i = 0; i < NCAPINTS; i++) + printk(" %08lx", c->x86_capability[i]); + printk("\n"); if (this_cpu->c_identify) { this_cpu->c_identify(c); - printk(KERN_DEBUG "CPU: After vendor identify, caps: %08lx %08lx %08lx %08lx\n", - c->x86_capability[0], - c->x86_capability[1], - c->x86_capability[2], - c->x86_capability[3]); -} + printk(KERN_DEBUG "CPU: After vendor identify, caps:"); + for (i = 0; i < NCAPINTS; i++) + printk(" %08lx", c->x86_capability[i]); + printk("\n"); + } /* * Vendor-specific initialization. In this section we @@ -398,11 +404,10 @@ void __init identify_cpu(struct cpuinfo_x86 *c) /* Now the feature flags better reflect actual CPU features! */ - printk(KERN_DEBUG "CPU: After all inits, caps: %08lx %08lx %08lx %08lx\n", - c->x86_capability[0], - c->x86_capability[1], - c->x86_capability[2], - c->x86_capability[3]); + printk(KERN_DEBUG "CPU: After all inits, caps:"); + for (i = 0; i < NCAPINTS; i++) + printk(" %08lx", c->x86_capability[i]); + printk("\n"); /* * On SMP, boot_cpu_data holds the common feature set between @@ -432,6 +437,50 @@ void __init dodgy_tsc(void) cpu_devs[X86_VENDOR_CYRIX]->c_init(&boot_cpu_data); } +#ifdef CONFIG_X86_HT +void __init detect_ht(struct cpuinfo_x86 *c) +{ + u32 eax, ebx, ecx, edx; + int index_lsb, index_msb, tmp; + int cpu = smp_processor_id(); + + if (!cpu_has(c, X86_FEATURE_HT)) + return; + + cpuid(1, &eax, &ebx, &ecx, &edx); + smp_num_siblings = (ebx & 0xff0000) >> 16; + + if (smp_num_siblings == 1) { + printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); + } else if (smp_num_siblings > 1 ) { + index_lsb = 0; + index_msb = 31; + + if (smp_num_siblings > NR_CPUS) { + printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings); + smp_num_siblings = 1; + return; + } + tmp = smp_num_siblings; + while ((tmp & 1) == 0) { + tmp >>=1 ; + index_lsb++; + } + tmp = smp_num_siblings; + while ((tmp & 0x80000000 ) == 0) { + tmp <<=1 ; + index_msb--; + } + if (index_lsb != index_msb ) + index_msb++; + phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); + + printk(KERN_INFO "CPU: Physical Processor ID: %d\n", + phys_proc_id[cpu]); + } +} +#endif + void __init print_cpu_info(struct cpuinfo_x86 *c) { char *vendor = NULL; @@ -455,7 +504,7 @@ void __init print_cpu_info(struct cpuinfo_x86 *c) printk("\n"); } -unsigned long cpu_initialized __initdata = 0; +cpumask_t cpu_initialized __initdata = CPU_MASK_NONE; /* This is hacky. :) * We're emulating future behavior. @@ -509,7 +558,7 @@ void __init cpu_init (void) struct tss_struct * t = &per_cpu(init_tss, cpu); struct thread_struct *thread = ¤t->thread; - if (test_and_set_bit(cpu, &cpu_initialized)) { + if (cpu_test_and_set(cpu, cpu_initialized)) { printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); for (;;) local_irq_enable(); } @@ -580,6 +629,6 @@ void __init cpu_init (void) * Force FPU initialization: */ current_thread_info()->status = 0; - current->used_math = 0; + clear_used_math(); mxcsr_feature_mask_init(); } diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig index 5cd444214..0283d7561 100644 --- a/arch/i386/kernel/cpu/cpufreq/Kconfig +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig @@ -4,18 +4,6 @@ menu "CPU Frequency scaling" -config CPU_FREQ - bool "CPU Frequency scaling" - help - Clock scaling allows you to change the clock speed of CPUs on the - fly. This is a nice method to save battery power on notebooks, - because the lower the clock speed, the less power the CPU consumes. - - For more information, take a look at - or at - - If in doubt, say N. - source "drivers/cpufreq/Kconfig" config CPU_FREQ_TABLE @@ -42,16 +30,6 @@ config X86_ACPI_CPUFREQ If in doubt, say N. -config X86_ACPI_CPUFREQ_PROC_INTF - bool "/proc/acpi/processor/../performance interface (deprecated)" - depends on X86_ACPI_CPUFREQ && PROC_FS - help - This enables the deprecated /proc/acpi/processor/../performance - interface. While it is helpful for debugging, the generic, - cross-architecture cpufreq interfaces should be used. - - If in doubt, say N. - config ELAN_CPUFREQ tristate "AMD Elan" depends on CPU_FREQ_TABLE && X86_ELAN @@ -95,7 +73,7 @@ config X86_POWERNOW_K7_ACPI config X86_POWERNOW_K8 tristate "AMD Opteron/Athlon64 PowerNow!" - depends on CPU_FREQ && EXPERIMENTAL + depends on CPU_FREQ_TABLE && EXPERIMENTAL help This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors. @@ -122,29 +100,40 @@ config X86_GX_SUSPMOD config X86_SPEEDSTEP_CENTRINO tristate "Intel Enhanced SpeedStep" depends on CPU_FREQ_TABLE + select X86_SPEEDSTEP_CENTRINO_TABLE if (!X86_SPEEDSTEP_CENTRINO_ACPI) help This adds the CPUFreq driver for Enhanced SpeedStep enabled - mobile CPUs. This means Intel Pentium M (Centrino) CPUs. + mobile CPUs. This means Intel Pentium M (Centrino) CPUs. However, + you also need to say Y to "Use ACPI tables to decode..." below + [which might imply enabling ACPI] if you want to use this driver + on non-Banias CPUs. For details, take a look at . If in doubt, say N. -config X86_SPEEDSTEP_CENTRINO_TABLE - bool - depends on X86_SPEEDSTEP_CENTRINO - default y - config X86_SPEEDSTEP_CENTRINO_ACPI - bool "Use ACPI tables to decode valid frequency/voltage pairs (EXPERIMENTAL)" - depends on EXPERIMENTAL + bool "Use ACPI tables to decode valid frequency/voltage pairs" + depends on X86_SPEEDSTEP_CENTRINO depends on ((X86_SPEEDSTEP_CENTRINO = "m" && ACPI_PROCESSOR) || (X86_SPEEDSTEP_CENTRINO = "y" && ACPI_PROCESSOR = "y")) + default y help Use primarily the information provided in the BIOS ACPI tables - to determine valid CPU frequency and voltage pairings. + to determine valid CPU frequency and voltage pairings. It is + required for the driver to work on non-Banias CPUs. If in doubt, say Y. +config X86_SPEEDSTEP_CENTRINO_TABLE + bool "Built-in tables for Banias CPUs" + depends on X86_SPEEDSTEP_CENTRINO + default y + help + Use built-in tables for Banias CPUs if ACPI encoding + is not available. + + If in doubt, say N. + config X86_SPEEDSTEP_ICH tristate "Intel Speedstep on ICH-M chipsets (ioport interface)" depends on CPU_FREQ_TABLE @@ -181,27 +170,23 @@ config X86_P4_CLOCKMOD If in doubt, say N. -config X86_SPEEDSTEP_LIB - tristate - depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) - default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) - -config X86_SPEEDSTEP_RELAXED_CAP_CHECK - bool "Relaxed speedstep capability checks" - depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH) +config X86_CPUFREQ_NFORCE2 + tristate "nVidia nForce2 FSB changing" + depends on CPU_FREQ && EXPERIMENTAL help - Don't perform all checks for a speedstep capable system which would - normally be done. Some ancient or strange systems, though speedstep - capable, don't always indicate that they are speedstep capable. This - option let's the probing code bypass some of those checks if the - parameter "relaxed_check=1" is passed to the module. + This adds the CPUFreq driver for FSB changing on nVidia nForce2 + platforms. + + For details, take a look at . + + If in doubt, say N. config X86_LONGRUN tristate "Transmeta LongRun" depends on CPU_FREQ help - This adds the CPUFreq driver for Transmeta Crusoe processors which - support LongRun. + This adds the CPUFreq driver for Transmeta Crusoe and Efficeon processors + which support LongRun. For details, take a look at . @@ -219,4 +204,34 @@ config X86_LONGHAUL If in doubt, say N. +comment "shared options" + depends on CPU_FREQ + +config X86_ACPI_CPUFREQ_PROC_INTF + bool "/proc/acpi/processor/../performance interface (deprecated)" + depends on PROC_FS + depends on X86_ACPI_CPUFREQ || X86_SPEEDSTEP_CENTRINO_ACPI || X86_POWERNOW_K7_ACPI || X86_POWERNOW_K8_ACPI + help + This enables the deprecated /proc/acpi/processor/../performance + interface. While it is helpful for debugging, the generic, + cross-architecture cpufreq interfaces should be used. + + If in doubt, say N. + +config X86_SPEEDSTEP_LIB + tristate + depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) + default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) + +config X86_SPEEDSTEP_RELAXED_CAP_CHECK + bool "Relaxed speedstep capability checks" + depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH) + help + Don't perform all checks for a speedstep capable system which would + normally be done. Some ancient or strange systems, though speedstep + capable, don't always indicate that they are speedstep capable. This + option lets the probing code bypass some of those checks if the + parameter "relaxed_check=1" is passed to the module. + + endmenu diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile index 2dad46e11..a922e97ae 100644 --- a/arch/i386/kernel/cpu/cpufreq/Makefile +++ b/arch/i386/kernel/cpu/cpufreq/Makefile @@ -1,19 +1,14 @@ -obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o -obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o -obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o -obj-$(CONFIG_X86_LONGHAUL) += longhaul.o -obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o -obj-$(CONFIG_X86_LONGRUN) += longrun.o -obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o -obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o -obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o -obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o -obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o -obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi.o -obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o - -ifdef CONFIG_X86_ACPI_CPUFREQ - ifdef CONFIG_ACPI_DEBUG - EXTRA_CFLAGS += -DACPI_DEBUG_OUTPUT - endif -endif +obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o +obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o +obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o +obj-$(CONFIG_X86_LONGHAUL) += longhaul.o +obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o +obj-$(CONFIG_X86_LONGRUN) += longrun.o +obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o +obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o +obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o +obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o +obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o +obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o +obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o +obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index 1e11401ef..963e17aa2 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -38,6 +38,8 @@ #include #include +#include "speedstep-est-common.h" + #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg) MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); @@ -48,10 +50,12 @@ MODULE_LICENSE("GPL"); struct cpufreq_acpi_io { struct acpi_processor_performance acpi_data; struct cpufreq_frequency_table *freq_table; + unsigned int resume; }; static struct cpufreq_acpi_io *acpi_io_data[NR_CPUS]; +static struct cpufreq_driver acpi_cpufreq_driver; static int acpi_processor_write_port( @@ -119,9 +123,14 @@ acpi_processor_set_performance ( } if (state == data->acpi_data.state) { - dprintk("Already at target state (P%d)\n", state); - retval = 0; - goto migrate_end; + if (unlikely(data->resume)) { + dprintk("Called after resume, resetting to P%d\n", state); + data->resume = 0; + } else { + dprintk("Already at target state (P%d)\n", state); + retval = 0; + goto migrate_end; + } } dprintk("Transitioning from P%d to P%d\n", @@ -368,6 +377,10 @@ acpi_cpufreq_cpu_init ( if (result) goto err_free; + if (is_const_loops_cpu(cpu)) { + acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS; + } + /* capability check */ if (data->acpi_data.state_count <= 1) { dprintk("No P-States\n"); @@ -462,6 +475,20 @@ acpi_cpufreq_cpu_exit ( return (0); } +static int +acpi_cpufreq_resume ( + struct cpufreq_policy *policy) +{ + struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; + + + dprintk("acpi_cpufreq_resume\n"); + + data->resume = 1; + + return (0); +} + static struct freq_attr* acpi_cpufreq_attr[] = { &cpufreq_freq_attr_scaling_available_freqs, @@ -473,6 +500,7 @@ static struct cpufreq_driver acpi_cpufreq_driver = { .target = acpi_cpufreq_target, .init = acpi_cpufreq_cpu_init, .exit = acpi_cpufreq_cpu_exit, + .resume = acpi_cpufreq_resume, .name = "acpi-cpufreq", .owner = THIS_MODULE, .attr = acpi_cpufreq_attr, diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c index e654e7b67..04a405345 100644 --- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c @@ -55,16 +55,7 @@ MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)"); MODULE_PARM_DESC(min_fsb, "Minimum FSB to use, if not defined: current FSB - 50"); -/* DEBUG - * Define it if you want verbose debug output, e.g. for bug reporting - */ -//#define NFORCE2_DEBUG - -#ifdef NFORCE2_DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) /* * nforce2_calc_fsb - calculate FSB diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 1f855c54c..1a49adb1f 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c @@ -141,17 +141,7 @@ module_param (max_duration, int, 0444); #define POLICY_MIN_DIV 20 -/* DEBUG - * Define it if you want verbose debug output - */ - -#define SUSPMOD_DEBUG 1 - -#ifdef SUSPMOD_DEBUG -#define dprintk(msg...) printk(KERN_DEBUG "cpufreq:" msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg) /** * we can detect a core multipiler from dir0_lsb @@ -194,18 +184,18 @@ static __init struct pci_dev *gx_detect_chipset(void) /* check if CPU is a MediaGX or a Geode. */ if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) && (current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) { - printk(KERN_INFO "gx-suspmod: error: no MediaGX/Geode processor found!\n"); + dprintk("error: no MediaGX/Geode processor found!\n"); return NULL; } /* detect which companion chip is used */ - while ((gx_pci = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { + while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) { return gx_pci; } } - dprintk(KERN_INFO "gx-suspmod: error: no supported chipset found!\n"); + dprintk("error: no supported chipset found!\n"); return NULL; } @@ -219,7 +209,7 @@ static unsigned int gx_get_cpuspeed(unsigned int cpu) if ((gx_params->pci_suscfg & SUSMOD) == 0) return stock_freq; - return (stock_freq * gx_params->on_duration) + return (stock_freq * gx_params->off_duration) / (gx_params->on_duration + gx_params->off_duration); } @@ -499,6 +489,7 @@ static int __init cpufreq_gx_init(void) static void __exit cpufreq_gx_exit(void) { cpufreq_unregister_driver(&gx_suspmod_driver); + pci_dev_put(gx_params->cs55x0); kfree(gx_params); } diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index e243f0fdd..ab0f9f5aa 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c @@ -58,21 +58,9 @@ static int vrmrev; /* Module parameters */ static int dont_scale_voltage; -static int debug; -static void dprintk(const char *fmt, ...) -{ - char s[256]; - va_list args; - - if (debug == 0) - return; - va_start(args, fmt); - vsprintf(s, fmt, args); - printk(s); - va_end(args); -} +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) #define __hlt() __asm__ __volatile__("hlt": : :"memory") @@ -84,6 +72,8 @@ static int voltage_table[32]; static unsigned int highest_speed, lowest_speed; /* kHz */ static int longhaul_version; static struct cpufreq_frequency_table *longhaul_table; + +#ifdef CONFIG_CPU_FREQ_DEBUG static char speedbuffer[8]; static char *print_speed(int speed) @@ -98,6 +88,7 @@ static char *print_speed(int speed) return speedbuffer; } +#endif static unsigned int calc_speed(int mult) @@ -192,7 +183,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index) cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); - dprintk (KERN_INFO PFX "Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", + dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", fsb, mult/10, mult%10, print_speed(speed/1000)); switch (longhaul_version) { @@ -356,7 +347,7 @@ static int __init longhaul_get_ranges(void) } } - dprintk (KERN_INFO PFX "MinMult:%d.%dx MaxMult:%d.%dx\n", + dprintk ("MinMult:%d.%dx MaxMult:%d.%dx\n", minmult/10, minmult%10, maxmult/10, maxmult%10); if (fsb == -1) { @@ -366,9 +357,9 @@ static int __init longhaul_get_ranges(void) highest_speed = calc_speed(maxmult); lowest_speed = calc_speed(minmult); - dprintk (KERN_INFO PFX "FSB:%dMHz ", fsb); - dprintk ("Lowest speed:%s ", print_speed(lowest_speed/1000)); - dprintk ("Highest speed:%s\n", print_speed(highest_speed/1000)); + dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, + print_speed(lowest_speed/1000), + print_speed(highest_speed/1000)); if (lowest_speed == highest_speed) { printk (KERN_INFO PFX "highestspeed == lowest, aborting.\n"); @@ -434,11 +425,11 @@ static void __init longhaul_setup_voltagescaling(void) } if (vrmrev==0) { - dprintk (KERN_INFO PFX "VRM 8.5 : "); + dprintk ("VRM 8.5 \n"); memcpy (voltage_table, vrm85scales, sizeof(voltage_table)); numvscales = (voltage_table[maxvid]-voltage_table[minvid])/25; } else { - dprintk (KERN_INFO PFX "Mobile VRM : "); + dprintk ("Mobile VRM \n"); memcpy (voltage_table, mobilevrmscales, sizeof(voltage_table)); numvscales = (voltage_table[maxvid]-voltage_table[minvid])/5; } @@ -658,9 +649,6 @@ static void __exit longhaul_exit(void) module_param (dont_scale_voltage, int, 0644); MODULE_PARM_DESC(dont_scale_voltage, "Don't scale voltage of processor"); -module_param (debug, int, 0644); -MODULE_PARM_DESC(debug, "Dump debugging information."); - MODULE_AUTHOR ("Dave Jones "); MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); MODULE_LICENSE ("GPL"); diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index ab3cfc3cd..e3868de4d 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c @@ -16,6 +16,8 @@ #include #include +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) + static struct cpufreq_driver longrun_driver; /** @@ -38,12 +40,14 @@ static void __init longrun_get_policy(struct cpufreq_policy *policy) u32 msr_lo, msr_hi; rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi); + dprintk("longrun flags are %x - %x\n", msr_lo, msr_hi); if (msr_lo & 0x01) policy->policy = CPUFREQ_POLICY_PERFORMANCE; else policy->policy = CPUFREQ_POLICY_POWERSAVE; rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); + dprintk("longrun ctrl is %x - %x\n", msr_lo, msr_hi); msr_lo &= 0x0000007F; msr_hi &= 0x0000007F; @@ -146,6 +150,7 @@ static unsigned int longrun_get(unsigned int cpu) return 0; cpuid(0x80860007, &eax, &ebx, &ecx, &edx); + dprintk("cpuid eax is %u\n", eax); return (eax * 1000); } @@ -191,6 +196,8 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi); *high_freq = msr_lo * 1000; /* to kHz */ + dprintk("longrun table interface told %u - %u kHz\n", *low_freq, *high_freq); + if (*low_freq > *high_freq) *low_freq = *high_freq; return 0; @@ -199,6 +206,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, /* set the upper border to the value determined during TSC init */ *high_freq = (cpu_khz / 1000); *high_freq = *high_freq * 1000; + dprintk("high frequency is %u kHz\n", *high_freq); /* get current borders */ rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); @@ -225,6 +233,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, /* restore values */ wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi); } + dprintk("percentage is %u %%, freq is %u MHz\n", ecx, eax); /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq) * eqals @@ -240,6 +249,8 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, edx = (eax - ebx) / (100 - ecx); *low_freq = edx * 1000; /* back to kHz */ + dprintk("low frequency is %u kHz\n", *low_freq); + if (*low_freq > *high_freq) *low_freq = *high_freq; @@ -308,7 +319,7 @@ static void __exit longrun_exit(void) MODULE_AUTHOR ("Dominik Brodowski "); -MODULE_DESCRIPTION ("LongRun driver for Transmeta Crusoe processors."); +MODULE_DESCRIPTION ("LongRun driver for Transmeta Crusoe and Efficeon processors."); MODULE_LICENSE ("GPL"); module_init(longrun_init); diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c index ef1394964..aa622d52c 100644 --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c @@ -36,6 +36,7 @@ #include "speedstep-lib.h" #define PFX "p4-clockmod: " +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg) /* * Duty Cycle (3bits), note DC_DISABLE is not specified in @@ -62,20 +63,20 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) return -EINVAL; rdmsr(MSR_IA32_THERM_STATUS, l, h); -#if 0 + if (l & 0x01) - printk(KERN_DEBUG PFX "CPU#%d currently thermal throttled\n", cpu); -#endif + dprintk("CPU#%d currently thermal throttled\n", cpu); + if (has_N44_O17_errata[cpu] && (newstate == DC_25PT || newstate == DC_DFLT)) newstate = DC_38PT; rdmsr(MSR_IA32_THERM_CONTROL, l, h); if (newstate == DC_DISABLE) { - /* printk(KERN_INFO PFX "CPU#%d disabling modulation\n", cpu); */ + dprintk("CPU#%d disabling modulation\n", cpu); wrmsr(MSR_IA32_THERM_CONTROL, l & ~(1<<4), h); } else { - /* printk(KERN_INFO PFX "CPU#%d setting duty cycle to %d%%\n", - cpu, ((125 * newstate) / 10)); */ + dprintk("CPU#%d setting duty cycle to %d%%\n", + cpu, ((125 * newstate) / 10)); /* bits 63 - 5 : reserved * bit 4 : enable/disable * bits 3-1 : duty cycle @@ -110,7 +111,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, { unsigned int newstate = DC_RESV; struct cpufreq_freqs freqs; - cpumask_t cpus_allowed, affected_cpu_map; + cpumask_t cpus_allowed; int i; if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0], target_freq, relation, &newstate)) @@ -122,18 +123,8 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, if (freqs.new == freqs.old) return 0; - /* switch to physical CPU where state is to be changed*/ - cpus_allowed = current->cpus_allowed; - - /* only run on CPU to be set, or on its sibling */ -#ifdef CONFIG_SMP - affected_cpu_map = cpu_sibling_map[policy->cpu]; -#else - affected_cpu_map = cpumask_of_cpu(policy->cpu); -#endif - /* notifiers */ - for_each_cpu_mask(i, affected_cpu_map) { + for_each_cpu_mask(i, policy->cpus) { freqs.cpu = i; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); } @@ -141,7 +132,9 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software * Developer's Manual, Volume 3 */ - for_each_cpu_mask(i, affected_cpu_map) { + cpus_allowed = current->cpus_allowed; + + for_each_cpu_mask(i, policy->cpus) { cpumask_t this_cpu = cpumask_of_cpu(i); set_cpus_allowed(current, this_cpu); @@ -152,7 +145,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, set_cpus_allowed(current, cpus_allowed); /* notifiers */ - for_each_cpu_mask(i, affected_cpu_map) { + for_each_cpu_mask(i, policy->cpus) { freqs.cpu = i; cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); } @@ -178,7 +171,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM); } - if ((c->x86 == 0x06) && (c->x86_model == 0x13)) { + if ((c->x86 == 0x06) && (c->x86_model == 0x0D)) { /* Pentium M (Dothan) */ printk(KERN_WARNING PFX "Warning: Pentium M detected. " "The speedstep_centrino module offers voltage scaling" @@ -219,6 +212,10 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) int cpuid = 0; unsigned int i; +#ifdef CONFIG_SMP + policy->cpus = cpu_sibling_map[policy->cpu]; +#endif + /* Errata workaround */ cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_mask; switch (cpuid) { @@ -227,6 +224,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) case 0x0f11: case 0x0f12: has_N44_O17_errata[policy->cpu] = 1; + dprintk("has errata -- disabling low frequencies\n"); } /* get max frequency */ @@ -260,14 +258,13 @@ static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy) static unsigned int cpufreq_p4_get(unsigned int cpu) { - cpumask_t cpus_allowed, affected_cpu_map; + cpumask_t cpus_allowed; u32 l, h; cpus_allowed = current->cpus_allowed; - affected_cpu_map = cpumask_of_cpu(cpu); - set_cpus_allowed(current, affected_cpu_map); - BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map)); + set_cpus_allowed(current, cpumask_of_cpu(cpu)); + BUG_ON(smp_processor_id() != cpu); rdmsr(MSR_IA32_THERM_CONTROL, l, h); @@ -305,6 +302,7 @@ static struct cpufreq_driver p4clockmod_driver = { static int __init cpufreq_p4_init(void) { struct cpuinfo_x86 *c = cpu_data; + int ret; /* * THERM_CONTROL is architectural for IA32 now, so @@ -317,9 +315,11 @@ static int __init cpufreq_p4_init(void) !test_bit(X86_FEATURE_ACC, c->x86_capability)) return -ENODEV; - printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock Modulation available\n"); + ret = cpufreq_register_driver(&p4clockmod_driver); + if (!ret) + printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock Modulation available\n"); - return cpufreq_register_driver(&p4clockmod_driver); + return (ret); } @@ -335,4 +335,3 @@ MODULE_LICENSE ("GPL"); late_initcall(cpufreq_p4_init); module_exit(cpufreq_p4_exit); - diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index c7e3aa60d..913f65262 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c @@ -66,13 +66,15 @@ union powernow_acpi_control_t { }; #endif -/* divide by 1000 to get VID. */ +#ifdef CONFIG_CPU_FREQ_DEBUG +/* divide by 1000 to get VCore voltage in V. */ static int mobile_vid_table[32] = { 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, - 1075, 1050, 1024, 1000, 975, 950, 925, 0, + 1075, 1050, 1025, 1000, 975, 950, 925, 0, }; +#endif /* divide by 10 to get FID. */ static int fid_codes[32] = { @@ -87,7 +89,6 @@ static int fid_codes[32] = { */ static int acpi_force; -static int debug; static struct cpufreq_frequency_table *powernow_table; @@ -100,20 +101,7 @@ static unsigned int fsb; static unsigned int latency; static char have_a0; -static void dprintk(const char *fmt, ...) -{ - char s[256]; - va_list args; - - if (debug==0) - return; - - va_start(args,fmt); - vsprintf(s, fmt, args); - printk(s); - va_end(args); -} - +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k7", msg) static int check_fsb(unsigned int fsbspeed) { @@ -202,9 +190,6 @@ static int get_ranges (unsigned char *pst) #endif } - dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz]) ", fid, - fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000); - if (speed < minimum_speed) minimum_speed = speed; if (speed > maximum_speed) @@ -212,8 +197,12 @@ static int get_ranges (unsigned char *pst) vid = *pst++; powernow_table[j].index |= (vid << 8); /* upper 8 bits */ - dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000, - mobile_vid_table[vid]%1000); + + dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " + "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, + fid_codes[fid] % 10, speed/1000, vid, + mobile_vid_table[vid]/1000, + mobile_vid_table[vid]%1000); } powernow_table[number_scales].frequency = CPUFREQ_TABLE_END; powernow_table[number_scales].index = 0; @@ -302,7 +291,7 @@ static void change_speed (unsigned int index) #ifdef CONFIG_X86_POWERNOW_K7_ACPI -struct acpi_processor_performance *acpi_processor_perf; +static struct acpi_processor_performance *acpi_processor_perf; static int powernow_acpi_init(void) { @@ -361,7 +350,7 @@ static int powernow_acpi_init(void) unsigned int speed; pc.val = (unsigned long) acpi_processor_perf->states[i].control; - dprintk (KERN_INFO PFX "acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", + dprintk ("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", i, (u32) acpi_processor_perf->states[i].core_frequency, (u32) acpi_processor_perf->states[i].power, @@ -383,10 +372,11 @@ static int powernow_acpi_init(void) powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; } - dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz]) ", fid, - fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000); - dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000, - mobile_vid_table[vid]%1000); + dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " + "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, + fid_codes[fid] % 10, speed/1000, vid, + mobile_vid_table[vid]/1000, + mobile_vid_table[vid]%1000); if (latency < pc.bits.sgtc) latency = pc.bits.sgtc; @@ -400,6 +390,9 @@ static int powernow_acpi_init(void) powernow_table[i].frequency = CPUFREQ_TABLE_END; powernow_table[i].index = 0; + /* notify BIOS that we exist */ + acpi_processor_notify_smm(THIS_MODULE); + return 0; err2: @@ -436,21 +429,20 @@ static int powernow_decode_bios (int maxfid, int startvid) p = phys_to_virt(i); if (memcmp(p, "AMDK7PNOW!", 10) == 0){ - dprintk (KERN_INFO PFX "Found PSB header at %p\n", p); + dprintk ("Found PSB header at %p\n", p); psb = (struct psb_s *) p; - dprintk (KERN_INFO PFX "Table version: 0x%x\n", psb->tableversion); + dprintk ("Table version: 0x%x\n", psb->tableversion); if (psb->tableversion != 0x12) { printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n"); return -ENODEV; } - dprintk (KERN_INFO PFX "Flags: 0x%x (", psb->flags); + dprintk ("Flags: 0x%x\n", psb->flags); if ((psb->flags & 1)==0) { - dprintk ("Mobile"); + dprintk ("Mobile voltage regulator\n"); } else { - dprintk ("Desktop"); + dprintk ("Desktop voltage regulator\n"); } - dprintk (" voltage regulator)\n"); latency = psb->settlingtime; if (latency < 100) { @@ -458,8 +450,8 @@ static int powernow_decode_bios (int maxfid, int startvid) "Should be at least 100. Correcting.\n", latency); latency = 100; } - dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime); - dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst); + dprintk ("Settling Time: %d microseconds.\n", psb->settlingtime); + dprintk ("Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst); p += sizeof (struct psb_s); @@ -472,11 +464,9 @@ static int powernow_decode_bios (int maxfid, int startvid) if ((etuple == pst->cpuid) && check_fsb(pst->fsbspeed) && (maxfid==pst->maxfid) && (startvid==pst->startvid)) { - dprintk (KERN_INFO PFX "PST:%d (@%p)\n", i, pst); - dprintk (KERN_INFO PFX " cpuid: 0x%x ", pst->cpuid); - dprintk ("fsb: %d ", pst->fsbspeed); - dprintk ("maxFID: 0x%x ", pst->maxfid); - dprintk ("startvid: 0x%x\n", pst->startvid); + dprintk ("PST:%d (@%p)\n", i, pst); + dprintk (" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n", + pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); ret = get_ranges ((char *) pst + sizeof (struct pst_s)); return ret; @@ -602,7 +592,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) printk(KERN_WARNING PFX "can not determine bus frequency\n"); return -EINVAL; } - dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000); + dprintk("FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000); if (dmi_check_system(powernow_dmi_table) || acpi_force) { printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n"); @@ -645,6 +635,17 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) static int powernow_cpu_exit (struct cpufreq_policy *policy) { cpufreq_frequency_table_put_attr(policy->cpu); + +#ifdef CONFIG_X86_POWERNOW_K7_ACPI + if (acpi_processor_perf) { + acpi_processor_unregister_performance(acpi_processor_perf, 0); + kfree(acpi_processor_perf); + } +#endif + + if (powernow_table) + kfree(powernow_table); + return 0; } @@ -674,19 +675,9 @@ static int __init powernow_init (void) static void __exit powernow_exit (void) { -#ifdef CONFIG_X86_POWERNOW_K7_ACPI - if (acpi_processor_perf) { - acpi_processor_unregister_performance(acpi_processor_perf, 0); - kfree(acpi_processor_perf); - } -#endif cpufreq_unregister_driver(&powernow_driver); - if (powernow_table) - kfree(powernow_table); } -module_param(debug, int, 0444); -MODULE_PARM_DESC(debug, "enable debug output."); module_param(acpi_force, int, 0444); MODULE_PARM_DESC(acpi_force, "Force ACPI to be used."); diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index e52390d12..a65ff7e32 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c @@ -18,6 +18,9 @@ * Processor information obtained from Chapter 9 (Power and Thermal Management) * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD * Opteron Processors" available for download from www.amd.com + * + * Tables for specific CPUs can be infrerred from + * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf */ #include @@ -39,7 +42,7 @@ #define PFX "powernow-k8: " #define BFX PFX "BIOS error: " -#define VERSION "version 1.00.09b" +#define VERSION "version 1.00.09e" #include "powernow-k8.h" /* serialize freq changes */ @@ -65,7 +68,12 @@ static u32 find_millivolts_from_vid(struct powernow_k8_data *data, u32 vid) return 1550-vid*25; } -/* Return the vco fid for an input fid */ +/* Return the vco fid for an input fid + * + * Each "low" fid has corresponding "high" fid, and you can get to "low" fids + * only from corresponding high fids. This returns "high" fid corresponding to + * "low" one. + */ static u32 convert_fid_to_vco_fid(u32 fid) { if (fid < HI_FID_TABLE_BOTTOM) { @@ -136,7 +144,7 @@ static void fidvid_msr_init(void) fid = lo & MSR_S_LO_CURRENT_FID; lo = fid | (vid << MSR_C_LO_VID_SHIFT); hi = MSR_C_HI_STP_GNT_BENIGN; - dprintk(PFX "cpu%d, init lo 0x%x, hi 0x%x\n", smp_processor_id(), lo, hi); + dprintk("cpu%d, init lo 0x%x, hi 0x%x\n", smp_processor_id(), lo, hi); wrmsr(MSR_FIDVID_CTL, lo, hi); } @@ -154,7 +162,7 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid) lo = fid | (data->currvid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; - dprintk(KERN_DEBUG PFX "writing fid 0x%x, lo 0x%x, hi 0x%x\n", + dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n", fid, lo, data->plllock * PLL_LOCK_CONVERSION); wrmsr(MSR_FIDVID_CTL, lo, data->plllock * PLL_LOCK_CONVERSION); @@ -192,7 +200,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid) lo = data->currfid | (vid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; - dprintk(KERN_DEBUG PFX "writing vid 0x%x, lo 0x%x, hi 0x%x\n", + dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n", vid, lo, STOP_GRANT_5NS); wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); @@ -255,7 +263,7 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req return 1; } - dprintk(KERN_INFO PFX "transitioned (cpu%d): new fid 0x%x, vid 0x%x\n", + dprintk("transitioned (cpu%d): new fid 0x%x, vid 0x%x\n", smp_processor_id(), data->currfid, data->currvid); return 0; @@ -267,24 +275,22 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid u32 rvosteps = data->rvo; u32 savefid = data->currfid; - dprintk(KERN_DEBUG PFX - "ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n", + dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n", smp_processor_id(), data->currfid, data->currvid, reqvid, data->rvo); while (data->currvid > reqvid) { - dprintk(KERN_DEBUG PFX "ph1: curr 0x%x, req vid 0x%x\n", + dprintk("ph1: curr 0x%x, req vid 0x%x\n", data->currvid, reqvid); if (decrease_vid_code_by_step(data, reqvid, data->vidmvs)) return 1; } - while (rvosteps > 0) { + while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) { if (data->currvid == 0) { rvosteps = 0; } else { - dprintk(KERN_DEBUG PFX - "ph1: changing vid for rvo, req 0x%x\n", + dprintk("ph1: changing vid for rvo, req 0x%x\n", data->currvid - 1); if (decrease_vid_code_by_step(data, data->currvid - 1, 1)) return 1; @@ -300,7 +306,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid return 1; } - dprintk(KERN_DEBUG PFX "ph1 complete, currfid 0x%x, currvid 0x%x\n", + dprintk("ph1 complete, currfid 0x%x, currvid 0x%x\n", data->currfid, data->currvid); return 0; @@ -309,10 +315,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid /* Phase 2 - core frequency transition */ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) { - u32 vcoreqfid; - u32 vcocurrfid; - u32 vcofiddiff; - u32 savevid = data->currvid; + u32 vcoreqfid, vcocurrfid, vcofiddiff, savevid = data->currvid; if ((reqfid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { printk(KERN_ERR PFX "ph2: illegal lo-lo transition 0x%x 0x%x\n", @@ -325,8 +328,7 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) return 0; } - dprintk(KERN_DEBUG PFX - "ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n", + dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n", smp_processor_id(), data->currfid, data->currvid, reqfid); @@ -376,7 +378,7 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) return 1; } - dprintk(KERN_DEBUG PFX "ph2 complete, currfid 0x%x, currvid 0x%x\n", + dprintk("ph2 complete, currfid 0x%x, currvid 0x%x\n", data->currfid, data->currvid); return 0; @@ -388,7 +390,7 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi u32 savefid = data->currfid; u32 savereqvid = reqvid; - dprintk(KERN_DEBUG PFX "ph3 (cpu%d): starting, currfid 0x%x, currvid 0x%x\n", + dprintk("ph3 (cpu%d): starting, currfid 0x%x, currvid 0x%x\n", smp_processor_id(), data->currfid, data->currvid); @@ -415,17 +417,17 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi return 1; if (savereqvid != data->currvid) { - dprintk(KERN_ERR PFX "ph3 failed, currvid 0x%x\n", data->currvid); + dprintk("ph3 failed, currvid 0x%x\n", data->currvid); return 1; } if (savefid != data->currfid) { - dprintk(KERN_ERR PFX "ph3 failed, currfid changed 0x%x\n", + dprintk("ph3 failed, currfid changed 0x%x\n", data->currfid); return 1; } - dprintk(KERN_DEBUG PFX "ph3 complete, currfid 0x%x, currvid 0x%x\n", + dprintk("ph3 complete, currfid 0x%x, currvid 0x%x\n", data->currfid, data->currvid); return 0; @@ -501,7 +503,7 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 || (pst[j].fid & 1) || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) { /* Only first fid is allowed to be in "low" range */ - printk(KERN_ERR PFX "fid %d invalid : 0x%x\n", j, pst[j].fid); + printk(KERN_ERR PFX "two low fids - %d : 0x%x\n", j, pst[j].fid); return -EINVAL; } if (pst[j].fid < lastfid) @@ -577,7 +579,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, return -EIO; } - dprintk(KERN_INFO PFX "cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); + dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); data->powernow_table = powernow_table; print_basics(data); @@ -585,7 +587,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, if ((pst[j].fid==data->currfid) && (pst[j].vid==data->currvid)) return 0; - dprintk(KERN_ERR PFX "currfid/vid do not match PST, ignoring\n"); + dprintk("currfid/vid do not match PST, ignoring\n"); return 0; } @@ -596,6 +598,8 @@ static int find_psb_table(struct powernow_k8_data *data) unsigned int i; u32 mvs; u8 maxvid; + u32 cpst = 0; + u32 thiscpuid; for (i = 0xc0000; i < 0xffff0; i += 0x10) { /* Scan BIOS looking for the signature. */ @@ -605,48 +609,55 @@ static int find_psb_table(struct powernow_k8_data *data) if (memcmp(psb, PSB_ID_STRING, PSB_ID_STRING_LEN) != 0) continue; - dprintk(KERN_DEBUG PFX "found PSB header at 0x%p\n", psb); + dprintk("found PSB header at 0x%p\n", psb); - dprintk(KERN_DEBUG PFX "table vers: 0x%x\n", psb->tableversion); + dprintk("table vers: 0x%x\n", psb->tableversion); if (psb->tableversion != PSB_VERSION_1_4) { printk(KERN_INFO BFX "PSB table is not v1.4\n"); return -ENODEV; } - dprintk(KERN_DEBUG PFX "flags: 0x%x\n", psb->flags1); + dprintk("flags: 0x%x\n", psb->flags1); if (psb->flags1) { printk(KERN_ERR BFX "unknown flags\n"); return -ENODEV; } - data->vstable = psb->voltagestabilizationtime; - dprintk(KERN_INFO PFX "voltage stabilization time: %d(*20us)\n", data->vstable); + data->vstable = psb->vstable; + dprintk("voltage stabilization time: %d(*20us)\n", data->vstable); - dprintk(KERN_DEBUG PFX "flags2: 0x%x\n", psb->flags2); + dprintk("flags2: 0x%x\n", psb->flags2); data->rvo = psb->flags2 & 3; data->irt = ((psb->flags2) >> 2) & 3; mvs = ((psb->flags2) >> 4) & 3; data->vidmvs = 1 << mvs; data->batps = ((psb->flags2) >> 6) & 3; - dprintk(KERN_INFO PFX "ramp voltage offset: %d\n", data->rvo); - dprintk(KERN_INFO PFX "isochronous relief time: %d\n", data->irt); - dprintk(KERN_INFO PFX "maximum voltage step: %d - 0x%x\n", mvs, data->vidmvs); + dprintk("ramp voltage offset: %d\n", data->rvo); + dprintk("isochronous relief time: %d\n", data->irt); + dprintk("maximum voltage step: %d - 0x%x\n", mvs, data->vidmvs); - dprintk(KERN_DEBUG PFX "numpst: 0x%x\n", psb->numpst); - if (psb->numpst != 1) { + dprintk("numpst: 0x%x\n", psb->num_tables); + cpst = psb->num_tables; + if ((psb->cpuid == 0x00000fc0) || (psb->cpuid == 0x00000fe0) ){ + thiscpuid = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); + if ((thiscpuid == 0x00000fc0) || (thiscpuid == 0x00000fe0) ) { + cpst = 1; + } + } + if (cpst != 1) { printk(KERN_ERR BFX "numpst must be 1\n"); return -ENODEV; } data->plllock = psb->plllocktime; - dprintk(KERN_INFO PFX "plllocktime: 0x%x (units 1us)\n", psb->plllocktime); - dprintk(KERN_INFO PFX "maxfid: 0x%x\n", psb->maxfid); - dprintk(KERN_INFO PFX "maxvid: 0x%x\n", psb->maxvid); + dprintk("plllocktime: 0x%x (units 1us)\n", psb->plllocktime); + dprintk("maxfid: 0x%x\n", psb->maxfid); + dprintk("maxvid: 0x%x\n", psb->maxvid); maxvid = psb->maxvid; - data->numps = psb->numpstates; - dprintk(KERN_INFO PFX "numpstates: 0x%x\n", data->numps); + data->numps = psb->numps; + dprintk("numpstates: 0x%x\n", data->numps); return fill_powernow_table(data, (struct pst_s *)(psb+1), maxvid); } /* @@ -684,19 +695,21 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) struct cpufreq_frequency_table *powernow_table; if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { - dprintk(KERN_DEBUG PFX "register performance failed\n"); + dprintk("register performance failed\n"); return -EIO; } /* verify the data contained in the ACPI structures */ if (data->acpi_data.state_count <= 1) { - dprintk(KERN_DEBUG PFX "No ACPI P-States\n"); + dprintk("No ACPI P-States\n"); goto err_out; } if ((data->acpi_data.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) || (data->acpi_data.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) { - dprintk(KERN_DEBUG PFX "Invalid control/status registers\n"); + dprintk("Invalid control/status registers (%x - %x)\n", + data->acpi_data.control_register.space_id, + data->acpi_data.status_register.space_id); goto err_out; } @@ -704,7 +717,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (data->acpi_data.state_count + 1)), GFP_KERNEL); if (!powernow_table) { - dprintk(KERN_ERR PFX "powernow_table memory alloc failure\n"); + dprintk("powernow_table memory alloc failure\n"); goto err_out; } @@ -712,7 +725,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) u32 fid = data->acpi_data.states[i].control & FID_MASK; u32 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK; - dprintk(KERN_INFO PFX " %d : fid 0x%x, vid 0x%x\n", i, fid, vid); + dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); powernow_table[i].index = fid; /* lower 8 bits */ powernow_table[i].index |= (vid << 8); /* upper 8 bits */ @@ -721,14 +734,14 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) /* verify frequency is OK */ if ((powernow_table[i].frequency > (MAX_FREQ * 1000)) || (powernow_table[i].frequency < (MIN_FREQ * 1000))) { - dprintk(KERN_INFO PFX "invalid freq %u kHz, ignoring\n", powernow_table[i].frequency); + dprintk("invalid freq %u kHz, ignoring\n", powernow_table[i].frequency); powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; continue; } /* verify voltage is OK - BIOSs are using "off" to indicate invalid */ if (vid == 0x1f) { - dprintk(KERN_INFO PFX "invalid vid %u, ignoring\n", vid); + dprintk("invalid vid %u, ignoring\n", vid); powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; continue; } @@ -744,7 +757,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) goto err_out_mem; } - dprintk(KERN_INFO PFX "double low frequency table entry, ignoring it.\n"); + dprintk("double low frequency table entry, ignoring it.\n"); powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; continue; } else @@ -768,6 +781,10 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) data->numps = data->acpi_data.state_count; print_basics(data); powernow_k8_acpi_pst_values(data, 0); + + /* notify BIOS that we exist */ + acpi_processor_notify_smm(THIS_MODULE); + return 0; err_out_mem: @@ -802,8 +819,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde int res; struct cpufreq_freqs freqs; - dprintk(KERN_DEBUG PFX "cpu %d transition to index %u\n", - smp_processor_id(), index ); + dprintk("cpu %d transition to index %u\n", smp_processor_id(), index); /* fid are the lower 8 bits of the index we stored into * the cpufreq frequency table in find_psb_table, vid are @@ -813,28 +829,25 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde fid = data->powernow_table[index].index & 0xFF; vid = (data->powernow_table[index].index & 0xFF00) >> 8; - dprintk(KERN_DEBUG PFX "table matched fid 0x%x, giving vid 0x%x\n", - fid, vid); + dprintk("table matched fid 0x%x, giving vid 0x%x\n", fid, vid); if (query_current_values_with_pending_wait(data)) return 1; if ((data->currvid == vid) && (data->currfid == fid)) { - dprintk(KERN_DEBUG PFX - "target matches current values (fid 0x%x, vid 0x%x)\n", + dprintk("target matches current values (fid 0x%x, vid 0x%x)\n", fid, vid); return 0; } if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { - printk(KERN_ERR PFX - "ignoring illegal change in lo freq table-%x to 0x%x\n", + printk("ignoring illegal change in lo freq table-%x to 0x%x\n", data->currfid, fid); return 1; } - dprintk(KERN_DEBUG PFX "cpu %d, changing to fid 0x%x, vid 0x%x\n", - smp_processor_id(), fid, vid); + dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n", + smp_processor_id(), fid, vid); freqs.cpu = data->cpu; @@ -877,7 +890,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi goto err_out; } - dprintk(KERN_DEBUG PFX "targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", + dprintk("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", pol->cpu, targfreq, pol->min, pol->max, relation); if (query_current_values_with_pending_wait(data)) { @@ -885,7 +898,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi goto err_out; } - dprintk(KERN_DEBUG PFX "targ: curr fid 0x%x, vid 0x%x\n", + dprintk("targ: curr fid 0x%x, vid 0x%x\n", data->currfid, data->currvid); if ((checkvid != data->currvid) || (checkfid != data->currfid)) { @@ -997,11 +1010,12 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol) + (3 * (1 << data->irt) * 10)) * 1000; pol->cur = find_khz_freq_from_fid(data->currfid); - dprintk(KERN_DEBUG PFX "policy current frequency %d kHz\n", pol->cur); + dprintk("policy current frequency %d kHz\n", pol->cur); /* min/max the cpu is capable of */ if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { printk(KERN_ERR PFX "invalid powernow_table\n"); + powernow_k8_cpu_exit_acpi(data); kfree(data->powernow_table); kfree(data); return -EINVAL; @@ -1009,7 +1023,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol) cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); - printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n", + printk("cpu_init done, current fid 0x%x, vid 0x%x\n", data->currfid, data->currvid); powernow_data[pol->cpu] = data; @@ -1019,6 +1033,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol) err_out: set_cpus_allowed(current, oldmask); schedule(); + powernow_k8_cpu_exit_acpi(data); kfree(data); return -ENODEV; @@ -1107,7 +1122,7 @@ static int __init powernowk8_init(void) /* driver entry point for term */ static void __exit powernowk8_exit(void) { - dprintk(KERN_INFO PFX "exit\n"); + dprintk("exit\n"); cpufreq_unregister_driver(&cpufreq_amd64_driver); } diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h index a95db64a9..63ebc8470 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h @@ -21,8 +21,7 @@ struct powernow_k8_data { u32 plllock; /* pll lock time, units 1 us */ /* keep track of the current fid / vid */ - u32 currvid; - u32 currfid; + u32 currvid, currfid; /* the powernow_table includes all frequency and vid/fid pairings: * fid are the lower 8 bits of the index, vid are the upper 8 bits. @@ -152,14 +151,14 @@ struct psb_s { u8 signature[10]; u8 tableversion; u8 flags1; - u16 voltagestabilizationtime; + u16 vstable; u8 flags2; - u8 numpst; + u8 num_tables; u32 cpuid; u8 plllocktime; u8 maxfid; u8 maxvid; - u8 numpstates; + u8 numps; }; /* Pairs of fid/vid values are appended to the version 1.4 PSB table. */ @@ -168,11 +167,7 @@ struct pst_s { u8 vid; }; -#ifdef DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg) static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid); static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid); diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index 56aafbde6..07d5612dc 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI #include @@ -32,16 +34,13 @@ #include #include +#include "speedstep-est-common.h" + #define PFX "speedstep-centrino: " #define MAINTAINER "Jeremy Fitzhardinge " -/*#define CENTRINO_DEBUG*/ +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg) -#ifdef CENTRINO_DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif struct cpu_id { @@ -76,8 +75,10 @@ struct cpu_model static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, const struct cpu_id *x); /* Operating points for current CPU */ -static struct cpu_model *centrino_model; -static int centrino_cpu; +static struct cpu_model *centrino_model[NR_CPUS]; +static const struct cpu_id *centrino_cpu[NR_CPUS]; + +static struct cpufreq_driver centrino_driver; #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE @@ -244,7 +245,7 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy) if (model->cpu_id == NULL) { /* No match at all */ - printk(KERN_INFO PFX "no support for CPU model \"%s\": " + dprintk(KERN_INFO PFX "no support for CPU model \"%s\": " "send /proc/cpuinfo to " MAINTAINER "\n", cpu->x86_model_id); return -ENOENT; @@ -252,15 +253,17 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy) if (model->op_points == NULL) { /* Matched a non-match */ - printk(KERN_INFO PFX "no table support for CPU model \"%s\": \n", + dprintk(KERN_INFO PFX "no table support for CPU model \"%s\": \n", cpu->x86_model_id); - printk(KERN_INFO PFX "try compiling with CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI enabled\n"); +#ifndef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI + dprintk(KERN_INFO PFX "try compiling with CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI enabled\n"); +#endif return -ENOENT; } - centrino_model = model; + centrino_model[policy->cpu] = model; - printk(KERN_INFO PFX "found \"%s\": max frequency: %dkHz\n", + dprintk("found \"%s\": max frequency: %dkHz\n", model->model_name, model->max_freq); return 0; @@ -280,7 +283,7 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, const struct cpu_ } /* To be called only after centrino_model is initialized */ -static unsigned extract_clock(unsigned msr) +static unsigned extract_clock(unsigned msr, unsigned int cpu, int failsafe) { int i; @@ -289,26 +292,32 @@ static unsigned extract_clock(unsigned msr) * for centrino, as some DSDTs are buggy. * Ideally, this can be done using the acpi_data structure. */ - if (centrino_cpu) { + if ((centrino_cpu[cpu] == &cpu_ids[CPU_BANIAS]) || + (centrino_cpu[cpu] == &cpu_ids[CPU_DOTHAN_A1]) || + (centrino_cpu[cpu] == &cpu_ids[CPU_DOTHAN_B0])) { msr = (msr >> 8) & 0xff; return msr * 100000; } - if ((!centrino_model) || (!centrino_model->op_points)) + if ((!centrino_model[cpu]) || (!centrino_model[cpu]->op_points)) return 0; msr &= 0xffff; - for (i=0;centrino_model->op_points[i].frequency != CPUFREQ_TABLE_END; i++) { - if (msr == centrino_model->op_points[i].index) - return centrino_model->op_points[i].frequency; + for (i=0;centrino_model[cpu]->op_points[i].frequency != CPUFREQ_TABLE_END; i++) { + if (msr == centrino_model[cpu]->op_points[i].index) + return centrino_model[cpu]->op_points[i].frequency; } - return 0; + if (failsafe) + return centrino_model[cpu]->op_points[i-1].frequency; + else + return 0; } /* Return the current CPU frequency in kHz */ static unsigned int get_cur_freq(unsigned int cpu) { unsigned l, h; + unsigned clock_freq; cpumask_t saved_mask; saved_mask = current->cpus_allowed; @@ -317,8 +326,21 @@ static unsigned int get_cur_freq(unsigned int cpu) return 0; rdmsr(MSR_IA32_PERF_STATUS, l, h); + clock_freq = extract_clock(l, cpu, 0); + + if (unlikely(clock_freq == 0)) { + /* + * On some CPUs, we can see transient MSR values (which are + * not present in _PSS), while CPU is doing some automatic + * P-state transition (like TM2). Get the last freq set + * in PERF_CTL. + */ + rdmsr(MSR_IA32_PERF_CTL, l, h); + clock_freq = extract_clock(l, cpu, 1); + } + set_cpus_allowed(current, saved_mask); - return extract_clock(l); + return clock_freq; } @@ -340,100 +362,118 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) struct acpi_object_list arg_list = {1, &arg0}; unsigned long cur_freq; int result = 0, i; + unsigned int cpu = policy->cpu; /* _PDC settings */ - arg0.buffer.length = 12; - arg0.buffer.pointer = (u8 *) arg0_buf; - arg0_buf[0] = ACPI_PDC_REVISION_ID; - arg0_buf[1] = 1; - arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR; + arg0.buffer.length = 12; + arg0.buffer.pointer = (u8 *) arg0_buf; + arg0_buf[0] = ACPI_PDC_REVISION_ID; + arg0_buf[1] = 1; + arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR; p.pdc = &arg_list; /* register with ACPI core */ - if (acpi_processor_register_performance(&p, policy->cpu)) - return -EIO; + if (acpi_processor_register_performance(&p, cpu)) { + dprintk(KERN_INFO PFX "obtaining ACPI data failed\n"); + return -EIO; + } /* verify the acpi_data */ if (p.state_count <= 1) { - printk(KERN_DEBUG "No P-States\n"); - result = -ENODEV; - goto err_unreg; + dprintk("No P-States\n"); + result = -ENODEV; + goto err_unreg; } if ((p.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) || (p.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) { - printk(KERN_DEBUG "Invalid control/status registers\n"); + dprintk("Invalid control/status registers (%x - %x)\n", + p.control_register.space_id, p.status_register.space_id); result = -EIO; goto err_unreg; } for (i=0; i p.states[0].core_frequency) { - printk(KERN_DEBUG "P%u has larger frequency than P0, skipping\n", i); + dprintk("P%u has larger frequency (%u) than P0 (%u), skipping\n", i, + p.states[i].core_frequency, p.states[0].core_frequency); p.states[i].core_frequency = 0; continue; } } - centrino_model = kmalloc(sizeof(struct cpu_model), GFP_KERNEL); - if (!centrino_model) { + centrino_model[cpu] = kmalloc(sizeof(struct cpu_model), GFP_KERNEL); + if (!centrino_model[cpu]) { result = -ENOMEM; goto err_unreg; } - memset(centrino_model, 0, sizeof(struct cpu_model)); + memset(centrino_model[cpu], 0, sizeof(struct cpu_model)); - centrino_model->model_name=NULL; - centrino_model->max_freq = p.states[0].core_frequency * 1000; - centrino_model->op_points = kmalloc(sizeof(struct cpufreq_frequency_table) * + centrino_model[cpu]->model_name=NULL; + centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000; + centrino_model[cpu]->op_points = kmalloc(sizeof(struct cpufreq_frequency_table) * (p.state_count + 1), GFP_KERNEL); - if (!centrino_model->op_points) { + if (!centrino_model[cpu]->op_points) { result = -ENOMEM; goto err_kfree; } for (i=0; iop_points[i].index = p.states[i].control; - centrino_model->op_points[i].frequency = p.states[i].core_frequency * 1000; + centrino_model[cpu]->op_points[i].index = p.states[i].control; + centrino_model[cpu]->op_points[i].frequency = p.states[i].core_frequency * 1000; + dprintk("adding state %i with frequency %u and control value %04x\n", + i, centrino_model[cpu]->op_points[i].frequency, centrino_model[cpu]->op_points[i].index); } - centrino_model->op_points[p.state_count].frequency = CPUFREQ_TABLE_END; + centrino_model[cpu]->op_points[p.state_count].frequency = CPUFREQ_TABLE_END; - cur_freq = get_cur_freq(policy->cpu); + cur_freq = get_cur_freq(cpu); for (i=0; iop_points[i].index) != - (centrino_model->op_points[i].frequency)) { - printk(KERN_DEBUG "Invalid encoded frequency\n"); + if (!p.states[i].core_frequency) { + dprintk("skipping state %u\n", i); + centrino_model[cpu]->op_points[i].frequency = CPUFREQ_ENTRY_INVALID; + continue; + } + + if (extract_clock(centrino_model[cpu]->op_points[i].index, cpu, 0) != + (centrino_model[cpu]->op_points[i].frequency)) { + dprintk("Invalid encoded frequency (%u vs. %u)\n", + extract_clock(centrino_model[cpu]->op_points[i].index, cpu, 0), + centrino_model[cpu]->op_points[i].frequency); result = -EINVAL; goto err_kfree_all; } - if (cur_freq == centrino_model->op_points[i].frequency) + if (cur_freq == centrino_model[cpu]->op_points[i].frequency) p.state = i; - if (!p.states[i].core_frequency) - centrino_model->op_points[i].frequency = CPUFREQ_ENTRY_INVALID; } + /* notify BIOS that we exist */ + acpi_processor_notify_smm(THIS_MODULE); + return 0; err_kfree_all: - kfree(centrino_model->op_points); + kfree(centrino_model[cpu]->op_points); err_kfree: - kfree(centrino_model); + kfree(centrino_model[cpu]); err_unreg: - acpi_processor_unregister_performance(&p, policy->cpu); + acpi_processor_unregister_performance(&p, cpu); + dprintk(KERN_INFO PFX "invalid ACPI data\n"); return (result); } #else @@ -457,14 +497,18 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) break; if (i != N_IDS) - centrino_cpu = 1; + centrino_cpu[policy->cpu] = &cpu_ids[i]; + + if (is_const_loops_cpu(policy->cpu)) { + centrino_driver.flags |= CPUFREQ_CONST_LOOPS; + } if (centrino_cpu_init_acpi(policy)) { if (policy->cpu != 0) return -ENODEV; - if (!centrino_cpu) { - printk(KERN_INFO PFX "found unsupported CPU with " + if (!centrino_cpu[policy->cpu]) { + dprintk(KERN_INFO PFX "found unsupported CPU with " "Enhanced SpeedStep: send /proc/cpuinfo to " MAINTAINER "\n"); return -ENODEV; @@ -481,6 +525,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) if (!(l & (1<<16))) { l |= (1<<16); + dprintk("trying to enable Enhanced SpeedStep (%x)\n", l); wrmsr(MSR_IA32_MISC_ENABLE, l, h); /* check to see if it stuck */ @@ -497,34 +542,36 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 10000; /* 10uS transition latency */ policy->cur = freq; - dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d cur=%dkHz\n", - policy->policy, policy->cur); + dprintk("centrino_cpu_init: cur=%dkHz\n", policy->cur); - ret = cpufreq_frequency_table_cpuinfo(policy, centrino_model->op_points); + ret = cpufreq_frequency_table_cpuinfo(policy, centrino_model[policy->cpu]->op_points); if (ret) return (ret); - cpufreq_frequency_table_get_attr(centrino_model->op_points, policy->cpu); + cpufreq_frequency_table_get_attr(centrino_model[policy->cpu]->op_points, policy->cpu); return 0; } static int centrino_cpu_exit(struct cpufreq_policy *policy) { - if (!centrino_model) + unsigned int cpu = policy->cpu; + + if (!centrino_model[cpu]) return -ENODEV; - cpufreq_frequency_table_put_attr(policy->cpu); + cpufreq_frequency_table_put_attr(cpu); #ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI - if (!centrino_model->model_name) { - acpi_processor_unregister_performance(&p, policy->cpu); - kfree(centrino_model->op_points); - kfree(centrino_model); + if (!centrino_model[cpu]->model_name) { + dprintk("unregistering and freeing ACPI data\n"); + acpi_processor_unregister_performance(&p, cpu); + kfree(centrino_model[cpu]->op_points); + kfree(centrino_model[cpu]); } #endif - centrino_model = NULL; + centrino_model[cpu] = NULL; return 0; } @@ -538,7 +585,7 @@ static int centrino_cpu_exit(struct cpufreq_policy *policy) */ static int centrino_verify (struct cpufreq_policy *policy) { - return cpufreq_frequency_table_verify(policy, centrino_model->op_points); + return cpufreq_frequency_table_verify(policy, centrino_model[policy->cpu]->op_points); } /** @@ -554,12 +601,12 @@ static int centrino_target (struct cpufreq_policy *policy, unsigned int relation) { unsigned int newstate = 0; - unsigned int msr, oldmsr, h; + unsigned int msr, oldmsr, h, cpu = policy->cpu; struct cpufreq_freqs freqs; cpumask_t saved_mask; int retval; - if (centrino_model == NULL) + if (centrino_model[cpu] == NULL) return -ENODEV; /* @@ -567,42 +614,32 @@ static int centrino_target (struct cpufreq_policy *policy, * Make sure we are running on the CPU that wants to change frequency */ saved_mask = current->cpus_allowed; - set_cpus_allowed(current, cpumask_of_cpu(policy->cpu)); - if (smp_processor_id() != policy->cpu) { + set_cpus_allowed(current, policy->cpus); + if (!cpu_isset(smp_processor_id(), policy->cpus)) { + dprintk("couldn't limit to CPUs in this domain\n"); return(-EAGAIN); } - if (cpufreq_frequency_table_target(policy, centrino_model->op_points, target_freq, + if (cpufreq_frequency_table_target(policy, centrino_model[cpu]->op_points, target_freq, relation, &newstate)) { retval = -EINVAL; goto migrate_end; } - msr = centrino_model->op_points[newstate].index; + msr = centrino_model[cpu]->op_points[newstate].index; rdmsr(MSR_IA32_PERF_CTL, oldmsr, h); if (msr == (oldmsr & 0xffff)) { retval = 0; + dprintk("no change needed - msr was and needs to be %x\n", oldmsr); goto migrate_end; } - /* Hm, old frequency can either be the last value we put in - PERF_CTL, or whatever it is now. The trouble is that TM2 - can change it behind our back, which means we never get to - see the speed change. Reading back the current speed would - tell us something happened, but it may leave the things on - the notifier chain confused; we therefore stick to using - the last programmed speed rather than the current speed for - "old". - - TODO: work out how the TCC interrupts work, and try to - catch the CPU changing things under us. - */ - freqs.cpu = policy->cpu; - freqs.old = extract_clock(oldmsr); - freqs.new = extract_clock(msr); - - dprintk(KERN_INFO PFX "target=%dkHz old=%d new=%d msr=%04x\n", + freqs.cpu = cpu; + freqs.old = extract_clock(oldmsr, cpu, 0); + freqs.new = extract_clock(msr, cpu, 0); + + dprintk("target=%dkHz old=%d new=%d msr=%04x\n", target_freq, freqs.old, freqs.new, msr); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c index 5f94c4fa2..5b7d18a06 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c @@ -52,16 +52,7 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { }; -/* DEBUG - * Define it if you want verbose debug output, e.g. for bug reporting - */ -//#define SPEEDSTEP_DEBUG - -#ifdef SPEEDSTEP_DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-ich", msg) /** @@ -83,13 +74,13 @@ static void speedstep_set_state (unsigned int state) /* get PMBASE */ pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase); if (!(pmbase & 0x01)) { - printk(KERN_ERR "cpufreq: could not find speedstep register\n"); + printk(KERN_ERR "speedstep-ich: could not find speedstep register\n"); return; } pmbase &= 0xFFFFFFFE; if (!pmbase) { - printk(KERN_ERR "cpufreq: could not find speedstep register\n"); + printk(KERN_ERR "speedstep-ich: could not find speedstep register\n"); return; } @@ -99,13 +90,13 @@ static void speedstep_set_state (unsigned int state) /* read state */ value = inb(pmbase + 0x50); - dprintk(KERN_DEBUG "cpufreq: read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); + dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); /* write new state */ value &= 0xFE; value |= state; - dprintk(KERN_DEBUG "cpufreq: writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase); + dprintk("writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase); /* Disable bus master arbitration */ pm2_blk = inb(pmbase + 0x20); @@ -125,10 +116,10 @@ static void speedstep_set_state (unsigned int state) /* Enable IRQs */ local_irq_restore(flags); - dprintk(KERN_DEBUG "cpufreq: read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); + dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); if (state == (value & 0x1)) { - dprintk (KERN_INFO "cpufreq: change to %u MHz succeeded\n", (speedstep_get_processor_frequency(speedstep_processor) / 1000)); + dprintk("change to %u MHz succeeded\n", (speedstep_get_processor_frequency(speedstep_processor) / 1000)); } else { printk (KERN_ERR "cpufreq: change failed - I/O error\n"); } @@ -153,7 +144,7 @@ static int speedstep_activate (void) pci_read_config_word(speedstep_chipset_dev, 0x00A0, &value); if (!(value & 0x08)) { value |= 0x08; - dprintk(KERN_DEBUG "cpufreq: activating SpeedStep (TM) registers\n"); + dprintk("activating SpeedStep (TM) registers\n"); pci_write_config_word(speedstep_chipset_dev, 0x00A0, value); } @@ -171,7 +162,7 @@ static int speedstep_activate (void) */ static unsigned int speedstep_detect_chipset (void) { - speedstep_chipset_dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, @@ -179,7 +170,7 @@ static unsigned int speedstep_detect_chipset (void) if (speedstep_chipset_dev) return 4; /* 4-M */ - speedstep_chipset_dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, PCI_ANY_ID, PCI_ANY_ID, @@ -188,7 +179,7 @@ static unsigned int speedstep_detect_chipset (void) return 3; /* 3-M */ - speedstep_chipset_dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10, PCI_ANY_ID, PCI_ANY_ID, @@ -201,7 +192,7 @@ static unsigned int speedstep_detect_chipset (void) static struct pci_dev *hostbridge; u8 rev = 0; - hostbridge = pci_find_subsys(PCI_VENDOR_ID_INTEL, + hostbridge = pci_get_subsys(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_MC, PCI_ANY_ID, PCI_ANY_ID, @@ -212,35 +203,37 @@ static unsigned int speedstep_detect_chipset (void) pci_read_config_byte(hostbridge, PCI_REVISION_ID, &rev); if (rev < 5) { - dprintk(KERN_INFO "cpufreq: hostbridge does not support speedstep\n"); + dprintk("hostbridge does not support speedstep\n"); speedstep_chipset_dev = NULL; + pci_dev_put(hostbridge); return 0; } + pci_dev_put(hostbridge); return 2; /* 2-M */ } return 0; } -static unsigned int speedstep_get(unsigned int cpu) +static unsigned int _speedstep_get(cpumask_t cpus) { unsigned int speed; - cpumask_t cpus_allowed,affected_cpu_map; + cpumask_t cpus_allowed; - /* only run on CPU to be set, or on its sibling */ cpus_allowed = current->cpus_allowed; -#ifdef CONFIG_SMP - affected_cpu_map = cpu_sibling_map[cpu]; -#else - affected_cpu_map = cpumask_of_cpu(cpu); -#endif - set_cpus_allowed(current, affected_cpu_map); - speed=speedstep_get_processor_frequency(speedstep_processor); + set_cpus_allowed(current, cpus); + speed = speedstep_get_processor_frequency(speedstep_processor); set_cpus_allowed(current, cpus_allowed); + dprintk("detected %u kHz as current frequency\n", speed); return speed; } +static unsigned int speedstep_get(unsigned int cpu) +{ + return _speedstep_get(cpumask_of_cpu(cpu)); +} + /** * speedstep_target - set a new CPUFreq policy * @policy: new policy @@ -255,43 +248,38 @@ static int speedstep_target (struct cpufreq_policy *policy, { unsigned int newstate = 0; struct cpufreq_freqs freqs; - cpumask_t cpus_allowed, affected_cpu_map; + cpumask_t cpus_allowed; int i; if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate)) return -EINVAL; - freqs.old = speedstep_get(policy->cpu); + freqs.old = _speedstep_get(policy->cpus); freqs.new = speedstep_freqs[newstate].frequency; freqs.cpu = policy->cpu; + dprintk("transiting from %u to %u kHz\n", freqs.old, freqs.new); + /* no transition necessary */ if (freqs.old == freqs.new) return 0; cpus_allowed = current->cpus_allowed; - /* only run on CPU to be set, or on its sibling */ -#ifdef CONFIG_SMP - affected_cpu_map = cpu_sibling_map[policy->cpu]; -#else - affected_cpu_map = cpumask_of_cpu(policy->cpu); -#endif - - for_each_cpu_mask(i, affected_cpu_map) { + for_each_cpu_mask(i, policy->cpus) { freqs.cpu = i; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); } /* switch to physical CPU where state is to be changed */ - set_cpus_allowed(current, affected_cpu_map); + set_cpus_allowed(current, policy->cpus); speedstep_set_state(newstate); /* allow to be run on all CPUs */ set_cpus_allowed(current, cpus_allowed); - for_each_cpu_mask(i, affected_cpu_map) { + for_each_cpu_mask(i, policy->cpus) { freqs.cpu = i; cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); } @@ -317,21 +305,15 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) { int result = 0; unsigned int speed; - cpumask_t cpus_allowed,affected_cpu_map; - - - /* capability check */ - if (policy->cpu != 0) /* FIXME: better support for SMT in cpufreq core. Up until then, it's better to register only one CPU */ - return -ENODEV; + cpumask_t cpus_allowed; /* only run on CPU to be set, or on its sibling */ - cpus_allowed = current->cpus_allowed; #ifdef CONFIG_SMP - affected_cpu_map = cpu_sibling_map[policy->cpu]; -#else - affected_cpu_map = cpumask_of_cpu(policy->cpu); + policy->cpus = cpu_sibling_map[policy->cpu]; #endif - set_cpus_allowed(current, affected_cpu_map); + + cpus_allowed = current->cpus_allowed; + set_cpus_allowed(current, policy->cpus); /* detect low and high frequency */ result = speedstep_get_freqs(speedstep_processor, @@ -343,11 +325,11 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) return result; /* get current speed setting */ - speed = speedstep_get(policy->cpu); + speed = _speedstep_get(policy->cpus); if (!speed) return -EIO; - dprintk(KERN_INFO "cpufreq: currently at %s speed setting - %i MHz\n", + dprintk("currently at %s speed setting - %i MHz\n", (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", (speed / 1000)); @@ -401,18 +383,22 @@ static int __init speedstep_init(void) { /* detect processor */ speedstep_processor = speedstep_detect_processor(); - if (!speedstep_processor) + if (!speedstep_processor) { + dprintk("Intel(R) SpeedStep(TM) capable processor not found\n"); return -ENODEV; + } /* detect chipset */ if (!speedstep_detect_chipset()) { - printk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) for this chipset not (yet) available.\n"); + dprintk("Intel(R) SpeedStep(TM) for this chipset not (yet) available.\n"); return -ENODEV; } /* activate speedstep support */ - if (speedstep_activate()) + if (speedstep_activate()) { + pci_dev_put(speedstep_chipset_dev); return -EINVAL; + } return cpufreq_register_driver(&speedstep_driver); } @@ -425,6 +411,7 @@ static int __init speedstep_init(void) */ static void __exit speedstep_exit(void) { + pci_dev_put(speedstep_chipset_dev); cpufreq_unregister_driver(&speedstep_driver); } diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c index 82f7c0220..8ba430a9c 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c @@ -19,17 +19,7 @@ #include #include "speedstep-lib.h" - -/* DEBUG - * Define it if you want verbose debug output, e.g. for bug reporting - */ -//#define SPEEDSTEP_DEBUG - -#ifdef SPEEDSTEP_DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-lib", msg) #ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK static int relaxed_check = 0; @@ -83,7 +73,7 @@ static unsigned int pentium3_get_frequency (unsigned int processor) /* read MSR 0x2a - we only need the low 32 bits */ rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); - dprintk(KERN_DEBUG "speedstep-lib: P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); + dprintk("P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); msr_tmp = msr_lo; /* decode the FSB */ @@ -96,9 +86,10 @@ static unsigned int pentium3_get_frequency (unsigned int processor) } /* decode the multiplier */ - if (processor == SPEEDSTEP_PROCESSOR_PIII_C_EARLY) + if (processor == SPEEDSTEP_PROCESSOR_PIII_C_EARLY) { + dprintk("workaround for early PIIIs\n"); msr_lo &= 0x03c00000; - else + } else msr_lo &= 0x0bc00000; msr_lo >>= 22; while (msr_lo != msr_decode_mult[j].bitmap) { @@ -107,6 +98,8 @@ static unsigned int pentium3_get_frequency (unsigned int processor) j++; } + dprintk("speed is %u\n", (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100)); + return (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100); } @@ -116,7 +109,7 @@ static unsigned int pentiumM_get_frequency(void) u32 msr_lo, msr_tmp; rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); - dprintk(KERN_DEBUG "speedstep-lib: PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); + dprintk("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); /* see table B-2 of 24547212.pdf */ if (msr_lo & 0x00040000) { @@ -125,7 +118,7 @@ static unsigned int pentiumM_get_frequency(void) } msr_tmp = (msr_lo >> 22) & 0x1f; - dprintk(KERN_DEBUG "speedstep-lib: bits 22-26 are 0x%x\n", msr_tmp); + dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * 100 * 1000)); return (msr_tmp * 100 * 1000); } @@ -139,7 +132,7 @@ static unsigned int pentium4_get_frequency(void) rdmsr(0x2c, msr_lo, msr_hi); - dprintk(KERN_DEBUG "speedstep-lib: P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); + dprintk("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); /* decode the FSB: see IA-32 Intel (C) Architecture Software * Developer's Manual, Volume 3: System Prgramming Guide, @@ -167,9 +160,12 @@ static unsigned int pentium4_get_frequency(void) printk(KERN_DEBUG "speedstep-lib: couldn't detect FSB speed. Please send an e-mail to \n"); /* Multiplier. */ - mult = msr_lo >> 24; + if (c->x86_model < 2) + mult = msr_lo >> 27; + else + mult = msr_lo >> 24; - dprintk(KERN_DEBUG "speedstep-lib: P4 - FSB %u kHz; Multiplier %u\n", fsb, mult); + dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", fsb, mult, (fsb * mult)); return (fsb * mult); } @@ -204,6 +200,8 @@ unsigned int speedstep_detect_processor (void) struct cpuinfo_x86 *c = cpu_data; u32 ebx, msr_lo, msr_hi; + dprintk("x86: %x, model: %x\n", c->x86, c->x86_model); + if ((c->x86_vendor != X86_VENDOR_INTEL) || ((c->x86 != 6) && (c->x86 != 0xF))) return 0; @@ -217,7 +215,7 @@ unsigned int speedstep_detect_processor (void) ebx = cpuid_ebx(0x00000001); ebx &= 0x000000FF; - dprintk(KERN_INFO "ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); + dprintk("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); switch (c->x86_mask) { case 4: @@ -269,6 +267,7 @@ unsigned int speedstep_detect_processor (void) /* cpuid_ebx(1) is 0x04 for desktop PIII, 0x06 for mobile PIII-M */ ebx = cpuid_ebx(0x00000001); + dprintk("ebx is %x\n", ebx); ebx &= 0x000000FF; @@ -286,7 +285,7 @@ unsigned int speedstep_detect_processor (void) /* all mobile PIII Coppermines have FSB 100 MHz * ==> sort out a few desktop PIIIs. */ rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi); - dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n", msr_lo, msr_hi); + dprintk("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n", msr_lo, msr_hi); msr_lo &= 0x00c0000; if (msr_lo != 0x0080000) return 0; @@ -298,11 +297,12 @@ unsigned int speedstep_detect_processor (void) * bit 56 or 57 is set */ rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); - dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi); + dprintk("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi); if ((msr_hi & (1<<18)) && (relaxed_check ? 1 : (msr_hi & (3<<24)))) { - if (c->x86_mask == 0x01) + if (c->x86_mask == 0x01) { + dprintk("early PIII version\n"); return SPEEDSTEP_PROCESSOR_PIII_C_EARLY; - else + } else return SPEEDSTEP_PROCESSOR_PIII_C; } @@ -329,10 +329,14 @@ unsigned int speedstep_get_freqs(unsigned int processor, if ((!processor) || (!low_speed) || (!high_speed) || (!set_state)) return -EINVAL; + dprintk("trying to determine both speeds\n"); + /* get current speed */ prev_speed = speedstep_get_processor_frequency(processor); if (!prev_speed) return -EIO; + + dprintk("previous seped is %u\n", prev_speed); local_irq_save(flags); @@ -344,6 +348,8 @@ unsigned int speedstep_get_freqs(unsigned int processor, goto out; } + dprintk("low seped is %u\n", *low_speed); + /* switch to high state */ set_state(SPEEDSTEP_HIGH); *high_speed = speedstep_get_processor_frequency(processor); @@ -352,6 +358,8 @@ unsigned int speedstep_get_freqs(unsigned int processor, goto out; } + dprintk("high seped is %u\n", *high_speed); + if (*low_speed == *high_speed) { ret = -ENODEV; goto out; diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index 5d176b19a..79440b3f0 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c @@ -24,8 +24,6 @@ #include "speedstep-lib.h" -#define PFX "speedstep-smi: " - /* speedstep system management interface port/command. * * These parameters are got from IST-SMI BIOS call. @@ -58,16 +56,7 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { * of DMA activity going on? */ #define SMI_TRIES 5 -/* DEBUG - * Define it if you want verbose debug output, e.g. for bug reporting - */ -//#define SPEEDSTEP_DEBUG - -#ifdef SPEEDSTEP_DEBUG -#define dprintk(msg...) printk(msg) -#else -#define dprintk(msg...) do { } while(0) -#endif +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-smi", msg) /** * speedstep_smi_ownership @@ -81,12 +70,16 @@ static int speedstep_smi_ownership (void) command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); magic = virt_to_phys(magic_data); + dprintk("trying to obtain ownership with command %x at port %x\n", command, smi_port); + __asm__ __volatile__( "out %%al, (%%dx)\n" : "=D" (result) : "a" (command), "b" (function), "c" (0), "d" (smi_port), "D" (0), "S" (magic) ); + dprintk("result is %x\n", result); + return result; } @@ -101,21 +94,27 @@ static int speedstep_smi_ownership (void) */ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high) { - u32 command, result, edi, high_mhz, low_mhz; + u32 command, result = 0, edi, high_mhz, low_mhz; u32 state=0; u32 function = GET_SPEEDSTEP_FREQS; - if (!(ist_info.event & 0xFFFF)) + if (!(ist_info.event & 0xFFFF)) { + dprintk("bug #1422 -- can't read freqs from BIOS\n", result); return -ENODEV; + } command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); + dprintk("trying to determine frequencies with command %x at port %x\n", command, smi_port); + __asm__ __volatile__("movl $0, %%edi\n" "out %%al, (%%dx)\n" : "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi) : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0) ); + dprintk("result %x, low_freq %u, high_freq %u\n", result, low_mhz, high_mhz); + /* abort if results are obviously incorrect... */ if ((high_mhz + low_mhz) < 600) return -EINVAL; @@ -138,15 +137,20 @@ static int speedstep_get_state (void) command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); + dprintk("trying to determine current setting with command %x at port %x\n", command, smi_port); + __asm__ __volatile__("movl $0, %%edi\n" "out %%al, (%%dx)\n" : "=a" (result), "=b" (state), "=D" (edi) : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0) ); + dprintk("state is %x, result is %x\n", state, result); + return (state & 1); } + /** * speedstep_set_state - set the SpeedStep state * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) @@ -167,9 +171,11 @@ static void speedstep_set_state (unsigned int state) command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); + dprintk("trying to set frequency to state %u with command %x at port %x\n", state, command, smi_port); + do { if (retry) { - dprintk(KERN_INFO "cpufreq: retry %u, previous result %u\n", retry, result); + dprintk("retry %u, previous result %u, waiting...\n", retry, result); mdelay(retry * 50); } retry++; @@ -185,7 +191,7 @@ static void speedstep_set_state (unsigned int state) local_irq_restore(flags); if (new_state == state) { - dprintk(KERN_INFO "cpufreq: change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result); + dprintk("change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result); } else { printk(KERN_ERR "cpufreq: change failed with new_state %u and result %u\n", new_state, result); } @@ -250,7 +256,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) result = speedstep_smi_ownership(); if (result) { - dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n"); + dprintk("fails in aquiring ownership of a SMI interface.\n"); return -EINVAL; } @@ -259,30 +265,24 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) &speedstep_freqs[SPEEDSTEP_HIGH].frequency); if (result) { /* fall back to speedstep_lib.c dection mechanism: try both states out */ - dprintk(KERN_INFO PFX "could not detect low and high frequencies by SMI call.\n"); - if (!speedstep_processor) - speedstep_processor = speedstep_detect_processor(); - - if (!speedstep_processor) - return -ENODEV; - + dprintk("could not detect low and high frequencies by SMI call.\n"); result = speedstep_get_freqs(speedstep_processor, &speedstep_freqs[SPEEDSTEP_LOW].frequency, &speedstep_freqs[SPEEDSTEP_HIGH].frequency, &speedstep_set_state); if (result) { - dprintk(KERN_INFO PFX "could not detect two different speeds -- aborting.\n"); + dprintk("could not detect two different speeds -- aborting.\n"); return result; } else - dprintk(KERN_INFO PFX "workaround worked.\n"); + dprintk("workaround worked.\n"); } /* get current speed setting */ state = speedstep_get_state(); speed = speedstep_freqs[state].frequency; - dprintk(KERN_INFO "cpufreq: currently at %s speed setting - %i MHz\n", + dprintk("currently at %s speed setting - %i MHz\n", (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", (speed / 1000)); @@ -310,10 +310,6 @@ static unsigned int speedstep_get(unsigned int cpu) { if (cpu) return -ENODEV; - if (!speedstep_processor) - speedstep_processor = speedstep_detect_processor(); - if (!speedstep_processor) - return 0; return speedstep_get_processor_frequency(speedstep_processor); } @@ -323,7 +319,7 @@ static int speedstep_resume(struct cpufreq_policy *policy) int result = speedstep_smi_ownership(); if (result) - dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n"); + dprintk("fails in re-aquiring ownership of a SMI interface.\n"); return result; } @@ -354,14 +350,23 @@ static struct cpufreq_driver speedstep_driver = { */ static int __init speedstep_init(void) { - struct cpuinfo_x86 *c = cpu_data; + speedstep_processor = speedstep_detect_processor(); + + switch (speedstep_processor) { + case SPEEDSTEP_PROCESSOR_PIII_T: + case SPEEDSTEP_PROCESSOR_PIII_C: + case SPEEDSTEP_PROCESSOR_PIII_C_EARLY: + break; + default: + speedstep_processor = 0; + } - if (c->x86_vendor != X86_VENDOR_INTEL) { - printk (KERN_INFO PFX "No Intel CPU detected.\n"); + if (!speedstep_processor) { + dprintk ("No supported Intel CPU detected.\n"); return -ENODEV; } - dprintk(KERN_DEBUG PFX "signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", + dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level); diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c index 55df60a43..98b85b604 100644 --- a/arch/i386/kernel/cpu/cyrix.c +++ b/arch/i386/kernel/cpu/cyrix.c @@ -187,6 +187,14 @@ static void __init geode_configure(void) } +#ifdef CONFIG_PCI +static struct pci_device_id cyrix_55x0[] = { + { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510) }, + { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520) }, + { }, +}; +#endif + static void __init init_cyrix(struct cpuinfo_x86 *c) { unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0; @@ -274,8 +282,7 @@ static void __init init_cyrix(struct cpuinfo_x86 *c) /* * The 5510/5520 companion chips have a funky PIT. */ - if (pci_find_device(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, NULL) || - pci_find_device(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, NULL)) + if (pci_dev_present(cyrix_55x0)) pit_latch_buggy = 1; /* GXm supports extended cpuid levels 'ala' AMD */ diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c index d13f9bb47..b8d847b85 100644 --- a/arch/i386/kernel/cpu/intel.c +++ b/arch/i386/kernel/cpu/intel.c @@ -56,62 +56,6 @@ int __init ppro_with_ram_bug(void) return 0; } -#define LVL_1_INST 1 -#define LVL_1_DATA 2 -#define LVL_2 3 -#define LVL_3 4 -#define LVL_TRACE 5 - -struct _cache_table -{ - unsigned char descriptor; - char cache_type; - short size; -}; - -/* all the cache descriptor types we care about (no TLB or trace cache entries) */ -static struct _cache_table cache_table[] __initdata = -{ - { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */ - { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */ - { 0x0a, LVL_1_DATA, 8 }, /* 2 way set assoc, 32 byte line size */ - { 0x0c, LVL_1_DATA, 16 }, /* 4-way set assoc, 32 byte line size */ - { 0x22, LVL_3, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x23, LVL_3, 1024 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x25, LVL_3, 2048 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x29, LVL_3, 4096 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x2c, LVL_1_DATA, 32 }, /* 8-way set assoc, 64 byte line size */ - { 0x30, LVL_1_INST, 32 }, /* 8-way set assoc, 64 byte line size */ - { 0x39, LVL_2, 128 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x3b, LVL_2, 128 }, /* 2-way set assoc, sectored cache, 64 byte line size */ - { 0x3c, LVL_2, 256 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */ - { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */ - { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */ - { 0x44, LVL_2, 1024 }, /* 4-way set assoc, 32 byte line size */ - { 0x45, LVL_2, 2048 }, /* 4-way set assoc, 32 byte line size */ - { 0x60, LVL_1_DATA, 16 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x66, LVL_1_DATA, 8 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x67, LVL_1_DATA, 16 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x68, LVL_1_DATA, 32 }, /* 4-way set assoc, sectored cache, 64 byte line size */ - { 0x70, LVL_TRACE, 12 }, /* 8-way set assoc */ - { 0x71, LVL_TRACE, 16 }, /* 8-way set assoc */ - { 0x72, LVL_TRACE, 32 }, /* 8-way set assoc */ - { 0x78, LVL_2, 1024 }, /* 4-way set assoc, 64 byte line size */ - { 0x79, LVL_2, 128 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x7a, LVL_2, 256 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x7b, LVL_2, 512 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x7c, LVL_2, 1024 }, /* 8-way set assoc, sectored cache, 64 byte line size */ - { 0x7d, LVL_2, 2048 }, /* 8-way set assoc, 64 byte line size */ - { 0x7f, LVL_2, 512 }, /* 2-way set assoc, 64 byte line size */ - { 0x82, LVL_2, 256 }, /* 8-way set assoc, 32 byte line size */ - { 0x83, LVL_2, 512 }, /* 8-way set assoc, 32 byte line size */ - { 0x84, LVL_2, 1024 }, /* 8-way set assoc, 32 byte line size */ - { 0x85, LVL_2, 2048 }, /* 8-way set assoc, 32 byte line size */ - { 0x86, LVL_2, 512 }, /* 4-way set assoc, 64 byte line size */ - { 0x87, LVL_2, 1024 }, /* 8-way set assoc, 64 byte line size */ - { 0x00, 0, 0} -}; /* * P4 Xeon errata 037 workaround. @@ -135,8 +79,8 @@ static void __init Intel_errata_workarounds(struct cpuinfo_x86 *c) static void __init init_intel(struct cpuinfo_x86 *c) { + unsigned int l2 = 0; char *p = NULL; - unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ #ifdef CONFIG_X86_F00F_BUG /* @@ -158,79 +102,7 @@ static void __init init_intel(struct cpuinfo_x86 *c) #endif select_idle_routine(c); - if (c->cpuid_level > 1) { - /* supports eax=2 call */ - int i, j, n; - int regs[4]; - unsigned char *dp = (unsigned char *)regs; - - /* Number of times to iterate */ - n = cpuid_eax(2) & 0xFF; - - for ( i = 0 ; i < n ; i++ ) { - cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]); - - /* If bit 31 is set, this is an unknown format */ - for ( j = 0 ; j < 3 ; j++ ) { - if ( regs[j] < 0 ) regs[j] = 0; - } - - /* Byte 0 is level count, not a descriptor */ - for ( j = 1 ; j < 16 ; j++ ) { - unsigned char des = dp[j]; - unsigned char k = 0; - - /* look up this descriptor in the table */ - while (cache_table[k].descriptor != 0) - { - if (cache_table[k].descriptor == des) { - switch (cache_table[k].cache_type) { - case LVL_1_INST: - l1i += cache_table[k].size; - break; - case LVL_1_DATA: - l1d += cache_table[k].size; - break; - case LVL_2: - l2 += cache_table[k].size; - break; - case LVL_3: - l3 += cache_table[k].size; - break; - case LVL_TRACE: - trace += cache_table[k].size; - break; - } - - break; - } - - k++; - } - } - } - - if ( trace ) - printk (KERN_INFO "CPU: Trace cache: %dK uops", trace); - else if ( l1i ) - printk (KERN_INFO "CPU: L1 I cache: %dK", l1i); - if ( l1d ) - printk(", L1 D cache: %dK\n", l1d); - else - printk("\n"); - if ( l2 ) - printk(KERN_INFO "CPU: L2 cache: %dK\n", l2); - if ( l3 ) - printk(KERN_INFO "CPU: L3 cache: %dK\n", l3); - - /* - * This assumes the L3 cache is shared; it typically lives in - * the northbridge. The L1 caches are included by the L2 - * cache, and so should not be included for the purpose of - * SMP switching weights. - */ - c->x86_cache_size = l2 ? l2 : (l1i+l1d); - } + l2 = init_intel_cacheinfo(c); /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until model 3 mask 3 */ if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) @@ -267,50 +139,7 @@ static void __init init_intel(struct cpuinfo_x86 *c) if ( p ) strcpy(c->x86_model_id, p); -#ifdef CONFIG_X86_HT - if (cpu_has(c, X86_FEATURE_HT)) { - extern int phys_proc_id[NR_CPUS]; - - u32 eax, ebx, ecx, edx; - int index_lsb, index_msb, tmp; - int cpu = smp_processor_id(); - - cpuid(1, &eax, &ebx, &ecx, &edx); - smp_num_siblings = (ebx & 0xff0000) >> 16; - - if (smp_num_siblings == 1) { - printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); - } else if (smp_num_siblings > 1 ) { - index_lsb = 0; - index_msb = 31; - - if (smp_num_siblings > NR_CPUS) { - printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings); - smp_num_siblings = 1; - goto too_many_siblings; - } - tmp = smp_num_siblings; - while ((tmp & 1) == 0) { - tmp >>=1 ; - index_lsb++; - } - tmp = smp_num_siblings; - while ((tmp & 0x80000000 ) == 0) { - tmp <<=1 ; - index_msb--; - } - if (index_lsb != index_msb ) - index_msb++; - phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); - - printk(KERN_INFO "CPU: Physical Processor ID: %d\n", - phys_proc_id[cpu]); - } - - } -too_many_siblings: - -#endif + detect_ht(c); /* Work around errata */ Intel_errata_workarounds(c); diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c index 2bba6df81..d7c8f7b9f 100644 --- a/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/arch/i386/kernel/cpu/intel_cacheinfo.c @@ -58,7 +58,7 @@ static struct _cache_table cache_table[] __initdata = { 0x00, 0, 0} }; -unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) +unsigned int __init init_intel_cacheinfo(struct cpuinfo_x86 *c) { unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ diff --git a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c index 304bf420f..8df52e86c 100644 --- a/arch/i386/kernel/cpu/mcheck/k7.c +++ b/arch/i386/kernel/cpu/mcheck/k7.c @@ -18,7 +18,7 @@ #include "mce.h" /* Machine Check Handler For AMD Athlon/Duron */ -static asmlinkage void k7_machine_check(struct pt_regs * regs, long error_code) +static fastcall void k7_machine_check(struct pt_regs * regs, long error_code) { int recover=1; u32 alow, ahigh, high, low; @@ -54,6 +54,7 @@ static asmlinkage void k7_machine_check(struct pt_regs * regs, long error_code) wrmsr (MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL); /* Serialize */ wmb(); + add_taint(TAINT_MACHINE_CHECK); } } diff --git a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/i386/kernel/cpu/mcheck/mce.c index 207f10d58..bf6d1aefa 100644 --- a/arch/i386/kernel/cpu/mcheck/mce.c +++ b/arch/i386/kernel/cpu/mcheck/mce.c @@ -22,13 +22,13 @@ int nr_mce_banks; EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */ /* Handle unconfigured int18 (should never happen) */ -static asmlinkage void unexpected_machine_check(struct pt_regs * regs, long error_code) +static fastcall void unexpected_machine_check(struct pt_regs * regs, long error_code) { printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n", smp_processor_id()); } /* Call the installed machine check handler for this CPU setup. */ -void asmlinkage (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check; +void fastcall (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check; /* This has to be run for each processor */ void __init mcheck_init(struct cpuinfo_x86 *c) diff --git a/arch/i386/kernel/cpu/mcheck/mce.h b/arch/i386/kernel/cpu/mcheck/mce.h index b097a7ccc..dc2416dfe 100644 --- a/arch/i386/kernel/cpu/mcheck/mce.h +++ b/arch/i386/kernel/cpu/mcheck/mce.h @@ -7,7 +7,7 @@ void intel_p6_mcheck_init(struct cpuinfo_x86 *c); void winchip_mcheck_init(struct cpuinfo_x86 *c); /* Call the installed machine check handler for this CPU setup. */ -extern asmlinkage void (*machine_check_vector)(struct pt_regs *, long error_code); +extern fastcall void (*machine_check_vector)(struct pt_regs *, long error_code); extern int mce_disabled __initdata; extern int nr_mce_banks; diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c index a1664bb15..7864ddfcc 100644 --- a/arch/i386/kernel/cpu/mcheck/non-fatal.c +++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c @@ -48,6 +48,7 @@ static void mce_checkregs (void *info) /* Serialize */ wmb(); + add_taint(TAINT_MACHINE_CHECK); } } } diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/i386/kernel/cpu/mcheck/p4.c index b31fc006f..8b16ceb92 100644 --- a/arch/i386/kernel/cpu/mcheck/p4.c +++ b/arch/i386/kernel/cpu/mcheck/p4.c @@ -40,6 +40,7 @@ static void unexpected_thermal_interrupt(struct pt_regs *regs) { printk(KERN_ERR "CPU%d: Unexpected LVT TMR interrupt!\n", smp_processor_id()); + add_taint(TAINT_MACHINE_CHECK); } /* P4/Xeon Thermal transition interrupt handler */ @@ -60,6 +61,7 @@ static void intel_thermal_interrupt(struct pt_regs *regs) printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu); printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n", cpu); + add_taint(TAINT_MACHINE_CHECK); } else { printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu); } @@ -68,10 +70,10 @@ static void intel_thermal_interrupt(struct pt_regs *regs) /* Thermal interrupt handler for this CPU setup */ static void (*vendor_thermal_interrupt)(struct pt_regs *regs) = unexpected_thermal_interrupt; -asmlinkage void smp_thermal_interrupt(struct pt_regs regs) +fastcall void smp_thermal_interrupt(struct pt_regs *regs) { irq_enter(); - vendor_thermal_interrupt(®s); + vendor_thermal_interrupt(regs); irq_exit(); } @@ -157,7 +159,7 @@ done: return mce_num_extended_msrs; } -static asmlinkage void intel_machine_check(struct pt_regs * regs, long error_code) +static fastcall void intel_machine_check(struct pt_regs * regs, long error_code) { int recover=1; u32 alow, ahigh, high, low; @@ -222,6 +224,7 @@ static asmlinkage void intel_machine_check(struct pt_regs * regs, long error_cod wrmsr(msr, 0UL, 0UL); /* Serialize */ wmb(); + add_taint(TAINT_MACHINE_CHECK); } } mcgstl &= ~(1<<2); diff --git a/arch/i386/kernel/cpu/mcheck/p5.c b/arch/i386/kernel/cpu/mcheck/p5.c index c92cd661c..c45a1b485 100644 --- a/arch/i386/kernel/cpu/mcheck/p5.c +++ b/arch/i386/kernel/cpu/mcheck/p5.c @@ -17,7 +17,7 @@ #include "mce.h" /* Machine check handler for Pentium class Intel */ -static asmlinkage void pentium_machine_check(struct pt_regs * regs, long error_code) +static fastcall void pentium_machine_check(struct pt_regs * regs, long error_code) { u32 loaddr, hi, lotype; rdmsr(MSR_IA32_P5_MC_ADDR, loaddr, hi); @@ -25,6 +25,7 @@ static asmlinkage void pentium_machine_check(struct pt_regs * regs, long error_c printk(KERN_EMERG "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n", smp_processor_id(), loaddr, lotype); if(lotype&(1<<5)) printk(KERN_EMERG "CPU#%d: Possible thermal failure (CPU on fire ?).\n", smp_processor_id()); + add_taint(TAINT_MACHINE_CHECK); } /* Set up machine check reporting for processors with Intel style MCE */ diff --git a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/i386/kernel/cpu/mcheck/p6.c index d63e9578c..46640f8c2 100644 --- a/arch/i386/kernel/cpu/mcheck/p6.c +++ b/arch/i386/kernel/cpu/mcheck/p6.c @@ -17,7 +17,7 @@ #include "mce.h" /* Machine Check Handler For PII/PIII */ -static asmlinkage void intel_machine_check(struct pt_regs * regs, long error_code) +static fastcall void intel_machine_check(struct pt_regs * regs, long error_code) { int recover=1; u32 alow, ahigh, high, low; @@ -72,6 +72,7 @@ static asmlinkage void intel_machine_check(struct pt_regs * regs, long error_cod wrmsr (msr, 0UL, 0UL); /* Serialize */ wmb(); + add_taint(TAINT_MACHINE_CHECK); } } mcgstl &= ~(1<<2); diff --git a/arch/i386/kernel/cpu/mcheck/winchip.c b/arch/i386/kernel/cpu/mcheck/winchip.c index ddb579da4..753fa7acb 100644 --- a/arch/i386/kernel/cpu/mcheck/winchip.c +++ b/arch/i386/kernel/cpu/mcheck/winchip.c @@ -16,9 +16,10 @@ #include "mce.h" /* Machine check handler for WinChip C6 */ -static asmlinkage void winchip_machine_check(struct pt_regs * regs, long error_code) +static fastcall void winchip_machine_check(struct pt_regs * regs, long error_code) { printk(KERN_EMERG "CPU0: Machine Check Exception.\n"); + add_taint(TAINT_MACHINE_CHECK); } /* Set up machine check reporting on the Winchip C6 series */ diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c index f37977fdb..01cead718 100644 --- a/arch/i386/kernel/cpu/mtrr/generic.c +++ b/arch/i386/kernel/cpu/mtrr/generic.c @@ -231,7 +231,14 @@ static unsigned long set_mtrr_state(u32 deftype_lo, u32 deftype_hi) static unsigned long cr4 = 0; static u32 deftype_lo, deftype_hi; -static spinlock_t set_atomicity_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(set_atomicity_lock); + +/* + * Since we are disabling the cache don't allow any interrupts - they + * would run extremely slow and would only increase the pain. The caller must + * ensure that local interrupts are disabled and are reenabled after post_set() + * has been called. + */ static void prepare_set(void) { @@ -240,18 +247,18 @@ static void prepare_set(void) /* Note that this is not ideal, since the cache is only flushed/disabled for this CPU while the MTRRs are changed, but changing this requires more invasive changes to the way the kernel boots */ + spin_lock(&set_atomicity_lock); /* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */ cr0 = read_cr0() | 0x40000000; /* set CD flag */ - wbinvd(); write_cr0(cr0); wbinvd(); /* Save value of CR4 and clear Page Global Enable (bit 7) */ if ( cpu_has_pge ) { cr4 = read_cr4(); - write_cr4(cr4 & (unsigned char) ~(1 << 7)); + write_cr4(cr4 & ~X86_CR4_PGE); } /* Flush all TLBs via a mov %cr3, %reg; mov %reg, %cr3 */ @@ -266,8 +273,7 @@ static void prepare_set(void) static void post_set(void) { - /* Flush caches and TLBs */ - wbinvd(); + /* Flush TLBs (no need to flush caches - they are disabled) */ __flush_tlb(); /* Intel (P6) standard MTRRs */ @@ -285,13 +291,16 @@ static void post_set(void) static void generic_set_all(void) { unsigned long mask, count; + unsigned long flags; + local_irq_save(flags); prepare_set(); /* Actually set the state */ mask = set_mtrr_state(deftype_lo,deftype_hi); post_set(); + local_irq_restore(flags); /* Use the atomic bitops to update the global mask */ for (count = 0; count < sizeof mask * 8; ++count) { @@ -314,6 +323,9 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base, [RETURNS] Nothing. */ { + unsigned long flags; + + local_irq_save(flags); prepare_set(); if (size == 0) { @@ -328,6 +340,7 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base, } post_set(); + local_irq_restore(flags); } int generic_validate_add_page(unsigned long base, unsigned long size, unsigned int type) diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index 959f57378..f9efeeb81 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c @@ -77,22 +77,24 @@ static int have_wrcomb(void) { struct pci_dev *dev; - if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) { + if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) { /* ServerWorks LE chipsets have problems with write-combining Don't allow it and leave room for other chipsets to be tagged */ if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS && dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) { printk(KERN_INFO "mtrr: Serverworks LE detected. Write-combining disabled.\n"); + pci_dev_put(dev); return 0; } /* Intel 450NX errata # 23. Non ascending cachline evictions to write combining memory may resulting in data corruption */ if (dev->vendor == PCI_VENDOR_ID_INTEL && - dev->device == PCI_DEVICE_ID_INTEL_82451NX) - { + dev->device == PCI_DEVICE_ID_INTEL_82451NX) { printk(KERN_INFO "mtrr: Intel 450NX MMC detected. Write-combining disabled.\n"); + pci_dev_put(dev); return 0; } + pci_dev_put(dev); } return (mtrr_if->have_wrcomb ? mtrr_if->have_wrcomb() : 0); } @@ -147,10 +149,8 @@ static void ipi_handler(void *info) local_irq_save(flags); atomic_dec(&data->count); - while(!atomic_read(&data->gate)) { + while(!atomic_read(&data->gate)) cpu_relax(); - barrier(); - } /* The master has cleared me to execute */ if (data->smp_reg != ~0U) @@ -160,10 +160,9 @@ static void ipi_handler(void *info) mtrr_if->set_all(); atomic_dec(&data->count); - while(atomic_read(&data->gate)) { + while(atomic_read(&data->gate)) cpu_relax(); - barrier(); - } + atomic_dec(&data->count); local_irq_restore(flags); } @@ -228,10 +227,9 @@ static void set_mtrr(unsigned int reg, unsigned long base, local_irq_save(flags); - while(atomic_read(&data.count)) { + while(atomic_read(&data.count)) cpu_relax(); - barrier(); - } + /* ok, reset count and toggle gate */ atomic_set(&data.count, num_booting_cpus() - 1); atomic_set(&data.gate,1); @@ -248,10 +246,9 @@ static void set_mtrr(unsigned int reg, unsigned long base, mtrr_if->set(reg,base,size,type); /* wait for the others */ - while(atomic_read(&data.count)) { + while(atomic_read(&data.count)) cpu_relax(); - barrier(); - } + atomic_set(&data.count, num_booting_cpus() - 1); atomic_set(&data.gate,0); @@ -259,10 +256,9 @@ static void set_mtrr(unsigned int reg, unsigned long base, * Wait here for everyone to have seen the gate change * So we're the last ones to touch 'data' */ - while(atomic_read(&data.count)) { + while(atomic_read(&data.count)) cpu_relax(); - barrier(); - } + local_irq_restore(flags); } diff --git a/arch/i386/kernel/cpu/nexgen.c b/arch/i386/kernel/cpu/nexgen.c index 4c44e973b..30898a260 100644 --- a/arch/i386/kernel/cpu/nexgen.c +++ b/arch/i386/kernel/cpu/nexgen.c @@ -32,7 +32,7 @@ static void __init init_nexgen(struct cpuinfo_x86 * c) c->x86_cache_size = 256; /* A few had 1 MB... */ } -static void nexgen_identify(struct cpuinfo_x86 * c) +static void __init nexgen_identify(struct cpuinfo_x86 * c) { /* Detect NexGen with old hypercode */ if ( deep_magic_nexgen_probe() ) { diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index bdd13285f..0fd2a0a52 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c @@ -25,10 +25,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe", /* AMD-defined */ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "pni", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, - NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow", + NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", /* Transmeta-defined */ "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, @@ -45,7 +45,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) /* Intel-defined (#2) */ "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "est", - "tm2", NULL, "cid", NULL, NULL, NULL, "xtpr", NULL, + "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -54,6 +54,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* AMD-defined (#2) */ + "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; struct cpuinfo_x86 *c = v; int i, n = c - cpu_data; @@ -88,11 +94,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); #ifdef CONFIG_X86_HT - if (cpu_has_ht) { - extern int phys_proc_id[NR_CPUS]; - seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); - seq_printf(m, "siblings\t: %d\n", smp_num_siblings); - } + seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); + seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings); #endif /* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */ @@ -121,8 +124,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, " %s", x86_cap_flags[i]); seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", - c->loops_per_jiffy/(500000/HZ), - (c->loops_per_jiffy/(5000/HZ)) % 100); + HZ*(c->loops_per_jiffy >> 3)/62500, + (HZ*(c->loops_per_jiffy >> 3)/625) % 100); return 0; } diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c index 4bb3c5633..f57e5ee94 100644 --- a/arch/i386/kernel/cpu/transmeta.c +++ b/arch/i386/kernel/cpu/transmeta.c @@ -8,7 +8,7 @@ static void __init init_transmeta(struct cpuinfo_x86 *c) { unsigned int cap_mask, uk, max, dummy; unsigned int cms_rev1, cms_rev2; - unsigned int cpu_rev, cpu_freq, cpu_flags; + unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev; char cpu_info[65]; get_model_name(c); /* Same as AMD/Cyrix */ @@ -16,17 +16,24 @@ static void __init init_transmeta(struct cpuinfo_x86 *c) /* Print CMS and CPU revision */ max = cpuid_eax(0x80860000); + cpu_rev = 0; if ( max >= 0x80860001 ) { cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags); - printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n", - (cpu_rev >> 24) & 0xff, - (cpu_rev >> 16) & 0xff, - (cpu_rev >> 8) & 0xff, - cpu_rev & 0xff, - cpu_freq); + if (cpu_rev != 0x02000000) { + printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n", + (cpu_rev >> 24) & 0xff, + (cpu_rev >> 16) & 0xff, + (cpu_rev >> 8) & 0xff, + cpu_rev & 0xff, + cpu_freq); + } } if ( max >= 0x80860002 ) { - cpuid(0x80860002, &dummy, &cms_rev1, &cms_rev2, &dummy); + cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy); + if (cpu_rev == 0x02000000) { + printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n", + new_cpu_rev, cpu_freq); + } printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n", (cms_rev1 >> 24) & 0xff, (cms_rev1 >> 16) & 0xff, diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c index d4f4a5aff..78bbcba0c 100644 --- a/arch/i386/kernel/dmi_scan.c +++ b/arch/i386/kernel/dmi_scan.c @@ -102,11 +102,18 @@ inline static int __init dmi_checksum(u8 *buf) static int __init dmi_iterate(void (*decode)(struct dmi_header *)) { u8 buf[15]; - u32 fp=0xF0000; + char __iomem *p, *q; - while (fp < 0xFFFFF) - { - isa_memcpy_fromio(buf, fp, 15); + /* + * no iounmap() for that ioremap(); it would be a no-op, but it's + * so early in setup that sucker gets confused into doing what + * it shouldn't if we actually call it. + */ + p = ioremap(0xF0000, 0x10000); + if (p == NULL) + return -1; + for (q = p; q < p + 0x10000; q += 16) { + memcpy_fromio(buf, q, 15); if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) { u16 num=buf[13]<<8|buf[12]; @@ -129,7 +136,6 @@ static int __init dmi_iterate(void (*decode)(struct dmi_header *)) if(dmi_table(base,len, num, decode)==0) return 0; } - fp+=16; } return -1; } @@ -214,20 +220,6 @@ static __init __attribute__((unused)) int force_acpi_ht(struct dmi_blacklist *d) } return 0; } - -/* - * early nForce2 reference BIOS shipped with a - * bogus ACPI IRQ0 -> pin2 interrupt override -- ignore it - */ -static __init int ignore_timer_override(struct dmi_blacklist *d) -{ - extern int acpi_skip_timer_override; - printk(KERN_NOTICE "%s detected: BIOS IRQ0 pin2 override" - " will be ignored\n", d->ident); - - acpi_skip_timer_override = 1; - return 0; -} #endif #ifdef CONFIG_ACPI_PCI @@ -308,21 +300,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), NO_MATCH, NO_MATCH }}, - { force_acpi_ht, "Compaq ProLiant DL380 G2", { - MATCH(DMI_SYS_VENDOR, "Compaq"), - MATCH(DMI_PRODUCT_NAME, "ProLiant DL380 G2"), - NO_MATCH, NO_MATCH }}, - - { force_acpi_ht, "Compaq ProLiant ML530 G2", { - MATCH(DMI_SYS_VENDOR, "Compaq"), - MATCH(DMI_PRODUCT_NAME, "ProLiant ML530 G2"), - NO_MATCH, NO_MATCH }}, - - { force_acpi_ht, "Compaq ProLiant ML350 G3", { - MATCH(DMI_SYS_VENDOR, "Compaq"), - MATCH(DMI_PRODUCT_NAME, "ProLiant ML350 G3"), - NO_MATCH, NO_MATCH }}, - { force_acpi_ht, "Compaq Workstation W8000", { MATCH(DMI_SYS_VENDOR, "Compaq"), MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), @@ -368,48 +345,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), NO_MATCH, NO_MATCH }}, - /* - * Systems with nForce2 BIOS timer override bug - * nVidia claims all nForce have timer on pin0, - * and applying this workaround is a NOP on fixed BIOS, - * so prospects are good for replacing these entries - * with something to key of chipset PCI-ID. - */ - { ignore_timer_override, "Abit NF7-S v2", { - MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), - MATCH(DMI_BOARD_NAME, "NF7-S/NF7,NF7-V (nVidia-nForce2)"), - MATCH(DMI_BIOS_VERSION, "6.00 PG"), - MATCH(DMI_BIOS_DATE, "03/24/2004") }}, - - { ignore_timer_override, "Asus A7N8X v2", { - MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - MATCH(DMI_BOARD_NAME, "A7N8X2.0"), - MATCH(DMI_BIOS_VERSION, "ASUS A7N8X2.0 Deluxe ACPI BIOS Rev 1007"), - MATCH(DMI_BIOS_DATE, "10/06/2003") }}, - - { ignore_timer_override, "Asus A7N8X-X", { - MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - MATCH(DMI_BOARD_NAME, "A7N8X-X"), - MATCH(DMI_BIOS_VERSION, "ASUS A7N8X-X ACPI BIOS Rev 1009"), - MATCH(DMI_BIOS_DATE, "2/3/2004") }}, - - { ignore_timer_override, "MSI K7N2-Delta", { - MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), - MATCH(DMI_BOARD_NAME, "MS-6570"), - MATCH(DMI_BIOS_VERSION, "6.00 PG"), - MATCH(DMI_BIOS_DATE, "03/29/2004") }}, - - { ignore_timer_override, "Shuttle SN41G2", { - MATCH(DMI_BOARD_VENDOR, "Shuttle Inc"), - MATCH(DMI_BOARD_NAME, "FN41"), - MATCH(DMI_BIOS_VERSION, "6.00 PG"), - MATCH(DMI_BIOS_DATE, "01/14/2004") }}, - - { ignore_timer_override, "Shuttle AN35N", { - MATCH(DMI_BOARD_VENDOR, "Shuttle Inc"), - MATCH(DMI_BOARD_NAME, "AN35"), - MATCH(DMI_BIOS_VERSION, "6.00 PG"), - MATCH(DMI_BIOS_DATE, "12/05/2003") }}, #endif // CONFIG_ACPI_BOOT #ifdef CONFIG_ACPI_PCI diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index fd4988dcc..8c3623b85 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c @@ -62,7 +62,7 @@ extern void * boot_ioremap(unsigned long, unsigned long); */ static unsigned long efi_rt_eflags; -static spinlock_t efi_rt_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(efi_rt_lock); static pgd_t efi_bak_pg_dir_pointer[2]; static void efi_call_phys_prelog(void) diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 1c230a7cb..0e7e68be1 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -131,7 +131,7 @@ VM_MASK = 0x00020000 movl $(__USER_DS), %edx; \ movl %edx, %ds; \ movl %edx, %es; \ - pushl $11; \ + movl $11,%eax; \ call do_exit; \ .previous; \ .section __ex_table,"a";\ @@ -140,40 +140,6 @@ VM_MASK = 0x00020000 .previous - -ENTRY(lcall7) - pushfl # We get a different stack layout with call - # gates, which has to be cleaned up later.. - pushl %eax - SAVE_ALL - movl %esp, %ebp - pushl %ebp - pushl $0x7 -do_lcall: - movl EIP(%ebp), %eax # due to call gates, this is eflags, not eip.. - movl CS(%ebp), %edx # this is eip.. - movl EFLAGS(%ebp), %ecx # and this is cs.. - movl %eax,EFLAGS(%ebp) # - movl %edx,EIP(%ebp) # Now we move them to their "normal" places - movl %ecx,CS(%ebp) # - GET_THREAD_INFO_WITH_ESP(%ebp) # GET_THREAD_INFO - movl TI_exec_domain(%ebp), %edx # Get the execution domain - call *EXEC_DOMAIN_handler(%edx) # Call the handler for the domain - addl $4, %esp - popl %eax - jmp resume_userspace - -ENTRY(lcall27) - pushfl # We get a different stack layout with call - # gates, which has to be cleaned up later.. - pushl %eax - SAVE_ALL - movl %esp, %ebp - pushl %ebp - pushl $0x27 - jmp do_lcall - - ENTRY(ret_from_fork) pushl %eax call schedule_tail @@ -210,6 +176,7 @@ ENTRY(resume_userspace) #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) + cli cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? jnz restore_all need_resched: @@ -218,11 +185,7 @@ need_resched: jz restore_all testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ? jz restore_all - movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp) - sti - call schedule - movl $0,TI_preempt_count(%ebp) - cli + call preempt_schedule_irq jmp need_resched #endif @@ -269,6 +232,7 @@ sysenter_past_esp: /* if something modifies registers it must also disable sysexit */ movl EIP(%esp), %edx movl OLDESP(%esp), %ecx + xorl %ebp,%ebp sti sysexit @@ -325,8 +289,8 @@ work_notifysig: # deal with pending signals and ALIGN work_notifysig_v86: - pushl %ecx - call save_v86_state + pushl %ecx # save ti_flags for do_notify_resume + call save_v86_state # %eax contains pt_regs pointer popl %ecx movl %eax, %esp xorl %edx, %edx @@ -393,6 +357,7 @@ vector=vector+1 ALIGN common_interrupt: SAVE_ALL + movl %esp,%eax call do_IRQ jmp ret_from_intr @@ -400,7 +365,8 @@ common_interrupt: ENTRY(name) \ pushl $nr-256; \ SAVE_ALL \ - call smp_/**/name; \ + movl %esp,%eax; \ + call smp_/**/name; \ jmp ret_from_intr; /* The include is where all of the SMP etc. interrupts come from */ @@ -423,18 +389,15 @@ error_code: pushl %ebx cld movl %es, %ecx - movl ORIG_EAX(%esp), %esi # get the error code movl ES(%esp), %edi # get the function address + movl ORIG_EAX(%esp), %edx # get the error code movl %eax, ORIG_EAX(%esp) movl %ecx, ES(%esp) - movl %esp, %edx - pushl %esi # push the error code - pushl %edx # push the pt_regs pointer - movl $(__USER_DS), %edx - movl %edx, %ds - movl %edx, %es + movl $(__USER_DS), %ecx + movl %ecx, %ds + movl %ecx, %es + movl %esp,%eax # pt_regs pointer call *%edi - addl $8, %esp jmp ret_from_exception ENTRY(coprocessor_error) @@ -491,11 +454,9 @@ ENTRY(debug) debug_stack_correct: pushl $-1 # mark this as an int SAVE_ALL - movl %esp,%edx - pushl $0 - pushl %edx + xorl %edx,%edx # error code 0 + movl %esp,%eax # pt_regs pointer call do_debug - addl $8,%esp testl %eax,%eax jnz restore_all jmp ret_from_exception @@ -525,11 +486,9 @@ ENTRY(nmi) nmi_stack_correct: pushl %eax SAVE_ALL - movl %esp, %edx - pushl $0 - pushl %edx + xorl %edx,%edx # zero error code + movl %esp,%eax # pt_regs pointer call do_nmi - addl $8, %esp RESTORE_ALL nmi_stack_fixup: @@ -549,11 +508,9 @@ nmi_debug_stack_fixup: ENTRY(int3) pushl $-1 # mark this as an int SAVE_ALL - movl %esp,%edx - pushl $0 - pushl %edx + xorl %edx,%edx # zero error code + movl %esp,%eax # pt_regs pointer call do_int3 - addl $8,%esp testl %eax,%eax jnz restore_all jmp ret_from_exception @@ -901,5 +858,9 @@ ENTRY(sys_call_table) .long sys_mq_getsetattr .long sys_ni_syscall /* reserved for kexec */ .long sys_waitid + .long sys_ni_syscall /* 285 */ /* available */ + .long sys_add_key + .long sys_request_key + .long sys_keyctl syscall_table_size=(.-sys_call_table) diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 95fe2fdf4..ea1ef3a32 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -128,9 +128,6 @@ ENTRY(startup_32_smp) movl %eax,%fs movl %eax,%gs - xorl %ebx,%ebx - incl %ebx /* This is a secondary processor (AP) */ - /* * New page tables may be in 4Mbyte page mode and may * be using the global pages. @@ -148,7 +145,7 @@ ENTRY(startup_32_smp) #define cr4_bits mmu_cr4_features-__PAGE_OFFSET movl cr4_bits,%edx andl %edx,%edx - jz 3f + jz 6f movl %cr4,%eax # Turn on paging options (PSE,PAE,..) orl %edx,%eax movl %eax,%cr4 @@ -176,9 +173,10 @@ ENTRY(startup_32_smp) wrmsr 6: - /* cpuid clobbered ebx, set it up again: */ + /* This is a secondary processor (AP) */ xorl %ebx,%ebx incl %ebx + 3: #endif /* CONFIG_SMP */ diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c index b93f0332d..bd22e8762 100644 --- a/arch/i386/kernel/i386_ksyms.c +++ b/arch/i386/kernel/i386_ksyms.c @@ -61,7 +61,6 @@ extern unsigned long get_cmos_time(void); /* platform dependent support */ EXPORT_SYMBOL(boot_cpu_data); -EXPORT_SYMBOL(MCA_bus); #ifdef CONFIG_DISCONTIGMEM EXPORT_SYMBOL(node_data); EXPORT_SYMBOL(physnode_map); @@ -71,15 +70,10 @@ EXPORT_SYMBOL(xquad_portio); #endif EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_fpu); -EXPORT_SYMBOL(dump_extended_fpu); EXPORT_SYMBOL_GPL(kernel_fpu_begin); EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(ioremap_nocache); EXPORT_SYMBOL(iounmap); -EXPORT_SYMBOL(enable_irq); -EXPORT_SYMBOL(disable_irq); -EXPORT_SYMBOL(disable_irq_nosync); -EXPORT_SYMBOL(probe_irq_mask); EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(pm_idle); EXPORT_SYMBOL(pm_power_off); @@ -146,7 +140,6 @@ EXPORT_SYMBOL(__write_lock_failed); EXPORT_SYMBOL(__read_lock_failed); /* Global SMP stuff */ -EXPORT_SYMBOL(synchronize_irq); EXPORT_SYMBOL(smp_call_function); /* TLB flushing */ @@ -179,7 +172,7 @@ EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(register_die_notifier); #ifdef CONFIG_HAVE_DEC_LOCK -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif EXPORT_SYMBOL(__PAGE_KERNEL); diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c index 3da92c23d..5af8b6838 100644 --- a/arch/i386/kernel/i387.c +++ b/arch/i386/kernel/i387.c @@ -60,7 +60,8 @@ void init_fpu(struct task_struct *tsk) tsk->thread.i387.fsave.twd = 0xffffffffu; tsk->thread.i387.fsave.fos = 0xffff0000u; } - tsk->used_math = 1; + /* only the device not available exception or ptrace can call init_fpu */ + set_stopped_child_used_math(tsk); } /* @@ -111,16 +112,17 @@ static inline unsigned short twd_i387_to_fxsr( unsigned short twd ) static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave ) { struct _fpxreg *st = NULL; + unsigned long tos = (fxsave->swd >> 11) & 7; unsigned long twd = (unsigned long) fxsave->twd; unsigned long tag; unsigned long ret = 0xffff0000u; int i; -#define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16); +#define FPREG_ADDR(f, n) ((void *)&(f)->st_space + (n) * 16); for ( i = 0 ; i < 8 ; i++ ) { if ( twd & 0x1 ) { - st = (struct _fpxreg *) FPREG_ADDR( fxsave, i ); + st = FPREG_ADDR( fxsave, (i - tos) & 7 ); switch ( st->exponent & 0x7fff ) { case 0x7fff: @@ -330,13 +332,13 @@ static int save_i387_fxsave( struct _fpstate __user *buf ) int save_i387( struct _fpstate __user *buf ) { - if ( !current->used_math ) + if ( !used_math() ) return 0; /* This will cause a "finit" to be triggered by the next * attempted FPU operation by the 'current' process. */ - current->used_math = 0; + clear_used_math(); if ( HAVE_HWFP ) { if ( cpu_has_fxsr ) { @@ -382,7 +384,7 @@ int restore_i387( struct _fpstate __user *buf ) } else { err = restore_i387_soft( ¤t->thread.i387.soft, buf ); } - current->used_math = 1; + set_used_math(); return err; } @@ -506,7 +508,7 @@ int dump_fpu( struct pt_regs *regs, struct user_i387_struct *fpu ) int fpvalid; struct task_struct *tsk = current; - fpvalid = tsk->used_math; + fpvalid = !!used_math(); if ( fpvalid ) { unlazy_fpu( tsk ); if ( cpu_has_fxsr ) { @@ -519,24 +521,9 @@ int dump_fpu( struct pt_regs *regs, struct user_i387_struct *fpu ) return fpvalid; } -int dump_extended_fpu( struct pt_regs *regs, struct user_fxsr_struct *fpu ) -{ - int fpvalid; - struct task_struct *tsk = current; - - fpvalid = tsk->used_math && cpu_has_fxsr; - if ( fpvalid ) { - unlazy_fpu( tsk ); - memcpy( fpu, &tsk->thread.i387.fxsave, - sizeof(struct user_fxsr_struct) ); - } - - return fpvalid; -} - int dump_task_fpu(struct task_struct *tsk, struct user_i387_struct *fpu) { - int fpvalid = tsk->used_math; + int fpvalid = !!tsk_used_math(tsk); if (fpvalid) { if (tsk == current) @@ -551,7 +538,7 @@ int dump_task_fpu(struct task_struct *tsk, struct user_i387_struct *fpu) int dump_task_extended_fpu(struct task_struct *tsk, struct user_fxsr_struct *fpu) { - int fpvalid = tsk->used_math && cpu_has_fxsr; + int fpvalid = tsk_used_math(tsk) && cpu_has_fxsr; if (fpvalid) { if (tsk == current) diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index dec7ebf49..5349062f5 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +38,7 @@ * moves to arch independent land */ -spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(i8259A_lock); static void end_8259A_irq (unsigned int irq) { diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 4bbd49692..d184f0ae5 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -42,7 +42,10 @@ #include "io_ports.h" -static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED; +int (*ioapic_renumber_irq)(int ioapic, int irq); +atomic_t irq_mis_count; + +static DEFINE_SPINLOCK(ioapic_lock); /* * Is the SiS APIC rmw bug present ? @@ -255,8 +258,6 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t cpumask) # define Dprintk(x...) # endif -extern cpumask_t irq_affinity[NR_IRQS]; - cpumask_t __cacheline_aligned pending_irq_balance_cpumask[NR_IRQS]; #define IRQBALANCE_CHECK_ARCH -999 @@ -572,6 +573,7 @@ static int balanced_irq(void *unused) for ( ; ; ) { set_current_state(TASK_INTERRUPTIBLE); time_remaining = schedule_timeout(time_remaining); + try_to_freeze(PF_FREEZE); if (time_after(jiffies, prev_balance_time+balanced_irq_interval)) { do_irq_balance(); @@ -636,7 +638,7 @@ failed: return 0; } -static int __init irqbalance_disable(char *str) +int __init irqbalance_disable(char *str) { irqbalance_disabled = 1; return 0; @@ -653,7 +655,7 @@ static inline void move_irq(int irq) } } -__initcall(balanced_irq_init); +late_initcall(balanced_irq_init); #else /* !CONFIG_IRQBALANCE */ static inline void move_irq(int irq) { } @@ -728,7 +730,7 @@ __setup("pirq=", ioapic_pirq_setup); /* * Find the IRQ entry number of a certain pin. */ -static int __init find_irq_entry(int apic, int pin, int type) +static int find_irq_entry(int apic, int pin, int type) { int i; @@ -838,7 +840,7 @@ void __init setup_ioapic_dest(void) /* * EISA Edge/Level control register, ELCR */ -static int __init EISA_ELCR(unsigned int irq) +static int EISA_ELCR(unsigned int irq) { if (irq < 16) { unsigned int port = 0x4d0 + (irq >> 3); @@ -955,7 +957,7 @@ static int __init MPBIOS_polarity(int idx) return polarity; } -static int __init MPBIOS_trigger(int idx) +static int MPBIOS_trigger(int idx) { int bus = mp_irqs[idx].mpc_srcbus; int trigger; @@ -1069,8 +1071,13 @@ static int pin_2_irq(int idx, int apic, int pin) while (i < apic) irq += nr_ioapic_registers[i++]; irq += pin; - if ((!apic) && (irq < 16)) - irq += 16; + + /* + * For MPS mode, so far only needed by ES7000 platform + */ + if (ioapic_renumber_irq) + irq = ioapic_renumber_irq(apic, irq); + break; } default: @@ -1758,7 +1765,7 @@ static int __init timer_irq_works(void) local_irq_enable(); /* Let ten ticks pass... */ - mdelay((10 * 1000) / HZ); + mdelay((10 * 1000) / HZ + 1); /* * Expect a few ticks at least, to be sure some possible @@ -1879,9 +1886,7 @@ static void end_level_ioapic_irq (unsigned int irq) ack_APIC_irq(); if (!(v & (1 << (i & 0x1f)))) { -#ifdef APIC_MISMATCH_DEBUG atomic_inc(&irq_mis_count); -#endif spin_lock(&ioapic_lock); __mask_and_edge_IO_APIC_irq(irq); __unmask_and_level_IO_APIC_irq(irq); diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 693b41afd..3d4e56312 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -3,437 +3,58 @@ * * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar * - * This file contains the code used by various IRQ handling routines: - * asking for different IRQ's should be done through these routines - * instead of just grabbing them. Thus setups with different IRQ numbers - * shouldn't result in any weird surprises, and installing new handlers - * should be easier. + * This file contains the lowest level x86-specific interrupt + * entry, irq-stacks and irq statistics code. All the remaining + * irq logic is done by the generic kernel/irq/ code and + * by the x86-specific irq controller code. (e.g. i8259.c and + * io_apic.c.) */ -/* - * (mostly architecture independent, will move to kernel/irq.c in 2.5.) - * - * IRQs are in fact implemented a bit like signal handlers for the kernel. - * Naturally it's not a 1:1 relation, but there are similarities. - */ - -#include -#include +#include #include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Linux has a controller-independent x86 interrupt architecture. - * every controller has a 'controller-template', that is used - * by the main code to do the right thing. Each driver-visible - * interrupt source is transparently wired to the apropriate - * controller. Thus drivers need not be aware of the - * interrupt-controller. - * - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. - * (IO-APICs assumed to be messaging to Pentium local-APICs) - * - * the code is designed to be easily extended with new/different - * interrupt controllers, without having to do assembly magic. - */ -/* - * Controller mappings for all interrupt sources: - */ -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -static void register_irq_proc (unsigned int irq); - -/* - * per-CPU IRQ handling stacks - */ -#ifdef CONFIG_4KSTACKS -union irq_ctx *hardirq_ctx[NR_CPUS]; -union irq_ctx *softirq_ctx[NR_CPUS]; -#endif - -/* - * Special irq handlers. - */ - -irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) -{ return IRQ_NONE; } - -/* - * Generic no controller code - */ - -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) -{ +#ifndef CONFIG_X86_LOCAL_APIC /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. + * each architecture has to answer this themselves. */ -#ifdef CONFIG_X86 +void ack_bad_irq(unsigned int irq) +{ printk("unexpected IRQ trap at vector %02x\n", irq); -#ifdef CONFIG_X86_LOCAL_APIC - /* - * Currently unexpected vectors happen only on SMP and APIC. - * We _must_ ack these because every local APIC has only N - * irq slots per priority level, and a 'hanging, unacked' IRQ - * holds up an irq slot - in excessive cases (when multiple - * unexpected vectors occur) that might lock up the APIC - * completely. - */ - ack_APIC_irq(); -#endif -#endif } - -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none - -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; - -atomic_t irq_err_count; -#if defined(CONFIG_X86_IO_APIC) && defined(APIC_MISMATCH_DEBUG) -atomic_t irq_mis_count; #endif +#ifdef CONFIG_4KSTACKS /* - * Generic, controller-independent functions: + * per-CPU IRQ handling contexts (thread information and stack) */ +union irq_ctx { + struct thread_info tinfo; + u32 stack[THREAD_SIZE/sizeof(u32)]; +}; -int show_interrupts(struct seq_file *p, void *v) -{ - int i = *(loff_t *) v, j; - struct irqaction * action; - unsigned long flags; - - if (i == 0) { - seq_printf(p, " "); - for (j=0; jtypename); - seq_printf(p, " %s", action->name); - - for (action=action->next; action; action = action->next) - seq_printf(p, ", %s", action->name); - - seq_putc(p, '\n'); -skip: - spin_unlock_irqrestore(&irq_desc[i].lock, flags); - } else if (i == NR_IRQS) { - seq_printf(p, "NMI: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", nmi_count(j)); - seq_putc(p, '\n'); -#ifdef CONFIG_X86_LOCAL_APIC - seq_printf(p, "LOC: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs); - seq_putc(p, '\n'); -#endif - seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); -#if defined(CONFIG_X86_IO_APIC) && defined(APIC_MISMATCH_DEBUG) - seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); -#endif - } - return 0; -} - - - - -#ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - while (irq_desc[irq].status & IRQ_INPROGRESS) - cpu_relax(); -} +static union irq_ctx *hardirq_ctx[NR_CPUS]; +static union irq_ctx *softirq_ctx[NR_CPUS]; #endif -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -asmlinkage int handle_IRQ_event(unsigned int irq, - struct pt_regs *regs, struct irqaction *action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - retval |= ret; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - return retval; -} - -static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - struct irqaction *action; - - if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { - printk(KERN_ERR "irq event %d: bogus return value %x\n", - irq, action_ret); - } else { - printk(KERN_ERR "irq %d: nobody cared!\n", irq); - } - dump_stack(); - printk(KERN_ERR "handlers:\n"); - action = desc->action; - do { - printk(KERN_ERR "[<%p>]", action->handler); - print_symbol(" (%s)", - (unsigned long)action->handler); - printk("\n"); - action = action->next; - } while (action); -} - -static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - static int count = 100; - - if (count) { - count--; - __report_bad_irq(irq, desc, action_ret); - } -} - -static int noirqdebug; - -static int __init noirqdebug_setup(char *str) -{ - noirqdebug = 1; - printk("IRQ lockup detection disabled\n"); - return 1; -} - -__setup("noirqdebug", noirqdebug_setup); - -/* - * If 99,900 of the previous 100,000 interrupts have not been handled then - * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to - * turn the IRQ off. - * - * (The other 100-of-100,000 interrupts may have been a correctly-functioning - * device sharing an IRQ with the failing one) - * - * Called under desc->lock - */ -static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; - if (action_ret != IRQ_NONE) - report_bad_irq(irq, desc, action_ret); - } - - desc->irq_count++; - if (desc->irq_count < 100000) - return; - - desc->irq_count = 0; - if (desc->irqs_unhandled > 99900) { - /* - * The interrupt is stuck - */ - __report_bad_irq(irq, desc, action_ret); - /* - * Now kill the IRQ - */ - printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - desc->irqs_unhandled = 0; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables and Enables are - * nested. - * Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Enables and Disables are - * nested. - * This function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} - -/** - * enable_irq - enable handling of an irq - * @irq: Interrupt to enable - * - * Undoes the effect of one call to disable_irq(). If this - * matches the last disable, processing of interrupts on this - * IRQ line is re-enabled. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced from %p\n", irq, - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific * handlers). */ -asmlinkage unsigned int do_IRQ(struct pt_regs regs) +fastcall unsigned int do_IRQ(struct pt_regs *regs) { - /* - * We ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - int irq = regs.orig_eax & 0xff; /* high bits used in ret_from_ code */ - irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; - unsigned int status; + /* high bits used in ret_from_ code */ + int irq = regs->orig_eax & 0xff; +#ifdef CONFIG_4KSTACKS + union irq_ctx *curctx, *irqctx; + u32 *isp; +#endif irq_enter(); - #ifdef CONFIG_DEBUG_STACKOVERFLOW /* Debugging check for stack overflow: is there less than 1KB free? */ { @@ -448,642 +69,54 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs) } } #endif - kstat_this_cpu.irqs[irq]++; - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; +#ifdef CONFIG_4KSTACKS - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (unlikely(!action)) - goto out; + curctx = (union irq_ctx *) current_thread_info(); + irqctx = hardirq_ctx[smp_processor_id()]; /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. + * this is where we switch to the IRQ stack. However, if we are + * already using the IRQ stack (because we interrupted a hardirq + * handler) we can't do that and just have to keep using the + * current stack (which is the irq stack already after all) */ -#ifdef CONFIG_4KSTACKS - - for (;;) { - irqreturn_t action_ret; - u32 *isp; - union irq_ctx * curctx; - union irq_ctx * irqctx; - - curctx = (union irq_ctx *) current_thread_info(); - irqctx = hardirq_ctx[smp_processor_id()]; - - spin_unlock(&desc->lock); - - /* - * this is where we switch to the IRQ stack. However, if we are already using - * the IRQ stack (because we interrupted a hardirq handler) we can't do that - * and just have to keep using the current stack (which is the irq stack already - * after all) - */ - - if (curctx == irqctx) - action_ret = handle_IRQ_event(irq, ®s, action); - else { - /* build the stack frame on the IRQ stack */ - isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); - irqctx->tinfo.task = curctx->tinfo.task; - irqctx->tinfo.previous_esp = current_stack_pointer(); - - *--isp = (u32) action; - *--isp = (u32) ®s; - *--isp = (u32) irq; - - asm volatile( - " xchgl %%ebx,%%esp \n" - " call handle_IRQ_event \n" - " xchgl %%ebx,%%esp \n" - : "=a"(action_ret) - : "b"(isp) - : "memory", "cc", "edx", "ecx" - ); - - - } - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (curctx != irqctx) - irqctx->tinfo.task = NULL; - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } + if (curctx != irqctx) { + int arg1, arg2, ebx; -#else - - for (;;) { - irqreturn_t action_ret; - - spin_unlock(&desc->lock); - - action_ret = handle_IRQ_event(irq, ®s, action); + /* build the stack frame on the IRQ stack */ + isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); + irqctx->tinfo.task = curctx->tinfo.task; + irqctx->tinfo.previous_esp = current_stack_pointer; - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } + asm volatile( + " xchgl %%ebx,%%esp \n" + " call __do_IRQ \n" + " movl %%ebx,%%esp \n" + : "=a" (arg1), "=d" (arg2), "=b" (ebx) + : "0" (irq), "1" (regs), "2" (isp) + : "memory", "cc", "ecx" + ); + } else #endif - desc->status &= ~IRQ_INPROGRESS; - -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->handler->end(irq); - spin_unlock(&desc->lock); + __do_IRQ(irq, regs); irq_exit(); return 1; } -int can_request_irq(unsigned int irq, unsigned long irqflags) -{ - struct irqaction *action; - - if (irq >= NR_IRQS) - return 0; - action = irq_desc[irq].action; - if (action) { - if (irqflags & action->flags & SA_SHIRQ) - action = NULL; - } - return !action; -} - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); - } -#endif - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_ATOMIC); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; -} - -EXPORT_SYMBOL(request_irq); - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function must not be called from interrupt context. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - -/* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - irq_desc_t *desc; - unsigned long val; - unsigned long delay; - - down(&probe_sem); - /* - * something may have generated an irq long ago and we want to - * flush such a longstanding irq before considering it as spurious. - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!irq_desc[i].action) - irq_desc[i].handler->startup(i); - spin_unlock_irq(&desc->lock); - } - - /* Wait for longstanding interrupts to trigger. */ - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) - /* about 20ms delay */ barrier(); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!desc->action) { - desc->status |= IRQ_AUTODETECT | IRQ_WAITING; - if (desc->handler->startup(i)) - desc->status |= IRQ_PENDING; - } - spin_unlock_irq(&desc->lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } else - if (i < 32) - val |= 1 << i; - } - spin_unlock_irq(&desc->lock); - } - - return val; -} - -EXPORT_SYMBOL(probe_irq_on); - -/* - * Return a mask of triggered interrupts (this - * can handle only legacy ISA interrupts). - */ - -/** - * probe_irq_mask - scan a bitmap of interrupt lines - * @val: mask of interrupts to consider - * - * Scan the ISA bus interrupt lines and return a bitmap of - * active interrupts. The interrupt probe logic state is then - * returned to its previous value. - * - * Note: we need to scan all the irq's even though we will - * only return ISA irq numbers - just so that we reset them - * all to a known state. - */ -unsigned int probe_irq_mask(unsigned long val) -{ - int i; - unsigned int mask; - - mask = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (i < 16 && !(status & IRQ_WAITING)) - mask |= 1 << i; - - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - return mask & val; -} - -/* - * Return the one interrupt that triggered (this can - * handle any interrupt source). - */ - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * their is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldnt happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. - */ - -int probe_irq_off(unsigned long val) -{ - int i, irq_found, nr_irqs; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -/* this was setup_x86_irq but it seems pretty generic */ -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_desc + irq; - - if (desc->handler == &no_irq_type) - return -ENOSYS; - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; - -#ifdef CONFIG_SMP - -static struct proc_dir_entry *smp_affinity_entry[NR_IRQS]; - -cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; - -static int irq_affinity_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc(struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - int irq = (long)data, full_count = count, err; - cpumask_t new_value, tmp; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - if (err) - return err; - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, - cpumask_of_cpu(first_cpu(new_value))); - - return full_count; -} - -#endif -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || - irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - -#ifdef CONFIG_SMP - { - struct proc_dir_entry *entry; - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; - } -#endif -} - -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - create_prof_cpu_mask(root_irq_dir); - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) - register_irq_proc(i); -} - - #ifdef CONFIG_4KSTACKS + /* * These should really be __section__(".bss.page_aligned") as well, but * gcc's 3.0 and earlier don't handle that correctly. */ -static char softirq_stack[NR_CPUS * THREAD_SIZE] __attribute__((__aligned__(THREAD_SIZE))); -static char hardirq_stack[NR_CPUS * THREAD_SIZE] __attribute__((__aligned__(THREAD_SIZE))); +static char softirq_stack[NR_CPUS * THREAD_SIZE] + __attribute__((__aligned__(THREAD_SIZE))); + +static char hardirq_stack[NR_CPUS * THREAD_SIZE] + __attribute__((__aligned__(THREAD_SIZE))); /* * allocate per-cpu stacks for hardirq and for softirq processing @@ -1135,12 +168,11 @@ asmlinkage void do_softirq(void) curctx = current_thread_info(); irqctx = softirq_ctx[smp_processor_id()]; irqctx->tinfo.task = curctx->task; - irqctx->tinfo.previous_esp = current_stack_pointer(); + irqctx->tinfo.previous_esp = current_stack_pointer; /* build the stack frame on the softirq stack */ isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); - asm volatile( " xchgl %%ebx,%%esp \n" " call __do_softirq \n" @@ -1156,3 +188,71 @@ asmlinkage void do_softirq(void) EXPORT_SYMBOL(do_softirq); #endif + +/* + * Interrupt statistics: + */ + +atomic_t irq_err_count; + +/* + * /proc/interrupts printing: + */ + +int show_interrupts(struct seq_file *p, void *v) +{ + int i = *(loff_t *) v, j; + struct irqaction * action; + unsigned long flags; + + if (i == 0) { + seq_printf(p, " "); + for (j=0; jtypename); + seq_printf(p, " %s", action->name); + + for (action=action->next; action; action = action->next) + seq_printf(p, ", %s", action->name); + + seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); + } else if (i == NR_IRQS) { + seq_printf(p, "NMI: "); + for (j = 0; j < NR_CPUS; j++) + if (cpu_online(j)) + seq_printf(p, "%10u ", nmi_count(j)); + seq_putc(p, '\n'); +#ifdef CONFIG_X86_LOCAL_APIC + seq_printf(p, "LOC: "); + for (j = 0; j < NR_CPUS; j++) + if (cpu_online(j)) + seq_printf(p, "%10u ", + irq_stat[j].apic_timer_irqs); + seq_putc(p, '\n'); +#endif + seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); +#if defined(CONFIG_X86_IO_APIC) + seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); +#endif + } + return 0; +} diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index 4d066cc30..f74b75570 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c @@ -31,6 +31,7 @@ #include #include #include +#include /* kprobe_status settings */ #define KPROBE_HIT_ACTIVE 0x00000001 @@ -42,6 +43,7 @@ static struct pt_regs jprobe_saved_regs; static long *jprobe_saved_esp; /* copy of the kernel stack at the probe fire time */ static kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; +void jprobe_return_end(void); /* * returns non-zero if opcode modifies the interrupt flag. @@ -58,9 +60,18 @@ static inline int is_IF_modifier(kprobe_opcode_t opcode) return 0; } -void arch_prepare_kprobe(struct kprobe *p) +int arch_prepare_kprobe(struct kprobe *p) +{ + return 0; +} + +void arch_copy_kprobe(struct kprobe *p) +{ + memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); +} + +void arch_remove_kprobe(struct kprobe *p) { - memcpy(p->insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); } static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs) @@ -73,22 +84,33 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) { regs->eflags |= TF_MASK; regs->eflags &= ~IF_MASK; - regs->eip = (unsigned long)&p->insn; + regs->eip = (unsigned long)&p->ainsn.insn; } /* * Interrupts are disabled on entry as trap3 is an interrupt gate and they * remain disabled thorough out this function. */ -static inline int kprobe_handler(struct pt_regs *regs) +static int kprobe_handler(struct pt_regs *regs) { struct kprobe *p; int ret = 0; - u8 *addr = (u8 *) (regs->eip - 1); + kprobe_opcode_t *addr = NULL; + unsigned long *lp; /* We're in an interrupt, but this is clear and BUG()-safe. */ preempt_disable(); - + /* Check if the application is using LDT entry for its code segment and + * calculate the address by reading the base address from the LDT entry. + */ + if ((regs->xcs & 4) && (current->mm)) { + lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8) + + (char *) current->mm->context.ldt); + addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip - + sizeof(kprobe_opcode_t)); + } else { + addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t)); + } /* Check we're not actually recursing */ if (kprobe_running()) { /* We *are* holding lock here, so this is safe. @@ -111,6 +133,11 @@ static inline int kprobe_handler(struct pt_regs *regs) p = get_kprobe(addr); if (!p) { unlock_kprobes(); + if (regs->eflags & VM_MASK) { + /* We are in virtual-8086 mode. Return 0 */ + goto no_kprobe; + } + if (*addr != BREAKPOINT_INSTRUCTION) { /* * The breakpoint instruction was removed right @@ -153,7 +180,7 @@ static inline int kprobe_handler(struct pt_regs *regs) * instruction. To avoid the SMP problems that can occur when we * temporarily put back the original opcode to single-step, we * single-stepped a copy of the instruction. The address of this - * copy is p->insn. + * copy is p->ainsn.insn. * * This function prepares to return from the post-single-step * interrupt. We have to fix up the stack as follows: @@ -173,10 +200,10 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs) { unsigned long *tos = (unsigned long *)®s->esp; unsigned long next_eip = 0; - unsigned long copy_eip = (unsigned long)&p->insn; + unsigned long copy_eip = (unsigned long)&p->ainsn.insn; unsigned long orig_eip = (unsigned long)p->addr; - switch (p->insn[0]) { + switch (p->ainsn.insn[0]) { case 0x9c: /* pushfl */ *tos &= ~(TF_MASK | IF_MASK); *tos |= kprobe_old_eflags; @@ -185,13 +212,13 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs) *tos = orig_eip + (*tos - copy_eip); break; case 0xff: - if ((p->insn[1] & 0x30) == 0x10) { + if ((p->ainsn.insn[1] & 0x30) == 0x10) { /* call absolute, indirect */ /* Fix return addr; eip is correct. */ next_eip = regs->eip; *tos = orig_eip + (*tos - copy_eip); - } else if (((p->insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ - ((p->insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ + } else if (((p->ainsn.insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ + ((p->ainsn.insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ /* eip is correct. */ next_eip = regs->eip; } @@ -315,12 +342,12 @@ void jprobe_return(void) { preempt_enable_no_resched(); asm volatile (" xchgl %%ebx,%%esp \n" - " int3 \n"::"b" + " int3 \n" + " .globl jprobe_return_end \n" + " jprobe_return_end: \n" + " nop \n"::"b" (jprobe_saved_esp):"memory"); } -void jprobe_return_end(void) -{ -}; int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) { diff --git a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c index 720365e46..8600faeea 100644 --- a/arch/i386/kernel/mca.c +++ b/arch/i386/kernel/mca.c @@ -56,13 +56,16 @@ static unsigned char which_scsi = 0; +int MCA_bus = 0; +EXPORT_SYMBOL(MCA_bus); + /* * Motherboard register spinlock. Untested on SMP at the moment, but * are there any MCA SMP boxes? * * Yes - Alan */ -spinlock_t mca_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mca_lock); /* Build the status info for the adapter */ @@ -119,14 +122,14 @@ static void mca_configure_adapter_status(struct mca_device *mca_dev) { /*--------------------------------------------------------------------*/ -struct resource mca_standard_resources[] = { - { "system control port B (MCA)", 0x60, 0x60 }, - { "arbitration (MCA)", 0x90, 0x90 }, - { "card Select Feedback (MCA)", 0x91, 0x91 }, - { "system Control port A (MCA)", 0x92, 0x92 }, - { "system board setup (MCA)", 0x94, 0x94 }, - { "POS (MCA)", 0x96, 0x97 }, - { "POS (MCA)", 0x100, 0x107 } +static struct resource mca_standard_resources[] = { + { .start = 0x60, .end = 0x60, .name = "system control port B (MCA)" }, + { .start = 0x90, .end = 0x90, .name = "arbitration (MCA)" }, + { .start = 0x91, .end = 0x91, .name = "card Select Feedback (MCA)" }, + { .start = 0x92, .end = 0x92, .name = "system Control port A (MCA)" }, + { .start = 0x94, .end = 0x94, .name = "system board setup (MCA)" }, + { .start = 0x96, .end = 0x97, .name = "POS (MCA)" }, + { .start = 0x100, .end = 0x107, .name = "POS (MCA)" } }; #define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource)) diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index aca20edc5..a77c612aa 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -69,7 +69,8 @@ * Thanks to Stuart Swales for pointing out this bug. */ - +//#define DEBUG /* pr_debug */ +#include #include #include #include @@ -88,12 +89,6 @@ MODULE_AUTHOR("Tigran Aivazian "); MODULE_LICENSE("GPL"); #define MICROCODE_VERSION "1.14" -#define MICRO_DEBUG 0 -#if MICRO_DEBUG -#define dprintk(x...) printk(KERN_INFO x) -#else -#define dprintk(x...) -#endif #define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ #define MC_HEADER_SIZE (sizeof (microcode_header_t)) /* 48 bytes */ @@ -114,7 +109,7 @@ MODULE_LICENSE("GPL"); #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) /* serialize access to the physical write to MSR 0x79 */ -static spinlock_t microcode_update_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(microcode_update_lock); /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ static DECLARE_MUTEX(microcode_sem); @@ -172,7 +167,7 @@ static void collect_cpu_info (void *unused) __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); /* get the current revision from MSR 0x8B */ rdmsr(MSR_IA32_UCODE_REV, val[0], uci->rev); - dprintk("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n", + pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n", uci->sig, uci->pf, uci->rev); } @@ -180,22 +175,22 @@ static inline void mark_microcode_update (int cpu_num, microcode_header_t *mc_he { struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; - dprintk("Microcode Found.\n"); - dprintk(" Header Revision 0x%x\n", mc_header->hdrver); - dprintk(" Loader Revision 0x%x\n", mc_header->ldrver); - dprintk(" Revision 0x%x \n", mc_header->rev); - dprintk(" Date %x/%x/%x\n", + pr_debug("Microcode Found.\n"); + pr_debug(" Header Revision 0x%x\n", mc_header->hdrver); + pr_debug(" Loader Revision 0x%x\n", mc_header->ldrver); + pr_debug(" Revision 0x%x \n", mc_header->rev); + pr_debug(" Date %x/%x/%x\n", ((mc_header->date >> 24 ) & 0xff), ((mc_header->date >> 16 ) & 0xff), (mc_header->date & 0xFFFF)); - dprintk(" Signature 0x%x\n", sig); - dprintk(" Type 0x%x Family 0x%x Model 0x%x Stepping 0x%x\n", + pr_debug(" Signature 0x%x\n", sig); + pr_debug(" Type 0x%x Family 0x%x Model 0x%x Stepping 0x%x\n", ((sig >> 12) & 0x3), ((sig >> 8) & 0xf), ((sig >> 4) & 0xf), ((sig & 0xf))); - dprintk(" Processor Flags 0x%x\n", pf); - dprintk(" Checksum 0x%x\n", cksum); + pr_debug(" Processor Flags 0x%x\n", pf); + pr_debug(" Checksum 0x%x\n", cksum); if (mc_header->rev < uci->rev) { printk(KERN_ERR "microcode: CPU%d not 'upgrading' to earlier revision" @@ -209,7 +204,7 @@ static inline void mark_microcode_update (int cpu_num, microcode_header_t *mc_he goto out; } - dprintk("microcode: CPU%d found a matching microcode update with " + pr_debug("microcode: CPU%d found a matching microcode update with " " revision 0x%x (current=0x%x)\n", cpu_num, mc_header->rev, uci->rev); uci->cksum = cksum; uci->pf = pf; /* keep the original mc pf for cksum calculation */ @@ -369,7 +364,7 @@ static void do_update_one (void * unused) struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; if (uci->mc == NULL) { - printk(KERN_INFO "microcode: No suitable data for CPU%d\n", cpu_num); + printk(KERN_INFO "microcode: No new microcode data for CPU%d\n", cpu_num); return; } diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 41cb82604..e5ad7e03f 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c @@ -309,8 +309,8 @@ static void __init MP_translation_info (struct mpc_config_translation *m) printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n"); else translation_table[mpc_record] = m; /* stash this for later */ - if (m->trans_quad+1 > numnodes) - numnodes = m->trans_quad+1; + if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad)) + node_set_online(m->trans_quad); } /* @@ -808,7 +808,6 @@ void __init find_smp_config (void) smp_scan_config(address, 0x400); } - /* -------------------------------------------------------------------------- ACPI-based MP Configuration -------------------------------------------------------------------------- */ @@ -996,6 +995,12 @@ void __init mp_config_acpi_legacy_irqs (void) mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA; Dprintk("Bus #%d is ISA\n", MP_ISA_BUS); + /* + * ES7000 has no legacy identity mappings + */ + if (es7000_plat) + return; + /* * Locate the IOAPIC that manages the ISA IRQs (0-15). */ @@ -1049,9 +1054,7 @@ void __init mp_config_acpi_legacy_irqs (void) } } -int (*platform_rename_gsi)(int ioapic, int gsi); - -void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) +int mp_register_gsi (u32 gsi, int edge_level, int active_high_low) { int ioapic = -1; int ioapic_pin = 0; @@ -1060,19 +1063,19 @@ void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) #ifdef CONFIG_ACPI_BUS /* Don't set up the ACPI SCI because it's already set up */ if (acpi_fadt.sci_int == gsi) - return; + return gsi; #endif ioapic = mp_find_ioapic(gsi); if (ioapic < 0) { printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); - return; + return gsi; } ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; - if (platform_rename_gsi) - gsi = platform_rename_gsi(ioapic, gsi); + if (ioapic_renumber_irq) + gsi = ioapic_renumber_irq(ioapic, gsi); /* * Avoid pin reprogramming. PRTs typically include entries @@ -1085,12 +1088,12 @@ void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) printk(KERN_ERR "Invalid reference to IOAPIC pin " "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, ioapic_pin); - return; + return gsi; } if ((1< #include #include +#include #include /* These are needed before the pgdat's are created */ @@ -39,8 +40,7 @@ extern long node_start_pfn[], node_end_pfn[]; * Function: smp_dump_qct() * * Description: gets memory layout from the quad config table. This - * function also increments numnodes with the number of nodes (quads) - * present. + * function also updates node_online_map with the nodes (quads) present. */ static void __init smp_dump_qct(void) { @@ -49,11 +49,10 @@ static void __init smp_dump_qct(void) struct sys_cfg_data *scd = (struct sys_cfg_data *)__va(SYS_CFG_DATA_PRIV_ADDR); - numnodes = 0; - for(node = 0; node < MAX_NUMNODES; node++) { - if(scd->quads_present31_0 & (1 << node)) { + nodes_clear(node_online_map); + for_each_node(node) { + if (scd->quads_present31_0 & (1 << node)) { node_set_online(node); - numnodes++; eq = &scd->eq[node]; /* Convert to pages */ node_start_pfn[node] = MB_TO_PAGES( diff --git a/arch/i386/kernel/pci-dma.c b/arch/i386/kernel/pci-dma.c index 982fe8c2b..7087b1415 100644 --- a/arch/i386/kernel/pci-dma.c +++ b/arch/i386/kernel/pci-dma.c @@ -89,11 +89,11 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, if (!mem_base) goto out; - dev->dma_mem = kmalloc(GFP_KERNEL, sizeof(struct dma_coherent_mem)); + dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); if (!dev->dma_mem) goto out; memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem)); - dev->dma_mem->bitmap = kmalloc(GFP_KERNEL, bitmap_size); + dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL); if (!dev->dma_mem->bitmap) goto free1_out; memset(dev->dma_mem->bitmap, 0, bitmap_size); @@ -122,6 +122,7 @@ void dma_release_declared_memory(struct device *dev) if(!mem) return; dev->dma_mem = NULL; + iounmap(mem->virt_base); kfree(mem->bitmap); kfree(mem); } diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 0095fa1dd..28b0d7bf0 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -57,6 +57,9 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); int hlt_counter; +unsigned long boot_option_idle_override = 0; +EXPORT_SYMBOL(boot_option_idle_override); + /* * Return saved PC of a blocked thread. */ @@ -69,6 +72,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk) * Powermanagement idle function, if any.. */ void (*pm_idle)(void); +static cpumask_t cpu_idle_map; void disable_hlt(void) { @@ -90,12 +94,14 @@ EXPORT_SYMBOL(enable_hlt); */ void default_idle(void) { - if (!hlt_counter && current_cpu_data.hlt_works_ok) { + if (!hlt_counter && boot_cpu_data.hlt_works_ok) { local_irq_disable(); if (!need_resched()) safe_halt(); else local_irq_enable(); + } else { + cpu_relax(); } } @@ -139,29 +145,44 @@ static void poll_idle (void) */ void cpu_idle (void) { + int cpu = _smp_processor_id(); + /* endless idle loop with no priority at all */ while (1) { while (!need_resched()) { void (*idle)(void); - /* - * Mark this as an RCU critical section so that - * synchronize_kernel() in the unload path waits - * for our completion. - */ - rcu_read_lock(); + + if (cpu_isset(cpu, cpu_idle_map)) + cpu_clear(cpu, cpu_idle_map); + rmb(); idle = pm_idle; if (!idle) idle = default_idle; - irq_stat[smp_processor_id()].idle_timestamp = jiffies; + irq_stat[cpu].idle_timestamp = jiffies; idle(); - rcu_read_unlock(); } schedule(); } } +void cpu_idle_wait(void) +{ + int cpu; + cpumask_t map; + + for_each_online_cpu(cpu) + cpu_set(cpu, cpu_idle_map); + + wmb(); + do { + ssleep(1); + cpus_and(map, cpu_idle_map, cpu_online_map); + } while (!cpus_empty(map)); +} +EXPORT_SYMBOL_GPL(cpu_idle_wait); + /* * This uses new MONITOR/MWAIT instructions on P4 processors with PNI, * which can obviate IPI to trigger checking of need_resched. @@ -214,6 +235,7 @@ static int __init idle_setup (char *str) pm_idle = default_idle; } + boot_option_idle_override = 1; return 1; } @@ -230,7 +252,8 @@ void show_regs(struct pt_regs * regs) if (regs->xcs & 3) printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); - printk(" EFLAGS: %08lx %s (%s)\n",regs->eflags, print_tainted(),UTS_RELEASE); + printk(" EFLAGS: %08lx %s (%s)\n", + regs->eflags, print_tainted(), system_utsname.release); printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", regs->eax,regs->ebx,regs->ecx,regs->edx); printk("ESI: %08lx EDI: %08lx EBP: %08lx", @@ -328,7 +351,7 @@ void flush_thread(void) * Forget coprocessor state.. */ clear_fpu(tsk); - tsk->used_math = 0; + clear_used_math(); } void release_thread(struct task_struct *dead_task) @@ -344,7 +367,7 @@ void release_thread(struct task_struct *dead_task) } } - release_x86_irqs(dead_task); + release_vm86_irqs(dead_task); } /* @@ -368,7 +391,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, *childregs = *regs; childregs->eax = 0; childregs->esp = esp; - p->set_child_tid = p->clear_child_tid = NULL; p->thread.esp = (unsigned long) childregs; p->thread.esp0 = (unsigned long) (childregs+1); @@ -656,7 +678,9 @@ asmlinkage int sys_execve(struct pt_regs regs) (char __user * __user *) regs.edx, ®s); if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); /* Make sure we don't return using sysenter.. */ set_thread_flag(TIF_IRET); } diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index 58a4f2f1d..7e6cf7956 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c @@ -42,6 +42,12 @@ */ #define EFL_OFFSET ((EFL-2)*4-sizeof(struct pt_regs)) +static inline struct pt_regs *get_child_regs(struct task_struct *task) +{ + void *stack_top = (void *)task->thread.esp0; + return stack_top - sizeof(struct pt_regs); +} + /* * this routine will get a word off of the processes privileged stack. * the offset is how far from the base addr as stored in the TSS. @@ -138,6 +144,123 @@ static unsigned long getreg(struct task_struct *child, return retval; } +#define LDT_SEGMENT 4 + +static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_regs *regs) +{ + unsigned long addr, seg; + + addr = regs->eip; + seg = regs->xcs & 0xffff; + if (regs->eflags & VM_MASK) { + addr = (addr & 0xffff) + (seg << 4); + return addr; + } + + /* + * We'll assume that the code segments in the GDT + * are all zero-based. That is largely true: the + * TLS segments are used for data, and the PNPBIOS + * and APM bios ones we just ignore here. + */ + if (seg & LDT_SEGMENT) { + u32 *desc; + unsigned long base; + + down(&child->mm->context.sem); + desc = child->mm->context.ldt + (seg & ~7); + base = (desc[0] >> 16) | ((desc[1] & 0xff) << 16) | (desc[1] & 0xff000000); + + /* 16-bit code segment? */ + if (!((desc[1] >> 22) & 1)) + addr &= 0xffff; + addr += base; + up(&child->mm->context.sem); + } + return addr; +} + +static inline int is_at_popf(struct task_struct *child, struct pt_regs *regs) +{ + int i, copied; + unsigned char opcode[16]; + unsigned long addr = convert_eip_to_linear(child, regs); + + copied = access_process_vm(child, addr, opcode, sizeof(opcode), 0); + for (i = 0; i < copied; i++) { + switch (opcode[i]) { + /* popf */ + case 0x9d: + return 1; + /* opcode and address size prefixes */ + case 0x66: case 0x67: + continue; + /* irrelevant prefixes (segment overrides and repeats) */ + case 0x26: case 0x2e: + case 0x36: case 0x3e: + case 0x64: case 0x65: + case 0xf0: case 0xf2: case 0xf3: + continue; + + /* + * pushf: NOTE! We should probably not let + * the user see the TF bit being set. But + * it's more pain than it's worth to avoid + * it, and a debugger could emulate this + * all in user space if it _really_ cares. + */ + case 0x9c: + default: + return 0; + } + } + return 0; +} + +static void set_singlestep(struct task_struct *child) +{ + struct pt_regs *regs = get_child_regs(child); + + /* + * Always set TIF_SINGLESTEP - this guarantees that + * we single-step system calls etc.. This will also + * cause us to set TF when returning to user mode. + */ + set_tsk_thread_flag(child, TIF_SINGLESTEP); + + /* + * If TF was already set, don't do anything else + */ + if (regs->eflags & TRAP_FLAG) + return; + + /* Set TF on the kernel stack.. */ + regs->eflags |= TRAP_FLAG; + + /* + * ..but if TF is changed by the instruction we will trace, + * don't mark it as being "us" that set it, so that we + * won't clear it by hand later. + */ + if (is_at_popf(child, regs)) + return; + + child->ptrace |= PT_DTRACE; +} + +static void clear_singlestep(struct task_struct *child) +{ + /* Always clear TIF_SINGLESTEP... */ + clear_tsk_thread_flag(child, TIF_SINGLESTEP); + + /* But touch TF only if it was set by us.. */ + if (child->ptrace & PT_DTRACE) { + struct pt_regs *regs = get_child_regs(child); + regs->eflags &= ~TRAP_FLAG; + child->ptrace &= ~PT_DTRACE; + } +} + /* * Called by kernel/ptrace.c when detaching.. * @@ -145,11 +268,7 @@ static unsigned long getreg(struct task_struct *child, */ void ptrace_disable(struct task_struct *child) { - long tmp; - - clear_tsk_thread_flag(child, TIF_SINGLESTEP); - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); + clear_singlestep(child); } /* @@ -346,6 +465,36 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) if(addr < (long) &dummy->u_debugreg[4] && ((unsigned long) data) >= TASK_SIZE-3) break; + /* Sanity-check data. Take one half-byte at once with + * check = (val >> (16 + 4*i)) & 0xf. It contains the + * R/Wi and LENi bits; bits 0 and 1 are R/Wi, and bits + * 2 and 3 are LENi. Given a list of invalid values, + * we do mask |= 1 << invalid_value, so that + * (mask >> check) & 1 is a correct test for invalid + * values. + * + * R/Wi contains the type of the breakpoint / + * watchpoint, LENi contains the length of the watched + * data in the watchpoint case. + * + * The invalid values are: + * - LENi == 0x10 (undefined), so mask |= 0x0f00. + * - R/Wi == 0x10 (break on I/O reads or writes), so + * mask |= 0x4444. + * - R/Wi == 0x00 && LENi != 0x00, so we have mask |= + * 0x1110. + * + * Finally, mask = 0x0f00 | 0x4444 | 0x1110 == 0x5f54. + * + * See the Intel Manual "System Programming Guide", + * 15.2.4 + * + * Note that LENi == 0x10 is defined on x86_64 in long + * mode (i.e. even for 32-bit userspace software, but + * 64-bit kernel), so the x86_64 mask value is 0x5454. + * See the AMD manual no. 24593 (AMD64 System + * Programming)*/ + if(addr == (long) &dummy->u_debugreg[7]) { data &= ~DR_CONTROL_RESERVED; for(i=0; i<4; i++) @@ -360,10 +509,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) } break; - case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ - case PTRACE_CONT: { /* restart after signal. */ - long tmp; - + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: /* restart after signal. */ ret = -EIO; if ((unsigned long) data > _NSIG) break; @@ -373,56 +520,39 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) else { clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); } - clear_tsk_thread_flag(child, TIF_SINGLESTEP); child->exit_code = data; - /* make sure the single step bit is not set. */ - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET,tmp); + /* make sure the single step bit is not set. */ + clear_singlestep(child); wake_up_process(child); ret = 0; break; - } /* * make the child exit. Best I can do is send it a sigkill. * perhaps it should be put in the status that it wants to * exit. */ - case PTRACE_KILL: { - long tmp; - + case PTRACE_KILL: ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; - clear_tsk_thread_flag(child, TIF_SINGLESTEP); /* make sure the single step bit is not set. */ - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); + clear_singlestep(child); wake_up_process(child); break; - } - - case PTRACE_SINGLESTEP: { /* set the trap flag. */ - long tmp; + case PTRACE_SINGLESTEP: /* set the trap flag. */ ret = -EIO; if ((unsigned long) data > _NSIG) break; clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - if ((child->ptrace & PT_DTRACE) == 0) { - /* Spurious delayed TF traps may occur */ - child->ptrace |= PT_DTRACE; - } - tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); - set_tsk_thread_flag(child, TIF_SINGLESTEP); + set_singlestep(child); child->exit_code = data; /* give it a chance to run. */ wake_up_process(child); ret = 0; break; - } case PTRACE_DETACH: /* detach a process that was attached. */ @@ -464,7 +594,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) break; } ret = 0; - if (!child->used_math) + if (!tsk_used_math(child)) init_fpu(child); get_fpregs((struct user_i387_struct __user *)data, child); break; @@ -476,7 +606,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ret = -EIO; break; } - child->used_math = 1; + set_stopped_child_used_math(child); set_fpregs(child, (struct user_i387_struct __user *)data); ret = 0; break; @@ -488,7 +618,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ret = -EIO; break; } - if (!child->used_math) + if (!tsk_used_math(child)) init_fpu(child); ret = get_fpxregs((struct user_fxsr_struct __user *)data, child); break; @@ -500,7 +630,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ret = -EIO; break; } - child->used_math = 1; + set_stopped_child_used_math(child); ret = set_fpxregs(child, (struct user_fxsr_struct __user *)data); break; } @@ -526,6 +656,24 @@ out: return ret; } +void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) +{ + struct siginfo info; + + tsk->thread.trap_no = 1; + tsk->thread.error_code = error_code; + + memset(&info, 0, sizeof(info)); + info.si_signo = SIGTRAP; + info.si_code = TRAP_BRKPT; + + /* User-mode eip? */ + info.si_addr = user_mode(regs) ? (void __user *) regs->eip : NULL; + + /* Send us the fakey SIGTRAP */ + force_sig_info(SIGTRAP, &info, tsk); +} + /* notification of system call entry/exit * - triggered by current->work.syscall_trace */ @@ -541,15 +689,19 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit) audit_syscall_exit(current, regs->eax); } - if (!test_thread_flag(TIF_SYSCALL_TRACE) && - !test_thread_flag(TIF_SINGLESTEP)) - return; if (!(current->ptrace & PT_PTRACED)) return; + + /* Fake a debug trap */ + if (test_thread_flag(TIF_SINGLESTEP)) + send_sigtrap(current, regs, 0); + + if (!test_thread_flag(TIF_SYSCALL_TRACE)) + return; + /* the 0x80 provides a way for the tracing parent to distinguish between a syscall stop and SIGTRAP delivery */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && - !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); /* * this isn't the same as continuing with a signal, but it will do diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c index 06974254c..3d7e99456 100644 --- a/arch/i386/kernel/reboot.c +++ b/arch/i386/kernel/reboot.c @@ -20,7 +20,7 @@ void (*pm_power_off)(void); static int reboot_mode; -int reboot_thru_bios; +static int reboot_thru_bios; #ifdef CONFIG_SMP int reboot_smp = 0; @@ -137,7 +137,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { { } }; -static int reboot_init(void) +static int __init reboot_init(void) { dmi_check_system(reboot_dmi_table); return 0; @@ -331,13 +331,10 @@ void machine_restart(char * __unused) * other OSs see a clean IRQ state. */ smp_send_stop(); -#elif defined(CONFIG_X86_LOCAL_APIC) - if (cpu_has_apic) { - local_irq_disable(); - disable_local_APIC(); - local_irq_enable(); - } -#endif +#endif /* CONFIG_SMP */ + + lapic_shutdown(); + #ifdef CONFIG_X86_IO_APIC disable_IO_APIC(); #endif @@ -373,6 +370,8 @@ EXPORT_SYMBOL(machine_halt); void machine_power_off(void) { + lapic_shutdown(); + if (efi_enabled) efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL); if (pm_power_off) diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c index 1cde4145c..d02df17e4 100644 --- a/arch/i386/kernel/scx200.c +++ b/arch/i386/kernel/scx200.c @@ -22,8 +22,46 @@ MODULE_LICENSE("GPL"); unsigned scx200_gpio_base = 0; long scx200_gpio_shadow[2]; -spinlock_t scx200_gpio_lock = SPIN_LOCK_UNLOCKED; -static spinlock_t scx200_gpio_config_lock = SPIN_LOCK_UNLOCKED; +static struct pci_device_id scx200_tbl[] = { + { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) }, + { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) }, + { }, +}; +MODULE_DEVICE_TABLE(pci,scx200_tbl); + +static int __devinit scx200_probe(struct pci_dev *, const struct pci_device_id *); + +static struct pci_driver scx200_pci_driver = { + .name = "scx200", + .id_table = scx200_tbl, + .probe = scx200_probe, +}; + +DEFINE_SPINLOCK(scx200_gpio_lock); +static DEFINE_SPINLOCK(scx200_gpio_config_lock); + +static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + int bank; + unsigned base; + + base = pci_resource_start(pdev, 0); + printk(KERN_INFO NAME ": GPIO base 0x%x\n", base); + + if (request_region(base, SCx200_GPIO_SIZE, "NatSemi SCx200 GPIO") == 0) { + printk(KERN_ERR NAME ": can't allocate I/O for GPIOs\n"); + return -EBUSY; + } + + scx200_gpio_base = base; + + /* read the current values driven on the GPIO signals */ + for (bank = 0; bank < 2; ++bank) + scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank); + + return 0; + +} u32 scx200_gpio_configure(int index, u32 mask, u32 bits) { @@ -77,39 +115,14 @@ void scx200_gpio_dump(unsigned index) int __init scx200_init(void) { - struct pci_dev *bridge; - int bank; - unsigned base; - printk(KERN_INFO NAME ": NatSemi SCx200 Driver\n"); - if ((bridge = pci_find_device(PCI_VENDOR_ID_NS, - PCI_DEVICE_ID_NS_SCx200_BRIDGE, - NULL)) == NULL - && (bridge = pci_find_device(PCI_VENDOR_ID_NS, - PCI_DEVICE_ID_NS_SC1100_BRIDGE, - NULL)) == NULL) - return -ENODEV; - - base = pci_resource_start(bridge, 0); - printk(KERN_INFO NAME ": GPIO base 0x%x\n", base); - - if (request_region(base, SCx200_GPIO_SIZE, "NatSemi SCx200 GPIO") == 0) { - printk(KERN_ERR NAME ": can't allocate I/O for GPIOs\n"); - return -EBUSY; - } - - scx200_gpio_base = base; - - /* read the current values driven on the GPIO signals */ - for (bank = 0; bank < 2; ++bank) - scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank); - - return 0; + return pci_module_init(&scx200_pci_driver); } void __exit scx200_cleanup(void) { + pci_unregister_driver(&scx200_pci_driver); release_region(scx200_gpio_base, SCx200_GPIO_SIZE); } diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c index 073912cfc..be61aa8af 100644 --- a/arch/i386/kernel/semaphore.c +++ b/arch/i386/kernel/semaphore.c @@ -49,12 +49,12 @@ * we cannot lose wakeup events. */ -asmlinkage void __up(struct semaphore *sem) +fastcall void __up(struct semaphore *sem) { wake_up(&sem->wait); } -asmlinkage void __sched __down(struct semaphore * sem) +fastcall void __sched __down(struct semaphore * sem) { struct task_struct *tsk = current; DECLARE_WAITQUEUE(wait, tsk); @@ -91,7 +91,7 @@ asmlinkage void __sched __down(struct semaphore * sem) tsk->state = TASK_RUNNING; } -asmlinkage int __sched __down_interruptible(struct semaphore * sem) +fastcall int __sched __down_interruptible(struct semaphore * sem) { int retval = 0; struct task_struct *tsk = current; @@ -154,7 +154,7 @@ asmlinkage int __sched __down_interruptible(struct semaphore * sem) * single "cmpxchg" without failure cases, * but then it wouldn't work on a 386. */ -asmlinkage int __down_trylock(struct semaphore * sem) +fastcall int __down_trylock(struct semaphore * sem) { int sleepers; unsigned long flags; @@ -183,9 +183,9 @@ asmlinkage int __down_trylock(struct semaphore * sem) * need to convert that sequence back into the C sequence when * there is contention on the semaphore. * - * %ecx contains the semaphore pointer on entry. Save the C-clobbered - * registers (%eax, %edx and %ecx) except %eax when used as a return - * value.. + * %eax contains the semaphore pointer on entry. Save the C-clobbered + * registers (%eax, %edx and %ecx) except %eax whish is either a return + * value or just clobbered.. */ asm( ".section .sched.text\n" @@ -196,13 +196,11 @@ asm( "pushl %ebp\n\t" "movl %esp,%ebp\n\t" #endif - "pushl %eax\n\t" "pushl %edx\n\t" "pushl %ecx\n\t" "call __down\n\t" "popl %ecx\n\t" "popl %edx\n\t" - "popl %eax\n\t" #if defined(CONFIG_FRAME_POINTER) "movl %ebp,%esp\n\t" "popl %ebp\n\t" @@ -257,13 +255,11 @@ asm( ".align 4\n" ".globl __up_wakeup\n" "__up_wakeup:\n\t" - "pushl %eax\n\t" "pushl %edx\n\t" "pushl %ecx\n\t" "call __up\n\t" "popl %ecx\n\t" "popl %edx\n\t" - "popl %eax\n\t" "ret" ); diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 19827c0c5..55ce1b114 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -87,7 +88,6 @@ int __initdata acpi_force = 0; extern acpi_interrupt_flags acpi_sci_flags; #endif -int MCA_bus; /* for MCA, but anyone else can use it if they want */ unsigned int machine_id; unsigned int machine_submodel_id; @@ -97,6 +97,9 @@ unsigned int mca_pentium_flag; /* For PCI or other memory-mapped resources */ unsigned long pci_mem_start = 0x10000000; +/* Boot loader ID as an integer, for the benefit of proc_dointvec */ +int bootloader_type; + /* user-defined highmem size */ static unsigned int highmem_pages = -1; @@ -672,6 +675,8 @@ static void __init parse_cmdline_early (char ** cmdline_p) saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { + if (c != ' ') + goto next_char; /* * "mem=nopentium" disables the 4MB page tables. * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM @@ -682,7 +687,7 @@ static void __init parse_cmdline_early (char ** cmdline_p) * HPA tells me bootloaders need to parse mem=, so no new * option should be mem= [also see Documentation/i386/boot.txt] */ - if (c == ' ' && !memcmp(from, "mem=", 4)) { + if (!memcmp(from, "mem=", 4)) { if (to != command_line) to--; if (!memcmp(from+4, "nopentium", 9)) { @@ -704,7 +709,7 @@ static void __init parse_cmdline_early (char ** cmdline_p) } } - if (c == ' ' && !memcmp(from, "memmap=", 7)) { + else if (!memcmp(from, "memmap=", 7)) { if (to != command_line) to--; if (!memcmp(from+7, "exactmap", 8)) { @@ -737,6 +742,10 @@ static void __init parse_cmdline_early (char ** cmdline_p) } } + else if (!memcmp(from, "noexec=", 7)) + noexec_setup(from + 7); + + #ifdef CONFIG_X86_SMP /* * If the BIOS enumerates physical processors before logical, @@ -812,7 +821,7 @@ static void __init parse_cmdline_early (char ** cmdline_p) * This works even on boxes that have no highmem otherwise. * This also works to reduce highmem size on bigger boxes. */ - if (c == ' ' && !memcmp(from, "highmem=", 8)) + else if (!memcmp(from, "highmem=", 8)) highmem_pages = memparse(from+8, &from) >> PAGE_SHIFT; /* @@ -820,9 +829,10 @@ static void __init parse_cmdline_early (char ** cmdline_p) * bytes. This can be used to increase (or decrease) the * vmalloc area - the default is 128m. */ - if (c == ' ' && !memcmp(from, "vmalloc=", 8)) + else if (!memcmp(from, "vmalloc=", 8)) __VMALLOC_RESERVE = memparse(from+8, &from); + next_char: c = *(from++); if (!c) break; @@ -1156,9 +1166,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat /* * Request address space for all standard resources */ -static void __init register_memory(unsigned long max_low_pfn) +static void __init register_memory(void) { - unsigned long low_mem_size; + unsigned long gapstart, gapsize; + unsigned long long last; int i; if (efi_enabled) @@ -1173,10 +1184,46 @@ static void __init register_memory(unsigned long max_low_pfn) for (i = 0; i < STANDARD_IO_RESOURCES; i++) request_resource(&ioport_resource, &standard_io_resources[i]); - /* Tell the PCI layer not to allocate too close to the RAM area.. */ - low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff; - if (low_mem_size > pci_mem_start) - pci_mem_start = low_mem_size; + /* + * Search for the bigest gap in the low 32 bits of the e820 + * memory space. + */ + last = 0x100000000ull; + gapstart = 0x10000000; + gapsize = 0x400000; + i = e820.nr_map; + while (--i >= 0) { + unsigned long long start = e820.map[i].addr; + unsigned long long end = start + e820.map[i].size; + + /* + * Since "last" is at most 4GB, we know we'll + * fit in 32 bits if this condition is true + */ + if (last > end) { + unsigned long gap = last - end; + + if (gap > gapsize) { + gapsize = gap; + gapstart = end; + } + } + if (start < last) + last = start; + } + + /* + * Start allocating dynamic PCI memory a bit into the gap, + * aligned up to the nearest megabyte. + * + * Question: should we try to pad it up a bit (do something + * like " + (gapsize >> 3)" in there too?). We now have the + * technology. + */ + pci_mem_start = (gapstart + 0xfffff) & ~0xfffff; + + printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n", + pci_mem_start, gapstart, gapsize); } /* Use inline assembly to define this because the nops are defined @@ -1288,6 +1335,15 @@ __setup("noreplacement", noreplacement_setup); static char * __init machine_specific_memory_setup(void); +#ifdef CONFIG_MCA +static void set_mca_bus(int x) +{ + MCA_bus = x; +} +#else +static void set_mca_bus(int x) { } +#endif + /* * Determine if we were loaded by an EFI loader. If so, then we have also been * passed the efi memmap, systab, etc., so we should use these data structures @@ -1323,12 +1379,13 @@ void __init setup_arch(char **cmdline_p) ist_info = IST_INFO; saved_videomode = VIDEO_MODE; if( SYS_DESC_TABLE.length != 0 ) { - MCA_bus = SYS_DESC_TABLE.table[3] &0x2; + set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2); machine_id = SYS_DESC_TABLE.table[0]; machine_submodel_id = SYS_DESC_TABLE.table[1]; BIOS_revision = SYS_DESC_TABLE.table[2]; } aux_device_present = AUX_DEVICE_INFO; + bootloader_type = LOADER_TYPE; #ifdef CONFIG_BLK_DEV_RAM rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; @@ -1404,6 +1461,7 @@ void __init setup_arch(char **cmdline_p) /* * Parse the ACPI tables for possible boot-time SMP configuration. */ + acpi_boot_table_init(); acpi_boot_init(); #ifdef CONFIG_X86_LOCAL_APIC @@ -1411,7 +1469,7 @@ void __init setup_arch(char **cmdline_p) get_smp_config(); #endif - register_memory(max_low_pfn); + register_memory(); #ifdef CONFIG_VT #if defined(CONFIG_VGA_CONSOLE) diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index a9b33b1e9..1e8b41ca0 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -190,6 +190,12 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax if (verify_area(VERIFY_READ, buf, sizeof(*buf))) goto badframe; err |= restore_i387(buf); + } else { + struct task_struct *me = current; + if (used_math()) { + clear_fpu(me); + clear_used_math(); + } } } @@ -270,7 +276,6 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, struct pt_regs *regs, unsigned long mask) { int tmp, err = 0; - unsigned long eflags; tmp = 0; __asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp)); @@ -292,11 +297,7 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, err |= __put_user(current->thread.error_code, &sc->err); err |= __put_user(regs->eip, &sc->eip); err |= __put_user(regs->xcs, (unsigned int __user *)&sc->cs); - eflags = regs->eflags; - if (current->ptrace & PT_PTRACED) { - eflags &= ~TF_MASK; - } - err |= __put_user(eflags, &sc->eflags); + err |= __put_user(regs->eflags, &sc->eflags); err |= __put_user(regs->esp, &sc->esp_at_signal); err |= __put_user(regs->xss, (unsigned int __user *)&sc->ss); @@ -364,20 +365,20 @@ static void setup_frame(int sig, struct k_sigaction *ka, ? current_thread_info()->exec_domain->signal_invmap[sig] : sig; - err |= __put_user(usig, &frame->sig); + err = __put_user(usig, &frame->sig); if (err) goto give_sigsegv; - err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]); + err = setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]); if (err) goto give_sigsegv; if (_NSIG_WORDS > 1) { - err |= __copy_to_user(&frame->extramask, &set->sig[1], + err = __copy_to_user(&frame->extramask, &set->sig[1], sizeof(frame->extramask)); + if (err) + goto give_sigsegv; } - if (err) - goto give_sigsegv; restorer = &__kernel_sigreturn; if (ka->sa.sa_flags & SA_RESTORER) @@ -412,13 +413,16 @@ static void setup_frame(int sig, struct k_sigaction *ka, regs->xes = __USER_DS; regs->xss = __USER_DS; regs->xcs = __USER_CS; - if (regs->eflags & TF_MASK) { - if (current->ptrace & PT_PTRACED) { - ptrace_notify(SIGTRAP); - } else { - regs->eflags &= ~TF_MASK; - } - } + + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", @@ -502,13 +506,16 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, regs->xes = __USER_DS; regs->xss = __USER_DS; regs->xcs = __USER_CS; - if (regs->eflags & TF_MASK) { - if (current->ptrace & PT_PTRACED) { - ptrace_notify(SIGTRAP); - } else { - regs->eflags &= ~TF_MASK; - } - } + + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", @@ -600,7 +607,9 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset) * have been cleared if the watchpoint triggered * inside the kernel. */ - __asm__("movl %0,%%db7" : : "r" (current->thread.debugreg[7])); + if (unlikely(current->thread.debugreg[7])) { + __asm__("movl %0,%%db7" : : "r" (current->thread.debugreg[7])); + } /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, &ka, oldset, regs); diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index cf6ddbcf9..0ac1d19c7 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -244,7 +244,7 @@ inline void send_IPI_mask_sequence(cpumask_t mask, int vector) static cpumask_t flush_cpumask; static struct mm_struct * flush_mm; static unsigned long flush_va; -static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tlbstate_lock); #define FLUSH_ALL 0xffffffff /* @@ -308,7 +308,7 @@ static inline void leave_mm (unsigned long cpu) * 2) Leave the mm if we are in the lazy tlb mode. */ -asmlinkage void smp_invalidate_interrupt (void) +fastcall void smp_invalidate_interrupt(struct pt_regs *regs) { unsigned long cpu; @@ -481,7 +481,7 @@ void smp_send_reschedule(int cpu) * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -538,11 +538,11 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, /* Wait for response */ while (atomic_read(&data.started) != cpus) - barrier(); + cpu_relax(); if (wait) while (atomic_read(&data.finished) != cpus) - barrier(); + cpu_relax(); spin_unlock(&call_lock); return 0; @@ -579,12 +579,12 @@ void smp_send_stop(void) * all the work is done automatically when * we return from the interrupt. */ -asmlinkage void smp_reschedule_interrupt(void) +fastcall void smp_reschedule_interrupt(struct pt_regs *regs) { ack_APIC_irq(); } -asmlinkage void smp_call_function_interrupt(void) +fastcall void smp_call_function_interrupt(struct pt_regs *regs) { void (*func) (void *info) = call_data->func; void *info = call_data->info; diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 016a07067..4b120fcd1 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -61,11 +61,12 @@ static int __initdata smp_b_stepping; /* Number of siblings per CPU package */ int smp_num_siblings = 1; int phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */ +EXPORT_SYMBOL(phys_proc_id); /* bitmap of online cpus */ cpumask_t cpu_online_map; -static cpumask_t cpu_callin_map; +cpumask_t cpu_callin_map; cpumask_t cpu_callout_map; static cpumask_t smp_commenced_mask; @@ -382,8 +383,6 @@ void __init smp_callin(void) setup_local_APIC(); map_cpu_to_logical_apicid(); - local_irq_enable(); - /* * Get our bogomips. */ @@ -396,7 +395,7 @@ void __init smp_callin(void) smp_store_cpu_info(cpuid); disable_APIC_timer(); - local_irq_disable(); + /* * Allow the master to continue. */ @@ -411,12 +410,10 @@ void __init smp_callin(void) int cpucount; -extern int cpu_idle(void); - /* * Activate a secondary processor. */ -int __init start_secondary(void *unused) +static void __init start_secondary(void *unused) { /* * Dont put anything before smp_callin(), SMP @@ -440,8 +437,12 @@ int __init start_secondary(void *unused) */ local_flush_tlb(); cpu_set(smp_processor_id(), cpu_online_map); + + /* We can take interrupts now: we're officially "up". */ + local_irq_enable(); + wmb(); - return cpu_idle(); + cpu_idle(); } /* @@ -1024,8 +1025,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus) printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", cpucount+1, - bogosum/(500000/HZ), - (bogosum/(5000/HZ))%100); + HZ*(bogosum >> 3)/62500, + (HZ*(bogosum >> 3)/625) % 100); Dprintk("Before bogocount - setting activated=1.\n"); diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c index e80cd8e41..74b0c8e03 100644 --- a/arch/i386/kernel/srat.c +++ b/arch/i386/kernel/srat.c @@ -28,6 +28,7 @@ #include #include #include +#include #include /* @@ -231,18 +232,22 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) * a set of sequential node IDs starting at zero. (ACPI doesn't seem * to specify the range of _PXM values.) */ - numnodes = 0; /* init total nodes in system */ + /* + * MCD - we no longer HAVE to number nodes sequentially. PXM domain + * numbers could go as high as 256, and MAX_NUMNODES for i386 is typically + * 32, so we will continue numbering them in this manner until MAX_NUMNODES + * approaches MAX_PXM_DOMAINS for i386. + */ + nodes_clear(node_online_map); for (i = 0; i < MAX_PXM_DOMAINS; i++) { if (BMAP_TEST(pxm_bitmap, i)) { - pxm_to_nid_map[i] = numnodes; - nid_to_pxm_map[numnodes] = i; - node_set_online(numnodes); - ++numnodes; + nid = num_online_nodes(); + pxm_to_nid_map[i] = nid; + nid_to_pxm_map[nid] = i; + node_set_online(nid); } } - - if (numnodes == 0) - BUG(); + BUG_ON(num_online_nodes() == 0); /* set cnode id in memory chunk structure */ for (i = 0; i < num_memory_chunks; i++) @@ -253,7 +258,7 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) printk("%02X ", pxm_bitmap[i]); } printk("\n"); - printk("Number of logical nodes in system = %d\n", numnodes); + printk("Number of logical nodes in system = %d\n", num_online_nodes()); printk("Number of memory chunks in system = %d\n", num_memory_chunks); for (j = 0; j < num_memory_chunks; j++){ @@ -264,7 +269,7 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) } /*calculate node_start_pfn/node_end_pfn arrays*/ - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { int been_here_before = 0; for (j = 0; j < num_memory_chunks; j++){ @@ -396,7 +401,7 @@ static void __init get_zholes_init(void) int first; unsigned long end = 0; - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { first = 1; for (c = 0; c < num_memory_chunks; c++){ if (node_memory_chunk[c].nid == nid) { @@ -424,8 +429,8 @@ unsigned long * __init get_zholes_size(int nid) zholes_size_init++; get_zholes_init(); } - if((nid >= numnodes) | (nid >= MAX_NUMNODES)) - printk("%s: nid = %d is invalid. numnodes = %d", - __FUNCTION__, nid, numnodes); + if (nid >= MAX_NUMNODES || !node_online(nid)) + printk("%s: nid = %d is invalid/offline. num_online_nodes = %d", + __FUNCTION__, nid, num_online_nodes()); return &zholes_size[nid * MAX_NR_ZONES]; } diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index a9711fc35..22d38b3a6 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -80,9 +81,9 @@ unsigned long cpu_khz; /* Detected as we calibrate the TSC */ extern unsigned long wall_jiffies; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); -spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); struct timer_opts *cur_timer = &timer_none; @@ -261,8 +262,7 @@ static inline void do_timer_interrupt(int irq, void *dev_id, last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } -#ifdef CONFIG_MCA - if( MCA_bus ) { + if (MCA_bus) { /* The PS/2 uses level-triggered interrupts. You can't turn them off, nor would you want to (any attempt to enable edge-triggered interrupts usually gets intercepted by a @@ -275,7 +275,6 @@ static inline void do_timer_interrupt(int irq, void *dev_id, irq = inb_p( 0x61 ); /* read the current state */ outb_p( irq|0x80, 0x61 ); /* reset the IRQ */ } -#endif } /* @@ -319,47 +318,58 @@ unsigned long get_cmos_time(void) return retval; } -static long clock_cmos_diff; +static long clock_cmos_diff, sleep_start; -static int time_suspend(struct sys_device *dev, u32 state) +static int timer_suspend(struct sys_device *dev, u32 state) { /* * Estimate time zone so that set_time can update the clock */ clock_cmos_diff = -get_cmos_time(); clock_cmos_diff += get_seconds(); + sleep_start = get_cmos_time(); return 0; } -static int time_resume(struct sys_device *dev) +static int timer_resume(struct sys_device *dev) { unsigned long flags; - unsigned long sec = get_cmos_time() + clock_cmos_diff; + unsigned long sec; + unsigned long sleep_length; + +#ifdef CONFIG_HPET_TIMER + if (is_hpet_enabled()) + hpet_reenable(); +#endif + sec = get_cmos_time() + clock_cmos_diff; + sleep_length = (get_cmos_time() - sleep_start) * HZ; write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = sec; xtime.tv_nsec = 0; write_sequnlock_irqrestore(&xtime_lock, flags); + jiffies += sleep_length; + wall_jiffies += sleep_length; return 0; } -static struct sysdev_class pit_sysclass = { - .resume = time_resume, - .suspend = time_suspend, - set_kset_name("pit"), +static struct sysdev_class timer_sysclass = { + .resume = timer_resume, + .suspend = timer_suspend, + set_kset_name("timer"), }; /* XXX this driverfs stuff should probably go elsewhere later -john */ -static struct sys_device device_i8253 = { +static struct sys_device device_timer = { .id = 0, - .cls = &pit_sysclass, + .cls = &timer_sysclass, }; static int time_init_device(void) { - int error = sysdev_class_register(&pit_sysclass); + int error = sysdev_class_register(&timer_sysclass); if (!error) - error = sysdev_register(&device_i8253); + error = sysdev_register(&device_timer); return error; } @@ -371,9 +381,9 @@ extern void (*late_time_init)(void); void __init hpet_time_init(void) { xtime.tv_sec = get_cmos_time(); - wall_to_monotonic.tv_sec = -xtime.tv_sec; xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); - wall_to_monotonic.tv_nsec = -xtime.tv_nsec; + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); if (hpet_enable() >= 0) { printk("Using HPET for base-timer\n"); @@ -399,9 +409,9 @@ void __init time_init(void) } #endif xtime.tv_sec = get_cmos_time(); - wall_to_monotonic.tv_sec = -xtime.tv_sec; xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); - wall_to_monotonic.tv_nsec = -xtime.tv_nsec; + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); cur_timer = select_timer(); printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c index 52fc52661..86b79c664 100644 --- a/arch/i386/kernel/time_hpet.c +++ b/arch/i386/kernel/time_hpet.c @@ -60,13 +60,51 @@ void __init wait_hpet_tick(void) } #endif +static int hpet_timer_stop_set_go(unsigned long tick) +{ + unsigned int cfg; + + /* + * Stop the timers and reset the main counter. + */ + cfg = hpet_readl(HPET_CFG); + cfg &= ~HPET_CFG_ENABLE; + hpet_writel(cfg, HPET_CFG); + hpet_writel(0, HPET_COUNTER); + hpet_writel(0, HPET_COUNTER + 4); + + /* + * Set up timer 0, as periodic with first interrupt to happen at + * hpet_tick, and period also hpet_tick. + */ + cfg = hpet_readl(HPET_T0_CFG); + cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | + HPET_TN_SETVAL | HPET_TN_32BIT; + hpet_writel(cfg, HPET_T0_CFG); + /* + * Some systems seems to need two writes to HPET_T0_CMP, + * to get interrupts working + */ + hpet_writel(tick, HPET_T0_CMP); + hpet_writel(tick, HPET_T0_CMP); + + /* + * Go! + */ + cfg = hpet_readl(HPET_CFG); + cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY; + hpet_writel(cfg, HPET_CFG); + + return 0; +} + /* * Check whether HPET was found by ACPI boot parse. If yes setup HPET * counter 0 for kernel base timer. */ int __init hpet_enable(void) { - unsigned int cfg, id; + unsigned int id; unsigned long tick_fsec_low, tick_fsec_high; /* tick in femto sec */ unsigned long hpet_tick_rem; @@ -108,31 +146,8 @@ int __init hpet_enable(void) if (hpet_tick_rem > (hpet_period >> 1)) hpet_tick++; /* rounding the result */ - /* - * Stop the timers and reset the main counter. - */ - cfg = hpet_readl(HPET_CFG); - cfg &= ~HPET_CFG_ENABLE; - hpet_writel(cfg, HPET_CFG); - hpet_writel(0, HPET_COUNTER); - hpet_writel(0, HPET_COUNTER + 4); - - /* - * Set up timer 0, as periodic with first interrupt to happen at - * hpet_tick, and period also hpet_tick. - */ - cfg = hpet_readl(HPET_T0_CFG); - cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | - HPET_TN_SETVAL | HPET_TN_32BIT; - hpet_writel(cfg, HPET_T0_CFG); - hpet_writel(hpet_tick, HPET_T0_CMP); - - /* - * Go! - */ - cfg = hpet_readl(HPET_CFG); - cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY; - hpet_writel(cfg, HPET_CFG); + if (hpet_timer_stop_set_go(hpet_tick)) + return -1; use_hpet = 1; @@ -151,6 +166,7 @@ int __init hpet_enable(void) * Register with driver. * Timer0 and Timer1 is used by platform. */ + hd.hd_phys_address = hpet_address; hd.hd_address = hpet_virt_address; hd.hd_nirqs = ntimer; hd.hd_flags = HPET_DATA_PLATFORM; @@ -185,6 +201,11 @@ int __init hpet_enable(void) return 0; } +int hpet_reenable(void) +{ + return hpet_timer_stop_set_go(hpet_tick); +} + int is_hpet_enabled(void) { return use_hpet; diff --git a/arch/i386/kernel/timers/common.c b/arch/i386/kernel/timers/common.c index 7271b0615..f7f90005e 100644 --- a/arch/i386/kernel/timers/common.c +++ b/arch/i386/kernel/timers/common.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c index 0526fc198..a3d6a2880 100644 --- a/arch/i386/kernel/timers/timer.c +++ b/arch/i386/kernel/timers/timer.c @@ -12,18 +12,18 @@ */ #endif /* list of timers, ordered by preference, NULL terminated */ -static struct timer_opts* timers[] = { +static struct init_timer_opts* __initdata timers[] = { #ifdef CONFIG_X86_CYCLONE_TIMER - &timer_cyclone, + &timer_cyclone_init, #endif #ifdef CONFIG_HPET_TIMER - &timer_hpet, + &timer_hpet_init, #endif #ifdef CONFIG_X86_PM_TIMER - &timer_pmtmr, + &timer_pmtmr_init, #endif - &timer_tsc, - &timer_pit, + &timer_tsc_init, + &timer_pit_init, NULL, }; @@ -49,7 +49,7 @@ void clock_fallback(void) /* iterates through the list of timers, returning the first * one that initializes successfully. */ -struct timer_opts* select_timer(void) +struct timer_opts* __init select_timer(void) { int i = 0; @@ -57,7 +57,7 @@ struct timer_opts* select_timer(void) while (timers[i]) { if (timers[i]->init) if (timers[i]->init(clock_override) == 0) - return timers[i]; + return timers[i]->opts; ++i; } diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c index 34f1f3d1c..f6f1206a1 100644 --- a/arch/i386/kernel/timers/timer_cyclone.c +++ b/arch/i386/kernel/timers/timer_cyclone.c @@ -245,11 +245,15 @@ static void delay_cyclone(unsigned long loops) /************************************************************/ /* cyclone timer_opts struct */ -struct timer_opts timer_cyclone = { +static struct timer_opts timer_cyclone = { .name = "cyclone", - .init = init_cyclone, .mark_offset = mark_offset_cyclone, .get_offset = get_offset_cyclone, .monotonic_clock = monotonic_clock_cyclone, .delay = delay_cyclone, }; + +struct init_timer_opts __initdata timer_cyclone_init = { + .init = init_cyclone, + .opts = &timer_cyclone, +}; diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c index 15035a563..56d8fc1ea 100644 --- a/arch/i386/kernel/timers/timer_hpet.c +++ b/arch/i386/kernel/timers/timer_hpet.c @@ -177,11 +177,15 @@ static int __init init_hpet(char* override) /************************************************************/ /* tsc timer_opts struct */ -struct timer_opts timer_hpet = { +static struct timer_opts timer_hpet = { .name = "hpet", - .init = init_hpet, .mark_offset = mark_offset_hpet, .get_offset = get_offset_hpet, .monotonic_clock = monotonic_clock_hpet, .delay = delay_hpet, }; + +struct init_timer_opts __initdata timer_hpet_init = { + .init = init_hpet, + .opts = &timer_hpet, +}; diff --git a/arch/i386/kernel/timers/timer_none.c b/arch/i386/kernel/timers/timer_none.c index 394a75250..4ea2f414d 100644 --- a/arch/i386/kernel/timers/timer_none.c +++ b/arch/i386/kernel/timers/timer_none.c @@ -1,11 +1,6 @@ #include #include -static int __init init_none(char* override) -{ - return 0; -} - static void mark_offset_none(void) { /* nothing needed */ @@ -37,7 +32,6 @@ static void delay_none(unsigned long loops) /* none timer_opts struct */ struct timer_opts timer_none = { .name = "none", - .init = init_none, .mark_offset = mark_offset_none, .get_offset = get_offset_none, .monotonic_clock = monotonic_clock_none, diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c index a433cb046..967d5453c 100644 --- a/arch/i386/kernel/timers/timer_pit.c +++ b/arch/i386/kernel/timers/timer_pit.c @@ -152,14 +152,18 @@ static unsigned long get_offset_pit(void) /* tsc timer_opts struct */ struct timer_opts timer_pit = { - .name = "pit", - .init = init_pit, - .mark_offset = mark_offset_pit, - .get_offset = get_offset_pit, + .name = "pit", + .mark_offset = mark_offset_pit, + .get_offset = get_offset_pit, .monotonic_clock = monotonic_clock_pit, .delay = delay_pit, }; +struct init_timer_opts __initdata timer_pit_init = { + .init = init_pit, + .opts = &timer_pit, +}; + void setup_pit_timer(void) { extern spinlock_t i8253_lock; @@ -181,7 +185,7 @@ static int timer_resume(struct sys_device *dev) } static struct sysdev_class timer_sysclass = { - set_kset_name("timer"), + set_kset_name("timer_pit"), .resume = timer_resume, }; diff --git a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c index 737a0219d..d77f22030 100644 --- a/arch/i386/kernel/timers/timer_pm.c +++ b/arch/i386/kernel/timers/timer_pm.c @@ -240,15 +240,18 @@ static unsigned long get_offset_pmtmr(void) /* acpi timer_opts struct */ -struct timer_opts timer_pmtmr = { +static struct timer_opts timer_pmtmr = { .name = "pmtmr", - .init = init_pmtmr, .mark_offset = mark_offset_pmtmr, .get_offset = get_offset_pmtmr, .monotonic_clock = monotonic_clock_pmtmr, .delay = delay_pmtmr, }; +struct init_timer_opts __initdata timer_pmtmr_init = { + .init = init_pmtmr, + .opts = &timer_pmtmr, +}; MODULE_LICENSE("GPL"); MODULE_AUTHOR("Dominik Brodowski "); diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index 34e9b8eba..a685994e5 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -28,7 +28,7 @@ #ifdef CONFIG_HPET_TIMER static unsigned long hpet_usec_quotient; static unsigned long hpet_last; -struct timer_opts timer_tsc; +static struct timer_opts timer_tsc; #endif static inline void cpufreq_delayed_get(void); @@ -546,11 +546,15 @@ __setup("notsc", tsc_setup); /************************************************************/ /* tsc timer_opts struct */ -struct timer_opts timer_tsc = { - .name = "tsc", - .init = init_tsc, - .mark_offset = mark_offset_tsc, - .get_offset = get_offset_tsc, - .monotonic_clock = monotonic_clock_tsc, +static struct timer_opts timer_tsc = { + .name = "tsc", + .mark_offset = mark_offset_tsc, + .get_offset = get_offset_tsc, + .monotonic_clock = monotonic_clock_tsc, .delay = delay_tsc, }; + +struct init_timer_opts __initdata timer_tsc_init = { + .init = init_tsc, + .opts = &timer_tsc, +}; diff --git a/arch/i386/kernel/trampoline.S b/arch/i386/kernel/trampoline.S index 72f7b9185..fcce0e61b 100644 --- a/arch/i386/kernel/trampoline.S +++ b/arch/i386/kernel/trampoline.S @@ -51,8 +51,14 @@ r_base = . movl $0xA5A5A5A5, trampoline_data - r_base # write marker for master knows we're running - lidt boot_idt - r_base # load idt with 0, 0 - lgdt boot_gdt - r_base # load gdt with whatever is appropriate + /* GDT tables in non default location kernel can be beyond 16MB and + * lgdt will not be able to load the address as in real mode default + * operand size is 16bit. Use lgdtl instead to force operand size + * to 32 bit. + */ + + lidtl boot_idt - r_base # load idt with 0, 0 + lgdtl boot_gdt - r_base # load gdt with whatever is appropriate xor %ax, %ax inc %ax # protected mode (PE) bit diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index e8889024f..f7e15360b 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #ifdef CONFIG_EISA @@ -53,12 +53,11 @@ #include #include +#include #include "mach_traps.h" asmlinkage int system_call(void); -asmlinkage void lcall7(void); -asmlinkage void lcall27(void); struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -95,7 +94,7 @@ asmlinkage void machine_check(void); static int kstack_depth_to_print = 24; struct notifier_block *i386die_chain; -static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(die_notifier_lock); int register_die_notifier(struct notifier_block *nb) { @@ -107,36 +106,27 @@ int register_die_notifier(struct notifier_block *nb) return err; } -static int valid_stack_ptr(struct task_struct *task, void *p) +static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) { - if (p <= (void *)task->thread_info) - return 0; - if (kstack_end(p)) - return 0; - return 1; + return p > (void *)tinfo && + p < (void *)tinfo + THREAD_SIZE - 3; } -#ifdef CONFIG_FRAME_POINTER -static void print_context_stack(struct task_struct *task, unsigned long *stack, - unsigned long ebp) +static inline unsigned long print_context_stack(struct thread_info *tinfo, + unsigned long *stack, unsigned long ebp) { unsigned long addr; - while (valid_stack_ptr(task, (void *)ebp)) { +#ifdef CONFIG_FRAME_POINTER + while (valid_stack_ptr(tinfo, (void *)ebp)) { addr = *(unsigned long *)(ebp + 4); printk(" [<%08lx>] ", addr); print_symbol("%s", addr); printk("\n"); ebp = *(unsigned long *)ebp; } -} #else -static void print_context_stack(struct task_struct *task, unsigned long *stack, - unsigned long ebp) -{ - unsigned long addr; - - while (!kstack_end(stack)) { + while (valid_stack_ptr(tinfo, stack)) { addr = *stack++; if (__kernel_text_address(addr)) { printk(" [<%08lx>]", addr); @@ -144,8 +134,9 @@ static void print_context_stack(struct task_struct *task, unsigned long *stack, printk("\n"); } } -} #endif + return ebp; +} void show_trace(struct task_struct *task, unsigned long * stack) { @@ -154,11 +145,6 @@ void show_trace(struct task_struct *task, unsigned long * stack) if (!task) task = current; - if (!valid_stack_ptr(task, stack)) { - printk("Stack pointer is garbage, not printing trace\n"); - return; - } - if (task == current) { /* Grab ebp right from our regs */ asm ("movl %%ebp, %0" : "=r" (ebp) : ); @@ -171,7 +157,7 @@ void show_trace(struct task_struct *task, unsigned long * stack) struct thread_info *context; context = (struct thread_info *) ((unsigned long)stack & (~(THREAD_SIZE - 1))); - print_context_stack(task, stack, ebp); + ebp = print_context_stack(context, stack, ebp); stack = (unsigned long*)context->previous_esp; if (!stack) break; @@ -233,7 +219,7 @@ void show_registers(struct pt_regs *regs) printk("CPU: %d\nEIP: %04x:[<%08lx>] %s VLI\nEFLAGS: %08lx" " (%s) \n", smp_processor_id(), 0xffff & regs->xcs, regs->eip, - print_tainted(), regs->eflags, UTS_RELEASE); + print_tainted(), regs->eflags, system_utsname.release); print_symbol("EIP is at %s\n", regs->eip); printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", regs->eax, regs->ebx, regs->ecx, regs->edx); @@ -321,7 +307,8 @@ void die(const char * str, struct pt_regs * regs, long err) }; static int die_counter; - if (die.lock_owner != smp_processor_id()) { + vxh_throw_oops(); + if (die.lock_owner != _smp_processor_id()) { console_verbose(); spin_lock_irq(&die.lock); die.lock_owner = smp_processor_id(); @@ -355,6 +342,7 @@ void die(const char * str, struct pt_regs * regs, long err) bust_spinlocks(0); die.lock_owner = -1; spin_unlock_irq(&die.lock); + vxh_dump_history(); if (in_interrupt()) panic("Fatal exception in interrupt"); @@ -373,16 +361,7 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long e die(str, regs, err); } -static inline unsigned long get_cr2(void) -{ - unsigned long address; - - /* get the address */ - __asm__("movl %%cr2,%0":"=r" (address)); - return address; -} - -static inline void do_trap(int trapnr, int signr, char *str, int vm86, +static void do_trap(int trapnr, int signr, char *str, int vm86, struct pt_regs * regs, long error_code, siginfo_t *info) { if (regs->eflags & VM_MASK) { @@ -419,7 +398,7 @@ static inline void do_trap(int trapnr, int signr, char *str, int vm86, } #define DO_ERROR(trapnr, signr, str, name) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +fastcall void do_##name(struct pt_regs * regs, long error_code) \ { \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ == NOTIFY_STOP) \ @@ -428,7 +407,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ } #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +fastcall void do_##name(struct pt_regs * regs, long error_code) \ { \ siginfo_t info; \ info.si_signo = signr; \ @@ -442,7 +421,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ } #define DO_VM86_ERROR(trapnr, signr, str, name) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +fastcall void do_##name(struct pt_regs * regs, long error_code) \ { \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ == NOTIFY_STOP) \ @@ -451,7 +430,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ } #define DO_VM86_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +fastcall void do_##name(struct pt_regs * regs, long error_code) \ { \ siginfo_t info; \ info.si_signo = signr; \ @@ -477,7 +456,7 @@ DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) DO_ERROR(12, SIGBUS, "stack segment", stack_segment) DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) -asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) +fastcall void do_general_protection(struct pt_regs * regs, long error_code) { int cpu = get_cpu(); struct tss_struct *tss = &per_cpu(init_tss, cpu); @@ -528,7 +507,7 @@ gp_in_vm86: gp_in_kernel: if (!fixup_exception(regs)) { if (notify_die(DIE_GPF, "general protection fault", regs, - error_code, 13, SIGSEGV) == NOTIFY_STOP); + error_code, 13, SIGSEGV) == NOTIFY_STOP) return; die("general protection fault", regs, error_code); } @@ -575,7 +554,7 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs) printk("Do you have a strange power saving mode enabled?\n"); } -static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(nmi_print_lock); void die_nmi (struct pt_regs *regs, const char *msg) { @@ -598,7 +577,11 @@ void die_nmi (struct pt_regs *regs, const char *msg) static void default_do_nmi(struct pt_regs * regs) { - unsigned char reason = get_nmi_reason(); + unsigned char reason = 0; + + /* Only the BSP gets external NMIs from the system. */ + if (!smp_processor_id()) + reason = get_nmi_reason(); if (!(reason & 0xc0)) { if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) @@ -637,7 +620,7 @@ static int dummy_nmi_callback(struct pt_regs * regs, int cpu) static nmi_callback_t nmi_callback = dummy_nmi_callback; -asmlinkage void do_nmi(struct pt_regs * regs, long error_code) +fastcall void do_nmi(struct pt_regs * regs, long error_code) { int cpu; @@ -663,7 +646,7 @@ void unset_nmi_callback(void) } #ifdef CONFIG_KPROBES -asmlinkage int do_int3(struct pt_regs *regs, long error_code) +fastcall int do_int3(struct pt_regs *regs, long error_code) { if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) @@ -698,11 +681,10 @@ asmlinkage int do_int3(struct pt_regs *regs, long error_code) * find every occurrence of the TF bit that could be saved away even * by user code) */ -asmlinkage void do_debug(struct pt_regs * regs, long error_code) +fastcall void do_debug(struct pt_regs * regs, long error_code) { unsigned int condition; struct task_struct *tsk = current; - siginfo_t info; __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); @@ -725,36 +707,29 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code) /* Save debug status register where ptrace can see it */ tsk->thread.debugreg[6] = condition; - /* Mask out spurious TF errors due to lazy TF clearing */ + /* + * Single-stepping through TF: make sure we ignore any events in + * kernel space (but re-enable TF when returning to user mode). + * And if the event was due to a debugger (PT_DTRACE), clear the + * TF flag so that register information is correct. + */ if (condition & DR_STEP) { /* - * The TF error should be masked out only if the current - * process is not traced and if the TRAP flag has been set - * previously by a tracing process (condition detected by - * the PT_DTRACE flag); remember that the i386 TRAP flag - * can be modified by the process itself in user mode, - * allowing programs to debug themselves without the ptrace() - * interface. + * We already checked v86 mode above, so we can + * check for kernel mode by just checking the CPL + * of CS. */ if ((regs->xcs & 3) == 0) goto clear_TF_reenable; - if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE) - goto clear_TF; + + if (likely(tsk->ptrace & PT_DTRACE)) { + tsk->ptrace &= ~PT_DTRACE; + regs->eflags &= ~TF_MASK; + } } /* Ok, finally something we can handle */ - tsk->thread.trap_no = 1; - tsk->thread.error_code = error_code; - info.si_signo = SIGTRAP; - info.si_errno = 0; - info.si_code = TRAP_BRKPT; - - /* If this is a kernel mode trap, save the user PC on entry to - * the kernel, that's what the debugger can make sense of. - */ - info.si_addr = ((regs->xcs & 3) == 0) ? (void __user *)tsk->thread.eip - : (void __user *)regs->eip; - force_sig_info(SIGTRAP, &info, tsk); + send_sigtrap(tsk, regs, error_code); /* Disable additional traps. They'll be re-enabled when * the signal is delivered. @@ -771,7 +746,6 @@ debug_vm86: clear_TF_reenable: set_tsk_thread_flag(tsk, TIF_SINGLESTEP); -clear_TF: regs->eflags &= ~TF_MASK; return; } @@ -837,7 +811,7 @@ void math_error(void __user *eip) force_sig_info(SIGFPE, &info, task); } -asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code) +fastcall void do_coprocessor_error(struct pt_regs * regs, long error_code) { ignore_fpu_irq = 1; math_error((void __user *)regs->eip); @@ -891,7 +865,7 @@ void simd_math_error(void __user *eip) force_sig_info(SIGFPE, &info, task); } -asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs, +fastcall void do_simd_coprocessor_error(struct pt_regs * regs, long error_code) { if (cpu_has_xmm) { @@ -915,7 +889,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs, } } -asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs, +fastcall void do_spurious_interrupt_bug(struct pt_regs * regs, long error_code) { #if 0 @@ -940,7 +914,7 @@ asmlinkage void math_state_restore(struct pt_regs regs) struct task_struct *tsk = thread->task; clts(); /* Allow maths ops (or we recurse) */ - if (!tsk->used_math) + if (!tsk_used_math(tsk)) init_fpu(tsk); restore_fpu(tsk); thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */ @@ -1015,11 +989,6 @@ static void __init set_system_gate(unsigned int n, void *addr) _set_gate(idt_table+n,15,3,addr,__KERNEL_CS); } -static void __init set_call_gate(void *a, void *addr) -{ - _set_gate(a,12,3,addr,__KERNEL_CS); -} - static void __init set_task_gate(unsigned int n, unsigned int gdt_entry) { _set_gate(idt_table+n,5,0,0,(gdt_entry<<3)); @@ -1029,9 +998,11 @@ static void __init set_task_gate(unsigned int n, unsigned int gdt_entry) void __init trap_init(void) { #ifdef CONFIG_EISA - if (isa_readl(0x0FFFD9) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) { + void __iomem *p = ioremap(0x0FFFD9, 4); + if (readl(p) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) { EISA_bus = 1; } + iounmap(p); #endif #ifdef CONFIG_X86_LOCAL_APIC @@ -1063,13 +1034,6 @@ void __init trap_init(void) set_system_gate(SYSCALL_VECTOR,&system_call); - /* - * default LDT is a single-entry callgate to lcall7 for iBCS - * and a callgate to lcall27 for Solaris/x86 binaries - */ - set_call_gate(&default_ldt[0],lcall7); - set_call_gate(&default_ldt[4],lcall27); - /* * Should be a barrier for any external CPU state. */ diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c index 483e9b2e4..2dd216ab0 100644 --- a/arch/i386/kernel/vm86.c +++ b/arch/i386/kernel/vm86.c @@ -137,6 +137,7 @@ struct pt_regs * fastcall save_v86_state(struct kernel_vm86_regs * regs) static void mark_screen_rdonly(struct task_struct * tsk) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte, *mapped; int i; @@ -151,7 +152,15 @@ static void mark_screen_rdonly(struct task_struct * tsk) pgd_clear(pgd); goto out; } - pmd = pmd_offset(pgd, 0xA0000); + pud = pud_offset(pgd, 0xA0000); + if (pud_none(*pud)) + goto out; + if (pud_bad(*pud)) { + pud_ERROR(*pud); + pud_clear(pud); + goto out; + } + pmd = pmd_offset(pud, 0xA0000); if (pmd_none(*pmd)) goto out; if (pmd_bad(*pmd)) { @@ -704,7 +713,7 @@ static struct vm86_irqs { int sig; } vm86_irqs[16]; -static spinlock_t irqbits_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irqbits_lock); static int irqbits; #define ALLOWED_SIGS ( 1 /* 0 = don't send a signal */ \ @@ -723,7 +732,14 @@ static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs) irqbits |= irq_bit; if (vm86_irqs[intno].sig) send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1); - /* else user will poll for IRQs */ + spin_unlock_irqrestore(&irqbits_lock, flags); + /* + * IRQ will be re-enabled when user asks for the irq (whether + * polling or as a result of the signal) + */ + disable_irq(intno); + return IRQ_HANDLED; + out: spin_unlock_irqrestore(&irqbits_lock, flags); return IRQ_NONE; @@ -741,7 +757,7 @@ static inline void free_vm86_irq(int irqnumber) spin_unlock_irqrestore(&irqbits_lock, flags); } -void release_x86_irqs(struct task_struct *task) +void release_vm86_irqs(struct task_struct *task) { int i; for (i = FIRST_VM86_IRQ ; i <= LAST_VM86_IRQ; i++) diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/i386/kernel/vsyscall-sysenter.S index cb54c01bd..4daefb2ec 100644 --- a/arch/i386/kernel/vsyscall-sysenter.S +++ b/arch/i386/kernel/vsyscall-sysenter.S @@ -84,7 +84,7 @@ SYSENTER_RETURN: .byte 0x04 /* DW_CFA_advance_loc4 */ .long .Lpop_ebp-.Lenter_kernel .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x12 /* RA at offset 12 now */ + .byte 0x0c /* RA at offset 12 now */ .byte 0xc5 /* DW_CFA_restore %ebp */ .byte 0x04 /* DW_CFA_advance_loc4 */ .long .Lpop_edx-.Lpop_ebp diff --git a/arch/i386/lib/dec_and_lock.c b/arch/i386/lib/dec_and_lock.c index ffd486900..ab43394dc 100644 --- a/arch/i386/lib/dec_and_lock.c +++ b/arch/i386/lib/dec_and_lock.c @@ -10,7 +10,7 @@ #include #include -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) { int counter; int newcount; diff --git a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c index 97b97af9c..080639f26 100644 --- a/arch/i386/lib/delay.c +++ b/arch/i386/lib/delay.c @@ -34,7 +34,7 @@ inline void __const_udelay(unsigned long xloops) xloops *= 4; __asm__("mull %0" :"=d" (xloops), "=&a" (d0) - :"1" (xloops),"0" (current_cpu_data.loops_per_jiffy * (HZ/4))); + :"1" (xloops),"0" (cpu_data[_smp_processor_id()].loops_per_jiffy * (HZ/4))); __delay(++xloops); } diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c index 3347c47b0..51aa2bbb0 100644 --- a/arch/i386/lib/usercopy.c +++ b/arch/i386/lib/usercopy.c @@ -514,6 +514,7 @@ do { \ unsigned long __copy_to_user_ll(void __user *to, const void *from, unsigned long n) { + BUG_ON((long) n < 0); #ifndef CONFIG_X86_WP_WORKS_OK if (unlikely(boot_cpu_data.wp_works_ok == 0) && ((unsigned long )to) < TASK_SIZE) { @@ -573,6 +574,7 @@ survive: unsigned long __copy_from_user_ll(void *to, const void __user *from, unsigned long n) { + BUG_ON((long)n < 0); if (movsl_is_ok(to, from, n)) __copy_user_zeroing(to, from, n); else @@ -597,6 +599,7 @@ unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) { might_sleep(); + BUG_ON((long) n < 0); if (access_ok(VERIFY_WRITE, to, n)) n = __copy_to_user(to, from, n); return n; @@ -623,6 +626,7 @@ unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) { might_sleep(); + BUG_ON((long) n < 0); if (access_ok(VERIFY_READ, from, n)) n = __copy_from_user(to, from, n); else diff --git a/arch/i386/mach-default/topology.c b/arch/i386/mach-default/topology.c index c70547a7e..8e4f0ab37 100644 --- a/arch/i386/mach-default/topology.c +++ b/arch/i386/mach-default/topology.c @@ -27,10 +27,42 @@ */ #include #include +#include #include struct i386_cpu cpu_devices[NR_CPUS]; +int arch_register_cpu(int num){ + struct node *parent = NULL; + +#ifdef CONFIG_NUMA + int node = cpu_to_node(num); + if (node_online(node)) + parent = &node_devices[node].node; +#endif /* CONFIG_NUMA */ + + return register_cpu(&cpu_devices[num].cpu, num, parent); +} + +#ifdef CONFIG_HOTPLUG_CPU + +void arch_unregister_cpu(int num) { + struct node *parent = NULL; + +#ifdef CONFIG_NUMA + int node = cpu_to_node(num); + if (node_online(node)) + parent = &node_devices[node].node; +#endif /* CONFIG_NUMA */ + + return unregister_cpu(&cpu_devices[num].cpu, parent); +} +EXPORT_SYMBOL(arch_register_cpu); +EXPORT_SYMBOL(arch_unregister_cpu); +#endif /*CONFIG_HOTPLUG_CPU*/ + + + #ifdef CONFIG_NUMA #include #include diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h index 1ff0caeb8..70691f0c4 100644 --- a/arch/i386/mach-es7000/es7000.h +++ b/arch/i386/mach-es7000/es7000.h @@ -104,13 +104,6 @@ struct mip_reg { #define MIP_SW_APIC 0x1020b #define MIP_FUNC(VALUE) (VALUE & 0xff) -#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT)) -#define IOAPIC_GSI_BOUND(ioapic) ((ioapic+1) * (nr_ioapic_registers[ioapic]-1)) -#define MAX_GSI_MAPSIZE 32 -#endif - -extern unsigned long io_apic_irqs; - extern int parse_unisys_oem (char *oemptr, int oem_entries); extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); extern int es7000_start_cpu(int cpu, unsigned long eip); diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c index 1d1954a7f..9707a9e45 100644 --- a/arch/i386/mach-es7000/es7000plat.c +++ b/arch/i386/mach-es7000/es7000plat.c @@ -52,72 +52,27 @@ int mip_port; unsigned long mip_addr, host_addr; #if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT)) -static unsigned long cycle_irqs = 0; -static unsigned long free_irqs = 0; -static int gsi_map[MAX_GSI_MAPSIZE] = { [0 ... MAX_GSI_MAPSIZE-1] = -1 }; /* * GSI override for ES7000 platforms. */ -static int __init -es7000_gsi_override(int ioapic, int gsi) -{ - static int newgsi = 0; - - if (gsi_map[gsi] != -1) - gsi = gsi_map[gsi]; - else if (cycle_irqs ^ free_irqs) { - newgsi = find_next_bit(&cycle_irqs, IOAPIC_GSI_BOUND(0), newgsi); - __set_bit(newgsi, &free_irqs); - gsi_map[gsi] = newgsi; - gsi = newgsi; - newgsi++; - Dprintk("es7000_gsi_override: free_irqs = 0x%lx\n", free_irqs); - } +static unsigned int base; - return gsi; -} - -static int __init +static int es7000_rename_gsi(int ioapic, int gsi) { - static int initialized = 0; - int i; - - /* - * These should NEVER be true at this point but we'd rather be - * safe than sorry. - */ - if (acpi_disabled || acpi_pci_disabled || acpi_noirq) - return gsi; - - if (ioapic) - return gsi; - - if (!initialized) { - unsigned long tmp_irqs = 0; - - for (i = 0; i < nr_ioapic_registers[0]; i++) - __set_bit(mp_irqs[i].mpc_srcbusirq, &tmp_irqs); - - cycle_irqs = (~tmp_irqs & io_apic_irqs & ((1 << IOAPIC_GSI_BOUND(0)) - 1)); - - initialized = 1; - Dprintk("es7000_rename_gsi: cycle_irqs = 0x%lx\n", cycle_irqs); - } - - for (i = 0; i < nr_ioapic_registers[0]; i++) { - if (mp_irqs[i].mpc_srcbusirq == gsi) { - if (mp_irqs[i].mpc_dstirq == gsi) - return gsi; - else - return es7000_gsi_override(0, gsi); - } + if (!base) { + int i; + for (i = 0; i < nr_ioapics; i++) + base += nr_ioapic_registers[i]; } + if (!ioapic && (gsi < 16)) + gsi += base; return gsi; } + #endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) /* @@ -184,7 +139,7 @@ parse_unisys_oem (char *oemptr, int oem_entries) } else { printk("\nEnabling ES7000 specific features...\n"); es7000_plat = 1; - platform_rename_gsi = es7000_rename_gsi; + ioapic_renumber_irq = es7000_rename_gsi; } return es7000_plat; } diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c index 8fc9fdc75..3a81e904a 100644 --- a/arch/i386/mach-visws/reboot.c +++ b/arch/i386/mach-visws/reboot.c @@ -8,9 +8,6 @@ void (*pm_power_off)(void); -int reboot_thru_bios; -int reboot_smp; - void machine_restart(char * __unused) { #ifdef CONFIG_SMP diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/i386/mach-visws/visws_apic.c index 818a2c5ae..04e658584 100644 --- a/arch/i386/mach-visws/visws_apic.c +++ b/arch/i386/mach-visws/visws_apic.c @@ -31,7 +31,7 @@ #include "irq_vectors.h" -static spinlock_t cobalt_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cobalt_lock); /* * Set the given Cobalt APIC Redirection Table entry to point diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c index 61a481423..602aea240 100644 --- a/arch/i386/mach-voyager/voyager_basic.c +++ b/arch/i386/mach-voyager/voyager_basic.c @@ -36,8 +36,6 @@ */ void (*pm_power_off)(void); -int reboot_thru_bios; - int voyager_level = 0; struct voyager_SUS *voyager_SUS = NULL; @@ -53,7 +51,7 @@ voyager_dump(int dummy1, struct pt_regs *dummy2, struct tty_struct *dummy3) static struct sysrq_key_op sysrq_voyager_dump_op = { .handler = voyager_dump, .help_msg = "Voyager", - .action_msg = "Dump Voyager Status\n", + .action_msg = "Dump Voyager Status", }; #endif diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 7cb7e8046..743fe4524 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c @@ -27,13 +27,10 @@ #include #include #include -#include #include #include -int reboot_smp = 0; - /* TLB state -- visible externally, indexed physically */ DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 }; @@ -254,7 +251,7 @@ static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; static __u16 vic_irq_enable_mask[NR_CPUS] __cacheline_aligned = { 0 }; /* Lock for enable/disable of VIC interrupts */ -static spinlock_t vic_irq_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(vic_irq_lock); /* The boot processor is correctly set up in PC mode when it * comes up, but the secondaries need their master/slave 8259 @@ -457,13 +454,12 @@ setup_trampoline(void) } /* Routine initially called when a non-boot CPU is brought online */ -int __init +static void __init start_secondary(void *unused) { __u8 cpuid = hard_smp_processor_id(); /* external functions not defined in the headers */ extern void calibrate_delay(void); - extern int cpu_idle(void); cpu_init(); @@ -520,7 +516,7 @@ start_secondary(void *unused) cpu_set(cpuid, cpu_online_map); wmb(); - return cpu_idle(); + cpu_idle(); } @@ -785,8 +781,8 @@ initialize_secondary(void) * System interrupts occur because some problem was detected on the * various busses. To find out what you have to probe all the * hardware via the CAT bus. FIXME: At the moment we do nothing. */ -asmlinkage void -smp_vic_sys_interrupt(void) +fastcall void +smp_vic_sys_interrupt(struct pt_regs *regs) { ack_CPI(VIC_SYS_INT); printk("Voyager SYSTEM INTERRUPT\n"); @@ -795,11 +791,11 @@ smp_vic_sys_interrupt(void) /* Handle a voyager CMN_INT; These interrupts occur either because of * a system status change or because a single bit memory error * occurred. FIXME: At the moment, ignore all this. */ -asmlinkage void -smp_vic_cmn_interrupt(void) +fastcall void +smp_vic_cmn_interrupt(struct pt_regs *regs) { static __u8 in_cmn_int = 0; - static spinlock_t cmn_int_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(cmn_int_lock); /* common ints are broadcast, so make sure we only do this once */ _raw_spin_lock(&cmn_int_lock); @@ -824,7 +820,7 @@ smp_vic_cmn_interrupt(void) /* * Reschedule call back. Nothing to do, all the work is done * automatically when we return from the interrupt. */ -asmlinkage void +static void smp_reschedule_interrupt(void) { /* do nothing */ @@ -832,7 +828,7 @@ smp_reschedule_interrupt(void) static struct mm_struct * flush_mm; static unsigned long flush_va; -static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tlbstate_lock); #define FLUSH_ALL 0xffffffff /* @@ -855,7 +851,7 @@ leave_mm (unsigned long cpu) /* * Invalidate call-back */ -asmlinkage void +static void smp_invalidate_interrupt(void) { __u8 cpu = smp_processor_id(); @@ -989,7 +985,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned long va) } /* enable the requested IRQs */ -asmlinkage void +static void smp_enable_irq_interrupt(void) { __u8 irq; @@ -1022,7 +1018,7 @@ smp_stop_cpu_function(void *dummy) __asm__("hlt"); } -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -1038,7 +1034,7 @@ static struct call_data_struct * call_data; * previously set up. This is used to schedule a function for * execution on all CPU's - set up the function then broadcast a * function_interrupt CPI to come here on each CPU */ -asmlinkage void +static void smp_call_function_interrupt(void) { void (*func) (void *info) = call_data->func; @@ -1133,50 +1129,50 @@ smp_call_function (void (*func) (void *info), void *info, int retry, * no local APIC, so I can't do this * * This function is currently a placeholder and is unused in the code */ -asmlinkage void -smp_apic_timer_interrupt(struct pt_regs regs) +fastcall void +smp_apic_timer_interrupt(struct pt_regs *regs) { - wrapper_smp_local_timer_interrupt(®s); + wrapper_smp_local_timer_interrupt(regs); } /* All of the QUAD interrupt GATES */ -asmlinkage void -smp_qic_timer_interrupt(struct pt_regs regs) +fastcall void +smp_qic_timer_interrupt(struct pt_regs *regs) { ack_QIC_CPI(QIC_TIMER_CPI); - wrapper_smp_local_timer_interrupt(®s); + wrapper_smp_local_timer_interrupt(regs); } -asmlinkage void -smp_qic_invalidate_interrupt(void) +fastcall void +smp_qic_invalidate_interrupt(struct pt_regs *regs) { ack_QIC_CPI(QIC_INVALIDATE_CPI); smp_invalidate_interrupt(); } -asmlinkage void -smp_qic_reschedule_interrupt(void) +fastcall void +smp_qic_reschedule_interrupt(struct pt_regs *regs) { ack_QIC_CPI(QIC_RESCHEDULE_CPI); smp_reschedule_interrupt(); } -asmlinkage void -smp_qic_enable_irq_interrupt(void) +fastcall void +smp_qic_enable_irq_interrupt(struct pt_regs *regs) { ack_QIC_CPI(QIC_ENABLE_IRQ_CPI); smp_enable_irq_interrupt(); } -asmlinkage void -smp_qic_call_function_interrupt(void) +fastcall void +smp_qic_call_function_interrupt(struct pt_regs *regs) { ack_QIC_CPI(QIC_CALL_FUNCTION_CPI); smp_call_function_interrupt(); } -asmlinkage void -smp_vic_cpi_interrupt(struct pt_regs regs) +fastcall void +smp_vic_cpi_interrupt(struct pt_regs *regs) { __u8 cpu = smp_processor_id(); @@ -1186,7 +1182,7 @@ smp_vic_cpi_interrupt(struct pt_regs regs) ack_VIC_CPI(VIC_CPI_LEVEL0); if(test_and_clear_bit(VIC_TIMER_CPI, &vic_cpi_mailbox[cpu])) - wrapper_smp_local_timer_interrupt(®s); + wrapper_smp_local_timer_interrupt(regs); if(test_and_clear_bit(VIC_INVALIDATE_CPI, &vic_cpi_mailbox[cpu])) smp_invalidate_interrupt(); if(test_and_clear_bit(VIC_RESCHEDULE_CPI, &vic_cpi_mailbox[cpu])) diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/i386/math-emu/fpu_entry.c index 633f954c3..4162c3c14 100644 --- a/arch/i386/math-emu/fpu_entry.c +++ b/arch/i386/math-emu/fpu_entry.c @@ -155,10 +155,10 @@ asmlinkage void math_emulate(long arg) RE_ENTRANT_CHECK_ON; #endif /* RE_ENTRANT_CHECKING */ - if (!current->used_math) + if (!used_math()) { finit(); - current->used_math = 1; + set_used_math(); } SETUP_DATA_AREA(arg); diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index efdcb0da9..2b535d2c9 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,7 @@ bootmem_data_t node0_bdata; * numa interface - we expect the numa architecture specfic code to have * populated the following initialisation. * - * 1) numnodes - the total number of nodes configured in the system + * 1) node_online_map - the map of all nodes configured (online) in the system * 2) physnode_map - the mapping between a pfn and owning node * 3) node_start_pfn - the starting page frame number for a node * 3) node_end_pfn - the ending page fram number for a node @@ -92,12 +93,12 @@ int __init get_memcfg_numa_flat(void) /* Run the memory configuration and find the top of memory. */ find_max_pfn(); - node_start_pfn[0] = 0; - node_end_pfn[0] = max_pfn; + node_start_pfn[0] = 0; + node_end_pfn[0] = max_pfn; /* Indicate there is one node available. */ + nodes_clear(node_online_map); node_set_online(0); - numnodes = 1; return 1; } @@ -182,7 +183,9 @@ void __init remap_numa_kva(void) unsigned long pfn; int node; - for (node = 1; node < numnodes; ++node) { + for_each_online_node(node) { + if (node == 0) + continue; for (pfn=0; pfn < node_remap_size[node]; pfn += PTRS_PER_PTE) { vaddr = node_remap_start_vaddr[node]+(pfn<bdata = &node0_bdata; @@ -374,14 +379,16 @@ void __init zone_sizes_init(void) * Clobber node 0's links and NULL out pgdat_list before starting. */ pgdat_list = NULL; - for (nid = numnodes - 1; nid >= 0; nid--) { + for (nid = MAX_NUMNODES - 1; nid >= 0; nid--) { + if (!node_online(nid)) + continue; if (nid) memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); NODE_DATA(nid)->pgdat_next = pgdat_list; pgdat_list = NODE_DATA(nid); } - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; unsigned long *zholes_size; unsigned int max_dma; @@ -463,11 +470,6 @@ void __init set_highmem_pages_init(int bad_ppro) void __init set_max_mapnr_init(void) { #ifdef CONFIG_HIGHMEM - struct zone *high0 = &NODE_DATA(0)->node_zones[ZONE_HIGHMEM]; - if (high0->spanned_pages > 0) - highmem_start_page = high0->zone_mem_map; - else - highmem_start_page = pfn_to_page(max_low_pfn+1); num_physpages = highend_pfn; #else num_physpages = max_low_pfn; diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index e92938476..a509237c4 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -112,9 +112,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, } /* Decode the code segment base from the descriptor */ - base = (desc[0] >> 16) | - ((desc[1] & 0xff) << 16) | - (desc[1] & 0xff000000); + base = get_desc_base((unsigned long *)desc); if (seg & (1<<2)) { up(¤t->mm->context.sem); @@ -201,7 +199,7 @@ static inline int is_prefetch(struct pt_regs *regs, unsigned long addr, return 0; } -asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); +fastcall void do_invalid_op(struct pt_regs *, unsigned long); /* * This routine handles page faults. It determines the address, @@ -213,7 +211,7 @@ asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); * bit 1 == 0 means read, 1 means write * bit 2 == 0 means kernel, 1 means user-mode */ -asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) +fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code) { struct task_struct *tsk; struct mm_struct *mm; @@ -518,6 +516,7 @@ vmalloc_fault: int index = pgd_index(address); unsigned long pgd_paddr; pgd_t *pgd, *pgd_k; + pud_t *pud, *pud_k; pmd_t *pmd, *pmd_k; pte_t *pte_k; @@ -530,11 +529,17 @@ vmalloc_fault: /* * set_pgd(pgd, *pgd_k); here would be useless on PAE - * and redundant with the set_pmd() on non-PAE. + * and redundant with the set_pmd() on non-PAE. As would + * set_pud. */ - pmd = pmd_offset(pgd, address); - pmd_k = pmd_offset(pgd_k, address); + pud = pud_offset(pgd, address); + pud_k = pud_offset(pgd_k, address); + if (!pud_present(*pud_k)) + goto no_context; + + pmd = pmd_offset(pud, address); + pmd_k = pmd_offset(pud_k, address); if (!pmd_present(*pmd_k)) goto no_context; set_pmd(pmd, *pmd_k); diff --git a/arch/i386/mm/highmem.c b/arch/i386/mm/highmem.c index 581753285..221698610 100644 --- a/arch/i386/mm/highmem.c +++ b/arch/i386/mm/highmem.c @@ -3,7 +3,7 @@ void *kmap(struct page *page) { might_sleep(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return page_address(page); return kmap_high(page); } @@ -12,7 +12,7 @@ void kunmap(struct page *page) { if (in_interrupt()) BUG(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return; kunmap_high(page); } @@ -32,7 +32,7 @@ void *kmap_atomic(struct page *page, enum km_type type) /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ inc_preempt_count(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c index a0eab6715..ade8efb86 100644 --- a/arch/i386/mm/hugetlbpage.c +++ b/arch/i386/mm/hugetlbpage.c @@ -21,20 +21,24 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd = NULL; pgd = pgd_offset(mm, addr); - pmd = pmd_alloc(mm, pgd, addr); + pud = pud_alloc(mm, pgd, addr); + pmd = pmd_alloc(mm, pud, addr); return (pte_t *) pmd; } static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd = NULL; pgd = pgd_offset(mm, addr); - pmd = pmd_offset(pgd, addr); + pud = pud_offset(pgd, addr); + pmd = pmd_offset(pud, addr); return (pte_t *) pmd; } @@ -250,6 +254,7 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) page = pmd_page(*pmd); pmd_clear(pmd); + mm->nr_ptes--; dec_page_state(nr_page_table_pages); page_cache_release(page); } @@ -284,3 +289,143 @@ out: spin_unlock(&mm->page_table_lock); return ret; } + +/* x86_64 also uses this file */ + +#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA +static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file, + unsigned long addr, unsigned long len, + unsigned long pgoff, unsigned long flags) +{ + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + unsigned long start_addr; + + start_addr = mm->free_area_cache; + +full_search: + addr = ALIGN(start_addr, HPAGE_SIZE); + + for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { + /* At this point: (!vma || addr < vma->vm_end). */ + if (TASK_SIZE - len < addr) { + /* + * Start a new search - just in case we missed + * some holes. + */ + if (start_addr != TASK_UNMAPPED_BASE) { + start_addr = TASK_UNMAPPED_BASE; + goto full_search; + } + return -ENOMEM; + } + if (!vma || addr + len <= vma->vm_start) { + mm->free_area_cache = addr + len; + return addr; + } + addr = ALIGN(vma->vm_end, HPAGE_SIZE); + } +} + +static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, + unsigned long addr0, unsigned long len, + unsigned long pgoff, unsigned long flags) +{ + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma, *prev_vma; + unsigned long base = mm->mmap_base, addr = addr0; + int first_time = 1; + + /* don't allow allocations above current base */ + if (mm->free_area_cache > base) + mm->free_area_cache = base; + +try_again: + /* make sure it can fit in the remaining address space */ + if (mm->free_area_cache < len) + goto fail; + + /* either no address requested or cant fit in requested address hole */ + addr = (mm->free_area_cache - len) & HPAGE_MASK; + do { + /* + * Lookup failure means no vma is above this address, + * i.e. return with success: + */ + if (!(vma = find_vma_prev(mm, addr, &prev_vma))) + return addr; + + /* + * new region fits between prev_vma->vm_end and + * vma->vm_start, use it: + */ + if (addr + len <= vma->vm_start && + (!prev_vma || (addr >= prev_vma->vm_end))) + /* remember the address as a hint for next time */ + return (mm->free_area_cache = addr); + else + /* pull free_area_cache down to the first hole */ + if (mm->free_area_cache == vma->vm_end) + mm->free_area_cache = vma->vm_start; + + /* try just below the current vma->vm_start */ + addr = (vma->vm_start - len) & HPAGE_MASK; + } while (len <= vma->vm_start); + +fail: + /* + * if hint left us with no space for the requested + * mapping then try again: + */ + if (first_time) { + mm->free_area_cache = base; + first_time = 0; + goto try_again; + } + /* + * A failed mmap() very likely causes application failure, + * so fall back to the bottom-up function here. This scenario + * can happen with large stack limits and large mmap() + * allocations. + */ + mm->free_area_cache = TASK_UNMAPPED_BASE; + addr = hugetlb_get_unmapped_area_bottomup(file, addr0, + len, pgoff, flags); + + /* + * Restore the topdown base: + */ + mm->free_area_cache = base; + + return addr; +} + +unsigned long +hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + unsigned long len, unsigned long pgoff, unsigned long flags) +{ + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + + if (len & ~HPAGE_MASK) + return -EINVAL; + if (len > TASK_SIZE) + return -ENOMEM; + + if (addr) { + addr = ALIGN(addr, HPAGE_SIZE); + vma = find_vma(mm, addr); + if (TASK_SIZE - len >= addr && + (!vma || addr + len <= vma->vm_start)) + return addr; + } + if (mm->get_unmapped_area == arch_get_unmapped_area) + return hugetlb_get_unmapped_area_bottomup(file, addr, len, + pgoff, flags); + else + return hugetlb_get_unmapped_area_topdown(file, addr, len, + pgoff, flags); +} + +#endif /*HAVE_ARCH_HUGETLB_UNMAPPED_AREA*/ + diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 567ec7c49..fe4e6b7b6 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -54,15 +54,18 @@ static int noinline do_test_wp_bit(void); */ static pmd_t * __init one_md_table_init(pgd_t *pgd) { + pud_t *pud; pmd_t *pmd_table; #ifdef CONFIG_X86_PAE pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE); set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT)); - if (pmd_table != pmd_offset(pgd, 0)) + pud = pud_offset(pgd, 0); + if (pmd_table != pmd_offset(pud, 0)) BUG(); #else - pmd_table = pmd_offset(pgd, 0); + pud = pud_offset(pgd, 0); + pmd_table = pmd_offset(pud, 0); #endif return pmd_table; @@ -100,6 +103,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd) static void __init page_table_range_init (unsigned long start, unsigned long end, pgd_t *pgd_base) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; int pgd_idx, pmd_idx; unsigned long vaddr; @@ -112,8 +116,8 @@ static void __init page_table_range_init (unsigned long start, unsigned long end for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) { if (pgd_none(*pgd)) one_md_table_init(pgd); - - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) { if (pmd_none(*pmd)) one_page_table_init(pmd); @@ -126,7 +130,7 @@ static void __init page_table_range_init (unsigned long start, unsigned long end static inline int is_kernel_text(unsigned long addr) { - if (addr >= (unsigned long)_stext && addr <= (unsigned long)__init_end) + if (addr >= PAGE_OFFSET && addr <= (unsigned long)__init_end) return 1; return 0; } @@ -233,7 +237,7 @@ EXPORT_SYMBOL(kmap_prot); EXPORT_SYMBOL(kmap_pte); #define kmap_get_fixmap_pte(vaddr) \ - pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) + pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), vaddr), (vaddr)), (vaddr)) void __init kmap_init(void) { @@ -249,6 +253,7 @@ void __init kmap_init(void) void __init permanent_kmaps_init(pgd_t *pgd_base) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; unsigned long vaddr; @@ -257,7 +262,8 @@ void __init permanent_kmaps_init(pgd_t *pgd_base) page_table_range_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); pgd = swapper_pg_dir + pgd_index(vaddr); - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); pte = pte_offset_kernel(pmd, vaddr); pkmap_page_table = pte; } @@ -424,7 +430,7 @@ u64 __supported_pte_mask = ~_PAGE_NX; * on Enable * off Disable */ -static int __init noexec_setup(char *str) +void __init noexec_setup(const char *str) { if (!strncmp(str, "on",2) && cpu_has_nx) { __supported_pte_mask |= _PAGE_NX; @@ -433,13 +439,10 @@ static int __init noexec_setup(char *str) disable_nx = 1; __supported_pte_mask &= ~_PAGE_NX; } - return 1; } -__setup("noexec=", noexec_setup); - -#ifdef CONFIG_X86_PAE int nx_enabled = 0; +#ifdef CONFIG_X86_PAE static void __init set_nx(void) { @@ -549,7 +552,6 @@ void __init test_wp_bit(void) static void __init set_max_mapnr_init(void) { #ifdef CONFIG_HIGHMEM - highmem_start_page = pfn_to_page(highstart_pfn); max_mapnr = num_physpages = highend_pfn; #else max_mapnr = num_physpages = max_low_pfn; @@ -704,6 +706,7 @@ void free_initmem(void) for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { ClearPageReserved(virt_to_page(addr)); set_page_count(virt_to_page(addr), 1); + memset((void *)addr, 0xcc, PAGE_SIZE); free_page(addr); totalram_pages++; } diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index aee0bb1f4..907326772 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c @@ -80,9 +80,14 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, BUG(); spin_lock(&init_mm.page_table_lock); do { + pud_t *pud; pmd_t *pmd; - pmd = pmd_alloc(&init_mm, dir, address); + error = -ENOMEM; + pud = pud_alloc(&init_mm, dir, address); + if (!pud) + break; + pmd = pmd_alloc(&init_mm, pud, address); if (!pmd) break; if (remap_area_pmd(pmd, address, end - address, @@ -130,7 +135,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l /* * Don't allow anybody to remap normal RAM that we're using.. */ - if (phys_addr < virt_to_phys(high_memory)) { + if (phys_addr <= virt_to_phys(high_memory - 1)) { char *t_addr, *t_end; struct page *page; @@ -152,7 +157,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l /* * Ok, go for it.. */ - area = get_vm_area(size, VM_IOREMAP); + area = get_vm_area(size, VM_IOREMAP | (flags << 20)); if (!area) return NULL; area->phys_addr = phys_addr; @@ -197,7 +202,7 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) /* Guaranteed to be > phys_addr, as per __ioremap() */ last_addr = phys_addr + size - 1; - if (last_addr < virt_to_phys(high_memory)) { + if (last_addr < virt_to_phys(high_memory) - 1) { struct page *ppage = virt_to_page(__va(phys_addr)); unsigned long npages; @@ -230,11 +235,12 @@ void iounmap(volatile void __iomem *addr) if (!p) { printk("__iounmap: bad address %p\n", addr); return; - } + } - if (p->flags && p->phys_addr < virt_to_phys(high_memory)) { + if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { + /* p->size includes the guard page, but cpa doesn't like that */ change_page_attr(virt_to_page(__va(p->phys_addr)), - p->size >> PAGE_SHIFT, + (p->size - PAGE_SIZE) >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } diff --git a/arch/i386/mm/mmap.c b/arch/i386/mm/mmap.c index a6270ee14..c5e0d0119 100644 --- a/arch/i386/mm/mmap.c +++ b/arch/i386/mm/mmap.c @@ -37,7 +37,7 @@ static inline unsigned long mmap_base(struct mm_struct *mm) { - unsigned long gap = current->rlim[RLIMIT_STACK].rlim_cur; + unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; if (gap < MIN_GAP) gap = MIN_GAP; @@ -59,7 +59,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (sysctl_legacy_va_layout || (current->personality & ADDR_COMPAT_LAYOUT) || - current->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) { + current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) { mm->mmap_base = TASK_UNMAPPED_BASE; mm->get_unmapped_area = arch_get_unmapped_area; mm->unmap_area = arch_unmap_area; diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c index 4cfc30349..862326f5d 100644 --- a/arch/i386/mm/pageattr.c +++ b/arch/i386/mm/pageattr.c @@ -13,17 +13,21 @@ #include #include -static spinlock_t cpa_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cpa_lock); static struct list_head df_list = LIST_HEAD_INIT(df_list); pte_t *lookup_address(unsigned long address) { - pgd_t *pgd = pgd_offset_k(address); + pgd_t *pgd = pgd_offset_k(address); + pud_t *pud; pmd_t *pmd; if (pgd_none(*pgd)) return NULL; - pmd = pmd_offset(pgd, address); + pud = pud_offset(pgd, address); + if (pud_none(*pud)) + return NULL; + pmd = pmd_offset(pud, address); if (pmd_none(*pmd)) return NULL; if (pmd_large(*pmd)) @@ -77,9 +81,11 @@ static void set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) spin_lock_irqsave(&pgd_lock, flags); for (page = pgd_list; page; page = (struct page *)page->index) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pgd = (pgd_t *)page_address(page) + pgd_index(address); - pmd = pmd_offset(pgd, address); + pud = pud_offset(pgd, address); + pmd = pmd_offset(pud, address); set_pte_atomic((pte_t *)pmd, pte); } spin_unlock_irqrestore(&pgd_lock, flags); @@ -92,7 +98,7 @@ static void set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) static inline void revert_page(struct page *kpte_page, unsigned long address) { pte_t *linear = (pte_t *) - pmd_offset(pgd_offset(&init_mm, address), address); + pmd_offset(pud_offset(pgd_offset_k(address), address), address); set_pmd_pte(linear, address, pfn_pte((__pa(address) & LARGE_PAGE_MASK) >> PAGE_SHIFT, PAGE_KERNEL_LARGE)); @@ -105,10 +111,7 @@ __change_page_attr(struct page *page, pgprot_t prot) unsigned long address; struct page *kpte_page; -#ifdef CONFIG_HIGHMEM - if (page >= highmem_start_page) - BUG(); -#endif + BUG_ON(PageHighMem(page)); address = (unsigned long)page_address(page); kpte = lookup_address(address); @@ -117,27 +120,35 @@ __change_page_attr(struct page *page, pgprot_t prot) kpte_page = virt_to_page(kpte); if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { if ((pte_val(*kpte) & _PAGE_PSE) == 0) { - pte_t old = *kpte; - pte_t standard = mk_pte(page, PAGE_KERNEL); set_pte_atomic(kpte, mk_pte(page, prot)); - if (pte_same(old,standard)) - get_page(kpte_page); } else { struct page *split = split_large_page(address, prot); if (!split) return -ENOMEM; - get_page(kpte_page); set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL)); + kpte_page = split; } + get_page(kpte_page); } else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL)); __put_page(kpte_page); - } + } else + BUG(); - if (cpu_has_pse && (page_count(kpte_page) == 1)) { - list_add(&kpte_page->lru, &df_list); - revert_page(kpte_page, address); - } + /* + * If the pte was reserved, it means it was created at boot + * time (not via split_large_page) and in turn we must not + * replace it with a largepage. + */ + if (!PageReserved(kpte_page)) { + /* memleak and potential failed 2M page regeneration */ + BUG_ON(!page_count(kpte_page)); + + if (cpu_has_pse && (page_count(kpte_page) == 1)) { + list_add(&kpte_page->lru, &df_list); + revert_page(kpte_page, address); + } + } return 0; } @@ -208,7 +219,6 @@ void kernel_map_pages(struct page *page, int numpages, int enable) */ __flush_tlb_all(); } -EXPORT_SYMBOL(kernel_map_pages); #endif EXPORT_SYMBOL(change_page_attr); diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c index 137d18db7..0742d54f8 100644 --- a/arch/i386/mm/pgtable.c +++ b/arch/i386/mm/pgtable.c @@ -62,6 +62,7 @@ void show_mem(void) static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; @@ -70,7 +71,12 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) BUG(); return; } - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + if (pud_none(*pud)) { + BUG(); + return; + } + pmd = pmd_offset(pud, vaddr); if (pmd_none(*pmd)) { BUG(); return; @@ -95,6 +101,7 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; if (vaddr & (PMD_SIZE-1)) { /* vaddr is misaligned */ @@ -110,7 +117,8 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) printk ("set_pmd_pfn: pgd_none\n"); return; /* BUG(); */ } - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); set_pmd(pmd, pfn_pmd(pfn, flags)); /* * It's enough to flush this one mapping. @@ -132,10 +140,7 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); - if (pte) - clear_page(pte); - return pte; + return (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); } struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) @@ -143,12 +148,10 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) struct page *pte; #ifdef CONFIG_HIGHPTE - pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0); #else - pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); #endif - if (pte) - clear_highpage(pte); return pte; } @@ -165,13 +168,11 @@ void pmd_ctor(void *pmd, kmem_cache_t *cache, unsigned long flags) * against pageattr.c; it is the unique case in which a valid change * of kernel pagetables can't be lazily synchronized by vmalloc faults. * vmalloc faults work because attached pagetables are never freed. - * If the locking proves to be non-performant, a ticketing scheme with - * checks at dup_mmap(), exec(), and other mmlist addition points - * could be used. The locking scheme was chosen on the basis of - * manfred's recommendations and having no core impact whatsoever. + * The locking scheme was chosen on the basis of manfred's + * recommendations and having no core impact whatsoever. * -- wli */ -spinlock_t pgd_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(pgd_lock); struct page *pgd_list; static inline void pgd_list_add(pgd_t *pgd) @@ -235,7 +236,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL); if (!pmd) goto out_oom; - set_pgd(&pgd[i], __pgd(1 + __pa((u64)((u32)pmd)))); + set_pgd(&pgd[i], __pgd(1 + __pa(pmd))); } return pgd; @@ -254,6 +255,6 @@ void pgd_free(pgd_t *pgd) if (PTRS_PER_PMD > 1) for (i = 0; i < USER_PTRS_PER_PGD; ++i) kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1)); - /* in the non-PAE case, clear_page_tables() clears user pgd entries */ + /* in the non-PAE case, clear_page_range() clears user pgd entries */ kmem_cache_free(pgd_cache, pgd); } diff --git a/arch/i386/oprofile/Makefile b/arch/i386/oprofile/Makefile index a6945077e..30f3eb366 100644 --- a/arch/i386/oprofile/Makefile +++ b/arch/i386/oprofile/Makefile @@ -6,7 +6,7 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ oprofilefs.o oprofile_stats.o \ timer_int.o ) -oprofile-y := $(DRIVER_OBJS) init.o +oprofile-y := $(DRIVER_OBJS) init.o backtrace.o oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o \ op_model_ppro.o op_model_p4.o oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o diff --git a/arch/i386/oprofile/init.c b/arch/i386/oprofile/init.c index 1b7747ca7..c90332de5 100644 --- a/arch/i386/oprofile/init.c +++ b/arch/i386/oprofile/init.c @@ -15,21 +15,27 @@ * with the NMI mode driver. */ -extern int nmi_init(struct oprofile_operations ** ops); -extern int nmi_timer_init(struct oprofile_operations **ops); +extern int nmi_init(struct oprofile_operations * ops); +extern int nmi_timer_init(struct oprofile_operations * ops); extern void nmi_exit(void); +extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); -int __init oprofile_arch_init(struct oprofile_operations ** ops) + +int __init oprofile_arch_init(struct oprofile_operations * ops) { - int ret = -ENODEV; + int ret; + + ret = -ENODEV; + #ifdef CONFIG_X86_LOCAL_APIC ret = nmi_init(ops); #endif - #ifdef CONFIG_X86_IO_APIC if (ret < 0) ret = nmi_timer_init(ops); #endif + ops->backtrace = x86_backtrace; + return ret; } diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index d3450dcc5..3492d961d 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c @@ -70,7 +70,7 @@ static int __init init_driverfs(void) } -static void __exit exit_driverfs(void) +static void exit_driverfs(void) { sysdev_unregister(&device_oprofile); sysdev_class_unregister(&oprofile_sysclass); @@ -84,7 +84,7 @@ static void __exit exit_driverfs(void) static int nmi_callback(struct pt_regs * regs, int cpu) { - return model->check_ctrs(cpu, &cpu_msrs[cpu], regs); + return model->check_ctrs(regs, &cpu_msrs[cpu]); } @@ -300,35 +300,26 @@ static int nmi_create_files(struct super_block * sb, struct dentry * root) } -struct oprofile_operations nmi_ops = { - .create_files = nmi_create_files, - .setup = nmi_setup, - .shutdown = nmi_shutdown, - .start = nmi_start, - .stop = nmi_stop -}; - - -static int __init p4_init(void) +static int __init p4_init(char ** cpu_type) { - __u8 cpu_model = current_cpu_data.x86_model; + __u8 cpu_model = boot_cpu_data.x86_model; - if (cpu_model > 3) + if (cpu_model > 4) return 0; #ifndef CONFIG_SMP - nmi_ops.cpu_type = "i386/p4"; + *cpu_type = "i386/p4"; model = &op_p4_spec; return 1; #else switch (smp_num_siblings) { case 1: - nmi_ops.cpu_type = "i386/p4"; + *cpu_type = "i386/p4"; model = &op_p4_spec; return 1; case 2: - nmi_ops.cpu_type = "i386/p4-ht"; + *cpu_type = "i386/p4-ht"; model = &op_p4_ht2_spec; return 1; } @@ -340,21 +331,21 @@ static int __init p4_init(void) } -static int __init ppro_init(void) +static int __init ppro_init(char ** cpu_type) { - __u8 cpu_model = current_cpu_data.x86_model; + __u8 cpu_model = boot_cpu_data.x86_model; if (cpu_model > 0xd) return 0; if (cpu_model == 9) { - nmi_ops.cpu_type = "i386/p6_mobile"; + *cpu_type = "i386/p6_mobile"; } else if (cpu_model > 5) { - nmi_ops.cpu_type = "i386/piii"; + *cpu_type = "i386/piii"; } else if (cpu_model > 2) { - nmi_ops.cpu_type = "i386/pii"; + *cpu_type = "i386/pii"; } else { - nmi_ops.cpu_type = "i386/ppro"; + *cpu_type = "i386/ppro"; } model = &op_ppro_spec; @@ -364,11 +355,12 @@ static int __init ppro_init(void) /* in order to get driverfs right */ static int using_nmi; -int __init nmi_init(struct oprofile_operations ** ops) +int __init nmi_init(struct oprofile_operations *ops) { - __u8 vendor = current_cpu_data.x86_vendor; - __u8 family = current_cpu_data.x86; - + __u8 vendor = boot_cpu_data.x86_vendor; + __u8 family = boot_cpu_data.x86; + char *cpu_type; + if (!cpu_has_apic) return -ENODEV; @@ -381,13 +373,13 @@ int __init nmi_init(struct oprofile_operations ** ops) return -ENODEV; case 6: model = &op_athlon_spec; - nmi_ops.cpu_type = "i386/athlon"; + cpu_type = "i386/athlon"; break; case 0xf: model = &op_athlon_spec; /* Actually it could be i386/hammer too, but give user space an consistent name. */ - nmi_ops.cpu_type = "x86-64/hammer"; + cpu_type = "x86-64/hammer"; break; } break; @@ -396,13 +388,13 @@ int __init nmi_init(struct oprofile_operations ** ops) switch (family) { /* Pentium IV */ case 0xf: - if (!p4_init()) + if (!p4_init(&cpu_type)) return -ENODEV; break; /* A P6-class processor */ case 6: - if (!ppro_init()) + if (!ppro_init(&cpu_type)) return -ENODEV; break; @@ -417,13 +409,18 @@ int __init nmi_init(struct oprofile_operations ** ops) init_driverfs(); using_nmi = 1; - *ops = &nmi_ops; + ops->create_files = nmi_create_files; + ops->setup = nmi_setup; + ops->shutdown = nmi_shutdown; + ops->start = nmi_start; + ops->stop = nmi_stop; + ops->cpu_type = cpu_type; printk(KERN_INFO "oprofile: using NMI interrupt.\n"); return 0; } -void __exit nmi_exit(void) +void nmi_exit(void) { if (using_nmi) exit_driverfs(); diff --git a/arch/i386/oprofile/nmi_timer_int.c b/arch/i386/oprofile/nmi_timer_int.c index c3351b824..b2e462abf 100644 --- a/arch/i386/oprofile/nmi_timer_int.c +++ b/arch/i386/oprofile/nmi_timer_int.c @@ -20,9 +20,7 @@ static int nmi_timer_callback(struct pt_regs * regs, int cpu) { - unsigned long eip = instruction_pointer(regs); - - oprofile_add_sample(eip, !user_mode(regs), 0, cpu); + oprofile_add_sample(regs, 0); return 1; } @@ -42,20 +40,16 @@ static void timer_stop(void) } -static struct oprofile_operations nmi_timer_ops = { - .start = timer_start, - .stop = timer_stop, - .cpu_type = "timer" -}; - -int __init nmi_timer_init(struct oprofile_operations ** ops) +int __init nmi_timer_init(struct oprofile_operations * ops) { extern int nmi_active; if (nmi_active <= 0) return -ENODEV; - *ops = &nmi_timer_ops; + ops->start = timer_start; + ops->stop = timer_stop; + ops->cpu_type = "timer"; printk(KERN_INFO "oprofile: using NMI timer interrupt.\n"); return 0; } diff --git a/arch/i386/oprofile/op_model_athlon.c b/arch/i386/oprofile/op_model_athlon.c index 0d4e00f42..3ad9a72a5 100644 --- a/arch/i386/oprofile/op_model_athlon.c +++ b/arch/i386/oprofile/op_model_athlon.c @@ -90,19 +90,16 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs) } -static int athlon_check_ctrs(unsigned int const cpu, - struct op_msrs const * const msrs, - struct pt_regs * const regs) +static int athlon_check_ctrs(struct pt_regs * const regs, + struct op_msrs const * const msrs) { unsigned int low, high; int i; - unsigned long eip = profile_pc(regs); - int is_kernel = !user_mode(regs); for (i = 0 ; i < NUM_COUNTERS; ++i) { CTR_READ(low, high, msrs, i); if (CTR_OVERFLOWED(low)) { - oprofile_add_sample(eip, is_kernel, i, cpu); + oprofile_add_sample(regs, i); CTR_WRITE(reset_value[i], msrs, i); } } diff --git a/arch/i386/oprofile/op_model_p4.c b/arch/i386/oprofile/op_model_p4.c index 1b3626df5..ac8a06603 100644 --- a/arch/i386/oprofile/op_model_p4.c +++ b/arch/i386/oprofile/op_model_p4.c @@ -619,14 +619,11 @@ static void p4_setup_ctrs(struct op_msrs const * const msrs) } -static int p4_check_ctrs(unsigned int const cpu, - struct op_msrs const * const msrs, - struct pt_regs * const regs) +static int p4_check_ctrs(struct pt_regs * const regs, + struct op_msrs const * const msrs) { unsigned long ctr, low, high, stag, real; int i; - unsigned long eip = profile_pc(regs); - int is_kernel = !user_mode(regs); stag = get_stagger(); @@ -657,7 +654,7 @@ static int p4_check_ctrs(unsigned int const cpu, CCCR_READ(low, high, real); CTR_READ(ctr, high, real); if (CCCR_OVF_P(low) || CTR_OVERFLOW_P(ctr)) { - oprofile_add_sample(eip, is_kernel, i, cpu); + oprofile_add_sample(regs, i); CTR_WRITE(reset_value[i], real); CCCR_CLEAR_OVF(low); CCCR_WRITE(low, high, real); diff --git a/arch/i386/oprofile/op_model_ppro.c b/arch/i386/oprofile/op_model_ppro.c index 0cc80654d..d719015fc 100644 --- a/arch/i386/oprofile/op_model_ppro.c +++ b/arch/i386/oprofile/op_model_ppro.c @@ -85,19 +85,16 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) } -static int ppro_check_ctrs(unsigned int const cpu, - struct op_msrs const * const msrs, - struct pt_regs * const regs) +static int ppro_check_ctrs(struct pt_regs * const regs, + struct op_msrs const * const msrs) { unsigned int low, high; int i; - unsigned long eip = profile_pc(regs); - int is_kernel = !user_mode(regs); for (i = 0 ; i < NUM_COUNTERS; ++i) { CTR_READ(low, high, msrs, i); if (CTR_OVERFLOWED(low)) { - oprofile_add_sample(eip, is_kernel, i, cpu); + oprofile_add_sample(regs, i); CTR_WRITE(reset_value[i], msrs, i); } } diff --git a/arch/i386/oprofile/op_x86_model.h b/arch/i386/oprofile/op_x86_model.h index 5cc251467..123b7e90a 100644 --- a/arch/i386/oprofile/op_x86_model.h +++ b/arch/i386/oprofile/op_x86_model.h @@ -36,9 +36,8 @@ struct op_x86_model_spec { unsigned int const num_controls; void (*fill_in_addresses)(struct op_msrs * const msrs); void (*setup_ctrs)(struct op_msrs const * const msrs); - int (*check_ctrs)(unsigned int const cpu, - struct op_msrs const * const msrs, - struct pt_regs * const regs); + int (*check_ctrs)(struct pt_regs * const regs, + struct op_msrs const * const msrs); void (*start)(struct op_msrs const * const msrs); void (*stop)(struct op_msrs const * const msrs); }; diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c index 86ce01655..0c0a16972 100644 --- a/arch/i386/pci/acpi.c +++ b/arch/i386/pci/acpi.c @@ -15,6 +15,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do return pcibios_scan_root(busnum); } +extern int pci_routeirq; static int __init pci_acpi_init(void) { struct pci_dev *dev = NULL; @@ -30,14 +31,27 @@ static int __init pci_acpi_init(void) pcibios_scanned++; pcibios_enable_irq = acpi_pci_irq_enable; - /* - * PCI IRQ routing is set up by pci_enable_device(), but we - * also do it here in case there are still broken drivers that - * don't use pci_enable_device(). - */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) - acpi_pci_irq_enable(dev); - + if (pci_routeirq) { + /* + * PCI IRQ routing is set up by pci_enable_device(), but we + * also do it here in case there are still broken drivers that + * don't use pci_enable_device(). + */ + printk(KERN_INFO "** Routing PCI interrupts for all devices because \"pci=routeirq\"\n"); + printk(KERN_INFO "** was specified. If this was required to make a driver work,\n"); + printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n"); + printk(KERN_INFO "** so I can fix the driver.\n"); + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) + acpi_pci_irq_enable(dev); + } else { + printk(KERN_INFO "** PCI interrupts are no longer routed automatically. If this\n"); + printk(KERN_INFO "** causes a device to stop working, it is probably because the\n"); + printk(KERN_INFO "** driver failed to call pci_enable_device(). As a temporary\n"); + printk(KERN_INFO "** workaround, the \"pci=routeirq\" argument restores the old\n"); + printk(KERN_INFO "** behavior. If this argument makes the device work again,\n"); + printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n"); + printk(KERN_INFO "** so I can fix the driver.\n"); + } #ifdef CONFIG_X86_IO_APIC if (acpi_ioapic) print_IO_APIC(); diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 88c832a0e..720975e1a 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c @@ -23,6 +23,7 @@ extern void pcibios_sort(void); unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | PCI_PROBE_MMCONF; +int pci_routeirq; int pcibios_last_bus = -1; struct pci_bus *pci_root_bus = NULL; struct pci_raw_ops *raw_pci_ops; @@ -52,7 +53,7 @@ int pcibios_scanned; * This interrupt-safe spinlock protects all accesses to PCI * configuration space. */ -spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(pci_config_lock); /* * Several buggy motherboards address only 16 devices and mirror @@ -227,6 +228,9 @@ char * __devinit pcibios_setup(char *str) } else if (!strcmp(str, "assign-busses")) { pci_probe |= PCI_ASSIGN_ALL_BUSSES; return NULL; + } else if (!strcmp(str, "routeirq")) { + pci_routeirq = 1; + return NULL; } return str; } diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index bfcecdc55..af18331b3 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c @@ -227,10 +227,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_fixup_transparent_ */ static void __init pci_fixup_nforce2(struct pci_dev *dev) { - u32 val, fixed_val; - u8 rev; - - pci_read_config_byte(dev, PCI_REVISION_ID, &rev); + u32 val; /* * Chip Old value New value @@ -240,18 +237,144 @@ static void __init pci_fixup_nforce2(struct pci_dev *dev) * Northbridge chip version may be determined by * reading the PCI revision ID (0xC1 or greater is C18D). */ - fixed_val = rev < 0xC1 ? 0x1F01FF01 : 0x9F01FF01; - pci_read_config_dword(dev, 0x6c, &val); /* - * Apply fixup only if C1 Halt Disconnect is enabled - * (bit28) because it is not supported on some boards. + * Apply fixup if needed, but don't touch disconnect state */ - if ((val & (1 << 28)) && val != fixed_val) { + if ((val & 0x00FF0000) != 0x00010000) { printk(KERN_WARNING "PCI: nForce2 C1 Halt Disconnect fixup\n"); - pci_write_config_dword(dev, 0x6c, fixed_val); + pci_write_config_dword(dev, 0x6c, (val & 0xFF00FFFF) | 0x00010000); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2, pci_fixup_nforce2); +/* Max PCI Express root ports */ +#define MAX_PCIEROOT 6 +static int quirk_aspm_offset[MAX_PCIEROOT << 3]; + +#define GET_INDEX(a, b) (((a - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + b) + +static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +{ + return raw_pci_ops->read(0, bus->number, devfn, where, size, value); +} + +/* + * Replace the original pci bus ops for write with a new one that will filter + * the request to insure ASPM cannot be enabled. + */ +static int quirk_pcie_aspm_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) +{ + u8 offset; + + offset = quirk_aspm_offset[GET_INDEX(bus->self->device, devfn)]; + + if ((offset) && (where == offset)) + value = value & 0xfffffffc; + + return raw_pci_ops->write(0, bus->number, devfn, where, size, value); +} + +static struct pci_ops quirk_pcie_aspm_ops = { + .read = quirk_pcie_aspm_read, + .write = quirk_pcie_aspm_write, +}; + +/* + * Prevents PCI Express ASPM (Active State Power Management) being enabled. + * + * Save the register offset, where the ASPM control bits are located, + * for each PCI Express device that is in the device list of + * the root port in an array for fast indexing. Replace the bus ops + * with the modified one. + */ +static void pcie_rootport_aspm_quirk(struct pci_dev *pdev) +{ + int cap_base, i; + struct pci_bus *pbus; + struct pci_dev *dev; + + if ((pbus = pdev->subordinate) == NULL) + return; + + /* + * Check if the DID of pdev matches one of the six root ports. This + * check is needed in the case this function is called directly by the + * hot-plug driver. + */ + if ((pdev->device < PCI_DEVICE_ID_INTEL_MCH_PA) || + (pdev->device > PCI_DEVICE_ID_INTEL_MCH_PC1)) + return; + + if (list_empty(&pbus->devices)) { + /* + * If no device is attached to the root port at power-up or + * after hot-remove, the pbus->devices is empty and this code + * will set the offsets to zero and the bus ops to parent's bus + * ops, which is unmodified. + */ + for (i= GET_INDEX(pdev->device, 0); i <= GET_INDEX(pdev->device, 7); ++i) + quirk_aspm_offset[i] = 0; + + pbus->ops = pbus->parent->ops; + } else { + /* + * If devices are attached to the root port at power-up or + * after hot-add, the code loops through the device list of + * each root port to save the register offsets and replace the + * bus ops. + */ + list_for_each_entry(dev, &pbus->devices, bus_list) { + /* There are 0 to 8 devices attached to this bus */ + cap_base = pci_find_capability(dev, PCI_CAP_ID_EXP); + quirk_aspm_offset[GET_INDEX(pdev->device, dev->devfn)]= cap_base + 0x10; + } + pbus->ops = &quirk_pcie_aspm_ops; + } +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA, pcie_rootport_aspm_quirk ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA1, pcie_rootport_aspm_quirk ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PB, pcie_rootport_aspm_quirk ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PB1, pcie_rootport_aspm_quirk ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC, pcie_rootport_aspm_quirk ); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk ); + +/* + * Fixup to mark boot BIOS video selected by BIOS before it changes + * + * From information provided by "Jon Smirl" + * + * The standard boot ROM sequence for an x86 machine uses the BIOS + * to select an initial video card for boot display. This boot video + * card will have it's BIOS copied to C0000 in system RAM. + * IORESOURCE_ROM_SHADOW is used to associate the boot video + * card with this copy. On laptops this copy has to be used since + * the main ROM may be compressed or combined with another image. + * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW + * is marked here since the boot video device will be the only enabled + * video device at this point. + * + */static void __devinit pci_fixup_video(struct pci_dev *pdev) +{ + struct pci_dev *bridge; + struct pci_bus *bus; + u16 l; + + if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) + return; + + /* Is VGA routed to us? */ + bus = pdev->bus; + while (bus) { + bridge = bus->self; + if (bridge) { + pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &l); + if (!(l & PCI_BRIDGE_CTL_VGA)) + return; + } + bus = bus->parent; + } + pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; +} +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index ec859ad0e..7a7b35a37 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c @@ -96,15 +96,13 @@ pcibios_align_resource(void *data, struct resource *res, static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) { - struct list_head *ln; struct pci_bus *bus; struct pci_dev *dev; int idx; struct resource *r, *pr; /* Depth-First Search on bus tree */ - for (ln=bus_list->next; ln != bus_list; ln=ln->next) { - bus = pci_bus_b(ln); + list_for_each_entry(bus, bus_list, node) { if ((dev = bus->self)) { for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { r = &dev->resource[idx]; @@ -126,7 +124,7 @@ static void __init pcibios_allocate_resources(int pass) u16 command; struct resource *r, *pr; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { pci_read_config_word(dev, PCI_COMMAND, &command); for(idx = 0; idx < 6; idx++) { r = &dev->resource[idx]; @@ -170,7 +168,7 @@ static int __init pcibios_assign_resources(void) int idx; struct resource *r; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { int class = dev->class >> 8; /* Don't touch classless devices and host bridges */ @@ -297,7 +295,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, /* Write-combine setting is ignored, it is changed via the mtrr * interfaces on this platform. */ - if (remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT, + if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index 6aa9e5fcf..9882a43ce 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "pci.h" @@ -28,6 +29,8 @@ static int acer_tm360_irqrouting; static struct irq_routing_table *pirq_table; +static int pirq_enable_irq(struct pci_dev *dev); + /* * Never use: 0, 1, 2 (timer, keyboard, and cascade) * Avoid using: 13, 14 and 15 (FP error and IDE). @@ -127,8 +130,15 @@ void eisa_set_level_irq(unsigned int irq) { unsigned char mask = 1 << (irq & 7); unsigned int port = 0x4d0 + (irq >> 3); - unsigned char val = inb(port); + unsigned char val; + static u16 eisa_irq_mask; + + if (irq >= 16 || (1 << irq) & eisa_irq_mask) + return; + eisa_irq_mask |= (1 << irq); + printk("PCI: setting IRQ %u as level-triggered\n", irq); + val = inb(port); if (!(val & mask)) { DBG(" -> edge"); outb(val | mask, port); @@ -452,14 +462,16 @@ static int pirq_bios_set(struct pci_dev *router, struct pci_dev *dev, int pirq, #endif - static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) { + static struct pci_device_id pirq_440gx[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_2) }, + { }, + }; + /* 440GX has a proprietary PIRQ router -- don't use it */ - if ( pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82443GX_0, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82443GX_2, NULL)) + if (pci_dev_present(pirq_440gx)) return 0; switch(device) @@ -481,6 +493,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route case PCI_DEVICE_ID_INTEL_ESB_1: case PCI_DEVICE_ID_INTEL_ICH6_0: case PCI_DEVICE_ID_INTEL_ICH6_1: + case PCI_DEVICE_ID_INTEL_ICH7_0: + case PCI_DEVICE_ID_INTEL_ICH7_1: r->name = "PIIX/ICH"; r->get = pirq_piix_get; r->set = pirq_piix_set; @@ -723,7 +737,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) if (!pirq_table) return 0; - DBG("IRQ for %s:%d", pci_name(dev), pin); + DBG("IRQ for %s[%c]", pci_name(dev), 'A' + pin); info = pirq_get_info(dev); if (!info) { DBG(" -> not found in routing table\n"); @@ -804,7 +818,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) printk(KERN_INFO "PCI: %s IRQ %d for device %s\n", msg, irq, pci_name(dev)); /* Update IRQ for all devices with the same pirq value */ - while ((dev2 = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { + while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin); if (!pin) continue; @@ -838,7 +852,7 @@ static void __init pcibios_fixup_irqs(void) u8 pin; DBG("PCI: IRQ fixup\n"); - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { /* * If the BIOS has set an out of range IRQ number, just ignore it. * Also keep track of which IRQ's are already in use. @@ -854,7 +868,7 @@ static void __init pcibios_fixup_irqs(void) } dev = NULL; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); #ifdef CONFIG_X86_IO_APIC /* @@ -880,16 +894,16 @@ static void __init pcibios_fixup_irqs(void) irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, PCI_SLOT(bridge->devfn), pin); if (irq >= 0) - printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n", - bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq); + printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", + pci_name(bridge), 'A' + pin, irq); } if (irq >= 0) { if (use_pci_vector() && !platform_legacy_irq(irq)) irq = IO_APIC_VECTOR(irq); - printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n", - dev->bus->number, PCI_SLOT(dev->devfn), pin, irq); + printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", + pci_name(dev), 'A' + pin, irq); dev->irq = irq; } } @@ -989,19 +1003,30 @@ static int __init pcibios_irq_init(void) subsys_initcall(pcibios_irq_init); -void pcibios_penalize_isa_irq(int irq) +static void pirq_penalize_isa_irq(int irq) { /* * If any ISAPnP device reports an IRQ in its list of possible * IRQ's, we try to avoid assigning it to PCI devices. */ - pirq_penalty[irq] += 100; + if (irq < 16) + pirq_penalty[irq] += 100; +} + +void pcibios_penalize_isa_irq(int irq) +{ +#ifdef CONFIG_ACPI_PCI + if (!acpi_noirq) + acpi_penalize_isa_irq(irq); + else +#endif + pirq_penalize_isa_irq(irq); } -int pirq_enable_irq(struct pci_dev *dev) +static int pirq_enable_irq(struct pci_dev *dev) { u8 pin; - extern int interrupt_line_quirk; + extern int via_interrupt_line_quirk; struct pci_dev *temp_dev; pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); @@ -1028,8 +1053,8 @@ int pirq_enable_irq(struct pci_dev *dev) irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, PCI_SLOT(bridge->devfn), pin); if (irq >= 0) - printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n", - bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq); + printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", + pci_name(bridge), 'A' + pin, irq); dev = bridge; } dev = temp_dev; @@ -1038,8 +1063,8 @@ int pirq_enable_irq(struct pci_dev *dev) if (!platform_legacy_irq(irq)) irq = IO_APIC_VECTOR(irq); #endif - printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n", - dev->bus->number, PCI_SLOT(dev->devfn), pin, irq); + printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", + pci_name(dev), 'A' + pin, irq); dev->irq = irq; return 0; } else @@ -1059,7 +1084,7 @@ int pirq_enable_irq(struct pci_dev *dev) } /* VIA bridges use interrupt line for apic/pci steering across the V-Link */ - else if (interrupt_line_quirk) + else if (via_interrupt_line_quirk) pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15); return 0; } diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index f42c45305..504fb18fe 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c @@ -30,7 +30,7 @@ static inline void pci_exp_set_dev_base(int bus, int devfn) u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12); if (dev_base != mmcfg_last_accessed_device) { mmcfg_last_accessed_device = dev_base; - set_fixmap(FIX_PCIE_MCFG, dev_base); + set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); } } @@ -85,9 +85,6 @@ static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 va break; } - /* Dummy read to flush PCI write */ - readl(mmcfg_virt_addr); - spin_unlock_irqrestore(&pci_config_lock, flags); return 0; @@ -105,6 +102,13 @@ static int __init pci_mmcfg_init(void) if (!pci_mmcfg_base_addr) goto out; + /* Kludge for now. Don't use mmconfig on AMD systems because + those have some busses where mmconfig doesn't work, + and we don't parse ACPI MCFG well enough to handle that. + Remove when proper handling is added. */ + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + goto out; + printk(KERN_INFO "PCI: Using MMCONFIG\n"); raw_pci_ops = &pci_mmcfg; pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; diff --git a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c index c8046737b..ddf9ac72d 100644 --- a/arch/i386/pci/numa.c +++ b/arch/i386/pci/numa.c @@ -4,6 +4,7 @@ #include #include +#include #include "pci.h" #define BUS2QUAD(global) (mp_bus_id_to_node[global]) @@ -112,14 +113,15 @@ static int __init pci_numa_init(void) return 0; pci_root_bus = pcibios_scan_root(0); - if (numnodes > 1) { - for (quad = 1; quad < numnodes; ++quad) { + if (num_online_nodes() > 1) + for_each_online_node(quad) { + if (quad == 0) + continue; printk("Scanning PCI bus %d for quad %d\n", QUADLOCAL2BUS(quad,0), quad); pci_scan_bus(QUADLOCAL2BUS(quad,0), &pci_root_ops, NULL); } - } return 0; } diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c index 50fc1f31e..d0f3c2d0d 100644 --- a/arch/i386/pci/pcbios.c +++ b/arch/i386/pci/pcbios.c @@ -385,8 +385,8 @@ void __devinit pcibios_sort(void) } } if (!found) { - printk(KERN_WARNING "PCI: Device %02x:%02x not found by BIOS\n", - dev->bus->number, dev->devfn); + printk(KERN_WARNING "PCI: Device %s not found by BIOS\n", + pci_name(dev)); list_del(&dev->global_list); list_add_tail(&dev->global_list, &sorted_devices); } diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index 13684e1cc..a8fc80ca6 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h @@ -71,6 +71,4 @@ extern unsigned int pcibios_irq_mask; extern int pcibios_scanned; extern spinlock_t pci_config_lock; -int pirq_enable_irq(struct pci_dev *dev); - extern int (*pcibios_enable_irq)(struct pci_dev *dev); diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c index 53542e3a9..adb50ba2a 100644 --- a/arch/i386/power/cpu.c +++ b/arch/i386/power/cpu.c @@ -148,6 +148,6 @@ void restore_processor_state(void) __restore_processor_state(&saved_context); } - +/* Needed by apm.c */ EXPORT_SYMBOL(save_processor_state); EXPORT_SYMBOL(restore_processor_state); diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index a9abc29bb..563a3cbe6 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -30,6 +30,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config TIME_INTERPOLATION bool default y @@ -57,11 +61,12 @@ config IA64_GENERIC will run on any supported IA-64 system. However, if you configure a kernel for your specific system, it will be faster and smaller. - generic For any supported IA-64 system - DIG-compliant For DIG ("Developer's Interface Guide") compliant systems - HP-zx1/sx1000 For HP systems - SGI-SN2 For SGI Altix systems - Ski-simulator For the HP simulator + generic For any supported IA-64 system + DIG-compliant For DIG ("Developer's Interface Guide") compliant systems + HP-zx1/sx1000 For HP systems + HP-zx1/sx1000+swiotlb For HP systems with (broken) DMA-constrained devices. + SGI-SN2 For SGI Altix systems + Ski-simulator For the HP simulator If you don't know what to do, choose "generic". @@ -74,6 +79,15 @@ config IA64_HP_ZX1 Build a kernel that runs on HP zx1 and sx1000 systems. This adds support for the HP I/O MMU. +config IA64_HP_ZX1_SWIOTLB + bool "HP-zx1/sx1000 with software I/O TLB" + help + Build a kernel that runs on HP zx1 and sx1000 systems even when they + have broken PCI devices which cannot DMA to full 32 bits. Apart + from support for the HP I/O MMU, this includes support for the software + I/O TLB, which allows supporting the broken devices at the expense of + wasting some kernel memory (about 2MB by default). + config IA64_SGI_SN2 bool "SGI-SN2" help @@ -144,14 +158,6 @@ config IA64_BRL_EMU depends on ITANIUM default y -config ITANIUM_BSTEP_SPECIFIC - bool "Itanium B-step specific code" - depends on ITANIUM - help - Select this option to build a kernel for an Itanium prototype system - with a B-step CPU. You have a B-step CPU if the "revision" field in - /proc/cpuinfo has a value in the range from 1 to 4. - # align cache-sensitive data to 128 bytes config IA64_L1_CACHE_SHIFT int @@ -178,9 +184,13 @@ config VIRTUAL_MEM_MAP require the DISCONTIGMEM option for your machine. If you are unsure, say Y. +config HOLES_IN_ZONE + bool + default y if VIRTUAL_MEM_MAP + config DISCONTIGMEM bool "Discontiguous memory support" - depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1) && NUMA && VIRTUAL_MEM_MAP + depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB) && NUMA && VIRTUAL_MEM_MAP default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA help Say Y to support efficient handling of discontiguous physical memory, @@ -241,13 +251,14 @@ config NR_CPUS performance hit. config HOTPLUG_CPU - bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" - depends on SMP && HOTPLUG && EXPERIMENTAL + bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" + depends on SMP && EXPERIMENTAL + select HOTPLUG default n - ---help--- - Say Y here to experiment with turning CPUs off and on. CPUs - can be controlled through /sys/devices/system/cpu/cpu#. - Say N if you want to disable CPU hotplug. + ---help--- + Say Y here to experiment with turning CPUs off and on. CPUs + can be controlled through /sys/devices/system/cpu/cpu#. + Say N if you want to disable CPU hotplug. config PREEMPT bool "Preemptible Kernel" @@ -302,6 +313,11 @@ config IA64_PALINFO To use this option, you have to ensure that the "/proc file system support" (CONFIG_PROC_FS) is enabled, too. +config ACPI_DEALLOCATE_IRQ + bool + depends on IOSAPIC && EXPERIMENTAL + default y + source "drivers/firmware/Kconfig" source "fs/Kconfig.binfmt" @@ -312,7 +328,7 @@ menu "Power management and ACPI" config PM bool "Power Management support" - depends on IA64_GENERIC || IA64_DIG || IA64_HP_ZX1 + depends on IA64_GENERIC || IA64_DIG || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB default y help "Power Management" means that parts of your computer are shut @@ -381,6 +397,17 @@ source "fs/Kconfig" source "lib/Kconfig" +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + +config GENERIC_IRQ_PROBE + bool + default y + source "arch/ia64/hp/sim/Kconfig" source "arch/ia64/oprofile/Kconfig" diff --git a/arch/ia64/Kconfig.debug b/arch/ia64/Kconfig.debug index 19edc8b2c..de9d507ba 100644 --- a/arch/ia64/Kconfig.debug +++ b/arch/ia64/Kconfig.debug @@ -16,7 +16,7 @@ config IA64_GRANULE_16MB config IA64_GRANULE_64MB bool "64MB" - depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_SGI_SN2) + depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_SGI_SN2) endchoice diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index a32ebd61a..f9bd88ada 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -42,13 +42,10 @@ $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad cod endif ifeq ($(GCC_VERSION),0304) -# Workaround Itanium 1 bugs in gcc 3.4. -# cflags-$(CONFIG_ITANIUM) += -mtune=merced + cflags-$(CONFIG_ITANIUM) += -mtune=merced cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley endif -cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step - CFLAGS += $(cflags-y) head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o @@ -58,11 +55,13 @@ core-$(CONFIG_IA32_SUPPORT) += arch/ia64/ia32/ core-$(CONFIG_IA64_DIG) += arch/ia64/dig/ core-$(CONFIG_IA64_GENERIC) += arch/ia64/dig/ core-$(CONFIG_IA64_HP_ZX1) += arch/ia64/dig/ +core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/ core-$(CONFIG_IA64_SGI_SN2) += arch/ia64/sn/ drivers-$(CONFIG_PCI) += arch/ia64/pci/ drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/ drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ +drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ drivers-$(CONFIG_IA64_GENERIC) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/ drivers-$(CONFIG_OPROFILE) += arch/ia64/oprofile/ @@ -83,7 +82,9 @@ unwcheck: vmlinux archclean: $(Q)$(MAKE) $(clean)=$(boot) -CLEAN_FILES += include/asm-ia64/.offsets.h.stamp include/asm-ia64/offsets.h vmlinux.gz bootloader +CLEAN_FILES += include/asm-ia64/.offsets.h.stamp vmlinux.gz bootloader + +MRPROPER_FILES += include/asm-ia64/offsets.h prepare: include/asm-ia64/offsets.h diff --git a/arch/ia64/configs/bigsur_defconfig b/arch/ia64/configs/bigsur_defconfig index f16fd2e14..b95fcf86e 100644 --- a/arch/ia64/configs/bigsur_defconfig +++ b/arch/ia64/configs/bigsur_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2 -# Tue Sep 28 13:26:53 2004 +# Linux kernel version: 2.6.10-rc2 +# Mon Nov 29 13:27:48 2004 # # @@ -9,6 +9,7 @@ # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -22,6 +23,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=16 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -29,12 +31,12 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -45,6 +47,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -70,7 +73,6 @@ CONFIG_ITANIUM=y CONFIG_IA64_PAGE_SIZE_16KB=y # CONFIG_IA64_PAGE_SIZE_64KB is not set CONFIG_IA64_BRL_EMU=y -# CONFIG_ITANIUM_BSTEP_SPECIFIC is not set CONFIG_IA64_L1_CACHE_SHIFT=6 # CONFIG_NUMA is not set # CONFIG_VIRTUAL_MEM_MAP is not set @@ -84,6 +86,7 @@ CONFIG_PREEMPT=y CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y +# CONFIG_IA64_MCA_RECOVERY is not set CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y @@ -107,9 +110,11 @@ CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=m CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_POWER=y @@ -131,9 +136,13 @@ CONFIG_PCI_NAMES=y # CONFIG_HOTPLUG_PCI is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set # # Device Drivers @@ -160,6 +169,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -175,6 +185,16 @@ CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -193,7 +213,6 @@ CONFIG_BLK_DEV_IDECD=m CONFIG_BLK_DEV_IDEFLOPPY=m # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -282,12 +301,14 @@ CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -311,6 +332,7 @@ CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m @@ -357,6 +379,8 @@ CONFIG_INET=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -376,7 +400,6 @@ CONFIG_INET=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -437,7 +460,6 @@ CONFIG_EEPRO100=y # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -450,6 +472,7 @@ CONFIG_EEPRO100=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -549,7 +572,7 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_ACPI is not set +CONFIG_SERIAL_8250_ACPI=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_SHARE_IRQ=y @@ -627,6 +650,7 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set @@ -644,14 +668,17 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set @@ -773,7 +800,7 @@ CONFIG_SND_CS4281=m # CONFIG_SND_VX222 is not set # -# ALSA USB devices +# USB devices # # CONFIG_SND_USB_AUDIO is not set # CONFIG_SND_USB_USX2Y is not set @@ -797,6 +824,8 @@ CONFIG_USB_DEVICEFS=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -826,7 +855,7 @@ CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y @@ -864,7 +893,7 @@ CONFIG_USB_HIDDEV=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -893,9 +922,14 @@ CONFIG_USB_HIDDEV=y # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # @@ -925,6 +959,7 @@ CONFIG_XFS_POSIX_ACL=y # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -957,6 +992,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -1087,9 +1123,11 @@ CONFIG_OPROFILE=y # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_IA64_GRANULE_16MB is not set CONFIG_IA64_GRANULE_64MB=y @@ -1102,6 +1140,7 @@ CONFIG_SYSVIPC_COMPAT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -1115,7 +1154,7 @@ CONFIG_CRYPTO_MD5=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WHIRLPOOL is not set +# CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set @@ -1126,6 +1165,7 @@ CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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 diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig index 80b53c925..a32758a6a 100644 --- a/arch/ia64/configs/sn2_defconfig +++ b/arch/ia64/configs/sn2_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2 -# Fri Sep 24 08:59:00 2004 +# Linux kernel version: 2.6.10 +# Mon Jan 10 13:57:35 2005 # # @@ -9,6 +9,7 @@ # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -22,6 +23,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=20 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -29,12 +31,12 @@ CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -45,6 +47,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -55,6 +58,7 @@ CONFIG_IA64=y CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y CONFIG_EFI=y CONFIG_GENERIC_IOMAP=y @@ -72,6 +76,7 @@ CONFIG_IA64_PAGE_SIZE_16KB=y CONFIG_IA64_L1_CACHE_SHIFT=7 CONFIG_NUMA=y CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_HOLES_IN_ZONE=y CONFIG_DISCONTIGMEM=y # CONFIG_IA64_CYCLONE is not set CONFIG_IOSAPIC=y @@ -84,8 +89,10 @@ CONFIG_PREEMPT=y CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y +CONFIG_IA64_MCA_RECOVERY=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y +CONFIG_ACPI_DEALLOCATE_IRQ=y # # Firmware Drivers @@ -106,14 +113,17 @@ CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y # CONFIG_ACPI_BUTTON is not set +CONFIG_ACPI_VIDEO=m # CONFIG_ACPI_FAN is not set # CONFIG_ACPI_PROCESSOR is not set CONFIG_ACPI_NUMA=y +CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y +# CONFIG_ACPI_CONTAINER is not set # # Bus options (PCI, PCMCIA) @@ -136,9 +146,13 @@ CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI_SGI=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set # # Device Drivers @@ -165,6 +179,7 @@ CONFIG_FW_LOADER=m # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -179,8 +194,20 @@ CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -199,7 +226,6 @@ CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -269,6 +295,7 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -283,6 +310,7 @@ CONFIG_SCSI_FC_ATTRS=y # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y +# CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set # CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_SATA_NV is not set @@ -290,6 +318,7 @@ CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set CONFIG_SCSI_SATA_VITESSE=y # CONFIG_SCSI_BUSLOGIC is not set @@ -299,19 +328,20 @@ CONFIG_SCSI_SATA_VITESSE=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set CONFIG_SCSI_QLA22XX=y CONFIG_SCSI_QLA2300=y CONFIG_SCSI_QLA2322=y # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -328,6 +358,7 @@ CONFIG_MD_RAID1=y CONFIG_MD_RAID5=y # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=y +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=y CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m @@ -377,6 +408,8 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set CONFIG_IPV6=m # CONFIG_IPV6_PRIVACY is not set # CONFIG_INET6_AH is not set @@ -402,7 +435,6 @@ CONFIG_IPV6=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -457,6 +489,7 @@ CONFIG_TIGON3=y # CONFIG_IXGB is not set CONFIG_S2IO=m # CONFIG_S2IO_NAPI is not set +# CONFIG_2BUFF_MODE is not set # # Token Ring devices @@ -533,6 +566,8 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -632,6 +667,8 @@ CONFIG_USB=m # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -641,6 +678,7 @@ CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=m +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -648,10 +686,14 @@ CONFIG_USB_UHCI_HCD=m # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER 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_STORAGE is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y @@ -677,7 +719,6 @@ CONFIG_USB_HIDINPUT=y # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices @@ -689,7 +730,7 @@ CONFIG_USB_HIDINPUT=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -711,20 +752,38 @@ CONFIG_USB_HIDINPUT=y # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set -# CONFIG_USB_TIGL 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_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_MTHCA=m +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set + # # File systems # @@ -758,6 +817,7 @@ CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set # CONFIG_QFMT_V2 is not set CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -789,6 +849,8 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -833,7 +895,7 @@ CONFIG_SMB_FS=m CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_POSIX is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -921,10 +983,13 @@ CONFIG_ZLIB_DEFLATE=m # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_FS is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set # CONFIG_IA64_PRINT_HAZARDS is not set @@ -936,6 +1001,7 @@ CONFIG_SYSVIPC_COMPAT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -949,7 +1015,7 @@ CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WHIRLPOOL is not set +# CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set @@ -960,7 +1026,12 @@ CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig index ce9412586..99830e8fc 100644 --- a/arch/ia64/configs/tiger_defconfig +++ b/arch/ia64/configs/tiger_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2 -# Tue Sep 28 09:03:25 2004 +# Linux kernel version: 2.6.11-rc2 +# Sat Jan 22 11:17:02 2005 # # @@ -9,6 +9,7 @@ # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -22,6 +23,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=20 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set @@ -30,12 +32,12 @@ CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -46,6 +48,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -56,12 +59,14 @@ CONFIG_IA64=y CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y CONFIG_EFI=y CONFIG_GENERIC_IOMAP=y # CONFIG_IA64_GENERIC is not set CONFIG_IA64_DIG=y # CONFIG_IA64_HP_ZX1 is not set +# CONFIG_IA64_HP_ZX1_SWIOTLB is not set # CONFIG_IA64_SGI_SN2 is not set # CONFIG_IA64_HP_SIM is not set # CONFIG_ITANIUM is not set @@ -73,6 +78,7 @@ CONFIG_IA64_PAGE_SIZE_16KB=y CONFIG_IA64_L1_CACHE_SHIFT=7 # CONFIG_NUMA is not set CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_HOLES_IN_ZONE=y CONFIG_IA64_CYCLONE=y CONFIG_IOSAPIC=y CONFIG_FORCE_MAX_ZONEORDER=18 @@ -83,8 +89,10 @@ CONFIG_HOTPLUG_CPU=y CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y +CONFIG_IA64_MCA_RECOVERY=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y +CONFIG_ACPI_DEALLOCATE_IRQ=y # # Firmware Drivers @@ -106,14 +114,18 @@ CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_BUTTON=m +# CONFIG_ACPI_VIDEO is not set CONFIG_ACPI_FAN=m CONFIG_ACPI_PROCESSOR=m +# CONFIG_ACPI_HOTPLUG_CPU is not set CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y +# CONFIG_ACPI_CONTAINER is not set # # Bus options (PCI, PCMCIA) @@ -132,13 +144,16 @@ CONFIG_HOTPLUG_PCI=m CONFIG_HOTPLUG_PCI_ACPI=m # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set # CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_PCIE is not set # CONFIG_HOTPLUG_PCI_SHPC is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set # # Device Drivers @@ -165,6 +180,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -173,13 +189,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -198,7 +227,6 @@ CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -267,6 +295,7 @@ CONFIG_CHR_DEV_SG=m # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -288,6 +317,7 @@ CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 @@ -299,13 +329,13 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_SCSI_QLOGIC_FC=y # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y CONFIG_SCSI_QLA21XX=m CONFIG_SCSI_QLA22XX=m CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2322=m # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -322,6 +352,7 @@ CONFIG_MD_RAID1=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m @@ -371,6 +402,8 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -390,7 +423,6 @@ CONFIG_SYN_COOKIES=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -451,7 +483,6 @@ CONFIG_NET_PCI=y # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set CONFIG_EEPRO100=m -# CONFIG_EEPRO100_PIO is not set CONFIG_E100=m # CONFIG_E100_NAPI is not set # CONFIG_FEALNX is not set @@ -463,7 +494,6 @@ CONFIG_E100=m # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -477,6 +507,7 @@ CONFIG_E1000=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # @@ -544,12 +575,13 @@ CONFIG_SOUND_GAMEPORT=m # CONFIG_GAMEPORT_EMU10K1 is not set # CONFIG_GAMEPORT_VORTEX is not set # CONFIG_GAMEPORT_FM801 is not set -# CONFIG_GAMEPORT_CS461x is not set +# CONFIG_GAMEPORT_CS461X is not set CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # @@ -578,6 +610,8 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -625,7 +659,7 @@ CONFIG_EFI_RTC=y # CONFIG_AGP=m CONFIG_AGP_I460=m -CONFIG_DRM=y +CONFIG_DRM=m CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m @@ -671,6 +705,7 @@ CONFIG_MAX_RAW_DEVS=256 # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -691,6 +726,8 @@ CONFIG_USB_DEVICEFS=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -700,6 +737,7 @@ CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -707,6 +745,10 @@ CONFIG_USB_UHCI_HCD=y # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER 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_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set @@ -720,7 +762,7 @@ CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -740,7 +782,6 @@ CONFIG_USB_HIDINPUT=y # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices @@ -752,7 +793,7 @@ CONFIG_USB_HIDINPUT=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -774,21 +815,36 @@ CONFIG_USB_HIDINPUT=y # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set -# CONFIG_USB_TIGL 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_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -819,6 +875,7 @@ CONFIG_XFS_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -852,6 +909,8 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -897,7 +956,7 @@ CONFIG_SMB_NLS_REMOTE="cp437" CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_POSIX is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -972,6 +1031,8 @@ CONFIG_NLS_UTF8=m # CONFIG_CRC_CCITT is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Profiling support @@ -983,10 +1044,13 @@ CONFIG_CRC32=y # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set # CONFIG_IA64_PRINT_HAZARDS is not set @@ -998,6 +1062,7 @@ CONFIG_SYSVIPC_COMPAT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -1011,7 +1076,7 @@ CONFIG_CRYPTO_MD5=m # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WHIRLPOOL is not set +# CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set @@ -1022,7 +1087,12 @@ CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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_TEST is not set + +# +# Hardware crypto devices +# diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig index 7ef08d376..21d6f9bab 100644 --- a/arch/ia64/configs/zx1_defconfig +++ b/arch/ia64/configs/zx1_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2-aegl -# Mon Sep 27 19:03:13 2004 +# Linux kernel version: 2.6.10 +# Wed Dec 29 09:05:48 2004 # # @@ -11,6 +11,7 @@ CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -25,6 +26,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -32,12 +34,12 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -47,6 +49,7 @@ CONFIG_MODULES=y # CONFIG_MODULE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set # @@ -83,6 +86,7 @@ CONFIG_NR_CPUS=16 CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y +CONFIG_IA64_MCA_RECOVERY=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y @@ -106,9 +110,11 @@ CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_BUTTON=y +CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y +CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_POWER=y @@ -136,9 +142,13 @@ CONFIG_HOTPLUG_PCI_ACPI=y # CONFIG_HOTPLUG_PCI_SHPC is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set # # Device Drivers @@ -165,6 +175,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -179,8 +190,19 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -199,7 +221,6 @@ CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -303,6 +324,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -362,6 +384,8 @@ CONFIG_IP_MULTICAST=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +# CONFIG_IP_TCPDIAG is not set +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -375,6 +399,7 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set CONFIG_IP_NF_ARPTABLES=y @@ -399,7 +424,6 @@ CONFIG_IP_NF_ARPTABLES=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -469,7 +493,6 @@ CONFIG_E100=y # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -483,6 +506,7 @@ CONFIG_E1000=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # @@ -653,6 +677,7 @@ CONFIG_I2C_ALGOPCF=y # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set @@ -664,20 +689,24 @@ CONFIG_I2C_ALGOPCF=y # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set @@ -708,7 +737,37 @@ CONFIG_I2C_ALGOPCF=y # # Multimedia devices # -# CONFIG_VIDEO_DEV is not set +CONFIG_VIDEO_DEV=y + +# +# Video For Linux +# + +# +# Video Adapters +# +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_SAA5246A is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_TUNER_3036 is not set +# CONFIG_VIDEO_STRADIS is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIDEO_ZR36120 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_DPC is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_OVCAMCHIP is not set + +# +# Radio Adapters +# +# CONFIG_RADIO_GEMTEK_PCI is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_MAESTRO is not set # # Digital Video Broadcasting Devices @@ -720,6 +779,7 @@ CONFIG_I2C_ALGOPCF=y # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set @@ -733,6 +793,7 @@ CONFIG_FB_RADEON_I2C=y CONFIG_FB_RADEON_DEBUG=y # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY 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 @@ -763,7 +824,87 @@ CONFIG_LOGO_LINUX_CLUT224=y # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_HWDEP=y +CONFIG_SND_RAWMIDI=y +CONFIG_SND_SEQUENCER=y +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +CONFIG_SND_SEQUENCER_OSS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_MPU401_UART=y +CONFIG_SND_OPL3_LIB=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 + +# +# PCI devices +# +CONFIG_SND_AC97_CODEC=y +# CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set +# CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BT87X is not set +# CONFIG_SND_CS46XX is not set +# CONFIG_SND_CS4281 is not set +# CONFIG_SND_EMU10K1 is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set +# CONFIG_SND_HDSP is not set +# CONFIG_SND_TRIDENT is not set +# CONFIG_SND_YMFPCI is not set +# CONFIG_SND_ALS4000 is not set +# CONFIG_SND_CMIPCI is not set +# CONFIG_SND_ENS1370 is not set +# CONFIG_SND_ENS1371 is not set +# CONFIG_SND_ES1938 is not set +# CONFIG_SND_ES1968 is not set +# CONFIG_SND_MAESTRO3 is not set +CONFIG_SND_FM801=y +CONFIG_SND_FM801_TEA575X=y +# CONFIG_SND_ICE1712 is not set +# CONFIG_SND_ICE1724 is not set +# CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_VIA82XX is not set +# CONFIG_SND_VX222 is not set + +# +# USB devices +# +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_USX2Y is not set + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set # # USB support @@ -779,6 +920,8 @@ CONFIG_USB_BANDWIDTH=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -788,13 +931,20 @@ CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=y CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # +# CONFIG_USB_AUDIO is not set # CONFIG_USB_BLUETOOTH_TTY is not set +# CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER 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_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set @@ -808,7 +958,7 @@ CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -834,13 +984,17 @@ CONFIG_USB_HIDDEV=y # USB Multimedia devices # # CONFIG_USB_DABUSB is not set +# CONFIG_USB_VICAM is not set +# CONFIG_USB_DSBR is not set +# CONFIG_USB_IBMCAM is not set +# CONFIG_USB_KONICAWC is not set +# CONFIG_USB_OV511 is not set +# CONFIG_USB_SE401 is not set +# CONFIG_USB_SN9C102 is not set +# CONFIG_USB_STV680 is not set # -# Video4Linux support is needed for USB Multimedia device support -# - -# -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -869,13 +1023,23 @@ CONFIG_USB_HIDDEV=y # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -896,6 +1060,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS4_FS is not set @@ -927,6 +1092,8 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -1053,9 +1220,11 @@ CONFIG_CRC32=y # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set @@ -1068,6 +1237,7 @@ CONFIG_SYSVIPC_COMPAT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -1081,7 +1251,7 @@ CONFIG_CRYPTO_MD5=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WHIRLPOOL is not set +# CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set @@ -1092,7 +1262,12 @@ CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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_TEST is not set + +# +# Hardware crypto devices +# diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig index b63441d85..7539e83bf 100644 --- a/arch/ia64/defconfig +++ b/arch/ia64/defconfig @@ -1,50 +1,54 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10 +# Thu Jan 6 11:13:13 2005 # # # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_CLEAN_COMPILE is not set -# CONFIG_STANDALONE is not set -CONFIG_BROKEN=y -CONFIG_BROKEN_ON_SMP=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set +# CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_LOG_BUF_SHIFT=16 +CONFIG_LOG_BUF_SHIFT=20 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y -CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -55,11 +59,13 @@ CONFIG_IA64=y CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y CONFIG_EFI=y -# CONFIG_IA64_GENERIC is not set +CONFIG_GENERIC_IOMAP=y +CONFIG_IA64_GENERIC=y # CONFIG_IA64_DIG is not set -CONFIG_IA64_HP_ZX1=y +# CONFIG_IA64_HP_ZX1 is not set # CONFIG_IA64_SGI_SN2 is not set # CONFIG_IA64_HP_SIM is not set # CONFIG_ITANIUM is not set @@ -69,20 +75,23 @@ CONFIG_MCKINLEY=y CONFIG_IA64_PAGE_SIZE_16KB=y # CONFIG_IA64_PAGE_SIZE_64KB is not set CONFIG_IA64_L1_CACHE_SHIFT=7 -# CONFIG_NUMA is not set +CONFIG_NUMA=y CONFIG_VIRTUAL_MEM_MAP=y -# CONFIG_IA64_CYCLONE is not set +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_CYCLONE=y CONFIG_IOSAPIC=y CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_SMP=y -CONFIG_NR_CPUS=16 -# CONFIG_HOTPLUG_CPU is not set +CONFIG_NR_CPUS=512 +CONFIG_HOTPLUG_CPU=y # CONFIG_PREEMPT is not set CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y +CONFIG_IA64_MCA_RECOVERY=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y +CONFIG_ACPI_DEALLOCATE_IRQ=y # # Firmware Drivers @@ -90,7 +99,7 @@ CONFIG_IA64_PALINFO=y CONFIG_EFI_VARS=y CONFIG_EFI_PCDP=y CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_MISC=y +CONFIG_BINFMT_MISC=m # # Power management and ACPI @@ -103,34 +112,49 @@ CONFIG_ACPI=y # CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y -CONFIG_ACPI_BUTTON=y -CONFIG_ACPI_FAN=y -CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_THERMAL=y +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_VIDEO=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_THERMAL=m +CONFIG_ACPI_NUMA=y +CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y +CONFIG_ACPI_CONTAINER=m # # Bus options (PCI, PCMCIA) # CONFIG_PCI=y CONFIG_PCI_DOMAINS=y -# CONFIG_PCI_USE_VECTOR is not set +# CONFIG_PCI_MSI is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # # PCI Hotplug Support # -# CONFIG_HOTPLUG_PCI is not set +CONFIG_HOTPLUG_PCI=m +# CONFIG_HOTPLUG_PCI_FAKE is not set +CONFIG_HOTPLUG_PCI_ACPI=m +# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_PCIE is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set # -# PCMCIA/CardBus support +# PC-card bridges # -# CONFIG_PCMCIA is not set # # Device Drivers @@ -139,6 +163,7 @@ CONFIG_PCI_NAMES=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set @@ -156,6 +181,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -164,13 +190,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -183,20 +221,19 @@ CONFIG_BLK_DEV_IDE=y # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y -CONFIG_IDEDISK_MULTI_MODE=y +# CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set -CONFIG_BLK_DEV_IDEFLOPPY=m +CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=m -CONFIG_IDE_TASK_IOCTL=y -CONFIG_IDE_TASKFILE_IO=y +# CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # -# CONFIG_IDE_GENERIC is not set +CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y -CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_IDEPCI_SHARE_IRQ is not set # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set @@ -204,7 +241,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -216,12 +252,13 @@ CONFIG_BLK_DEV_CMD64X=y # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set -# CONFIG_BLK_DEV_PIIX is not set +CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set -CONFIG_BLK_DEV_SIIMAGE=y +CONFIG_BLK_DEV_SGIIOC4=y +# CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set @@ -241,24 +278,25 @@ CONFIG_SCSI_PROC_FS=y # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y -CONFIG_CHR_DEV_ST=y -CONFIG_CHR_DEV_OSST=y -CONFIG_BLK_DEV_SR=y -CONFIG_BLK_DEV_SR_VENDOR=y -CONFIG_CHR_DEV_SG=y +CONFIG_CHR_DEV_ST=m +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_LOGGING=y +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set +CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -268,13 +306,12 @@ CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set -CONFIG_SCSI_AIC7XXX_OLD=y +# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_ADVANSYS is not set -CONFIG_SCSI_MEGARAID=y +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set @@ -289,18 +326,17 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_PCI2000 is not set -# CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_QLOGIC_ISP is not set -# CONFIG_SCSI_QLOGIC_FC is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y -# CONFIG_SCSI_QLA21XX is not set -# CONFIG_SCSI_QLA22XX is not set -# CONFIG_SCSI_QLA2300 is not set -# CONFIG_SCSI_QLA2322 is not set +CONFIG_SCSI_QLA21XX=m +CONFIG_SCSI_QLA22XX=m +CONFIG_SCSI_QLA2300=m +CONFIG_SCSI_QLA2322=m # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -313,21 +349,22 @@ CONFIG_BLK_DEV_MD=m CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m +# CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=m -# CONFIG_MD_RAID6 is not set +CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m -# CONFIG_DM_CRYPT is not set -# CONFIG_DM_SNAPSHOT is not set -# CONFIG_DM_MIRROR is not set -# CONFIG_DM_ZERO is not set +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m # # Fusion MPT device support # CONFIG_FUSION=y CONFIG_FUSION_MAX_SGE=40 -# CONFIG_FUSION_ISENSE is not set # CONFIG_FUSION_CTL is not set # @@ -350,7 +387,7 @@ CONFIG_NET=y # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set -# CONFIG_NETLINK_DEV is not set +CONFIG_NETLINK_DEV=y CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y @@ -360,31 +397,16 @@ CONFIG_IP_MULTICAST=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set +CONFIG_ARPD=y +CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set - -# -# IP: Virtual Server Configuration -# -# CONFIG_IP_VS is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set -CONFIG_NETFILTER=y -# CONFIG_NETFILTER_DEBUG is not set - -# -# IP: Netfilter Configuration -# -# CONFIG_IP_NF_CONNTRACK is not set -# CONFIG_IP_NF_QUEUE is not set -# CONFIG_IP_NF_IPTABLES is not set -CONFIG_IP_NF_ARPTABLES=y -# CONFIG_IP_NF_ARPFILTER is not set -# CONFIG_IP_NF_ARP_MANGLE is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_NETFILTER is not set # # SCTP Configuration (EXPERIMENTAL) @@ -402,7 +424,6 @@ CONFIG_IP_NF_ARPTABLES=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -414,16 +435,19 @@ CONFIG_IP_NF_ARPTABLES=y # Network testing # # CONFIG_NET_PKTGEN is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_RX is not set +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y -CONFIG_DUMMY=y -CONFIG_BONDING=y +CONFIG_DUMMY=m +# CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set # # ARCnet devices @@ -434,7 +458,7 @@ CONFIG_BONDING=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -CONFIG_MII=y +CONFIG_MII=m # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -442,7 +466,15 @@ CONFIG_MII=y # # Tulip family network device support # -# CONFIG_NET_TULIP is not set +CONFIG_NET_TULIP=y +# CONFIG_DE2104X is not set +CONFIG_TULIP=m +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_DM9102 is not set # CONFIG_HP100 is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set @@ -451,9 +483,10 @@ CONFIG_NET_PCI=y # CONFIG_B44 is not set # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set -CONFIG_EEPRO100=y +CONFIG_EEPRO100=m # CONFIG_EEPRO100_PIO is not set -# CONFIG_E100 is not set +CONFIG_E100=m +# CONFIG_E100_NAPI is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set @@ -463,7 +496,6 @@ CONFIG_EEPRO100=y # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -477,6 +509,7 @@ CONFIG_E1000=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # @@ -505,7 +538,7 @@ CONFIG_TIGON3=y # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set -# CONFIG_NETCONSOLE is not set +CONFIG_NETCONSOLE=y # # ISDN subsystem @@ -529,27 +562,43 @@ CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -CONFIG_INPUT_JOYDEV=y +# CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set -CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # -# CONFIG_GAMEPORT is not set -CONFIG_SOUND_GAMEPORT=y +CONFIG_GAMEPORT=m +CONFIG_SOUND_GAMEPORT=m +# CONFIG_GAMEPORT_NS558 is not set +# CONFIG_GAMEPORT_L4 is not set +# CONFIG_GAMEPORT_EMU10K1 is not set +# CONFIG_GAMEPORT_VORTEX is not set +# CONFIG_GAMEPORT_FM801 is not set +# CONFIG_GAMEPORT_CS461x is not set CONFIG_SERIO=y -# CONFIG_SERIO_I8042 is not set +CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set # # Input Device Drivers # -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -560,7 +609,15 @@ CONFIG_SERIO=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y -# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_SYNCLINK is not set +# CONFIG_SYNCLINKMP is not set +# CONFIG_N_HDLC is not set +# CONFIG_STALDRV is not set +CONFIG_SGI_SNSC=y # # Serial drivers @@ -568,28 +625,27 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_ACPI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set +CONFIG_SERIAL_8250_NR_UARTS=6 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_MULTIPORT is not set +# CONFIG_SERIAL_8250_RSA is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_SGI_L1_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI # -CONFIG_IPMI_HANDLER=m -CONFIG_IPMI_PANIC_EVENT=y -CONFIG_IPMI_PANIC_STRING=y -CONFIG_IPMI_DEVICE_INTERFACE=m -CONFIG_IPMI_SI=m -CONFIG_IPMI_WATCHDOG=m +# CONFIG_IPMI_HANDLER is not set # # Watchdog Cards @@ -604,90 +660,26 @@ CONFIG_EFI_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set CONFIG_AGP=m +CONFIG_AGP_I460=m CONFIG_AGP_HP_ZX1=m -CONFIG_DRM=y -# CONFIG_DRM_TDFX is not set -# CONFIG_DRM_GAMMA is not set -# CONFIG_DRM_R128 is not set +CONFIG_DRM=m +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m -# CONFIG_DRM_MGA is not set -# CONFIG_DRM_SIS is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_HPET is not set +CONFIG_DRM_MGA=m +CONFIG_DRM_SIS=m +CONFIG_RAW_DRIVER=m +CONFIG_HPET=y +# CONFIG_HPET_RTC_IRQ is not set +CONFIG_HPET_MMAP=y +CONFIG_MAX_RAW_DEVS=256 +CONFIG_MMTIMER=y # # I2C support # -CONFIG_I2C=y -# CONFIG_I2C_CHARDEV is not set - -# -# I2C Algorithms -# -CONFIG_I2C_ALGOBIT=y -# CONFIG_I2C_ALGOPCF is not set - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_I810 is not set -# CONFIG_I2C_ISA is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PROSAVAGE is not set -# CONFIG_I2C_SAVAGE4 is not set -# CONFIG_SCx200_ACB is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_VOODOO3 is not set - -# -# Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_FSCHER is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83627HF is not set - -# -# Other I2C Chip support -# -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_RTC8564 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_I2C is not set # # Dallas's 1-wire bus @@ -711,53 +703,18 @@ CONFIG_I2C_ALGOBIT=y # # Graphics support # -CONFIG_FB=y -# 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_RIVA=m -CONFIG_FB_RIVA_I2C=y -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON_OLD is not set -CONFIG_FB_RADEON=m -CONFIG_FB_RADEON_I2C=y -# CONFIG_FB_RADEON_DEBUG is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY 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_TRIDENT is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y - -# -# Logo configuration -# -CONFIG_LOGO=y -# CONFIG_LOGO_LINUX_MONO is not set -# CONFIG_LOGO_LINUX_VGA16 is not set -CONFIG_LOGO_LINUX_CLUT224=y # # Sound # -CONFIG_SOUND=y +CONFIG_SOUND=m # # Advanced Linux Sound Architecture @@ -768,11 +725,12 @@ CONFIG_SND_PCM=m CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m -# CONFIG_SND_SEQ_DUMMY is not set -# CONFIG_SND_MIXER_OSS is not set -# CONFIG_SND_PCM_OSS is not set -# CONFIG_SND_SEQUENCER_OSS is not set -# CONFIG_SND_VERBOSE_PRINTK is not set +CONFIG_SND_SEQ_DUMMY=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_SEQUENCER_OSS=y +CONFIG_SND_VERBOSE_PRINTK=y # CONFIG_SND_DEBUG is not set # @@ -780,11 +738,11 @@ CONFIG_SND_SEQUENCER=m # CONFIG_SND_MPU401_UART=m CONFIG_SND_OPL3_LIB=m -# 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 +CONFIG_SND_DUMMY=m +CONFIG_SND_VIRMIDI=m +CONFIG_SND_MTPAV=m +CONFIG_SND_SERIAL_U16550=m +CONFIG_SND_MPU401=m # # PCI devices @@ -792,14 +750,16 @@ CONFIG_SND_OPL3_LIB=m CONFIG_SND_AC97_CODEC=m # CONFIG_SND_ALI5451 is not set # CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set # CONFIG_SND_AU8810 is not set # CONFIG_SND_AU8820 is not set # CONFIG_SND_AU8830 is not set # CONFIG_SND_AZT3328 is not set # CONFIG_SND_BT87X is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_EMU10K1 is not set +CONFIG_SND_CS46XX=m +CONFIG_SND_CS46XX_NEW_DSP=y +CONFIG_SND_CS4281=m +CONFIG_SND_EMU10K1=m # CONFIG_SND_KORG1212 is not set # CONFIG_SND_MIXART is not set # CONFIG_SND_NM256 is not set @@ -827,9 +787,10 @@ CONFIG_SND_FM801=m # CONFIG_SND_VX222 is not set # -# ALSA USB devices +# USB devices # # CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_USX2Y is not set # # Open Sound System @@ -839,24 +800,29 @@ CONFIG_SND_FM801=m # # USB support # -CONFIG_USB=y +CONFIG_USB=m # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y -CONFIG_USB_BANDWIDTH=y +# CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # -CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_SPLIT_ISO is not set -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_UHCI_HCD=m +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -866,15 +832,35 @@ CONFIG_USB_UHCI_HCD=y # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set -# CONFIG_USB_STORAGE is not set # -# USB Human Interface Devices (HID) +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_RW_DETECT 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_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set + +# +# USB Input Devices # -CONFIG_USB_HID=y +CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set -CONFIG_USB_HIDDEV=y +# 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_KBTAB is not set @@ -889,7 +875,6 @@ CONFIG_USB_HIDDEV=y # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices @@ -901,7 +886,7 @@ CONFIG_USB_HIDDEV=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -930,55 +915,87 @@ CONFIG_USB_HIDDEV=y # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_MTHCA=m +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set + # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y -# CONFIG_EXT2_FS_POSIX_ACL is not set -# CONFIG_EXT2_FS_SECURITY is not set +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y 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_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y # CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=y +# CONFIG_XFS_RT is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_SECURITY is not set +# CONFIG_XFS_POSIX_ACL is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems # -CONFIG_ISO9660_FS=y +CONFIG_ISO9660_FS=m CONFIG_JOLIET=y # CONFIG_ZISOFS is not set -CONFIG_UDF_FS=y +CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y +# CONFIG_MSDOS_FS is not set CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set # # Pseudo filesystems @@ -989,6 +1006,8 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -1003,7 +1022,6 @@ CONFIG_RAMFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set @@ -1014,22 +1032,28 @@ CONFIG_RAMFS=y # # Network File Systems # -CONFIG_NFS_FS=y +CONFIG_NFS_FS=m CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y -CONFIG_NFSD=y +CONFIG_NFSD=m CONFIG_NFSD_V3=y -# CONFIG_NFSD_V4 is not set -# CONFIG_NFSD_TCP is not set -CONFIG_LOCKD=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m CONFIG_LOCKD_V4=y -CONFIG_EXPORTFS=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set +CONFIG_EXPORTFS=m +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_RPCSEC_GSS_KRB5=m +# CONFIG_RPCSEC_GSS_SPKM3 is not set +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -1049,7 +1073,7 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set +CONFIG_SGI_PARTITION=y # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set CONFIG_EFI_PARTITION=y @@ -1060,43 +1084,43 @@ CONFIG_EFI_PARTITION=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +# CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m # # Library routines @@ -1105,6 +1129,13 @@ CONFIG_NLS_ISO8859_1=y CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set +# +# HP Simulator drivers +# +# CONFIG_HP_SIMETH is not set +# CONFIG_HP_SIMSERIAL is not set +# CONFIG_HP_SIMSCSI is not set + # # Profiling support # @@ -1113,24 +1144,26 @@ CONFIG_CRC32=y # # Kernel hacking # -CONFIG_IA64_GRANULE_16MB=y -# CONFIG_IA64_GRANULE_64MB is not set CONFIG_DEBUG_KERNEL=y -CONFIG_IA64_PRINT_HAZARDS=y -# CONFIG_DISABLE_VHPT is not set CONFIG_MAGIC_SYSRQ=y -# CONFIG_IA64_EARLY_PRINTK_VGA is not set +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_IA64_GRANULE_16MB=y +# CONFIG_IA64_GRANULE_64MB is not set +# CONFIG_IA64_PRINT_HAZARDS is not set +# CONFIG_DISABLE_VHPT is not set # CONFIG_IA64_DEBUG_CMPXCHG is not set # CONFIG_IA64_DEBUG_IRQ is not set -CONFIG_DEBUG_INFO=y CONFIG_SYSVIPC_COMPAT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -1140,11 +1173,12 @@ CONFIG_CRYPTO=y # CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MD5=m # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set -CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_WP512 is not set +CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set @@ -1153,7 +1187,13 @@ CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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_TEST is not set + +# +# Hardware crypto devices +# diff --git a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile index 1a7f925ea..971cd7870 100644 --- a/arch/ia64/dig/Makefile +++ b/arch/ia64/dig/Makefile @@ -6,9 +6,4 @@ # obj-y := setup.o - -ifndef CONFIG_NUMA -obj-$(CONFIG_IA64_DIG) += topology.o -endif - obj-$(CONFIG_IA64_GENERIC) += machvec.o diff --git a/arch/ia64/hp/common/Makefile b/arch/ia64/hp/common/Makefile index e7c7133c7..f61a60057 100644 --- a/arch/ia64/hp/common/Makefile +++ b/arch/ia64/hp/common/Makefile @@ -6,3 +6,5 @@ # obj-y := sba_iommu.o +obj-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += hwsw_iommu.o +obj-$(CONFIG_IA64_GENERIC) += hwsw_iommu.o diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index e50c446e0..272291d60 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -33,13 +33,14 @@ #include #include #include +#include +#include /* hweight64() */ #include /* ia64_get_itc() */ #include #include /* PAGE_OFFSET */ #include #include /* wmb() */ -#include /* hweight64() */ #include @@ -478,7 +479,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted) * purges IOTLB entries in power-of-two sizes, so we also * allocate IOVA space in power-of-two sizes. */ - bits_wanted = 1UL << get_iovp_order(bits_wanted << PAGE_SHIFT); + bits_wanted = 1UL << get_iovp_order(bits_wanted << iovp_shift); if (likely(bits_wanted == 1)) { unsigned int bitshiftcnt; @@ -687,7 +688,7 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size) unsigned long m; /* Round up to power-of-two size: see AR2305 note above */ - bits_not_wanted = 1UL << get_iovp_order(bits_not_wanted << PAGE_SHIFT); + bits_not_wanted = 1UL << get_iovp_order(bits_not_wanted << iovp_shift); for (; bits_not_wanted > 0 ; res_ptr++) { if (unlikely(bits_not_wanted > BITS_PER_LONG)) { @@ -1556,7 +1557,7 @@ ioc_iova_init(struct ioc *ioc) ** We program the next pdir index after we stop w/ a key for ** the GART code to handshake on. */ - while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) + for_each_pci_dev(device) agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP); if (agp_found && reserve_sba_gart) { diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index 3c9c3072b..ae84a1018 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -286,7 +286,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev) static int simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr) { - struct net_device *dev = (struct net_device *)ptr; + struct net_device *dev = ptr; struct simeth_local *local; struct in_device *in_dev; struct in_ifaddr **ifap = NULL; @@ -382,7 +382,7 @@ frame_print(unsigned char *from, unsigned char *frame, int len) static int simeth_tx(struct sk_buff *skb, struct net_device *dev) { - struct simeth_local *local = (struct simeth_local *)dev->priv; + struct simeth_local *local = dev->priv; #if 0 /* ensure we have at least ETH_ZLEN bytes (min frame size) */ @@ -446,7 +446,7 @@ simeth_rx(struct net_device *dev) int len; int rcv_count = SIMETH_RECV_MAX; - local = (struct simeth_local *)dev->priv; + local = dev->priv; /* * the loop concept has been borrowed from other drivers * looks to me like it's a throttling thing to avoid pushing to many @@ -515,7 +515,7 @@ simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs) static struct net_device_stats * simeth_get_stats(struct net_device *dev) { - struct simeth_local *local = (struct simeth_local *) dev->priv; + struct simeth_local *local = dev->priv; return &local->stats; } diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index af4b7143d..786e70718 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -301,7 +301,7 @@ static void rs_flush_chars(struct tty_struct *tty) } -static int rs_write(struct tty_struct * tty, int from_user, +static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) { int c, ret = 0; @@ -310,58 +310,22 @@ static int rs_write(struct tty_struct * tty, int from_user, if (!tty || !info->xmit.buf || !tmp_buf) return 0; - if (from_user) { - down(&tmp_buf_sem); - while (1) { - int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) - break; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!ret) - ret = -EFAULT; - break; - } - - local_irq_save(flags); - { - c1 = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, - SERIAL_XMIT_SIZE); - if (c1 < c) - c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - } - local_irq_restore(flags); - - buf += c; - count -= c; - ret += c; - } - up(&tmp_buf_sem); - } else { - local_irq_save(flags); - while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) { - break; - } - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - buf += c; - count -= c; - ret += c; + local_irq_save(flags); + while (1) { + c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); + if (count < c) + c = count; + if (c <= 0) { + break; } - local_irq_restore(flags); + memcpy(info->xmit.buf + info->xmit.head, buf, c); + info->xmit.head = ((info->xmit.head + c) & + (SERIAL_XMIT_SIZE-1)); + buf += c; + count -= c; + ret += c; } + local_irq_restore(flags); /* * Hey, we transmit directly from here in our case */ diff --git a/arch/ia64/hp/zx1/Makefile b/arch/ia64/hp/zx1/Makefile index 64e39aa82..61e878729 100644 --- a/arch/ia64/hp/zx1/Makefile +++ b/arch/ia64/hp/zx1/Makefile @@ -5,4 +5,4 @@ # Copyright (C) Alex Williamson (alex_williamson@hp.com) # -obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o +obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o hpzx1_swiotlb_machvec.o diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c index 093129cb2..3941e0429 100644 --- a/arch/ia64/ia32/binfmt_elf32.c +++ b/arch/ia64/ia32/binfmt_elf32.c @@ -35,7 +35,7 @@ extern void ia64_elf32_init (struct pt_regs *regs); static void elf32_set_personality (void); -#define setup_arg_pages(bprm,exec) ia32_setup_arg_pages(bprm,exec) +#define setup_arg_pages(bprm,tos,exec) ia32_setup_arg_pages(bprm,exec) #define elf_map elf32_map #undef SET_PERSONALITY @@ -100,7 +100,11 @@ ia64_elf32_init (struct pt_regs *regs) vma->vm_ops = &ia32_shared_page_vm_ops; down_write(¤t->mm->mmap_sem); { - insert_vm_struct(current->mm, vma); + if (insert_vm_struct(current->mm, vma)) { + kmem_cache_free(vm_area_cachep, vma); + up_write(¤t->mm->mmap_sem); + BUG(); + } } up_write(¤t->mm->mmap_sem); } @@ -123,7 +127,11 @@ ia64_elf32_init (struct pt_regs *regs) vma->vm_ops = &ia32_gate_page_vm_ops; down_write(¤t->mm->mmap_sem); { - insert_vm_struct(current->mm, vma); + if (insert_vm_struct(current->mm, vma)) { + kmem_cache_free(vm_area_cachep, vma); + up_write(¤t->mm->mmap_sem); + BUG(); + } } up_write(¤t->mm->mmap_sem); } @@ -142,7 +150,11 @@ ia64_elf32_init (struct pt_regs *regs) vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE; down_write(¤t->mm->mmap_sem); { - insert_vm_struct(current->mm, vma); + if (insert_vm_struct(current->mm, vma)) { + kmem_cache_free(vm_area_cachep, vma); + up_write(¤t->mm->mmap_sem); + BUG(); + } } up_write(¤t->mm->mmap_sem); } @@ -190,7 +202,7 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack) unsigned long stack_base, grow; struct vm_area_struct *mpnt; struct mm_struct *mm = current->mm; - int i; + int i, ret; stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; mm->arg_start = bprm->p + stack_base; @@ -227,7 +239,11 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack) mpnt->vm_flags = VM_STACK_FLAGS; mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC)? PAGE_COPY_EXEC: PAGE_COPY; - insert_vm_struct(current->mm, mpnt); + if ((ret = insert_vm_struct(current->mm, mpnt))) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return ret; + } // current->mm->stack_vm = current->mm->total_vm = vma_pages(mpnt); vx_vmpages_sub(current->mm, current->mm->total_vm - vma_pages(mpnt)); current->mm->stack_vm = current->mm->total_vm; diff --git a/arch/ia64/ia32/elfcore32.h b/arch/ia64/ia32/elfcore32.h index b68534d18..b73b8b6b1 100644 --- a/arch/ia64/ia32/elfcore32.h +++ b/arch/ia64/ia32/elfcore32.h @@ -9,6 +9,7 @@ #define _ELFCORE32_H_ #include +#include #define USE_ELF_CORE_DUMP 1 @@ -105,7 +106,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr struct ia32_user_i387_struct *fpstate = (void*)fpu; mm_segment_t old_fs; - if (!tsk->used_math) + if (!tsk_used_math(tsk)) return 0; old_fs = get_fs(); @@ -123,7 +124,7 @@ elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) struct ia32_user_fxsr_struct *fpxstate = (void*) xfpu; mm_segment_t old_fs; - if (!tsk->used_math) + if (!tsk_used_math(tsk)) return 0; old_fs = get_fs(); diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S index 4a6319c6d..1bb348d72 100644 --- a/arch/ia64/ia32/ia32_entry.S +++ b/arch/ia64/ia32/ia32_entry.S @@ -223,7 +223,7 @@ ia32_syscall_table: data8 sys_unlink /* 10 */ data8 ia32_execve data8 sys_chdir - data8 sys32_time + data8 compat_sys_time data8 sys_mknod data8 sys_chmod /* 15 */ data8 sys_lchown /* 16-bit version */ @@ -235,7 +235,7 @@ ia32_syscall_table: data8 sys_oldumount data8 sys_setuid /* 16-bit version */ data8 sys_getuid /* 16-bit version */ - data8 sys_ni_syscall /* sys_stime is not supported on IA64 */ /* 25 */ + data8 compat_sys_stime /* 25 */ data8 sys32_ptrace data8 sys32_alarm data8 sys_ni_syscall @@ -387,7 +387,7 @@ ia32_syscall_table: data8 sys32_rt_sigaction data8 sys32_rt_sigprocmask /* 175 */ data8 sys_rt_sigpending - data8 sys32_rt_sigtimedwait + data8 compat_sys_rt_sigtimedwait data8 sys32_rt_sigqueueinfo data8 sys32_rt_sigsuspend data8 sys32_pread /* 180 */ @@ -470,16 +470,16 @@ ia32_syscall_table: data8 sys_remap_file_pages data8 sys_set_tid_address data8 sys32_timer_create - data8 compat_timer_settime /* 260 */ - data8 compat_timer_gettime + data8 compat_sys_timer_settime /* 260 */ + data8 compat_sys_timer_gettime data8 sys_timer_getoverrun data8 sys_timer_delete - data8 compat_clock_settime - data8 compat_clock_gettime /* 265 */ - data8 compat_clock_getres - data8 compat_clock_nanosleep - data8 compat_statfs64 - data8 compat_fstatfs64 + data8 compat_sys_clock_settime + data8 compat_sys_clock_gettime /* 265 */ + data8 compat_sys_clock_getres + data8 compat_sys_clock_nanosleep + data8 compat_sys_statfs64 + data8 compat_sys_fstatfs64 data8 sys_tgkill /* 270 */ data8 compat_sys_utimes data8 sys32_fadvise64_64 diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c index 7f2fc2704..3b385f543 100644 --- a/arch/ia64/ia32/ia32_signal.c +++ b/arch/ia64/ia32/ia32_signal.c @@ -1,7 +1,7 @@ /* * IA32 Architecture-specific signal handling support. * - * Copyright (C) 1999, 2001-2002 Hewlett-Packard Co + * Copyright (C) 1999, 2001-2002, 2005 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999 Arun Sharma * Copyright (C) 2000 VA Linux Co @@ -59,19 +59,19 @@ struct rt_sigframe_ia32 int sig; int pinfo; int puc; - siginfo_t32 info; + compat_siginfo_t info; struct ucontext_ia32 uc; struct _fpstate_ia32 fpstate; char retcode[8]; }; int -copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 __user *from) +copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from) { unsigned long tmp; int err; - if (!access_ok(VERIFY_READ, from, sizeof(siginfo_t32))) + if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t))) return -EFAULT; err = __get_user(to->si_signo, &from->si_signo); @@ -110,12 +110,12 @@ copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 __user *from) } int -copy_siginfo_to_user32 (siginfo_t32 __user *to, siginfo_t *from) +copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from) { unsigned int addr; int err; - if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t32))) + if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t))) return -EFAULT; /* If you change siginfo_t structure, please be sure @@ -589,34 +589,7 @@ sys32_rt_sigprocmask (int how, compat_sigset_t __user *set, compat_sigset_t __us } asmlinkage long -sys32_rt_sigtimedwait (compat_sigset_t __user *uthese, siginfo_t32 __user *uinfo, - struct compat_timespec __user *uts, unsigned int sigsetsize) -{ - mm_segment_t old_fs = get_fs(); - struct timespec t; - siginfo_t info; - sigset_t s; - int ret; - - if (copy_from_user(&s.sig, uthese, sizeof(compat_sigset_t))) - return -EFAULT; - if (uts && get_compat_timespec(&t, uts)) - return -EFAULT; - set_fs(KERNEL_DS); - ret = sys_rt_sigtimedwait((sigset_t __user *) &s, - uinfo ? (siginfo_t __user *) &info : NULL, - uts ? (struct timespec __user *) &t : NULL, - sigsetsize); - set_fs(old_fs); - if (ret >= 0 && uinfo) { - if (copy_siginfo_to_user32(uinfo, &info)) - return -EFAULT; - } - return ret; -} - -asmlinkage long -sys32_rt_sigqueueinfo (int pid, int sig, siginfo_t32 __user *uinfo) +sys32_rt_sigqueueinfo (int pid, int sig, compat_siginfo_t __user *uinfo) { mm_segment_t old_fs = get_fs(); siginfo_t info; @@ -997,11 +970,10 @@ ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, } asmlinkage long -sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, - unsigned long stack) +sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, + int arg6, int arg7, struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &stack; - unsigned long esp = (unsigned int) regs->r12; + unsigned long esp = (unsigned int) regs.r12; struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(esp - 8); sigset_t set; int eax; @@ -1020,7 +992,7 @@ sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - if (restore_sigcontext_ia32(regs, &frame->sc, &eax)) + if (restore_sigcontext_ia32(®s, &frame->sc, &eax)) goto badframe; return eax; @@ -1030,11 +1002,10 @@ sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int } asmlinkage long -sys32_rt_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, - unsigned long stack) +sys32_rt_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, + int arg5, int arg6, int arg7, struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &stack; - unsigned long esp = (unsigned int) regs->r12; + unsigned long esp = (unsigned int) regs.r12; struct rt_sigframe_ia32 __user *frame = (struct rt_sigframe_ia32 __user *)(esp - 4); sigset_t set; int eax; @@ -1050,7 +1021,7 @@ sys32_rt_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - if (restore_sigcontext_ia32(regs, &frame->uc.uc_mcontext, &eax)) + if (restore_sigcontext_ia32(®s, &frame->uc.uc_mcontext, &eax)) goto badframe; /* It is more difficult to avoid calling this function than to diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h index 59c500b23..ebdd4e20b 100644 --- a/arch/ia64/ia32/ia32priv.h +++ b/arch/ia64/ia32/ia32priv.h @@ -232,7 +232,7 @@ typedef union sigval32 { #define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3) -typedef struct siginfo32 { +typedef struct compat_siginfo { int si_signo; int si_errno; int si_code; @@ -282,7 +282,7 @@ typedef struct siginfo32 { int _fd; } _sigpoll; } _sifields; -} siginfo_t32; +} compat_siginfo_t; typedef struct sigevent32 { sigval_t32 sigev_value; diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 1b653dadb..f2eccc24c 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -6,7 +6,7 @@ * Copyright (C) 1999 Arun Sharma * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 2000-2003 Hewlett-Packard Co + * Copyright (C) 2000-2003, 2005 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 2004 Gordon Jin * @@ -1415,7 +1415,7 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); @@ -1425,27 +1425,6 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) return -EINVAL; } -/* - * sys_time() can be implemented in user-level using - * sys_gettimeofday(). IA64 did this but i386 Linux did not - * so we have to implement this system call here. - */ -asmlinkage long -sys32_time (int __user *tloc) -{ - int i; - struct timeval tv; - - do_gettimeofday(&tv); - i = tv.tv_sec; - - if (tloc) { - if (put_user(i, tloc)) - i = -EFAULT; - } - return i; -} - asmlinkage long compat_sys_wait4 (compat_pid_t pid, compat_uint_t * stat_addr, int options, struct compat_rusage *ru); @@ -1457,7 +1436,7 @@ sys32_waitpid (int pid, unsigned int *stat_addr, int options) } static unsigned int -ia32_peek (struct pt_regs *regs, struct task_struct *child, unsigned long addr, unsigned int *val) +ia32_peek (struct task_struct *child, unsigned long addr, unsigned int *val) { size_t copied; unsigned int ret; @@ -1467,7 +1446,7 @@ ia32_peek (struct pt_regs *regs, struct task_struct *child, unsigned long addr, } static unsigned int -ia32_poke (struct pt_regs *regs, struct task_struct *child, unsigned long addr, unsigned int val) +ia32_poke (struct task_struct *child, unsigned long addr, unsigned int val) { if (access_process_vm(child, addr, &val, sizeof(val), 1) != sizeof(val)) @@ -1772,25 +1751,16 @@ restore_ia32_fpxstate (struct task_struct *tsk, struct ia32_user_fxsr_struct __u return 0; } -/* - * Note that the IA32 version of `ptrace' calls the IA64 routine for - * many of the requests. This will only work for requests that do - * not need access to the calling processes `pt_regs' which is located - * at the address of `stack'. Once we call the IA64 `sys_ptrace' then - * the address of `stack' will not be the address of the `pt_regs'. - */ asmlinkage long -sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, - long arg4, long arg5, long arg6, long arg7, long stack) +sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data) { - struct pt_regs *regs = (struct pt_regs *) &stack; struct task_struct *child; unsigned int value, tmp; long i, ret; lock_kernel(); if (request == PTRACE_TRACEME) { - ret = sys_ptrace(request, pid, addr, data, arg4, arg5, arg6, arg7, stack); + ret = sys_ptrace(request, pid, addr, data); goto out; } @@ -1807,7 +1777,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, goto out_tsk; if (request == PTRACE_ATTACH) { - ret = sys_ptrace(request, pid, addr, data, arg4, arg5, arg6, arg7, stack); + ret = sys_ptrace(request, pid, addr, data); goto out_tsk; } @@ -1818,7 +1788,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, switch (request) { case PTRACE_PEEKTEXT: case PTRACE_PEEKDATA: /* read word at location addr */ - ret = ia32_peek(regs, child, addr, &value); + ret = ia32_peek(child, addr, &value); if (ret == 0) ret = put_user(value, (unsigned int __user *) compat_ptr(data)); else @@ -1827,7 +1797,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, case PTRACE_POKETEXT: case PTRACE_POKEDATA: /* write the word at location addr */ - ret = ia32_poke(regs, child, addr, data); + ret = ia32_poke(child, addr, data); goto out_tsk; case PTRACE_PEEKUSR: /* read word at addr in USER area */ @@ -1894,12 +1864,16 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, compat_ptr(data)); break; + case PTRACE_GETEVENTMSG: + ret = put_user(child->ptrace_message, (unsigned int __user *) compat_ptr(data)); + break; + case PTRACE_SYSCALL: /* continue, stop after next syscall */ case PTRACE_CONT: /* restart after signal. */ case PTRACE_KILL: case PTRACE_SINGLESTEP: /* execute chile for one instruction */ case PTRACE_DETACH: /* detach a process */ - ret = sys_ptrace(request, pid, addr, data, arg4, arg5, arg6, arg7, stack); + ret = sys_ptrace(request, pid, addr, data); break; default: @@ -1922,9 +1896,9 @@ typedef struct { asmlinkage long sys32_sigaltstack (ia32_stack_t __user *uss32, ia32_stack_t __user *uoss32, - long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long stack) + long arg2, long arg3, long arg4, long arg5, long arg6, + long arg7, struct pt_regs pt) { - struct pt_regs *pt = (struct pt_regs *) &stack; stack_t uss, uoss; ia32_stack_t buf32; int ret; @@ -1945,7 +1919,7 @@ sys32_sigaltstack (ia32_stack_t __user *uss32, ia32_stack_t __user *uoss32, } set_fs(KERNEL_DS); ret = do_sigaltstack(uss32 ? (stack_t __user *) &uss : NULL, - (stack_t __user *) &uoss, pt->r12); + (stack_t __user *) &uoss, pt.r12); current->sas_ss_size = buf32.ss_size; set_fs(old_fs); out: @@ -1990,10 +1964,10 @@ struct sysctl32 { unsigned int __unused[4]; }; +#ifdef CONFIG_SYSCTL asmlinkage long sys32_sysctl (struct sysctl32 __user *args) { -#ifdef CONFIG_SYSCTL struct sysctl32 a32; mm_segment_t old_fs = get_fs (); void __user *oldvalp, *newvalp; @@ -2032,10 +2006,8 @@ sys32_sysctl (struct sysctl32 __user *args) return -EFAULT; return ret; -#else - return -ENOSYS; -#endif } +#endif asmlinkage long sys32_newuname (struct new_utsname __user *name) @@ -2662,7 +2634,7 @@ long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, } asmlinkage long sys32_waitid(int which, compat_pid_t pid, - siginfo_t32 __user *uinfo, int options, + compat_siginfo_t __user *uinfo, int options, struct compat_rusage __user *uru) { siginfo_t info; @@ -2673,7 +2645,7 @@ asmlinkage long sys32_waitid(int which, compat_pid_t pid, info.si_signo = 0; set_fs (KERNEL_DS); ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options, - uru ? &ru : NULL); + uru ? (struct rusage __user *) &ru : NULL); set_fs (old_fs); if (ret < 0 || info.si_signo == 0) diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index 265ae83da..c1a02bbc2 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile @@ -6,15 +6,17 @@ extra-y := head.o init_task.o vmlinux.lds obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ - salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o unwind.o mca.o mca_asm.o + salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \ + unwind.o mca.o mca_asm.o topology.o obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o obj-$(CONFIG_IA64_HP_ZX1) += acpi-ext.o +obj-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += acpi-ext.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_IOSAPIC) += iosapic.o obj-$(CONFIG_MODULES) += module.o -obj-$(CONFIG_SMP) += smp.o smpboot.o +obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o obj-$(CONFIG_IA64_CYCLONE) += cyclone.o obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 6e012ba55..ca062b962 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,8 @@ acpi_get_sysname (void) return "hpsim"; # elif defined (CONFIG_IA64_HP_ZX1) return "hpzx1"; +# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB) + return "hpzx1_swiotlb"; # elif defined (CONFIG_IA64_SGI_SN2) return "sn2"; # elif defined (CONFIG_IA64_DIG) @@ -354,11 +357,11 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size) #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) static int __initdata srat_num_cpus; /* number of cpus */ -static u32 __initdata pxm_flag[PXM_FLAG_LEN]; +static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag)) #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) /* maps to convert between proximity domain and logical node ID */ -int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS]; +int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS]; int __initdata nid_to_pxm_map[MAX_NUMNODES]; static struct acpi_table_slit __initdata *slit_table; @@ -444,16 +447,20 @@ acpi_numa_arch_fixup (void) return; } + /* + * MCD - This can probably be dropped now. No need for pxm ID to node ID + * mapping with sparse node numbering iff MAX_PXM_DOMAINS <= MAX_NUMNODES. + */ /* calculate total number of nodes in system from PXM bitmap */ - numnodes = 0; /* init total nodes in system */ - memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map)); memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map)); + nodes_clear(node_online_map); for (i = 0; i < MAX_PXM_DOMAINS; i++) { if (pxm_bit_test(i)) { - pxm_to_nid_map[i] = numnodes; - node_set_online(numnodes); - nid_to_pxm_map[numnodes++] = i; + int nid = num_online_nodes(); + pxm_to_nid_map[i] = nid; + nid_to_pxm_map[nid] = i; + node_set_online(nid); } } @@ -462,7 +469,7 @@ acpi_numa_arch_fixup (void) node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid]; /* assign memory bank numbers for each chunk on each node */ - for (i = 0; i < numnodes; i++) { + for_each_online_node(i) { int bank; bank = 0; @@ -475,7 +482,7 @@ acpi_numa_arch_fixup (void) for (i = 0; i < srat_num_cpus; i++) node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; - printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes); + printk(KERN_INFO "Number of logical nodes in system = %d\n", num_online_nodes()); printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks); if (!slit_table) return; @@ -495,8 +502,8 @@ acpi_numa_arch_fixup (void) #ifdef SLIT_DEBUG printk("ACPI 2.0 SLIT locality table:\n"); - for (i = 0; i < numnodes; i++) { - for (j = 0; j < numnodes; j++) + for_each_online_node(i) { + for_each_online_node(j) printk("%03d ", node_distance(i,j)); printk("\n"); } @@ -516,6 +523,15 @@ acpi_register_gsi (u32 gsi, int edge_level, int active_high_low) } EXPORT_SYMBOL(acpi_register_gsi); +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void +acpi_unregister_gsi (u32 gsi) +{ + iosapic_unregister_intr(gsi); +} +EXPORT_SYMBOL(acpi_unregister_gsi); +#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ + static int __init acpi_parse_fadt (unsigned long phys_addr, unsigned long size) { @@ -651,6 +667,110 @@ acpi_gsi_to_irq (u32 gsi, unsigned int *irq) return 0; } +/* + * ACPI based hotplug CPU support + */ +#ifdef CONFIG_ACPI_HOTPLUG_CPU +static +int +acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) +{ +#ifdef CONFIG_ACPI_NUMA + int pxm_id; + + pxm_id = acpi_get_pxm(handle); + + /* + * Assuming that the container driver would have set the proximity + * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag + */ + node_cpuid[cpu].nid = (pxm_id < 0) ? 0: + pxm_to_nid_map[pxm_id]; + + node_cpuid[cpu].phys_id = physid; +#endif + return(0); +} + + +int +acpi_map_lsapic(acpi_handle handle, int *pcpu) +{ + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + union acpi_object *obj; + struct acpi_table_lsapic *lsapic; + cpumask_t tmp_map; + long physid; + int cpu; + + if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) + return -EINVAL; + + if (!buffer.length || !buffer.pointer) + return -EINVAL; + + obj = buffer.pointer; + if (obj->type != ACPI_TYPE_BUFFER || + obj->buffer.length < sizeof(*lsapic)) { + acpi_os_free(buffer.pointer); + return -EINVAL; + } + + lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer; + + if ((lsapic->header.type != ACPI_MADT_LSAPIC) || + (!lsapic->flags.enabled)) { + acpi_os_free(buffer.pointer); + return -EINVAL; + } + + physid = ((lsapic->id <<8) | (lsapic->eid)); + + acpi_os_free(buffer.pointer); + buffer.length = ACPI_ALLOCATE_BUFFER; + buffer.pointer = NULL; + + cpus_complement(tmp_map, cpu_present_map); + cpu = first_cpu(tmp_map); + if(cpu >= NR_CPUS) + return -EINVAL; + + acpi_map_cpu2node(handle, cpu, physid); + + cpu_set(cpu, cpu_present_map); + ia64_cpu_to_sapicid[cpu] = physid; + ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu]; + + *pcpu = cpu; + return(0); +} +EXPORT_SYMBOL(acpi_map_lsapic); + + +int +acpi_unmap_lsapic(int cpu) +{ + int i; + + for (i=0; i #include #include +#include #define SD_NODES_PER_DOMAIN 6 @@ -150,10 +151,9 @@ void __devinit arch_init_sched_domains(void) * Set up domains. Isolated domains just stay on the dummy domain. */ for_each_cpu_mask(i, cpu_default_map) { - int node = cpu_to_node(i); int group; struct sched_domain *sd = NULL, *p; - cpumask_t nodemask = node_to_cpumask(node); + cpumask_t nodemask = node_to_cpumask(cpu_to_node(i)); cpus_and(nodemask, nodemask, cpu_default_map); @@ -171,7 +171,7 @@ void __devinit arch_init_sched_domains(void) sd = &per_cpu(node_domains, i); *sd = SD_NODE_INIT; - sd->span = sched_domain_node_span(node); + sd->span = sched_domain_node_span(cpu_to_node(i)); sd->parent = p; cpus_and(sd->span, sd->span, cpu_default_map); #endif diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 7b23f4dfa..4a3b1aac4 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -324,12 +325,12 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) * [granule_addr - first_non_wb_addr) is guaranteed to * be contiguous WB memory. */ - granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); + granule_addr = GRANULEROUNDDOWN(md->phys_addr); first_non_wb_addr = max(first_non_wb_addr, granule_addr); if (first_non_wb_addr < md->phys_addr) { trim_bottom(md, granule_addr + IA64_GRANULE_SIZE); - granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); + granule_addr = GRANULEROUNDDOWN(md->phys_addr); first_non_wb_addr = max(first_non_wb_addr, granule_addr); } @@ -343,24 +344,36 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) break; /* non-WB or hole */ } - last_granule_addr = first_non_wb_addr & ~(IA64_GRANULE_SIZE - 1); + last_granule_addr = GRANULEROUNDDOWN(first_non_wb_addr); if (last_granule_addr < md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) trim_top(md, last_granule_addr); if (is_available_memory(md)) { - if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > max_addr) { - if (md->phys_addr > max_addr) + if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) >= max_addr) { + if (md->phys_addr >= max_addr) continue; md->num_pages = (max_addr - md->phys_addr) >> EFI_PAGE_SHIFT; + first_non_wb_addr = max_addr; } if (total_mem >= mem_limit) continue; - total_mem += (md->num_pages << EFI_PAGE_SHIFT); - if (total_mem > mem_limit) { - md->num_pages -= ((total_mem - mem_limit) >> EFI_PAGE_SHIFT); - max_addr = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); + + if (total_mem + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) { + unsigned long limit_addr = md->phys_addr; + + limit_addr += mem_limit - total_mem; + limit_addr = GRANULEROUNDDOWN(limit_addr); + + if (md->phys_addr > limit_addr) + continue; + + md->num_pages = (limit_addr - md->phys_addr) >> + EFI_PAGE_SHIFT; + first_non_wb_addr = max_addr = md->phys_addr + + (md->num_pages << EFI_PAGE_SHIFT); } + total_mem += (md->num_pages << EFI_PAGE_SHIFT); if (md->num_pages == 0) continue; @@ -401,16 +414,15 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor * Abstraction Layer chapter 11 in ADAG */ -void -efi_map_pal_code (void) + +void * +efi_get_pal_addr (void) { void *efi_map_start, *efi_map_end, *p; efi_memory_desc_t *md; u64 efi_desc_size; int pal_code_count = 0; - u64 mask, psr; - u64 vaddr; - int cpu; + u64 vaddr, mask; efi_map_start = __va(ia64_boot_param->efi_memmap); efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; @@ -454,30 +466,39 @@ efi_map_pal_code (void) if (md->num_pages << EFI_PAGE_SHIFT > IA64_GRANULE_SIZE) panic("Woah! PAL code size bigger than a granule!"); - mask = ~((1 << IA64_GRANULE_SHIFT) - 1); #if EFI_DEBUG + mask = ~((1 << IA64_GRANULE_SHIFT) - 1); + printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", - smp_processor_id(), md->phys_addr, - md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), - vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); + smp_processor_id(), md->phys_addr, + md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), + vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); #endif - - /* - * Cannot write to CRx with PSR.ic=1 - */ - psr = ia64_clear_ic(); - ia64_itr(0x1, IA64_TR_PALCODE, vaddr & mask, - pte_val(pfn_pte(md->phys_addr >> PAGE_SHIFT, PAGE_KERNEL)), - IA64_GRANULE_SHIFT); - ia64_set_psr(psr); /* restore psr */ - ia64_srlz_i(); - - cpu = smp_processor_id(); - - /* insert this TR into our list for MCA recovery purposes */ - ia64_mca_tlb_list[cpu].pal_base = vaddr & mask; - ia64_mca_tlb_list[cpu].pal_paddr = pte_val(mk_pte_phys(md->phys_addr, PAGE_KERNEL)); + return __va(md->phys_addr); } + printk(KERN_WARNING "%s: no PAL-code memory-descriptor found", + __FUNCTION__); + return NULL; +} + +void +efi_map_pal_code (void) +{ + void *pal_vaddr = efi_get_pal_addr (); + u64 psr; + + if (!pal_vaddr) + return; + + /* + * Cannot write to CRx with PSR.ic=1 + */ + psr = ia64_clear_ic(); + ia64_itr(0x1, IA64_TR_PALCODE, GRANULEROUNDDOWN((unsigned long) pal_vaddr), + pte_val(pfn_pte(__pa(pal_vaddr) >> PAGE_SHIFT, PAGE_KERNEL)), + IA64_GRANULE_SHIFT); + ia64_set_psr(psr); /* restore psr */ + ia64_srlz_i(); } void __init @@ -495,13 +516,13 @@ efi_init (void) for (cp = saved_command_line; *cp; ) { if (memcmp(cp, "mem=", 4) == 0) { cp += 4; - mem_limit = memparse(cp, &end) - 2; + mem_limit = memparse(cp, &end); if (end != cp) break; cp = end; } else if (memcmp(cp, "max_addr=", 9) == 0) { cp += 9; - max_addr = memparse(cp, &end) - 1; + max_addr = GRANULEROUNDDOWN(memparse(cp, &end)); if (end != cp) break; cp = end; @@ -737,6 +758,7 @@ efi_mem_attributes (unsigned long phys_addr) } return 0; } +EXPORT_SYMBOL(efi_mem_attributes); int valid_phys_addr_range (unsigned long phys_addr, unsigned long *size) diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 5e22d9df6..0ad38f6fa 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S @@ -3,7 +3,7 @@ * * Kernel entry points. * - * Copyright (C) 1998-2003 Hewlett-Packard Co + * Copyright (C) 1998-2003, 2005 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999, 2002-2003 * Asit Mallick @@ -51,8 +51,11 @@ * setup a null register window frame. */ ENTRY(ia64_execve) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3) - alloc loc1=ar.pfs,3,2,4,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc loc1=ar.pfs,8,2,4,0 mov loc0=rp .body mov out0=in0 // filename @@ -113,8 +116,11 @@ END(ia64_execve) * u64 tls) */ GLOBAL_ENTRY(sys_clone2) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) - alloc r16=ar.pfs,6,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -142,8 +148,11 @@ END(sys_clone2) * Deprecated. Use sys_clone2() instead. */ GLOBAL_ENTRY(sys_clone) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) - alloc r16=ar.pfs,5,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -549,7 +558,7 @@ GLOBAL_ENTRY(ia64_trace_syscall) .mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8 .mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10 br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value -.ret3: br.cond.sptk ia64_leave_syscall +.ret3: br.cond.sptk .work_pending_syscall_end strace_error: ld8 r3=[r2] // load pt_regs.r8 @@ -612,10 +621,7 @@ GLOBAL_ENTRY(ia64_ret_from_syscall) PT_REGS_UNWIND_INFO(0) cmp.ge p6,p7=r8,r0 // syscall executed successfully? adds r2=PT(R8)+16,sp // r2 = &pt_regs.r8 - adds r3=PT(R10)+16,sp // r3 = &pt_regs.r10 - ;; -.mem.offset 0,0; (p6) st8.spill [r2]=r8 // store return value in slot for r8 and set unat bit -.mem.offset 8,0; (p6) st8.spill [r3]=r0 // clear error indication in slot for r10 and set unat bit + mov r10=r0 // clear error indication in r10 (p7) br.cond.spnt handle_syscall_error // handle potential syscall failure END(ia64_ret_from_syscall) // fall through @@ -633,10 +639,12 @@ END(ia64_ret_from_syscall) * r13: restored (user-level thread pointer) * r14: cleared * r15: restored (syscall #) - * r16-r19: cleared + * r16-r17: cleared + * r18: user-level b6 + * r19: cleared * r20: user-level ar.fpsr * r21: user-level b0 - * r22: user-level b6 + * r22: cleared * r23: user-level ar.bspstore * r24: user-level ar.rnat * r25: user-level ar.unat @@ -661,7 +669,7 @@ END(ia64_ret_from_syscall) * ar.csd: cleared * ar.ssd: cleared */ -GLOBAL_ENTRY(ia64_leave_syscall) +ENTRY(ia64_leave_syscall) PT_REGS_UNWIND_INFO(0) /* * work.need_resched etc. mustn't get changed by this CPU before it returns to @@ -690,79 +698,76 @@ GLOBAL_ENTRY(ia64_leave_syscall) (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk #endif .work_processed_syscall: - adds r16=PT(LOADRS)+16,r12 - adds r17=PT(AR_BSPSTORE)+16,r12 + adds r2=PT(LOADRS)+16,r12 + adds r3=PT(AR_BSPSTORE)+16,r12 adds r18=TI_FLAGS+IA64_TASK_SIZE,r13 ;; (p6) ld4 r31=[r18] // load current_thread_info()->flags - ld8 r19=[r16],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" - nop.i 0 + ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" + mov b7=r0 // clear b7 ;; - ld8 r23=[r17],PT(R9)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) - ld8 r22=[r16],PT(R8)-PT(B6) // load b6 + ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) + ld8 r18=[r2],PT(R9)-PT(B6) // load b6 (p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE? ;; - - mov.m ar.ccv=r0 // clear ar.ccv + mov r16=ar.bsp // M2 get existing backing store pointer (p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending? -(p6) br.cond.spnt .work_pending +(p6) br.cond.spnt .work_pending_syscall ;; // start restoring the state saved on the kernel stack (struct pt_regs): - ld8.fill r8=[r16],16 - ld8.fill r9=[r17],16 + ld8 r9=[r2],PT(CR_IPSR)-PT(R9) + ld8 r11=[r3],PT(CR_IIP)-PT(R11) mov f6=f0 // clear f6 ;; - ld8.fill r10=[r16],16 - ld8.fill r11=[r17],16 - mov f7=f0 // clear f7 - ;; - ld8 r29=[r16],16 // load cr.ipsr - ld8 r28=[r17],16 // load cr.iip + invala // M0|1 invalidate ALAT + rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection + mov f9=f0 // clear f9 + + ld8 r29=[r2],16 // load cr.ipsr + ld8 r28=[r3],16 // load cr.iip mov f8=f0 // clear f8 ;; - ld8 r30=[r16],16 // load cr.ifs - ld8 r25=[r17],16 // load ar.unat + ld8 r30=[r2],16 // M0|1 load cr.ifs + mov.m ar.ssd=r0 // M2 clear ar.ssd cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs ;; - rsm psr.i | psr.ic // initiate turning off of interrupt and interruption collection - invala // invalidate ALAT - mov f9=f0 // clear f9 - - mov.m ar.ssd=r0 // clear ar.ssd - mov.m ar.csd=r0 // clear ar.csd + ld8 r25=[r3],16 // M0|1 load ar.unat + mov.m ar.csd=r0 // M2 clear ar.csd + mov r22=r0 // clear r22 + ;; + ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs +(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled mov f10=f0 // clear f10 ;; - ld8 r26=[r16],16 // load ar.pfs - ld8 r27=[r17],PT(PR)-PT(AR_RSC) // load ar.rsc + ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0 + ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc mov f11=f0 // clear f11 ;; - ld8 r24=[r16],PT(B0)-PT(AR_RNAT) // load ar.rnat (may be garbage) - ld8 r31=[r17],PT(R1)-PT(PR) // load predicates + ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // load ar.rnat (may be garbage) + ld8 r31=[r3],PT(R1)-PT(PR) // load predicates (pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 ;; - ld8 r21=[r16],PT(R12)-PT(B0) // load b0 - ld8.fill r1=[r17],16 // load r1 -(pUStk) mov r3=1 + ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // load ar.fpsr + ld8.fill r1=[r3],16 // load r1 +(pUStk) mov r17=1 ;; - ld8.fill r12=[r16],16 - ld8.fill r13=[r17],16 - mov r2=r0 // clear r2 + srlz.d // M0 ensure interruption collection is off + ld8.fill r13=[r3],16 + mov f7=f0 // clear f7 ;; - ld8 r20=[r16] // load ar.fpsr - ld8.fill r15=[r17] // load r15 - mov b7=r0 // clear b7 + ld8.fill r12=[r2] // restore r12 (sp) + ld8.fill r15=[r3] // restore r15 + addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0 ;; -(pUStk) st1 [r14]=r3 - addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 +(pUStk) ld4 r3=[r3] // r3 = cpu_data->phys_stacked_size_p8 +(pUStk) st1 [r14]=r17 + mov b6=r18 // I0 restore b6 ;; - mov r16=ar.bsp // get existing backing store pointer - srlz.i // ensure interruption collection is off mov r14=r0 // clear r14 - ;; - ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8 - mov b6=r22 // restore b6 - shr.u r18=r19,16 // get byte size of existing "dirty" partition + shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition (pKStk) br.cond.dpnt.many skip_rbs_switch + + mov.m ar.ccv=r0 // clear ar.ccv (pNonSys) br.cond.dpnt.many dont_preserve_current_frame br.cond.sptk.many rbs_switch END(ia64_leave_syscall) @@ -883,12 +888,16 @@ GLOBAL_ENTRY(ia64_leave_kernel) srlz.i // ensure interruption collection is off mov ar.ccv=r15 ;; + ldf.fill f11=[r2] bsw.0 // switch back to bank 0 (no stop bit required beforehand...) ;; - ldf.fill f11=[r2] -(pUStk) mov r18=IA64_KR(CURRENT) // Itanium 2: 12 cycle read latency +(pUStk) mov r18=IA64_KR(CURRENT)// M2 (12 cycle read latency) adds r16=PT(CR_IPSR)+16,r12 adds r17=PT(CR_IIP)+16,r12 + +(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled + nop.i 0 + nop.i 0 ;; ld8 r29=[r16],16 // load cr.ipsr ld8 r28=[r17],16 // load cr.iip @@ -901,7 +910,7 @@ GLOBAL_ENTRY(ia64_leave_kernel) cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs ;; ld8 r24=[r16],16 // load ar.rnat (may be garbage) - ld8 r23=[r17],16// load ar.bspstore (may be garbage) + ld8 r23=[r17],16 // load ar.bspstore (may be garbage) ;; ld8 r31=[r16],16 // load predicates ld8 r21=[r17],16 // load b0 @@ -971,6 +980,7 @@ dont_preserve_current_frame: shladd in0=loc1,3,r17 mov in1=0 ;; + TEXT_ALIGN(32) rse_clear_invalid: #ifdef CONFIG_ITANIUM // cycle 0 @@ -1031,23 +1041,33 @@ rse_clear_invalid: loadrs ;; skip_rbs_switch: -(pLvSys) mov r19=r0 // clear r19 for leave_syscall, no-op otherwise - mov b0=r21 - mov ar.pfs=r26 -(pUStk) mov ar.bspstore=r23 -(p9) mov cr.ifs=r30 -(pLvSys)mov r16=r0 // clear r16 for leave_syscall, no-op otherwise - mov cr.ipsr=r29 - mov ar.fpsr=r20 -(pLvSys)mov r17=r0 // clear r17 for leave_syscall, no-op otherwise - mov cr.iip=r28 - ;; -(pUStk) mov ar.rnat=r24 // must happen with RSE in lazy mode -(pLvSys)mov r18=r0 // clear r18 for leave_syscall, no-op otherwise - mov ar.rsc=r27 - mov ar.unat=r25 - mov pr=r31,-1 - rfi + mov ar.unat=r25 // M2 +(pKStk) extr.u r22=r22,21,1 // I0 extract current value of psr.pp from r22 +(pLvSys)mov r19=r0 // A clear r19 for leave_syscall, no-op otherwise + ;; +(pUStk) mov ar.bspstore=r23 // M2 +(pKStk) dep r29=r22,r29,21,1 // I0 update ipsr.pp with psr.pp +(pLvSys)mov r16=r0 // A clear r16 for leave_syscall, no-op otherwise + ;; + mov cr.ipsr=r29 // M2 + mov ar.pfs=r26 // I0 +(pLvSys)mov r17=r0 // A clear r17 for leave_syscall, no-op otherwise + +(p9) mov cr.ifs=r30 // M2 + mov b0=r21 // I0 +(pLvSys)mov r18=r0 // A clear r18 for leave_syscall, no-op otherwise + + mov ar.fpsr=r20 // M2 + mov cr.iip=r28 // M2 + nop 0 + ;; +(pUStk) mov ar.rnat=r24 // M2 must happen with RSE in lazy mode + nop 0 +(pLvSys)mov r2=r0 + + mov ar.rsc=r27 // M2 + mov pr=r31,-1 // I0 + rfi // B /* * On entry: @@ -1056,7 +1076,16 @@ skip_rbs_switch: * On exit: * p6 = TRUE if work-pending-check needs to be redone */ +.work_pending_syscall: + add r2=-8,r2 + add r3=-8,r3 + ;; + st8 [r2]=r8 + st8 [r3]=r10 .work_pending: + tbit.nz p6,p0=r31,TIF_SIGDELAYED // signal delayed from MCA/INIT/NMI/PMI context? +(p6) br.cond.sptk.few .sigdelayed + ;; tbit.z p6,p0=r31,TIF_NEED_RESCHED // current_thread_info()->need_resched==0? (p6) br.cond.sptk.few .notify #ifdef CONFIG_PREEMPT @@ -1074,14 +1103,34 @@ skip_rbs_switch: ;; (pKStk) st4 [r20]=r0 // preempt_count() <- 0 #endif -(pLvSys)br.cond.sptk.many .work_processed_syscall // re-check +(pLvSys)br.cond.sptk.few .work_pending_syscall_end br.cond.sptk.many .work_processed_kernel // re-check .notify: (pUStk) br.call.spnt.many rp=notify_resume_user .ret10: cmp.ne p6,p0=r0,r0 // p6 <- 0 -(pLvSys)br.cond.sptk.many .work_processed_syscall // don't re-check +(pLvSys)br.cond.sptk.few .work_pending_syscall_end br.cond.sptk.many .work_processed_kernel // don't re-check + +// There is a delayed signal that was detected in MCA/INIT/NMI/PMI context where +// it could not be delivered. Deliver it now. The signal might be for us and +// may set TIF_SIGPENDING, so redrive ia64_leave_* after processing the delayed +// signal. + +.sigdelayed: + br.call.sptk.many rp=do_sigdelayed + cmp.eq p6,p0=r0,r0 // p6 <- 1, always re-check +(pLvSys)br.cond.sptk.few .work_pending_syscall_end + br.cond.sptk.many .work_processed_kernel // re-check + +.work_pending_syscall_end: + adds r2=PT(R8)+16,r12 + adds r3=PT(R10)+16,r12 + ;; + ld8 r8=[r2] + ld8 r10=[r3] + br.cond.sptk.many .work_processed_syscall // re-check + END(ia64_leave_kernel) ENTRY(handle_syscall_error) @@ -1093,17 +1142,11 @@ ENTRY(handle_syscall_error) */ PT_REGS_UNWIND_INFO(0) ld8 r3=[r2] // load pt_regs.r8 - sub r9=0,r8 // negate return value to get errno ;; - mov r10=-1 // return -1 in pt_regs.r10 to indicate error cmp.eq p6,p7=r3,r0 // is pt_regs.r8==0? - adds r3=16,r2 // r3=&pt_regs.r10 ;; -(p6) mov r9=r8 -(p6) mov r10=0 - ;; -.mem.offset 0,0; st8.spill [r2]=r9 // store errno in pt_regs.r8 and set unat bit -.mem.offset 8,0; st8.spill [r3]=r10 // store error indication in pt_regs.r10 and set unat bit +(p7) mov r10=-1 +(p7) sub r8=0,r8 // negate return value to get errno br.cond.sptk ia64_leave_syscall END(handle_syscall_error) @@ -1183,7 +1226,10 @@ END(sys_rt_sigsuspend) ENTRY(sys_rt_sigreturn) PT_REGS_UNWIND_INFO(0) - alloc r2=ar.pfs,0,0,1,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + alloc r2=ar.pfs,8,0,1,0 .prologue PT_REGS_SAVES(16) adds sp=-16,sp @@ -1527,10 +1573,10 @@ sys_call_table: data8 sys_mq_getsetattr data8 sys_ni_syscall // reserved for kexec_load data8 sys_vserver - data8 sys_ni_syscall // 1270 - data8 sys_ni_syscall - data8 sys_ni_syscall - data8 sys_ni_syscall + data8 sys_waitid // 1270 + data8 sys_add_key + data8 sys_request_key + data8 sys_keyctl data8 sys_ni_syscall data8 sys_ni_syscall // 1275 data8 sys_ni_syscall diff --git a/arch/ia64/kernel/entry.h b/arch/ia64/kernel/entry.h index 455681bbc..6d4ecec98 100644 --- a/arch/ia64/kernel/entry.h +++ b/arch/ia64/kernel/entry.h @@ -1,14 +1,25 @@ #include /* - * Preserved registers that are shared between code in ivt.S and entry.S. Be - * careful not to step on these! + * Preserved registers that are shared between code in ivt.S and + * entry.S. Be careful not to step on these! */ -#define pLvSys p1 /* set 1 if leave from syscall; otherwise, set 0 */ -#define pKStk p2 /* will leave_{kernel,syscall} return to kernel-stacks? */ -#define pUStk p3 /* will leave_{kernel,syscall} return to user-stacks? */ -#define pSys p4 /* are we processing a (synchronous) system call? */ -#define pNonSys p5 /* complement of pSys */ +#define PRED_LEAVE_SYSCALL 1 /* TRUE iff leave from syscall */ +#define PRED_KERNEL_STACK 2 /* returning to kernel-stacks? */ +#define PRED_USER_STACK 3 /* returning to user-stacks? */ +#define PRED_SYSCALL 4 /* inside a system call? */ +#define PRED_NON_SYSCALL 5 /* complement of PRED_SYSCALL */ + +#ifdef __ASSEMBLY__ +# define PASTE2(x,y) x##y +# define PASTE(x,y) PASTE2(x,y) + +# define pLvSys PASTE(p,PRED_LEAVE_SYSCALL) +# define pKStk PASTE(p,PRED_KERNEL_STACK) +# define pUStk PASTE(p,PRED_USER_STACK) +# define pSys PASTE(p,PRED_SYSCALL) +# define pNonSys PASTE(p,PRED_NON_SYSCALL) +#endif #define PT(f) (IA64_PT_REGS_##f##_OFFSET) #define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET) diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index 4895559ee..4f3cdef75 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S @@ -177,7 +177,7 @@ ENTRY(fsys_gettimeofday) // r11 = preserved: saved ar.pfs // r12 = preserved: memory stack // r13 = preserved: thread pointer - // r14 = debug pointer / usable + // r14 = address of mask / mask // r15 = preserved: system call number // r16 = preserved: current task pointer // r17 = wall to monotonic use @@ -226,7 +226,6 @@ ENTRY(fsys_gettimeofday) add r10 = IA64_TIME_INTERPOLATOR_ADDRESS_OFFSET,r20 extr r3 = r21,32,32 // time_interpolator->nsec_per_cyc extr r8 = r21,0,16 // time_interpolator->source - nop.i 123 cmp.ne p6, p0 = 0, r2 // Fallback if work is scheduled (p6) br.cond.spnt.many fsys_fallback_syscall ;; @@ -257,17 +256,20 @@ ENTRY(fsys_gettimeofday) add r24 = IA64_TIME_INTERPOLATOR_OFFSET_OFFSET,r20 (p15) ld8 r17 = [r19],IA64_TIMESPEC_TV_NSEC_OFFSET ld8 r9 = [r27],IA64_TIMESPEC_TV_NSEC_OFFSET - nop.i 123 + add r14 = IA64_TIME_INTERPOLATOR_MASK_OFFSET, r20 ;; ld8 r18 = [r24] // time_interpolator->offset ld8 r8 = [r27],-IA64_TIMESPEC_TV_NSEC_OFFSET // xtime.tv_nsec (p13) sub r3 = r25,r2 // Diff needed before comparison (thanks davidm) ;; + ld8 r14 = [r14] // time_interpolator->mask (p13) cmp.gt.unc p6,p7 = r3,r0 // check if it is less than last. p6,p7 cleared sub r10 = r2,r26 // current_counter - last_counter ;; (p6) sub r10 = r25,r26 // time we got was less than last_cycle (p7) mov ar.ccv = r25 // more than last_cycle. Prep for cmpxchg + ;; + and r10 = r10,r14 // Apply mask ;; setf.sig f8 = r10 nop.i 123 @@ -609,9 +611,12 @@ GLOBAL_ENTRY(fsys_bubble_down) movl r2=ia64_ret_from_syscall ;; mov rp=r2 // set the real return addr - tbit.z p8,p0=r3,TIF_SYSCALL_TRACE + and r3=_TIF_SYSCALL_TRACEAUDIT,r3 + ;; + cmp.eq p8,p0=r3,r0 -(p8) br.call.sptk.many b6=b6 // ignore this return addr +(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8 +(p8) br.call.sptk.many b6=b6 // ignore this return addr br.cond.sptk ia64_trace_syscall END(fsys_bubble_down) diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S index a4dba3648..facf75acd 100644 --- a/arch/ia64/kernel/gate.S +++ b/arch/ia64/kernel/gate.S @@ -81,6 +81,7 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc) LOAD_FSYSCALL_TABLE(r14) mov r16=IA64_KR(CURRENT) // 12 cycle read latency + tnat.nz p10,p9=r15 mov r19=NR_syscalls-1 ;; shladd r18=r17,3,r14 @@ -119,7 +120,8 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc) #endif mov r10=-1 - mov r8=ENOSYS +(p10) mov r8=EINVAL +(p9) mov r8=ENOSYS FSYS_RETURN END(__kernel_syscall_via_epc) diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 0e821d0c3..105c7fec8 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S @@ -5,7 +5,7 @@ * to set up the kernel's global pointer and jump to the kernel * entry point. * - * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co + * Copyright (C) 1998-2001, 2003, 2005 Hewlett-Packard Co * David Mosberger-Tang * Stephane Eranian * Copyright (C) 1999 VA Linux Systems @@ -65,10 +65,27 @@ start_ap: ;; /* * Initialize kernel region registers: + * rr[0]: VHPT enabled, page size = PAGE_SHIFT + * rr[1]: VHPT enabled, page size = PAGE_SHIFT + * rr[2]: VHPT enabled, page size = PAGE_SHIFT + * rr[3]: VHPT enabled, page size = PAGE_SHIFT + * rr[4]: VHPT enabled, page size = PAGE_SHIFT * rr[5]: VHPT enabled, page size = PAGE_SHIFT * rr[6]: VHPT disabled, page size = IA64_GRANULE_SHIFT * rr[7]: VHPT disabled, page size = IA64_GRANULE_SHIFT + * We initialize all of them to prevent inadvertently assuming + * something about the state of address translation early in boot. */ + mov r6=((ia64_rid(IA64_REGION_ID_KERNEL, (0<<61)) << 8) | (PAGE_SHIFT << 2) | 1) + movl r7=(0<<61) + mov r8=((ia64_rid(IA64_REGION_ID_KERNEL, (1<<61)) << 8) | (PAGE_SHIFT << 2) | 1) + movl r9=(1<<61) + mov r10=((ia64_rid(IA64_REGION_ID_KERNEL, (2<<61)) << 8) | (PAGE_SHIFT << 2) | 1) + movl r11=(2<<61) + mov r12=((ia64_rid(IA64_REGION_ID_KERNEL, (3<<61)) << 8) | (PAGE_SHIFT << 2) | 1) + movl r13=(3<<61) + mov r14=((ia64_rid(IA64_REGION_ID_KERNEL, (4<<61)) << 8) | (PAGE_SHIFT << 2) | 1) + movl r15=(4<<61) mov r16=((ia64_rid(IA64_REGION_ID_KERNEL, (5<<61)) << 8) | (PAGE_SHIFT << 2) | 1) movl r17=(5<<61) mov r18=((ia64_rid(IA64_REGION_ID_KERNEL, (6<<61)) << 8) | (IA64_GRANULE_SHIFT << 2)) @@ -76,6 +93,11 @@ start_ap: mov r20=((ia64_rid(IA64_REGION_ID_KERNEL, (7<<61)) << 8) | (IA64_GRANULE_SHIFT << 2)) movl r21=(7<<61) ;; + mov rr[r7]=r6 + mov rr[r9]=r8 + mov rr[r11]=r10 + mov rr[r13]=r12 + mov rr[r15]=r14 mov rr[r17]=r16 mov rr[r19]=r18 mov rr[r21]=r20 @@ -210,21 +232,6 @@ start_ap: ;; (isBP) st8 [r2]=r28 // save the address of the boot param area passed by the bootloader -#ifdef CONFIG_IA64_EARLY_PRINTK - .rodata -alive_msg: - stringz "I'm alive and well\n" -alive_msg_end: - .previous - - alloc r2=ar.pfs,0,0,2,0 - movl out0=alive_msg - movl out1=alive_msg_end-alive_msg-1 - ;; - br.call.sptk.many rp=early_printk -1: // force new bundle -#endif /* CONFIG_IA64_EARLY_PRINTK */ - #ifdef CONFIG_SMP (isAP) br.call.sptk.many rp=start_secondary .ret0: @@ -245,7 +252,9 @@ alive_msg_end: ;; ld8 out0=[r3] br.call.sptk.many b0=console_print -self: br.sptk.many self // endless loop + +self: hint @pause + br.sptk.many self // endless loop END(_start) GLOBAL_ENTRY(ia64_save_debug_regs) @@ -949,6 +958,8 @@ GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4) (p14) br.cond.sptk.few .wait (p15) rsm psr.i // disable interrupts if we reenabled them br.cond.sptk.few b6 // lock is now free, try to acquire + .global ia64_spinlock_contention_pre3_4_end // for kernprof +ia64_spinlock_contention_pre3_4_end: END(ia64_spinlock_contention_pre3_4) #else diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index 605c4e92a..7bbf019c9 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c @@ -122,3 +122,6 @@ EXPORT_SYMBOL(ia64_spinlock_contention); # endif # endif #endif + +extern char ia64_ivt[]; +EXPORT_SYMBOL(ia64_ivt); diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 51548a8c5..111dad917 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c @@ -99,7 +99,7 @@ #define DBG(fmt...) #endif -static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(iosapic_lock); /* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */ @@ -111,6 +111,7 @@ static struct iosapic_intr_info { unsigned char dmode : 3; /* delivery mode (see iosapic.h) */ unsigned char polarity: 1; /* interrupt polarity (see iosapic.h) */ unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ + int refcnt; /* reference counter */ } iosapic_intr_info[IA64_NUM_VECTORS]; static struct iosapic { @@ -177,7 +178,7 @@ gsi_to_irq (unsigned int gsi) static void set_rte (unsigned int vector, unsigned int dest, int mask) { - unsigned long pol, trigger, dmode, flags; + unsigned long pol, trigger, dmode; u32 low32, high32; char __iomem *addr; int rte_index; @@ -218,13 +219,9 @@ set_rte (unsigned int vector, unsigned int dest, int mask) /* dest contains both id and eid */ high32 = (dest << IOSAPIC_DEST_SHIFT); - spin_lock_irqsave(&iosapic_lock, flags); - { - iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32); - iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); - iosapic_intr_info[vector].low32 = low32; - } - spin_unlock_irqrestore(&iosapic_lock, flags); + iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32); + iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); + iosapic_intr_info[vector].low32 = low32; } static void @@ -475,6 +472,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, iosapic_intr_info[vector].addr = iosapic_address; iosapic_intr_info[vector].gsi_base = gsi_base; iosapic_intr_info[vector].trigger = trigger; + iosapic_intr_info[vector].refcnt++; if (trigger == IOSAPIC_EDGE) irq_type = &irq_type_iosapic_edge; @@ -521,7 +519,12 @@ get_target_cpu (unsigned int gsi, int vector) goto skip_numa_setup; cpu_mask = node_to_cpumask(iosapic_lists[iosapic_index].node); - + + for_each_cpu_mask(numa_cpu, cpu_mask) { + if (!cpu_online(numa_cpu)) + cpu_clear(numa_cpu, cpu_mask); + } + num_cpus = cpus_weight(cpu_mask); if (!num_cpus) @@ -576,6 +579,7 @@ iosapic_register_intr (unsigned int gsi, { vector = gsi_to_vector(gsi); if (vector > 0) { + iosapic_intr_info[vector].refcnt++; spin_unlock_irqrestore(&iosapic_lock, flags); return vector; } @@ -584,6 +588,8 @@ iosapic_register_intr (unsigned int gsi, dest = get_target_cpu(gsi, vector); register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, polarity, trigger); + + set_rte(vector, dest, 1); } spin_unlock_irqrestore(&iosapic_lock, flags); @@ -592,10 +598,87 @@ iosapic_register_intr (unsigned int gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), cpu_logical_id(dest), dest, vector); - set_rte(vector, dest, 1); return vector; } +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void +iosapic_unregister_intr (unsigned int gsi) +{ + unsigned long flags; + int irq, vector; + irq_desc_t *idesc; + int rte_index; + unsigned long trigger, polarity; + + /* + * If the irq associated with the gsi is not found, + * iosapic_unregister_intr() is unbalanced. We need to check + * this again after getting locks. + */ + irq = gsi_to_irq(gsi); + if (irq < 0) { + printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); + WARN_ON(1); + return; + } + vector = irq_to_vector(irq); + + idesc = irq_descp(irq); + spin_lock_irqsave(&idesc->lock, flags); + spin_lock(&iosapic_lock); + { + rte_index = iosapic_intr_info[vector].rte_index; + if (rte_index < 0) { + spin_unlock(&iosapic_lock); + spin_unlock_irqrestore(&idesc->lock, flags); + printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); + WARN_ON(1); + return; + } + + if (--iosapic_intr_info[vector].refcnt > 0) { + spin_unlock(&iosapic_lock); + spin_unlock_irqrestore(&idesc->lock, flags); + return; + } + + /* + * If interrupt handlers still exist on the irq + * associated with the gsi, don't unregister the + * interrupt. + */ + if (idesc->action) { + iosapic_intr_info[vector].refcnt++; + spin_unlock(&iosapic_lock); + spin_unlock_irqrestore(&idesc->lock, flags); + printk(KERN_WARNING "Cannot unregister GSI. IRQ %u is still in use.\n", irq); + return; + } + + /* Clear the interrupt controller descriptor. */ + idesc->handler = &no_irq_type; + + trigger = iosapic_intr_info[vector].trigger; + polarity = iosapic_intr_info[vector].polarity; + + /* Clear the interrupt information. */ + memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); + iosapic_intr_info[vector].rte_index = -1; /* mark as unused */ + } + spin_unlock(&iosapic_lock); + spin_unlock_irqrestore(&idesc->lock, flags); + + /* Free the interrupt vector */ + free_irq_vector(vector); + + printk(KERN_INFO "GSI %u (%s, %s) -> vector %d unregisterd.\n", + gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), + (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), + vector); +} +#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ + /* * ACPI calls this when it finds an entry for a platform interrupt. * Note that the irq_base and IOSAPIC address must be set in iosapic_init(). diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index f779d97a4..4413e54b1 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c @@ -16,175 +16,47 @@ * architecture. */ -/* - * (mostly architecture independent, will move to kernel/irq.c in 2.5.) - * - * IRQs are in fact implemented a bit like signal handlers for the kernel. - * Naturally it's not a 1:1 relation, but there are similarities. - */ - -#include -#include +#include +#include #include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - /* - * Linux has a controller-independent x86 interrupt architecture. - * every controller has a 'controller-template', that is used - * by the main code to do the right thing. Each driver-visible - * interrupt source is transparently wired to the appropriate - * controller. Thus drivers need not be aware of the - * interrupt-controller. - * - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. - * (IO-APICs assumed to be messaging to Pentium local-APICs) - * - * the code is designed to be easily extended with new/different - * interrupt controllers, without having to do assembly magic. - */ - -/* - * Controller mappings for all interrupt sources: - */ -irq_desc_t _irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .status = IRQ_DISABLED, - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -#ifdef CONFIG_SMP -/* - * This is updated when the user sets irq affinity via /proc + * 'what should we do if we get a hw irq event on an illegal vector'. + * each architecture has to answer this themselves. */ -cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; -static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)]; -#endif - -#ifdef CONFIG_IA64_GENERIC -irq_desc_t * __ia64_irq_desc (unsigned int irq) +void ack_bad_irq(unsigned int irq) { - return _irq_desc + irq; -} - -ia64_vector __ia64_irq_to_vector (unsigned int irq) -{ - return (ia64_vector) irq; + printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); } +#ifdef CONFIG_IA64_GENERIC unsigned int __ia64_local_vector_to_irq (ia64_vector vec) { return (unsigned int) vec; } #endif -static void register_irq_proc (unsigned int irq); - -/* - * Special irq handlers. - */ - -irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) -{ return IRQ_NONE; } - /* - * Generic no controller code + * Interrupt statistics: */ -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) -{ -/* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. - */ -#ifdef CONFIG_X86 - printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq); -#ifdef CONFIG_X86_LOCAL_APIC - /* - * Currently unexpected vectors happen only on SMP and APIC. - * We _must_ ack these because every local APIC has only N - * irq slots per priority level, and a 'hanging, unacked' IRQ - * holds up an irq slot - in excessive cases (when multiple - * unexpected vectors occur) that might lock up the APIC - * completely. - */ - ack_APIC_irq(); -#endif -#endif -#ifdef CONFIG_IA64 - printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); -#endif -} - -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none - -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; - atomic_t irq_err_count; -#ifdef CONFIG_X86_IO_APIC -#ifdef APIC_MISMATCH_DEBUG -atomic_t irq_mis_count; -#endif -#endif /* - * Generic, controller-independent functions: + * /proc/interrupts printing: */ int show_interrupts(struct seq_file *p, void *v) { - int j, i = *(loff_t *) v; + int i = *(loff_t *) v, j; struct irqaction * action; - irq_desc_t *idesc; unsigned long flags; if (i == 0) { - seq_puts(p, " "); + seq_printf(p, " "); for (j=0; jlock, flags); - action = idesc->action; + spin_lock_irqsave(&irq_desc[i].lock, flags); + action = irq_desc[i].action; if (!action) goto skip; seq_printf(p, "%3d: ",i); @@ -205,7 +76,7 @@ int show_interrupts(struct seq_file *p, void *v) if (cpu_online(j)) seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); #endif - seq_printf(p, " %14s", idesc->handler->typename); + seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %s", action->name); for (action=action->next; action; action = action->next) @@ -213,733 +84,20 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); skip: - spin_unlock_irqrestore(&idesc->lock, flags); - } else if (i == NR_IRQS) { - seq_puts(p, "NMI: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", nmi_count(j)); - seq_putc(p, '\n'); -#ifdef CONFIG_X86_LOCAL_APIC - seq_puts(p, "LOC: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs); - seq_putc(p, '\n'); -#endif + spin_unlock_irqrestore(&irq_desc[i].lock, flags); + } else if (i == NR_IRQS) seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); -#ifdef CONFIG_X86_IO_APIC -#ifdef APIC_MISMATCH_DEBUG - seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); -#endif -#endif - } return 0; } #ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - while (irq_descp(irq)->status & IRQ_INPROGRESS) - cpu_relax(); -} -EXPORT_SYMBOL(synchronize_irq); -#endif - -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -int handle_IRQ_event(unsigned int irq, - struct pt_regs *regs, struct irqaction *action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - retval |= ret; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - return retval; -} - -static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - struct irqaction *action; - - if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { - printk(KERN_ERR "irq event %d: bogus return value %x\n", - irq, action_ret); - } else { - printk(KERN_ERR "irq %d: nobody cared!\n", irq); - } - dump_stack(); - printk(KERN_ERR "handlers:\n"); - action = desc->action; - do { - printk(KERN_ERR "[<%p>]", action->handler); - print_symbol(" (%s)", - (unsigned long)action->handler); - printk("\n"); - action = action->next; - } while (action); -} - -static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - static int count = 100; - - if (count) { - count--; - __report_bad_irq(irq, desc, action_ret); - } -} - -static int noirqdebug; - -static int __init noirqdebug_setup(char *str) -{ - noirqdebug = 1; - printk("IRQ lockup detection disabled\n"); - return 1; -} - -__setup("noirqdebug", noirqdebug_setup); - -/* - * If 99,900 of the previous 100,000 interrupts have not been handled then - * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to - * turn the IRQ off. - * - * (The other 100-of-100,000 interrupts may have been a correctly-functioning - * device sharing an IRQ with the failing one) - * - * Called under desc->lock - */ -static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; - if (action_ret != IRQ_NONE) - report_bad_irq(irq, desc, action_ret); - } - - desc->irq_count++; - if (desc->irq_count < 100000) - return; - - desc->irq_count = 0; - if (desc->irqs_unhandled > 99900) { - /* - * The interrupt is stuck - */ - __report_bad_irq(irq, desc, action_ret); - /* - * Now kill the IRQ - */ - printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - desc->irqs_unhandled = 0; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables and Enables are - * nested. - * Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_descp(irq); - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} -EXPORT_SYMBOL(disable_irq_nosync); - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Enables and Disables are - * nested. - * This function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_descp(irq); - - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} -EXPORT_SYMBOL(disable_irq); - -/** - * enable_irq - enable handling of an irq - * @irq: Interrupt to enable - * - * Undoes the effect of one call to disable_irq(). If this - * matches the last disable, processing of interrupts on this - * IRQ line is re-enabled. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_descp(irq); - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk(KERN_ERR "enable_irq(%u) unbalanced from %p\n", - irq, (void *) __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} -EXPORT_SYMBOL(enable_irq); - -/* - * do_IRQ handles all normal device IRQ's (the special - * SMP cross-CPU interrupts have their own specific - * handlers). - */ -unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs) -{ - /* - * We ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - irq_desc_t *desc = irq_descp(irq); - struct irqaction * action; - irqreturn_t action_ret; - unsigned int status; - int cpu; - - cpu = smp_processor_id(); /* for CONFIG_PREEMPT, this must come after irq_enter()! */ - - kstat_cpu(cpu).irqs[irq]++; - - if (desc->status & IRQ_PER_CPU) { - /* no locking required for CPU-local interrupts: */ - desc->handler->ack(irq); - action_ret = handle_IRQ_event(irq, regs, desc->action); - desc->handler->end(irq); - } else { - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - * REPLAY is when Linux resends an IRQ that was dropped earlier - * WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - * Since we set PENDING, if another processor is handling - * a different instance of this same irq, the other processor - * will take care of it. - */ - if (unlikely(!action)) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - spin_unlock(&desc->lock); - action_ret = handle_IRQ_event(irq, regs, action); - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (!(desc->status & IRQ_PENDING)) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; - out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->handler->end(irq); - spin_unlock(&desc->lock); - } - return 1; -} - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk(KERN_ERR "Bad boy: %s called us without a dev_id!\n", devname); - } -#endif - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_ATOMIC); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; -} - -EXPORT_SYMBOL(request_irq); - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function must not be called from interrupt context. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_descp(irq); - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk(KERN_ERR "Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - /* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - irq_desc_t *desc; - unsigned long val; - unsigned long delay; - - down(&probe_sem); - /* - * something may have generated an irq long ago and we want to - * flush such a longstanding irq before considering it as spurious. - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_descp(i); - - spin_lock_irq(&desc->lock); - if (!desc->action) - desc->handler->startup(i); - spin_unlock_irq(&desc->lock); - } - - /* Wait for longstanding interrupts to trigger. */ - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) - /* about 20ms delay */ barrier(); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_descp(i); - - spin_lock_irq(&desc->lock); - if (!desc->action) { - desc->status |= IRQ_AUTODETECT | IRQ_WAITING; - if (desc->handler->startup(i)) - desc->status |= IRQ_PENDING; - } - spin_unlock_irq(&desc->lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_descp(i); - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } else - if (i < 32) - val |= 1 << i; - } - spin_unlock_irq(&desc->lock); - } - - return val; -} - -EXPORT_SYMBOL(probe_irq_on); - -/** - * probe_irq_mask - scan a bitmap of interrupt lines - * @val: mask of interrupts to consider - * - * Scan the ISA bus interrupt lines and return a bitmap of - * active interrupts. The interrupt probe logic state is then - * returned to its previous value. - * - * Note: we need to scan all the irq's even though we will - * only return ISA irq numbers - just so that we reset them - * all to a known state. - */ -unsigned int probe_irq_mask(unsigned long val) -{ - int i; - unsigned int mask; - - mask = 0; - for (i = 0; i < 16; i++) { - irq_desc_t *desc = irq_descp(i); - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) - mask |= 1 << i; - - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - return mask & val; -} -EXPORT_SYMBOL(probe_irq_mask); - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * their is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldn't happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. + * This is updated when the user sets irq affinity via /proc */ - -int probe_irq_off(unsigned long val) -{ - int i, irq_found, nr_irqs; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_descp(i); - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_descp(irq); - - if (desc->handler == &no_irq_type) - return -ENOSYS; - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - if (new->flags & SA_PERCPU_IRQ) { - desc->status |= IRQ_PER_CPU; - desc->handler = &irq_type_ia64_lsapic; - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; - -#ifdef CONFIG_SMP - -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; +cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; +static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)]; static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; - static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 }; void set_irq_affinity_info (unsigned int irq, int hwid, int redir) @@ -954,79 +112,6 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir) } } -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = sprintf(page, "%s", irq_redir[(long)data] ? "r " : ""); - - len += cpumask_scnprintf(page+len, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - unsigned int irq = (unsigned long) data; - int full_count = count, err; - cpumask_t new_value, tmp; -# define R_PREFIX_LEN 16 - char rbuf[R_PREFIX_LEN]; - int rlen; - int prelen; - irq_desc_t *desc = irq_descp(irq); - unsigned long flags; - int redir = 0; - - if (!desc->handler->set_affinity) - return -EIO; - - /* - * If string being written starts with a prefix of 'r' or 'R' - * and some limited number of spaces, set IA64_IRQ_REDIRECTED. - * If more than (R_PREFIX_LEN - 2) spaces are passed, they won't - * all be trimmed as part of prelen, the untrimmed spaces will - * cause the hex parsing to fail, and this write() syscall will - * fail with EINVAL. - */ - - if (!count) - return -EINVAL; - rlen = min(sizeof(rbuf)-1, count); - if (copy_from_user(rbuf, buffer, rlen)) - return -EFAULT; - rbuf[rlen] = 0; - prelen = 0; - if (tolower(*rbuf) == 'r') { - prelen = strspn(rbuf, "Rr "); - redir++; - } - - err = cpumask_parse(buffer+prelen, count-prelen, new_value); - if (err) - return err; - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - spin_lock_irqsave(&desc->lock, flags); - pending_irq_cpumask[irq] = new_value; - if (redir) - set_bit(irq, pending_irq_redir); - else - clear_bit(irq, pending_irq_redir); - spin_unlock_irqrestore(&desc->lock, flags); - - return full_count; -} void move_irq(int irq) { @@ -1035,6 +120,9 @@ void move_irq(int irq) irq_desc_t *desc = irq_descp(irq); int redir = test_bit(irq, pending_irq_redir); + if (unlikely(!desc->handler->set_affinity)) + return; + if (!cpus_empty(pending_irq_cpumask[irq])) { cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); if (unlikely(!cpus_empty(tmp))) { @@ -1126,7 +214,7 @@ void fixup_irqs(void) for (irq=0; irq < NR_IRQS; irq++) { if (vectors_in_migration[irq]) { vectors_in_migration[irq]=0; - do_IRQ(irq, NULL); + __do_IRQ(irq, NULL); } } @@ -1140,57 +228,3 @@ void fixup_irqs(void) local_irq_disable(); } #endif - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_descp(irq)->handler == &no_irq_type) || irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - -#ifdef CONFIG_SMP - { - struct proc_dir_entry *entry; - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; - } -#endif -} - -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) { - if (irq_descp(i)->handler == &no_irq_type) - continue; - register_irq_proc(i); - } -} diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 335d827ce..5ba06ebe3 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c @@ -30,8 +30,8 @@ #include #include #include +#include -#include #include #include #include @@ -60,33 +60,35 @@ __u8 isa_irq_to_vector_map[16] = { }; EXPORT_SYMBOL(isa_irq_to_vector_map); -static inline void -irq_enter (void) -{ - preempt_count() += HARDIRQ_OFFSET; -} - -static inline void -irq_exit (void) -{ - preempt_count() -= IRQ_EXIT_OFFSET; - if (!in_interrupt() && local_softirq_pending()) - do_softirq(); - preempt_enable_no_resched(); -} +static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; int assign_irq_vector (int irq) { - static int next_vector = IA64_FIRST_DEVICE_VECTOR; - - if (next_vector > IA64_LAST_DEVICE_VECTOR) + int pos, vector; + again: + pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS); + vector = IA64_FIRST_DEVICE_VECTOR + pos; + if (vector > IA64_LAST_DEVICE_VECTOR) /* XXX could look for sharable vectors instead of panic'ing... */ panic("assign_irq_vector: out of interrupt vectors!"); - return next_vector++; + if (test_and_set_bit(pos, ia64_vector_mask)) + goto again; + return vector; } -extern unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs); +void +free_irq_vector (int vector) +{ + int pos; + + if (vector < IA64_FIRST_DEVICE_VECTOR || vector > IA64_LAST_DEVICE_VECTOR) + return; + + pos = vector - IA64_FIRST_DEVICE_VECTOR; + if (!test_and_clear_bit(pos, ia64_vector_mask)) + printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); +} #ifdef CONFIG_SMP # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) @@ -115,7 +117,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) * switched atomically. */ bsp = ia64_getreg(_IA64_REG_AR_BSP); - sp = ia64_getreg(_IA64_REG_AR_SP); + sp = ia64_getreg(_IA64_REG_SP); if ((sp - bsp) < 1024) { static unsigned char count; @@ -146,7 +148,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) ia64_setreg(_IA64_REG_CR_TPR, vector); ia64_srlz_d(); - do_IRQ(local_vector_to_irq(vector), regs); + __do_IRQ(local_vector_to_irq(vector), regs); /* * Disable interrupts and send EOI: @@ -197,7 +199,7 @@ void ia64_process_pending_intr(void) * Probably could shared code. */ vectors_in_migration[local_vector_to_irq(vector)]=0; - do_IRQ(local_vector_to_irq(vector), NULL); + __do_IRQ(local_vector_to_irq(vector), NULL); /* * Disable interrupts and send EOI diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 0834c7bcb..b3ed949a4 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S @@ -51,6 +51,7 @@ #include #include #include +#include #if 1 # define PSR_DEFAULT_BITS psr.ac @@ -547,7 +548,7 @@ ENTRY(dirty_bit) #endif mov pr=r31,-1 // restore pr rfi -END(idirty_bit) +END(dirty_bit) .org ia64_ivt+0x2400 ///////////////////////////////////////////////////////////////////////////////////////// @@ -732,10 +733,12 @@ ENTRY(break_fault) ssm psr.ic | PSR_DEFAULT_BITS ;; srlz.i // guarantee that interruption collection is on + mov r3=NR_syscalls - 1 ;; (p15) ssm psr.i // restore psr.i + // p10==true means out registers are more than 8 or r15's Nat is true +(p10) br.cond.spnt.many ia64_ret_from_syscall ;; - mov r3=NR_syscalls - 1 movl r16=sys_call_table adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 @@ -836,8 +839,11 @@ END(interrupt) * On exit: * - executing on bank 1 registers * - psr.ic enabled, interrupts restored + * - p10: TRUE if syscall is invoked with more than 8 out + * registers or r15's Nat is true * - r1: kernel's gp * - r3: preserved (same as on entry) + * - r8: -EINVAL if p10 is true * - r12: points to kernel stack * - r13: points to current task * - p15: TRUE if interrupts need to be re-enabled @@ -852,7 +858,7 @@ GLOBAL_ENTRY(ia64_syscall_setup) add r17=PT(R11),r1 // initialize second base pointer ;; alloc r19=ar.pfs,8,0,0,0 // ensure in0-in7 are writable - st8 [r16]=r29,PT(CR_IFS)-PT(CR_IPSR) // save cr.ipsr + st8 [r16]=r29,PT(AR_PFS)-PT(CR_IPSR) // save cr.ipsr tnat.nz p8,p0=in0 st8.spill [r17]=r11,PT(CR_IIP)-PT(R11) // save r11 @@ -860,31 +866,36 @@ GLOBAL_ENTRY(ia64_syscall_setup) (pKStk) mov r18=r0 // make sure r18 isn't NaT ;; + st8 [r16]=r26,PT(CR_IFS)-PT(AR_PFS) // save ar.pfs st8 [r17]=r28,PT(AR_UNAT)-PT(CR_IIP) // save cr.iip mov r28=b0 // save b0 (2 cyc) -(p8) mov in0=-1 ;; - st8 [r16]=r0,PT(AR_PFS)-PT(CR_IFS) // clear cr.ifs st8 [r17]=r25,PT(AR_RSC)-PT(AR_UNAT) // save ar.unat -(p9) mov in1=-1 + dep r19=0,r19,38,26 // clear all bits but 0..37 [I0] +(p8) mov in0=-1 ;; - st8 [r16]=r26,PT(AR_RNAT)-PT(AR_PFS) // save ar.pfs + st8 [r16]=r19,PT(AR_RNAT)-PT(CR_IFS) // store ar.pfs.pfm in cr.ifs + extr.u r11=r19,7,7 // I0 // get sol of ar.pfs + and r8=0x7f,r19 // A // get sof of ar.pfs + st8 [r17]=r27,PT(AR_BSPSTORE)-PT(AR_RSC)// save ar.rsc - tnat.nz p10,p0=in2 + tbit.nz p15,p0=r29,IA64_PSR_I_BIT // I0 +(p9) mov in1=-1 + ;; (pUStk) sub r18=r18,r22 // r18=RSE.ndirty*8 - tbit.nz p15,p0=r29,IA64_PSR_I_BIT - tnat.nz p11,p0=in3 + tnat.nz p10,p0=in2 + add r11=8,r11 ;; (pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16 // skip over ar_rnat field (pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17 // skip over ar_bspstore field + tnat.nz p11,p0=in3 + ;; (p10) mov in2=-1 - + tnat.nz p12,p0=in4 // [I0] (p11) mov in3=-1 - tnat.nz p12,p0=in4 - tnat.nz p13,p0=in5 ;; (pUStk) st8 [r16]=r24,PT(PR)-PT(AR_RNAT) // save ar.rnat (pUStk) st8 [r17]=r23,PT(B0)-PT(AR_BSPSTORE) // save ar.bspstore @@ -892,36 +903,41 @@ GLOBAL_ENTRY(ia64_syscall_setup) ;; st8 [r16]=r31,PT(LOADRS)-PT(PR) // save predicates st8 [r17]=r28,PT(R1)-PT(B0) // save b0 -(p12) mov in4=-1 + tnat.nz p13,p0=in5 // [I0] ;; st8 [r16]=r18,PT(R12)-PT(LOADRS) // save ar.rsc value for "loadrs" st8.spill [r17]=r20,PT(R13)-PT(R1) // save original r1 -(p13) mov in5=-1 +(p12) mov in4=-1 ;; .mem.offset 0,0; st8.spill [r16]=r12,PT(AR_FPSR)-PT(R12) // save r12 .mem.offset 8,0; st8.spill [r17]=r13,PT(R15)-PT(R13) // save r13 - tnat.nz p14,p0=in6 +(p13) mov in5=-1 ;; st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr - st8.spill [r17]=r15 // save r15 - tnat.nz p8,p0=in7 + tnat.nz p14,p0=in6 + cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8 ;; stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error) +(p9) tnat.nz p10,p0=r15 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch) -(p14) mov in6=-1 + + st8.spill [r17]=r15 // save r15 + tnat.nz p8,p0=in7 + nop.i 0 mov r13=r2 // establish `current' movl r1=__gp // establish kernel global pointer ;; +(p14) mov in6=-1 (p8) mov in7=-1 - tnat.nz p9,p0=r15 + nop.i 0 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0 movl r17=FPSR_DEFAULT ;; mov.m ar.fpsr=r17 // set ar.fpsr to kernel default value -(p9) mov r15=-1 +(p10) mov r8=-EINVAL br.ret.sptk.many b7 END(ia64_syscall_setup) diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index aa76ea054..4d6c7b8f6 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -85,12 +86,13 @@ /* Used by mca_asm.S */ ia64_mca_sal_to_os_state_t ia64_sal_to_os_handoff_state; ia64_mca_os_to_sal_state_t ia64_os_to_sal_handoff_state; -u64 ia64_mca_proc_state_dump[512]; -u64 ia64_mca_stack[1024] __attribute__((aligned(16))); -u64 ia64_mca_stackframe[32]; -u64 ia64_mca_bspstore[1024]; -u64 ia64_init_stack[KERNEL_STACK_SIZE/8] __attribute__((aligned(16))); u64 ia64_mca_serialize; +DEFINE_PER_CPU(u64, ia64_mca_data); /* == __per_cpu_mca[smp_processor_id()] */ +DEFINE_PER_CPU(u64, ia64_mca_per_cpu_pte); /* PTE to map per-CPU area */ +DEFINE_PER_CPU(u64, ia64_mca_pal_pte); /* PTE to map PAL code */ +DEFINE_PER_CPU(u64, ia64_mca_pal_base); /* vaddr PAL code granule */ + +unsigned long __per_cpu_mca[NR_CPUS]; /* In mca_asm.S */ extern void ia64_monarch_init_handler (void); @@ -98,8 +100,6 @@ extern void ia64_slave_init_handler (void); static ia64_mc_info_t ia64_mc_info; -struct ia64_mca_tlb_info ia64_mca_tlb_list[NR_CPUS]; - #define MAX_CPE_POLL_INTERVAL (15*60*HZ) /* 15 minutes */ #define MIN_CPE_POLL_INTERVAL (2*60*HZ) /* 2 minutes */ #define CMC_POLL_INTERVAL (1*60*HZ) /* 1 minute */ @@ -240,6 +240,7 @@ static void ia64_mca_log_sal_error_record(int sal_info_type) { u8 *buffer; + sal_log_record_header_t *rh; u64 size; int irq_safe = sal_info_type != SAL_INFO_TYPE_MCA && sal_info_type != SAL_INFO_TYPE_INIT; #ifdef IA64_MCA_DEBUG_INFO @@ -258,7 +259,8 @@ ia64_mca_log_sal_error_record(int sal_info_type) sal_info_type < ARRAY_SIZE(rec_name) ? rec_name[sal_info_type] : "UNKNOWN"); /* Clear logs from corrected errors in case there's no user-level logger */ - if (sal_info_type == SAL_INFO_TYPE_CPE || sal_info_type == SAL_INFO_TYPE_CMC) + rh = (sal_log_record_header_t *)buffer; + if (rh->severity == sal_log_severity_corrected) ia64_sal_clear_state_info(sal_info_type); } @@ -276,7 +278,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) { static unsigned long cpe_history[CPE_HISTORY_LENGTH]; static int index; - static spinlock_t cpe_history_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(cpe_history_lock); IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n", __FUNCTION__, cpe_irq, smp_processor_id()); @@ -593,7 +595,7 @@ ia64_mca_cmc_vector_disable (void *dummy) { cmcv_reg_t cmcv; - cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV); + cmcv.cmcv_regval = ia64_getreg(_IA64_REG_CR_CMCV); cmcv.cmcv_mask = 1; /* Mask/disable interrupt */ ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); @@ -620,7 +622,7 @@ ia64_mca_cmc_vector_enable (void *dummy) { cmcv_reg_t cmcv; - cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV); + cmcv.cmcv_regval = ia64_getreg(_IA64_REG_CR_CMCV); cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); @@ -686,6 +688,7 @@ ia64_mca_wakeup_ipi_wait(void) irr = ia64_getreg(_IA64_REG_CR_IRR3); break; } + cpu_relax(); } while (!(irr & (1UL << irr_bit))) ; } @@ -886,6 +889,11 @@ ia64_mca_ucmc_handler(void) &ia64_sal_to_os_handoff_state, &ia64_os_to_sal_handoff_state)); + if (recover) { + sal_log_record_header_t *rh = IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA); + rh->severity = sal_log_severity_corrected; + ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA); + } /* * Wakeup all the processors which are spinning in the rendezvous * loop. @@ -919,7 +927,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs) { static unsigned long cmc_history[CMC_HISTORY_LENGTH]; static int index; - static spinlock_t cmc_history_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(cmc_history_lock); IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n", __FUNCTION__, cmc_irq, smp_processor_id()); @@ -1132,6 +1140,7 @@ ia64_init_handler (struct pt_regs *pt, struct switch_stack *sw) pal_min_state_area_t *ms; oops_in_progress = 1; /* avoid deadlock in printk, but it makes recovery dodgy */ + console_loglevel = 15; /* make sure printks make it to console */ printk(KERN_INFO "Entered OS INIT handler. PSP=%lx\n", ia64_sal_to_os_handoff_state.proc_state_param); @@ -1193,6 +1202,53 @@ static struct irqaction mca_cpep_irqaction = { }; #endif /* CONFIG_ACPI */ +/* Do per-CPU MCA-related initialization. */ + +void __devinit +ia64_mca_cpu_init(void *cpu_data) +{ + void *pal_vaddr; + + if (smp_processor_id() == 0) { + void *mca_data; + int cpu; + + mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu) + * NR_CPUS); + for (cpu = 0; cpu < NR_CPUS; cpu++) { + __per_cpu_mca[cpu] = __pa(mca_data); + mca_data += sizeof(struct ia64_mca_cpu); + } + } + + /* + * The MCA info structure was allocated earlier and its + * physical address saved in __per_cpu_mca[cpu]. Copy that + * address * to ia64_mca_data so we can access it as a per-CPU + * variable. + */ + __get_cpu_var(ia64_mca_data) = __per_cpu_mca[smp_processor_id()]; + + /* + * Stash away a copy of the PTE needed to map the per-CPU page. + * We may need it during MCA recovery. + */ + __get_cpu_var(ia64_mca_per_cpu_pte) = + pte_val(mk_pte_phys(__pa(cpu_data), PAGE_KERNEL)); + + /* + * Also, stash away a copy of the PAL address and the PTE + * needed to map it. + */ + pal_vaddr = efi_get_pal_addr(); + if (!pal_vaddr) + return; + __get_cpu_var(ia64_mca_pal_base) = + GRANULEROUNDDOWN((unsigned long) pal_vaddr); + __get_cpu_var(ia64_mca_pal_pte) = pte_val(mk_pte_phys(__pa(pal_vaddr), + PAGE_KERNEL)); +} + /* * ia64_mca_init * diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S index b5026aa81..cf3f8014f 100644 --- a/arch/ia64/kernel/mca_asm.S +++ b/arch/ia64/kernel/mca_asm.S @@ -13,6 +13,9 @@ // 2. Restore current thread pointer to kr6 // 3. Move stack ptr 16 bytes to conform to C calling convention // +// 04/11/12 Russ Anderson +// Added per cpu MCA/INIT stack save areas. +// #include #include @@ -98,15 +101,15 @@ ld8 tmp=[sal_to_os_handoff];; \ st8 [os_to_sal_handoff]=tmp;; +#define GET_IA64_MCA_DATA(reg) \ + GET_THIS_PADDR(reg, ia64_mca_data) \ + ;; \ + ld8 reg=[reg] + .global ia64_os_mca_dispatch .global ia64_os_mca_dispatch_end .global ia64_sal_to_os_handoff_state .global ia64_os_to_sal_handoff_state - .global ia64_mca_proc_state_dump - .global ia64_mca_stack - .global ia64_mca_stackframe - .global ia64_mca_bspstore - .global ia64_init_stack .text .align 16 @@ -146,36 +149,26 @@ ia64_os_mca_done_dump: // The following code purges TC and TR entries. Then reload all TC entries. // Purge percpu data TC entries. begin_tlb_purge_and_reload: - mov r16=cr.lid - LOAD_PHYSICAL(p0,r17,ia64_mca_tlb_list) // Physical address of ia64_mca_tlb_list - mov r19=0 - mov r20=NR_CPUS - ;; -1: cmp.eq p6,p7=r19,r20 -(p6) br.spnt.few err - ld8 r18=[r17],IA64_MCA_TLB_INFO_SIZE - ;; - add r19=1,r19 - cmp.eq p6,p7=r18,r16 -(p7) br.sptk.few 1b - ;; - adds r17=-IA64_MCA_TLB_INFO_SIZE,r17 - ;; - mov r23=r17 // save current ia64_mca_percpu_info addr pointer. - adds r17=16,r17 + +#define O(member) IA64_CPUINFO_##member##_OFFSET + + GET_THIS_PADDR(r2, cpu_info) // load phys addr of cpu_info into r2 ;; - ld8 r18=[r17],8 // r18=ptce_base - ;; - ld4 r19=[r17],4 // r19=ptce_count[0] + addl r17=O(PTCE_STRIDE),r2 + addl r2=O(PTCE_BASE),r2 ;; - ld4 r20=[r17],4 // r20=ptce_count[1] + ld8 r18=[r2],(O(PTCE_COUNT)-O(PTCE_BASE));; // r18=ptce_base + ld4 r19=[r2],4 // r19=ptce_count[0] + ld4 r21=[r17],4 // r21=ptce_stride[0] ;; - ld4 r21=[r17],4 // r21=ptce_stride[0] + ld4 r20=[r2] // r20=ptce_count[1] + ld4 r22=[r17] // r22=ptce_stride[1] mov r24=0 ;; - ld4 r22=[r17],4 // r22=ptce_stride[1] adds r20=-1,r20 ;; +#undef O + 2: cmp.ltu p6,p7=r24,r19 (p7) br.cond.dpnt.few 4f @@ -215,9 +208,9 @@ begin_tlb_purge_and_reload: srlz.d ;; // 3. Purge ITR for PAL code. - adds r17=48,r23 + GET_THIS_PADDR(r2, ia64_mca_pal_base) ;; - ld8 r16=[r17] + ld8 r16=[r2] mov r18=IA64_GRANULE_SHIFT<<2 ;; ptr.i r16,r18 @@ -260,14 +253,15 @@ begin_tlb_purge_and_reload: srlz.d ;; // 2. Reload DTR register for PERCPU data. - adds r17=8,r23 + GET_THIS_PADDR(r2, ia64_mca_per_cpu_pte) + ;; movl r16=PERCPU_ADDR // vaddr movl r18=PERCPU_PAGE_SHIFT<<2 ;; mov cr.itir=r18 mov cr.ifa=r16 ;; - ld8 r18=[r17] // pte + ld8 r18=[r2] // load per-CPU PTE mov r16=IA64_TR_PERCPU_DATA; ;; itr.d dtr[r16]=r18 @@ -275,11 +269,13 @@ begin_tlb_purge_and_reload: srlz.d ;; // 3. Reload ITR for PAL code. - adds r17=40,r23 + GET_THIS_PADDR(r2, ia64_mca_pal_pte) + ;; + ld8 r18=[r2] // load PAL PTE ;; - ld8 r18=[r17],8 // pte + GET_THIS_PADDR(r2, ia64_mca_pal_base) ;; - ld8 r16=[r17] // vaddr + ld8 r16=[r2] // load PAL vaddr mov r19=IA64_GRANULE_SHIFT<<2 ;; mov cr.itir=r19 @@ -318,17 +314,18 @@ err: done_tlb_purge_and_reload: // Setup new stack frame for OS_MCA handling - movl r2=ia64_mca_bspstore;; // local bspstore area location in r2 - DATA_VA_TO_PA(r2);; - movl r3=ia64_mca_stackframe;; // save stack frame to memory in r3 - DATA_VA_TO_PA(r3);; + GET_IA64_MCA_DATA(r2) + ;; + add r3 = IA64_MCA_CPU_STACKFRAME_OFFSET, r2 + add r2 = IA64_MCA_CPU_RBSTORE_OFFSET, r2 + ;; rse_switch_context(r6,r3,r2);; // RSC management in this new context - movl r12=ia64_mca_stack - mov r2=8*1024;; // stack size must be same as C array - add r12=r2,r12;; // stack base @ bottom of array - adds r12=-16,r12;; // allow 16 bytes of scratch - // (C calling convention) - DATA_VA_TO_PA(r12);; + + GET_IA64_MCA_DATA(r2) + ;; + add r2 = IA64_MCA_CPU_STACK_OFFSET+IA64_MCA_STACK_SIZE-16, r2 + ;; + mov r12=r2 // establish new stack-pointer // Enter virtual mode from physical mode VIRTUAL_MODE_ENTER(r2, r3, ia64_os_mca_virtual_begin, r4) @@ -344,9 +341,10 @@ ia64_os_mca_virtual_begin: ia64_os_mca_virtual_end: // restore the original stack frame here - movl r2=ia64_mca_stackframe // restore stack frame from memory at r2 + GET_IA64_MCA_DATA(r2) + ;; + add r2 = IA64_MCA_CPU_STACKFRAME_OFFSET, r2 ;; - DATA_VA_TO_PA(r2) movl r4=IA64_PSR_MC ;; rse_return_context(r4,r3,r2) // switch from interrupt context for RSE @@ -387,8 +385,10 @@ ia64_os_mca_dispatch_end: ia64_os_mca_proc_state_dump: // Save bank 1 GRs 16-31 which will be used by c-language code when we switch // to virtual addressing mode. - LOAD_PHYSICAL(p0,r2,ia64_mca_proc_state_dump)// convert OS state dump area to physical address - + GET_IA64_MCA_DATA(r2) + ;; + add r2 = IA64_MCA_CPU_PROC_STATE_DUMP_OFFSET, r2 + ;; // save ar.NaT mov r5=ar.unat // ar.unat @@ -618,9 +618,9 @@ end_os_mca_dump: ia64_os_mca_proc_state_restore: // Restore bank1 GR16-31 - movl r2=ia64_mca_proc_state_dump // Convert virtual address - ;; // of OS state dump area - DATA_VA_TO_PA(r2) // to physical address + GET_IA64_MCA_DATA(r2) + ;; + add r2 = IA64_MCA_CPU_PROC_STATE_DUMP_OFFSET, r2 restore_GRs: // restore bank-1 GRs 16-31 bsw.1;; @@ -868,7 +868,7 @@ end_os_mca_restore: GLOBAL_ENTRY(ia64_monarch_init_handler) - + .prologue // stash the information the SAL passed to os SAL_TO_OS_MCA_HANDOFF_STATE_SAVE(r2) ;; @@ -907,6 +907,7 @@ IVirtual_Switch: adds out0=16,sp // out0 = pointer to pt_regs ;; DO_SAVE_SWITCH_STACK + .body adds out1=16,sp // out0 = pointer to switch_stack br.call.sptk.many rp=ia64_init_handler diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 90ed84b72..ab478172c 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c @@ -45,14 +45,14 @@ static ia64_mca_os_to_sal_state_t *os_to_sal_handoff_state; /* from mca_drv_asm.S */ extern void *mca_handler_bhhook(void); -static spinlock_t mca_bh_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mca_bh_lock); typedef enum { MCA_IS_LOCAL = 0, MCA_IS_GLOBAL = 1 } mca_type_t; -#define MAX_PAGE_ISOLATE 32 +#define MAX_PAGE_ISOLATE 1024 static struct page *page_isolate[MAX_PAGE_ISOLATE]; static int num_page_isolate = 0; diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h index b1460dcc3..a01c2cd06 100644 --- a/arch/ia64/kernel/minstate.h +++ b/arch/ia64/kernel/minstate.h @@ -37,12 +37,15 @@ * go virtual and don't want to destroy the iip or ipsr. */ #define MINSTATE_START_SAVE_MIN_PHYS \ -(pKStk) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \ +(pKStk) mov r3=IA64_KR(PER_CPU_DATA);; \ +(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \ +(pKStk) ld8 r3 = [r3];; \ +(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \ +(pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \ (pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ (pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ ;; \ (pUStk) mov r24=ar.rnat; \ -(pKStk) tpa r1=sp; /* compute physical addr of sp */ \ (pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ (pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \ (pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \ diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 99b16dacf..7cfb6921d 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -5,13 +5,13 @@ * The initial version of perfmon.c was written by * Ganesh Venkitachalam, IBM Corp. * - * Then it was modified for perfmon-1.x by Stephane Eranian and + * Then it was modified for perfmon-1.x by Stephane Eranian and * David Mosberger, Hewlett Packard Co. - * + * * Version Perfmon-2.x is a rewrite of perfmon-1.x - * by Stephane Eranian, Hewlett Packard Co. + * by Stephane Eranian, Hewlett Packard Co. * - * Copyright (C) 1999-2003 Hewlett Packard Co + * Copyright (C) 1999-2003, 2005 Hewlett Packard Co * Stephane Eranian * David Mosberger-Tang * @@ -38,10 +38,10 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -574,12 +574,6 @@ pfm_unreserve_page(unsigned long a) ClearPageReserved(vmalloc_to_page((void*)a)); } -static inline int -pfm_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long phys_addr, unsigned long size, pgprot_t prot) -{ - return remap_page_range(vma, from, phys_addr, size, prot); -} - static inline unsigned long pfm_protect_ctx_ctxsw(pfm_context_t *x) { @@ -807,18 +801,6 @@ pfm_reset_msgq(pfm_context_t *ctx) DPRINT(("ctx=%p msgq reset\n", ctx)); } - -/* Here we want the physical address of the memory. - * This is used when initializing the contents of the - * area and marking the pages as reserved. - */ -static inline unsigned long -pfm_kvirt_to_pa(unsigned long adr) -{ - __u64 pa = ia64_tpa(adr); - return pa; -} - static void * pfm_rvmalloc(unsigned long size) { @@ -1658,7 +1640,7 @@ pfm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned lon } /* - * context is locked when coming here and interrupts are disabled + * interrupt cannot be masked when coming here */ static inline int pfm_do_fasync(int fd, struct file *filp, pfm_context_t *ctx, int on) @@ -2018,7 +2000,7 @@ pfm_close(struct inode *inode, struct file *filp) /* * XXX: check for signals : - * - ok of explicit close + * - ok for explicit close * - not ok when coming from exit_files() */ schedule(); @@ -2180,9 +2162,7 @@ pfm_alloc_fd(struct file **cfile) DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode)); - inode->i_sb = pfmfs_mnt->mnt_sb; inode->i_mode = S_IFCHR|S_IRUGO; - inode->i_sock = 0; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; @@ -2246,14 +2226,14 @@ pfm_free_fd(int fd, struct file *file) static int pfm_remap_buffer(struct vm_area_struct *vma, unsigned long buf, unsigned long addr, unsigned long size) { - unsigned long page; - DPRINT(("CPU%d buf=0x%lx addr=0x%lx size=%ld\n", smp_processor_id(), buf, addr, size)); while (size > 0) { - page = pfm_kvirt_to_pa(buf); + unsigned long pfn = ia64_tpa(buf) >> PAGE_SHIFT; + - if (pfm_remap_page_range(vma, addr, page, PAGE_SIZE, PAGE_READONLY)) return -ENOMEM; + if (remap_pfn_range(vma, addr, pfn, PAGE_SIZE, PAGE_READONLY)) + return -ENOMEM; addr += PAGE_SIZE; buf += PAGE_SIZE; @@ -2289,7 +2269,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon * if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur) * return -ENOMEM; */ - if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -ENOMEM; + if (size > task->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) + return -ENOMEM; /* * We do the easy to undo allocations first. @@ -2314,10 +2295,6 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon /* * partially initialize the vma for the sampling buffer - * - * The VM_DONTCOPY flag is very important as it ensures that the mapping - * will never be inherited for any child process (via fork()) which is always - * what we want. */ vma->vm_mm = mm; vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED; @@ -2347,6 +2324,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon goto error; } vma->vm_end = vma->vm_start + size; + vma->vm_pgoff = vma->vm_start >> PAGE_SHIFT; DPRINT(("aligned size=%ld, hdr=%p mapped @0x%lx\n", size, ctx->ctx_smpl_hdr, vma->vm_start)); @@ -2595,7 +2573,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task) return -EINVAL; } - if (task->state == TASK_ZOMBIE) { + if (task->exit_state == EXIT_ZOMBIE) { DPRINT(("cannot attach to zombie task [%d]\n", task->pid)); return -EBUSY; } @@ -3080,11 +3058,12 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) #endif } - DPRINT(("pmc[%u]=0x%lx loaded=%d access_pmu=%d all_pmcs=0x%lx used_pmds=0x%lx eventid=%ld smpl_pmds=0x%lx reset_pmds=0x%lx reloads_pmcs=0x%lx used_monitors=0x%lx ovfl_regs=0x%lx\n", + DPRINT(("pmc[%u]=0x%lx ld=%d apmu=%d flags=0x%x all_pmcs=0x%lx used_pmds=0x%lx eventid=%ld smpl_pmds=0x%lx reset_pmds=0x%lx reloads_pmcs=0x%lx used_monitors=0x%lx ovfl_regs=0x%lx\n", cnum, value, is_loaded, can_access_pmu, + flags, ctx->ctx_all_pmcs[0], ctx->ctx_used_pmds[0], ctx->ctx_pmds[cnum].eventid, @@ -3260,8 +3239,8 @@ pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) } } - DPRINT(("pmd[%u]=0x%lx loaded=%d access_pmu=%d, hw_value=0x%lx ctx_pmd=0x%lx short_reset=0x%lx " - "long_reset=0x%lx notify=%c used_pmds=0x%lx reset_pmds=0x%lx reload_pmds=0x%lx all_pmds=0x%lx ovfl_regs=0x%lx\n", + DPRINT(("pmd[%u]=0x%lx ld=%d apmu=%d, hw_value=0x%lx ctx_pmd=0x%lx short_reset=0x%lx " + "long_reset=0x%lx notify=%c seed=0x%lx mask=0x%lx used_pmds=0x%lx reset_pmds=0x%lx reload_pmds=0x%lx all_pmds=0x%lx ovfl_regs=0x%lx\n", cnum, value, is_loaded, @@ -3271,6 +3250,8 @@ pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) ctx->ctx_pmds[cnum].short_reset, ctx->ctx_pmds[cnum].long_reset, PMC_OVFL_NOTIFY(ctx, cnum) ? 'Y':'N', + ctx->ctx_pmds[cnum].seed, + ctx->ctx_pmds[cnum].mask, ctx->ctx_used_pmds[0], ctx->ctx_pmds[cnum].reset_pmds[0], ctx->ctx_reload_pmds[0], @@ -3348,7 +3329,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) } expert_mode = pfm_sysctl.expert_mode; - DPRINT(("loaded=%d access_pmu=%d ctx_state=%d\n", + DPRINT(("ld=%d apmu=%d ctx_state=%d\n", is_loaded, can_access_pmu, state)); @@ -3888,7 +3869,7 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_ ctx->ctx_ibrs[rnum] = dbreg.val; - DPRINT(("write ibr%u=0x%lx used_ibrs=0x%x is_loaded=%d access_pmu=%d\n", + DPRINT(("write ibr%u=0x%lx used_ibrs=0x%x ld=%d apmu=%d\n", rnum, dbreg.val, ctx->ctx_used_ibrs[0], is_loaded, can_access_pmu)); } else { CTX_USED_DBR(ctx, rnum); @@ -3899,7 +3880,7 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_ } ctx->ctx_dbrs[rnum] = dbreg.val; - DPRINT(("write dbr%u=0x%lx used_dbrs=0x%x is_loaded=%d access_pmu=%d\n", + DPRINT(("write dbr%u=0x%lx used_dbrs=0x%x ld=%d apmu=%d\n", rnum, dbreg.val, ctx->ctx_used_dbrs[0], is_loaded, can_access_pmu)); } } @@ -4800,10 +4781,8 @@ recheck: * system-call entry point (must return long) */ asmlinkage long -sys_perfmonctl (int fd, int cmd, void __user *arg, int count, long arg5, long arg6, long arg7, - long arg8, long stack) +sys_perfmonctl (int fd, int cmd, void __user *arg, int count) { - struct pt_regs *regs = (struct pt_regs *)&stack; struct file *file = NULL; pfm_context_t *ctx = NULL; unsigned long flags = 0UL; @@ -4927,7 +4906,7 @@ restart_args: if (unlikely(ret)) goto abort_locked; skip_fd: - ret = (*func)(ctx, args_k, count, regs); + ret = (*func)(ctx, args_k, count, ia64_task_regs(current)); call_made = 1; @@ -4998,26 +4977,14 @@ pfm_resume_after_ovfl(pfm_context_t *ctx, unsigned long ovfl_regs, struct pt_reg static void pfm_context_force_terminate(pfm_context_t *ctx, struct pt_regs *regs) { - if (ctx->ctx_fl_system) { - printk(KERN_ERR "perfmon: pfm_context_force_terminate [%d] is system-wide\n", current->pid); - return; - } - /* - * we stop the whole thing, we do no need to flush - * we know we WERE masked - */ - pfm_clear_psr_up(); - ia64_psr(regs)->up = 0; - ia64_psr(regs)->sp = 1; + int ret; - /* - * disconnect the task from the context and vice-versa - */ - current->thread.pfm_context = NULL; - current->thread.flags &= ~IA64_THREAD_PM_VALID; - ctx->ctx_task = NULL; + DPRINT(("entering for [%d]\n", current->pid)); - DPRINT(("context terminated\n")); + ret = pfm_context_unload(ctx, NULL, 0, regs); + if (ret) { + printk(KERN_ERR "pfm_context_force_terminate: [%d] unloaded failed with %d\n", current->pid, ret); + } /* * and wakeup controlling task, indicating we are now disconnected @@ -5077,6 +5044,18 @@ pfm_handle_work(void) UNPROTECT_CTX(ctx, flags); + /* + * pfm_handle_work() is currently called with interrupts disabled. + * The down_interruptible call may sleep, therefore we + * must re-enable interrupts to avoid deadlocks. It is + * safe to do so because this function is called ONLY + * when returning to user level (PUStk=1), in which case + * there is no risk of kernel stack overflow due to deep + * interrupt nesting. + */ + BUG_ON(flags & IA64_PSR_I); + local_irq_enable(); + DPRINT(("before block sleeping\n")); /* @@ -5087,6 +5066,12 @@ pfm_handle_work(void) DPRINT(("after block sleeping ret=%d\n", ret)); + /* + * disable interrupts to restore state we had upon entering + * this function + */ + local_irq_disable(); + PROTECT_CTX(ctx, flags); /* @@ -5372,9 +5357,8 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str if (ovfl_notify == 0) reset_pmds = ovfl_pmds; } - DPRINT(("ovfl_pmds=0x%lx reset_pmds=0x%lx\n", - ovfl_pmds, - reset_pmds)); + DPRINT_ovfl(("ovfl_pmds=0x%lx reset_pmds=0x%lx\n", ovfl_pmds, reset_pmds)); + /* * reset the requested PMD registers using the short reset values */ @@ -5874,14 +5858,6 @@ pfm_save_regs(struct task_struct *task) return; } - /* - * sanity check - */ - if (ctx->ctx_last_activation != GET_ACTIVATION()) { - pfm_unprotect_ctx_ctxsw(ctx, flags); - return; - } - /* * save current PSR: needed because we modify it */ @@ -6377,6 +6353,9 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) * XXX: sampling situation is not taken into account here */ mask2 = ctx->ctx_used_pmds[0]; + + DPRINT(("is_self=%d ovfl_val=0x%lx mask2=0x%lx\n", is_self, ovfl_val, mask2)); + for (i = 0; mask2; i++, mask2>>=1) { /* skip non used pmds */ @@ -6415,7 +6394,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) } } - DPRINT(("[%d] is_self=%d ctx_pmd[%d]=0x%lx pmd_val=0x%lx\n", task->pid, is_self, i, val, pmd_val)); + DPRINT(("[%d] ctx_pmd[%d]=0x%lx pmd_val=0x%lx\n", task->pid, i, val, pmd_val)); if (is_self) task->thread.pmds[i] = pmd_val; @@ -6693,8 +6672,7 @@ pfm_inherit(struct task_struct *task, struct pt_regs *regs) } #else /* !CONFIG_PERFMON */ asmlinkage long -sys_perfmonctl (int fd, int cmd, void *arg, int count, long arg5, long arg6, long arg7, - long arg8, long stack) +sys_perfmonctl (int fd, int cmd, void *arg, int count) { return -ENOSYS; } diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 56ffa1a5d..91293388d 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,8 @@ #include #include +#include "entry.h" + #ifdef CONFIG_PERFMON # include #endif @@ -46,7 +49,10 @@ #include "sigframe.h" void (*ia64_mark_idle)(int); +static cpumask_t cpu_idle_map; +unsigned long boot_option_idle_override = 0; +EXPORT_SYMBOL(boot_option_idle_override); void ia64_do_show_stack (struct unw_frame_info *info, void *arg) @@ -185,6 +191,8 @@ default_idle (void) while (!need_resched()) if (pal_halt && !pmu_active) safe_halt(); + else + cpu_relax(); } #ifdef CONFIG_HOTPLUG_CPU @@ -221,10 +229,28 @@ static inline void play_dead(void) } #endif /* CONFIG_HOTPLUG_CPU */ + +void cpu_idle_wait(void) +{ + int cpu; + cpumask_t map; + + for_each_online_cpu(cpu) + cpu_set(cpu, cpu_idle_map); + + wmb(); + do { + ssleep(1); + cpus_and(map, cpu_idle_map, cpu_online_map); + } while (!cpus_empty(map)); +} +EXPORT_SYMBOL_GPL(cpu_idle_wait); + void __attribute__((noreturn)) -cpu_idle (void *unused) +cpu_idle (void) { void (*mark_idle)(int) = ia64_mark_idle; + int cpu = smp_processor_id(); /* endless idle loop with no priority at all */ while (1) { @@ -237,17 +263,14 @@ cpu_idle (void *unused) if (mark_idle) (*mark_idle)(1); - /* - * Mark this as an RCU critical section so that - * synchronize_kernel() in the unload path waits - * for our completion. - */ - rcu_read_lock(); + + if (cpu_isset(cpu, cpu_idle_map)) + cpu_clear(cpu, cpu_idle_map); + rmb(); idle = pm_idle; if (!idle) idle = default_idle; (*idle)(); - rcu_read_unlock(); } if (mark_idle) @@ -609,7 +632,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst) return 1; /* f0-f31 are always valid so we always return 1 */ } -asmlinkage long +long sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs) { @@ -646,7 +669,7 @@ kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) regs.pt.cr_ifs = 1UL << 63; /* mark as valid, empty frame */ regs.sw.ar_fpsr = regs.pt.ar_fpsr = ia64_getreg(_IA64_REG_AR_FPSR); regs.sw.ar_bspstore = (unsigned long) current + IA64_RBS_OFFSET; - + regs.sw.pr = (1 << PRED_KERNEL_STACK); return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s.pt, 0, NULL, NULL); } EXPORT_SYMBOL(kernel_thread); diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 66e7f9fbc..ad92fee8e 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c @@ -1,11 +1,10 @@ /* * Kernel support for the ptrace() and syscall tracing interfaces. * - * Copyright (C) 1999-2003 Hewlett-Packard Co + * Copyright (C) 1999-2005 Hewlett-Packard Co * David Mosberger-Tang * - * Derived from the x86 and Alpha versions. Most of the code in here - * could actually be factored into a common set of routines. + * Derived from the x86 and Alpha versions. */ #include #include @@ -17,6 +16,7 @@ #include #include #include +#include #include #include @@ -31,9 +31,6 @@ #include "entry.h" -#define p4 (1UL << 4) /* for pSys (see entry.h) */ -#define p5 (1UL << 5) /* for pNonSys (see entry.h) */ - /* * Bits in the PSR that we allow ptrace() to change: * be, up, ac, mfl, mfh (the user mask; five bits total) @@ -43,9 +40,11 @@ * ri (restart instruction; two bits) * is (instruction set; one bit) */ -#define IPSR_WRITE_MASK \ - (IA64_PSR_UM | IA64_PSR_DB | IA64_PSR_IS | IA64_PSR_ID | IA64_PSR_DD | IA64_PSR_RI) -#define IPSR_READ_MASK IPSR_WRITE_MASK +#define IPSR_MASK (IA64_PSR_UM | IA64_PSR_DB | IA64_PSR_IS \ + | IA64_PSR_ID | IA64_PSR_DD | IA64_PSR_RI) + +#define MASK(nbits) ((1UL << (nbits)) - 1) /* mask with NBITS bits set */ +#define PFM_MASK MASK(38) #define PTRACE_DEBUG 0 @@ -71,23 +70,24 @@ in_syscall (struct pt_regs *pt) unsigned long ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat) { -# define GET_BITS(first, last, unat) \ - ({ \ - unsigned long bit = ia64_unat_pos(&pt->r##first); \ - unsigned long mask = ((1UL << (last - first + 1)) - 1) << first; \ - unsigned long dist; \ - if (bit < first) \ - dist = 64 + bit - first; \ - else \ - dist = bit - first; \ - ia64_rotr(unat, dist) & mask; \ +# define GET_BITS(first, last, unat) \ + ({ \ + unsigned long bit = ia64_unat_pos(&pt->r##first); \ + unsigned long nbits = (last - first + 1); \ + unsigned long mask = MASK(nbits) << first; \ + unsigned long dist; \ + if (bit < first) \ + dist = 64 + bit - first; \ + else \ + dist = bit - first; \ + ia64_rotr(unat, dist) & mask; \ }) unsigned long val; /* - * Registers that are stored consecutively in struct pt_regs can be handled in - * parallel. If the register order in struct_pt_regs changes, this code MUST be - * updated. + * Registers that are stored consecutively in struct pt_regs + * can be handled in parallel. If the register order in + * struct_pt_regs changes, this code MUST be updated. */ val = GET_BITS( 1, 1, scratch_unat); val |= GET_BITS( 2, 3, scratch_unat); @@ -109,23 +109,24 @@ ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat) unsigned long ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat) { -# define PUT_BITS(first, last, nat) \ - ({ \ - unsigned long bit = ia64_unat_pos(&pt->r##first); \ - unsigned long mask = ((1UL << (last - first + 1)) - 1) << first; \ - long dist; \ - if (bit < first) \ - dist = 64 + bit - first; \ - else \ - dist = bit - first; \ - ia64_rotl(nat & mask, dist); \ +# define PUT_BITS(first, last, nat) \ + ({ \ + unsigned long bit = ia64_unat_pos(&pt->r##first); \ + unsigned long nbits = (last - first + 1); \ + unsigned long mask = MASK(nbits) << first; \ + long dist; \ + if (bit < first) \ + dist = 64 + bit - first; \ + else \ + dist = bit - first; \ + ia64_rotl(nat & mask, dist); \ }) unsigned long scratch_unat; /* - * Registers that are stored consecutively in struct pt_regs can be handled in - * parallel. If the register order in struct_pt_regs changes, this code MUST be - * updated. + * Registers that are stored consecutively in struct pt_regs + * can be handled in parallel. If the register order in + * struct_pt_regs changes, this code MUST be updated. */ scratch_unat = PUT_BITS( 1, 1, nat); scratch_unat |= PUT_BITS( 2, 3, nat); @@ -188,10 +189,12 @@ ia64_decrement_ip (struct pt_regs *regs) } /* - * This routine is used to read an rnat bits that are stored on the kernel backing store. - * Since, in general, the alignment of the user and kernel are different, this is not - * completely trivial. In essence, we need to construct the user RNAT based on up to two - * kernel RNAT values and/or the RNAT value saved in the child's pt_regs. + * This routine is used to read an rnat bits that are stored on the + * kernel backing store. Since, in general, the alignment of the user + * and kernel are different, this is not completely trivial. In + * essence, we need to construct the user RNAT based on up to two + * kernel RNAT values and/or the RNAT value saved in the child's + * pt_regs. * * user rbs * @@ -224,24 +227,28 @@ ia64_decrement_ip (struct pt_regs *regs) * +--------+ * <--- child_stack->ar_bspstore * - * The way to think of this code is as follows: bit 0 in the user rnat corresponds to some - * bit N (0 <= N <= 62) in one of the kernel rnat value. The kernel rnat value holding - * this bit is stored in variable rnat0. rnat1 is loaded with the kernel rnat value that + * The way to think of this code is as follows: bit 0 in the user rnat + * corresponds to some bit N (0 <= N <= 62) in one of the kernel rnat + * value. The kernel rnat value holding this bit is stored in + * variable rnat0. rnat1 is loaded with the kernel rnat value that * form the upper bits of the user rnat value. * * Boundary cases: * - * o when reading the rnat "below" the first rnat slot on the kernel backing store, - * rnat0/rnat1 are set to 0 and the low order bits are merged in from pt->ar_rnat. + * o when reading the rnat "below" the first rnat slot on the kernel + * backing store, rnat0/rnat1 are set to 0 and the low order bits are + * merged in from pt->ar_rnat. * - * o when reading the rnat "above" the last rnat slot on the kernel backing store, - * rnat0/rnat1 gets its value from sw->ar_rnat. + * o when reading the rnat "above" the last rnat slot on the kernel + * backing store, rnat0/rnat1 gets its value from sw->ar_rnat. */ static unsigned long get_rnat (struct task_struct *task, struct switch_stack *sw, - unsigned long *krbs, unsigned long *urnat_addr, unsigned long *urbs_end) + unsigned long *krbs, unsigned long *urnat_addr, + unsigned long *urbs_end) { - unsigned long rnat0 = 0, rnat1 = 0, urnat = 0, *slot0_kaddr, umask = 0, mask, m; + unsigned long rnat0 = 0, rnat1 = 0, urnat = 0, *slot0_kaddr; + unsigned long umask = 0, mask, m; unsigned long *kbsp, *ubspstore, *rnat0_kaddr, *rnat1_kaddr, shift; long num_regs, nbits; struct pt_regs *pt; @@ -254,11 +261,12 @@ get_rnat (struct task_struct *task, struct switch_stack *sw, nbits = ia64_rse_num_regs(urnat_addr - 63, urbs_end); else nbits = 63; - mask = (1UL << nbits) - 1; + mask = MASK(nbits); /* - * First, figure out which bit number slot 0 in user-land maps to in the kernel - * rnat. Do this by figuring out how many register slots we're beyond the user's - * backingstore and then computing the equivalent address in kernel space. + * First, figure out which bit number slot 0 in user-land maps + * to in the kernel rnat. Do this by figuring out how many + * register slots we're beyond the user's backingstore and + * then computing the equivalent address in kernel space. */ num_regs = ia64_rse_num_regs(ubspstore, urnat_addr + 1); slot0_kaddr = ia64_rse_skip_regs(krbs, num_regs); @@ -268,7 +276,7 @@ get_rnat (struct task_struct *task, struct switch_stack *sw, if (ubspstore + 63 > urnat_addr) { /* some bits need to be merged in from pt->ar_rnat */ - umask = ((1UL << ia64_rse_slot_num(ubspstore)) - 1) & mask; + umask = MASK(ia64_rse_slot_num(ubspstore)) & mask; urnat = (pt->ar_rnat & umask); mask &= ~umask; if (!mask) @@ -304,7 +312,6 @@ put_rnat (struct task_struct *task, struct switch_stack *sw, long num_regs, nbits; struct pt_regs *pt; unsigned long cfm, *urbs_kargs; - struct unw_frame_info info; pt = ia64_task_regs(task); kbsp = (unsigned long *) sw->ar_bspstore; @@ -316,11 +323,8 @@ put_rnat (struct task_struct *task, struct switch_stack *sw, * If entered via syscall, don't allow user to set rnat bits * for syscall args. */ - unw_init_from_blocked_task(&info,task); - if (unw_unwind_to_user(&info) == 0) { - unw_get_cfm(&info,&cfm); - urbs_kargs = ia64_rse_skip_regs(urbs_end,-(cfm & 0x7f)); - } + cfm = pt->cr_ifs; + urbs_kargs = ia64_rse_skip_regs(urbs_end, -(cfm & 0x7f)); } if (urbs_kargs >= urnat_addr) @@ -330,12 +334,13 @@ put_rnat (struct task_struct *task, struct switch_stack *sw, return; nbits = ia64_rse_num_regs(urnat_addr - 63, urbs_kargs); } - mask = (1UL << nbits) - 1; + mask = MASK(nbits); /* - * First, figure out which bit number slot 0 in user-land maps to in the kernel - * rnat. Do this by figuring out how many register slots we're beyond the user's - * backingstore and then computing the equivalent address in kernel space. + * First, figure out which bit number slot 0 in user-land maps + * to in the kernel rnat. Do this by figuring out how many + * register slots we're beyond the user's backingstore and + * then computing the equivalent address in kernel space. */ num_regs = ia64_rse_num_regs(ubspstore, urnat_addr + 1); slot0_kaddr = ia64_rse_skip_regs(krbs, num_regs); @@ -345,7 +350,7 @@ put_rnat (struct task_struct *task, struct switch_stack *sw, if (ubspstore + 63 > urnat_addr) { /* some bits need to be place in pt->ar_rnat: */ - umask = ((1UL << ia64_rse_slot_num(ubspstore)) - 1) & mask; + umask = MASK(ia64_rse_slot_num(ubspstore)) & mask; pt->ar_rnat = (pt->ar_rnat & ~umask) | (urnat & umask); mask &= ~umask; if (!mask) @@ -371,25 +376,28 @@ put_rnat (struct task_struct *task, struct switch_stack *sw, } static inline int -on_kernel_rbs (unsigned long addr, unsigned long bspstore, unsigned long urbs_end) +on_kernel_rbs (unsigned long addr, unsigned long bspstore, + unsigned long urbs_end) { - return (addr >= bspstore - && addr <= (unsigned long) ia64_rse_rnat_addr((unsigned long *) urbs_end)); + unsigned long *rnat_addr = ia64_rse_rnat_addr((unsigned long *) + urbs_end); + return (addr >= bspstore && addr <= (unsigned long) rnat_addr); } /* - * Read a word from the user-level backing store of task CHILD. ADDR is the user-level - * address to read the word from, VAL a pointer to the return value, and USER_BSP gives - * the end of the user-level backing store (i.e., it's the address that would be in ar.bsp - * after the user executed a "cover" instruction). + * Read a word from the user-level backing store of task CHILD. ADDR + * is the user-level address to read the word from, VAL a pointer to + * the return value, and USER_BSP gives the end of the user-level + * backing store (i.e., it's the address that would be in ar.bsp after + * the user executed a "cover" instruction). * - * This routine takes care of accessing the kernel register backing store for those - * registers that got spilled there. It also takes care of calculating the appropriate - * RNaT collection words. + * This routine takes care of accessing the kernel register backing + * store for those registers that got spilled there. It also takes + * care of calculating the appropriate RNaT collection words. */ long -ia64_peek (struct task_struct *child, struct switch_stack *child_stack, unsigned long user_rbs_end, - unsigned long addr, long *val) +ia64_peek (struct task_struct *child, struct switch_stack *child_stack, + unsigned long user_rbs_end, unsigned long addr, long *val) { unsigned long *bspstore, *krbs, regnum, *laddr, *urbs_end, *rnat_addr; struct pt_regs *child_regs; @@ -401,10 +409,13 @@ ia64_peek (struct task_struct *child, struct switch_stack *child_stack, unsigned child_regs = ia64_task_regs(child); bspstore = (unsigned long *) child_regs->ar_bspstore; krbs = (unsigned long *) child + IA64_RBS_OFFSET/8; - if (on_kernel_rbs(addr, (unsigned long) bspstore, (unsigned long) urbs_end)) { + if (on_kernel_rbs(addr, (unsigned long) bspstore, + (unsigned long) urbs_end)) + { /* - * Attempt to read the RBS in an area that's actually on the kernel RBS => - * read the corresponding bits in the kernel RBS. + * Attempt to read the RBS in an area that's actually + * on the kernel RBS => read the corresponding bits in + * the kernel RBS. */ rnat_addr = ia64_rse_rnat_addr(laddr); ret = get_rnat(child, child_stack, krbs, rnat_addr, urbs_end); @@ -417,18 +428,23 @@ ia64_peek (struct task_struct *child, struct switch_stack *child_stack, unsigned if (((1UL << ia64_rse_slot_num(laddr)) & ret) != 0) { /* - * It is implementation dependent whether the data portion of a - * NaT value gets saved on a st8.spill or RSE spill (e.g., see - * EAS 2.6, 4.4.4.6 Register Spill and Fill). To get consistent - * behavior across all possible IA-64 implementations, we return - * zero in this case. + * It is implementation dependent whether the + * data portion of a NaT value gets saved on a + * st8.spill or RSE spill (e.g., see EAS 2.6, + * 4.4.4.6 Register Spill and Fill). To get + * consistent behavior across all possible + * IA-64 implementations, we return zero in + * this case. */ *val = 0; return 0; } if (laddr < urbs_end) { - /* the desired word is on the kernel RBS and is not a NaT */ + /* + * The desired word is on the kernel RBS and + * is not a NaT. + */ regnum = ia64_rse_num_regs(bspstore, laddr); *val = *ia64_rse_skip_regs(krbs, regnum); return 0; @@ -442,74 +458,75 @@ ia64_peek (struct task_struct *child, struct switch_stack *child_stack, unsigned } long -ia64_poke (struct task_struct *child, struct switch_stack *child_stack, unsigned long user_rbs_end, - unsigned long addr, long val) +ia64_poke (struct task_struct *child, struct switch_stack *child_stack, + unsigned long user_rbs_end, unsigned long addr, long val) { - unsigned long *bspstore, *krbs, regnum, *laddr, *urbs_end = (long *) user_rbs_end; + unsigned long *bspstore, *krbs, regnum, *laddr; + unsigned long *urbs_end = (long *) user_rbs_end; struct pt_regs *child_regs; laddr = (unsigned long *) addr; child_regs = ia64_task_regs(child); bspstore = (unsigned long *) child_regs->ar_bspstore; krbs = (unsigned long *) child + IA64_RBS_OFFSET/8; - if (on_kernel_rbs(addr, (unsigned long) bspstore, (unsigned long) urbs_end)) { + if (on_kernel_rbs(addr, (unsigned long) bspstore, + (unsigned long) urbs_end)) + { /* - * Attempt to write the RBS in an area that's actually on the kernel RBS - * => write the corresponding bits in the kernel RBS. + * Attempt to write the RBS in an area that's actually + * on the kernel RBS => write the corresponding bits + * in the kernel RBS. */ if (ia64_rse_is_rnat_slot(laddr)) - put_rnat(child, child_stack, krbs, laddr, val, urbs_end); + put_rnat(child, child_stack, krbs, laddr, val, + urbs_end); else { if (laddr < urbs_end) { regnum = ia64_rse_num_regs(bspstore, laddr); *ia64_rse_skip_regs(krbs, regnum) = val; } } - } else if (access_process_vm(child, addr, &val, sizeof(val), 1) != sizeof(val)) { + } else if (access_process_vm(child, addr, &val, sizeof(val), 1) + != sizeof(val)) return -EIO; - } return 0; } /* - * Calculate the address of the end of the user-level register backing store. This is the - * address that would have been stored in ar.bsp if the user had executed a "cover" - * instruction right before entering the kernel. If CFMP is not NULL, it is used to - * return the "current frame mask" that was active at the time the kernel was entered. + * Calculate the address of the end of the user-level register backing + * store. This is the address that would have been stored in ar.bsp + * if the user had executed a "cover" instruction right before + * entering the kernel. If CFMP is not NULL, it is used to return the + * "current frame mask" that was active at the time the kernel was + * entered. */ unsigned long -ia64_get_user_rbs_end (struct task_struct *child, struct pt_regs *pt, unsigned long *cfmp) +ia64_get_user_rbs_end (struct task_struct *child, struct pt_regs *pt, + unsigned long *cfmp) { - unsigned long *krbs, *bspstore, cfm; - struct unw_frame_info info; + unsigned long *krbs, *bspstore, cfm = pt->cr_ifs; long ndirty; krbs = (unsigned long *) child + IA64_RBS_OFFSET/8; bspstore = (unsigned long *) pt->ar_bspstore; ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19)); - cfm = pt->cr_ifs & ~(1UL << 63); - if (in_syscall(pt)) { - /* - * If bit 63 of cr.ifs is cleared, the kernel was entered via a system - * call and we need to recover the CFM that existed on entry to the - * kernel by unwinding the kernel stack. - */ - unw_init_from_blocked_task(&info, child); - if (unw_unwind_to_user(&info) == 0) { - unw_get_cfm(&info, &cfm); - ndirty += (cfm & 0x7f); - } - } + if (in_syscall(pt)) + ndirty += (cfm & 0x7f); + else + cfm &= ~(1UL << 63); /* clear valid bit */ + if (cfmp) *cfmp = cfm; return (unsigned long) ia64_rse_skip_regs(bspstore, ndirty); } /* - * Synchronize (i.e, write) the RSE backing store living in kernel space to the VM of the - * CHILD task. SW and PT are the pointers to the switch_stack and pt_regs structures, - * respectively. USER_RBS_END is the user-level address at which the backing store ends. + * Synchronize (i.e, write) the RSE backing store living in kernel + * space to the VM of the CHILD task. SW and PT are the pointers to + * the switch_stack and pt_regs structures, respectively. + * USER_RBS_END is the user-level address at which the backing store + * ends. */ long ia64_sync_user_rbs (struct task_struct *child, struct switch_stack *sw, @@ -523,7 +540,8 @@ ia64_sync_user_rbs (struct task_struct *child, struct switch_stack *sw, ret = ia64_peek(child, sw, user_rbs_end, addr, &val); if (ret < 0) return ret; - if (access_process_vm(child, addr, &val, sizeof(val), 1) != sizeof(val)) + if (access_process_vm(child, addr, &val, sizeof(val), 1) + != sizeof(val)) return -EIO; } return 0; @@ -537,13 +555,14 @@ thread_matches (struct task_struct *thread, unsigned long addr) if (ptrace_check_attach(thread, 0) < 0) /* - * If the thread is not in an attachable state, we'll ignore it. - * The net effect is that if ADDR happens to overlap with the - * portion of the thread's register backing store that is - * currently residing on the thread's kernel stack, then ptrace() - * may end up accessing a stale value. But if the thread isn't - * stopped, that's a problem anyhow, so we're doing as well as we - * can... + * If the thread is not in an attachable state, we'll + * ignore it. The net effect is that if ADDR happens + * to overlap with the portion of the thread's + * register backing store that is currently residing + * on the thread's kernel stack, then ptrace() may end + * up accessing a stale value. But if the thread + * isn't stopped, that's a problem anyhow, so we're + * doing as well as we can... */ return 0; @@ -556,10 +575,11 @@ thread_matches (struct task_struct *thread, unsigned long addr) } /* - * GDB apparently wants to be able to read the register-backing store of any thread when - * attached to a given process. If we are peeking or poking an address that happens to - * reside in the kernel-backing store of another thread, we need to attach to that thread, - * because otherwise we end up accessing stale data. + * GDB apparently wants to be able to read the register-backing store + * of any thread when attached to a given process. If we are peeking + * or poking an address that happens to reside in the kernel-backing + * store of another thread, we need to attach to that thread, because + * otherwise we end up accessing stale data. * * task_list_lock must be read-locked before calling this routine! */ @@ -573,7 +593,8 @@ find_thread_for_addr (struct task_struct *child, unsigned long addr) if (!(mm = get_task_mm(child))) return child; - mm_users = atomic_read(&mm->mm_users) - 1; /* -1 because of our get_task_mm()... */ + /* -1 because of our get_task_mm(): */ + mm_users = atomic_read(&mm->mm_users) - 1; if (mm_users <= 1) goto out; /* not multi-threaded */ @@ -643,7 +664,8 @@ ia64_sync_fph (struct task_struct *task) } static int -access_fr (struct unw_frame_info *info, int regnum, int hi, unsigned long *data, int write_access) +access_fr (struct unw_frame_info *info, int regnum, int hi, + unsigned long *data, int write_access) { struct ia64_fpreg fpval; int ret; @@ -665,7 +687,8 @@ access_fr (struct unw_frame_info *info, int regnum, int hi, unsigned long *data, * kernel exit-path, rather than the syscall-exit path. */ static void -convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, unsigned long cfm) +convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, + unsigned long cfm) { struct unw_frame_info info, prev_info; unsigned long ip, pr; @@ -682,19 +705,59 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, unsigned } unw_get_pr(&prev_info, &pr); - pr &= ~pSys; - pr |= pNonSys; + pr &= ~(1UL << PRED_SYSCALL); + pr |= (1UL << PRED_NON_SYSCALL); unw_set_pr(&prev_info, pr); pt->cr_ifs = (1UL << 63) | cfm; } static int -access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data, int write_access) +access_nat_bits (struct task_struct *child, struct pt_regs *pt, + struct unw_frame_info *info, + unsigned long *data, int write_access) +{ + unsigned long regnum, nat_bits, scratch_unat, dummy = 0; + char nat = 0; + + if (write_access) { + nat_bits = *data; + scratch_unat = ia64_put_scratch_nat_bits(pt, nat_bits); + if (unw_set_ar(info, UNW_AR_UNAT, scratch_unat) < 0) { + dprintk("ptrace: failed to set ar.unat\n"); + return -1; + } + for (regnum = 4; regnum <= 7; ++regnum) { + unw_get_gr(info, regnum, &dummy, &nat); + unw_set_gr(info, regnum, dummy, + (nat_bits >> regnum) & 1); + } + } else { + if (unw_get_ar(info, UNW_AR_UNAT, &scratch_unat) < 0) { + dprintk("ptrace: failed to read ar.unat\n"); + return -1; + } + nat_bits = ia64_get_scratch_nat_bits(pt, scratch_unat); + for (regnum = 4; regnum <= 7; ++regnum) { + unw_get_gr(info, regnum, &dummy, &nat); + nat_bits |= (nat != 0) << regnum; + } + *data = nat_bits; + } + return 0; +} + +static int +access_uarea (struct task_struct *child, unsigned long addr, + unsigned long *data, int write_access) { unsigned long *ptr, regnum, urbs_end, rnat_addr, cfm; struct switch_stack *sw; struct pt_regs *pt; +# define pt_reg_addr(pt, reg) ((void *) \ + ((unsigned long) (pt) \ + + offsetof(struct pt_regs, reg))) + pt = ia64_task_regs(child); sw = (struct switch_stack *) (child->thread.ksp + 16); @@ -710,17 +773,20 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data ia64_sync_fph(child); else ia64_flush_fph(child); - ptr = (unsigned long *) ((unsigned long) &child->thread.fph + addr); + ptr = (unsigned long *) + ((unsigned long) &child->thread.fph + addr); } else if ((addr >= PT_F10) && (addr < PT_F11 + 16)) { /* scratch registers untouched by kernel (saved in pt_regs) */ - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, f10) + addr - PT_F10); + ptr = pt_reg_addr(pt, f10) + (addr - PT_F10); } else if (addr >= PT_F12 && addr < PT_F15 + 16) { - /* scratch registers untouched by kernel (saved in switch_stack) */ - ptr = (unsigned long *) ((long) sw + (addr - PT_NAT_BITS - 32)); + /* + * Scratch registers untouched by kernel (saved in + * switch_stack). + */ + ptr = (unsigned long *) ((long) sw + + (addr - PT_NAT_BITS - 32)); } else if (addr < PT_AR_LC + 8) { /* preserved state: */ - unsigned long nat_bits, scratch_unat, dummy = 0; struct unw_frame_info info; char nat = 0; int ret; @@ -731,62 +797,48 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data switch (addr) { case PT_NAT_BITS: - if (write_access) { - nat_bits = *data; - scratch_unat = ia64_put_scratch_nat_bits(pt, nat_bits); - if (unw_set_ar(&info, UNW_AR_UNAT, scratch_unat) < 0) { - dprintk("ptrace: failed to set ar.unat\n"); - return -1; - } - for (regnum = 4; regnum <= 7; ++regnum) { - unw_get_gr(&info, regnum, &dummy, &nat); - unw_set_gr(&info, regnum, dummy, (nat_bits >> regnum) & 1); - } - } else { - if (unw_get_ar(&info, UNW_AR_UNAT, &scratch_unat) < 0) { - dprintk("ptrace: failed to read ar.unat\n"); - return -1; - } - nat_bits = ia64_get_scratch_nat_bits(pt, scratch_unat); - for (regnum = 4; regnum <= 7; ++regnum) { - unw_get_gr(&info, regnum, &dummy, &nat); - nat_bits |= (nat != 0) << regnum; - } - *data = nat_bits; - } - return 0; + return access_nat_bits(child, pt, &info, + data, write_access); case PT_R4: case PT_R5: case PT_R6: case PT_R7: if (write_access) { /* read NaT bit first: */ unsigned long dummy; - ret = unw_get_gr(&info, (addr - PT_R4)/8 + 4, &dummy, &nat); + ret = unw_get_gr(&info, (addr - PT_R4)/8 + 4, + &dummy, &nat); if (ret < 0) return ret; } - return unw_access_gr(&info, (addr - PT_R4)/8 + 4, data, &nat, - write_access); + return unw_access_gr(&info, (addr - PT_R4)/8 + 4, data, + &nat, write_access); - case PT_B1: case PT_B2: case PT_B3: case PT_B4: case PT_B5: - return unw_access_br(&info, (addr - PT_B1)/8 + 1, data, write_access); + case PT_B1: case PT_B2: case PT_B3: + case PT_B4: case PT_B5: + return unw_access_br(&info, (addr - PT_B1)/8 + 1, data, + write_access); case PT_AR_EC: - return unw_access_ar(&info, UNW_AR_EC, data, write_access); + return unw_access_ar(&info, UNW_AR_EC, data, + write_access); case PT_AR_LC: - return unw_access_ar(&info, UNW_AR_LC, data, write_access); + return unw_access_ar(&info, UNW_AR_LC, data, + write_access); default: if (addr >= PT_F2 && addr < PT_F5 + 16) - return access_fr(&info, (addr - PT_F2)/16 + 2, (addr & 8) != 0, - data, write_access); + return access_fr(&info, (addr - PT_F2)/16 + 2, + (addr & 8) != 0, data, + write_access); else if (addr >= PT_F16 && addr < PT_F31 + 16) - return access_fr(&info, (addr - PT_F16)/16 + 16, (addr & 8) != 0, + return access_fr(&info, + (addr - PT_F16)/16 + 16, + (addr & 8) != 0, data, write_access); else { - dprintk("ptrace: rejecting access to register address 0x%lx\n", - addr); + dprintk("ptrace: rejecting access to register " + "address 0x%lx\n", addr); return -1; } } @@ -795,34 +847,49 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data switch (addr) { case PT_AR_BSP: /* - * By convention, we use PT_AR_BSP to refer to the end of the user-level - * backing store. Use ia64_rse_skip_regs(PT_AR_BSP, -CFM.sof) to get - * the real value of ar.bsp at the time the kernel was entered. + * By convention, we use PT_AR_BSP to refer to + * the end of the user-level backing store. + * Use ia64_rse_skip_regs(PT_AR_BSP, -CFM.sof) + * to get the real value of ar.bsp at the time + * the kernel was entered. * - * Furthermore, when changing the contents of PT_AR_BSP (or - * PT_CFM) we MUST copy any users-level stacked registers that are - * stored on the kernel stack back to user-space because - * otherwise, we might end up clobbering kernel stacked registers. - * Also, if this happens while the task is blocked in a system - * call, which convert the state such that the non-system-call - * exit path is used. This ensures that the proper state will be - * picked up when resuming execution. However, it *also* means - * that once we write PT_AR_BSP/PT_CFM, it won't be possible to - * modify the syscall arguments of the pending system call any - * longer. This shouldn't be an issue because modifying - * PT_AR_BSP/PT_CFM generally implies that we're either abandoning - * the pending system call or that we defer it's re-execution - * (e.g., due to GDB doing an inferior function call). + * Furthermore, when changing the contents of + * PT_AR_BSP (or PT_CFM) we MUST copy any + * users-level stacked registers that are + * stored on the kernel stack back to + * user-space because otherwise, we might end + * up clobbering kernel stacked registers. + * Also, if this happens while the task is + * blocked in a system call, which convert the + * state such that the non-system-call exit + * path is used. This ensures that the proper + * state will be picked up when resuming + * execution. However, it *also* means that + * once we write PT_AR_BSP/PT_CFM, it won't be + * possible to modify the syscall arguments of + * the pending system call any longer. This + * shouldn't be an issue because modifying + * PT_AR_BSP/PT_CFM generally implies that + * we're either abandoning the pending system + * call or that we defer it's re-execution + * (e.g., due to GDB doing an inferior + * function call). */ urbs_end = ia64_get_user_rbs_end(child, pt, &cfm); if (write_access) { if (*data != urbs_end) { if (ia64_sync_user_rbs(child, sw, - pt->ar_bspstore, urbs_end) < 0) + pt->ar_bspstore, + urbs_end) < 0) return -1; if (in_syscall(pt)) - convert_to_non_syscall(child, pt, cfm); - /* simulate user-level write of ar.bsp: */ + convert_to_non_syscall(child, + pt, + cfm); + /* + * Simulate user-level write + * of ar.bsp: + */ pt->loadrs = 0; pt->ar_bspstore = *data; } @@ -833,14 +900,17 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data case PT_CFM: urbs_end = ia64_get_user_rbs_end(child, pt, &cfm); if (write_access) { - if (((cfm ^ *data) & 0x3fffffffffUL) != 0) { + if (((cfm ^ *data) & PFM_MASK) != 0) { if (ia64_sync_user_rbs(child, sw, - pt->ar_bspstore, urbs_end) < 0) + pt->ar_bspstore, + urbs_end) < 0) return -1; if (in_syscall(pt)) - convert_to_non_syscall(child, pt, cfm); - pt->cr_ifs = ((pt->cr_ifs & ~0x3fffffffffUL) - | (*data & 0x3fffffffffUL)); + convert_to_non_syscall(child, + pt, + cfm); + pt->cr_ifs = ((pt->cr_ifs & ~PFM_MASK) + | (*data & PFM_MASK)); } } else *data = cfm; @@ -848,99 +918,94 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data case PT_CR_IPSR: if (write_access) - pt->cr_ipsr = ((*data & IPSR_WRITE_MASK) - | (pt->cr_ipsr & ~IPSR_WRITE_MASK)); + pt->cr_ipsr = ((*data & IPSR_MASK) + | (pt->cr_ipsr & ~IPSR_MASK)); else - *data = (pt->cr_ipsr & IPSR_READ_MASK); + *data = (pt->cr_ipsr & IPSR_MASK); return 0; case PT_AR_RNAT: urbs_end = ia64_get_user_rbs_end(child, pt, NULL); - rnat_addr = (long) ia64_rse_rnat_addr((long *) urbs_end); + rnat_addr = (long) ia64_rse_rnat_addr((long *) + urbs_end); if (write_access) - return ia64_poke(child, sw, urbs_end, rnat_addr, *data); + return ia64_poke(child, sw, urbs_end, + rnat_addr, *data); else - return ia64_peek(child, sw, urbs_end, rnat_addr, data); + return ia64_peek(child, sw, urbs_end, + rnat_addr, data); case PT_R1: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, r1)); + ptr = pt_reg_addr(pt, r1); break; - case PT_R2: case PT_R3: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, r2) + addr - PT_R2); + ptr = pt_reg_addr(pt, r2) + (addr - PT_R2); break; case PT_R8: case PT_R9: case PT_R10: case PT_R11: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, r8)+ addr - PT_R8); + ptr = pt_reg_addr(pt, r8) + (addr - PT_R8); break; case PT_R12: case PT_R13: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, r12)+ addr - PT_R12); + ptr = pt_reg_addr(pt, r12) + (addr - PT_R12); break; case PT_R14: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, r14)); + ptr = pt_reg_addr(pt, r14); break; case PT_R15: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, r15)); + ptr = pt_reg_addr(pt, r15); break; case PT_R16: case PT_R17: case PT_R18: case PT_R19: case PT_R20: case PT_R21: case PT_R22: case PT_R23: case PT_R24: case PT_R25: case PT_R26: case PT_R27: case PT_R28: case PT_R29: case PT_R30: case PT_R31: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, r16) + addr - PT_R16); + ptr = pt_reg_addr(pt, r16) + (addr - PT_R16); break; case PT_B0: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, b0)); + ptr = pt_reg_addr(pt, b0); break; case PT_B6: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, b6)); + ptr = pt_reg_addr(pt, b6); break; case PT_B7: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, b7)); + ptr = pt_reg_addr(pt, b7); break; case PT_F6: case PT_F6+8: case PT_F7: case PT_F7+8: case PT_F8: case PT_F8+8: case PT_F9: case PT_F9+8: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, f6) + addr - PT_F6); + ptr = pt_reg_addr(pt, f6) + (addr - PT_F6); break; case PT_AR_BSPSTORE: - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, ar_bspstore)); + ptr = pt_reg_addr(pt, ar_bspstore); break; case PT_AR_RSC: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, ar_rsc)); + ptr = pt_reg_addr(pt, ar_rsc); break; case PT_AR_UNAT: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, ar_unat)); + ptr = pt_reg_addr(pt, ar_unat); break; case PT_AR_PFS: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, ar_pfs)); + ptr = pt_reg_addr(pt, ar_pfs); break; case PT_AR_CCV: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, ar_ccv)); + ptr = pt_reg_addr(pt, ar_ccv); break; case PT_AR_FPSR: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, ar_fpsr)); + ptr = pt_reg_addr(pt, ar_fpsr); break; case PT_CR_IIP: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, cr_iip)); + ptr = pt_reg_addr(pt, cr_iip); break; case PT_PR: - ptr = (unsigned long *) ((long) pt + offsetof(struct pt_regs, pr)); + ptr = pt_reg_addr(pt, pr); break; /* scratch register */ default: /* disallow accessing anything else... */ - dprintk("ptrace: rejecting access to register address 0x%lx\n", - addr); + dprintk("ptrace: rejecting access to register " + "address 0x%lx\n", addr); return -1; } } else if (addr <= PT_AR_SSD) { - ptr = (unsigned long *) - ((long) pt + offsetof(struct pt_regs, ar_csd) + addr - PT_AR_CSD); + ptr = pt_reg_addr(pt, ar_csd) + (addr - PT_AR_CSD); } else { /* access debug registers */ @@ -953,41 +1018,46 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data } if (regnum >= 8) { - dprintk("ptrace: rejecting access to register address 0x%lx\n", addr); + dprintk("ptrace: rejecting access to register " + "address 0x%lx\n", addr); return -1; } #ifdef CONFIG_PERFMON /* - * Check if debug registers are used by perfmon. This test must be done - * once we know that we can do the operation, i.e. the arguments are all - * valid, but before we start modifying the state. + * Check if debug registers are used by perfmon. This + * test must be done once we know that we can do the + * operation, i.e. the arguments are all valid, but + * before we start modifying the state. * - * Perfmon needs to keep a count of how many processes are trying to - * modify the debug registers for system wide monitoring sessions. + * Perfmon needs to keep a count of how many processes + * are trying to modify the debug registers for system + * wide monitoring sessions. * - * We also include read access here, because they may cause the - * PMU-installed debug register state (dbr[], ibr[]) to be reset. The two - * arrays are also used by perfmon, but we do not use - * IA64_THREAD_DBG_VALID. The registers are restored by the PMU context - * switch code. + * We also include read access here, because they may + * cause the PMU-installed debug register state + * (dbr[], ibr[]) to be reset. The two arrays are also + * used by perfmon, but we do not use + * IA64_THREAD_DBG_VALID. The registers are restored + * by the PMU context switch code. */ if (pfm_use_debug_registers(child)) return -1; #endif if (!(child->thread.flags & IA64_THREAD_DBG_VALID)) { child->thread.flags |= IA64_THREAD_DBG_VALID; - memset(child->thread.dbr, 0, sizeof(child->thread.dbr)); - memset(child->thread.ibr, 0, sizeof(child->thread.ibr)); + memset(child->thread.dbr, 0, + sizeof(child->thread.dbr)); + memset(child->thread.ibr, 0, + sizeof(child->thread.ibr)); } ptr += regnum; - if (write_access) - /* don't let the user set kernel-level breakpoints... */ + if ((regnum & 1) && write_access) { + /* don't let the user set kernel-level breakpoints: */ *ptr = *data & ~(7UL << 56); - else - *data = *ptr; - return 0; + return 0; + } } if (write_access) *ptr = *data; @@ -1008,7 +1078,8 @@ ptrace_getregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) char nat = 0; int i; - retval = verify_area(VERIFY_WRITE, ppr, sizeof(struct pt_all_user_regs)); + retval = verify_area(VERIFY_WRITE, ppr, + sizeof(struct pt_all_user_regs)); if (retval != 0) { return -EIO; } @@ -1110,11 +1181,13 @@ ptrace_getregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) /* fr6-fr11 */ - retval |= __copy_to_user(&ppr->fr[6], &pt->f6, sizeof(struct ia64_fpreg) * 6); + retval |= __copy_to_user(&ppr->fr[6], &pt->f6, + sizeof(struct ia64_fpreg) * 6); /* fp scratch regs(12-15) */ - retval |= __copy_to_user(&ppr->fr[12], &sw->f12, sizeof(struct ia64_fpreg) * 4); + retval |= __copy_to_user(&ppr->fr[12], &sw->f12, + sizeof(struct ia64_fpreg) * 4); /* fr16-fr31 */ @@ -1127,7 +1200,8 @@ ptrace_getregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) /* fph */ ia64_flush_fph(child); - retval |= __copy_to_user(&ppr->fr[32], &child->thread.fph, sizeof(ppr->fr[32]) * 96); + retval |= __copy_to_user(&ppr->fr[32], &child->thread.fph, + sizeof(ppr->fr[32]) * 96); /* preds */ @@ -1154,7 +1228,8 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) memset(&fpval, 0, sizeof(fpval)); - retval = verify_area(VERIFY_READ, ppr, sizeof(struct pt_all_user_regs)); + retval = verify_area(VERIFY_READ, ppr, + sizeof(struct pt_all_user_regs)); if (retval != 0) { return -EIO; } @@ -1202,7 +1277,8 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) for (i = 4; i < 8; i++) { retval |= __get_user(val, &ppr->gr[i]); - if (unw_set_gr(&info, i, val, 0) < 0) /* NaT bit will be set via PT_NAT_BITS */ + /* NaT bit will be set via PT_NAT_BITS: */ + if (unw_set_gr(&info, i, val, 0) < 0) return -EIO; } @@ -1246,16 +1322,19 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) /* fr6-fr11 */ - retval |= __copy_from_user(&pt->f6, &ppr->fr[6], sizeof(ppr->fr[6]) * 6); + retval |= __copy_from_user(&pt->f6, &ppr->fr[6], + sizeof(ppr->fr[6]) * 6); /* fp scratch regs(12-15) */ - retval |= __copy_from_user(&sw->f12, &ppr->fr[12], sizeof(ppr->fr[12]) * 4); + retval |= __copy_from_user(&sw->f12, &ppr->fr[12], + sizeof(ppr->fr[12]) * 4); /* fr16-fr31 */ for (i = 16; i < 32; i++) { - retval |= __copy_from_user(&fpval, &ppr->fr[i], sizeof(fpval)); + retval |= __copy_from_user(&fpval, &ppr->fr[i], + sizeof(fpval)); if (unw_set_fr(&info, i, fpval) < 0) return -EIO; } @@ -1263,7 +1342,8 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) /* fph */ ia64_sync_fph(child); - retval |= __copy_from_user(&child->thread.fph, &ppr->fr[32], sizeof(ppr->fr[32]) * 96); + retval |= __copy_from_user(&child->thread.fph, &ppr->fr[32], + sizeof(ppr->fr[32]) * 96); /* preds */ @@ -1295,16 +1375,15 @@ ptrace_disable (struct task_struct *child) { struct ia64_psr *child_psr = ia64_psr(ia64_task_regs(child)); - /* make sure the single step/take-branch tra bits are not set: */ + /* make sure the single step/taken-branch trap bits are not set: */ child_psr->ss = 0; child_psr->tb = 0; } asmlinkage long -sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, - long arg4, long arg5, long arg6, long arg7, long stack) +sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) { - struct pt_regs *pt, *regs = (struct pt_regs *) &stack; + struct pt_regs *pt; unsigned long urbs_end, peek_or_poke; struct task_struct *child; struct switch_stack *sw; @@ -1324,8 +1403,10 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, goto out; } - peek_or_poke = (request == PTRACE_PEEKTEXT || request == PTRACE_PEEKDATA - || request == PTRACE_POKETEXT || request == PTRACE_POKEDATA); + peek_or_poke = (request == PTRACE_PEEKTEXT + || request == PTRACE_PEEKDATA + || request == PTRACE_POKETEXT + || request == PTRACE_POKEDATA); ret = -ESRCH; read_lock(&tasklist_lock); { @@ -1360,31 +1441,37 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, switch (request) { case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: /* read word at location addr */ + case PTRACE_PEEKDATA: + /* read word at location addr */ urbs_end = ia64_get_user_rbs_end(child, pt, NULL); ret = ia64_peek(child, sw, urbs_end, addr, &data); if (ret == 0) { ret = data; - regs->r8 = 0; /* ensure "ret" is not mistaken as an error code */ + /* ensure "ret" is not mistaken as an error code: */ + force_successful_syscall_return(); } goto out_tsk; case PTRACE_POKETEXT: - case PTRACE_POKEDATA: /* write the word at location addr */ + case PTRACE_POKEDATA: + /* write the word at location addr */ urbs_end = ia64_get_user_rbs_end(child, pt, NULL); ret = ia64_poke(child, sw, urbs_end, addr, data); goto out_tsk; - case PTRACE_PEEKUSR: /* read the word at addr in the USER area */ + case PTRACE_PEEKUSR: + /* read the word at addr in the USER area */ if (access_uarea(child, addr, &data, 0) < 0) { ret = -EIO; goto out_tsk; } ret = data; - regs->r8 = 0; /* ensure "ret" is not mistaken as an error code */ + /* ensure "ret" is not mistaken as an error code */ + force_successful_syscall_return(); goto out_tsk; - case PTRACE_POKEUSR: /* write the word at addr in the USER area */ + case PTRACE_POKEUSR: + /* write the word at addr in the USER area */ if (access_uarea(child, addr, &data, 1) < 0) { ret = -EIO; goto out_tsk; @@ -1392,16 +1479,20 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, ret = 0; goto out_tsk; - case PTRACE_OLD_GETSIGINFO: /* for backwards-compatibility */ + case PTRACE_OLD_GETSIGINFO: + /* for backwards-compatibility */ ret = ptrace_request(child, PTRACE_GETSIGINFO, addr, data); goto out_tsk; - case PTRACE_OLD_SETSIGINFO: /* for backwards-compatibility */ + case PTRACE_OLD_SETSIGINFO: + /* for backwards-compatibility */ ret = ptrace_request(child, PTRACE_SETSIGINFO, addr, data); goto out_tsk; - case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ - case PTRACE_CONT: /* restart after signal. */ + case PTRACE_SYSCALL: + /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: + /* restart after signal. */ ret = -EIO; if (data > _NSIG) goto out_tsk; @@ -1411,7 +1502,10 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->exit_code = data; - /* make sure the single step/taken-branch trap bits are not set: */ + /* + * Make sure the single step/taken-branch trap bits + * are not set: + */ ia64_psr(pt)->ss = 0; ia64_psr(pt)->tb = 0; @@ -1425,19 +1519,18 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, * sigkill. Perhaps it should be put in the status * that it wants to exit. */ - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) + /* already dead */ goto out_tsk; child->exit_code = SIGKILL; - /* make sure the single step/take-branch tra bits are not set: */ - ia64_psr(pt)->ss = 0; - ia64_psr(pt)->tb = 0; - + ptrace_disable(child); wake_up_process(child); ret = 0; goto out_tsk; - case PTRACE_SINGLESTEP: /* let child execute for one instruction */ + case PTRACE_SINGLESTEP: + /* let child execute for one instruction */ case PTRACE_SINGLEBLOCK: ret = -EIO; if (data > _NSIG) @@ -1456,16 +1549,19 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, ret = 0; goto out_tsk; - case PTRACE_DETACH: /* detach a process that was attached. */ + case PTRACE_DETACH: + /* detach a process that was attached. */ ret = ptrace_detach(child, data); goto out_tsk; case PTRACE_GETREGS: - ret = ptrace_getregs(child, (struct pt_all_user_regs __user *) data); + ret = ptrace_getregs(child, + (struct pt_all_user_regs __user *) data); goto out_tsk; case PTRACE_SETREGS: - ret = ptrace_setregs(child, (struct pt_all_user_regs __user *) data); + ret = ptrace_setregs(child, + (struct pt_all_user_regs __user *) data); goto out_tsk; default: @@ -1488,15 +1584,16 @@ syscall_trace (void) if (!(current->ptrace & PT_PTRACED)) return; /* - * The 0x80 provides a way for the tracing parent to distinguish between a syscall - * stop and SIGTRAP delivery. + * The 0x80 provides a way for the tracing parent to + * distinguish between a syscall stop and SIGTRAP delivery. */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); + ptrace_notify(SIGTRAP + | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); /* - * This isn't the same as continuing with a signal, but it will do for normal use. - * strace only continues with a signal if the stopping signal is not SIGTRAP. - * -brl + * This isn't the same as continuing with a signal, but it + * will do for normal use. strace only continues with a + * signal if the stopping signal is not SIGTRAP. -brl */ if (current->exit_code) { send_sig(current->exit_code, current, 1); @@ -1508,21 +1605,22 @@ syscall_trace (void) asmlinkage void syscall_trace_enter (long arg0, long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6, long arg7, long stack) + long arg4, long arg5, long arg6, long arg7, + struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &stack; long syscall; if (unlikely(current->audit_context)) { - if (IS_IA32_PROCESS(regs)) - syscall = regs->r1; + if (IS_IA32_PROCESS(®s)) + syscall = regs.r1; else - syscall = regs->r15; + syscall = regs.r15; audit_syscall_entry(current, syscall, arg0, arg1, arg2, arg3); } - if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED)) + if (test_thread_flag(TIF_SYSCALL_TRACE) + && (current->ptrace & PT_PTRACED)) syscall_trace(); } @@ -1530,11 +1628,13 @@ syscall_trace_enter (long arg0, long arg1, long arg2, long arg3, asmlinkage void syscall_trace_leave (long arg0, long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6, long arg7, long stack) + long arg4, long arg5, long arg6, long arg7, + struct pt_regs regs) { if (unlikely(current->audit_context)) - audit_syscall_exit(current, ((struct pt_regs *) &stack)->r8); + audit_syscall_exit(current, regs.r8); - if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED)) + if (test_thread_flag(TIF_SYSCALL_TRACE) + && (current->ptrace & PT_PTRACED)) syscall_trace(); } diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c index 3ec0d2d22..acc0f132f 100644 --- a/arch/ia64/kernel/sal.c +++ b/arch/ia64/kernel/sal.c @@ -18,7 +18,7 @@ #include #include -spinlock_t sal_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; + __cacheline_aligned DEFINE_SPINLOCK(sal_lock); unsigned long sal_platform_features; unsigned short sal_revision; diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 500e1050c..d227fabec 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c @@ -19,6 +19,9 @@ * * Jan 28 2004 kaos@sgi.com * Periodically check for outstanding MCA or INIT records. + * + * Dec 5 2004 kaos@sgi.com + * Standardize which records are cleared automatically. */ #include @@ -230,8 +233,8 @@ salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe) } } -/* Check for outstanding MCA/INIT records every 5 minutes (arbitrary) */ -#define SALINFO_TIMER_DELAY (5*60*HZ) +/* Check for outstanding MCA/INIT records every minute (arbitrary) */ +#define SALINFO_TIMER_DELAY (60*HZ) static struct timer_list salinfo_timer; static void @@ -382,8 +385,11 @@ static void salinfo_log_read_cpu(void *context) { struct salinfo_data *data = context; + sal_log_record_header_t *rh; data->log_size = ia64_sal_get_state_info(data->type, (u64 *) data->log_buffer); - if (data->type == SAL_INFO_TYPE_CPE || data->type == SAL_INFO_TYPE_CMC) + rh = (sal_log_record_header_t *)(data->log_buffer); + /* Clear corrected errors as they are read from SAL */ + if (rh->severity == sal_log_severity_corrected) ia64_sal_clear_state_info(data->type); } @@ -457,6 +463,7 @@ salinfo_log_clear_cpu(void *context) static int salinfo_log_clear(struct salinfo_data *data, int cpu) { + sal_log_record_header_t *rh; data->state = STATE_NO_DATA; if (!test_bit(cpu, &data->cpu_event)) return 0; @@ -469,10 +476,9 @@ salinfo_log_clear(struct salinfo_data *data, int cpu) data->saved_num = 0; spin_unlock_irqrestore(&data_saved_lock, flags); } - /* ia64_mca_log_sal_error_record or salinfo_log_read_cpu already cleared - * CPE and CMC errors - */ - if (data->type != SAL_INFO_TYPE_CPE && data->type != SAL_INFO_TYPE_CMC) + rh = (sal_log_record_header_t *)(data->log_buffer); + /* Corrected errors have already been cleared from SAL */ + if (rh->severity != sal_log_severity_corrected) call_on_cpu(cpu, salinfo_log_clear_cpu, data); /* clearing a record may make a new record visible */ salinfo_log_new_read(cpu, data); diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index da88d284e..29684bf18 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -1,7 +1,7 @@ /* * Architecture-specific setup. * - * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co + * Copyright (C) 1998-2001, 2003-2004 Hewlett-Packard Co * David Mosberger-Tang * Stephane Eranian * Copyright (C) 2000, Rohit Seth @@ -258,25 +258,6 @@ io_port_init (void) num_io_spaces = 1; } -#ifdef CONFIG_SERIAL_8250_CONSOLE -static void __init -setup_serial_legacy (void) -{ - struct uart_port port; - unsigned int i, iobase[] = {0x3f8, 0x2f8}; - - printk(KERN_INFO "Registering legacy COM ports for serial console\n"); - memset(&port, 0, sizeof(port)); - port.iotype = SERIAL_IO_PORT; - port.uartclk = BASE_BAUD * 16; - for (i = 0; i < ARRAY_SIZE(iobase); i++) { - port.line = i; - port.iobase = iobase[i]; - early_serial_setup(&port); - } -} -#endif - /** * early_console_setup - setup debugging console * @@ -287,19 +268,36 @@ setup_serial_legacy (void) * Returns non-zero if a console couldn't be setup. */ static inline int __init -early_console_setup (void) +early_console_setup (char *cmdline) { #ifdef CONFIG_SERIAL_SGI_L1_CONSOLE { extern int sn_serial_console_early_setup(void); - if(!sn_serial_console_early_setup()) + if (!sn_serial_console_early_setup()) return 0; } #endif +#ifdef CONFIG_EFI_PCDP + if (!efi_setup_pcdp_console(cmdline)) + return 0; +#endif +#ifdef CONFIG_SERIAL_8250_CONSOLE + if (!early_serial_console_init(cmdline)) + return 0; +#endif return -1; } +static inline void +mark_bsp_online (void) +{ +#ifdef CONFIG_SMP + /* If we register an early console, allow CPU 0 to printk */ + cpu_set(smp_processor_id(), cpu_online_map); +#endif +} + void __init setup_arch (char **cmdline_p) { @@ -314,14 +312,32 @@ setup_arch (char **cmdline_p) io_port_init(); #ifdef CONFIG_IA64_GENERIC - machvec_init(acpi_get_sysname()); + { + const char *mvec_name = strstr (*cmdline_p, "machvec="); + char str[64]; + + if (mvec_name) { + const char *end; + size_t len; + + mvec_name += 8; + end = strchr (mvec_name, ' '); + if (end) + len = end - mvec_name; + else + len = strlen (mvec_name); + len = min(len, sizeof (str) - 1); + strncpy (str, mvec_name, len); + str[len] = '\0'; + mvec_name = str; + } else + mvec_name = acpi_get_sysname(); + machvec_init(mvec_name); + } #endif -#ifdef CONFIG_SMP - /* If we register an early console, allow CPU 0 to printk */ - if (!early_console_setup()) - cpu_set(smp_processor_id(), cpu_online_map); -#endif + if (early_console_setup(*cmdline_p) == 0) + mark_bsp_online(); #ifdef CONFIG_ACPI_BOOT /* Initialize the ACPI boot-time table parser */ @@ -349,13 +365,6 @@ setup_arch (char **cmdline_p) #ifdef CONFIG_ACPI_BOOT acpi_boot_init(); #endif -#ifdef CONFIG_EFI_PCDP - efi_setup_pcdp_console(*cmdline_p); -#endif -#ifdef CONFIG_SERIAL_8250_CONSOLE - if (!efi.hcdp) - setup_serial_legacy(); -#endif #ifdef CONFIG_VT if (!conswitchp) { @@ -378,7 +387,7 @@ setup_arch (char **cmdline_p) /* enable IA-64 Machine Check Abort Handling unless disabled */ if (!strstr(saved_command_line, "nomca")) ia64_mca_init(); - + platform_setup(cmdline_p); paging_init(); } @@ -600,6 +609,14 @@ cpu_init (void) cpu_data = per_cpu_init(); + /* + * We set ar.k3 so that assembly code in MCA handler can compute + * physical addresses of per cpu variables with a simple: + * phys = ar.k3 + &per_cpu_var + */ + ia64_set_kr(IA64_KR_PER_CPU_DATA, + ia64_tpa(cpu_data) - (long) __per_cpu_start); + get_max_cacheline_size(); /* @@ -646,6 +663,7 @@ cpu_init (void) BUG(); ia64_mmu_init(ia64_imva(cpu_data)); + ia64_mca_cpu_init(ia64_imva(cpu_data)); #ifdef CONFIG_IA32_SUPPORT ia32_cpu_init(); diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index 135cb55b1..499b7e531 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c @@ -84,12 +84,11 @@ ia64_rt_sigsuspend (sigset_t __user *uset, size_t sigsetsize, struct sigscratch } asmlinkage long -sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2, long arg3, long arg4, - long arg5, long arg6, long arg7, long stack) +sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2, + long arg3, long arg4, long arg5, long arg6, long arg7, + struct pt_regs regs) { - struct pt_regs *pt = (struct pt_regs *) &stack; - - return do_sigaltstack(uss, uoss, pt->r12); + return do_sigaltstack(uss, uoss, regs.r12); } static long @@ -225,7 +224,8 @@ ia64_rt_sigreturn (struct sigscratch *scr) * could be corrupted. */ retval = (long) &ia64_leave_kernel; - if (test_thread_flag(TIF_SYSCALL_TRACE)) + if (test_thread_flag(TIF_SYSCALL_TRACE) + || test_thread_flag(TIF_SYSCALL_AUDIT)) /* * strace expects to be notified after sigreturn returns even though the * context to which we return may not be in the middle of a syscall. @@ -290,12 +290,10 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc if (on_sig_stack((unsigned long) sc)) flags |= IA64_SC_FLAG_ONSTACK; - if ((ifs & (1UL << 63)) == 0) { - /* if cr_ifs isn't valid, we got here through a syscall */ + if ((ifs & (1UL << 63)) == 0) + /* if cr_ifs doesn't have the valid bit set, we got here through a syscall */ flags |= IA64_SC_FLAG_IN_SYSCALL; - cfm = scr->ar_pfs & ((1UL << 38) - 1); - } else - cfm = ifs & ((1UL << 38) - 1); + cfm = ifs & ((1UL << 38) - 1); ia64_flush_fph(current); if ((current->thread.flags & IA64_THREAD_FPH_VALID)) { flags |= IA64_SC_FLAG_FPH_VALID; @@ -591,3 +589,104 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall) } return 0; } + +/* Set a delayed signal that was detected in MCA/INIT/NMI/PMI context where it + * could not be delivered. It is important that the target process is not + * allowed to do any more work in user space. Possible cases for the target + * process: + * + * - It is sleeping and will wake up soon. Store the data in the current task, + * the signal will be sent when the current task returns from the next + * interrupt. + * + * - It is running in user context. Store the data in the current task, the + * signal will be sent when the current task returns from the next interrupt. + * + * - It is running in kernel context on this or another cpu and will return to + * user context. Store the data in the target task, the signal will be sent + * to itself when the target task returns to user space. + * + * - It is running in kernel context on this cpu and will sleep before + * returning to user context. Because this is also the current task, the + * signal will not get delivered and the task could sleep indefinitely. + * Store the data in the idle task for this cpu, the signal will be sent + * after the idle task processes its next interrupt. + * + * To cover all cases, store the data in the target task, the current task and + * the idle task on this cpu. Whatever happens, the signal will be delivered + * to the target task before it can do any useful user space work. Multiple + * deliveries have no unwanted side effects. + * + * Note: This code is executed in MCA/INIT/NMI/PMI context, with interrupts + * disabled. It must not take any locks nor use kernel structures or services + * that require locks. + */ + +/* To ensure that we get the right pid, check its start time. To avoid extra + * include files in thread_info.h, convert the task start_time to unsigned long, + * giving us a cycle time of > 580 years. + */ +static inline unsigned long +start_time_ul(const struct task_struct *t) +{ + return t->start_time.tv_sec * NSEC_PER_SEC + t->start_time.tv_nsec; +} + +void +set_sigdelayed(pid_t pid, int signo, int code, void __user *addr) +{ + struct task_struct *t; + unsigned long start_time = 0; + int i; + + for (i = 1; i <= 3; ++i) { + switch (i) { + case 1: + t = find_task_by_pid(pid); + if (t) + start_time = start_time_ul(t); + break; + case 2: + t = current; + break; + default: + t = idle_task(smp_processor_id()); + break; + } + + if (!t) + return; + t->thread_info->sigdelayed.signo = signo; + t->thread_info->sigdelayed.code = code; + t->thread_info->sigdelayed.addr = addr; + t->thread_info->sigdelayed.start_time = start_time; + t->thread_info->sigdelayed.pid = pid; + wmb(); + set_tsk_thread_flag(t, TIF_SIGDELAYED); + } +} + +/* Called from entry.S when it detects TIF_SIGDELAYED, a delayed signal that + * was detected in MCA/INIT/NMI/PMI context where it could not be delivered. + */ + +void +do_sigdelayed(void) +{ + struct siginfo siginfo; + pid_t pid; + struct task_struct *t; + + clear_thread_flag(TIF_SIGDELAYED); + memset(&siginfo, 0, sizeof(siginfo)); + siginfo.si_signo = current_thread_info()->sigdelayed.signo; + siginfo.si_code = current_thread_info()->sigdelayed.code; + siginfo.si_addr = current_thread_info()->sigdelayed.addr; + pid = current_thread_info()->sigdelayed.pid; + t = find_task_by_pid(pid); + if (!t) + return; + if (current_thread_info()->sigdelayed.start_time != start_time_ul(t)) + return; + force_sig_info(siginfo.si_signo, &siginfo, t); +} diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c index 14134f2e3..4149a0d49 100644 --- a/arch/ia64/kernel/smp.c +++ b/arch/ia64/kernel/smp.c @@ -29,9 +29,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -52,7 +52,7 @@ * Structure and data for smp_call_function(). This is designed to minimise static memory * requirements. It also looks cleaner. */ -static spinlock_t call_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -290,11 +290,11 @@ smp_call_function_single (int cpuid, void (*func) (void *info), void *info, int /* Wait for response */ while (atomic_read(&data.started) != cpus) - barrier(); + cpu_relax(); if (wait) while (atomic_read(&data.finished) != cpus) - barrier(); + cpu_relax(); call_data = NULL; spin_unlock_bh(&call_lock); @@ -349,11 +349,11 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai /* Wait for response */ while (atomic_read(&data.started) != cpus) - barrier(); + cpu_relax(); if (wait) while (atomic_read(&data.finished) != cpus) - barrier(); + cpu_relax(); call_data = NULL; spin_unlock(&call_lock); diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index f0dd8c3dc..02dc1fc08 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c @@ -29,9 +29,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -68,7 +68,7 @@ #define NUM_ROUNDS 64 /* magic value */ #define NUM_ITERS 5 /* likewise */ -static spinlock_t itc_sync_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(itc_sync_lock); static volatile unsigned long go[SLAVE + 1]; #define DEBUG_ITC_SYNC 0 @@ -343,8 +343,6 @@ smp_callin (void) int __devinit start_secondary (void *unused) { - extern int cpu_idle (void); - /* Early console may use I/O ports */ ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase)); @@ -353,7 +351,8 @@ start_secondary (void *unused) cpu_init(); smp_callin(); - return cpu_idle(); + cpu_idle(); + return 0; } struct pt_regs * __devinit idle_regs(struct pt_regs *regs) @@ -613,8 +612,7 @@ void __cpu_die(unsigned int cpu) */ return; } - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ/10); + msleep(100); } printk(KERN_ERR "CPU %u didn't die...\n", cpu); } diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c index 88d8b217f..3ac216e1c 100644 --- a/arch/ia64/kernel/sys_ia64.c +++ b/arch/ia64/kernel/sys_ia64.c @@ -2,7 +2,7 @@ * This file contains various system calls that have different calling * conventions on different platforms. * - * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co + * Copyright (C) 1999-2000, 2002-2003, 2005 Hewlett-Packard Co * David Mosberger-Tang */ #include @@ -138,7 +138,7 @@ ia64_brk (unsigned long brk) goto out; /* Check against rlimit.. */ - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim < RLIM_INFINITY && brk - mm->start_data > rlim) goto out; @@ -163,10 +163,9 @@ out: * and r9) as this is faster than doing a copy_to_user(). */ asmlinkage long -sys_pipe (long arg0, long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6, long arg7, long stack) +sys_pipe (void) { - struct pt_regs *regs = (struct pt_regs *) &stack; + struct pt_regs *regs = ia64_task_regs(current); int fd[2]; int retval; diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 853d8dae7..8b8a5a45b 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -32,7 +32,7 @@ extern unsigned long wall_jiffies; -u64 jiffies_64 = INITIAL_JIFFIES; +u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); @@ -45,7 +45,11 @@ EXPORT_SYMBOL(last_cli_ip); #endif -static struct time_interpolator itc_interpolator; +static struct time_interpolator itc_interpolator = { + .shift = 16, + .mask = 0xffffffffffffffffLL, + .source = TIME_SOURCE_CPU +}; static irqreturn_t timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) @@ -67,14 +71,8 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) profile_tick(CPU_PROFILING, regs); while (1) { -#ifdef CONFIG_SMP - /* - * For UP, this is done in do_timer(). Weird, but - * fixing that would require updates to all - * platforms. - */ update_process_times(user_mode(regs)); -#endif + new_itm += local_cpu_data->itm_delta; if (smp_processor_id() == TIME_KEEPER_ID) { @@ -192,17 +190,20 @@ ia64_init_itm (void) itc_ratio.den = 1; /* avoid division by zero */ itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den; - if (platform_base_drift != -1) - itc_drift = platform_base_drift*itc_ratio.num/itc_ratio.den; - else - itc_drift = -1; local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ; printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, " - "ITC freq=%lu.%03luMHz+/-%ldppm\n", smp_processor_id(), + "ITC freq=%lu.%03luMHz", smp_processor_id(), platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000, - itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000, - itc_drift); + itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000); + + if (platform_base_drift != -1) { + itc_drift = platform_base_drift*itc_ratio.num/itc_ratio.den; + printk("+/-%ldppm\n", itc_drift); + } else { + itc_drift = -1; + printk("\n"); + } local_cpu_data->proc_freq = (platform_base_freq*proc_ratio.num)/proc_ratio.den; local_cpu_data->itc_freq = itc_freq; @@ -212,9 +213,7 @@ ia64_init_itm (void) if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) { itc_interpolator.frequency = local_cpu_data->itc_freq; - itc_interpolator.shift = 16; itc_interpolator.drift = itc_drift; - itc_interpolator.source = TIME_SOURCE_CPU; #ifdef CONFIG_SMP /* On IA64 in an SMP configuration ITCs are never accurately synchronized. * Jitter compensation requires a cmpxchg which may limit @@ -228,7 +227,6 @@ ia64_init_itm (void) */ if (!nojitter) itc_interpolator.jitter = 1; #endif - itc_interpolator.addr = NULL; register_time_interpolator(&itc_interpolator); } diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index 3dd9b1dc7..e82ad7808 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c @@ -358,11 +358,10 @@ struct illegal_op_return { }; struct illegal_op_return -ia64_illegal_op_fault (unsigned long ec, unsigned long arg1, unsigned long arg2, - unsigned long arg3, unsigned long arg4, unsigned long arg5, - unsigned long arg6, unsigned long arg7, unsigned long stack) +ia64_illegal_op_fault (unsigned long ec, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6, long arg7, + struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &stack; struct illegal_op_return rv; struct siginfo si; char buf[128]; @@ -371,19 +370,19 @@ ia64_illegal_op_fault (unsigned long ec, unsigned long arg1, unsigned long arg2, { extern struct illegal_op_return ia64_emulate_brl (struct pt_regs *, unsigned long); - rv = ia64_emulate_brl(regs, ec); + rv = ia64_emulate_brl(®s, ec); if (rv.fkt != (unsigned long) -1) return rv; } #endif sprintf(buf, "IA-64 Illegal operation fault"); - die_if_kernel(buf, regs, 0); + die_if_kernel(buf, ®s, 0); memset(&si, 0, sizeof(si)); si.si_signo = SIGILL; si.si_code = ILL_ILLOPC; - si.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); + si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(®s)->ri); force_sig_info(SIGILL, &si, current); rv.fkt = 0; return rv; @@ -391,11 +390,10 @@ ia64_illegal_op_fault (unsigned long ec, unsigned long arg1, unsigned long arg2, void ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, - unsigned long iim, unsigned long itir, unsigned long arg5, - unsigned long arg6, unsigned long arg7, unsigned long stack) + unsigned long iim, unsigned long itir, long arg5, long arg6, + long arg7, struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &stack; - unsigned long code, error = isr; + unsigned long code, error = isr, iip; struct siginfo siginfo; char buf[128]; int result, sig; @@ -415,10 +413,12 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, * This fault was due to lfetch.fault, set "ed" bit in the psr to cancel * the lfetch. */ - ia64_psr(regs)->ed = 1; + ia64_psr(®s)->ed = 1; return; } + iip = regs.cr_iip + ia64_psr(®s)->ri; + switch (vector) { case 24: /* General Exception */ code = (isr >> 4) & 0xf; @@ -428,8 +428,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, if (code == 8) { # ifdef CONFIG_IA64_PRINT_HAZARDS printk("%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n", - current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, - regs->pr); + current->comm, current->pid, + regs.cr_iip + ia64_psr(®s)->ri, regs.pr); # endif return; } @@ -437,14 +437,14 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, case 25: /* Disabled FP-Register */ if (isr & 2) { - disabled_fph_fault(regs); + disabled_fph_fault(®s); return; } sprintf(buf, "Disabled FPL fault---not supposed to happen!"); break; case 26: /* NaT Consumption */ - if (user_mode(regs)) { + if (user_mode(®s)) { void __user *addr; if (((isr >> 4) & 0xf) == 2) { @@ -456,7 +456,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, /* register NaT consumption */ sig = SIGILL; code = ILL_ILLOPN; - addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); + addr = (void __user *) (regs.cr_iip + + ia64_psr(®s)->ri); } siginfo.si_signo = sig; siginfo.si_code = code; @@ -467,17 +468,17 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, siginfo.si_isr = isr; force_sig_info(sig, &siginfo, current); return; - } else if (ia64_done_with_exception(regs)) + } else if (ia64_done_with_exception(®s)) return; sprintf(buf, "NaT consumption"); break; case 31: /* Unsupported Data Reference */ - if (user_mode(regs)) { + if (user_mode(®s)) { siginfo.si_signo = SIGILL; siginfo.si_code = ILL_ILLOPN; siginfo.si_errno = 0; - siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_addr = (void __user *) iip; siginfo.si_imm = vector; siginfo.si_flags = __ISR_VALID; siginfo.si_isr = isr; @@ -490,7 +491,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, case 29: /* Debug */ case 35: /* Taken Branch Trap */ case 36: /* Single Step Trap */ - if (fsys_mode(current, regs)) { + if (fsys_mode(current, ®s)) { extern char __kernel_syscall_via_break[]; /* * Got a trap in fsys-mode: Taken Branch Trap and Single Step trap @@ -498,13 +499,13 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, */ if (unlikely(vector == 29)) { die("Got debug trap in fsys-mode---not supposed to happen!", - regs, 0); + ®s, 0); return; } /* re-do the system call via break 0x100000: */ - regs->cr_iip = (unsigned long) __kernel_syscall_via_break; - ia64_psr(regs)->ri = 0; - ia64_psr(regs)->cpl = 3; + regs.cr_iip = (unsigned long) __kernel_syscall_via_break; + ia64_psr(®s)->ri = 0; + ia64_psr(®s)->cpl = 3; return; } switch (vector) { @@ -515,8 +516,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, * Erratum 10 (IFA may contain incorrect address) now has * "NoFix" status. There are no plans for fixing this. */ - if (ia64_psr(regs)->is == 0) - ifa = regs->cr_iip; + if (ia64_psr(®s)->is == 0) + ifa = regs.cr_iip; #endif break; case 35: siginfo.si_code = TRAP_BRANCH; ifa = 0; break; @@ -533,12 +534,12 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, case 32: /* fp fault */ case 33: /* fp trap */ - result = handle_fpu_swa((vector == 32) ? 1 : 0, regs, isr); + result = handle_fpu_swa((vector == 32) ? 1 : 0, ®s, isr); if ((result < 0) || (current->thread.flags & IA64_THREAD_FPEMU_SIGFPE)) { siginfo.si_signo = SIGFPE; siginfo.si_errno = 0; siginfo.si_code = FPE_FLTINV; - siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_addr = (void __user *) iip; siginfo.si_flags = __ISR_VALID; siginfo.si_isr = isr; siginfo.si_imm = 0; @@ -554,19 +555,18 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, * interesting work (e.g., signal delivery is done in the kernel * exit path). */ - ia64_psr(regs)->lp = 0; + ia64_psr(®s)->lp = 0; return; } else { /* Unimplemented Instr. Address Trap */ - if (user_mode(regs)) { + if (user_mode(®s)) { siginfo.si_signo = SIGILL; siginfo.si_code = ILL_BADIADDR; siginfo.si_errno = 0; siginfo.si_flags = 0; siginfo.si_isr = 0; siginfo.si_imm = 0; - siginfo.si_addr = (void __user *) - (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_addr = (void __user *) iip; force_sig_info(SIGILL, &siginfo, current); return; } @@ -576,23 +576,23 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, case 45: #ifdef CONFIG_IA32_SUPPORT - if (ia32_exception(regs, isr) == 0) + if (ia32_exception(®s, isr) == 0) return; #endif printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n"); printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", - regs->cr_iip, ifa, isr); + iip, ifa, isr); force_sig(SIGSEGV, current); break; case 46: #ifdef CONFIG_IA32_SUPPORT - if (ia32_intercept(regs, isr) == 0) + if (ia32_intercept(®s, isr) == 0) return; #endif printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n"); printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", - regs->cr_iip, ifa, isr, iim); + iip, ifa, isr, iim); force_sig(SIGSEGV, current); return; @@ -604,6 +604,6 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, sprintf(buf, "Fault %lu", vector); break; } - die_if_kernel(buf, regs, error); + die_if_kernel(buf, ®s, error); force_sig(SIGILL, current); } diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index 69e095abe..d494ff647 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c @@ -47,8 +47,6 @@ #include "entry.h" #include "unwind_i.h" -#define p5 5 - #define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */ #define UNW_CACHE_SIZE (1 << UNW_LOG_CACHE_SIZE) @@ -1269,7 +1267,6 @@ script_new (unsigned long ip) { struct unw_script *script, *prev, *tmp; unw_hash_index_t index; - unsigned long flags; unsigned short head; STAT(++unw.stat.script.news); @@ -1278,13 +1275,9 @@ script_new (unsigned long ip) * Can't (easily) use cmpxchg() here because of ABA problem * that is intrinsic in cmpxchg()... */ - spin_lock_irqsave(&unw.lock, flags); - { - head = unw.lru_head; - script = unw.cache + head; - unw.lru_head = script->lru_chain; - } - spin_unlock(&unw.lock); + head = unw.lru_head; + script = unw.cache + head; + unw.lru_head = script->lru_chain; /* * We'd deadlock here if we interrupted a thread that is holding a read lock on @@ -1295,43 +1288,39 @@ script_new (unsigned long ip) if (!write_trylock(&script->lock)) return NULL; - spin_lock(&unw.lock); - { - /* re-insert script at the tail of the LRU chain: */ - unw.cache[unw.lru_tail].lru_chain = head; - unw.lru_tail = head; - - /* remove the old script from the hash table (if it's there): */ - if (script->ip) { - index = hash(script->ip); - tmp = unw.cache + unw.hash[index]; - prev = NULL; - while (1) { - if (tmp == script) { - if (prev) - prev->coll_chain = tmp->coll_chain; - else - unw.hash[index] = tmp->coll_chain; - break; - } else - prev = tmp; - if (tmp->coll_chain >= UNW_CACHE_SIZE) - /* old script wasn't in the hash-table */ - break; - tmp = unw.cache + tmp->coll_chain; - } + /* re-insert script at the tail of the LRU chain: */ + unw.cache[unw.lru_tail].lru_chain = head; + unw.lru_tail = head; + + /* remove the old script from the hash table (if it's there): */ + if (script->ip) { + index = hash(script->ip); + tmp = unw.cache + unw.hash[index]; + prev = NULL; + while (1) { + if (tmp == script) { + if (prev) + prev->coll_chain = tmp->coll_chain; + else + unw.hash[index] = tmp->coll_chain; + break; + } else + prev = tmp; + if (tmp->coll_chain >= UNW_CACHE_SIZE) + /* old script wasn't in the hash-table */ + break; + tmp = unw.cache + tmp->coll_chain; } + } - /* enter new script in the hash table */ - index = hash(ip); - script->coll_chain = unw.hash[index]; - unw.hash[index] = script - unw.cache; + /* enter new script in the hash table */ + index = hash(ip); + script->coll_chain = unw.hash[index]; + unw.hash[index] = script - unw.cache; - script->ip = ip; /* set new IP while we're holding the locks */ + script->ip = ip; /* set new IP while we're holding the locks */ - STAT(if (script->coll_chain < UNW_CACHE_SIZE) ++unw.stat.script.collisions); - } - spin_unlock_irqrestore(&unw.lock, flags); + STAT(if (script->coll_chain < UNW_CACHE_SIZE) ++unw.stat.script.collisions); script->flags = 0; script->hint = 0; @@ -1830,6 +1819,7 @@ find_save_locs (struct unw_frame_info *info) { int have_write_lock = 0; struct unw_script *scr; + unsigned long flags = 0; if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) { /* don't let obviously bad addresses pollute the cache */ @@ -1841,8 +1831,10 @@ find_save_locs (struct unw_frame_info *info) scr = script_lookup(info); if (!scr) { + spin_lock_irqsave(&unw.lock, flags); scr = build_script(info); if (!scr) { + spin_unlock_irqrestore(&unw.lock, flags); UNW_DPRINT(0, "unwind.%s: failed to locate/build unwind script for ip %lx\n", __FUNCTION__, info->ip); @@ -1855,9 +1847,10 @@ find_save_locs (struct unw_frame_info *info) run_script(scr, info); - if (have_write_lock) + if (have_write_lock) { write_unlock(&scr->lock); - else + spin_unlock_irqrestore(&unw.lock, flags); + } else read_unlock(&scr->lock); return 0; } @@ -1904,7 +1897,7 @@ unw_unwind (struct unw_frame_info *info) num_regs = 0; if ((info->flags & UNW_FLAG_INTERRUPT_FRAME)) { info->pt = info->sp + 16; - if ((pr & (1UL << pNonSys)) != 0) + if ((pr & (1UL << PRED_NON_SYSCALL)) != 0) num_regs = *info->cfm_loc & 0x7f; /* size of frame */ info->pfs_loc = (unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs)); @@ -1950,7 +1943,7 @@ EXPORT_SYMBOL(unw_unwind); int unw_unwind_to_user (struct unw_frame_info *info) { - unsigned long ip; + unsigned long ip, sp; while (unw_unwind(info) >= 0) { if (unw_get_rp(info, &ip) < 0) { @@ -1959,6 +1952,9 @@ unw_unwind_to_user (struct unw_frame_info *info) __FUNCTION__, ip); return -1; } + unw_get_sp(info, &sp); + if (sp >= (unsigned long)info->task + IA64_STK_OFFSET) + break; if (ip < FIXADDR_USER_END) return 0; } @@ -2056,6 +2052,8 @@ unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t, struct find_save_locs(info); } +EXPORT_SYMBOL(unw_init_frame_info); + void unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t) { @@ -2259,7 +2257,7 @@ unw_init (void) if (i > 0) unw.cache[i].lru_chain = (i - 1); unw.cache[i].coll_chain = -1; - unw.cache[i].lock = RW_LOCK_UNLOCKED; + rwlock_init(&unw.cache[i].lock); } unw.lru_head = UNW_CACHE_SIZE - 1; unw.lru_tail = 0; diff --git a/arch/ia64/lib/bitop.c b/arch/ia64/lib/bitop.c index 1c6ee49fd..82e299c84 100644 --- a/arch/ia64/lib/bitop.c +++ b/arch/ia64/lib/bitop.c @@ -2,13 +2,13 @@ #include #include #include -#include +#include /* * Find next zero bit in a bitmap reasonably efficiently.. */ -int __find_next_zero_bit (void *addr, unsigned long size, unsigned long offset) +int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 6); unsigned long result = offset & ~63UL; diff --git a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c index ca7ba1e9c..36866e8a5 100644 --- a/arch/ia64/lib/csum_partial_copy.c +++ b/arch/ia64/lib/csum_partial_copy.c @@ -105,8 +105,8 @@ out: extern unsigned long do_csum(const unsigned char *, long); static unsigned int -do_csum_partial_copy_from_user (const char __user *src, char *dst, int len, - unsigned int psum, int *errp) +do_csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, + int len, unsigned int psum, int *errp) { unsigned long result; @@ -129,8 +129,8 @@ do_csum_partial_copy_from_user (const char __user *src, char *dst, int len, } unsigned int -csum_partial_copy_from_user (const char __user *src, char *dst, int len, - unsigned int sum, int *errp) +csum_partial_copy_from_user (const unsigned char __user *src, unsigned char *dst, + int len, unsigned int sum, int *errp) { if (!access_ok(VERIFY_READ, src, len)) { *errp = -EFAULT; @@ -142,7 +142,8 @@ csum_partial_copy_from_user (const char __user *src, char *dst, int len, } unsigned int -csum_partial_copy_nocheck(const char __user *src, char *dst, int len, unsigned int sum) +csum_partial_copy_nocheck(const unsigned char __user *src, unsigned char *dst, + int len, unsigned int sum) { return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); } diff --git a/arch/ia64/lib/dec_and_lock.c b/arch/ia64/lib/dec_and_lock.c index 46bdc0490..c7ce92f96 100644 --- a/arch/ia64/lib/dec_and_lock.c +++ b/arch/ia64/lib/dec_and_lock.c @@ -19,7 +19,7 @@ * acquiring the spinlock first. */ int -atomic_dec_and_lock (atomic_t *refcount, spinlock_t *lock) +_atomic_dec_and_lock (atomic_t *refcount, spinlock_t *lock) { int old, new; @@ -39,4 +39,4 @@ atomic_dec_and_lock (atomic_t *refcount, spinlock_t *lock) return 0; } -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); diff --git a/arch/ia64/lib/io.c b/arch/ia64/lib/io.c index 2bc5be82d..8949e4409 100644 --- a/arch/ia64/lib/io.c +++ b/arch/ia64/lib/io.c @@ -8,8 +8,7 @@ * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */ -void -__ia64_memcpy_fromio (void *to, volatile void __iomem *from, long count) +void memcpy_fromio(void *to, const volatile void __iomem *from, long count) { char *dst = to; @@ -18,30 +17,28 @@ __ia64_memcpy_fromio (void *to, volatile void __iomem *from, long count) *dst++ = readb(from++); } } -EXPORT_SYMBOL(__ia64_memcpy_fromio); +EXPORT_SYMBOL(memcpy_fromio); /* * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void -__ia64_memcpy_toio (volatile void __iomem *to, void *from, long count) +void memcpy_toio(volatile void __iomem *to, const void *from, long count) { - char *src = from; + const char *src = from; while (count) { count--; writeb(*src++, to++); } } -EXPORT_SYMBOL(__ia64_memcpy_toio); +EXPORT_SYMBOL(memcpy_toio); /* * "memset" on IO memory space. * This needs to be optimized. */ -void -__ia64_memset_c_io (volatile void __iomem *dst, unsigned long c, long count) +void memset_io(volatile void __iomem *dst, int c, long count) { unsigned char ch = (char)(c & 0xff); @@ -51,7 +48,7 @@ __ia64_memset_c_io (volatile void __iomem *dst, unsigned long c, long count) dst++; } } -EXPORT_SYMBOL(__ia64_memset_c_io); +EXPORT_SYMBOL(memset_io); #ifdef CONFIG_IA64_GENERIC @@ -73,6 +70,7 @@ EXPORT_SYMBOL(__ia64_memset_c_io); #undef __ia64_writew #undef __ia64_writel #undef __ia64_writeq +#undef __ia64_mmiowb unsigned int __ia64_inb (unsigned long port) @@ -158,4 +156,10 @@ __ia64_readq_relaxed (void __iomem *addr) return ___ia64_readq (addr); } +void +__ia64_mmiowb(void) +{ + ___ia64_mmiowb(); +} + #endif /* CONFIG_IA64_GENERIC */ diff --git a/arch/ia64/lib/memcpy.S b/arch/ia64/lib/memcpy.S index 0cdd373fe..448908d80 100644 --- a/arch/ia64/lib/memcpy.S +++ b/arch/ia64/lib/memcpy.S @@ -15,22 +15,6 @@ */ #include -GLOBAL_ENTRY(bcopy) - .regstk 3,0,0,0 - mov r8=in0 - mov in0=in1 - ;; - mov in1=r8 - // gas doesn't handle control flow across procedures, so it doesn't - // realize that a stop bit is needed before the "alloc" instruction - // below -{ - nop.m 0 - nop.f 0 - nop.i 0 -} ;; -END(bcopy) - // FALL THROUGH GLOBAL_ENTRY(memcpy) # define MEM_LAT 21 /* latency to memory */ diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S index b1f806a7d..6f26ef7cc 100644 --- a/arch/ia64/lib/memcpy_mck.S +++ b/arch/ia64/lib/memcpy_mck.S @@ -17,15 +17,6 @@ #define EK(y...) EX(y) -GLOBAL_ENTRY(bcopy) - .regstk 3,0,0,0 - mov r8=in0 - mov in0=in1 - ;; - mov in1=r8 - ;; -END(bcopy) - /* McKinley specific optimization */ #define retval r8 diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c index 9d4486f87..e3e2fb755 100644 --- a/arch/ia64/lib/swiotlb.c +++ b/arch/ia64/lib/swiotlb.c @@ -44,54 +44,57 @@ #define IO_TLB_SEGSIZE 128 /* - * log of the size of each IO TLB slab. The number of slabs is command line controllable. + * log of the size of each IO TLB slab. The number of slabs is command line + * controllable. */ #define IO_TLB_SHIFT 11 int swiotlb_force; /* - * Used to do a quick range check in swiotlb_unmap_single and swiotlb_sync_single_*, to see - * if the memory was in fact allocated by this API. + * Used to do a quick range check in swiotlb_unmap_single and + * swiotlb_sync_single_*, to see if the memory was in fact allocated by this + * API. */ static char *io_tlb_start, *io_tlb_end; /* - * The number of IO TLB blocks (in groups of 64) betweeen io_tlb_start and io_tlb_end. - * This is command line adjustable via setup_io_tlb_npages. - * Default to 64MB. + * The number of IO TLB blocks (in groups of 64) betweeen io_tlb_start and + * io_tlb_end. This is command line adjustable via setup_io_tlb_npages. */ -static unsigned long io_tlb_nslabs = 32768; +static unsigned long io_tlb_nslabs; -/* +/* * When the IOMMU overflows we return a fallback buffer. This sets the size. */ static unsigned long io_tlb_overflow = 32*1024; -void *io_tlb_overflow_buffer; +void *io_tlb_overflow_buffer; /* - * This is a free list describing the number of free entries available from each index + * This is a free list describing the number of free entries available from + * each index */ static unsigned int *io_tlb_list; static unsigned int io_tlb_index; /* - * We need to save away the original address corresponding to a mapped entry for the sync - * operations. + * We need to save away the original address corresponding to a mapped entry + * for the sync operations. */ static unsigned char **io_tlb_orig_addr; /* * Protect the above data structures in the map and unmap calls */ -static spinlock_t io_tlb_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(io_tlb_lock); static int __init -setup_io_tlb_npages (char *str) +setup_io_tlb_npages(char *str) { - if (isdigit(*str)) { - io_tlb_nslabs = simple_strtoul(str, &str, 0) << (PAGE_SHIFT - IO_TLB_SHIFT); + if (isdigit(*str)) { + io_tlb_nslabs = simple_strtoul(str, &str, 0) << + (PAGE_SHIFT - IO_TLB_SHIFT); /* avoid tail segment of size < IO_TLB_SEGSIZE */ io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); } @@ -105,18 +108,24 @@ __setup("swiotlb=", setup_io_tlb_npages); /* make io_tlb_overflow tunable too? */ /* - * Statically reserve bounce buffer space and initialize bounce buffer data structures for - * the software IO TLB used to implement the PCI DMA API. + * Statically reserve bounce buffer space and initialize bounce buffer data + * structures for the software IO TLB used to implement the PCI DMA API. */ void -swiotlb_init (void) +swiotlb_init_with_default_size (size_t default_size) { unsigned long i; + if (!io_tlb_nslabs) { + io_tlb_nslabs = (default_size >> PAGE_SHIFT); + io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); + } + /* * Get IO TLB memory from the low pages */ - io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs * (1 << IO_TLB_SHIFT)); + io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs * + (1 << IO_TLB_SHIFT)); if (!io_tlb_start) panic("Cannot allocate SWIOTLB buffer"); io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT); @@ -131,28 +140,36 @@ swiotlb_init (void) io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); io_tlb_index = 0; io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *)); - - /* - * Get the overflow emergency buffer + + /* + * Get the overflow emergency buffer */ - io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); + io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n", virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end)); } -static inline int address_needs_mapping(struct device *hwdev, dma_addr_t addr) -{ - dma_addr_t mask = 0xffffffff; - if (hwdev && hwdev->dma_mask) - mask = *hwdev->dma_mask; - return (addr & ~mask) != 0; -} +void +swiotlb_init (void) +{ + swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */ +} + +static inline int +address_needs_mapping(struct device *hwdev, dma_addr_t addr) +{ + dma_addr_t mask = 0xffffffff; + /* If the device has a mask, use it, otherwise default to 32 bits */ + if (hwdev && hwdev->dma_mask) + mask = *hwdev->dma_mask; + return (addr & ~mask) != 0; +} /* * Allocates bounce buffer and returns its kernel virtual address. */ static void * -map_single (struct device *hwdev, char *buffer, size_t size, int dir) +map_single(struct device *hwdev, char *buffer, size_t size, int dir) { unsigned long flags; char *dma_addr; @@ -160,11 +177,11 @@ map_single (struct device *hwdev, char *buffer, size_t size, int dir) int i; /* - * For mappings greater than a page size, we limit the stride (and hence alignment) - * to a page size. + * For mappings greater than a page, we limit the stride (and + * hence alignment) to a page size. */ nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT; - if (size > (1 << PAGE_SHIFT)) + if (size > PAGE_SIZE) stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT)); else stride = 1; @@ -173,8 +190,8 @@ map_single (struct device *hwdev, char *buffer, size_t size, int dir) BUG(); /* - * Find suitable number of IO TLB entries size that will fit this request and - * allocate a buffer from that IO TLB pool. + * Find suitable number of IO TLB entries size that will fit this + * request and allocate a buffer from that IO TLB pool. */ spin_lock_irqsave(&io_tlb_lock, flags); { @@ -185,22 +202,23 @@ map_single (struct device *hwdev, char *buffer, size_t size, int dir) do { /* - * If we find a slot that indicates we have 'nslots' number of - * contiguous buffers, we allocate the buffers from that slot and - * mark the entries as '0' indicating unavailable. + * If we find a slot that indicates we have 'nslots' + * number of contiguous buffers, we allocate the + * buffers from that slot and mark the entries as '0' + * indicating unavailable. */ if (io_tlb_list[index] >= nslots) { int count = 0; for (i = index; i < (int) (index + nslots); i++) io_tlb_list[i] = 0; - for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) - && io_tlb_list[i]; i--) + for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && io_tlb_list[i]; i--) io_tlb_list[i] = ++count; dma_addr = io_tlb_start + (index << IO_TLB_SHIFT); /* - * Update the indices to avoid searching in the next round. + * Update the indices to avoid searching in + * the next round. */ io_tlb_index = ((index + nslots) < io_tlb_nslabs ? (index + nslots) : 0); @@ -219,8 +237,9 @@ map_single (struct device *hwdev, char *buffer, size_t size, int dir) spin_unlock_irqrestore(&io_tlb_lock, flags); /* - * Save away the mapping from the original address to the DMA address. This is - * needed when we sync the memory. Then we sync the buffer if needed. + * Save away the mapping from the original address to the DMA address. + * This is needed when we sync the memory. Then we sync the buffer if + * needed. */ io_tlb_orig_addr[index] = buffer; if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) @@ -233,52 +252,51 @@ map_single (struct device *hwdev, char *buffer, size_t size, int dir) * dma_addr is the kernel virtual address of the bounce buffer to unmap. */ static void -unmap_single (struct device *hwdev, char *dma_addr, size_t size, int dir) +unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir) { unsigned long flags; - int i, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT; + int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT; int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; char *buffer = io_tlb_orig_addr[index]; /* * First, sync the memory before unmapping the entry */ - if ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL)) + if (buffer && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))) /* - * bounce... copy the data back into the original buffer * and delete the - * bounce buffer. + * bounce... copy the data back into the original buffer * and + * delete the bounce buffer. */ memcpy(buffer, dma_addr, size); /* - * Return the buffer to the free list by setting the corresponding entries to - * indicate the number of contigous entries available. While returning the - * entries to the free list, we merge the entries with slots below and above the - * pool being returned. + * Return the buffer to the free list by setting the corresponding + * entries to indicate the number of contigous entries available. + * While returning the entries to the free list, we merge the entries + * with slots below and above the pool being returned. */ spin_lock_irqsave(&io_tlb_lock, flags); { - int count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ? - io_tlb_list[index + nslots] : 0); + count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ? + io_tlb_list[index + nslots] : 0); /* - * Step 1: return the slots to the free list, merging the slots with - * superceeding slots + * Step 1: return the slots to the free list, merging the + * slots with superceeding slots */ for (i = index + nslots - 1; i >= index; i--) io_tlb_list[i] = ++count; /* - * Step 2: merge the returned slots with the preceding slots, if - * available (non zero) + * Step 2: merge the returned slots with the preceding slots, + * if available (non zero) */ - for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && - io_tlb_list[i]; i--) + for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && io_tlb_list[i]; i--) io_tlb_list[i] = ++count; } spin_unlock_irqrestore(&io_tlb_lock, flags); } static void -sync_single (struct device *hwdev, char *dma_addr, size_t size, int dir) +sync_single(struct device *hwdev, char *dma_addr, size_t size, int dir) { int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; char *buffer = io_tlb_orig_addr[index]; @@ -296,92 +314,127 @@ sync_single (struct device *hwdev, char *dma_addr, size_t size, int dir) } void * -swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handle, int flags) +swiotlb_alloc_coherent(struct device *hwdev, size_t size, + dma_addr_t *dma_handle, int flags) { unsigned long dev_addr; void *ret; + int order = get_order(size); - /* XXX fix me: the DMA API should pass us an explicit DMA mask instead: */ + /* + * XXX fix me: the DMA API should pass us an explicit DMA mask + * instead, or use ZONE_DMA32 (ia64 overloads ZONE_DMA to be a ~32 + * bit range instead of a 16MB one). + */ flags |= GFP_DMA; - ret = (void *)__get_free_pages(flags, get_order(size)); - if (!ret) - return NULL; + ret = (void *)__get_free_pages(flags, order); + if (ret && address_needs_mapping(hwdev, virt_to_phys(ret))) { + /* + * The allocated memory isn't reachable by the device. + * Fall back on swiotlb_map_single(). + */ + free_pages((unsigned long) ret, order); + ret = NULL; + } + if (!ret) { + /* + * We are either out of memory or the device can't DMA + * to GFP_DMA memory; fall back on + * swiotlb_map_single(), which will grab memory from + * the lowest available address range. + */ + dma_addr_t handle; + handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE); + if (dma_mapping_error(handle)) + return NULL; + + ret = phys_to_virt(handle); + } memset(ret, 0, size); dev_addr = virt_to_phys(ret); - if (address_needs_mapping(hwdev,dev_addr)) - panic("swiotlb_alloc_consistent: allocated memory is out of range for device"); + + /* Confirm address can be DMA'd by device */ + if (address_needs_mapping(hwdev, dev_addr)) { + printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016lx\n", + (unsigned long long)*hwdev->dma_mask, dev_addr); + panic("swiotlb_alloc_coherent: allocated memory is out of " + "range for device"); + } *dma_handle = dev_addr; return ret; } void -swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) +swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, + dma_addr_t dma_handle) { - free_pages((unsigned long) vaddr, get_order(size)); + if (!(vaddr >= (void *)io_tlb_start + && vaddr < (void *)io_tlb_end)) + free_pages((unsigned long) vaddr, get_order(size)); + else + /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ + swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE); } -static void swiotlb_full(struct device *dev, size_t size, int dir, int do_panic) +static void +swiotlb_full(struct device *dev, size_t size, int dir, int do_panic) { - /* + /* * Ran out of IOMMU space for this operation. This is very bad. * Unfortunately the drivers cannot handle this operation properly. * unless they check for pci_dma_mapping_error (most don't) * When the mapping is small enough return a static buffer to limit - * the damage, or panic when the transfer is too big. - */ - - printk(KERN_ERR - "PCI-DMA: Out of SW-IOMMU space for %lu bytes at device %s\n", - size, dev ? dev->bus_id : "?"); + * the damage, or panic when the transfer is too big. + */ + printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at " + "device %s\n", size, dev ? dev->bus_id : "?"); if (size > io_tlb_overflow && do_panic) { if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL) panic("PCI-DMA: Memory would be corrupted\n"); - if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL) - panic("PCI-DMA: Random memory would be DMAed\n"); - } -} + if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL) + panic("PCI-DMA: Random memory would be DMAed\n"); + } +} /* - * Map a single buffer of the indicated size for DMA in streaming mode. The PCI address - * to use is returned. + * Map a single buffer of the indicated size for DMA in streaming mode. The + * PCI address to use is returned. * - * Once the device is given the dma address, the device owns this memory until either - * swiotlb_unmap_single or swiotlb_dma_sync_single is performed. + * Once the device is given the dma address, the device owns this memory until + * either swiotlb_unmap_single or swiotlb_dma_sync_single is performed. */ dma_addr_t -swiotlb_map_single (struct device *hwdev, void *ptr, size_t size, int dir) +swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir) { unsigned long dev_addr = virt_to_phys(ptr); - void *map; + void *map; if (dir == DMA_NONE) BUG(); /* - * Check if the PCI device can DMA to ptr... if so, just return ptr + * If the pointer passed in happens to be in the device's DMA window, + * we can safely return the device addr and not worry about bounce + * buffering it. */ - if (!address_needs_mapping(hwdev, dev_addr) && !swiotlb_force) - /* - * Device is bit capable of DMA'ing to the buffer... just return the PCI - * address of ptr - */ + if (!address_needs_mapping(hwdev, dev_addr) && !swiotlb_force) return dev_addr; /* - * get a bounce buffer: + * Oh well, have to allocate and map a bounce buffer. */ map = map_single(hwdev, ptr, size, dir); - if (!map) { - swiotlb_full(hwdev, size, dir, 1); - map = io_tlb_overflow_buffer; + if (!map) { + swiotlb_full(hwdev, size, dir, 1); + map = io_tlb_overflow_buffer; } dev_addr = virt_to_phys(map); /* - * Ensure that the address returned is DMA'ble: + * Ensure that the address returned is DMA'ble */ if (address_needs_mapping(hwdev, dev_addr)) panic("map_single: bounce buffer is not DMA'ble"); @@ -395,7 +448,7 @@ swiotlb_map_single (struct device *hwdev, void *ptr, size_t size, int dir) * flush them when they get mapped into an executable vm-area. */ static void -mark_clean (void *addr, size_t size) +mark_clean(void *addr, size_t size) { unsigned long pg_addr, end; @@ -409,15 +462,16 @@ mark_clean (void *addr, size_t size) } /* - * Unmap a single streaming mode DMA translation. The dma_addr and size must match what - * was provided for in a previous swiotlb_map_single call. All other usages are - * undefined. + * Unmap a single streaming mode DMA translation. The dma_addr and size must + * match what was provided for in a previous swiotlb_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. + * After this call, reads by the cpu to the buffer are guaranteed to see + * whatever the device wrote there. */ void -swiotlb_unmap_single (struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir) +swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, + int dir) { char *dma_addr = phys_to_virt(dev_addr); @@ -430,16 +484,18 @@ swiotlb_unmap_single (struct device *hwdev, dma_addr_t dev_addr, size_t size, in } /* - * Make physical memory consistent for a single streaming mode DMA translation after a - * transfer. + * Make physical memory consistent for a single streaming mode DMA translation + * after a transfer. * - * If you perform a swiotlb_map_single() but wish to interrogate the buffer using the cpu, - * yet do not wish to teardown the PCI dma mapping, you must call this function before - * doing so. At the next point you give the PCI dma address back to the card, you must - * first perform a swiotlb_dma_sync_for_device, and then the device again owns the buffer + * If you perform a swiotlb_map_single() but wish to interrogate the buffer + * using the cpu, yet do not wish to teardown the PCI dma mapping, you must + * call this function before doing so. At the next point you give the PCI dma + * address back to the card, you must first perform a + * swiotlb_dma_sync_for_device, and then the device again owns the buffer */ void -swiotlb_sync_single_for_cpu (struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir) +swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, + size_t size, int dir) { char *dma_addr = phys_to_virt(dev_addr); @@ -452,7 +508,8 @@ swiotlb_sync_single_for_cpu (struct device *hwdev, dma_addr_t dev_addr, size_t s } void -swiotlb_sync_single_for_device (struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir) +swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, + size_t size, int dir) { char *dma_addr = phys_to_virt(dev_addr); @@ -465,10 +522,11 @@ swiotlb_sync_single_for_device (struct device *hwdev, dma_addr_t dev_addr, size_ } /* - * Map a set of buffers described by scatterlist in streaming mode for DMA. This is the - * scatter-gather version of the above swiotlb_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). + * Map a set of buffers described by scatterlist in streaming mode for DMA. + * This is the scatter-gather version of the above swiotlb_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. @@ -476,10 +534,12 @@ swiotlb_sync_single_for_device (struct device *hwdev, dma_addr_t dev_addr, size_ * The routine returns the number of addr/length pairs actually * used, at most nents. * - * Device ownership issues as mentioned above for swiotlb_map_single are the same here. + * Device ownership issues as mentioned above for swiotlb_map_single are the + * same here. */ int -swiotlb_map_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int dir) +swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems, + int dir) { void *addr; unsigned long dev_addr; @@ -494,9 +554,9 @@ swiotlb_map_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int di if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) { sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir)); if (!sg->dma_address) { - /* Don't panic here, we expect pci_map_sg users + /* Don't panic here, we expect map_sg users to do proper error handling. */ - swiotlb_full(hwdev, sg->length, dir, 0); + swiotlb_full(hwdev, sg->length, dir, 0); swiotlb_unmap_sg(hwdev, sg - i, i, dir); sg[0].dma_length = 0; return 0; @@ -509,11 +569,12 @@ swiotlb_map_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int di } /* - * Unmap a set of streaming mode DMA translations. Again, cpu read rules concerning calls - * here are the same as for swiotlb_unmap_single() above. + * Unmap a set of streaming mode DMA translations. Again, cpu read rules + * concerning calls here are the same as for swiotlb_unmap_single() above. */ void -swiotlb_unmap_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int dir) +swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems, + int dir) { int i; @@ -528,14 +589,15 @@ swiotlb_unmap_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int } /* - * Make physical memory consistent for a set of streaming mode DMA translations after a - * transfer. + * Make physical memory consistent for a set of streaming mode DMA translations + * after a transfer. * - * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules and - * usage. + * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules + * and usage. */ void -swiotlb_sync_sg_for_cpu (struct device *hwdev, struct scatterlist *sg, int nelems, int dir) +swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, + int nelems, int dir) { int i; @@ -544,11 +606,13 @@ swiotlb_sync_sg_for_cpu (struct device *hwdev, struct scatterlist *sg, int nelem for (i = 0; i < nelems; i++, sg++) if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg)) - sync_single(hwdev, (void *) sg->dma_address, sg->dma_length, dir); + sync_single(hwdev, (void *) sg->dma_address, + sg->dma_length, dir); } void -swiotlb_sync_sg_for_device (struct device *hwdev, struct scatterlist *sg, int nelems, int dir) +swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, + int nelems, int dir) { int i; @@ -557,24 +621,26 @@ swiotlb_sync_sg_for_device (struct device *hwdev, struct scatterlist *sg, int ne for (i = 0; i < nelems; i++, sg++) if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg)) - sync_single(hwdev, (void *) sg->dma_address, sg->dma_length, dir); + sync_single(hwdev, (void *) sg->dma_address, + sg->dma_length, dir); } int -swiotlb_dma_mapping_error (dma_addr_t dma_addr) +swiotlb_dma_mapping_error(dma_addr_t dma_addr) { return (dma_addr == virt_to_phys(io_tlb_overflow_buffer)); } /* - * Return whether the given PCI device DMA address mask can be supported properly. For - * example, if your device can only drive the low 24-bits during PCI bus mastering, then - * you would pass 0x00ffffff as the mask to this function. + * Return whether the given PCI device DMA address mask can be supported + * properly. For example, if your device can only drive the low 24-bits + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to + * this function. */ int swiotlb_dma_supported (struct device *hwdev, u64 mask) { - return 1; + return (virt_to_phys (io_tlb_end) - 1) <= mask; } EXPORT_SYMBOL(swiotlb_init); diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 0f905a637..b9b3e627a 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef CONFIG_VIRTUAL_MEM_MAP static unsigned long num_dma_physpages; @@ -214,8 +215,8 @@ count_dma_pages (u64 start, u64 end, void *arg) { unsigned long *count = arg; - if (end <= MAX_DMA_ADDRESS) - *count += (end - start) >> PAGE_SHIFT; + if (start < MAX_DMA_ADDRESS) + *count += (min(end, MAX_DMA_ADDRESS) - start) >> PAGE_SHIFT; return 0; } #endif diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index eb464cbb9..3456a9b69 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -4,6 +4,10 @@ * Copyright (c) 2001 Tony Luck * Copyright (c) 2002 NEC Corp. * Copyright (c) 2002 Kimio Suganuma + * Copyright (c) 2004 Silicon Graphics, Inc + * Russ Anderson + * Jesse Barnes + * Jack Steiner */ /* @@ -16,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +43,7 @@ struct early_node_data { unsigned long max_pfn; }; -static struct early_node_data mem_data[NR_NODES] __initdata; +static struct early_node_data mem_data[MAX_NUMNODES] __initdata; /** * reassign_cpu_only_nodes - called from find_memory to move CPU-only nodes to a memory node @@ -55,9 +60,9 @@ static void __init reassign_cpu_only_nodes(void) struct node_memblk_s *p; int i, j, k, nnode, nid, cpu, cpunid, pxm; u8 cslit, slit; - static DECLARE_BITMAP(nodes_with_mem, NR_NODES) __initdata; + static DECLARE_BITMAP(nodes_with_mem, MAX_NUMNODES) __initdata; static u8 numa_slit_fix[MAX_NUMNODES * MAX_NUMNODES] __initdata; - static int node_flip[NR_NODES] __initdata; + static int node_flip[MAX_NUMNODES] __initdata; static int old_nid_map[NR_CPUS] __initdata; for (nnode = 0, p = &node_memblk[0]; p < &node_memblk[num_node_memblks]; p++) @@ -69,7 +74,7 @@ static void __init reassign_cpu_only_nodes(void) /* * All nids with memory. */ - if (nnode == numnodes) + if (nnode == num_online_nodes()) return; /* @@ -78,10 +83,17 @@ static void __init reassign_cpu_only_nodes(void) * For reassigned CPU nodes a nid can't be arrived at * until after this loop because the target nid's new * identity might not have been established yet. So - * new nid values are fabricated above numnodes and + * new nid values are fabricated above num_online_nodes() and * mapped back later to their true value. */ - for (nid = 0, i = 0; i < numnodes; i++) { + /* MCD - This code is a bit complicated, but may be unnecessary now. + * We can now handle much more interesting node-numbering. + * The old requirement that 0 <= nid <= numnodes <= MAX_NUMNODES + * and that there be no holes in the numbering 0..numnodes + * has become simply 0 <= nid <= MAX_NUMNODES. + */ + nid = 0; + for_each_online_node(i) { if (test_bit(i, (void *) nodes_with_mem)) { /* * Save original nid value for numa_slit @@ -101,7 +113,7 @@ static void __init reassign_cpu_only_nodes(void) cpunid = nid; nid++; } else - cpunid = numnodes; + cpunid = MAX_NUMNODES; for (cpu = 0; cpu < NR_CPUS; cpu++) if (node_cpuid[cpu].nid == i) { @@ -109,7 +121,7 @@ static void __init reassign_cpu_only_nodes(void) * For nodes not being reassigned just * fix the cpu's nid and reverse pxm map */ - if (cpunid < numnodes) { + if (cpunid < MAX_NUMNODES) { pxm = nid_to_pxm_map[i]; pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = cpunid; @@ -119,18 +131,21 @@ static void __init reassign_cpu_only_nodes(void) /* * For nodes being reassigned, find best node by * numa_slit information and then make a temporary - * nid value based on current nid and numnodes. + * nid value based on current nid and num_online_nodes(). */ - for (slit = 0xff, k = numnodes + numnodes, j = 0; j < numnodes; j++) + slit = 0xff; + k = 2*num_online_nodes(); + for_each_online_node(j) { if (i == j) continue; else if (test_bit(j, (void *) nodes_with_mem)) { - cslit = numa_slit[i * numnodes + j]; + cslit = numa_slit[i * num_online_nodes() + j]; if (cslit < slit) { - k = numnodes + j; + k = num_online_nodes() + j; slit = cslit; } } + } /* save old nid map so we can update the pxm */ old_nid_map[cpu] = node_cpuid[cpu].nid; @@ -142,12 +157,12 @@ static void __init reassign_cpu_only_nodes(void) * Fixup temporary nid values for CPU-only nodes. */ for (cpu = 0; cpu < NR_CPUS; cpu++) - if (node_cpuid[cpu].nid == (numnodes + numnodes)) { + if (node_cpuid[cpu].nid == (2*num_online_nodes())) { pxm = nid_to_pxm_map[old_nid_map[cpu]]; pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = nnode - 1; } else { for (i = 0; i < nnode; i++) { - if (node_flip[i] != (node_cpuid[cpu].nid - numnodes)) + if (node_flip[i] != (node_cpuid[cpu].nid - num_online_nodes())) continue; pxm = nid_to_pxm_map[old_nid_map[cpu]]; @@ -163,14 +178,13 @@ static void __init reassign_cpu_only_nodes(void) for (i = 0; i < nnode; i++) for (j = 0; j < nnode; j++) numa_slit_fix[i * nnode + j] = - numa_slit[node_flip[i] * numnodes + node_flip[j]]; + numa_slit[node_flip[i] * num_online_nodes() + node_flip[j]]; memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit)); - for (i = nnode; i < numnodes; i++) - node_set_offline(i); - - numnodes = nnode; + nodes_clear(node_online_map); + for (i = 0; i < nnode; i++) + node_set_online(i); return; } @@ -218,13 +232,35 @@ static int __init build_node_maps(unsigned long start, unsigned long len, return 0; } +/** + * early_nr_phys_cpus_node - return number of physical cpus on a given node + * @node: node to check + * + * Count the number of physical cpus on @node. These are cpus that actually + * exist. We can't use nr_cpus_node() yet because + * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been + * called yet. + */ +static int early_nr_phys_cpus_node(int node) +{ + int cpu, n = 0; + + for (cpu = 0; cpu < NR_CPUS; cpu++) + if (node == node_cpuid[cpu].nid) + if ((cpu == 0) || node_cpuid[cpu].phys_id) + n++; + + return n; +} + + /** * early_nr_cpus_node - return number of cpus on a given node * @node: node to check * * Count the number of cpus on @node. We can't use nr_cpus_node() yet because * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been - * called yet. + * called yet. Note that node 0 will also count all non-existent cpus. */ static int early_nr_cpus_node(int node) { @@ -251,7 +287,7 @@ static int early_nr_cpus_node(int node) * | | * |~~~~~~~~~~~~~~~~~~~~~~~~| <-- NODEDATA_ALIGN(start, node) for the first * | PERCPU_PAGE_SIZE * | start and length big enough - * | NR_CPUS | + * | cpus_on_this_node | Node 0 will also have entries for all non-existent cpus. * |------------------------| * | local pg_data_t * | * |------------------------| @@ -268,7 +304,7 @@ static int early_nr_cpus_node(int node) static int __init find_pernode_space(unsigned long start, unsigned long len, int node) { - unsigned long epfn, cpu, cpus; + unsigned long epfn, cpu, cpus, phys_cpus; unsigned long pernodesize = 0, pernode, pages, mapsize; void *cpu_data; struct bootmem_data *bdp = &mem_data[node].bootmem_data; @@ -294,7 +330,9 @@ static int __init find_pernode_space(unsigned long start, unsigned long len, * for good alignment and alias prevention. */ cpus = early_nr_cpus_node(node); + phys_cpus = early_nr_phys_cpus_node(node); pernodesize += PERCPU_PAGE_SIZE * cpus; + pernodesize += node * L1_CACHE_BYTES; pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t)); pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data)); pernodesize = PAGE_ALIGN(pernodesize); @@ -308,6 +346,7 @@ static int __init find_pernode_space(unsigned long start, unsigned long len, cpu_data = (void *)pernode; pernode += PERCPU_PAGE_SIZE * cpus; + pernode += node * L1_CACHE_BYTES; mem_data[node].pgdat = __va(pernode); pernode += L1_CACHE_ALIGN(sizeof(pg_data_t)); @@ -369,7 +408,7 @@ static void __init reserve_pernode_space(void) struct bootmem_data *bdp; int node; - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { pg_data_t *pdp = mem_data[node].pgdat; bdp = pdp->bdata; @@ -398,13 +437,13 @@ static void __init reserve_pernode_space(void) static void __init initialize_pernode_data(void) { int cpu, node; - pg_data_t *pgdat_list[NR_NODES]; + pg_data_t *pgdat_list[MAX_NUMNODES]; - for (node = 0; node < numnodes; node++) + for_each_online_node(node) pgdat_list[node] = mem_data[node].pgdat; /* Copy the pg_data_t list to each node and init the node field */ - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list, sizeof(pgdat_list)); } @@ -428,15 +467,15 @@ void __init find_memory(void) reserve_memory(); - if (numnodes == 0) { + if (num_online_nodes() == 0) { printk(KERN_ERR "node info missing!\n"); - numnodes = 1; + node_set_online(0); } min_low_pfn = -1; max_low_pfn = 0; - if (numnodes > 1) + if (num_online_nodes() > 1) reassign_cpu_only_nodes(); /* These actually end up getting called by call_pernode_memory() */ @@ -447,10 +486,13 @@ void __init find_memory(void) * Initialize the boot memory maps in reverse order since that's * what the bootmem allocator expects */ - for (node = numnodes - 1; node >= 0; node--) { + for (node = MAX_NUMNODES - 1; node >= 0; node--) { unsigned long pernode, pernodesize, map; struct bootmem_data *bdp; + if (!node_online(node)) + continue; + bdp = &mem_data[node].bootmem_data; pernode = mem_data[node].pernode_addr; pernodesize = mem_data[node].pernode_size; @@ -601,7 +643,7 @@ void call_pernode_memory(unsigned long start, unsigned long len, void *arg) * for each piece of usable memory and will setup these values for each node. * Very similar to build_maps(). */ -static int count_node_pages(unsigned long start, unsigned long len, int node) +static __init int count_node_pages(unsigned long start, unsigned long len, int node) { unsigned long end = start + len; @@ -626,7 +668,7 @@ static int count_node_pages(unsigned long start, unsigned long len, int node) * paging_init() sets up the page tables for each node of the system and frees * the bootmem allocator memory for general use. */ -void paging_init(void) +void __init paging_init(void) { unsigned long max_dma; unsigned long zones_size[MAX_NR_ZONES]; @@ -637,12 +679,12 @@ void paging_init(void) max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; /* so min() will work in count_node_pages */ - for (node = 0; node < numnodes; node++) + for_each_online_node(node) mem_data[node].min_pfn = ~0UL; efi_memmap_walk(filter_rsvd_memory, count_node_pages); - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { memset(zones_size, 0, sizeof(zones_size)); memset(zholes_size, 0, sizeof(zholes_size)); @@ -680,7 +722,7 @@ void paging_init(void) PAGE_ALIGN(max_low_pfn * sizeof(struct page)); vmem_map = (struct page *) vmalloc_end; - efi_memmap_walk(create_mem_map_page_table, 0); + efi_memmap_walk(create_mem_map_page_table, NULL); printk("Virtual mem_map starts at 0x%p\n", vmem_map); } diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 134d24b97..190996f53 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -33,9 +33,9 @@ expand_backing_store (struct vm_area_struct *vma, unsigned long address) unsigned long grow; grow = PAGE_SIZE >> PAGE_SHIFT; - if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur + if (address - vma->vm_start > current->signal->rlim[RLIMIT_STACK].rlim_cur || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > - current->rlim[RLIMIT_AS].rlim_cur)) + current->signal->rlim[RLIMIT_AS].rlim_cur)) return -ENOMEM; if (!vx_vmpages_avail(vma->vm_mm, grow) || ((vma->vm_flags & VM_LOCKED) && @@ -59,6 +59,7 @@ static int mapped_kernel_page_is_present (unsigned long address) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *ptep, pte; @@ -66,7 +67,11 @@ mapped_kernel_page_is_present (unsigned long address) if (pgd_none(*pgd) || pgd_bad(*pgd)) return 0; - pmd = pmd_offset(pgd, address); + pud = pud_offset(pgd, address); + if (pud_none(*pud) || pud_bad(*pud)) + return 0; + + pmd = pmd_offset(pud, address); if (pmd_none(*pmd) || pmd_bad(*pmd)) return 0; diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c index fbd24a074..678a0a5d0 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c @@ -29,13 +29,17 @@ huge_pte_alloc (struct mm_struct *mm, unsigned long addr) { unsigned long taddr = htlbpage_to_page(addr); pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; pgd = pgd_offset(mm, taddr); - pmd = pmd_alloc(mm, pgd, taddr); - if (pmd) - pte = pte_alloc_map(mm, pmd, taddr); + pud = pud_alloc(mm, pgd, taddr); + if (pud) { + pmd = pmd_alloc(mm, pud, taddr); + if (pmd) + pte = pte_alloc_map(mm, pmd, taddr); + } return pte; } @@ -44,14 +48,18 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr) { unsigned long taddr = htlbpage_to_page(addr); pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; pgd = pgd_offset(mm, taddr); if (pgd_present(*pgd)) { - pmd = pmd_offset(pgd, taddr); - if (pmd_present(*pmd)) - pte = pte_offset_map(pmd, taddr); + pud = pud_offset(pgd, taddr); + if (pud_present(*pud)) { + pmd = pmd_offset(pud, taddr); + if (pmd_present(*pmd)) + pte = pte_offset_map(pmd, taddr); + } } return pte; @@ -189,7 +197,6 @@ void hugetlb_free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *prev, { unsigned long first = start & HUGETLB_PGDIR_MASK; unsigned long last = end + HUGETLB_PGDIR_SIZE - 1; - unsigned long start_index, end_index; struct mm_struct *mm = tlb->mm; if (!prev) { @@ -214,23 +221,13 @@ void hugetlb_free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *prev, last = next->vm_start; } if (prev->vm_end > first) - first = prev->vm_end + HUGETLB_PGDIR_SIZE - 1; + first = prev->vm_end; break; } no_mmaps: if (last < first) /* for arches with discontiguous pgd indices */ return; - /* - * If the PGD bits are not consecutive in the virtual address, the - * old method of shifting the VA >> by PGDIR_SHIFT doesn't work. - */ - - start_index = pgd_index(htlbpage_to_page(first)); - end_index = pgd_index(htlbpage_to_page(last)); - - if (end_index > start_index) { - clear_page_tables(tlb, start_index, end_index - start_index); - } + clear_page_range(tlb, first, last); } void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 87a8016f5..df0f12115 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -19,9 +19,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -98,7 +98,7 @@ update_mmu_cache (struct vm_area_struct *vma, unsigned long vaddr, pte_t pte) inline void ia64_set_rbs_bot (void) { - unsigned long stack_size = current->rlim[RLIMIT_STACK].rlim_max & -16; + unsigned long stack_size = current->signal->rlim[RLIMIT_STACK].rlim_max & -16; if (stack_size > MAX_USER_STACK_SIZE) stack_size = MAX_USER_STACK_SIZE; @@ -131,7 +131,13 @@ ia64_init_addr_space (void) vma->vm_end = vma->vm_start + PAGE_SIZE; vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP; - insert_vm_struct(current->mm, vma); + down_write(¤t->mm->mmap_sem); + if (insert_vm_struct(current->mm, vma)) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return; + } + up_write(¤t->mm->mmap_sem); } /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ @@ -143,7 +149,13 @@ ia64_init_addr_space (void) vma->vm_end = PAGE_SIZE; vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED; - insert_vm_struct(current->mm, vma); + down_write(¤t->mm->mmap_sem); + if (insert_vm_struct(current->mm, vma)) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return; + } + up_write(¤t->mm->mmap_sem); } } } @@ -225,6 +237,7 @@ struct page * put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; @@ -236,7 +249,11 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) spin_lock(&init_mm.page_table_lock); { - pmd = pmd_alloc(&init_mm, pgd, address); + pud = pud_alloc(&init_mm, pgd, address); + if (!pud) + goto out; + + pmd = pmd_alloc(&init_mm, pud, address); if (!pmd) goto out; pte = pte_alloc_map(&init_mm, pmd, address); @@ -279,7 +296,6 @@ ia64_mmu_init (void *my_cpu_data) { unsigned long psr, pta, impl_va_bits; extern void __devinit tlb_init (void); - int cpu; #ifdef CONFIG_DISABLE_VHPT # define VHPT_ENABLE_BIT 0 @@ -344,20 +360,6 @@ ia64_mmu_init (void *my_cpu_data) ia64_set_rr(HPAGE_REGION_BASE, HPAGE_SHIFT << 2); ia64_srlz_d(); #endif - - cpu = smp_processor_id(); - - /* mca handler uses cr.lid as key to pick the right entry */ - ia64_mca_tlb_list[cpu].cr_lid = ia64_getreg(_IA64_REG_CR_LID); - - /* insert this percpu data information into our list for MCA recovery purposes */ - ia64_mca_tlb_list[cpu].percpu_paddr = pte_val(mk_pte_phys(__pa(my_cpu_data), PAGE_KERNEL)); - /* Also save per-cpu tlb flush recipe for use in physical mode mca handler */ - ia64_mca_tlb_list[cpu].ptce_base = local_cpu_data->ptce_base; - ia64_mca_tlb_list[cpu].ptce_count[0] = local_cpu_data->ptce_count[0]; - ia64_mca_tlb_list[cpu].ptce_count[1] = local_cpu_data->ptce_count[1]; - ia64_mca_tlb_list[cpu].ptce_stride[0] = local_cpu_data->ptce_stride[0]; - ia64_mca_tlb_list[cpu].ptce_stride[1] = local_cpu_data->ptce_stride[1]; } #ifdef CONFIG_VIRTUAL_MEM_MAP @@ -369,6 +371,7 @@ create_mem_map_page_table (u64 start, u64 end, void *arg) struct page *map_start, *map_end; int node; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; @@ -383,7 +386,11 @@ create_mem_map_page_table (u64 start, u64 end, void *arg) pgd = pgd_offset_k(address); if (pgd_none(*pgd)) pgd_populate(&init_mm, pgd, alloc_bootmem_pages_node(NODE_DATA(node), PAGE_SIZE)); - pmd = pmd_offset(pgd, address); + pud = pud_offset(pgd, address); + + if (pud_none(*pud)) + pud_populate(&init_mm, pud, alloc_bootmem_pages_node(NODE_DATA(node), PAGE_SIZE)); + pmd = pmd_offset(pud, address); if (pmd_none(*pmd)) pmd_populate_kernel(&init_mm, pmd, alloc_bootmem_pages_node(NODE_DATA(node), PAGE_SIZE)); @@ -410,7 +417,6 @@ virtual_memmap_init (u64 start, u64 end, void *arg) struct page *map_start, *map_end; args = (struct memmap_init_callback_data *) arg; - map_start = vmem_map + (__pa(start) >> PAGE_SHIFT); map_end = vmem_map + (__pa(end) >> PAGE_SHIFT); diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index ef2dbcfda..77118bbf3 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c @@ -20,8 +20,6 @@ #include #include -static struct node *sysfs_nodes; -static struct cpu *sysfs_cpus; /* * The following structures are usually initialized by ACPI or @@ -49,37 +47,3 @@ paddr_to_nid(unsigned long paddr) return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0); } - -static int __init topology_init(void) -{ - int i, err = 0; - - sysfs_nodes = kmalloc(sizeof(struct node) * numnodes, GFP_KERNEL); - if (!sysfs_nodes) { - err = -ENOMEM; - goto out; - } - memset(sysfs_nodes, 0, sizeof(struct node) * numnodes); - - sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL); - if (!sysfs_cpus) { - kfree(sysfs_nodes); - err = -ENOMEM; - goto out; - } - memset(sysfs_cpus, 0, sizeof(struct cpu) * NR_CPUS); - - for (i = 0; i < numnodes; i++) - if ((err = register_node(&sysfs_nodes[i], i, 0))) - goto out; - - for (i = 0; i < NR_CPUS; i++) - if (cpu_online(i)) - if((err = register_cpu(&sysfs_cpus[i], i, - &sysfs_nodes[cpu_to_node(i)]))) - goto out; - out: - return err; -} - -__initcall(topology_init); diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index 0c5cb3c61..bd62f55b0 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c @@ -88,7 +88,7 @@ wrap_mmu_context (struct mm_struct *mm) void ia64_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) { - static spinlock_t ptcg_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(ptcg_lock); /* HW requires global serialization of ptc.ga. */ spin_lock(&ptcg_lock); diff --git a/arch/ia64/oprofile/Makefile b/arch/ia64/oprofile/Makefile index 29aeef4f6..aad27a718 100644 --- a/arch/ia64/oprofile/Makefile +++ b/arch/ia64/oprofile/Makefile @@ -6,5 +6,5 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \ oprofilefs.o oprofile_stats.o \ timer_int.o ) -oprofile-y := $(DRIVER_OBJS) init.o +oprofile-y := $(DRIVER_OBJS) init.o backtrace.o oprofile-$(CONFIG_PERFMON) += perfmon.o diff --git a/arch/ia64/oprofile/init.c b/arch/ia64/oprofile/init.c index 6d0c132b0..125a602a6 100644 --- a/arch/ia64/oprofile/init.c +++ b/arch/ia64/oprofile/init.c @@ -12,15 +12,21 @@ #include #include -extern int perfmon_init(struct oprofile_operations ** ops); +extern int perfmon_init(struct oprofile_operations * ops); extern void perfmon_exit(void); +extern void ia64_backtrace(struct pt_regs * const regs, unsigned int depth); -int __init oprofile_arch_init(struct oprofile_operations ** ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { + int ret = -ENODEV; + #ifdef CONFIG_PERFMON - return perfmon_init(ops); + /* perfmon_init() can fail, but we have no way to report it */ + ret = perfmon_init(ops); #endif - return -ENODEV; + ops->backtrace = ia64_backtrace; + + return ret; } diff --git a/arch/ia64/oprofile/perfmon.c b/arch/ia64/oprofile/perfmon.c index bfc82ccf5..b7975a469 100644 --- a/arch/ia64/oprofile/perfmon.c +++ b/arch/ia64/oprofile/perfmon.c @@ -21,8 +21,6 @@ static int perfmon_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct pt_regs *regs, unsigned long stamp) { - int cpu = smp_processor_id(); - unsigned long eip = instruction_pointer(regs); int event = arg->pmd_eventid; arg->ovfl_ctrl.bits.reset_ovfl_pmds = 1; @@ -31,7 +29,7 @@ perfmon_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, * without perfmon being shutdown (e.g. SIGSEGV) */ if (allow_ints) - oprofile_add_sample(eip, !user_mode(regs), event, cpu); + oprofile_add_sample(regs, event); return 0; } @@ -75,21 +73,18 @@ static char * get_cpu_type(void) /* all the ops are handled via userspace for IA64 perfmon */ -static struct oprofile_operations perfmon_ops = { - .start = perfmon_start, - .stop = perfmon_stop, -}; static int using_perfmon; -int perfmon_init(struct oprofile_operations ** ops) +int perfmon_init(struct oprofile_operations * ops) { int ret = pfm_register_buffer_fmt(&oprofile_fmt); if (ret) return -ENODEV; - perfmon_ops.cpu_type = get_cpu_type(); - *ops = &perfmon_ops; + ops->cpu_type = get_cpu_type(); + ops->start = perfmon_start; + ops->stop = perfmon_stop; using_perfmon = 1; printk(KERN_INFO "oprofile: using perfmon.\n"); return 0; diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index dd33eaf87..2a0dcf608 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -6,6 +6,7 @@ * Copyright (C) 2002 Hewlett-Packard Co * David Mosberger-Tang * Bjorn Helgaas + * Copyright (C) 2004 Silicon Graphics, Inc. * * Note: Above list of copyright holders is incomplete... */ @@ -46,6 +47,8 @@ #define DBG(x...) #endif +static int pci_routeirq; + /* * Low-level SAL-based PCI configuration access functions. Note that SAL * calls are already serialized (via sal_lock), so we don't need another @@ -68,7 +71,7 @@ pci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value) u64 addr, mode, data = 0; int result = 0; - if ((seg > 255) || (bus > 255) || (devfn > 255) || (reg > 4095)) + if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; if ((seg | reg) <= 255) { @@ -124,11 +127,24 @@ pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val devfn, where, size, value); } -static struct pci_ops pci_root_ops = { +struct pci_ops pci_root_ops = { .read = pci_read, .write = pci_write, }; +#ifdef CONFIG_NUMA +extern acpi_status acpi_map_iosapic(acpi_handle, u32, void *, void **); +static void acpi_map_iosapics(void) +{ + acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL); +} +#else +static void acpi_map_iosapics(void) +{ + return; +} +#endif /* CONFIG_NUMA */ + static int __init pci_acpi_init (void) { @@ -136,18 +152,29 @@ pci_acpi_init (void) printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); -#ifdef CONFIG_NUMA -extern acpi_status acpi_map_iosapic (acpi_handle, u32, void*, void**); + acpi_map_iosapics(); - acpi_get_devices(NULL, acpi_map_iosapic, NULL, NULL); -#endif - /* - * PCI IRQ routing is set up by pci_enable_device(), but we - * also do it here in case there are still broken drivers that - * don't use pci_enable_device(). - */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) - acpi_pci_irq_enable(dev); + if (pci_routeirq) { + /* + * PCI IRQ routing is set up by pci_enable_device(), but we + * also do it here in case there are still broken drivers that + * don't use pci_enable_device(). + */ + printk(KERN_INFO "** Routing PCI interrupts for all devices because \"pci=routeirq\"\n"); + printk(KERN_INFO "** was specified. If this was required to make a driver work,\n"); + printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n"); + printk(KERN_INFO "** so I can fix the driver.\n"); + for_each_pci_dev(dev) + acpi_pci_irq_enable(dev); + } else { + printk(KERN_INFO "** PCI interrupts are no longer routed automatically. If this\n"); + printk(KERN_INFO "** causes a device to stop working, it is probably because the\n"); + printk(KERN_INFO "** driver failed to call pci_enable_device(). As a temporary\n"); + printk(KERN_INFO "** workaround, the \"pci=routeirq\" argument restores the old\n"); + printk(KERN_INFO "** behavior. If this argument makes the device work again,\n"); + printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n"); + printk(KERN_INFO "** so I can fix the driver.\n"); + } return 0; } @@ -275,7 +302,7 @@ add_window (struct acpi_resource *res, void *data) return AE_OK; window = &info->controller->window[info->controller->windows++]; - window->resource.flags |= flags; + window->resource.flags = flags; window->resource.start = addr.min_address_range; window->resource.end = addr.max_address_range; window->offset = offset; @@ -328,33 +355,66 @@ out1: return NULL; } -void __init -pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus) +void pcibios_resource_to_bus(struct pci_dev *dev, + struct pci_bus_region *region, struct resource *res) { struct pci_controller *controller = PCI_CONTROLLER(dev); - struct pci_window *window; - int i, j; + unsigned long offset = 0; + int i; + + for (i = 0; i < controller->windows; i++) { + struct pci_window *window = &controller->window[i]; + if (!(window->resource.flags & res->flags)) + continue; + if (window->resource.start > res->start - window->offset) + continue; + if (window->resource.end < res->end - window->offset) + continue; + offset = window->offset; + break; + } + + region->start = res->start - offset; + region->end = res->end - offset; +} +EXPORT_SYMBOL(pcibios_resource_to_bus); + +void pcibios_bus_to_resource(struct pci_dev *dev, + struct resource *res, struct pci_bus_region *region) +{ + struct pci_controller *controller = PCI_CONTROLLER(dev); + unsigned long offset = 0; + int i; + + for (i = 0; i < controller->windows; i++) { + struct pci_window *window = &controller->window[i]; + if (!(window->resource.flags & res->flags)) + continue; + if (window->resource.start > region->start) + continue; + if (window->resource.end < region->end) + continue; + offset = window->offset; + break; + } + + res->start = region->start + offset; + res->end = region->end + offset; +} + +static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) +{ + struct pci_bus_region region; + int i; int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \ PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES; for (i = 0; i < limit; i++) { - if (!dev->resource[i].start) + if (!dev->resource[i].flags) continue; - -#define contains(win, res) ((res)->start >= (win)->start && \ - (res)->end <= (win)->end) - - for (j = 0; j < controller->windows; j++) { - window = &controller->window[j]; - if (((dev->resource[i].flags & IORESOURCE_MEM && - window->resource.flags & IORESOURCE_MEM) || - (dev->resource[i].flags & IORESOURCE_IO && - window->resource.flags & IORESOURCE_IO)) && - contains(&window->resource, &dev->resource[i])) { - dev->resource[i].start += window->offset; - dev->resource[i].end += window->offset; - } - } + region.start = dev->resource[i].start; + region.end = dev->resource[i].end; + pcibios_bus_to_resource(dev, &dev->resource[i], ®ion); pci_claim_resource(dev, i); } } @@ -365,10 +425,10 @@ pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus) void __devinit pcibios_fixup_bus (struct pci_bus *b) { - struct list_head *ln; + struct pci_dev *dev; - for (ln = b->devices.next; ln != &b->devices; ln = ln->next) - pcibios_fixup_device_resources(pci_dev_b(ln), b); + list_for_each_entry(dev, &b->devices, bus_list) + pcibios_fixup_device_resources(dev); return; } @@ -431,6 +491,14 @@ pcibios_enable_device (struct pci_dev *dev, int mask) return acpi_pci_irq_enable(dev); } +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void +pcibios_disable_device (struct pci_dev *dev) +{ + acpi_pci_irq_disable(dev); +} +#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ + void pcibios_align_resource (void *data, struct resource *res, unsigned long size, unsigned long align) @@ -443,6 +511,8 @@ pcibios_align_resource (void *data, struct resource *res, char * __init pcibios_setup (char *str) { + if (!strcmp(str, "routeirq")) + pci_routeirq = 1; return NULL; } @@ -451,36 +521,148 @@ pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine) { /* - * I/O space cannot be accessed via normal processor loads and stores on this - * platform. + * I/O space cannot be accessed via normal processor loads and + * stores on this platform. */ if (mmap_state == pci_mmap_io) /* - * XXX we could relax this for I/O spaces for which ACPI indicates that - * the space is 1-to-1 mapped. But at the moment, we don't support - * multiple PCI address spaces and the legacy I/O space is not 1-to-1 - * mapped, so this is moot. + * XXX we could relax this for I/O spaces for which ACPI + * indicates that the space is 1-to-1 mapped. But at the + * moment, we don't support multiple PCI address spaces and + * the legacy I/O space is not 1-to-1 mapped, so this is moot. */ return -EINVAL; /* - * Leave vm_pgoff as-is, the PCI space address is the physical address on this - * platform. + * Leave vm_pgoff as-is, the PCI space address is the physical + * address on this platform. */ - vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO); + vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); - if (write_combine) + if (write_combine && 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); - if (remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT, + if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; return 0; } +/** + * ia64_pci_get_legacy_mem - generic legacy mem routine + * @bus: bus to get legacy memory base address for + * + * Find the base of legacy memory for @bus. This is typically the first + * megabyte of bus address space for @bus or is simply 0 on platforms whose + * chipsets support legacy I/O and memory routing. Returns the base address + * or an error pointer if an error occurred. + * + * This is the ia64 generic version of this routine. Other platforms + * are free to override it with a machine vector. + */ +char *ia64_pci_get_legacy_mem(struct pci_bus *bus) +{ + return (char *)__IA64_UNCACHED_OFFSET; +} + +/** + * pci_mmap_legacy_page_range - map legacy memory space to userland + * @bus: bus whose legacy space we're mapping + * @vma: vma passed in by mmap + * + * Map legacy memory space for this device back to userspace using a machine + * vector to get the base address. + */ +int +pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma) +{ + char *addr; + + addr = pci_get_legacy_mem(bus); + if (IS_ERR(addr)) + return PTR_ERR(addr); + + vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT; + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); + + if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, + vma->vm_end - vma->vm_start, vma->vm_page_prot)) + return -EAGAIN; + + return 0; +} + +/** + * ia64_pci_legacy_read - read from legacy I/O space + * @bus: bus to read + * @port: legacy port value + * @val: caller allocated storage for returned value + * @size: number of bytes to read + * + * Simply reads @size bytes from @port and puts the result in @val. + * + * Again, this (and the write routine) are generic versions that can be + * overridden by the platform. This is necessary on platforms that don't + * support legacy I/O routing or that hard fail on legacy I/O timeouts. + */ +int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size) +{ + int ret = size; + + switch (size) { + case 1: + *val = inb(port); + break; + case 2: + *val = inw(port); + break; + case 4: + *val = inl(port); + break; + default: + ret = -EINVAL; + break; + } + + return ret; +} + +/** + * ia64_pci_legacy_write - perform a legacy I/O write + * @bus: bus pointer + * @port: port to write + * @val: value to write + * @size: number of bytes to write from @val + * + * Simply writes @size bytes of @val to @port. + */ +int ia64_pci_legacy_write(struct pci_dev *bus, u16 port, u32 val, u8 size) +{ + int ret = 0; + + switch (size) { + case 1: + outb(val, port); + break; + case 2: + outw(val, port); + break; + case 4: + outl(val, port); + break; + default: + ret = -EINVAL; + break; + } + + return ret; +} + /** * pci_cacheline_size - determine cacheline size for PCI devices * @dev: void diff --git a/arch/ia64/sn/Makefile b/arch/ia64/sn/Makefile index d28f1a0ca..a269f6d84 100644 --- a/arch/ia64/sn/Makefile +++ b/arch/ia64/sn/Makefile @@ -4,9 +4,11 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 2003 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (C) 2004 Silicon Graphics, Inc. All Rights Reserved. # # Makefile for the sn ia64 subplatform # -obj-y += kernel/ io/ +CPPFLAGS += -I$(srctree)/arch/ia64/sn/include + +obj-y += kernel/ pci/ diff --git a/arch/ia64/sn/kernel/Makefile b/arch/ia64/sn/kernel/Makefile index 1e610ac2b..6c7f4d9e8 100644 --- a/arch/ia64/sn/kernel/Makefile +++ b/arch/ia64/sn/kernel/Makefile @@ -7,5 +7,6 @@ # Copyright (C) 1999,2001-2003 Silicon Graphics, Inc. All Rights Reserved. # -obj-y += probe.o setup.o bte.o irq.o mca.o idle.o sn2/ +obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \ + huberror.o io_init.o iomv.o klconflib.o sn2/ obj-$(CONFIG_IA64_GENERIC) += machvec.o diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c index 94a99eeb1..ce0bc4085 100644 --- a/arch/ia64/sn/kernel/bte.c +++ b/arch/ia64/sn/kernel/bte.c @@ -8,14 +8,14 @@ #include #include -#include #include #include #include #include #include -#include +#include #include +#include #include #include @@ -30,8 +30,7 @@ /* two interfaces on two btes */ #define MAX_INTERFACES_TO_TRY 4 -static struct bteinfo_s * -bte_if_on_node(nasid_t nasid, int interface) +static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface) { nodepda_t *tmp_nodepda; @@ -40,13 +39,11 @@ bte_if_on_node(nasid_t nasid, int interface) } - /************************************************************************ * Block Transfer Engine copy related functions. * ***********************************************************************/ - /* * bte_copy(src, dest, len, mode, notification) * @@ -66,17 +63,17 @@ bte_if_on_node(nasid_t nasid, int interface) * NOTE: This function requires src, dest, and len to * be cacheline aligned. */ -bte_result_t -bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) +bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) { u64 transfer_size; u64 transfer_stat; struct bteinfo_s *bte; bte_result_t bte_status; unsigned long irq_flags; + unsigned long itc_end = 0; struct bteinfo_s *btes_to_try[MAX_INTERFACES_TO_TRY]; int bte_if_index; - + int bte_pri, bte_sec; BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n", src, dest, len, mode, notification)); @@ -85,34 +82,44 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) return BTE_SUCCESS; } - ASSERT(!((len & L1_CACHE_MASK) || - (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK))); - ASSERT(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT)); + BUG_ON((len & L1_CACHE_MASK) || + (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK)); + BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT))); + + /* CPU 0 (per node) tries bte0 first, CPU 1 try bte1 first */ + if (cpuid_to_subnode(smp_processor_id()) == 0) { + bte_pri = 0; + bte_sec = 1; + } else { + bte_pri = 1; + bte_sec = 0; + } if (mode & BTE_USE_DEST) { /* try remote then local */ - btes_to_try[0] = bte_if_on_node(NASID_GET(dest), 0); - btes_to_try[1] = bte_if_on_node(NASID_GET(dest), 1); + btes_to_try[0] = bte_if_on_node(NASID_GET(dest), bte_pri); + btes_to_try[1] = bte_if_on_node(NASID_GET(dest), bte_sec); if (mode & BTE_USE_ANY) { - btes_to_try[2] = bte_if_on_node(get_nasid(), 0); - btes_to_try[3] = bte_if_on_node(get_nasid(), 1); + btes_to_try[2] = bte_if_on_node(get_nasid(), bte_pri); + btes_to_try[3] = bte_if_on_node(get_nasid(), bte_sec); } else { btes_to_try[2] = NULL; btes_to_try[3] = NULL; } } else { /* try local then remote */ - btes_to_try[0] = bte_if_on_node(get_nasid(), 0); - btes_to_try[1] = bte_if_on_node(get_nasid(), 1); + btes_to_try[0] = bte_if_on_node(get_nasid(), bte_pri); + btes_to_try[1] = bte_if_on_node(get_nasid(), bte_sec); if (mode & BTE_USE_ANY) { - btes_to_try[2] = bte_if_on_node(NASID_GET(dest), 0); - btes_to_try[3] = bte_if_on_node(NASID_GET(dest), 1); + btes_to_try[2] = bte_if_on_node(NASID_GET(dest), bte_pri); + btes_to_try[3] = bte_if_on_node(NASID_GET(dest), bte_sec); } else { btes_to_try[2] = NULL; btes_to_try[3] = NULL; } } +retry_bteop: do { local_irq_save(irq_flags); @@ -127,16 +134,16 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) } if (spin_trylock(&bte->spinlock)) { - if ((*bte->most_rcnt_na & BTE_ACTIVE) || + if (!(*bte->most_rcnt_na & BTE_WORD_AVAILABLE) || (BTE_LNSTAT_LOAD(bte) & BTE_ACTIVE)) { /* Got the lock but BTE still busy */ spin_unlock(&bte->spinlock); - bte = NULL; } else { /* we got the lock and it's not busy */ break; } } + bte = NULL; } if (bte != NULL) { @@ -150,7 +157,6 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) } } while (1); - if (notification == NULL) { /* User does not want to be notified. */ bte->most_rcnt_na = &bte->notify; @@ -162,7 +168,7 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) transfer_size = ((len >> L1_CACHE_SHIFT) & BTE_LEN_MASK); /* Initialize the notification to a known value. */ - *bte->most_rcnt_na = -1L; + *bte->most_rcnt_na = BTE_WORD_BUSY; /* Set the status reg busy bit and transfer length */ BTE_PRINTKV(("IBLS = 0x%lx\n", IBLS_BUSY | transfer_size)); @@ -175,42 +181,53 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) BTE_DEST_STORE(bte, TO_PHYS(dest)); /* Set the notification register */ - BTE_PRINTKV(("IBNA = 0x%lx)\n", + BTE_PRINTKV(("IBNA = 0x%lx)\n", TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)))); - BTE_NOTIF_STORE(bte, TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na))); - + BTE_NOTIF_STORE(bte, + TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na))); /* Initiate the transfer */ BTE_PRINTK(("IBCT = 0x%lx)\n", BTE_VALID_MODE(mode))); BTE_CTRL_STORE(bte, BTE_VALID_MODE(mode)); - spin_unlock_irqrestore(&bte->spinlock, irq_flags); + itc_end = ia64_get_itc() + (40000000 * local_cpu_data->cyc_per_usec); + spin_unlock_irqrestore(&bte->spinlock, irq_flags); if (notification != NULL) { return BTE_SUCCESS; } - while ((transfer_stat = *bte->most_rcnt_na) == -1UL) { + while ((transfer_stat = *bte->most_rcnt_na) == BTE_WORD_BUSY) { + if (ia64_get_itc() > itc_end) { + BTE_PRINTK(("BTE timeout nasid 0x%x bte%d IBLS = 0x%lx na 0x%lx\n", + NASID_GET(bte->bte_base_addr), bte->bte_num, + BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na) ); + bte->bte_error_count++; + bte->bh_error = IBLS_ERROR; + bte_error_handler((unsigned long)NODEPDA(bte->bte_cnode)); + *bte->most_rcnt_na = BTE_WORD_AVAILABLE; + goto retry_bteop; + } } - BTE_PRINTKV((" Delay Done. IBLS = 0x%lx, most_rcnt_na = 0x%lx\n", - BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na)); + BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na)); if (transfer_stat & IBLS_ERROR) { bte_status = transfer_stat & ~IBLS_ERROR; - *bte->most_rcnt_na = 0L; } else { bte_status = BTE_SUCCESS; } + *bte->most_rcnt_na = BTE_WORD_AVAILABLE; + BTE_PRINTK(("Returning status is 0x%lx and most_rcnt_na is 0x%lx\n", - BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na)); + BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na)); return bte_status; } -EXPORT_SYMBOL(bte_copy); +EXPORT_SYMBOL(bte_copy); /* * bte_unaligned_copy(src, dest, len, mode) @@ -228,8 +245,7 @@ EXPORT_SYMBOL(bte_copy); * NOTE: If the source, dest, and len are all cache line aligned, * then it would be _FAR_ preferrable to use bte_copy instead. */ -bte_result_t -bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) +bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) { int destFirstCacheOffset; u64 headBteSource; @@ -254,7 +270,7 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) if (bteBlock_unaligned == NULL) { return BTEFAIL_NOTAVAIL; } - bteBlock = (char *) L1_CACHE_ALIGN((u64) bteBlock_unaligned); + bteBlock = (char *)L1_CACHE_ALIGN((u64) bteBlock_unaligned); headBcopySrcOffset = src & L1_CACHE_MASK; destFirstCacheOffset = dest & L1_CACHE_MASK; @@ -302,15 +318,13 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) } if (len > headBcopyLen) { - footBcopyLen = - (len - headBcopyLen) & L1_CACHE_MASK; + footBcopyLen = (len - headBcopyLen) & L1_CACHE_MASK; footBteLen = L1_CACHE_BYTES; footBteSource = src + len - footBcopyLen; footBcopyDest = dest + len - footBcopyLen; - if (footBcopyDest == - (headBcopyDest + headBcopyLen)) { + if (footBcopyDest == (headBcopyDest + headBcopyLen)) { /* * We have two contigous bcopy * blocks. Merge them. @@ -326,9 +340,8 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) return rv; } - memcpy(__va(footBcopyDest), - (char *) bteBlock, footBcopyLen); + (char *)bteBlock, footBcopyLen); } } else { footBcopyLen = 0; @@ -350,7 +363,6 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) } } else { - /* * The transfer is not symetric, we will * allocate a buffer large enough for all the @@ -361,8 +373,7 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) /* Add the leader from source */ headBteLen = len + (src & L1_CACHE_MASK); /* Add the trailing bytes from footer. */ - headBteLen += - L1_CACHE_BYTES - (headBteLen & L1_CACHE_MASK); + headBteLen += L1_CACHE_BYTES - (headBteLen & L1_CACHE_MASK); headBteSource = src & ~L1_CACHE_MASK; headBcopySrcOffset = src & L1_CACHE_MASK; headBcopyDest = dest; @@ -371,40 +382,37 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) if (headBcopyLen > 0) { rv = bte_copy(headBteSource, - ia64_tpa((unsigned long)bteBlock), headBteLen, mode, NULL); + ia64_tpa((unsigned long)bteBlock), headBteLen, + mode, NULL); if (rv != BTE_SUCCESS) { kfree(bteBlock_unaligned); return rv; } - memcpy(__va(headBcopyDest), ((char *) bteBlock + - headBcopySrcOffset), - headBcopyLen); + memcpy(__va(headBcopyDest), ((char *)bteBlock + + headBcopySrcOffset), headBcopyLen); } kfree(bteBlock_unaligned); return BTE_SUCCESS; } -EXPORT_SYMBOL(bte_unaligned_copy); +EXPORT_SYMBOL(bte_unaligned_copy); /************************************************************************ * Block Transfer Engine initialization functions. * ***********************************************************************/ - /* * bte_init_node(nodepda, cnode) * * Initialize the nodepda structure with BTE base addresses and * spinlocks. */ -void -bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode) +void bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode) { int i; - /* * Indicate that all the block transfer engines on this node * are available. @@ -418,13 +426,13 @@ bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode) spin_lock_init(&mynodepda->bte_recovery_lock); init_timer(&mynodepda->bte_recovery_timer); mynodepda->bte_recovery_timer.function = bte_error_handler; - mynodepda->bte_recovery_timer.data = (unsigned long) mynodepda; + mynodepda->bte_recovery_timer.data = (unsigned long)mynodepda; for (i = 0; i < BTES_PER_NODE; i++) { /* Which link status register should we use? */ unsigned long link_status = (i == 0 ? IIO_IBLS0 : IIO_IBLS1); mynodepda->bte_if[i].bte_base_addr = (u64 *) - REMOTE_HUB_ADDR(cnodeid_to_nasid(cnode), link_status); + REMOTE_HUB_ADDR(cnodeid_to_nasid(cnode), link_status); /* * Initialize the notification and spinlock @@ -432,7 +440,7 @@ bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode) */ mynodepda->bte_if[i].most_rcnt_na = &(mynodepda->bte_if[i].notify); - mynodepda->bte_if[i].notify = 0L; + mynodepda->bte_if[i].notify = BTE_WORD_AVAILABLE; spin_lock_init(&mynodepda->bte_if[i].spinlock); mynodepda->bte_if[i].bte_cnode = cnode; diff --git a/arch/ia64/sn/kernel/bte_error.c b/arch/ia64/sn/kernel/bte_error.c index 3591c2cf1..fd104312c 100644 --- a/arch/ia64/sn/kernel/bte_error.c +++ b/arch/ia64/sn/kernel/bte_error.c @@ -10,11 +10,12 @@ #include #include "ioerror.h" #include -#include "shubio.h" +#include #include #include "xtalk/xwidgetdev.h" #include "xtalk/hubdev.h" #include +#include /* * Bte error handling is done in two parts. The first captures @@ -47,6 +48,7 @@ void bte_error_handler(unsigned long _nodepda) ii_icrb0_d_u_t icrbd; /* II CRB Register D */ ii_ibcr_u_t ibcr; ii_icmr_u_t icmr; + ii_ieclr_u_t ieclr; BTE_PRINTK(("bte_error_handler(%p) - %d\n", err_nodepda, smp_processor_id())); @@ -131,6 +133,14 @@ void bte_error_handler(unsigned long _nodepda) imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1; REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval); + /* Clear BTE0/1 error bits */ + ieclr.ii_ieclr_regval = 0; + if (err_nodepda->bte_if[0].bh_error != BTE_SUCCESS) + ieclr.ii_ieclr_fld_s.i_e_bte_0 = 1; + if (err_nodepda->bte_if[1].bh_error != BTE_SUCCESS) + ieclr.ii_ieclr_fld_s.i_e_bte_1 = 1; + REMOTE_HUB_S(nasid, IIO_IECLR, ieclr.ii_ieclr_regval); + /* Reinitialize both BTE state machines. */ ibcr.ii_ibcr_regval = REMOTE_HUB_L(nasid, IIO_IBCR); ibcr.ii_ibcr_fld_s.i_soft_reset = 1; @@ -152,7 +162,7 @@ void bte_error_handler(unsigned long _nodepda) err_nodepda->bte_if[i].cleanup_active = 0; BTE_PRINTK(("eh:%p:%d Unlocked %d\n", err_nodepda, smp_processor_id(), i)); - spin_unlock(&pda->cpu_bte_if[i]->spinlock); + spin_unlock(&err_nodepda->bte_if[i].spinlock); } del_timer(recovery_timer); diff --git a/arch/ia64/sn/kernel/huberror.c b/arch/ia64/sn/kernel/huberror.c index 118060460..2bdf684c5 100644 --- a/arch/ia64/sn/kernel/huberror.c +++ b/arch/ia64/sn/kernel/huberror.c @@ -13,7 +13,7 @@ #include #include "ioerror.h" #include -#include "shubio.h" +#include #include #include "xtalk/xwidgetdev.h" #include "xtalk/hubdev.h" diff --git a/arch/ia64/sn/kernel/idle.c b/arch/ia64/sn/kernel/idle.c index 65e6e3f77..49d178f02 100644 --- a/arch/ia64/sn/kernel/idle.c +++ b/arch/ia64/sn/kernel/idle.c @@ -3,14 +3,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2001-2003 Silicon Graphics, Inc. All rights reserved. + * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. */ -#include #include -#include -void snidle(int state) { +void snidle(int state) +{ if (state) { if (pda->idle_flag == 0) { /* @@ -19,11 +18,6 @@ void snidle(int state) { set_led_bits(0, LED_CPU_ACTIVITY); } -#ifdef CONFIG_IA64_SGI_SN_SIM - if (IS_RUNNING_ON_SIMULATOR()) - SIMULATOR_SLEEP(); -#endif - pda->idle_flag = 1; } else { /* diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index abb0f4283..001880812 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -201,7 +202,7 @@ static void sn_pci_fixup_slot(struct pci_dev *dev) struct pci_dev *host_pci_dev; int status = 0; - SN_PCIDEV_INFO(dev) = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL); + dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL); if (SN_PCIDEV_INFO(dev) <= 0) BUG(); /* Cannot afford to run out of memory */ memset(SN_PCIDEV_INFO(dev), 0, sizeof(struct pcidev_info)); @@ -309,8 +310,8 @@ static void sn_pci_controller_fixup(int segment, int busnum) * after this point. */ - PCI_CONTROLLER(bus) = controller; - SN_PCIBUS_BUSSOFT(bus) = provider_soft; + bus->sysdata = controller; + PCI_CONTROLLER(bus)->platform_data = provider_soft; nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); cnode = nasid_to_cnodeid(nasid); @@ -382,7 +383,7 @@ void hubdev_init_node(nodepda_t * npda, cnodeid_t node) struct hubdev_info *hubdev_info; - if (node >= numnodes) /* Headless/memless IO nodes */ + if (node >= num_online_nodes()) /* Headless/memless IO nodes */ hubdev_info = (struct hubdev_info *)alloc_bootmem_node(NODE_DATA(0), sizeof(struct diff --git a/arch/ia64/sn/kernel/iomv.c b/arch/ia64/sn/kernel/iomv.c index a98d6740a..fec6d8b82 100644 --- a/arch/ia64/sn/kernel/iomv.c +++ b/arch/ia64/sn/kernel/iomv.c @@ -32,7 +32,6 @@ void *sn_io_addr(unsigned long port) return ((void *)(port | __IA64_UNCACHED_OFFSET)); } else { /* but the simulator uses them... */ - unsigned long io_base; unsigned long addr; /* @@ -40,14 +39,9 @@ void *sn_io_addr(unsigned long port) * for accessing registers in bedrock local block * (so we don't do port&0xfff) */ - if ((port >= 0x1f0 && port <= 0x1f7) || - port == 0x3f6 || port == 0x3f7) { - io_base = (0xc000000fcc000000UL | - ((unsigned long)get_nasid() << 38)); - addr = io_base | ((port >> 2) << 12) | (port & 0xfff); - } else { - addr = __ia64_get_io_port_base() | ((port >> 2) << 2); - } + addr = (is_shub2() ? 0xc00000028c000000UL : 0xc0000087cc000000UL) | ((port >> 2) << 12); + if ((port >= 0x1f0 && port <= 0x1f7) || port == 0x3f6 || port == 0x3f7) + addr |= port; return (void *)addr; } } @@ -66,9 +60,10 @@ EXPORT_SYMBOL(sn_io_addr); */ void __sn_mmiowb(void) { - while ((((volatile unsigned long)(*pda->pio_write_status_addr)) & - SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) != - SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) + volatile unsigned long *adr = pda->pio_write_status_addr; + unsigned long val = pda->pio_write_status_val; + + while ((*adr & SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK) != val) cpu_relax(); } diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 6bcf70ea1..3be44724f 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c @@ -5,97 +5,83 @@ * 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) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. */ -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include -#include -#include -#include +#include "xtalk/xwidgetdev.h" +#include "pci/pcibus_provider_defs.h" +#include "pci/pcidev.h" +#include "pci/pcibr_provider.h" +#include +#include static void force_interrupt(int irq); -extern void pcibr_force_interrupt(pcibr_intr_t intr); -extern int sn_force_interrupt_flag; -struct irq_desc * sn_irq_desc(unsigned int irq); -extern cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; - -struct sn_intr_list_t { - struct sn_intr_list_t *next; - pcibr_intr_t intr; -}; +static void register_intr_pda(struct sn_irq_info *sn_irq_info); +static void unregister_intr_pda(struct sn_irq_info *sn_irq_info); -static struct sn_intr_list_t *sn_intr_list[NR_IRQS]; +extern int sn_force_interrupt_flag; +extern int sn_ioif_inited; +struct sn_irq_info **sn_irq; +static inline uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, + u64 sn_irq_info, + int req_irq, nasid_t req_nasid, + int req_slice) +{ + struct ia64_sal_retval ret_stuff; + ret_stuff.status = 0; + ret_stuff.v0 = 0; + + SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, + (u64) SAL_INTR_ALLOC, (u64) local_nasid, + (u64) local_widget, (u64) sn_irq_info, (u64) req_irq, + (u64) req_nasid, (u64) req_slice); + return ret_stuff.status; +} -static unsigned int -sn_startup_irq(unsigned int irq) +static inline void sn_intr_free(nasid_t local_nasid, int local_widget, + struct sn_irq_info *sn_irq_info) { - return(0); + struct ia64_sal_retval ret_stuff; + ret_stuff.status = 0; + ret_stuff.v0 = 0; + + SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, + (u64) SAL_INTR_FREE, (u64) local_nasid, + (u64) local_widget, (u64) sn_irq_info->irq_irq, + (u64) sn_irq_info->irq_cookie, 0, 0); } -static void -sn_shutdown_irq(unsigned int irq) +static unsigned int sn_startup_irq(unsigned int irq) { + return 0; } -static void -sn_disable_irq(unsigned int irq) +static void sn_shutdown_irq(unsigned int irq) { } -static void -sn_enable_irq(unsigned int irq) +static void sn_disable_irq(unsigned int irq) { } -static inline void sn_move_irq(int irq) +static void sn_enable_irq(unsigned int irq) { - /* note - we hold desc->lock */ - cpumask_t tmp; - irq_desc_t *desc = irq_descp(irq); - - if (!cpus_empty(pending_irq_cpumask[irq])) { - cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); - if (unlikely(!cpus_empty(tmp))) { - desc->handler->set_affinity(irq, pending_irq_cpumask[irq]); - } - cpus_clear(pending_irq_cpumask[irq]); - } } -static void -sn_ack_irq(unsigned int irq) +static void sn_ack_irq(unsigned int irq) { - unsigned long event_occurred, mask = 0; + uint64_t event_occurred, mask = 0; int nasid; irq = irq & 0xff; - nasid = smp_physical_node_id(); - event_occurred = HUB_L( (unsigned long *)GLOBAL_MMR_ADDR(nasid,SH_EVENT_OCCURRED) ); + nasid = get_nasid(); + event_occurred = + HUB_L((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED)); if (event_occurred & SH_EVENT_OCCURRED_UART_INT_MASK) { mask |= (1 << SH_EVENT_OCCURRED_UART_INT_SHFT); } @@ -108,272 +94,338 @@ sn_ack_irq(unsigned int irq) if (event_occurred & SH_EVENT_OCCURRED_II_INT1_MASK) { mask |= (1 << SH_EVENT_OCCURRED_II_INT1_SHFT); } - HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), mask ); + HUB_S((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), + mask); __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); - sn_move_irq(irq); + + move_irq(irq); } -static void -sn_end_irq(unsigned int irq) +static void sn_end_irq(unsigned int irq) { int nasid; int ivec; - unsigned long event_occurred; - irq_desc_t *desc = sn_irq_desc(irq); - unsigned int status = desc->status; + uint64_t event_occurred; ivec = irq & 0xff; if (ivec == SGI_UART_VECTOR) { - nasid = smp_physical_node_id(); - event_occurred = HUB_L( (unsigned long *)GLOBAL_MMR_ADDR(nasid,SH_EVENT_OCCURRED) ); - // If the UART bit is set here, we may have received an interrupt from the - // UART that the driver missed. To make sure, we IPI ourselves to force us - // to look again. + nasid = get_nasid(); + event_occurred = HUB_L((uint64_t *) GLOBAL_MMR_ADDR + (nasid, SH_EVENT_OCCURRED)); + /* If the UART bit is set here, we may have received an + * interrupt from the UART that the driver missed. To + * make sure, we IPI ourselves to force us to look again. + */ if (event_occurred & SH_EVENT_OCCURRED_UART_INT_MASK) { - platform_send_ipi(smp_processor_id(), SGI_UART_VECTOR, IA64_IPI_DM_INT, 0); + platform_send_ipi(smp_processor_id(), SGI_UART_VECTOR, + IA64_IPI_DM_INT, 0); } } __clear_bit(ivec, (volatile void *)pda->sn_in_service_ivecs); if (sn_force_interrupt_flag) - if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) - force_interrupt(irq); + force_interrupt(irq); } -static void -sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) { + struct sn_irq_info *sn_irq_info = sn_irq[irq]; + struct sn_irq_info *tmp_sn_irq_info; + int cpuid, cpuphys; + nasid_t t_nasid; /* nasid to target */ + int t_slice; /* slice to target */ + + /* allocate a temp sn_irq_info struct to get new target info */ + tmp_sn_irq_info = kmalloc(sizeof(*tmp_sn_irq_info), GFP_KERNEL); + if (!tmp_sn_irq_info) + return; + + cpuid = first_cpu(mask); + cpuphys = cpu_physical_id(cpuid); + t_nasid = cpuid_to_nasid(cpuid); + t_slice = cpuid_to_slice(cpuid); + + while (sn_irq_info) { + int status; + int local_widget; + uint64_t bridge = (uint64_t) sn_irq_info->irq_bridge; + nasid_t local_nasid = NASID_GET(bridge); + + if (!bridge) + break; /* irq is not a device interrupt */ + + if (local_nasid & 1) + local_widget = TIO_SWIN_WIDGETNUM(bridge); + else + local_widget = SWIN_WIDGETNUM(bridge); + + /* Free the old PROM sn_irq_info structure */ + sn_intr_free(local_nasid, local_widget, sn_irq_info); + + /* allocate a new PROM sn_irq_info struct */ + status = sn_intr_alloc(local_nasid, local_widget, + __pa(tmp_sn_irq_info), irq, t_nasid, + t_slice); + + if (status == 0) { + /* Update kernels sn_irq_info with new target info */ + unregister_intr_pda(sn_irq_info); + sn_irq_info->irq_cpuid = cpuid; + sn_irq_info->irq_nasid = t_nasid; + sn_irq_info->irq_slice = t_slice; + sn_irq_info->irq_xtalkaddr = + tmp_sn_irq_info->irq_xtalkaddr; + sn_irq_info->irq_cookie = tmp_sn_irq_info->irq_cookie; + register_intr_pda(sn_irq_info); + + if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type)) { + pcibr_change_devices_irq(sn_irq_info); + } + + sn_irq_info = sn_irq_info->irq_next; + #ifdef CONFIG_SMP - int redir = 0; - int cpu; - struct sn_intr_list_t *p = sn_intr_list[irq]; - pcibr_intr_t intr; - extern void sn_shub_redirect_intr(pcibr_intr_t intr, unsigned long cpu); - extern void sn_tio_redirect_intr(pcibr_intr_t intr, unsigned long cpu); - - if (p == NULL) - return; - - intr = p->intr; - - if (intr == NULL) - return; - - cpu = first_cpu(mask); - sn_shub_redirect_intr(intr, cpu); - irq = irq & 0xff; /* strip off redirect bit, if someone stuck it on. */ - (void) set_irq_affinity_info(irq, cpu_physical_id(intr->bi_cpu), redir); -#endif /* CONFIG_SMP */ + set_irq_affinity_info((irq & 0xff), cpuphys, 0); +#endif + } else { + break; /* snp_affinity failed the intr_alloc */ + } + } + kfree(tmp_sn_irq_info); } - struct hw_interrupt_type irq_type_sn = { "SN hub", sn_startup_irq, sn_shutdown_irq, sn_enable_irq, sn_disable_irq, - sn_ack_irq, + sn_ack_irq, sn_end_irq, sn_set_affinity_irq }; - -struct irq_desc * -sn_irq_desc(unsigned int irq) -{ - - irq = SN_IVEC_FROM_IRQ(irq); - - return(_irq_desc + irq); -} - -u8 -sn_irq_to_vector(unsigned int irq) -{ - return(irq); -} - -unsigned int -sn_local_vector_to_irq(u8 vector) +unsigned int sn_local_vector_to_irq(u8 vector) { return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector)); } -void -sn_irq_init (void) +void sn_irq_init(void) { int i; - irq_desc_t *base_desc = _irq_desc; + irq_desc_t *base_desc = irq_desc; - for (i=0; ibi_cpu; + int irq = sn_irq_info->irq_irq; + int cpu = sn_irq_info->irq_cpuid; if (pdacpu(cpu)->sn_last_irq < irq) { pdacpu(cpu)->sn_last_irq = irq; } - if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) pdacpu(cpu)->sn_first_irq = irq; - if (!p) panic("Could not allocate memory for sn_intr_list_t\n"); - if ((list = sn_intr_list[irq])) { - while (list->next) list = list->next; - list->next = p; - p->next = NULL; - p->intr = intr; - } else { - sn_intr_list[irq] = p; - p->next = NULL; - p->intr = intr; + + if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq) { + pdacpu(cpu)->sn_first_irq = irq; } } -void -unregister_pcibr_intr(int irq, pcibr_intr_t intr) +static void unregister_intr_pda(struct sn_irq_info *sn_irq_info) { - - struct sn_intr_list_t **prev, *curr; - int cpu = intr->bi_cpu; - int i; - - if (sn_intr_list[irq] == NULL) - return; - - prev = &sn_intr_list[irq]; - curr = sn_intr_list[irq]; - while (curr) { - if (curr->intr == intr) { - *prev = curr->next; - break; + int irq = sn_irq_info->irq_irq; + int cpu = sn_irq_info->irq_cpuid; + struct sn_irq_info *tmp_irq_info; + int i, foundmatch; + + if (pdacpu(cpu)->sn_last_irq == irq) { + foundmatch = 0; + for (i = pdacpu(cpu)->sn_last_irq - 1; i; i--) { + tmp_irq_info = sn_irq[i]; + while (tmp_irq_info) { + if (tmp_irq_info->irq_cpuid == cpu) { + foundmatch++; + break; + } + tmp_irq_info = tmp_irq_info->irq_next; + } + if (foundmatch) { + break; + } } - prev = &curr->next; - curr = curr->next; + pdacpu(cpu)->sn_last_irq = i; } - if (curr) - kfree(curr); - - if (!sn_intr_list[irq]) { - if (pdacpu(cpu)->sn_last_irq == irq) { - for (i = pdacpu(cpu)->sn_last_irq - 1; i; i--) - if (sn_intr_list[i]) + if (pdacpu(cpu)->sn_first_irq == irq) { + foundmatch = 0; + for (i = pdacpu(cpu)->sn_first_irq + 1; i < NR_IRQS; i++) { + tmp_irq_info = sn_irq[i]; + while (tmp_irq_info) { + if (tmp_irq_info->irq_cpuid == cpu) { + foundmatch++; break; - pdacpu(cpu)->sn_last_irq = i; + } + tmp_irq_info = tmp_irq_info->irq_next; + } + if (foundmatch) { + break; + } } + pdacpu(cpu)->sn_first_irq = ((i == NR_IRQS) ? 0 : i); + } +} - if (pdacpu(cpu)->sn_first_irq == irq) { - pdacpu(cpu)->sn_first_irq = 0; - for (i = pdacpu(cpu)->sn_first_irq + 1; i < NR_IRQS; i++) - if (sn_intr_list[i]) - pdacpu(cpu)->sn_first_irq = i; - } +struct sn_irq_info *sn_irq_alloc(nasid_t local_nasid, int local_widget, int irq, + nasid_t nasid, int slice) +{ + struct sn_irq_info *sn_irq_info; + int status; + + sn_irq_info = kmalloc(sizeof(*sn_irq_info), GFP_KERNEL); + if (sn_irq_info == NULL) + return NULL; + + memset(sn_irq_info, 0x0, sizeof(*sn_irq_info)); + + status = + sn_intr_alloc(local_nasid, local_widget, __pa(sn_irq_info), irq, + nasid, slice); + + if (status) { + kfree(sn_irq_info); + return NULL; + } else { + return sn_irq_info; } +} +void sn_irq_free(struct sn_irq_info *sn_irq_info) +{ + uint64_t bridge = (uint64_t) sn_irq_info->irq_bridge; + nasid_t local_nasid = NASID_GET(bridge); + int local_widget; + + if (local_nasid & 1) /* tio check */ + local_widget = TIO_SWIN_WIDGETNUM(bridge); + else + local_widget = SWIN_WIDGETNUM(bridge); + + sn_intr_free(local_nasid, local_widget, sn_irq_info); + + kfree(sn_irq_info); } -void -force_polled_int(void) +void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info) { - int i; - struct sn_intr_list_t *p; + nasid_t nasid = sn_irq_info->irq_nasid; + int slice = sn_irq_info->irq_slice; + int cpu = nasid_slice_to_cpuid(nasid, slice); - for (i=0; iintr){ - pcibr_force_interrupt(p->intr); - } - p = p->next; - } - } + sn_irq_info->irq_cpuid = cpu; + sn_irq_info->irq_pciioinfo = SN_PCIDEV_INFO(pci_dev); + + /* link it into the sn_irq[irq] list */ + sn_irq_info->irq_next = sn_irq[sn_irq_info->irq_irq]; + sn_irq[sn_irq_info->irq_irq] = sn_irq_info; + + (void)register_intr_pda(sn_irq_info); } -static void -force_interrupt(int irq) +static void force_interrupt(int irq) { - struct sn_intr_list_t *p = sn_intr_list[irq]; + struct sn_irq_info *sn_irq_info; - while (p) { - if (p->intr) { - pcibr_force_interrupt(p->intr); + if (!sn_ioif_inited) + return; + sn_irq_info = sn_irq[irq]; + while (sn_irq_info) { + if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) && + (sn_irq_info->irq_bridge != NULL)) { + pcibr_force_interrupt(sn_irq_info); } - p = p->next; + sn_irq_info = sn_irq_info->irq_next; } } /* -Check for lost interrupts. If the PIC int_status reg. says that -an interrupt has been sent, but not handled, and the interrupt -is not pending in either the cpu irr regs or in the soft irr regs, -and the interrupt is not in service, then the interrupt may have -been lost. Force an interrupt on that pin. It is possible that -the interrupt is in flight, so we may generate a spurious interrupt, -but we should never miss a real lost interrupt. -*/ - -static void -sn_check_intr(int irq, pcibr_intr_t intr) + * Check for lost interrupts. If the PIC int_status reg. says that + * an interrupt has been sent, but not handled, and the interrupt + * is not pending in either the cpu irr regs or in the soft irr regs, + * and the interrupt is not in service, then the interrupt may have + * been lost. Force an interrupt on that pin. It is possible that + * the interrupt is in flight, so we may generate a spurious interrupt, + * but we should never miss a real lost interrupt. + */ +static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info) { - unsigned long regval; + uint64_t regval; int irr_reg_num; int irr_bit; - unsigned long irr_reg; + uint64_t irr_reg; + struct pcidev_info *pcidev_info; + struct pcibus_info *pcibus_info; + + pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + if (!pcidev_info) + return; + pcibus_info = + (struct pcibus_info *)pcidev_info->pdi_host_pcidev_info-> + pdi_pcibus_info; + regval = pcireg_intr_status_get(pcibus_info); - regval = pcireg_intr_status_get(intr->bi_soft); irr_reg_num = irq_to_vector(irq) / 64; irr_bit = irq_to_vector(irq) % 64; switch (irr_reg_num) { - case 0: - irr_reg = ia64_getreg(_IA64_REG_CR_IRR0); - break; - case 1: - irr_reg = ia64_getreg(_IA64_REG_CR_IRR1); - break; - case 2: - irr_reg = ia64_getreg(_IA64_REG_CR_IRR2); - break; - case 3: - irr_reg = ia64_getreg(_IA64_REG_CR_IRR3); - break; + case 0: + irr_reg = ia64_getreg(_IA64_REG_CR_IRR0); + break; + case 1: + irr_reg = ia64_getreg(_IA64_REG_CR_IRR1); + break; + case 2: + irr_reg = ia64_getreg(_IA64_REG_CR_IRR2); + break; + case 3: + irr_reg = ia64_getreg(_IA64_REG_CR_IRR3); + break; } - if (!test_bit(irr_bit, &irr_reg) ) { - if (!test_bit(irq, pda->sn_soft_irr) ) { - if (!test_bit(irq, pda->sn_in_service_ivecs) ) { + if (!test_bit(irr_bit, &irr_reg)) { + if (!test_bit(irq, pda->sn_soft_irr)) { + if (!test_bit(irq, pda->sn_in_service_ivecs)) { regval &= 0xff; - if (intr->bi_ibits & regval & intr->bi_last_intr) { - regval &= ~(intr->bi_ibits & regval); - pcibr_force_interrupt(intr); + if (sn_irq_info->irq_int_bit & regval & + sn_irq_info->irq_last_intr) { + regval &= + ~(sn_irq_info-> + irq_int_bit & regval); + pcibr_force_interrupt(sn_irq_info); } } } } - intr->bi_last_intr = regval; + sn_irq_info->irq_last_intr = regval; } -void -sn_lb_int_war_check(void) +void sn_lb_int_war_check(void) { int i; - if (pda->sn_first_irq == 0) return; - for (i=pda->sn_first_irq; - i <= pda->sn_last_irq; i++) { - struct sn_intr_list_t *p = sn_intr_list[i]; - if (p == NULL) { - continue; - } - while (p) { - sn_check_intr(i, p->intr); - p = p->next; + if (!sn_ioif_inited || pda->sn_first_irq == 0) + return; + for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) { + struct sn_irq_info *sn_irq_info = sn_irq[i]; + while (sn_irq_info) { + /* Only call for PCI bridges that are fully initialized. */ + if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) && + (sn_irq_info->irq_bridge != NULL)) { + sn_check_intr(i, sn_irq_info); } + sn_irq_info = sn_irq_info->irq_next; + } } } diff --git a/arch/ia64/sn/kernel/mca.c b/arch/ia64/sn/kernel/mca.c index 3b313e0a3..857774bb2 100644 --- a/arch/ia64/sn/kernel/mca.c +++ b/arch/ia64/sn/kernel/mca.c @@ -10,13 +10,10 @@ #include #include #include -#include #include #include #include - - /* * Interval for calling SAL to poll for errors that do NOT cause error * interrupts. SAL will raise a CPEI if any errors are present that @@ -24,7 +21,6 @@ */ #define CPEI_INTERVAL (5*HZ) - struct timer_list sn_cpei_timer; void sn_init_cpei_timer(void); @@ -42,8 +38,7 @@ static u64 *sn_oemdata_size, sn_oemdata_bufsize; * info for platform errors. buf is appended to sn_oemdata, resizing as * required. */ -static int -print_hook(const char *fmt, ...) +static int print_hook(const char *fmt, ...) { char buf[400]; int len; @@ -55,7 +50,8 @@ print_hook(const char *fmt, ...) while (*sn_oemdata_size + len + 1 > sn_oemdata_bufsize) { u8 *newbuf = vmalloc(sn_oemdata_bufsize += 1000); if (!newbuf) { - printk(KERN_ERR "%s: unable to extend sn_oemdata\n", __FUNCTION__); + printk(KERN_ERR "%s: unable to extend sn_oemdata\n", + __FUNCTION__); return 0; } memcpy(newbuf, *sn_oemdata, *sn_oemdata_size); @@ -67,9 +63,7 @@ print_hook(const char *fmt, ...) return 0; } - -static void -sn_cpei_handler(int irq, void *devid, struct pt_regs *regs) +static void sn_cpei_handler(int irq, void *devid, struct pt_regs *regs) { /* * this function's sole purpose is to call SAL when we receive @@ -82,16 +76,13 @@ sn_cpei_handler(int irq, void *devid, struct pt_regs *regs) ia64_sn_plat_cpei_handler(); } - -static void -sn_cpei_timer_handler(unsigned long dummy) +static void sn_cpei_timer_handler(unsigned long dummy) { sn_cpei_handler(-1, NULL, NULL); mod_timer(&sn_cpei_timer, jiffies + CPEI_INTERVAL); } -void -sn_init_cpei_timer(void) +void sn_init_cpei_timer(void) { init_timer(&sn_cpei_timer); sn_cpei_timer.expires = jiffies + CPEI_INTERVAL; @@ -100,16 +91,14 @@ sn_init_cpei_timer(void) } static int -sn_platform_plat_specific_err_print(const u8 *sect_header, u8 **oemdata, u64 *oemdata_size) +sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata, + u64 * oemdata_size) { - sal_log_plat_specific_err_info_t *psei = (sal_log_plat_specific_err_info_t *)sect_header; - if (!psei->valid.oem_data) - return 0; down(&sn_oemdata_mutex); sn_oemdata = oemdata; sn_oemdata_size = oemdata_size; sn_oemdata_bufsize = 0; - ia64_sn_plat_specific_err_print(print_hook, (char *)psei); + ia64_sn_plat_specific_err_print(print_hook, (char *)sect_header); up(&sn_oemdata_mutex); return 0; } @@ -120,13 +109,21 @@ sn_platform_plat_specific_err_print(const u8 *sect_header, u8 **oemdata, u64 *oe int sn_salinfo_platform_oemdata(const u8 *sect_header, u8 **oemdata, u64 *oemdata_size) { efi_guid_t guid = *(efi_guid_t *)sect_header; + int valid = 0; *oemdata_size = 0; vfree(*oemdata); *oemdata = NULL; - if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0 || - efi_guidcmp(guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID) == 0) + if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0) { + sal_log_plat_specific_err_info_t *psei = (sal_log_plat_specific_err_info_t *)sect_header; + valid = psei->valid.oem_data; + } else if (efi_guidcmp(guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID) == 0) { + sal_log_mem_dev_err_info_t *mdei = (sal_log_mem_dev_err_info_t *)sect_header; + valid = mdei->valid.oem_data; + } + if (valid) return sn_platform_plat_specific_err_print(sect_header, oemdata, oemdata_size); - return 0; + else + return 0; } static int __init sn_salinfo_init(void) diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 4a0aa40c4..a85207794 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c @@ -3,7 +3,7 @@ * 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,2001-2004 Silicon Graphics, Inc. All rights reserved. */ #include @@ -28,71 +28,65 @@ #include #include #include +#include #include #include #include #include #include -#include -#include #include #include #include #include #include -#include #include #include #include +#include #include #include -#include +#include +#include "xtalk/xwidgetdev.h" +#include "xtalk/hubdev.h" +#include + DEFINE_PER_CPU(struct pda_s, pda_percpu); -#define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */ +#define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */ + +lboard_t *root_lboard[MAX_COMPACT_NODES]; + +extern void bte_init_node(nodepda_t *, cnodeid_t); -extern void bte_init_node (nodepda_t *, cnodeid_t); extern void sn_timer_init(void); extern unsigned long last_time_offset; -extern void init_platform_hubinfo(nodepda_t **nodepdaindr); -extern void (*ia64_mark_idle)(int); +extern void (*ia64_mark_idle) (int); extern void snidle(int); extern unsigned char acpi_kbd_controller_present; - -unsigned long sn_rtc_cycles_per_second; +unsigned long sn_rtc_cycles_per_second; EXPORT_SYMBOL(sn_rtc_cycles_per_second); partid_t sn_partid = -1; +EXPORT_SYMBOL(sn_partid); char sn_system_serial_number_string[128]; +EXPORT_SYMBOL(sn_system_serial_number_string); u64 sn_partition_serial_number; +EXPORT_SYMBOL(sn_partition_serial_number); short physical_node_map[MAX_PHYSNODE_ID]; EXPORT_SYMBOL(physical_node_map); -int numionodes; -/* - * This is the address of the RRegs in the HSpace of the global - * master. It is used by a hack in serial.c (serial_[in|out], - * printk.c (early_printk), and kdb_io.c to put console output on that - * node's Bedrock UART. It is initialized here to 0, so that - * early_printk won't try to access the UART before - * master_node_bedrock_address is properly calculated. - */ -u64 master_node_bedrock_address; +int numionodes; static void sn_init_pdas(char **); static void scan_for_ionodes(void); - -static nodepda_t *nodepdaindr[MAX_COMPACT_NODES]; - -irqpda_t *irqpdaindr; - +static nodepda_t *nodepdaindr[MAX_COMPACT_NODES]; /* * The format of "screen_info" is strange, and due to early i386-setup @@ -100,14 +94,14 @@ irqpda_t *irqpdaindr; * VGA color display. */ struct screen_info sn_screen_info = { - .orig_x = 0, - .orig_y = 0, - .orig_video_mode = 3, - .orig_video_cols = 80, - .orig_video_ega_bx = 3, - .orig_video_lines = 25, - .orig_video_isVGA = 1, - .orig_video_points = 16 + .orig_x = 0, + .orig_y = 0, + .orig_video_mode = 3, + .orig_video_cols = 80, + .orig_video_ega_bx = 3, + .orig_video_lines = 25, + .orig_video_isVGA = 1, + .orig_video_points = 16 }; /* @@ -119,11 +113,24 @@ struct screen_info sn_screen_info = { * is sufficient (the IDE driver will autodetect the drive geometry). */ #ifdef CONFIG_IA64_GENERIC -extern char drive_info[4*16]; +extern char drive_info[4 * 16]; #else -char drive_info[4*16]; +char drive_info[4 * 16]; #endif +/* + * Get nasid of current cpu early in boot before nodepda is initialized + */ +static int +boot_get_nasid(void) +{ + int nasid; + + if (ia64_sn_get_sapic_info(get_sapicid(), &nasid, NULL, NULL)) + BUG(); + return nasid; +} + /* * This routine can only be used during init, since * smp_boot_data is an init data structure. @@ -133,8 +140,7 @@ char drive_info[4*16]; * may not be initialized yet. */ -static int __init -pxm_to_nasid(int pxm) +static int __init pxm_to_nasid(int pxm) { int i; int nid; @@ -147,6 +153,7 @@ pxm_to_nasid(int pxm) } return -1; } + /** * early_sn_setup - early setup routine for SN platforms * @@ -154,16 +161,14 @@ pxm_to_nasid(int pxm) * for bringup. See start_kernel() in init/main.c. */ -void __init -early_sn_setup(void) +void __init early_sn_setup(void) { - void ia64_sal_handler_init (void *entry_point, void *gpval); - efi_system_table_t *efi_systab; - efi_config_table_t *config_tables; - struct ia64_sal_systab *sal_systab; - struct ia64_sal_desc_entry_point *ep; - char *p; - int i; + efi_system_table_t *efi_systab; + efi_config_table_t *config_tables; + struct ia64_sal_systab *sal_systab; + struct ia64_sal_desc_entry_point *ep; + char *p; + int i, j; /* * Parse enough of the SAL tables to locate the SAL entry point. Since, console @@ -172,79 +177,64 @@ early_sn_setup(void) * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. * Any changes to those file may have to be made hereas well. */ - efi_systab = (efi_system_table_t*)__va(ia64_boot_param->efi_systab); + efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); config_tables = __va(efi_systab->tables); for (i = 0; i < efi_systab->nr_tables; i++) { - if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) { + if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == + 0) { sal_systab = __va(config_tables[i].table); - p = (char*)(sal_systab+1); - for (i = 0; i < sal_systab->entry_count; i++) { + p = (char *)(sal_systab + 1); + for (j = 0; j < sal_systab->entry_count; j++) { if (*p == SAL_DESC_ENTRY_POINT) { - ep = (struct ia64_sal_desc_entry_point *) p; - ia64_sal_handler_init(__va(ep->sal_proc), __va(ep->gp)); - break; + ep = (struct ia64_sal_desc_entry_point + *)p; + ia64_sal_handler_init(__va + (ep->sal_proc), + __va(ep->gp)); + return; } p += SAL_DESC_SIZE(*p); } } } - - if ( IS_RUNNING_ON_SIMULATOR() ) { - master_node_bedrock_address = (u64)REMOTE_HUB(get_nasid(), SH_JUNK_BUS_UART0); - printk(KERN_DEBUG "early_sn_setup: setting master_node_bedrock_address to 0x%lx\n", master_node_bedrock_address); - } + /* Uh-oh, SAL not available?? */ + printk(KERN_ERR "failed to find SAL entry point\n"); } extern int platform_intr_list[]; extern nasid_t master_nasid; static int shub_1_1_found __initdata; - /* * sn_check_for_wars * * Set flag for enabling shub specific wars */ -static inline int __init -is_shub_1_1(int nasid) +static inline int __init is_shub_1_1(int nasid) { unsigned long id; - int rev; + int rev; - id = REMOTE_HUB_L(nasid, SH_SHUB_ID); - rev = (id & SH_SHUB_ID_REVISION_MASK) >> SH_SHUB_ID_REVISION_SHFT; + if (is_shub2()) + return 0; + id = REMOTE_HUB_L(nasid, SH1_SHUB_ID); + rev = (id & SH1_SHUB_ID_REVISION_MASK) >> SH1_SHUB_ID_REVISION_SHFT; return rev <= 2; } -static void __init -sn_check_for_wars(void) -{ - int cnode; - - for (cnode=0; cnode< numnodes; cnode++) - if (is_shub_1_1(cnodeid_to_nasid(cnode))) - shub_1_1_found = 1; -} - -/** - * sn_set_error_handling_features - Tell the SN prom how to handle certain - * error types. - */ -static void __init -sn_set_error_handling_features(void) +static void __init sn_check_for_wars(void) { - u64 ret; - u64 sn_ehf_bits[7]; /* see ia64_sn_set_error_handling_features */ - memset(sn_ehf_bits, 0, sizeof(sn_ehf_bits)); -#define EHF(x) __set_bit(SN_SAL_EHF_ ## x, sn_ehf_bits) - EHF(MCA_SLV_TO_OS_INIT_SLV); - EHF(NO_RZ_TLBC); - // Uncomment once Jesse's code goes in - EHF(NO_RZ_IO_READ); -#undef EHF - ret = ia64_sn_set_error_handling_features(sn_ehf_bits); - if (ret) - printk(KERN_ERR "%s: failed, return code %ld\n", __FUNCTION__, ret); + int cnode; + + if (is_shub2()) { + /* none yet */ + } else { + for_each_online_node(cnode) { + if (is_shub_1_1(cnodeid_to_nasid(cnode))) + shub_1_1_found = 1; + } + } } /** @@ -255,15 +245,12 @@ sn_set_error_handling_features(void) * the RTC frequency (via a SAL call), initializing secondary CPUs, and * setting up per-node data areas. The console is also initialized here. */ -void __init -sn_setup(char **cmdline_p) +void __init sn_setup(char **cmdline_p) { long status, ticks_per_sec, drift; int pxm; int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); - extern nasid_t snia_get_master_baseio_nasid(void); extern void sn_cpu_init(void); - extern nasid_t snia_get_console_nasid(void); /* * If the generic code has enabled vga console support - lets @@ -278,17 +265,17 @@ sn_setup(char **cmdline_p) conswitchp = &dummy_con; #else conswitchp = NULL; -#endif /* CONFIG_DUMMY_CONSOLE */ +#endif /* CONFIG_DUMMY_CONSOLE */ } -#endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */ +#endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */ MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY; memset(physical_node_map, -1, sizeof(physical_node_map)); - for (pxm=0; pxmcnodeid_to_nasid_table, -1, sizeof(pda->cnodeid_to_nasid_table)); - for (cnode=0; cnodecnodeid_to_nasid_table[cnode] = pxm_to_nasid(nid_to_pxm_map[cnode]); + memset(pda->cnodeid_to_nasid_table, -1, + sizeof(pda->cnodeid_to_nasid_table)); + for_each_online_node(cnode) + pda->cnodeid_to_nasid_table[cnode] = + pxm_to_nasid(nid_to_pxm_map[cnode]); - numionodes = numnodes; + numionodes = num_online_nodes(); scan_for_ionodes(); - /* - * Allocate & initalize the nodepda for each node. - */ - for (cnode=0; cnode < numnodes; cnode++) { - nodepdaindr[cnode] = alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); + /* + * Allocate & initalize the nodepda for each node. + */ + for_each_online_node(cnode) { + nodepdaindr[cnode] = + alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); - } + memset(nodepdaindr[cnode]->phys_cpuid, -1, + sizeof(nodepdaindr[cnode]->phys_cpuid)); + } /* - * Now copy the array of nodepda pointers to each nodepda. + * Allocate & initialize nodepda for TIOs. For now, put them on node 0. */ - for (cnode=0; cnode < numionodes; cnode++) - memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, sizeof(nodepdaindr)); + for (cnode = num_online_nodes(); cnode < numionodes; cnode++) { + nodepdaindr[cnode] = + alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t)); + memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); + } + /* + * Now copy the array of nodepda pointers to each nodepda. + */ + for (cnode = 0; cnode < numionodes; cnode++) + memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, + sizeof(nodepdaindr)); /* * Set up IO related platform-dependent nodepda fields. * The following routine actually sets up the hubinfo struct * in nodepda. */ - for (cnode = 0; cnode < numnodes; cnode++) { - init_platform_nodepda(nodepdaindr[cnode], cnode); - bte_init_node (nodepdaindr[cnode], cnode); + for_each_online_node(cnode) { + bte_init_node(nodepdaindr[cnode], cnode); + } + + /* + * Initialize the per node hubdev. This includes IO Nodes and + * headless/memless nodes. + */ + for (cnode = 0; cnode < numionodes; cnode++) { + hubdev_init_node(nodepdaindr[cnode], cnode); } } @@ -425,15 +415,25 @@ sn_init_pdas(char **cmdline_p) * Also sets up a few fields in the nodepda. Also known as * platform_cpu_init() by the ia64 machvec code. */ -void __init -sn_cpu_init(void) +void __init sn_cpu_init(void) { - int cpuid; - int cpuphyid; - int nasid; - int slice; - int cnode; - static int wars_have_been_checked; + int cpuid; + int cpuphyid; + int nasid; + int subnode; + int slice; + int cnode; + int i; + u64 shubtype, nasid_bitmask, nasid_shift; + static int wars_have_been_checked; + + memset(pda, 0, sizeof(pda)); + if (ia64_sn_get_hub_info(0, &shubtype, &nasid_bitmask, &nasid_shift)) + BUG(); + pda->shub2 = (u8)shubtype; + pda->nasid_bitmask = (u16)nasid_bitmask; + pda->nasid_shift = (u8)nasid_shift; + pda->as_shift = pda->nasid_shift - 2; /* * The boot cpu makes this call again after platform initialization is @@ -443,22 +443,33 @@ sn_cpu_init(void) return; cpuid = smp_processor_id(); - cpuphyid = ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff); - nasid = cpu_physical_id_to_nasid(cpuphyid); + cpuphyid = get_sapicid(); + + if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice)) + BUG(); + + for (i=0; i < MAX_NUMNODES; i++) { + if (nodepdaindr[i]) { + nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid; + nodepdaindr[i]->phys_cpuid[cpuid].slice = slice; + nodepdaindr[i]->phys_cpuid[cpuid].subnode = subnode; + } + } + cnode = nasid_to_cnodeid(nasid); - slice = cpu_physical_id_to_slice(cpuphyid); - memset(pda, 0, sizeof(pda)); pda->p_nodepda = nodepdaindr[cnode]; - pda->led_address = (typeof(pda->led_address)) (LED0 + (slice<led_address = + (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); pda->led_state = LED_ALWAYS_SET; - pda->hb_count = HZ/2; + pda->hb_count = HZ / 2; pda->hb_state = 0; pda->idle_flag = 0; - if (cpuid != 0){ - memcpy(pda->cnodeid_to_nasid_table, pdacpu(0)->cnodeid_to_nasid_table, - sizeof(pda->cnodeid_to_nasid_table)); + if (cpuid != 0) { + memcpy(pda->cnodeid_to_nasid_table, + pdacpu(0)->cnodeid_to_nasid_table, + sizeof(pda->cnodeid_to_nasid_table)); } /* @@ -472,30 +483,31 @@ sn_cpu_init(void) wars_have_been_checked = 1; } pda->shub_1_1_found = shub_1_1_found; - /* - * We must use different memory allocators for first cpu (bootmem - * allocator) than for the other cpus (regular allocator). + * Set up addresses of PIO/MEM write status registers. */ - if (cpuid == 0) - irqpdaindr = alloc_bootmem_node(NODE_DATA(cpuid_to_cnodeid(cpuid)),sizeof(irqpda_t)); - - memset(irqpdaindr, 0, sizeof(irqpda_t)); - irqpdaindr->irq_flags[SGI_PCIBR_ERROR] = SN2_IRQ_SHARED; - irqpdaindr->irq_flags[SGI_PCIBR_ERROR] |= SN2_IRQ_RESERVED; - irqpdaindr->irq_flags[SGI_II_ERROR] = SN2_IRQ_SHARED; - irqpdaindr->irq_flags[SGI_II_ERROR] |= SN2_IRQ_RESERVED; - - pda->pio_write_status_addr = (volatile unsigned long *) - LOCAL_MMR_ADDR((slice < 2 ? SH_PIO_WRITE_STATUS_0 : SH_PIO_WRITE_STATUS_1 ) ); - pda->mem_write_status_addr = (volatile u64 *) - LOCAL_MMR_ADDR((slice < 2 ? SH_MEMORY_WRITE_STATUS_0 : SH_MEMORY_WRITE_STATUS_1 ) ); - - if (local_node_data->active_cpu_count++ == 0) { - int buddy_nasid; - buddy_nasid = cnodeid_to_nasid(numa_node_id() == numnodes-1 ? 0 : numa_node_id()+ 1); - pda->pio_shub_war_cam_addr = (volatile unsigned long*)GLOBAL_MMR_ADDR(nasid, SH_PI_CAM_CONTROL); + { + u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; + u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, + SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; + u64 *pio; + pio = is_shub1() ? pio1 : pio2; + pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]); + pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; + } + + /* + * WAR addresses for SHUB 1.x. + */ + if (local_node_data->active_cpu_count++ == 0 && is_shub1()) { + int buddy_nasid; + buddy_nasid = + cnodeid_to_nasid(numa_node_id() == + num_online_nodes() - 1 ? 0 : numa_node_id() + 1); + pda->pio_shub_war_cam_addr = + (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid, + SH1_PI_CAM_CONTROL); } } @@ -504,48 +516,53 @@ sn_cpu_init(void) * physical_node_map and the pda and increment numionodes. */ -static void __init -scan_for_ionodes(void) +static void __init scan_for_ionodes(void) { int nasid = 0; lboard_t *brd; /* Setup ionodes with memory */ - for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) { - u64 klgraph_header; + for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { + char *klgraph_header; cnodeid_t cnodeid; - if (physical_node_map[nasid] == -1) + if (physical_node_map[nasid] == -1) continue; - klgraph_header = cnodeid = -1; - klgraph_header = ia64_sn_get_klconfig_addr(nasid); - if (klgraph_header <= 0) { - if ( IS_RUNNING_ON_SIMULATOR() ) + cnodeid = -1; + klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); + if (!klgraph_header) { + if (IS_RUNNING_ON_SIMULATOR()) continue; - BUG(); /* All nodes must have klconfig tables! */ + BUG(); /* All nodes must have klconfig tables! */ } cnodeid = nasid_to_cnodeid(nasid); root_lboard[cnodeid] = (lboard_t *) - NODE_OFFSET_TO_LBOARD( (nasid), - ((kl_config_hdr_t *)(klgraph_header))-> - ch_board_info); + NODE_OFFSET_TO_LBOARD((nasid), + ((kl_config_hdr_t + *) (klgraph_header))-> + ch_board_info); } /* Scan headless/memless IO Nodes. */ - for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) { + for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { /* if there's no nasid, don't try to read the klconfig on the node */ - if (physical_node_map[nasid] == -1) continue; - brd = find_lboard_any((lboard_t *)root_lboard[nasid_to_cnodeid(nasid)], KLTYPE_SNIA); + if (physical_node_map[nasid] == -1) + continue; + brd = find_lboard_any((lboard_t *) + root_lboard[nasid_to_cnodeid(nasid)], + KLTYPE_SNIA); if (brd) { - brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */ + brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */ if (!brd) continue; } brd = find_lboard_any(brd, KLTYPE_SNIA); + while (brd) { - pda->cnodeid_to_nasid_table[numionodes] = brd->brd_nasid; + pda->cnodeid_to_nasid_table[numionodes] = + brd->brd_nasid; physical_node_map[brd->brd_nasid] = numionodes; root_lboard[numionodes] = brd; numionodes++; @@ -556,4 +573,39 @@ scan_for_ionodes(void) brd = find_lboard_any(brd, KLTYPE_SNIA); } } + + /* Scan for TIO nodes. */ + for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { + /* if there's no nasid, don't try to read the klconfig on the node */ + if (physical_node_map[nasid] == -1) + continue; + brd = find_lboard_any((lboard_t *) + root_lboard[nasid_to_cnodeid(nasid)], + KLTYPE_TIO); + while (brd) { + pda->cnodeid_to_nasid_table[numionodes] = + brd->brd_nasid; + physical_node_map[brd->brd_nasid] = numionodes; + root_lboard[numionodes] = brd; + numionodes++; + brd = KLCF_NEXT_ANY(brd); + if (!brd) + break; + + brd = find_lboard_any(brd, KLTYPE_TIO); + } + } + +} + +int +nasid_slice_to_cpuid(int nasid, int slice) +{ + long cpu; + + for (cpu=0; cpu < NR_CPUS; cpu++) + if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice) + return cpu; + + return -1; } diff --git a/arch/ia64/sn/kernel/sn2/io.c b/arch/ia64/sn/kernel/sn2/io.c index 37b4190b7..a12c0586d 100644 --- a/arch/ia64/sn/kernel/sn2/io.c +++ b/arch/ia64/sn/kernel/sn2/io.c @@ -9,7 +9,7 @@ * we wrap the inlines from asm/ia64/sn/sn2/io.h here. */ -#include +#include #ifdef CONFIG_IA64_GENERIC @@ -28,88 +28,74 @@ #undef __sn_readl_relaxed #undef __sn_readq_relaxed -unsigned int -__sn_inb (unsigned long port) +unsigned int __sn_inb(unsigned long port) { return ___sn_inb(port); } -unsigned int -__sn_inw (unsigned long port) +unsigned int __sn_inw(unsigned long port) { return ___sn_inw(port); } -unsigned int -__sn_inl (unsigned long port) +unsigned int __sn_inl(unsigned long port) { return ___sn_inl(port); } -void -__sn_outb (unsigned char val, unsigned long port) +void __sn_outb(unsigned char val, unsigned long port) { ___sn_outb(val, port); } -void -__sn_outw (unsigned short val, unsigned long port) +void __sn_outw(unsigned short val, unsigned long port) { ___sn_outw(val, port); } -void -__sn_outl (unsigned int val, unsigned long port) +void __sn_outl(unsigned int val, unsigned long port) { ___sn_outl(val, port); } -unsigned char -__sn_readb (void *addr) +unsigned char __sn_readb(void __iomem *addr) { - return ___sn_readb (addr); + return ___sn_readb(addr); } -unsigned short -__sn_readw (void *addr) +unsigned short __sn_readw(void __iomem *addr) { - return ___sn_readw (addr); + return ___sn_readw(addr); } -unsigned int -__sn_readl (void *addr) +unsigned int __sn_readl(void __iomem *addr) { - return ___sn_readl (addr); + return ___sn_readl(addr); } -unsigned long -__sn_readq (void *addr) +unsigned long __sn_readq(void __iomem *addr) { - return ___sn_readq (addr); + return ___sn_readq(addr); } -unsigned char -__sn_readb_relaxed (void *addr) +unsigned char __sn_readb_relaxed(void __iomem *addr) { - return ___sn_readb_relaxed (addr); + return ___sn_readb_relaxed(addr); } -unsigned short -__sn_readw_relaxed (void *addr) +unsigned short __sn_readw_relaxed(void __iomem *addr) { - return ___sn_readw_relaxed (addr); + return ___sn_readw_relaxed(addr); } -unsigned int -__sn_readl_relaxed (void *addr) +unsigned int __sn_readl_relaxed(void __iomem *addr) { - return ___sn_readl_relaxed (addr); + return ___sn_readl_relaxed(addr); } -unsigned long -__sn_readq_relaxed (void *addr) +unsigned long __sn_readq_relaxed(void __iomem *addr) { - return ___sn_readq_relaxed (addr); + return ___sn_readq_relaxed(addr); } #endif diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c index 32db72ae7..81c63b2f8 100644 --- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c +++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c @@ -12,11 +12,12 @@ #include #include #include +#include #include #include #include #include -#include +#include MODULE_DESCRIPTION("PROM version reporting for /proc"); MODULE_AUTHOR("Chad Talbott"); @@ -55,30 +56,29 @@ MODULE_LICENSE("GPL"); ((unsigned) ((q) >> FIT_TYPE_SHIFT) & FIT_TYPE_MASK) struct fit_type_map_t { - unsigned char type; - const char *name; + unsigned char type; + const char *name; }; static const struct fit_type_map_t fit_entry_types[] = { - { FIT_ENTRY_FIT_HEADER, "FIT Header" }, - { FIT_ENTRY_PAL_A_GEN, "Generic PAL_A" }, - { FIT_ENTRY_PAL_A_PROC, "Processor-specific PAL_A" }, - { FIT_ENTRY_PAL_A, "PAL_A" }, - { FIT_ENTRY_PAL_B, "PAL_B" }, - { FIT_ENTRY_SAL_A, "SAL_A" }, - { FIT_ENTRY_SAL_B, "SAL_B" }, - { FIT_ENTRY_SALRUNTIME, "SAL runtime" }, - { FIT_ENTRY_EFI, "EFI" }, - { FIT_ENTRY_VMLINUX, "Embedded Linux" }, - { FIT_ENTRY_FPSWA, "Embedded FPSWA" }, - { FIT_ENTRY_UNUSED, "Unused" }, - { 0xff, "Error" }, + {FIT_ENTRY_FIT_HEADER, "FIT Header"}, + {FIT_ENTRY_PAL_A_GEN, "Generic PAL_A"}, + {FIT_ENTRY_PAL_A_PROC, "Processor-specific PAL_A"}, + {FIT_ENTRY_PAL_A, "PAL_A"}, + {FIT_ENTRY_PAL_B, "PAL_B"}, + {FIT_ENTRY_SAL_A, "SAL_A"}, + {FIT_ENTRY_SAL_B, "SAL_B"}, + {FIT_ENTRY_SALRUNTIME, "SAL runtime"}, + {FIT_ENTRY_EFI, "EFI"}, + {FIT_ENTRY_VMLINUX, "Embedded Linux"}, + {FIT_ENTRY_FPSWA, "Embedded FPSWA"}, + {FIT_ENTRY_UNUSED, "Unused"}, + {0xff, "Error"}, }; -static const char * -fit_type_name(unsigned char type) +static const char *fit_type_name(unsigned char type) { - struct fit_type_map_t const*mapp; + struct fit_type_map_t const *mapp; for (mapp = fit_entry_types; mapp->type != 0xff; mapp++) if (type == mapp->type) @@ -92,132 +92,18 @@ fit_type_name(unsigned char type) return "Unknown type"; } - -/* ============ BEGIN temp til old PROMs are no longer supported ============= - * - * The OS should not make direct access to the PROM flash memory. Access to - * this region must be serialized with a PROM lock. If SAL on one cpu is - * updating the FLASH error log at the same time another cpu is accessing the - * PROM, data corruption will occur. - * - * To solve the problem, all flash PROM access has been moved to SAL. Because - * not all systems will have instant PROM updates, we need to support a new OS - * running on a system with old PROMs. - * - * This code should be deleted after 1 OS/PROM release has occurred & the OS - * no longer supports downrev PROMs. (PROM support should be in the 3.50 - * PROMs). - */ -#define SUPPORT_OLD_PROMS -#ifdef SUPPORT_OLD_PROMS - - -#define FIT_SIGNATURE 0x2020205f5449465ful - -/* Sub-regions determined by bits in Node Offset */ -#define LB_PROM_SPACE 0x0000000700000000ul /* Local LB PROM */ - -/* Offset of PROM banner pointers in SAL A and SAL B */ -#define SAL_A_BANNER_OFFSET (1 * 16) -#define SAL_B_BANNER_OFFSET (3 * 16) - -/* Architected IA64 firmware space */ -#define FW_BASE 0x00000000FF000000 -#define FW_TOP 0x0000000100000000 - -static unsigned long -convert_fw_addr(nasid_t nasid, unsigned long addr) -{ - /* snag just the node-relative offset */ - addr &= ~0ul >> (63-35); - /* the pointer to SAL A is relative to IA-64 compatibility - * space. However, the PROM is mapped at a different offset - * in MMR space (both local and global) - */ - addr += 0x700000000; - return GLOBAL_MMR_ADDR(nasid, addr); -} - -static int -valid_fw_addr(unsigned long addr) -{ - addr &= ~(1ul << 63); /* Clear cached/uncached bit */ - return (addr >= FW_BASE && addr < FW_TOP); -} - -static unsigned long * -lookup_fit(int nasid) -{ - unsigned long *fitp; - unsigned long fit_paddr; - unsigned long *fit_vaddr; - - fitp = (void *)GLOBAL_MMR_ADDR(nasid, LB_PROM_SPACE - 32); - fit_paddr = readq(fitp); - fit_vaddr = (unsigned long *) convert_fw_addr(nasid, fit_paddr); - return fit_vaddr; -} -#endif /* SUPPORT_OLD_PROMS */ -/* ============ END temp til old PROMs are no longer supported ============= */ - static int get_fit_entry(unsigned long nasid, int index, unsigned long *fentry, char *banner, int banlen) { - int ret; - - ret = ia64_sn_get_fit_compt(nasid, index, fentry, banner, banlen); - -#ifdef SUPPORT_OLD_PROMS - /* The following is hack is temporary until PROMs are updated */ - if (ret == SALRET_NOT_IMPLEMENTED) { - unsigned long *fitadr = lookup_fit(nasid); - int nentries; - - if (readq(fitadr) != FIT_SIGNATURE) { - printk(KERN_WARNING "Unrecognized FIT signature"); - return -2; - } - - nentries = (unsigned int) (readq(fitadr + 1) & 0xffffff); - if (index >= nentries) - return -2; - - fentry[0] = readq(fitadr + 2 * index); - fentry[1] = readq(fitadr + 2 * index + 1); - ret = 0; - - if (banner && FIT_TYPE(fentry[1]) == FIT_ENTRY_SAL_A) { - unsigned long i, qw, *bwp, *qwp; - - banner[0] = '\0'; - qw = fentry[0]; /* Address of SAL A */ - if (!valid_fw_addr(qw)) - return 0; - - qw += SAL_A_BANNER_OFFSET; - qw = convert_fw_addr(nasid, qw); - - qw = readq(qw); /* Address of banner */ - if (!valid_fw_addr(qw)) - return 0; - qw = convert_fw_addr(nasid, qw); - qwp = (unsigned long *) qw; - bwp = (unsigned long *) banner; - for (i=0; icount) len = count; - if (len<0) len = 0; + if (len > count) + len = count; + if (len < 0) + len = 0; return len; } @@ -334,8 +223,7 @@ static struct proc_dir_entry *sgi_prominfo_entry; #define NODE_NAME_LEN 11 -int __init -prominfo_init(void) +int __init prominfo_init(void) { struct proc_dir_entry **entp; struct proc_dir_entry *p; @@ -346,14 +234,13 @@ prominfo_init(void) if (!ia64_platform_is("sn2")) return 0; - proc_entries = kmalloc(numnodes * sizeof(struct proc_dir_entry *), + proc_entries = kmalloc(num_online_nodes() * sizeof(struct proc_dir_entry *), GFP_KERNEL); sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL); - for (cnodeid = 0, entp = proc_entries; - cnodeid < numnodes; - cnodeid++, entp++) { + entp = proc_entries; + for_each_online_node(cnodeid) { sprintf(name, "node%d", cnodeid); *entp = proc_mkdir(name, sgi_prominfo_entry); nasid = cnodeid_to_nasid(cnodeid); @@ -367,25 +254,25 @@ prominfo_init(void) (void *)nasid); if (p) p->owner = THIS_MODULE; + entp++; } return 0; } -void __exit -prominfo_exit(void) +void __exit prominfo_exit(void) { struct proc_dir_entry **entp; unsigned cnodeid; char name[NODE_NAME_LEN]; - for (cnodeid = 0, entp = proc_entries; - cnodeid < numnodes; - cnodeid++, entp++) { + entp = proc_entries; + for_each_online_node(cnodeid) { remove_proc_entry("fit", *entp); remove_proc_entry("version", *entp); sprintf(name, "node%d", cnodeid); remove_proc_entry(name, sgi_prominfo_entry); + entp++; } remove_proc_entry("sgi_prominfo", NULL); kfree(proc_entries); diff --git a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S index 4bd638dc0..794731280 100644 --- a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S +++ b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S @@ -3,39 +3,38 @@ * 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) 2000-2004 Silicon Graphics, Inc. All rights reserved. */ -#include +#include -#define ZEROVAL 0x3f // "zero" value for outstanding PIO requests -#define DEADLOCKBIT SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK_SHFT -#define WRITECOUNT SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_SHFT -#define ALIAS_OFFSET (SH_PIO_WRITE_STATUS_0_ALIAS-SH_PIO_WRITE_STATUS_0) +#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT +#define WRITECOUNTMASK SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK +#define ALIAS_OFFSET (SH1_PIO_WRITE_STATUS_0_ALIAS-SH1_PIO_WRITE_STATUS_0) .global sn2_ptc_deadlock_recovery_core .proc sn2_ptc_deadlock_recovery_core sn2_ptc_deadlock_recovery_core: - .regstk 5,0,0,0 + .regstk 6,0,0,0 ptc0 = in0 data0 = in1 ptc1 = in2 data1 = in3 piowc = in4 + zeroval = in5 piowcphy = r30 psrsave = r2 - zeroval = r3 scr1 = r16 scr2 = r17 + mask = r18 extr.u piowcphy=piowc,0,61;; // Convert piowc to uncached physical address dep piowcphy=-1,piowcphy,63,1 - - mov zeroval=ZEROVAL // "zero" value for PIO write count + movl mask=WRITECOUNTMASK 1: add scr2=ALIAS_OFFSET,piowc // Address of WRITE_STATUS alias register @@ -43,7 +42,7 @@ sn2_ptc_deadlock_recovery_core: st8.rel [scr2]=scr1;; 5: ld8.acq scr1=[piowc];; // Wait for PIOs to complete. - extr.u scr2=scr1,WRITECOUNT,7;;// PIO count + and scr2=scr1,mask;; // mask of writecount bits cmp.ne p6,p0=zeroval,scr2 (p6) br.cond.sptk 5b @@ -57,16 +56,17 @@ sn2_ptc_deadlock_recovery_core: st8.rel [ptc0]=data0 // Write PTC0 & wait for completion. 5: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete. - extr.u scr2=scr1,WRITECOUNT,7;;// PIO count + and scr2=scr1,mask;; // mask of writecount bits cmp.ne p6,p0=zeroval,scr2 (p6) br.cond.sptk 5b;; tbit.nz p8,p7=scr1,DEADLOCKBIT;;// Test for DEADLOCK +(p7) cmp.ne p7,p0=r0,ptc1;; // Test for non-null ptc1 (p7) st8.rel [ptc1]=data1;; // Now write PTC1. 5: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete. - extr.u scr2=scr1,WRITECOUNT,7;;// PIO count + and scr2=scr1,mask;; // mask of writecount bits cmp.ne p6,p0=zeroval,scr2 (p6) br.cond.sptk 5b diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index 3ee7c10af..7af05a7ac 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -18,10 +18,11 @@ #include #include #include +#include +#include #include #include -#include #include #include #include @@ -29,46 +30,41 @@ #include #include #include -#include #include #include #include +#include #include -#include +#include #include #include -void sn2_ptc_deadlock_recovery(unsigned long data0, unsigned long data1); +void sn2_ptc_deadlock_recovery(volatile unsigned long *, unsigned long data0, + volatile unsigned long *, unsigned long data1); - -static spinlock_t sn2_global_ptc_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); static unsigned long sn2_ptc_deadlock_count; - -static inline unsigned long -wait_piowc(void) +static inline unsigned long wait_piowc(void) { - volatile unsigned long *piows; - unsigned long ws; + volatile unsigned long *piows, zeroval; + unsigned long ws; piows = pda->pio_write_status_addr; + zeroval = pda->pio_write_status_val; do { - ia64_mfa(); - } while (((ws = *piows) & SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) != - SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK); + cpu_relax(); + } while (((ws = *piows) & SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK) != zeroval); return ws; } - -void -sn_tlb_migrate_finish(struct mm_struct *mm) +void sn_tlb_migrate_finish(struct mm_struct *mm) { if (mm == current->mm) flush_tlb_mm(mm); } - /** * sn2_global_tlb_purge - globally purge translation cache of virtual address range * @start: start of virtual address range @@ -90,22 +86,22 @@ sn_tlb_migrate_finish(struct mm_struct *mm) */ void -sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) +sn2_global_tlb_purge(unsigned long start, unsigned long end, + unsigned long nbits) { - int i, cnode, mynasid, cpu, lcpu=0, nasid, flushed=0; - volatile unsigned long *ptc0, *ptc1; - unsigned long flags=0, data0, data1; - struct mm_struct *mm=current->active_mm; - short nasids[NR_NODES], nix; - DECLARE_BITMAP(nodes_flushed, NR_NODES); - - bitmap_zero(nodes_flushed, NR_NODES); - + int i, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; + volatile unsigned long *ptc0, *ptc1; + unsigned long flags = 0, data0 = 0, data1 = 0; + struct mm_struct *mm = current->active_mm; + short nasids[MAX_NUMNODES], nix; + nodemask_t nodes_flushed; + + nodes_clear(nodes_flushed); i = 0; for_each_cpu_mask(cpu, mm->cpu_vm_mask) { cnode = cpu_to_node(cpu); - __set_bit(cnode, nodes_flushed); + node_set(cnode, nodes_flushed); lcpu = cpu; i++; } @@ -114,7 +110,7 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit if (likely(i == 1 && lcpu == smp_processor_id())) { do { - ia64_ptcl(start, nbits<<2); + ia64_ptcl(start, nbits << 2); start += (1UL << nbits); } while (start < end); ia64_srlz_i(); @@ -128,43 +124,56 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit return; } - nix = 0; - for (cnode=find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES; - cnode=find_next_bit(&nodes_flushed, NR_NODES, ++cnode)) + for_each_node_mask(cnode, nodes_flushed) nasids[nix++] = cnodeid_to_nasid(cnode); + shub1 = is_shub1(); + if (shub1) { + data0 = (1UL << SH1_PTC_0_A_SHFT) | + (nbits << SH1_PTC_0_PS_SHFT) | + ((ia64_get_rr(start) >> 8) << SH1_PTC_0_RID_SHFT) | + (1UL << SH1_PTC_0_START_SHFT); + ptc0 = (long *)GLOBAL_MMR_PHYS_ADDR(0, SH1_PTC_0); + ptc1 = (long *)GLOBAL_MMR_PHYS_ADDR(0, SH1_PTC_1); + } else { + data0 = (1UL << SH2_PTC_A_SHFT) | + (nbits << SH2_PTC_PS_SHFT) | + (1UL << SH2_PTC_START_SHFT); + ptc0 = (long *)GLOBAL_MMR_PHYS_ADDR(0, SH2_PTC + + ((ia64_get_rr(start) >> 8) << SH2_PTC_RID_SHFT) ); + ptc1 = NULL; + } + - data0 = (1UL<>8)<pio_write_status_addr; + piows = pda->pio_write_status_addr; + zeroval = pda->pio_write_status_val; mycnode = numa_node_id(); - for (cnode = 0; cnode < numnodes; cnode++) { + for_each_online_node(cnode) { if (is_headless_node(cnode) || cnode == mycnode) continue; nasid = cnodeid_to_nasid(cnode); ptc0 = CHANGE_NASID(nasid, ptc0); - ptc1 = CHANGE_NASID(nasid, ptc1); - sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows); + if (ptc1) + ptc1 = CHANGE_NASID(nasid, ptc1); + sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); } } /** * sn_send_IPI_phys - send an IPI to a Nasid and slice + * @nasid: nasid to receive the interrupt (may be outside partition) * @physid: physical cpuid to receive the interrupt. * @vector: command to send * @delivery_mode: delivery mechanism @@ -224,34 +236,31 @@ sn2_ptc_deadlock_recovery(unsigned long data0, unsigned long data1) * %IA64_IPI_DM_NMI - pend an NMI * %IA64_IPI_DM_INIT - pend an INIT interrupt */ -void -sn_send_IPI_phys(long physid, int vector, int delivery_mode) +void sn_send_IPI_phys(int nasid, long physid, int vector, int delivery_mode) { - long nasid, slice, val; - unsigned long flags=0; - volatile long *p; - - nasid = cpu_physical_id_to_nasid(physid); - slice = cpu_physical_id_to_slice(physid); + long val; + unsigned long flags = 0; + volatile long *p; - p = (long*)GLOBAL_MMR_PHYS_ADDR(nasid, SH_IPI_INT); - val = (1UL<. @@ -30,15 +30,19 @@ #include #include #include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include static void *sn_hwperf_salheap = NULL; static int sn_hwperf_obj_cnt = 0; @@ -80,21 +84,26 @@ out: static int sn_hwperf_geoid_to_cnode(char *location) { int cnode; - int mod, slot, slab; - int cmod, cslot, cslab; + geoid_t geoid; + moduleid_t module_id; + char type; + int rack, slot, slab; + int this_rack, this_slot, this_slab; - if (sscanf(location, "%03dc%02d#%d", &mod, &slot, &slab) != 3) + if (sscanf(location, "%03d%c%02d#%d", &rack, &type, &slot, &slab) != 4) return -1; - for (cnode = 0; cnode < numnodes; cnode++) { - /* XXX: need a better way than this ... */ - if (sscanf(NODEPDA(cnode)->hwg_node_name, - "hw/module/%03dc%02d/slab/%d", &cmod, &cslot, &cslab) == 3) { - if (mod == cmod && slot == cslot && slab == cslab) - break; - } + + for (cnode = 0; cnode < numionodes; cnode++) { + geoid = cnodeid_get_geoid(cnode); + module_id = geo_module(geoid); + this_rack = MODULE_GET_RACK(module_id); + this_slot = MODULE_GET_BPOS(module_id); + this_slab = geo_slab(geoid); + if (rack == this_rack && slot == this_slot && slab == this_slab) + break; } - return cnode < numnodes ? cnode : -1; + return cnode < numionodes ? cnode : -1; } static int sn_hwperf_obj_to_cnode(struct sn_hwperf_object_info * obj) @@ -113,52 +122,35 @@ static int sn_hwperf_generic_ordinal(struct sn_hwperf_object_info *obj, for (ordinal=0, p=objs; p != obj; p++) { if (SN_HWPERF_FOREIGN(p)) continue; - if (p->location[3] == obj->location[3]) + if (SN_HWPERF_SAME_OBJTYPE(p, obj)) ordinal++; } return ordinal; } -#ifndef MODULE_IOBRICK -/* this will be available when ioif TIO support is added */ -#define MODULE_IOBRICK (MODULE_OPUSBRICK+1) -#endif +static const char *slabname_node = "node"; /* SHub asic */ +static const char *slabname_ionode = "ionode"; /* TIO asic */ +static const char *slabname_router = "router"; /* NL3R or NL4R */ +static const char *slabname_other = "other"; /* unknown asic */ -static const char *sn_hwperf_get_brickname(struct sn_hwperf_object_info *obj, - struct sn_hwperf_object_info *objs, int *ordinal) +static const char *sn_hwperf_get_slabname(struct sn_hwperf_object_info *obj, + struct sn_hwperf_object_info *objs, int *ordinal) { - int i; - const char *objtype = NULL; + int isnode; + const char *slabname = slabname_other; - for (i=0; i < MAX_BRICK_TYPES; i++) { - if (brick_types[i] != obj->location[3]) - continue; - switch (i) { - case MODULE_CBRICK: - objtype = "node"; - *ordinal = sn_hwperf_obj_to_cnode(obj); /* cnodeid */ - break; - - case MODULE_RBRICK: - objtype = "router"; - *ordinal = sn_hwperf_generic_ordinal(obj, objs); - break; - - case MODULE_IOBRICK: - objtype = "ionode"; - *ordinal = sn_hwperf_generic_ordinal(obj, objs); - break; - } - break; + if ((isnode = SN_HWPERF_IS_NODE(obj)) || SN_HWPERF_IS_IONODE(obj)) { + slabname = isnode ? slabname_node : slabname_ionode; + *ordinal = sn_hwperf_obj_to_cnode(obj); } - - if (i == MAX_BRICK_TYPES) { - objtype = "other"; + else { *ordinal = sn_hwperf_generic_ordinal(obj, objs); + if (SN_HWPERF_IS_ROUTER(obj)) + slabname = slabname_router; } - return objtype; + return slabname; } static int sn_topology_show(struct seq_file *s, void *d) @@ -168,7 +160,7 @@ static int sn_topology_show(struct seq_file *s, void *d) int e; int i; int j; - const char *brickname; + const char *slabname; int ordinal; cpumask_t cpumask; char slice; @@ -194,22 +186,22 @@ static int sn_topology_show(struct seq_file *s, void *d) obj->name[i] = '_'; } - brickname = sn_hwperf_get_brickname(obj, objs, &ordinal); - seq_printf(s, "%s %d %s %s asic %s", brickname, ordinal, obj->location, + slabname = sn_hwperf_get_slabname(obj, objs, &ordinal); + seq_printf(s, "%s %d %s %s asic %s", slabname, ordinal, obj->location, obj->sn_hwp_this_part ? "local" : "shared", obj->name); - if (obj->location[3] != 'c') + if (!SN_HWPERF_IS_NODE(obj) && !SN_HWPERF_IS_IONODE(obj)) seq_putc(s, '\n'); else { seq_printf(s, ", nasid 0x%x", cnodeid_to_nasid(ordinal)); - for (i=0; i < numnodes; i++) { + for (i=0; i < numionodes; i++) { seq_printf(s, i ? ":%d" : ", dist %d", node_distance(ordinal, i)); } seq_putc(s, '\n'); /* - * CPUs on this node + * CPUs on this node, if any */ cpumask = node_to_cpumask(ordinal); for_each_online_cpu(i) { @@ -253,11 +245,16 @@ static int sn_topology_show(struct seq_file *s, void *d) break; } } - if (i >= sn_hwperf_obj_cnt) - continue; seq_printf(s, "numalink %d %s-%d", ordinal+pt, obj->location, ptdata[pt].port); + if (i >= sn_hwperf_obj_cnt) { + /* no connection */ + seq_puts(s, " local endpoint disconnected" + ", protocol unknown\n"); + continue; + } + if (obj->sn_hwp_this_part && p->sn_hwp_this_part) /* both ends local to this partition */ seq_puts(s, " local"); @@ -276,9 +273,8 @@ static int sn_topology_show(struct seq_file *s, void *d) */ seq_printf(s, " endpoint %s-%d, protocol %s\n", p->location, ptdata[pt].conn_port, - strcmp(obj->name, "NL3Router") == 0 || - strcmp(p->name, "NL3Router") == 0 ? - "LLP3" : "LLP4"); + (SN_HWPERF_IS_NL3ROUTER(obj) || + SN_HWPERF_IS_NL3ROUTER(p)) ? "LLP3" : "LLP4"); } vfree(ptdata); } @@ -378,6 +374,42 @@ out: return r; } +/* map SAL hwperf error code to system error code */ +static int sn_hwperf_map_err(int hwperf_err) +{ + int e; + + switch(hwperf_err) { + case SN_HWPERF_OP_OK: + e = 0; + break; + + case SN_HWPERF_OP_NOMEM: + e = -ENOMEM; + break; + + case SN_HWPERF_OP_NO_PERM: + e = -EPERM; + break; + + case SN_HWPERF_OP_IO_ERROR: + e = -EIO; + break; + + case SN_HWPERF_OP_BUSY: + case SN_HWPERF_OP_RECONFIGURE: + e = -EAGAIN; + break; + + case SN_HWPERF_OP_INVAL: + default: + e = -EINVAL; + break; + } + + return e; +} + /* * ioctl for "sn_hwperf" misc device */ @@ -405,7 +437,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) r = -EINVAL; goto error; } - r = copy_from_user(&a, (const void *)arg, + r = copy_from_user(&a, (const void __user *)arg, sizeof(struct sn_hwperf_ioctl_args)); if (r != 0) { r = -EFAULT; @@ -426,7 +458,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) } if (op & SN_HWPERF_OP_MEM_COPYIN) { - r = copy_from_user(p, (const void *)a.ptr, a.sz); + r = copy_from_user(p, (const void __user *)a.ptr, a.sz); if (r != 0) { r = -EFAULT; goto error; @@ -473,7 +505,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) case SN_HWPERF_GET_NODE_NASID: if (a.sz != sizeof(u64) || - (node = a.arg) < 0 || node >= numnodes) { + (node = a.arg) < 0 || node >= numionodes) { r = -EINVAL; goto error; } @@ -515,18 +547,26 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) op_info.v0 = &v0; op_info.op = op; r = sn_hwperf_op_cpu(&op_info); + if (r) { + r = sn_hwperf_map_err(r); + goto error; + } break; default: /* all other ops are a direct SAL call */ r = ia64_sn_hwperf_op(sn_hwperf_master_nasid, op, a.arg, a.sz, (u64) p, 0, 0, &v0); + if (r) { + r = sn_hwperf_map_err(r); + goto error; + } a.v0 = v0; break; } if (op & SN_HWPERF_OP_MEM_COPYOUT) { - r = copy_to_user((void *)a.ptr, p, a.sz); + r = copy_to_user((void __user *)a.ptr, p, a.sz); if (r != 0) { r = -EFAULT; goto error; @@ -534,8 +574,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) } error: - if (p) - vfree(p); + vfree(p); lock_kernel(); return r; @@ -646,7 +685,6 @@ int sn_topology_release(struct inode *inode, struct file *file) { struct seq_file *seq = file->private_data; - if (seq->private) - vfree(seq->private); + vfree(seq->private); return seq_release(inode, file); } diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c index 55c1065e9..6a80fca80 100644 --- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c +++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c @@ -11,7 +11,6 @@ #ifdef CONFIG_PROC_FS #include #include -#include #include static int partition_id_show(struct seq_file *s, void *p) @@ -63,9 +62,14 @@ static int sn_force_interrupt_show(struct seq_file *s, void *p) } static ssize_t sn_force_interrupt_write_proc(struct file *file, - const __user char *buffer, size_t count, loff_t *data) + const char __user *buffer, size_t count, loff_t *data) { - sn_force_interrupt_flag = (*buffer == '0') ? 0 : 1; + char val; + + if (copy_from_user(&val, buffer, 1)) + return -EFAULT; + + sn_force_interrupt_flag = (val == '0') ? 0 : 1; return count; } @@ -76,7 +80,8 @@ static int sn_force_interrupt_open(struct inode *inode, struct file *file) static int coherence_id_show(struct seq_file *s, void *p) { - seq_printf(s, "%d\n", cpuid_to_coherence_id(smp_processor_id())); + seq_printf(s, "%d\n", partition_coherence_id()); + return 0; } @@ -117,7 +122,7 @@ void register_sn_procfs(void) struct proc_dir_entry *e; BUG_ON(sgi_proc_dir != NULL); - if (!(sgi_proc_dir = proc_mkdir("sgi_sn", 0))) + if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL))) return; sn_procfs_create_entry("partition_id", sgi_proc_dir, diff --git a/arch/ia64/sn/kernel/sn2/timer.c b/arch/ia64/sn/kernel/sn2/timer.c index 85f7d215a..deb9baf4d 100644 --- a/arch/ia64/sn/kernel/sn2/timer.c +++ b/arch/ia64/sn/kernel/sn2/timer.c @@ -16,20 +16,21 @@ #include #include +#include #include - extern unsigned long sn_rtc_cycles_per_second; -static struct time_interpolator sn2_interpolator; +static struct time_interpolator sn2_interpolator = { + .drift = -1, + .shift = 10, + .mask = (1LL << 55) - 1, + .source = TIME_SOURCE_MMIO64 +}; -void __init -sn_timer_init(void) +void __init sn_timer_init(void) { sn2_interpolator.frequency = sn_rtc_cycles_per_second; - sn2_interpolator.drift = -1; /* unknown */ - sn2_interpolator.shift = 10; /* RTC is 54 bits maximum shift is 10 */ sn2_interpolator.addr = RTC_COUNTER_ADDR; - sn2_interpolator.source = TIME_SOURCE_MMIO64; register_time_interpolator(&sn2_interpolator); } diff --git a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c index dd2c28413..cde737539 100644 --- a/arch/ia64/sn/kernel/sn2/timer_interrupt.c +++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c @@ -37,23 +37,23 @@ #include extern void sn_lb_int_war_check(void); -extern irqreturn_t timer_interrupt (int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); #define SN_LB_INT_WAR_INTERVAL 100 -void -sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +void sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* LED blinking */ if (!pda->hb_count--) { - pda->hb_count = HZ/2; - set_led_bits(pda->hb_state ^= LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT); + pda->hb_count = HZ / 2; + set_led_bits(pda->hb_state ^= + LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT); } if (enable_shub_wars_1_1()) { /* Bugfix code for SHUB 1.1 */ - if (pda->pio_shub_war_cam_addr) - *pda->pio_shub_war_cam_addr = 0x8000000000000010UL; + if (pda->pio_shub_war_cam_addr) + *pda->pio_shub_war_cam_addr = 0x8000000000000010UL; } if (pda->sn_lb_int_war_ticks == 0) sn_lb_int_war_check(); diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 71f311dc0..f680824f8 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c @@ -3,52 +3,85 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000,2002-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2000,2002-2005 Silicon Graphics, Inc. All rights reserved. * - * Routines for PCI DMA mapping. See Documentation/DMA-mapping.txt for + * Routines for PCI DMA mapping. See Documentation/DMA-API.txt for * a description of how these routines should be used. */ #include +#include #include #include "pci/pcibus_provider_defs.h" #include "pci/pcidev.h" #include "pci/pcibr_provider.h" -void sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction); +#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) +#define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG)) /** - * sn_pci_alloc_consistent - allocate memory for coherent DMA - * @hwdev: device to allocate for + * sn_dma_supported - test a DMA mask + * @dev: device to test + * @mask: DMA mask to test + * + * Return whether the given PCI device DMA address mask can be supported + * properly. For example, if your device can only drive the low 24-bits + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to + * this function. Of course, SN only supports devices that have 32 or more + * address bits when using the PMU. + */ +int sn_dma_supported(struct device *dev, u64 mask) +{ + BUG_ON(dev->bus != &pci_bus_type); + + if (mask < 0x7fffffff) + return 0; + return 1; +} +EXPORT_SYMBOL(sn_dma_supported); + +/** + * sn_dma_set_mask - set the DMA mask + * @dev: device to set + * @dma_mask: new mask + * + * Set @dev's DMA mask if the hw supports it. + */ +int sn_dma_set_mask(struct device *dev, u64 dma_mask) +{ + BUG_ON(dev->bus != &pci_bus_type); + + if (!sn_dma_supported(dev, dma_mask)) + return 0; + + *dev->dma_mask = dma_mask; + return 1; +} +EXPORT_SYMBOL(sn_dma_set_mask); + +/** + * sn_dma_alloc_coherent - allocate memory for coherent DMA + * @dev: device to allocate for * @size: size of the region * @dma_handle: DMA (bus) address + * @flags: memory allocation flags * - * pci_alloc_consistent() returns a pointer to a memory region suitable for + * dma_alloc_coherent() returns a pointer to a memory region suitable for * coherent DMA traffic to/from a PCI device. On SN platforms, this means * that @dma_handle will have the %PCIIO_DMA_CMD flag set. * * This interface is usually used for "command" streams (e.g. the command - * queue for a SCSI controller). See Documentation/DMA-mapping.txt for + * queue for a SCSI controller). See Documentation/DMA-API.txt for * more information. - * - * Also known as platform_pci_alloc_consistent() by the IA64 machvec code. */ -void *sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t * dma_handle) +void *sn_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t * dma_handle, int flags) { void *cpuaddr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - if (bussoft == NULL) { - return NULL; - } + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return NULL; /* unsupported asic type */ - } + BUG_ON(dev->bus != &pci_bus_type); /* * Allocate the memory. @@ -66,151 +99,52 @@ void *sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, /* * 64 bit address translations should never fail. * 32 bit translations can fail if there are insufficient mapping - * resources. + * resources. */ - *dma_handle = pcibr_dma_map(pcidev_info, phys_addr, size, SN_PCIDMA_CONSISTENT); + *dma_handle = pcibr_dma_map(pcidev_info, phys_addr, size, + SN_PCIDMA_CONSISTENT); if (!*dma_handle) { - printk(KERN_ERR - "sn_pci_alloc_consistent(): failed *dma_handle = 0x%lx hwdev->dev.coherent_dma_mask = 0x%lx \n", - *dma_handle, hwdev->dev.coherent_dma_mask); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); return NULL; } return cpuaddr; } +EXPORT_SYMBOL(sn_dma_alloc_coherent); /** - * sn_pci_free_consistent - free memory associated with coherent DMAable region - * @hwdev: device to free for + * sn_pci_free_coherent - free memory associated with coherent DMAable region + * @dev: device to free for * @size: size to free - * @vaddr: kernel virtual address to free + * @cpu_addr: kernel virtual address to free * @dma_handle: DMA address associated with this region * - * Frees the memory allocated by pci_alloc_consistent(). Also known - * as platform_pci_free_consistent() by the IA64 machvec code. + * Frees the memory allocated by dma_alloc_coherent(), potentially unmapping + * any associated IOMMU mappings. */ -void -sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, - dma_addr_t dma_handle) +void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, + dma_addr_t dma_handle) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (! bussoft) { - return; - } + BUG_ON(dev->bus != &pci_bus_type); pcibr_dma_unmap(pcidev_info, dma_handle, 0); - free_pages((unsigned long)vaddr, get_order(size)); -} - -/** - * sn_pci_map_sg - map a scatter-gather list for DMA - * @hwdev: device to map for - * @sg: scatterlist to map - * @nents: number of entries - * @direction: direction of the DMA transaction - * - * Maps each entry of @sg for DMA. Also known as platform_pci_map_sg by the - * IA64 machvec code. - */ -int -sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction) -{ - - int i; - unsigned long phys_addr; - struct scatterlist *saved_sg = sg; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - /* can't go anywhere w/o a direction in life */ - if (direction == PCI_DMA_NONE) - BUG(); - - if (! bussoft) { - return 0; - } - - /* SN cannot support DMA addresses smaller than 32 bits. */ - if (hwdev->dma_mask < 0x7fffffff) - return 0; - - /* - * Setup a DMA address for each entry in the - * scatterlist. - */ - for (i = 0; i < nents; i++, sg++) { - phys_addr = - __pa((unsigned long)page_address(sg->page) + sg->offset); - sg->dma_address = pcibr_dma_map(pcidev_info, phys_addr, sg->length, 0); - - if (!sg->dma_address) { - printk(KERN_ERR "sn_pci_map_sg: Unable to allocate " - "anymore page map entries.\n"); - /* - * We will need to free all previously allocated entries. - */ - if (i > 0) { - sn_pci_unmap_sg(hwdev, saved_sg, i, direction); - } - return (0); - } - - sg->dma_length = sg->length; - } - - return nents; - -} - -/** - * sn_pci_unmap_sg - unmap a scatter-gather list - * @hwdev: device to unmap - * @sg: scatterlist to unmap - * @nents: number of scatterlist entries - * @direction: DMA direction - * - * Unmap a set of streaming mode DMA translations. Again, cpu read rules - * concerning calls here are the same as for pci_unmap_single() below. Also - * known as sn_pci_unmap_sg() by the IA64 machvec code. - */ -void -sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction) -{ - int i; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - /* can't go anywhere w/o a direction in life */ - if (direction == PCI_DMA_NONE) - BUG(); - - if (! bussoft) { - return; - } - - for (i = 0; i < nents; i++, sg++) { - pcibr_dma_unmap(pcidev_info, sg->dma_address, direction); - sg->dma_address = (dma_addr_t) NULL; - sg->dma_length = 0; - } + free_pages((unsigned long)cpu_addr, get_order(size)); } +EXPORT_SYMBOL(sn_dma_free_coherent); /** - * sn_pci_map_single - map a single region for DMA - * @hwdev: device to map for - * @ptr: kernel virtual address of the region to map + * sn_dma_map_single - map a single page for DMA + * @dev: device to map for + * @cpu_addr: kernel virtual address of the region to map * @size: size of the region * @direction: DMA direction * - * Map the region pointed to by @ptr for DMA and return the - * DMA address. Also known as platform_pci_map_single() by - * the IA64 machvec code. + * Map the region pointed to by @cpu_addr for DMA and return the + * DMA address. * * We map this to the one step pcibr_dmamap_trans interface rather than * the two step pcibr_dmamap_alloc/pcibr_dmamap_addr because we have @@ -218,260 +152,212 @@ sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, * (which is pretty much unacceptable). * * TODO: simplify our interface; - * get rid of dev_desc and vhdl (seems redundant given a pci_dev); * figure out how to save dmamap handle so can use two step. */ -dma_addr_t -sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) +dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, + int direction) { dma_addr_t dma_addr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (direction == PCI_DMA_NONE) - BUG(); - - if (bussoft == NULL) { - return 0; - } - - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return 0; /* unsupported asic type */ - } - - /* SN cannot support DMA addresses smaller than 32 bits. */ - if (hwdev->dma_mask < 0x7fffffff) - return 0; - - /* - * Call our dmamap interface - */ + BUG_ON(dev->bus != &pci_bus_type); - phys_addr = __pa(ptr); + phys_addr = __pa(cpu_addr); dma_addr = pcibr_dma_map(pcidev_info, phys_addr, size, 0); if (!dma_addr) { - printk(KERN_ERR "pci_map_single: Unable to allocate anymore " - "page map entries.\n"); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; } - return ((dma_addr_t) dma_addr); + return dma_addr; } +EXPORT_SYMBOL(sn_dma_map_single); /** - * sn_pci_dma_sync_single_* - make sure all DMAs or CPU accesses - * have completed - * @hwdev: device to sync - * @dma_handle: DMA address to sync + * sn_dma_unmap_single - unamp a DMA mapped page + * @dev: device to sync + * @dma_addr: DMA address to sync * @size: size of region * @direction: DMA direction * * This routine is supposed to sync the DMA region specified - * by @dma_handle into the 'coherence domain'. We do not need to do - * anything on our platform. + * by @dma_handle into the coherence domain. On SN, we're always cache + * coherent, so we just need to free any ATEs associated with this mapping. */ -void -sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, - int direction) +void sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, + int direction) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - if (direction == PCI_DMA_NONE) - BUG(); - - if (bussoft == NULL) { - return; - } - - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return; /* unsupported asic type */ - } + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + BUG_ON(dev->bus != &pci_bus_type); pcibr_dma_unmap(pcidev_info, dma_addr, direction); } +EXPORT_SYMBOL(sn_dma_unmap_single); /** - * sn_dma_supported - test a DMA mask - * @hwdev: device to test - * @mask: DMA mask to test + * sn_dma_unmap_sg - unmap a DMA scatterlist + * @dev: device to unmap + * @sg: scatterlist to unmap + * @nhwentries: number of scatterlist entries + * @direction: DMA direction * - * Return whether the given PCI device DMA address mask can be supported - * properly. For example, if your device can only drive the low 24-bits - * during PCI bus mastering, then you would pass 0x00ffffff as the mask to - * this function. Of course, SN only supports devices that have 32 or more - * address bits when using the PMU. We could theoretically support <32 bit - * cards using direct mapping, but we'll worry about that later--on the off - * chance that someone actually wants to use such a card. + * Unmap a set of streaming mode DMA translations. */ -int sn_pci_dma_supported(struct pci_dev *hwdev, u64 mask) +void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, + int nhwentries, int direction) { - if (mask < 0x7fffffff) - return 0; - return 1; -} - -/* - * New generic DMA routines just wrap sn2 PCI routines until we - * support other bus types (if ever). - */ + int i; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); -int sn_dma_supported(struct device *dev, u64 mask) -{ BUG_ON(dev->bus != &pci_bus_type); - return sn_pci_dma_supported(to_pci_dev(dev), mask); + for (i = 0; i < nhwentries; i++, sg++) { + pcibr_dma_unmap(pcidev_info, sg->dma_address, direction); + sg->dma_address = (dma_addr_t) NULL; + sg->dma_length = 0; + } } +EXPORT_SYMBOL(sn_dma_unmap_sg); -EXPORT_SYMBOL(sn_dma_supported); - -int sn_dma_set_mask(struct device *dev, u64 dma_mask) +/** + * sn_dma_map_sg - map a scatterlist for DMA + * @dev: device to map for + * @sg: scatterlist to map + * @nhwentries: number of entries + * @direction: direction of the DMA transaction + * + * Maps each entry of @sg for DMA. + */ +int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries, + int direction) { + unsigned long phys_addr; + struct scatterlist *saved_sg = sg; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + int i; + BUG_ON(dev->bus != &pci_bus_type); - if (!sn_dma_supported(dev, dma_mask)) - return 0; + /* + * Setup a DMA address for each entry in the scatterlist. + */ + for (i = 0; i < nhwentries; i++, sg++) { + phys_addr = SG_ENT_PHYS_ADDRESS(sg); + sg->dma_address = pcibr_dma_map(pcidev_info, phys_addr, + sg->length, 0); - *dev->dma_mask = dma_mask; - return 1; -} + if (!sg->dma_address) { + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); -EXPORT_SYMBOL(sn_dma_set_mask); + /* + * Free any successfully allocated entries. + */ + if (i > 0) + sn_dma_unmap_sg(dev, saved_sg, i, direction); + return 0; + } -void *sn_dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t * dma_handle, int flag) -{ - BUG_ON(dev->bus != &pci_bus_type); + sg->dma_length = sg->length; + } - return sn_pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); + return nhwentries; } +EXPORT_SYMBOL(sn_dma_map_sg); -EXPORT_SYMBOL(sn_dma_alloc_coherent); - -void -sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, - dma_addr_t dma_handle) +void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, + size_t size, int direction) { BUG_ON(dev->bus != &pci_bus_type); - - sn_pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); } +EXPORT_SYMBOL(sn_dma_sync_single_for_cpu); -EXPORT_SYMBOL(sn_dma_free_coherent); - -dma_addr_t -sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, - int direction) +void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, + size_t size, int direction) { BUG_ON(dev->bus != &pci_bus_type); - - return sn_pci_map_single(to_pci_dev(dev), cpu_addr, size, - (int)direction); } +EXPORT_SYMBOL(sn_dma_sync_single_for_device); -EXPORT_SYMBOL(sn_dma_map_single); - -void -sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, - int direction) +void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, + int nelems, int direction) { BUG_ON(dev->bus != &pci_bus_type); - - sn_pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); } +EXPORT_SYMBOL(sn_dma_sync_sg_for_cpu); -EXPORT_SYMBOL(sn_dma_unmap_single); - -dma_addr_t -sn_dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, int direction) +void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, + int nelems, int direction) { BUG_ON(dev->bus != &pci_bus_type); - - return pci_map_page(to_pci_dev(dev), page, offset, size, - (int)direction); } +EXPORT_SYMBOL(sn_dma_sync_sg_for_device); -EXPORT_SYMBOL(sn_dma_map_page); - -void -sn_dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, - int direction) +int sn_dma_mapping_error(dma_addr_t dma_addr) { - BUG_ON(dev->bus != &pci_bus_type); - - pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); + return 0; } +EXPORT_SYMBOL(sn_dma_mapping_error); -EXPORT_SYMBOL(sn_dma_unmap_page); - -int -sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, - int direction) +char *sn_pci_get_legacy_mem(struct pci_bus *bus) { - BUG_ON(dev->bus != &pci_bus_type); + if (!SN_PCIBUS_BUSSOFT(bus)) + return ERR_PTR(-ENODEV); - return sn_pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); + return (char *)(SN_PCIBUS_BUSSOFT(bus)->bs_legacy_mem | __IA64_UNCACHED_OFFSET); } -EXPORT_SYMBOL(sn_dma_map_sg); - -void -sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, - int direction) +int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size) { - BUG_ON(dev->bus != &pci_bus_type); - - sn_pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -} + unsigned long addr; + int ret; -EXPORT_SYMBOL(sn_dma_unmap_sg); + if (!SN_PCIBUS_BUSSOFT(bus)) + return -ENODEV; -void -sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, - size_t size, int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); -} + addr = SN_PCIBUS_BUSSOFT(bus)->bs_legacy_io | __IA64_UNCACHED_OFFSET; + addr += port; -EXPORT_SYMBOL(sn_dma_sync_single_for_cpu); + ret = ia64_sn_probe_mem(addr, (long)size, (void *)val); -void -sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, - size_t size, int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); -} + if (ret == 2) + return -EINVAL; -EXPORT_SYMBOL(sn_dma_sync_single_for_device); + if (ret == 1) + *val = -1; -void -sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, - int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); + return size; } -EXPORT_SYMBOL(sn_dma_sync_sg_for_cpu); - -void -sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, - int nelems, int direction) +int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) { - BUG_ON(dev->bus != &pci_bus_type); -} + int ret = size; + unsigned long paddr; + unsigned long *addr; -int sn_dma_mapping_error(dma_addr_t dma_addr) -{ - return 0; -} + if (!SN_PCIBUS_BUSSOFT(bus)) { + ret = -ENODEV; + goto out; + } -EXPORT_SYMBOL(sn_dma_sync_sg_for_device); -EXPORT_SYMBOL(sn_pci_unmap_single); -EXPORT_SYMBOL(sn_pci_map_single); -EXPORT_SYMBOL(sn_pci_map_sg); -EXPORT_SYMBOL(sn_pci_unmap_sg); -EXPORT_SYMBOL(sn_pci_alloc_consistent); -EXPORT_SYMBOL(sn_pci_free_consistent); -EXPORT_SYMBOL(sn_pci_dma_supported); -EXPORT_SYMBOL(sn_dma_mapping_error); + /* Put the phys addr in uncached space */ + paddr = SN_PCIBUS_BUSSOFT(bus)->bs_legacy_io | __IA64_UNCACHED_OFFSET; + paddr += port; + addr = (unsigned long *)paddr; + + switch (size) { + case 1: + *(volatile u8 *)(addr) = (u8)(val); + break; + case 2: + *(volatile u16 *)(addr) = (u16)(val); + break; + case 4: + *(volatile u32 *)(addr) = (u32)(val); + break; + default: + ret = -EINVAL; + break; + } + out: + return ret; +} diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index bacc0b298..0d90ea58a 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig @@ -3,7 +3,7 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux Kernel Configuration" +mainmenu "Linux/M32R Kernel Configuration" config M32R bool @@ -14,12 +14,20 @@ config SBUS config UID16 bool - default y + default n config GENERIC_ISA_DMA bool default y +config GENERIC_HARDIRQS + bool + default y + +config GENERIC_IRQ_PROBE + bool + default y + source "init/Kconfig" @@ -189,6 +197,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default n +config GENERIC_CALIBRATE_DELAY + bool + default y + config PREEMPT bool "Preemptible Kernel" help @@ -346,96 +358,10 @@ source "fs/Kconfig" source "arch/m32r/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_STACKOVERFLOW - bool "Check for stack overflows" - depends on DEBUG_KERNEL - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config DEBUG_IOVIRT - bool "Memory mapped I/O debugging" - depends on DEBUG_KERNEL - help - Say Y here to get warned whenever an attempt is made to do I/O on - obviously invalid addresses such as those generated when ioremap() - calls are forgotten. Memory mapped I/O will go through an extra - check to catch access to unmapped ISA addresses, an access method - that can still be used by old drivers that are being ported from - 2.0/2.2. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in . Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_PAGEALLOC - bool "Page alloc debugging" - depends on DEBUG_KERNEL - help - Unmap pages from the kernel linear mapping after free_pages(). - This results in a large slowdown, but helps to find certain types - of memory corruptions. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -endmenu +source "arch/m32r/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile index 63ea62a5d..dd4418d84 100644 --- a/arch/m32r/Makefile +++ b/arch/m32r/Makefile @@ -5,7 +5,6 @@ LDFLAGS := OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -e startup_32 -LDFLAGS_BLOB := --format binary --oformat elf32-m32r CFLAGS += -pipe -fno-schedule-insns CFLAGS_KERNEL += -mmodel=medium @@ -42,6 +41,8 @@ boot := arch/m32r/boot .PHONY: zImage +all: zImage + zImage: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ @@ -51,5 +52,5 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) define archhelp - @echo ' zImage - Compressed kernel image (arch/m32r/boot/zImage)' + echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' endef diff --git a/arch/m32r/boot/compressed/Makefile b/arch/m32r/boot/compressed/Makefile index a8f130d5e..994c9aa04 100644 --- a/arch/m32r/boot/compressed/Makefile +++ b/arch/m32r/boot/compressed/Makefile @@ -5,10 +5,10 @@ # targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \ - m32r-sio.o piggy.o vmlinux.lds + piggy.o vmlinux.lds EXTRA_AFLAGS := -traditional -OBJECTS = $(obj)/head.o $(obj)/misc.o $(obj)/m32r_sio.o +OBJECTS = $(obj)/head.o $(obj)/misc.o # # IMAGE_OFFSET is the load offset of the compression loader @@ -28,8 +28,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE $(call if_changed,gzip) -$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.S FORCE - $(CPP) $(EXTRA_AFLAGS) -C -P -I include $< >$@ +CFLAGS_misc.o += -fpic LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T OBJCOPYFLAGS += -R .empty_zero_page diff --git a/arch/m32r/boot/compressed/head.S b/arch/m32r/boot/compressed/head.S index 28de481bd..10b928ed0 100644 --- a/arch/m32r/boot/compressed/head.S +++ b/arch/m32r/boot/compressed/head.S @@ -13,20 +13,62 @@ #include #include + /* + * This code can be loaded anywhere, as long as output will not + * overlap it. + * + * NOTE: This head.S should *NOT* be compiled with -fpic. + * + */ + .global startup + .global __bss_start, _ebss, end, zimage_data, zimage_len __ALIGN startup: ldi r0, #0x0000 /* SPI, disable EI */ mvtc r0, psw + ldi r12, #-8 + bl 1f + .fillinsn +1: + seth r1, #high(CONFIG_MEMORY_START + 0x00400000) /* Start address */ + add r12, r14 /* Real address */ + sub r12, r1 /* difference */ + + .global got_len + seth r3, #high(_GLOBAL_OFFSET_TABLE_+8) + or3 r3, r3, #low(_GLOBAL_OFFSET_TABLE_+12) + add r3, r14 + + /* Update the contents of global offset table */ + ldi r1, #low(got_len) + srli r1, #2 + beqz r1, 2f + .fillinsn +1: + ld r2, @r3 + add r2, r12 + st r2, @r3 + addi r3, #4 + addi r1, #-1 + bnez r1, 1b + .fillinsn +2: + /* XXX: resolve plt */ + /* * Clear BSS first so that there are no surprises... */ #ifdef CONFIG_ISA_DUAL_ISSUE + seth r2, #high(__bss_start) + or3 r2, r2, #low(__bss_start) + add r2, r12 + seth r3, #high(_ebss) + or3 r3, r3, #low(_ebss) + add r3, r12 + sub r3, r2 - LDIMM (r2, __bss_start) - LDIMM (r3, _end) - sub r3, r2 ; BSS size in bytes ; R4 = BSS size in longwords (rounded down) mv r4, r3 || ldi r1, #0 srli r4, #4 || addi r2, #-4 @@ -52,10 +94,13 @@ startup: .Lendloop2: #else /* not CONFIG_ISA_DUAL_ISSUE */ - - LDIMM (r2, __bss_start) - LDIMM (r3, _end) - sub r3, r2 ; BSS size in bytes + seth r2, #high(__bss_start) + or3 r2, r2, #low(__bss_start) + add r2, r12 + seth r3, #high(_ebss) + or3 r3, r3, #low(_ebss) + add r3, r12 + sub r3, r2 mv r4, r3 srli r4, #2 ; R4 = BSS size in longwords (rounded down) ldi r1, #0 ; clear R1 for longwords store @@ -66,27 +111,29 @@ startup: addi r4, #-1 ; decrement count bnez r4, .Lloop1 ; go do some more .Lendloop1: - and3 r4, r3, #3 ; get no. of remaining BSS bytes to clear - addi r2, #4 ; account for pre-inc store - beqz r4, .Lendloop2 ; any more to go? -.Lloop2: - stb r1, @r2 ; yep, zero out another byte - addi r2, #1 ; bump address - addi r4, #-1 ; decrement count - bnez r4, .Lloop2 ; go do some more -.Lendloop2: #endif /* not CONFIG_ISA_DUAL_ISSUE */ - seth r0, #shigh(stack_start) - ld sp, @(r0, low(stack_start)) /* set stack point */ + seth r1, #high(end) + or3 r1, r1, #low(end) + add r1, r12 + mv sp, r1 /* * decompress the kernel */ + mv r0, sp + srli r0, 31 /* MMU is ON or OFF */ + seth r1, #high(zimage_data) + or3 r1, r1, #low(zimage_data) + add r1, r12 + seth r2, #high(zimage_len) + or3 r2, r2, #low(zimage_len) + mv r3, sp + bl decompress_kernel -#if defined(CONFIG_CHIP_M32700) +#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_VDEC2) /* Cache flush */ ldi r0, -1 ldi r1, 0xd0 ; invalidate i-cache, copy back d-cache @@ -94,9 +141,14 @@ startup: #else #error "put your cache flush function, please" #endif - seth r0, #high(CONFIG_MEMORY_START) - or3 r0, r0, #0x2000 - jmp r0 + + mv r0, sp + srli r0, 31 /* MMU is ON or OFF */ + slli r0, 31 + or3 r0, r0, #0x2000 + seth r1, #high(CONFIG_MEMORY_START) + or r0, r1 + jmp r0 .balign 512 fake_headers_as_bzImage: diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c index 469c4dce5..bdfd1c283 100644 --- a/arch/m32r/boot/compressed/m32r_sio.c +++ b/arch/m32r/boot/compressed/m32r_sio.c @@ -6,12 +6,10 @@ */ #include -#include -#include -void putc(char c); +static void putc(char c); -int puts(const char *s) +static int puts(const char *s) { char c; while ((c = *s++)) putc(c); @@ -19,6 +17,9 @@ int puts(const char *s) } #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) +#include +#include + #define USE_FPGA_MAP 0 #if USE_FPGA_MAP @@ -35,7 +36,7 @@ int puts(const char *s) #define BOOT_SIO0TXB PLD_ESIO0TXB #endif -void putc(char c) +static void putc(char c) { while ((*BOOT_SIO0STS & 0x3) != 0x3) ; @@ -46,8 +47,17 @@ void putc(char c) *BOOT_SIO0TXB = c; } #else -void putc(char c) +#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14) +#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30) + +static void putc(char c) { - /* do nothing */ + + while ((*SIO0STS & 0x1) == 0) ; + if (c == '\n') { + *SIO0TXB = '\r'; + while ((*SIO0STS & 0x1) == 0) ; + } + *SIO0TXB = c; } #endif diff --git a/arch/m32r/boot/compressed/misc.c b/arch/m32r/boot/compressed/misc.c index 4661d38d9..70fa79900 100644 --- a/arch/m32r/boot/compressed/misc.c +++ b/arch/m32r/boot/compressed/misc.c @@ -8,8 +8,6 @@ * * Adapted for SH by Stuart Menefy, Aug 1999 * - * Modified to use standard LinuxSH BIOS by Greg Banks 7Jul2000 - * * 2003-02-12: Support M32R by Takeo Takahashi * This is based on arch/sh/boot/compressed/misc.c. */ @@ -38,9 +36,9 @@ typedef unsigned long ulg; static uch *inbuf; /* input buffer */ static uch window[WSIZE]; /* Sliding window buffer */ -static unsigned insize; /* valid bytes in inbuf */ -static unsigned inptr; /* index of next byte to be processed in inbuf */ -static unsigned outcnt; /* bytes in output buffer */ +static unsigned insize = 0; /* valid bytes in inbuf */ +static unsigned inptr = 0; /* index of next byte to be processed in inbuf */ +static unsigned outcnt = 0; /* bytes in output buffer */ /* gzip flag byte */ #define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */ @@ -76,24 +74,18 @@ static void error(char *m); static void gzip_mark(void **); static void gzip_release(void **); -extern char input_data[]; -extern int input_len; +static unsigned char *input_data; +static int input_len; -static long bytes_out; +static long bytes_out = 0; static uch *output_data; -static unsigned long output_ptr; +static unsigned long output_ptr = 0; +#include "m32r_sio.c" static void *malloc(int size); static void free(void *where); -static void error(char *m); -static void gzip_mark(void **); -static void gzip_release(void **); - -extern int puts(const char *); -extern int _text; /* Defined in vmlinux.lds.S */ -extern int _end; static unsigned long free_mem_ptr; static unsigned long free_mem_end_ptr; @@ -105,8 +97,8 @@ static void *malloc(int size) { void *p; - if (size <0) error("Malloc error\n"); - if (free_mem_ptr == 0) error("Memory error\n"); + if (size <0) error("Malloc error"); + if (free_mem_ptr == 0) error("Memory error"); free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ @@ -114,7 +106,7 @@ static void *malloc(int size) free_mem_ptr += size; if (free_mem_ptr >= free_mem_end_ptr) - error("\nOut of memory\n"); + error("Out of memory"); return p; } @@ -159,7 +151,7 @@ void* memcpy(void* __dest, __const void* __src, static int fill_inbuf(void) { if (insize != 0) { - error("ran out of input data\n"); + error("ran out of input data"); } inbuf = input_data; @@ -199,25 +191,20 @@ static void error(char *x) while(1); /* Halt */ } -#define STACK_SIZE (4096) -long user_stack [STACK_SIZE]; -long* stack_start = &user_stack[STACK_SIZE]; - /* return decompressed size */ -long decompress_kernel(void) +void +decompress_kernel(int mmu_on, unsigned char *zimage_data, + unsigned int zimage_len, unsigned long heap) { - insize = 0; - inptr = 0; - bytes_out = 0; - outcnt = 0; - output_data = 0; - output_ptr = CONFIG_MEMORY_START + 0x2000; - free_mem_ptr = (unsigned long)&_end; + output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000 + + (mmu_on ? 0x80000000 : 0); + free_mem_ptr = heap; free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; + input_data = zimage_data; + input_len = zimage_len; makecrc(); puts("Uncompressing Linux... "); gunzip(); puts("Ok, booting the kernel.\n"); - return bytes_out; } diff --git a/arch/m32r/boot/compressed/vmlinux.lds.S b/arch/m32r/boot/compressed/vmlinux.lds.S index 20a9e9450..a18431759 100644 --- a/arch/m32r/boot/compressed/vmlinux.lds.S +++ b/arch/m32r/boot/compressed/vmlinux.lds.S @@ -8,16 +8,24 @@ SECTIONS _text = .; .text : { *(.text) } = 0 - .rodata : { *(.rodata) } + .rodata : { *(.rodata) *(.rodata.*) } _etext = .; - . = ALIGN(32) + (. & (32 - 1)); + . = ALIGN(32 / 8); .data : { *(.data) } + . = ALIGN(32 / 8); + _got = .; + .got : { *(.got) _egot = .; *(.got.*) } _edata = .; . = ALIGN(32 / 8); __bss_start = .; - .bss : { *(.bss) } + .bss : { *(.bss) *(.sbss) } . = ALIGN(32 / 8); - _end = . ; + _ebss = .; + . = ALIGN(4096); + . += 4096; + end = . ; + + got_len = (_egot - _got); } diff --git a/arch/m32r/boot/compressed/vmlinux.scr b/arch/m32r/boot/compressed/vmlinux.scr index a08490360..924c7992c 100644 --- a/arch/m32r/boot/compressed/vmlinux.scr +++ b/arch/m32r/boot/compressed/vmlinux.scr @@ -1,9 +1,9 @@ SECTIONS { .data : { - input_len = .; - LONG(input_data_end - input_data) input_data = .; + zimage_data = .; *(.data) - input_data_end = .; + zimage_data_end = .; } + zimage_len = zimage_data_end - zimage_data; } diff --git a/arch/m32r/boot/setup.S b/arch/m32r/boot/setup.S index 9be591710..1b95a8b8d 100644 --- a/arch/m32r/boot/setup.S +++ b/arch/m32r/boot/setup.S @@ -24,7 +24,7 @@ #define CPU_PARAMS boot_cpu_data #define M32R_MCICAR 0xfffffff0 #define M32R_MCDCAR 0xfffffff4 -#define M32R_MCCR 0xfffffffc +#define M32R_MCCR 0xfffffffc #define M32R_BSCR0 0xffffffd2 ;BSEL diff --git a/arch/m32r/defconfig b/arch/m32r/defconfig index 984701b73..417c95ba8 100644 --- a/arch/m32r/defconfig +++ b/arch/m32r/defconfig @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:10:44 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -11,10 +15,12 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +30,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y # CONFIG_IKCONFIG_PROC is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -73,26 +83,11 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set -# -# M32R drivers -# -# CONFIG_M32RPCC is not set -CONFIG_M32R_CFC=y -CONFIG_M32700UT_CFC=y -CONFIG_CFC_NUM=1 -# CONFIG_MTD_M32R is not set -CONFIG_M32R_SMC91111=y -CONFIG_M32700UT_DS1302=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -100,11 +95,19 @@ CONFIG_M32700UT_DS1302=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +# CONFIG_M32R_PCC is not set +CONFIG_M32R_CFC=y +CONFIG_M32R_CFC_NUM=1 # # PCI Hotplug Support @@ -145,12 +148,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -170,7 +186,6 @@ CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -209,13 +224,12 @@ 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 # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -271,6 +285,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -290,7 +307,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -307,7 +323,50 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_SMC91X=y +# CONFIG_NE2000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -342,6 +401,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -355,7 +416,9 @@ CONFIG_SERIO_SERPORT=y # # Character devices # -# CONFIG_VT is not set +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # @@ -368,13 +431,12 @@ CONFIG_SERIO_SERPORT=y # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_M32R_SIO is not set +CONFIG_SERIAL_M32R_SIO=y +CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_SERIAL_M32R_PLDSIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -387,13 +449,13 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set +CONFIG_DS1302=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -429,8 +491,8 @@ CONFIG_VIDEO_DEV=y # Video Adapters # # CONFIG_VIDEO_CPIA is not set -CONFIG_M32R_AR=y -CONFIG_M32R_AR_VGA=y +CONFIG_VIDEO_M32R_AR=y +CONFIG_VIDEO_M32R_AR_M64278=y # # Radio Adapters @@ -445,7 +507,29 @@ CONFIG_M32R_AR_VGA=y # # Graphics support # -# CONFIG_FB is not set +CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_MONO=y +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -455,12 +539,28 @@ CONFIG_M32R_AR_VGA=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -478,10 +578,15 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -515,6 +620,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -546,9 +652,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -614,12 +720,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -627,6 +735,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index 29b0d8d0c..e71801637 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S @@ -725,25 +725,25 @@ ENTRY(sys_call_table) .long sys_time .long sys_mknod .long sys_chmod /* 15 */ - .long sys_lchown + .long sys_ni_syscall /* lchown16 syscall holder */ .long sys_ni_syscall /* old break syscall holder */ - .long sys_stat + .long sys_ni_syscall /* old stat syscall holder */ .long sys_lseek .long sys_getpid /* 20 */ .long sys_mount .long sys_oldumount - .long sys_setuid - .long sys_getuid + .long sys_ni_syscall /* setuid16 syscall holder */ + .long sys_ni_syscall /* getuid16 syscall holder */ .long sys_stime /* 25 */ .long sys_ptrace .long sys_alarm - .long sys_fstat + .long sys_ni_syscall /* old fstat syscall holder */ .long sys_pause .long sys_utime /* 30 */ - .long sys_cacheflush /* for M32R */ /* old stty syscall holder */ + .long sys_ni_syscall /* old stty syscall holder */ .long sys_cachectl /* for M32R */ /* old gtty syscall holder */ .long sys_access - .long sys_nice + .long sys_ni_syscall /* nice syscall holder */ .long sys_ni_syscall /* 35 - old ftime syscall holder */ .long sys_sync .long sys_kill @@ -755,17 +755,17 @@ ENTRY(sys_call_table) .long sys_times .long sys_ni_syscall /* old prof syscall holder */ .long sys_brk /* 45 */ - .long sys_setgid - .long sys_getgid - .long sys_signal - .long sys_geteuid - .long sys_getegid /* 50 */ + .long sys_ni_syscall /* setgid16 syscall holder */ + .long sys_getgid /* will be unused */ + .long sys_ni_syscall /* signal syscall holder */ + .long sys_ni_syscall /* geteuid16 syscall holder */ + .long sys_ni_syscall /* 50 - getegid16 syscall holder */ .long sys_acct .long sys_umount /* recycled never used phys() */ .long sys_ni_syscall /* old lock syscall holder */ .long sys_ioctl - .long sys_fcntl /* 55 */ - .long sys_ni_syscall /* old mpx syscall holder */ + .long sys_fcntl /* 55 - will be unused */ + .long sys_ni_syscall /* mpx syscall holder */ .long sys_setpgid .long sys_ni_syscall /* old ulimit syscall holder */ .long sys_ni_syscall /* sys_olduname */ @@ -776,41 +776,41 @@ ENTRY(sys_call_table) .long sys_getppid .long sys_getpgrp /* 65 */ .long sys_setsid - .long sys_sigaction - .long sys_sgetmask - .long sys_ssetmask - .long sys_setreuid /* 70 */ - .long sys_setregid - .long sys_sigsuspend - .long sys_sigpending + .long sys_ni_syscall /* sigaction syscall holder */ + .long sys_ni_syscall /* sgetmask syscall holder */ + .long sys_ni_syscall /* ssetmask syscall holder */ + .long sys_ni_syscall /* 70 - setreuid16 syscall holder */ + .long sys_ni_syscall /* setregid16 syscall holder */ + .long sys_ni_syscall /* sigsuspend syscall holder */ + .long sys_ni_syscall /* sigpending syscall holder */ .long sys_sethostname .long sys_setrlimit /* 75 */ - .long sys_getrlimit + .long sys_getrlimit/*will be unused*/ .long sys_getrusage .long sys_gettimeofday .long sys_settimeofday - .long sys_getgroups /* 80 */ - .long sys_setgroups + .long sys_ni_syscall /* 80 - getgroups16 syscall holder */ + .long sys_ni_syscall /* setgroups16 syscall holder */ .long sys_ni_syscall /* sys_oldselect */ .long sys_symlink - .long sys_lstat + .long sys_ni_syscall /* old lstat syscall holder */ .long sys_readlink /* 85 */ .long sys_uselib .long sys_swapon .long sys_reboot - .long old_readdir + .long sys_ni_syscall /* readdir syscall holder */ .long sys_ni_syscall /* 90 - old_mmap syscall holder */ .long sys_munmap .long sys_truncate .long sys_ftruncate .long sys_fchmod - .long sys_fchown /* 95 */ + .long sys_ni_syscall /* 95 - fchwon16 syscall holder */ .long sys_getpriority .long sys_setpriority .long sys_ni_syscall /* old profil syscall holder */ .long sys_statfs .long sys_fstatfs /* 100 */ - .long sys_ni_syscall /* ioperm */ + .long sys_ni_syscall /* ioperm syscall holder */ .long sys_socketcall .long sys_syslog .long sys_setitimer @@ -818,37 +818,37 @@ ENTRY(sys_call_table) .long sys_newstat .long sys_newlstat .long sys_newfstat - .long sys_uname - .long sys_ni_syscall /* 110 - iopl */ + .long sys_ni_syscall /* old uname syscall holder */ + .long sys_ni_syscall /* 110 - iopl syscall holder */ .long sys_vhangup - .long sys_ni_syscall /* for idle */ - .long sys_ni_syscall /* for vm86old */ + .long sys_ni_syscall /* idle syscall holder */ + .long sys_ni_syscall /* vm86old syscall holder */ .long sys_wait4 .long sys_swapoff /* 115 */ .long sys_sysinfo .long sys_ipc .long sys_fsync - .long sys_sigreturn + .long sys_ni_syscall /* sigreturn syscall holder */ .long sys_clone /* 120 */ .long sys_setdomainname .long sys_newuname - .long sys_ni_syscall /* sys_modify_ldt */ + .long sys_ni_syscall /* modify_ldt syscall holder */ .long sys_adjtimex .long sys_mprotect /* 125 */ - .long sys_sigprocmask - .long sys_ni_syscall /* sys_create_module */ + .long sys_ni_syscall /* sigprocmask syscall holder */ + .long sys_ni_syscall /* create_module syscall holder */ .long sys_init_module .long sys_delete_module - .long sys_ni_syscall /* 130 sys_get_kernel_syms */ + .long sys_ni_syscall /* 130 - get_kernel_syms */ .long sys_quotactl .long sys_getpgid .long sys_fchdir .long sys_bdflush .long sys_sysfs /* 135 */ .long sys_personality - .long sys_ni_syscall /* for afs_syscall */ - .long sys_setfsuid - .long sys_setfsgid + .long sys_ni_syscall /* afs_syscall syscall holder */ + .long sys_ni_syscall /* setfsuid16 syscall holder */ + .long sys_ni_syscall /* setfsgid16 syscall holder */ .long sys_llseek /* 140 */ .long sys_getdents .long sys_select @@ -873,10 +873,10 @@ ENTRY(sys_call_table) .long sys_sched_rr_get_interval .long sys_nanosleep .long sys_mremap - .long sys_setresuid - .long sys_getresuid /* 165 */ - .long sys_tas /* vm86 */ - .long sys_ni_syscall /* sys_query_module */ + .long sys_ni_syscall /* setresuid16 syscall holder */ + .long sys_ni_syscall /* 165 - getresuid16 syscall holder */ + .long sys_tas /* vm86 syscall holder */ + .long sys_ni_syscall /* query_module syscall holder */ .long sys_poll .long sys_nfsservctl .long sys_setresgid /* 170 */ @@ -891,7 +891,7 @@ ENTRY(sys_call_table) .long sys_rt_sigsuspend .long sys_pread64 /* 180 */ .long sys_pwrite64 - .long sys_chown + .long sys_ni_syscall /* chown16 syscall holder */ .long sys_getcwd .long sys_capget .long sys_capset /* 185 */ diff --git a/arch/m32r/kernel/io_m32700ut.c b/arch/m32r/kernel/io_m32700ut.c index 501b75581..371ba904e 100644 --- a/arch/m32r/kernel/io_m32700ut.c +++ b/arch/m32r/kernel/io_m32700ut.c @@ -1,5 +1,5 @@ /* - * linux/arch/m32r/kernel/io_mappi.c + * linux/arch/m32r/kernel/io_m32700ut.c * * Typical I/O routines for M32700UT board. * @@ -9,7 +9,6 @@ * This file is subject to 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 @@ -32,16 +31,16 @@ extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ -#define PORT2ADDR(port) _port2addr(port) -#define PORT2ADDR_USB(port) _port2addr_usb(port) +#define PORT2ADDR(port) _port2addr(port) +#define PORT2ADDR_USB(port) _port2addr_usb(port) -static __inline__ void *_port2addr(unsigned long port) +static inline void *_port2addr(unsigned long port) { return (void *)(port + NONCACHE_OFFSET); } #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) -static __inline__ void *__port2addr_ata(unsigned long port) +static inline void *__port2addr_ata(unsigned long port) { static int dummy_reg; @@ -67,16 +66,16 @@ static __inline__ void *__port2addr_ata(unsigned long port) */ #define LAN_IOSTART 0x300 #define LAN_IOEND 0x320 -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)(port + NONCACHE_OFFSET + 0x10000000); } -static __inline__ void *_port2addr_usb(unsigned long port) +static inline void *_port2addr_usb(unsigned long port) { - return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); + return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); } -static __inline__ void delay(void) +static inline void delay(void) { __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); } @@ -87,29 +86,30 @@ static __inline__ void delay(void) #define PORT2ADDR_NE(port) _port2addr_ne(port) -static __inline__ unsigned char _ne_inb(void *portp) +static inline unsigned char _ne_inb(void *portp) { return *(volatile unsigned char *)portp; } -static __inline__ unsigned short _ne_inw(void *portp) +static inline unsigned short _ne_inw(void *portp) { return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); } -static __inline__ void _ne_insb(void *portp, void * addr, unsigned long count) +static inline void _ne_insb(void *portp, void *addr, unsigned long count) { unsigned char *buf = (unsigned char *)addr; - while (count--) *buf++ = _ne_inb(portp); + while (count--) + *buf++ = _ne_inb(portp); } -static __inline__ void _ne_outb(unsigned char b, void *portp) +static inline void _ne_outb(unsigned char b, void *portp) { *(volatile unsigned char *)portp = b; } -static __inline__ void _ne_outw(unsigned short w, void *portp) +static inline void _ne_outw(unsigned short w, void *portp) { *(volatile unsigned short *)portp = cpu_to_le16(w); } @@ -126,9 +126,9 @@ unsigned char _inb(unsigned long port) #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif @@ -146,13 +146,13 @@ unsigned short _inw(unsigned long port) #endif #if defined(CONFIG_USB) else if(port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); + return *(volatile unsigned short *)PORT2ADDR_USB(port); #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif return *(volatile unsigned short *)PORT2ADDR(port); @@ -162,9 +162,9 @@ unsigned long _inl(unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); - return l; + unsigned long l; + pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); + return l; } else #endif return *(volatile unsigned long *)PORT2ADDR(port); @@ -184,9 +184,9 @@ unsigned char _inb_p(unsigned long port) #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif v = *(volatile unsigned char *)PORT2ADDR(port); @@ -208,15 +208,15 @@ unsigned short _inw_p(unsigned long port) } else #endif #if defined(CONFIG_USB) - if(port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); + if(port >= 0x340 && port < 0x3a0) + return *(volatile unsigned short *)PORT2ADDR_USB(port); else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif v = *(volatile unsigned short *)PORT2ADDR(port); @@ -246,7 +246,7 @@ void _outb(unsigned char b, unsigned long port) #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -264,12 +264,12 @@ void _outw(unsigned short w, unsigned long port) #endif #if defined(CONFIG_USB) if(port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -279,7 +279,7 @@ void _outl(unsigned long l, unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); + pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); } else #endif *(volatile unsigned long *)PORT2ADDR(port) = l; @@ -297,7 +297,7 @@ void _outb_p(unsigned char b, unsigned long port) #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -316,13 +316,13 @@ void _outw_p(unsigned short w, unsigned long port) } else #endif #if defined(CONFIG_USB) - if(port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; + if(port >= 0x340 && port < 0x3a0) + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -336,7 +336,7 @@ void _outl_p(unsigned long l, unsigned long port) delay(); } -void _insb(unsigned int port, void * addr, unsigned long count) +void _insb(unsigned int port, void *addr, unsigned long count) { if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_insb(PORT2ADDR_NE(port), addr, count); @@ -344,22 +344,25 @@ void _insb(unsigned int port, void * addr, unsigned long count) else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { unsigned char *buf = addr; unsigned char *portp = __port2addr_ata(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { + pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); } #endif else { unsigned char *buf = addr; unsigned char *portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } -void _insw(unsigned int port, void * addr, unsigned long count) +void _insw(unsigned int port, void *addr, unsigned long count) { unsigned short *buf = addr; unsigned short *portp; @@ -370,55 +373,64 @@ void _insw(unsigned int port, void * addr, unsigned long count) * from the DATA_REG. Do not swap the data. */ portp = PORT2ADDR_NE(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; #endif } else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } -void _insl(unsigned int port, void * addr, unsigned long count) +void _insl(unsigned int port, void *addr, unsigned long count) { unsigned long *buf = addr; unsigned long *portp; portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned long *)portp; + while (count--) + *buf++ = *(volatile unsigned long *)portp; } -void _outsb(unsigned int port, const void * addr, unsigned long count) +void _outsb(unsigned int port, const void *addr, unsigned long count) { const unsigned char *buf = addr; unsigned char *portp; if (port >= LAN_IOSTART && port < LAN_IOEND) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outb(*buf++, portp); + while (count--) + _ne_outb(*buf++, portp); #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; } } -void _outsw(unsigned int port, const void * addr, unsigned long count) +void _outsw(unsigned int port, const void *addr, unsigned long count) { const unsigned short *buf = addr; unsigned short *portp; @@ -429,27 +441,32 @@ void _outsw(unsigned int port, const void * addr, unsigned long count) * into the DATA_REG. Do not swap the data. */ portp = PORT2ADDR_NE(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; } } -void _outsl(unsigned int port, const void * addr, unsigned long count) +void _outsl(unsigned int port, const void *addr, unsigned long count) { const unsigned long *buf = addr; unsigned char *portp; portp = PORT2ADDR(port); - while(count--) *(volatile unsigned long *)portp = *buf++; + while (count--) + *(volatile unsigned long *)portp = *buf++; } diff --git a/arch/m32r/kernel/io_mappi.c b/arch/m32r/kernel/io_mappi.c index 74aeca636..85688ffb5 100644 --- a/arch/m32r/kernel/io_mappi.c +++ b/arch/m32r/kernel/io_mappi.c @@ -7,15 +7,13 @@ * Hitoshi Yamamoto */ -/* $Id: io_mappi.c,v 1.9 2003/12/02 07:18:08 fujiwara Exp $ */ - #include #include #include #include #include -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) #include #define M32R_PCC_IOMAP_SIZE 0x1000 @@ -27,21 +25,21 @@ extern void pcc_ioread(int, unsigned long, void *, size_t, size_t, int); extern void pcc_iowrite(int, unsigned long, void *, size_t, size_t, int); -#endif /* CONFIG_PCMCIA && CONFIG_M32RPCC */ +#endif /* CONFIG_PCMCIA && CONFIG_M32R_PCC */ #define PORT2ADDR(port) _port2addr(port) -static __inline__ void *_port2addr(unsigned long port) +static inline void *_port2addr(unsigned long port) { return (void *)(port + NONCACHE_OFFSET); } -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)((port<<1) + NONCACHE_OFFSET + 0x0C000000); } -static __inline__ void delay(void) +static inline void delay(void) { __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); } @@ -52,12 +50,12 @@ static __inline__ void delay(void) #define PORT2ADDR_NE(port) _port2addr_ne(port) -static __inline__ unsigned char _ne_inb(void *portp) +static inline unsigned char _ne_inb(void *portp) { return (unsigned char) *(volatile unsigned short *)portp; } -static __inline__ unsigned short _ne_inw(void *portp) +static inline unsigned short _ne_inw(void *portp) { unsigned short tmp; @@ -65,12 +63,12 @@ static __inline__ unsigned short _ne_inw(void *portp) return le16_to_cpu(tmp); } -static __inline__ void _ne_outb(unsigned char b, void *portp) +static inline void _ne_outb(unsigned char b, void *portp) { *(volatile unsigned short *)portp = (unsigned short)b; } -static __inline__ void _ne_outw(unsigned short w, void *portp) +static inline void _ne_outw(unsigned short w, void *portp) { *(volatile unsigned short *)portp = cpu_to_le16(w); } @@ -80,15 +78,15 @@ unsigned char _inb(unsigned long port) if (port >= 0x300 && port < 0x320) return _ne_inb(PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread(0, port, &b, sizeof(b), 1, 0); + return b; } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned char b; - pcc_ioread(1, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread(1, port, &b, sizeof(b), 1, 0); + return b; } else #endif @@ -100,15 +98,15 @@ unsigned short _inw(unsigned long port) if (port >= 0x300 && port < 0x320) return _ne_inw(PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread(0, port, &w, sizeof(w), 1, 0); + return w; } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned short w; - pcc_ioread(1, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread(1, port, &w, sizeof(w), 1, 0); + return w; } else #endif return *(volatile unsigned short *)PORT2ADDR(port); @@ -116,15 +114,15 @@ unsigned short _inw(unsigned long port) unsigned long _inl(unsigned long port) { -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread(0, port, &l, sizeof(l), 1, 0); - return l; + unsigned long l; + pcc_ioread(0, port, &l, sizeof(l), 1, 0); + return l; } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned short l; - pcc_ioread(1, port, &l, sizeof(l), 1, 0); - return l; + unsigned short l; + pcc_ioread(1, port, &l, sizeof(l), 1, 0); + return l; } else #endif return *(volatile unsigned long *)PORT2ADDR(port); @@ -137,15 +135,15 @@ unsigned char _inb_p(unsigned long port) if (port >= 0x300 && port < 0x320) v = _ne_inb(PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread(0, port, &b, sizeof(b), 1, 0); + return b; } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned char b; - pcc_ioread(1, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread(1, port, &b, sizeof(b), 1, 0); + return b; } else #endif v = *(volatile unsigned char *)PORT2ADDR(port); @@ -161,15 +159,15 @@ unsigned short _inw_p(unsigned long port) if (port >= 0x300 && port < 0x320) v = _ne_inw(PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread(0, port, &w, sizeof(w), 1, 0); + return w; } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned short w; - pcc_ioread(1, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread(1, port, &w, sizeof(w), 1, 0); + return w; } else #endif v = *(volatile unsigned short *)PORT2ADDR(port); @@ -192,11 +190,11 @@ void _outb(unsigned char b, unsigned long port) if (port >= 0x300 && port < 0x320) _ne_outb(b, PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite(0, port, &b, sizeof(b), 1, 0); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &b, sizeof(b), 1, 0); + pcc_iowrite(1, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -207,11 +205,11 @@ void _outw(unsigned short w, unsigned long port) if (port >= 0x300 && port < 0x320) _ne_outw(w, PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite(0, port, &w, sizeof(w), 1, 0); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &w, sizeof(w), 1, 0); + pcc_iowrite(1, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -219,11 +217,11 @@ void _outw(unsigned short w, unsigned long port) void _outl(unsigned long l, unsigned long port) { -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &l, sizeof(l), 1, 0); + pcc_iowrite(0, port, &l, sizeof(l), 1, 0); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &l, sizeof(l), 1, 0); + pcc_iowrite(1, port, &l, sizeof(l), 1, 0); } else #endif *(volatile unsigned long *)PORT2ADDR(port) = l; @@ -234,11 +232,11 @@ void _outb_p(unsigned char b, unsigned long port) if (port >= 0x300 && port < 0x320) _ne_outb(b, PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite(0, port, &b, sizeof(b), 1, 0); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &b, sizeof(b), 1, 0); + pcc_iowrite(1, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -251,11 +249,11 @@ void _outw_p(unsigned short w, unsigned long port) if (port >= 0x300 && port < 0x320) _ne_outw(w, PORT2ADDR_NE(port)); else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite(0, port, &w, sizeof(w), 1, 0); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &w, sizeof(w), 1, 0); + pcc_iowrite(1, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -269,100 +267,118 @@ void _outl_p(unsigned long l, unsigned long port) delay(); } -void _insb(unsigned int port, void * addr, unsigned long count) +void _insb(unsigned int port, void *addr, unsigned long count) { unsigned short *buf = addr; unsigned short *portp; if (port >= 0x300 && port < 0x320){ portp = PORT2ADDR_NE(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) + while (count--) + *buf++ = *(volatile unsigned char *)portp; +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread(0, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_ioread(0, port, (void *)addr, sizeof(unsigned char), + count, 1); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_ioread(1, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_ioread(1, port, (void *)addr, sizeof(unsigned char), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } -void _insw(unsigned int port, void * addr, unsigned long count) +void _insw(unsigned int port, void *addr, unsigned long count) { unsigned short *buf = addr; unsigned short *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) *buf++ = _ne_inw(portp); -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) + while (count--) + *buf++ = _ne_inw(portp); +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread(0, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_ioread(0, port, (void *)addr, sizeof(unsigned short), + count, 1); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_ioread(1, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_ioread(1, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } -void _insl(unsigned int port, void * addr, unsigned long count) +void _insl(unsigned int port, void *addr, unsigned long count) { unsigned long *buf = addr; unsigned long *portp; portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned long *)portp; + while (count--) + *buf++ = *(volatile unsigned long *)portp; } -void _outsb(unsigned int port, const void * addr, unsigned long count) +void _outsb(unsigned int port, const void *addr, unsigned long count) { const unsigned char *buf = addr; unsigned char *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outb(*buf++, portp); -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) + while (count--) + _ne_outb(*buf++, portp); +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_iowrite(0, port, (void *)addr, sizeof(unsigned char), + count, 1); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_iowrite(1, port, (void *)addr, sizeof(unsigned char), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; } } -void _outsw(unsigned int port, const void * addr, unsigned long count) +void _outsw(unsigned int port, const void *addr, unsigned long count) { const unsigned short *buf = addr; unsigned short *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outw(*buf++, portp); -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) + while (count--) + _ne_outw(*buf++, portp); +#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_iowrite(0, port, (void *)addr, sizeof(unsigned short), + count, 1); } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_iowrite(1, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; } } -void _outsl(unsigned int port, const void * addr, unsigned long count) +void _outsl(unsigned int port, const void *addr, unsigned long count) { const unsigned long *buf = addr; unsigned char *portp; portp = PORT2ADDR(port); - while(count--) *(volatile unsigned long *)portp = *buf++; + while (count--) + *(volatile unsigned long *)portp = *buf++; } diff --git a/arch/m32r/kernel/io_mappi2.c b/arch/m32r/kernel/io_mappi2.c index 7705fb0bb..4182cd4f9 100644 --- a/arch/m32r/kernel/io_mappi2.c +++ b/arch/m32r/kernel/io_mappi2.c @@ -4,15 +4,14 @@ * Typical I/O routines for Mappi2 board. * * Copyright (c) 2001-2003 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Mamoru Sakugawa + * Hitoshi Yamamoto, Mamoru Sakugawa */ -/* $Id:$ */ - #include #include #include #include +#include #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) #include @@ -32,29 +31,50 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); #define PORT2ADDR_NE(port) _port2addr_ne(port) #define PORT2ADDR_USB(port) _port2addr_usb(port) -static __inline__ void *_port2addr(unsigned long port) +static inline void *_port2addr(unsigned long port) { return (void *)(port + NONCACHE_OFFSET); } #define LAN_IOSTART 0x300 #define LAN_IOEND 0x320 + +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) +static inline void *__port2addr_ata(unsigned long port) +{ + static int dummy_reg; + + switch (port) { + case 0x1f0: return (void *)0xac002000; + case 0x1f1: return (void *)0xac012800; + case 0x1f2: return (void *)0xac012002; + case 0x1f3: return (void *)0xac012802; + case 0x1f4: return (void *)0xac012004; + case 0x1f5: return (void *)0xac012804; + case 0x1f6: return (void *)0xac012006; + case 0x1f7: return (void *)0xac012806; + case 0x3f6: return (void *)0xac01200e; + default: return (void *)&dummy_reg; + } +} +#endif + #ifdef CONFIG_CHIP_OPSP -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)(port + NONCACHE_OFFSET + 0x10000000); } #else -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)(port + NONCACHE_OFFSET + 0x04000000); } #endif -static __inline__ void *_port2addr_usb(unsigned long port) +static inline void *_port2addr_usb(unsigned long port) { return (void *)(port + NONCACHE_OFFSET + 0x14000000); } -static __inline__ void delay(void) +static inline void delay(void) { __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); } @@ -63,51 +83,48 @@ static __inline__ void delay(void) * NIC I/O function */ -static __inline__ unsigned char _ne_inb(void *portp) +static inline unsigned char _ne_inb(void *portp) { return (unsigned char) *(volatile unsigned char *)portp; } -static __inline__ unsigned short _ne_inw(void *portp) +static inline unsigned short _ne_inw(void *portp) { -#if 1 /* byte swap */ - unsigned short tmp,tmp2; - tmp = *(volatile unsigned short *)portp; - tmp2 = (tmp>>8|tmp<<8); - return tmp2; -#else - return *(volatile unsigned short *)portp; -#endif + return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); } -static __inline__ void _ne_insb(void *portp, void * addr, unsigned long count) +static inline void _ne_insb(void *portp, void * addr, unsigned long count) { - unsigned short tmp; unsigned char *buf = addr; - tmp = *(volatile unsigned char *)portp; - while (count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } -static __inline__ void _ne_outb(unsigned char b, void *portp) +static inline void _ne_outb(unsigned char b, void *portp) { *(volatile unsigned char *)portp = (unsigned char)b; } -static __inline__ void _ne_outw(unsigned short w, void *portp) +static inline void _ne_outw(unsigned short w, void *portp) { - *(volatile unsigned short *)portp = (w>>8|w<<8); + *(volatile unsigned short *)portp = cpu_to_le16(w); } unsigned char _inb(unsigned long port) { if (port >= LAN_IOSTART && port < LAN_IOEND) return _ne_inb(PORT2ADDR_NE(port)); +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + return *(volatile unsigned char *)__port2addr_ata(port); + } +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif @@ -118,16 +135,21 @@ unsigned short _inw(unsigned long port) { if (port >= LAN_IOSTART && port < LAN_IOEND) return _ne_inw(PORT2ADDR_NE(port)); +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + return *(volatile unsigned short *)__port2addr_ata(port); + } +#endif #if defined(CONFIG_USB) - else if (port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); + else if (port >= 0x340 && port < 0x3a0) + return *(volatile unsigned short *)PORT2ADDR_USB(port); #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif return *(volatile unsigned short *)PORT2ADDR(port); @@ -137,9 +159,9 @@ unsigned long _inl(unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); - return l; + unsigned long l; + pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); + return l; } else #endif return *(volatile unsigned long *)PORT2ADDR(port); @@ -149,14 +171,19 @@ unsigned char _inb_p(unsigned long port) { unsigned char v; - if (port >= 0x300 && port < 0x320) + if (port >= LAN_IOSTART && port < LAN_IOEND) v = _ne_inb(PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + return *(volatile unsigned char *)__port2addr_ata(port); + } else +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif v = *(volatile unsigned char *)PORT2ADDR(port); @@ -169,19 +196,24 @@ unsigned short _inw_p(unsigned long port) { unsigned short v; - if (port >= 0x300 && port < 0x320) + if (port >= LAN_IOSTART && port < LAN_IOEND) v = _ne_inw(PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + return *(volatile unsigned short *)__port2addr_ata(port); + } else +#endif #if defined(CONFIG_USB) - if (port >= 0x340 && port < 0x3a0) + if (port >= 0x340 && port < 0x3a0) v = *(volatile unsigned short *)PORT2ADDR_USB(port); - else + else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif v = *(volatile unsigned short *)PORT2ADDR(port); @@ -204,9 +236,14 @@ void _outb(unsigned char b, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outb(b, PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + *(volatile unsigned char *)__port2addr_ata(port) = b; + } else +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -217,14 +254,19 @@ void _outw(unsigned short w, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outw(w, PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + *(volatile unsigned short *)__port2addr_ata(port) = w; + } else +#endif #if defined(CONFIG_USB) - if (port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; + if (port >= 0x340 && port < 0x3a0) + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -234,7 +276,7 @@ void _outl(unsigned long l, unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); + pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); } else #endif *(volatile unsigned long *)PORT2ADDR(port) = l; @@ -245,9 +287,14 @@ void _outb_p(unsigned char b, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outb(b, PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + *(volatile unsigned char *)__port2addr_ata(port) = b; + } else +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -260,6 +307,11 @@ void _outw_p(unsigned short w, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outw(w, PORT2ADDR_NE(port)); else +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + *(volatile unsigned short *)__port2addr_ata(port) = w; + } else +#endif #if defined(CONFIG_USB) if (port >= 0x340 && port < 0x3a0) *(volatile unsigned short *)PORT2ADDR_USB(port) = w; @@ -267,7 +319,7 @@ void _outw_p(unsigned short w, unsigned long port) #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -285,15 +337,25 @@ void _insb(unsigned int port, void * addr, unsigned long count) { if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_insb(PORT2ADDR_NE(port), addr, count); +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + unsigned char *buf = addr; + unsigned char *portp = __port2addr_ata(port); + while (count--) + *buf++ = *(volatile unsigned char *)portp; + } +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { + pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); } #endif else { unsigned char *buf = addr; unsigned char *portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } @@ -302,16 +364,25 @@ void _insw(unsigned int port, void * addr, unsigned long count) unsigned short *buf = addr; unsigned short *portp; - if (port >= LAN_IOSTART && port < LAN_IOEND) + if (port >= LAN_IOSTART && port < LAN_IOEND) { portp = PORT2ADDR_NE(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); +#endif +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + portp = __port2addr_ata(port); + while (count--) + *buf++ = *(volatile unsigned short *)portp; #endif } else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } @@ -321,7 +392,8 @@ void _insl(unsigned int port, void * addr, unsigned long count) unsigned long *portp; portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned long *)portp; + while (count--) + *buf++ = *(volatile unsigned long *)portp; } void _outsb(unsigned int port, const void * addr, unsigned long count) @@ -329,16 +401,25 @@ void _outsb(unsigned int port, const void * addr, unsigned long count) const unsigned char *buf = addr; unsigned char *portp; - if (port >= LAN_IOSTART && port < LAN_IOEND) + if (port >= LAN_IOSTART && port < LAN_IOEND) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outb(*buf++, portp); + while (count--) + _ne_outb(*buf++, portp); +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + portp = __port2addr_ata(port); + while (count--) + *(volatile unsigned char *)portp = *buf++; +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; } } @@ -347,16 +428,25 @@ void _outsw(unsigned int port, const void * addr, unsigned long count) const unsigned short *buf = addr; unsigned short *portp; - if (port >= LAN_IOSTART && port < LAN_IOEND) + if (port >= LAN_IOSTART && port < LAN_IOEND) { portp = PORT2ADDR_NE(port); - while (count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { + portp = __port2addr_ata(port); + while (count--) + *(volatile unsigned short *)portp = *buf++; +#endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; } } @@ -366,5 +456,6 @@ void _outsl(unsigned int port, const void * addr, unsigned long count) unsigned char *portp; portp = PORT2ADDR(port); - while(count--) *(volatile unsigned long *)portp = *buf++; + while (count--) + *(volatile unsigned long *)portp = *buf++; } diff --git a/arch/m32r/kernel/io_oaks32r.c b/arch/m32r/kernel/io_oaks32r.c index 7fcbf2047..286964794 100644 --- a/arch/m32r/kernel/io_oaks32r.c +++ b/arch/m32r/kernel/io_oaks32r.c @@ -4,11 +4,9 @@ * Typical I/O routines for OAKS32R board. * * Copyright (c) 2001-2004 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Mamoru Sakugawa + * Hitoshi Yamamoto, Mamoru Sakugawa */ -/* $Id$ */ - #include #include #include @@ -16,17 +14,17 @@ #define PORT2ADDR(port) _port2addr(port) -static __inline__ void *_port2addr(unsigned long port) +static inline void *_port2addr(unsigned long port) { return (void *)(port + NONCACHE_OFFSET); } -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)((port<<1) + NONCACHE_OFFSET + 0x02000000); } -static __inline__ void delay(void) +static inline void delay(void) { __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); } @@ -37,12 +35,12 @@ static __inline__ void delay(void) #define PORT2ADDR_NE(port) _port2addr_ne(port) -static __inline__ unsigned char _ne_inb(void *portp) +static inline unsigned char _ne_inb(void *portp) { return *(volatile unsigned char *)(portp+1); } -static __inline__ unsigned short _ne_inw(void *portp) +static inline unsigned short _ne_inw(void *portp) { unsigned short tmp; @@ -51,21 +49,22 @@ static __inline__ unsigned short _ne_inw(void *portp) return tmp; } -static __inline__ void _ne_insb(void *portp, void * addr, unsigned long count) +static inline void _ne_insb(void *portp, void *addr, unsigned long count) { unsigned char *buf = addr; - while (count--) *buf++ = *(volatile unsigned char *)(portp+1); + while (count--) + *buf++ = *(volatile unsigned char *)(portp+1); } -static __inline__ void _ne_outb(unsigned char b, void *portp) +static inline void _ne_outb(unsigned char b, void *portp) { *(volatile unsigned char *)(portp+1) = b; } -static __inline__ void _ne_outw(unsigned short w, void *portp) +static inline void _ne_outw(unsigned short w, void *portp) { - *(volatile unsigned short *)portp = (w >> 8); - *(volatile unsigned short *)(portp+2) = (w & 0xff); + *(volatile unsigned short *)portp = (w >> 8); + *(volatile unsigned short *)(portp+2) = (w & 0xff); } unsigned char _inb(unsigned long port) @@ -171,73 +170,82 @@ void _outl_p(unsigned long l, unsigned long port) delay(); } -void _insb(unsigned int port, void * addr, unsigned long count) +void _insb(unsigned int port, void *addr, unsigned long count) { if (port >= 0x300 && port < 0x320) _ne_insb(PORT2ADDR_NE(port), addr, count); else { unsigned char *buf = addr; unsigned char *portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } -void _insw(unsigned int port, void * addr, unsigned long count) +void _insw(unsigned int port, void *addr, unsigned long count) { unsigned short *buf = addr; unsigned short *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) *buf++ = _ne_inw(portp); + while (count--) + *buf++ = _ne_inw(portp); } else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } -void _insl(unsigned int port, void * addr, unsigned long count) +void _insl(unsigned int port, void *addr, unsigned long count) { unsigned long *buf = addr; unsigned long *portp; portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned long *)portp; + while (count--) + *buf++ = *(volatile unsigned long *)portp; } -void _outsb(unsigned int port, const void * addr, unsigned long count) +void _outsb(unsigned int port, const void *addr, unsigned long count) { const unsigned char *buf = addr; unsigned char *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outb(*buf++, portp); + while (count--) + _ne_outb(*buf++, portp); } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; } } -void _outsw(unsigned int port, const void * addr, unsigned long count) +void _outsw(unsigned int port, const void *addr, unsigned long count) { const unsigned short *buf = addr; unsigned short *portp; if (port >= 0x300 && port < 0x320) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outw(*buf++, portp); + while (count--) + _ne_outw(*buf++, portp); } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; } } -void _outsl(unsigned int port, const void * addr, unsigned long count) +void _outsl(unsigned int port, const void *addr, unsigned long count) { const unsigned long *buf = addr; unsigned char *portp; portp = PORT2ADDR(port); - while(count--) *(volatile unsigned long *)portp = *buf++; + while (count--) + *(volatile unsigned long *)portp = *buf++; } diff --git a/arch/m32r/kernel/io_opsput.c b/arch/m32r/kernel/io_opsput.c index 642376e3b..aaf42f9f7 100644 --- a/arch/m32r/kernel/io_opsput.c +++ b/arch/m32r/kernel/io_opsput.c @@ -9,7 +9,6 @@ * This file is subject to 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 @@ -35,7 +34,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); #define PORT2ADDR(port) _port2addr(port) #define PORT2ADDR_USB(port) _port2addr_usb(port) -static __inline__ void *_port2addr(unsigned long port) +static inline void *_port2addr(unsigned long port) { return (void *)(port + NONCACHE_OFFSET); } @@ -47,16 +46,16 @@ static __inline__ void *_port2addr(unsigned long port) */ #define LAN_IOSTART 0x300 #define LAN_IOEND 0x320 -static __inline__ void *_port2addr_ne(unsigned long port) +static inline void *_port2addr_ne(unsigned long port) { return (void *)(port + NONCACHE_OFFSET + 0x10000000); } -static __inline__ void *_port2addr_usb(unsigned long port) +static inline void *_port2addr_usb(unsigned long port) { - return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); + return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); } -static __inline__ void delay(void) +static inline void delay(void) { __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); } @@ -67,29 +66,30 @@ static __inline__ void delay(void) #define PORT2ADDR_NE(port) _port2addr_ne(port) -static __inline__ unsigned char _ne_inb(void *portp) +static inline unsigned char _ne_inb(void *portp) { return *(volatile unsigned char *)portp; } -static __inline__ unsigned short _ne_inw(void *portp) +static inline unsigned short _ne_inw(void *portp) { return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); } -static __inline__ void _ne_insb(void *portp, void * addr, unsigned long count) +static inline void _ne_insb(void *portp, void *addr, unsigned long count) { unsigned char *buf = (unsigned char *)addr; - while (count--) *buf++ = _ne_inb(portp); + while (count--) + *buf++ = _ne_inb(portp); } -static __inline__ void _ne_outb(unsigned char b, void *portp) +static inline void _ne_outb(unsigned char b, void *portp) { *(volatile unsigned char *)portp = b; } -static __inline__ void _ne_outw(unsigned short w, void *portp) +static inline void _ne_outw(unsigned short w, void *portp) { *(volatile unsigned short *)portp = cpu_to_le16(w); } @@ -101,9 +101,9 @@ unsigned char _inb(unsigned long port) #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif @@ -116,14 +116,14 @@ unsigned short _inw(unsigned long port) return _ne_inw(PORT2ADDR_NE(port)); #if defined(CONFIG_USB) else if(port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); + return *(volatile unsigned short *)PORT2ADDR_USB(port); #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif return *(volatile unsigned short *)PORT2ADDR(port); @@ -133,9 +133,9 @@ unsigned long _inl(unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); - return l; + unsigned long l; + pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); + return l; } else #endif return *(volatile unsigned long *)PORT2ADDR(port); @@ -150,9 +150,9 @@ unsigned char _inb_p(unsigned long port) else #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; + unsigned char b; + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); + return b; } else #endif v = *(volatile unsigned char *)PORT2ADDR(port); @@ -169,16 +169,16 @@ unsigned short _inw_p(unsigned long port) v = _ne_inw(PORT2ADDR_NE(port)); else #if defined(CONFIG_USB) - if(port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); + if(port >= 0x340 && port < 0x3a0) + return *(volatile unsigned short *)PORT2ADDR_USB(port); else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; + unsigned short w; + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); + return w; } else #endif v = *(volatile unsigned short *)PORT2ADDR(port); @@ -203,7 +203,7 @@ void _outb(unsigned char b, unsigned long port) else #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -216,13 +216,13 @@ void _outw(unsigned short w, unsigned long port) else #if defined(CONFIG_USB) if(port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -232,7 +232,7 @@ void _outl(unsigned long l, unsigned long port) { #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); + pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); } else #endif *(volatile unsigned long *)PORT2ADDR(port) = l; @@ -245,7 +245,7 @@ void _outb_p(unsigned char b, unsigned long port) else #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); } else #endif *(volatile unsigned char *)PORT2ADDR(port) = b; @@ -259,14 +259,14 @@ void _outw_p(unsigned short w, unsigned long port) _ne_outw(w, PORT2ADDR_NE(port)); else #if defined(CONFIG_USB) - if(port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; + if(port >= 0x340 && port < 0x3a0) + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; else #endif #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); } else #endif *(volatile unsigned short *)PORT2ADDR(port) = w; @@ -280,23 +280,25 @@ void _outl_p(unsigned long l, unsigned long port) delay(); } -void _insb(unsigned int port, void * addr, unsigned long count) +void _insb(unsigned int port, void *addr, unsigned long count) { if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_insb(PORT2ADDR_NE(port), addr, count); #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { + pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); } #endif else { unsigned char *buf = addr; unsigned char *portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } -void _insw(unsigned int port, void * addr, unsigned long count) +void _insw(unsigned int port, void *addr, unsigned long count) { unsigned short *buf = addr; unsigned short *portp; @@ -307,45 +309,52 @@ void _insw(unsigned int port, void * addr, unsigned long count) * from the DATA_REG. Do not swap the data. */ portp = PORT2ADDR_NE(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } -void _insl(unsigned int port, void * addr, unsigned long count) +void _insl(unsigned int port, void *addr, unsigned long count) { unsigned long *buf = addr; unsigned long *portp; portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned long *)portp; + while (count--) + *buf++ = *(volatile unsigned long *)portp; } -void _outsb(unsigned int port, const void * addr, unsigned long count) +void _outsb(unsigned int port, const void *addr, unsigned long count) { const unsigned char *buf = addr; unsigned char *portp; if (port >= LAN_IOSTART && port < LAN_IOEND) { portp = PORT2ADDR_NE(port); - while (count--) _ne_outb(*buf++, portp); + while (count--) + _ne_outb(*buf++, portp); #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), count, 1); + pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned char *)portp = *buf++; + while (count--) + *(volatile unsigned char *)portp = *buf++; } } -void _outsw(unsigned int port, const void * addr, unsigned long count) +void _outsw(unsigned int port, const void *addr, unsigned long count) { const unsigned short *buf = addr; unsigned short *portp; @@ -356,22 +365,26 @@ void _outsw(unsigned int port, const void * addr, unsigned long count) * into the DATA_REG. Do not swap the data. */ portp = PORT2ADDR_NE(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); + pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), + count, 1); #endif } else { portp = PORT2ADDR(port); - while(count--) *(volatile unsigned short *)portp = *buf++; + while (count--) + *(volatile unsigned short *)portp = *buf++; } } -void _outsl(unsigned int port, const void * addr, unsigned long count) +void _outsl(unsigned int port, const void *addr, unsigned long count) { const unsigned long *buf = addr; unsigned char *portp; portp = PORT2ADDR(port); - while(count--) *(volatile unsigned long *)portp = *buf++; + while (count--) + *(volatile unsigned long *)portp = *buf++; } diff --git a/arch/m32r/kernel/io_usrv.c b/arch/m32r/kernel/io_usrv.c index cc77ced9f..27928a0b9 100644 --- a/arch/m32r/kernel/io_usrv.c +++ b/arch/m32r/kernel/io_usrv.c @@ -178,7 +178,8 @@ void _insb(unsigned int port, void * addr, unsigned long count) else { unsigned char *buf = addr; unsigned char *portp = PORT2ADDR(port); - while(count--) *buf++ = *(volatile unsigned char *)portp; + while (count--) + *buf++ = *(volatile unsigned char *)portp; } } @@ -192,7 +193,8 @@ void _insw(unsigned int port, void * addr, unsigned long count) 1); else { portp = PORT2ADDR(port); - while (count--) *buf++ = *(volatile unsigned short *)portp; + while (count--) + *buf++ = *(volatile unsigned short *)portp; } } diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c index ba1357733..1ce63926a 100644 --- a/arch/m32r/kernel/irq.c +++ b/arch/m32r/kernel/irq.c @@ -1,9 +1,8 @@ /* * linux/arch/m32r/kernel/irq.c * - * Copyright (c) 2003, 2004 Hitoshi Yamamoto - * - * Taken from i386 2.6.4 version. + * Copyright (c) 2003, 2004 Hitoshi Yamamoto + * Copyright (c) 2004 Hirokazu Takata */ /* @@ -11,112 +10,17 @@ * * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar * - * This file contains the code used by various IRQ handling routines: - * asking for different IRQ's should be done through these routines - * instead of just grabbing them. Thus setups with different IRQ numbers - * shouldn't result in any weird surprises, and installing new handlers - * should be easier. - */ - -/* - * (mostly architecture independent, will move to kernel/irq.c in 2.5.) - * - * IRQs are in fact implemented a bit like signal handlers for the kernel. - * Naturally it's not a 1:1 relation, but there are similarities. + * This file contains the lowest level m32r-specific interrupt + * entry and irq statistics code. All the remaining irq logic is + * done by the generic kernel/irq/ code and in the + * m32r-specific irq controller code. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include -#include - -#include -#include -#include -#include -#include +#include #include -#include -#include - -/* - * Linux has a controller-independent x86 interrupt architecture. - * every controller has a 'controller-template', that is used - * by the main code to do the right thing. Each driver-visible - * interrupt source is transparently wired to the apropriate - * controller. Thus drivers need not be aware of the - * interrupt-controller. - * - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. - * (IO-APICs assumed to be messaging to Pentium local-APICs) - * - * the code is designed to be easily extended with new/different - * interrupt controllers, without having to do assembly magic. - */ - -/* - * Controller mappings for all interrupt sources: - */ -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -static void register_irq_proc (unsigned int irq); - -/* - * Special irq handlers. - */ - -irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) -{ return IRQ_NONE; } - -/* - * Generic no controller code - */ - -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) -{ -/* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. - */ - printk("unexpected IRQ trap at vector %02x\n", irq); -} - -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none - -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; atomic_t irq_err_count; atomic_t irq_mis_count; @@ -168,215 +72,6 @@ skip: return 0; } -#ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - while (irq_desc[irq].status & IRQ_INPROGRESS) - cpu_relax(); -} -#endif - -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -int handle_IRQ_event(unsigned int irq, - struct pt_regs *regs, struct irqaction *action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - action = action->next; - retval |= ret; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - return retval; -} - -static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - struct irqaction *action; - - if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { - printk(KERN_ERR "irq event %d: bogus return value %x\n", - irq, action_ret); - } else { - printk(KERN_ERR "irq %d: nobody cared!\n", irq); - } - dump_stack(); - printk(KERN_ERR "handlers:\n"); - action = desc->action; - do { - printk(KERN_ERR "[<%p>]", action->handler); - print_symbol(" (%s)", - (unsigned long)action->handler); - printk("\n"); - action = action->next; - } while (action); -} - -static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - static int count = 100; - - if (count) { - count--; - __report_bad_irq(irq, desc, action_ret); - } -} - -static int noirqdebug; - -static int __init noirqdebug_setup(char *str) -{ - noirqdebug = 1; - printk("IRQ lockup detection disabled\n"); - return 1; -} - -__setup("noirqdebug", noirqdebug_setup); - -/* - * If 99,900 of the previous 100,000 interrupts have not been handled then - * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to - * turn the IRQ off. - * - * (The other 100-of-100,000 interrupts may have been a correctly-functioning - * device sharing an IRQ with the failing one) - * - * Called under desc->lock - */ -static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; - if (action_ret != IRQ_NONE) - report_bad_irq(irq, desc, action_ret); - } - - desc->irq_count++; - if (desc->irq_count < 100000) - return; - - desc->irq_count = 0; - if (desc->irqs_unhandled > 99900) { - /* - * The interrupt is stuck - */ - __report_bad_irq(irq, desc, action_ret); - /* - * Now kill the IRQ - */ - printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - desc->irqs_unhandled = 0; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables and Enables are - * nested. - * Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Enables and Disables are - * nested. - * This function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} - -/** - * enable_irq - enable handling of an irq - * @irq: Interrupt to enable - * - * Undoes the effect of one call to disable_irq(). If this - * matches the last disable, processing of interrupts on this - * IRQ line is re-enabled. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced from %p\n", irq, - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific @@ -384,637 +79,13 @@ void enable_irq(unsigned int irq) */ asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) { - /* - * We ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; - unsigned int status; - irq_enter(); #ifdef CONFIG_DEBUG_STACKOVERFLOW /* FIXME M32R */ #endif - kstat_this_cpu.irqs[irq]++; - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (unlikely(!action)) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - irqreturn_t action_ret; - - spin_unlock(&desc->lock); - action_ret = handle_IRQ_event(irq, regs, action); - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; - -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->handler->end(irq); - spin_unlock(&desc->lock); - + __do_IRQ(irq, regs); irq_exit(); -#if defined(CONFIG_SMP) - if (irq == M32R_IRQ_MFT2) - smp_send_timer(); -#endif /* CONFIG_SMP */ - return 1; } - -int can_request_irq(unsigned int irq, unsigned long irqflags) -{ - struct irqaction *action; - - if (irq >= NR_IRQS) - return 0; - action = irq_desc[irq].action; - if (action) { - if (irqflags & action->flags & SA_SHIRQ) - action = NULL; - } - return !action; -} - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); - } -#endif - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_ATOMIC); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; -} - -EXPORT_SYMBOL(request_irq); - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function must not be called from interrupt context. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - -/* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - irq_desc_t *desc; - unsigned long val; - unsigned long delay; - - down(&probe_sem); - /* - * something may have generated an irq long ago and we want to - * flush such a longstanding irq before considering it as spurious. - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!irq_desc[i].action) - irq_desc[i].handler->startup(i); - spin_unlock_irq(&desc->lock); - } - - /* Wait for longstanding interrupts to trigger. */ - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) - /* about 20ms delay */ barrier(); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!desc->action) { - desc->status |= IRQ_AUTODETECT | IRQ_WAITING; - if (desc->handler->startup(i)) - desc->status |= IRQ_PENDING; - } - spin_unlock_irq(&desc->lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } else - if (i < 32) - val |= 1 << i; - } - spin_unlock_irq(&desc->lock); - } - - return val; -} - -EXPORT_SYMBOL(probe_irq_on); - -/* - * Return a mask of triggered interrupts (this - * can handle only legacy ISA interrupts). - */ - -/** - * probe_irq_mask - scan a bitmap of interrupt lines - * @val: mask of interrupts to consider - * - * Scan the ISA bus interrupt lines and return a bitmap of - * active interrupts. The interrupt probe logic state is then - * returned to its previous value. - * - * Note: we need to scan all the irq's even though we will - * only return ISA irq numbers - just so that we reset them - * all to a known state. - */ -unsigned int probe_irq_mask(unsigned long val) -{ - int i; - unsigned int mask; - - mask = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (i < 16 && !(status & IRQ_WAITING)) - mask |= 1 << i; - - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - return mask & val; -} - -/* - * Return the one interrupt that triggered (this can - * handle any interrupt source). - */ - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * their is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldnt happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. - */ - -int probe_irq_off(unsigned long val) -{ - int i, irq_found, nr_irqs; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -/* this was setup_x86_irq but it seems pretty generic */ -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_desc + irq; - - if (desc->handler == &no_irq_type) - return -ENOSYS; - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; - -#ifdef CONFIG_SMP - -static struct proc_dir_entry *smp_affinity_entry[NR_IRQS]; - -cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; - -static int irq_affinity_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc(struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - int irq = (long)data, full_count = count, err; - cpumask_t new_value, tmp; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - if (err) - return err; - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, - cpumask_of_cpu(first_cpu(new_value))); - - return full_count; -} - -#endif - -static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, *(cpumask_t *)data); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - cpumask_t *mask = (cpumask_t *)data; - unsigned long full_count = count, err; - cpumask_t new_value; - - err = cpumask_parse(buffer, count, new_value); - if (err) - return err; - - *mask = new_value; - return full_count; -} - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || - irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - -#ifdef CONFIG_SMP - { - struct proc_dir_entry *entry; - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; - } -#endif -} - -unsigned long prof_cpu_mask = -1; - -void init_irq_proc (void) -{ - struct proc_dir_entry *entry; - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - - /* create /proc/irq/prof_cpu_mask */ - entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir); - - if (!entry) - return; - - entry->nlink = 1; - entry->data = (void *)&prof_cpu_mask; - entry->read_proc = prof_cpu_mask_read_proc; - entry->write_proc = prof_cpu_mask_write_proc; - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) - register_irq_proc(i); -} - diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index 9e7de27a8..b556c3cf6 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c @@ -1,6 +1,5 @@ /* * linux/arch/m32r/kernel/process.c - * orig : sh * * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Hitoshi Yamamoto @@ -247,8 +246,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu, unsigned long sp = (unsigned long)tsk->thread_info + THREAD_SIZE; extern void ret_from_fork(void); - tsk->set_child_tid = tsk->clear_child_tid = NULL; - /* Copy registers */ sp -= sizeof (struct pt_regs); childregs = (struct pt_regs *)sp; @@ -292,13 +289,16 @@ asmlinkage int sys_fork(unsigned long r0, unsigned long r1, unsigned long r2, } asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, - unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r5, - unsigned long r6, struct pt_regs regs) + unsigned long parent_tidptr, + unsigned long child_tidptr, + unsigned long r4, unsigned long r5, unsigned long r6, + struct pt_regs regs) { if (!newsp) newsp = regs.spu; - return do_fork(clone_flags, newsp, ®s, 0, NULL, NULL); + return do_fork(clone_flags, newsp, ®s, 0, + (int __user *)parent_tidptr, (int __user *)child_tidptr); } /* @@ -322,9 +322,10 @@ asmlinkage int sys_vfork(unsigned long r0, unsigned long r1, unsigned long r2, /* * sys_execve() executes a new program. */ -asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, char __user * __user *uenvp, - unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, - struct pt_regs regs) +asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, + char __user * __user *uenvp, + unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, struct pt_regs regs) { int error; char *filename; @@ -335,8 +336,11 @@ asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, c goto out; error = do_execve(filename, uargv, uenvp, ®s); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: return error; @@ -353,4 +357,3 @@ unsigned long get_wchan(struct task_struct *p) /* M32R_FIXME */ return (0); } - diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index ab4137a33..8b40f362d 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c @@ -2,7 +2,7 @@ * linux/arch/m32r/kernel/ptrace.c * * Copyright (C) 2002 Hirokazu Takata, Takeo Takahashi - * Copyright (C) 2004 Hirokazu Takata + * Copyright (C) 2004 Hirokazu Takata, Kei Sakamoto * * Original x86 implementation: * By Ross Biro 1/23/92 @@ -130,7 +130,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, #ifndef NO_FPU else if (off >= (long)(&dummy->fpu >> 2) && off < (long)(&dummy->u_fpvalid >> 2)) { - if (!tsk->used_math) { + if (!tsk_used_math(tsk)) { if (off == (long)(&dummy->fpu.fpscr >> 2)) tmp = FPSCR_INIT; else @@ -139,7 +139,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, tmp = ((long *)(&tsk->thread.fpu >> 2)) [off - (long)&dummy->fpu]; } else if (off == (long)(&dummy->u_fpvalid >> 2)) - tmp = tsk->used_math; + tmp = !!tsk_used_math(tsk); #endif /* not NO_FPU */ else tmp = 0; @@ -187,12 +187,12 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off, #ifndef NO_FPU else if (off >= (long)(&dummy->fpu >> 2) && off < (long)(&dummy->u_fpvalid >> 2)) { - tsk->used_math = 1; + set_stopped_child_used_math(tsk); ((long *)&tsk->thread.fpu) [off - (long)&dummy->fpu] = data; ret = 0; } else if (off == (long)(&dummy->u_fpvalid >> 2)) { - tsk->used_math = data ? 1 : 0; + conditional_stopped_child_used_math(data, tsk); ret = 0; } #endif /* not NO_FPU */ @@ -450,13 +450,13 @@ register_debug_trap(struct task_struct *child, unsigned long next_pc, struct debug_trap *p = &child->thread.debug_trap; unsigned long addr = next_pc & ~3; - if (p->nr_trap != 0) { + if (p->nr_trap == MAX_TRAPS) { printk("kernel BUG at %s %d: p->nr_trap = %d\n", __FILE__, __LINE__, p->nr_trap); return -1; } - p->addr = addr; - p->insn = next_insn; + p->addr[p->nr_trap] = addr; + p->insn[p->nr_trap] = next_insn; p->nr_trap++; if (next_pc & 3) { *code = (next_insn & 0xffff0000) | 0x10f1; @@ -473,35 +473,34 @@ register_debug_trap(struct task_struct *child, unsigned long next_pc, return 0; } -int withdraw_debug_trap_for_signal(struct task_struct *child) -{ - struct debug_trap *p = &child->thread.debug_trap; - int nr_trap = p->nr_trap; - - if (nr_trap) { - access_process_vm(child, p->addr, &p->insn, sizeof(p->insn), 1); - p->nr_trap = 0; - p->addr = 0; - p->insn = 0; - } - return nr_trap; -} - static int unregister_debug_trap(struct task_struct *child, unsigned long addr, unsigned long *code) { struct debug_trap *p = &child->thread.debug_trap; + int i; - if (p->nr_trap != 1 || p->addr != addr) { + /* Search debug trap entry. */ + for (i = 0; i < p->nr_trap; i++) { + if (p->addr[i] == addr) + break; + } + if (i >= p->nr_trap) { /* The trap may be requested from debugger. * ptrace should do nothing in this case. */ return 0; } - *code = p->insn; - p->insn = 0; - p->addr = 0; + + /* Recover orignal instruction code. */ + *code = p->insn[i]; + + /* Shift debug trap entries. */ + while (i < p->nr_trap - 1) { + p->insn[i] = p->insn[i + 1]; + p->addr[i] = p->addr[i + 1]; + i++; + } p->nr_trap--; return 1; } @@ -510,13 +509,11 @@ static void unregister_all_debug_traps(struct task_struct *child) { struct debug_trap *p = &child->thread.debug_trap; + int i; - if (p->nr_trap) { - access_process_vm(child, p->addr, &p->insn, sizeof(p->insn), 1); - p->addr = 0; - p->insn = 0; - p->nr_trap = 0; - } + for (i = 0; i < p->nr_trap; i++) + access_process_vm(child, p->addr[i], &p->insn[i], sizeof(p->insn[i]), 1); + p->nr_trap = 0; } static inline void @@ -575,34 +572,6 @@ embed_debug_trap(struct task_struct *child, unsigned long next_pc) return 0; /* success */ } -void -embed_debug_trap_for_signal(struct task_struct *child) -{ - unsigned long next_pc; - unsigned long pc, insn; - int ret; - - pc = get_stack_long(child, PT_BPC); - ret = access_process_vm(child, pc&~3, &insn, sizeof(insn), 0); - if (ret != sizeof(insn)) { - printk("kernel BUG at %s %d: access_process_vm returns %d\n", - __FILE__, __LINE__, ret); - return; - } - compute_next_pc(insn, pc, &next_pc, child); - if (next_pc & 0x80000000) { - printk("kernel BUG at %s %d: next_pc = 0x%08x\n", - __FILE__, __LINE__, (int)next_pc); - return; - } - if (embed_debug_trap(child, next_pc)) { - printk("kernel BUG at %s %d: embed_debug_trap error\n", - __FILE__, __LINE__); - return; - } - invalidate_cache(); -} - void withdraw_debug_trap(struct pt_regs *regs) { @@ -621,9 +590,12 @@ static void init_debug_traps(struct task_struct *child) { struct debug_trap *p = &child->thread.debug_trap; + int i; p->nr_trap = 0; - p->addr = 0; - p->insn = 0; + for (i = 0; i < MAX_TRAPS; i++) { + p->addr[i] = 0; + p->insn[i] = 0; + } } @@ -713,7 +685,7 @@ do_ptrace(long request, struct task_struct *child, long addr, long data) ret = 0; unregister_all_debug_traps(child); invalidate_cache(); - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); @@ -855,4 +827,3 @@ void do_syscall_trace(void) current->exit_code = 0; } } - diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c index db9589c24..fb03be1a0 100644 --- a/arch/m32r/kernel/setup.c +++ b/arch/m32r/kernel/setup.c @@ -251,7 +251,9 @@ void __init setup_arch(char **cmdline_p) #endif #ifdef CONFIG_DISCONTIGMEM - numnodes = 2; + nodes_clear(node_online_map); + node_set_online(0); + node_set_online(1); #endif /* CONFIG_DISCONTIGMEM */ init_mm.start_code = (unsigned long) _text; @@ -389,7 +391,7 @@ void __init cpu_init (void) /* Force FPU initialization */ current_thread_info()->status = 0; - current->used_math = 0; + clear_used_math(); #ifdef CONFIG_MMU /* Set up MMU */ diff --git a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c index 5d0780b8b..488aa87ba 100644 --- a/arch/m32r/kernel/setup_m32700ut.c +++ b/arch/m32r/kernel/setup_m32700ut.c @@ -435,7 +435,7 @@ void __init init_IRQ(void) icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; enable_m32700ut_irq(M32R_IRQ_INT2); -//#if defined(CONFIG_M32R_AR_VGA) +//#if defined(CONFIG_VIDEO_M32R_AR) /* * INT3# is used for AR */ @@ -445,7 +445,7 @@ void __init init_IRQ(void) irq_desc[M32R_IRQ_INT3].depth = 1; icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; disable_m32700ut_irq(M32R_IRQ_INT3); -//#endif /* CONFIG_M32R_ARV */ +//#endif /* CONFIG_VIDEO_M32R_AR */ } #define LAN_IOSTART 0x300 diff --git a/arch/m32r/kernel/setup_mappi.c b/arch/m32r/kernel/setup_mappi.c index 523cee330..1e74110f0 100644 --- a/arch/m32r/kernel/setup_mappi.c +++ b/arch/m32r/kernel/setup_mappi.c @@ -140,7 +140,7 @@ void __init init_IRQ(void) disable_mappi_irq(M32R_IRQ_SIO1_S); #endif /* CONFIG_SERIAL_M32R_SIO */ -#if defined(CONFIG_M32RPCC) +#if defined(CONFIG_M32R_PCC) /* INT1 : pccard0 interrupt */ irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; irq_desc[M32R_IRQ_INT1].handler = &mappi_irq_type; diff --git a/arch/m32r/kernel/setup_mappi2.c b/arch/m32r/kernel/setup_mappi2.c index 92eb06e85..1904d465a 100644 --- a/arch/m32r/kernel/setup_mappi2.c +++ b/arch/m32r/kernel/setup_mappi2.c @@ -151,7 +151,6 @@ void __init init_IRQ(void) disable_mappi2_irq(M32R_IRQ_INT1); #endif /* CONFIG_USB */ -#if defined(CONFIG_M32R_CFC) /* ICUCR40: CFC IREQ */ irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; irq_desc[PLD_IRQ_CFIREQ].handler = &mappi2_irq_type; @@ -161,6 +160,7 @@ void __init init_IRQ(void) icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; disable_mappi2_irq(PLD_IRQ_CFIREQ); +#if defined(CONFIG_M32R_CFC) /* ICUCR41: CFC Insert */ irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; irq_desc[PLD_IRQ_CFC_INSERT].handler = &mappi2_irq_type; diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c index 17a4d3e52..84315e344 100644 --- a/arch/m32r/kernel/setup_opsput.c +++ b/arch/m32r/kernel/setup_opsput.c @@ -439,7 +439,7 @@ void __init init_IRQ(void) icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; enable_opsput_irq(M32R_IRQ_INT2); -//#if defined(CONFIG_M32R_AR_VGA) +//#if defined(CONFIG_VIDEO_M32R_AR) /* * INT3# is used for AR */ @@ -449,7 +449,7 @@ void __init init_IRQ(void) irq_desc[M32R_IRQ_INT3].depth = 1; icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; disable_opsput_irq(M32R_IRQ_INT3); -//#endif /* CONFIG_M32R_ARV */ +//#endif /* CONFIG_VIDEO_M32R_AR */ } #define LAN_IOSTART 0x300 diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index cbfa6748e..d1f782517 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c @@ -33,32 +33,6 @@ int do_signal(struct pt_regs *, sigset_t *); -/* - * Atomically swap in the new signal mask, and wait for a signal. - */ -asmlinkage int -sys_sigsuspend(old_sigset_t mask, unsigned long r1, - unsigned long r2, unsigned long r3, unsigned long r4, - unsigned long r5, unsigned long r6, struct pt_regs regs) -{ - sigset_t saveset; - - mask &= _BLOCKABLE; - spin_lock_irq(¤t->sighand->siglock); - saveset = current->blocked; - siginitset(¤t->blocked, mask); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - regs.r0 = -EINTR; - while (1) { - current->state = TASK_INTERRUPTIBLE; - schedule(); - if (do_signal(®s, &saveset)) - return regs.r0; - } -} - asmlinkage int sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, unsigned long r2, unsigned long r3, unsigned long r4, @@ -89,38 +63,6 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, } } -asmlinkage int -sys_sigaction(int sig, const struct old_sigaction __user *act, - struct old_sigaction __user *oact) -{ - struct k_sigaction new_ka, old_ka; - int ret; - - if (act) { - old_sigset_t mask; - if (verify_area(VERIFY_READ, act, sizeof(*act)) || - __get_user(new_ka.sa.sa_handler, &act->sa_handler) || - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) - return -EFAULT; - __get_user(new_ka.sa.sa_flags, &act->sa_flags); - __get_user(mask, &act->sa_mask); - siginitset(&new_ka.sa.sa_mask, mask); - } - - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); - - if (!ret && oact) { - if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) - return -EFAULT; - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); - } - - return ret; -} - asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, unsigned long r2, unsigned long r3, unsigned long r4, @@ -134,26 +76,14 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, * Do a signal return; undo the signal stack. */ -struct sigframe -{ -// char *pretcode; - int sig; - struct sigcontext sc; -// struct _fpstate fpstate; - unsigned long extramask[_NSIG_WORDS-1]; - char retcode[4]; -}; - struct rt_sigframe { -// char *pretcode; int sig; struct siginfo *pinfo; void *puc; struct siginfo info; struct ucontext uc; // struct _fpstate fpstate; - char retcode[8]; }; static int @@ -207,38 +137,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, return err; } -asmlinkage int -sys_sigreturn(unsigned long r0, unsigned long r1, - unsigned long r2, unsigned long r3, unsigned long r4, - unsigned long r5, unsigned long r6, struct pt_regs regs) -{ - struct sigframe __user *frame = (struct sigframe __user *)regs.spu; - sigset_t set; - int result; - - if (verify_area(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__get_user(set.sig[0], &frame->sc.oldmask) - || (_NSIG_WORDS > 1 - && __copy_from_user(&set.sig[1], &frame->extramask, - sizeof(frame->extramask)))) - goto badframe; - - sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sighand->siglock); - current->blocked = set; - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - if (restore_sigcontext(®s, &frame->sc, &result)) - goto badframe; - return result; - -badframe: - force_sig(SIGSEGV, current); - return 0; -} - asmlinkage int sys_rt_sigreturn(unsigned long r0, unsigned long r1, unsigned long r2, unsigned long r3, unsigned long r4, @@ -342,71 +240,6 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) return (void __user *)((sp - frame_size) & -8ul); } -static void setup_frame(int sig, struct k_sigaction *ka, - sigset_t *set, struct pt_regs *regs) -{ - struct sigframe __user *frame; - int err = 0; - int signal; - - frame = get_sigframe(ka, regs->spu, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - goto give_sigsegv; - - signal = current_thread_info()->exec_domain - && current_thread_info()->exec_domain->signal_invmap - && sig < 32 - ? current_thread_info()->exec_domain->signal_invmap[sig] - : sig; - - err |= __put_user(signal, &frame->sig); - if (err) - goto give_sigsegv; - - err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); - if (err) - goto give_sigsegv; - - if (_NSIG_WORDS > 1) { - err |= __copy_to_user(frame->extramask, &set->sig[1], - sizeof(frame->extramask)); - if (err) - goto give_sigsegv; - } - - if (ka->sa.sa_flags & SA_RESTORER) - regs->lr = (unsigned long)ka->sa.sa_restorer; - else { - /* This is : ldi r7, #__NR_sigreturn ; trap #2 */ - unsigned long code = 0x670010f2 | (__NR_sigreturn << 16); - - regs->lr = (unsigned long)frame->retcode; - err |= __put_user(code, (long __user *)(frame->retcode+0)); - if (err) - goto give_sigsegv; - flush_cache_sigtramp((unsigned long)frame->retcode); - } - - /* Set up registers for signal handler */ - regs->spu = (unsigned long)frame; - regs->r0 = signal; /* Arg for signal handler */ - regs->r1 = (unsigned long)&frame->sc; - regs->bpc = (unsigned long)ka->sa.sa_handler; - - set_fs(USER_DS); - -#if DEBUG_SIG - printk("SIG deliver (%s:%d): sp=%p pc=%p\n", - current->comm, current->pid, frame, regs->pc); -#endif - - return; - -give_sigsegv: - force_sigsegv(sig, current); -} - static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { @@ -448,20 +281,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, goto give_sigsegv; /* Set up to return from userspace. */ - if (ka->sa.sa_flags & SA_RESTORER) - regs->lr = (unsigned long)ka->sa.sa_restorer; - else { - /* This is : ldi r7, #__NR_rt_sigreturn ; trap #2 */ - unsigned long code1 = 0x97f00000 | (__NR_rt_sigreturn); - unsigned long code2 = 0x10f2f000; - - regs->lr = (unsigned long)frame->retcode; - err |= __put_user(code1, (long __user *)(frame->retcode+0)); - err |= __put_user(code2, (long __user *)(frame->retcode+4)); - if (err) - goto give_sigsegv; - flush_cache_sigtramp((unsigned long)frame->retcode); - } + regs->lr = (unsigned long)ka->sa.sa_restorer; /* Set up registers for signal handler */ regs->spu = (unsigned long)frame; @@ -519,10 +339,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, } /* Set up the stack frame */ - if (ka->sa.sa_flags & SA_SIGINFO) - setup_rt_frame(sig, ka, info, oldset, regs); - else - setup_frame(sig, ka, oldset, regs); + setup_rt_frame(sig, ka, info, oldset, regs); if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c index 2dc542eb1..48b187f2d 100644 --- a/arch/m32r/kernel/smp.c +++ b/arch/m32r/kernel/smp.c @@ -38,7 +38,7 @@ * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -53,7 +53,7 @@ static struct call_data_struct *call_data; /* * For flush_cache_all() */ -static spinlock_t flushcache_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(flushcache_lock); static volatile unsigned long flushcache_cpumask = 0; /* @@ -63,7 +63,7 @@ static volatile cpumask_t flush_cpumask; static struct mm_struct *flush_mm; static struct vm_area_struct *flush_vma; static volatile unsigned long flush_va; -static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tlbstate_lock); #define FLUSH_ALL 0xffffffff DECLARE_PER_CPU(int, prof_multiplier); @@ -953,7 +953,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num, "ldi r4, #1 \n\t" "st r4, @%2 \n\t" : "=&r"(ipicr_val) - : "r"(flags), "r"(&ipilock->lock), "r"(ipicr_addr), + : "r"(flags), "r"(&ipilock->slock), "r"(ipicr_addr), "r"(mask), "r"(try), "r"(my_physid_mask) : "memory", "r4" #ifdef CONFIG_CHIP_M32700_TS1 diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index 6ac4f705e..5180c7a12 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c @@ -58,7 +58,6 @@ #define Dprintk(x...) #endif -extern int cpu_idle(void); extern cpumask_t cpu_initialized; /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ @@ -248,7 +247,7 @@ static void __init init_ipi_lock(void) int ipi; for (ipi = 0 ; ipi < NR_IPIS ; ipi++) - ipi_lock[ipi] = SPIN_LOCK_UNLOCKED; + spin_lock_init(&ipi_lock[ipi]); } /*==========================================================================* @@ -433,7 +432,7 @@ int __init start_secondary(void *unused) cpu_init(); smp_callin(); while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) - rep_nop(); + cpu_relax(); smp_online(); @@ -443,7 +442,8 @@ int __init start_secondary(void *unused) */ local_flush_tlb_all(); - return cpu_idle(); + cpu_idle(); + return 0; } /*==========================================================================* @@ -482,7 +482,7 @@ static void __init smp_callin(void) /* Has the boot CPU finished it's STARTUP sequence ? */ if (cpu_isset(cpu_id, cpu_callout_map)) break; - rep_nop(); + cpu_relax(); } if (!time_before(jiffies, timeout)) { diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c index f34fa19ac..356e895fa 100644 --- a/arch/m32r/kernel/sys_m32r.c +++ b/arch/m32r/kernel/sys_m32r.c @@ -48,7 +48,7 @@ asmlinkage int sys_tas(int *addr) #else /* CONFIG_SMP */ #include -static spinlock_t tas_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tas_lock); asmlinkage int sys_tas(int *addr) { @@ -57,10 +57,10 @@ asmlinkage int sys_tas(int *addr) if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) return -EFAULT; - spin_lock(&tas_lock); + _raw_spin_lock(&tas_lock); oldval = *addr; *addr = 1; - spin_unlock(&tas_lock); + _raw_spin_unlock(&tas_lock); return oldval; } diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index 25a31668f..3c4707280 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c @@ -193,7 +193,7 @@ EXPORT_SYMBOL(do_settimeofday); * BUG: This routine does not handle hour overflow properly; it just * sets the minutes. Usually you won't notice until after reboot! */ -static __inline__ int set_rtc_mmss(unsigned long nowtime) +static inline int set_rtc_mmss(unsigned long nowtime) { return 0; } @@ -205,11 +205,17 @@ static long last_rtc_update = 0; * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static __inline__ void do_timer_interrupt(int irq, void *dev_id, - struct pt_regs * regs) +static inline void +do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { +#ifndef CONFIG_SMP + profile_tick(CPU_PROFILING, regs); +#endif do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif /* * If we have an externally synchronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be @@ -241,10 +247,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer_interrupt(irq, NULL, regs); write_sequnlock(&xtime_lock); -#ifndef CONFIG_SMP - profile_tick(CPU_PROFILING, regs); -#endif - return IRQ_HANDLED; } @@ -273,8 +275,8 @@ void __init time_init(void) xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); - wall_to_monotonic.tv_sec = -xtime.tv_sec; - wall_to_monotonic.tv_nsec = -xtime.tv_nsec; + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); #if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ @@ -314,4 +316,3 @@ unsigned long long sched_clock(void) { return (unsigned long long)jiffies * (1000000000 / HZ); } - diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c index 87fdc4ddc..8f9fd2f67 100644 --- a/arch/m32r/kernel/traps.c +++ b/arch/m32r/kernel/traps.c @@ -223,7 +223,7 @@ bad: printk("\n"); } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); void die(const char * str, struct pt_regs * regs, long err) { diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c index 22600fc08..c871b4606 100644 --- a/arch/m32r/lib/csum_partial_copy.c +++ b/arch/m32r/lib/csum_partial_copy.c @@ -3,16 +3,16 @@ * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * - * MIPS specific IP/TCP/UDP checksumming routines + * M32R specific IP/TCP/UDP checksumming routines + * (Some code taken from MIPS architecture) * - * Authors: Ralf Baechle, - * Lots of code moved from tcp.c and ip.c; see those files - * for more names. + * This file is subject to 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 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. + * Copyright (C) 1994, 1995 Waldorf Electronics GmbH + * Copyright (C) 1998, 1999 Ralf Baechle + * Copyright (C) 2001-2005 Hiroyuki Kondo, Hirokazu Takata * */ @@ -27,8 +27,9 @@ /* * Copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy_nocheck (const char *src, char *dst, - int len, unsigned int sum) +unsigned int +csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, + int len, unsigned int sum) { sum = csum_partial(src, len, sum); memcpy(dst, src, len); @@ -41,9 +42,10 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck); * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user (const char __user *src, char *dst, - int len, unsigned int sum, - int *err_ptr) +unsigned int +csum_partial_copy_from_user (const unsigned char __user *src, + unsigned char *dst, + int len, unsigned int sum, int *err_ptr) { int missing; diff --git a/arch/m32r/lib/delay.c b/arch/m32r/lib/delay.c index 7afe66e9d..fb29632c7 100644 --- a/arch/m32r/lib/delay.c +++ b/arch/m32r/lib/delay.c @@ -51,7 +51,7 @@ void __delay(unsigned long loops) "addi %0, #-1 \n\t" "bgtz %0, 1b \n\t" " .fillinsn \n\t" - "2:i \n\t" + "2: \n\t" : "+r" (loops) : "r" (0) ); diff --git a/arch/m32r/lib/memset.S b/arch/m32r/lib/memset.S index 7fe94b6c6..6e26df120 100644 --- a/arch/m32r/lib/memset.S +++ b/arch/m32r/lib/memset.S @@ -70,16 +70,18 @@ qword_set_loop: st r1, @+r4 bnc qword_set_loop || cmpz r2 jc r14 -word_set_wrap: +set_remainder: cmpui r2, #4 - bc byte_set + bc byte_set_wrap1 addi r2, #-4 bra word_set_loop byte_set_wrap: addi r2, #4 - addi r4, #4 || cmpz r2 + cmpz r2 jc r14 +byte_set_wrap1: + addi r4, #4 #if defined(CONFIG_ISA_M32R2) byte_set: addi r2, #-1 || stb r1, @r4+ @@ -153,18 +155,19 @@ qword_set_loop: st r1, @+r4 st r1, @+r4 bnc qword_set_loop - bnez r2, word_set_wrap + bnez r2, set_remainder jmp r14 -word_set_wrap: +set_remainder: cmpui r2, #4 - bc byte_set + bc byte_set_wrap1 addi r2, #-4 bra word_set_loop byte_set_wrap: addi r2, #4 - addi r4, #4 beqz r2, end_memset +byte_set_wrap1: + addi r4, #4 byte_set: addi r2, #-1 stb r1, @r4 diff --git a/arch/m32r/m32700ut/defconfig.m32700ut.smp b/arch/m32r/m32700ut/defconfig.m32700ut.smp index df7f9d01b..1c002181d 100644 --- a/arch/m32r/m32700ut/defconfig.m32700ut.smp +++ b/arch/m32r/m32700ut/defconfig.m32700ut.smp @@ -1,19 +1,25 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:10:50 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -23,17 +29,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y # CONFIG_IKCONFIG_PROC is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -43,6 +52,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -73,6 +83,7 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set CONFIG_SMP=y @@ -80,22 +91,6 @@ CONFIG_CHIP_M32700_TS1=y CONFIG_NR_CPUS=2 # CONFIG_NUMA is not set -# -# M32R drivers -# -# CONFIG_M32RPCC is not set -CONFIG_M32R_CFC=y -CONFIG_M32700UT_CFC=y -CONFIG_CFC_NUM=1 -# CONFIG_MTD_M32R is not set -CONFIG_M32R_SMC91111=y -CONFIG_M32700UT_DS1302=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -103,11 +98,19 @@ CONFIG_M32700UT_DS1302=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +# CONFIG_M32R_PCC is not set +CONFIG_M32R_CFC=y +CONFIG_M32R_CFC_NUM=1 # # PCI Hotplug Support @@ -148,12 +151,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -173,7 +189,6 @@ CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -212,13 +227,12 @@ 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 # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -274,6 +288,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -293,7 +310,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -310,7 +326,50 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_SMC91X=y +# CONFIG_NE2000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -345,6 +404,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -373,13 +434,12 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_M32R_SIO is not set +CONFIG_SERIAL_M32R_SIO=y +CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_SERIAL_M32R_PLDSIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -392,13 +452,13 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set +CONFIG_DS1302=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -434,8 +494,8 @@ CONFIG_VIDEO_DEV=y # Video Adapters # # CONFIG_VIDEO_CPIA is not set -CONFIG_M32R_AR=y -CONFIG_M32R_AR_VGA=y +CONFIG_VIDEO_M32R_AR=y +CONFIG_VIDEO_M32R_AR_M64278=y # # Radio Adapters @@ -451,14 +511,14 @@ CONFIG_M32R_AR_VGA=y # Graphics support # CONFIG_FB=y -CONFIG_FB_EPSON_S1D13806=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set @@ -472,7 +532,7 @@ CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_LOGO_M32R_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -482,12 +542,28 @@ CONFIG_LOGO_M32R_CLUT224=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -505,10 +581,15 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -542,6 +623,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -573,9 +655,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -641,12 +723,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -654,6 +738,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/m32700ut/defconfig.m32700ut.up b/arch/m32r/m32700ut/defconfig.m32700ut.up index 5a9da73fb..805357f7b 100644 --- a/arch/m32r/m32700ut/defconfig.m32700ut.up +++ b/arch/m32r/m32700ut/defconfig.m32700ut.up @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:10:54 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -11,10 +15,12 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +30,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y # CONFIG_IKCONFIG_PROC is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -73,26 +83,11 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set -# -# M32R drivers -# -# CONFIG_M32RPCC is not set -CONFIG_M32R_CFC=y -CONFIG_M32700UT_CFC=y -CONFIG_CFC_NUM=1 -# CONFIG_MTD_M32R is not set -CONFIG_M32R_SMC91111=y -CONFIG_M32700UT_DS1302=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -100,11 +95,19 @@ CONFIG_M32700UT_DS1302=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +# CONFIG_M32R_PCC is not set +CONFIG_M32R_CFC=y +CONFIG_M32R_CFC_NUM=1 # # PCI Hotplug Support @@ -145,12 +148,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -170,7 +186,6 @@ CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -209,13 +224,12 @@ 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 # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -271,6 +285,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -290,7 +307,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -307,7 +323,50 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_SMC91X=y +# CONFIG_NE2000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -342,6 +401,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -370,13 +431,12 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_M32R_SIO is not set +CONFIG_SERIAL_M32R_SIO=y +CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_SERIAL_M32R_PLDSIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -389,13 +449,13 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set +CONFIG_DS1302=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -431,8 +491,8 @@ CONFIG_VIDEO_DEV=y # Video Adapters # # CONFIG_VIDEO_CPIA is not set -CONFIG_M32R_AR=y -CONFIG_M32R_AR_VGA=y +CONFIG_VIDEO_M32R_AR=y +CONFIG_VIDEO_M32R_AR_M64278=y # # Radio Adapters @@ -448,14 +508,14 @@ CONFIG_M32R_AR_VGA=y # Graphics support # CONFIG_FB=y -CONFIG_FB_EPSON_S1D13806=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set @@ -469,7 +529,7 @@ CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_LOGO_M32R_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -479,12 +539,28 @@ CONFIG_LOGO_M32R_CLUT224=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -502,10 +578,15 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -539,6 +620,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -570,9 +652,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -638,12 +720,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -651,6 +735,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/m32700ut/dot.gdbinit_200MHz_16MB b/arch/m32r/m32700ut/dot.gdbinit_200MHz_16MB index fa79cd9fb..525dab469 100644 --- a/arch/m32r/m32700ut/dot.gdbinit_200MHz_16MB +++ b/arch/m32r/m32700ut/dot.gdbinit_200MHz_16MB @@ -1,5 +1,5 @@ # .gdbinit file -# $Id: dot.gdbinit_200MHz_16MB,v 1.1 2004/08/17 02:58:11 takata Exp $ +# $Id: dot.gdbinit_200MHz_16MB,v 1.2 2004/10/20 03:02:27 fujiwara Exp $ #----- # NOTE: this file is generated by a script, "gen_gdbinit.pl". # (Please type "gen_gdbinit.pl --help" and check the help message). @@ -178,11 +178,11 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x08002000 + set $param = (void*)0x08001000 # INITRD_START - set *(unsigned long *)($param + 0x0010) = 0x082a0000 +# set *(unsigned long *)($param + 0x0010) = 0x08300000 # INITRD_SIZE - set *(unsigned long *)($param + 0x0014) = 0x00000000 +# set *(unsigned long *)($param + 0x0014) = 0x00000000 # M32R_CPUCLK set *(unsigned long *)($param + 0x0018) = 0d200000000 # M32R_BUSCLK @@ -191,15 +191,15 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x console=tty1 video=s1d13xxxfb:mode:240x320-16 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=16M \0" + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=16M \0" end # Boot define boot set_kernel_parameters set $fp = 0 - set $pc = 0x08001000 - set *(unsigned char *)0xffffffff = 0x03 + set $pc = 0x08002000 +# set *(unsigned char *)0xffffffff = 0x03 si c end diff --git a/arch/m32r/m32700ut/dot.gdbinit_300MHz_32MB b/arch/m32r/m32700ut/dot.gdbinit_300MHz_32MB index 4df06e1d9..aa503657a 100644 --- a/arch/m32r/m32700ut/dot.gdbinit_300MHz_32MB +++ b/arch/m32r/m32700ut/dot.gdbinit_300MHz_32MB @@ -1,5 +1,5 @@ # .gdbinit file -# $Id: dot.gdbinit_300MHz_32MB,v 1.1 2004/08/17 02:58:11 takata Exp $ +# $Id: dot.gdbinit_300MHz_32MB,v 1.2 2004/10/20 03:02:27 fujiwara Exp $ #----- # NOTE: this file is generated by a script, "gen_gdbinit.pl". # (Please type "gen_gdbinit.pl --help" and check the help message). @@ -42,8 +42,8 @@ define sdram_init set *(unsigned long *)0x00ef602c = 0x00000020 # Ch0-TR set *(unsigned long *)0x00ef6028 = 0x00051502 - # Ch0-ADR (size:16MB) - set *(unsigned long *)0x00ef6020 = 0x08000002 + # Ch0-ADR (size:32MB) + set *(unsigned long *)0x00ef6020 = 0x08000003 # AutoRef On set *(unsigned long *)0x00ef6004 = 0x00010e24 # Access enable @@ -51,7 +51,7 @@ define sdram_init end document sdram_init SDRAM controller initialization - 0x08000000 - 0x08ffffff (16MB) + 0x08000000 - 0x09ffffff (32MB) end # Initialize BSEL3 for UT-CFC @@ -161,8 +161,8 @@ define setup shell sleep 0.1 clock_init shell sleep 0.1 - # SDRAM: 16MB - set *(unsigned long *)0x00ef6020 = 0x08000002 + # SDRAM: 32MB + set *(unsigned long *)0x00ef6020 = 0x08000003 cfc_init # USB set *(unsigned short *)0xb0301000 = 0x100 @@ -178,11 +178,11 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x08002000 + set $param = (void*)0x08001000 # INITRD_START - set *(unsigned long *)($param + 0x0010) = 0x082a0000 +# set *(unsigned long *)($param + 0x0010) = 0x08300000 # INITRD_SIZE - set *(unsigned long *)($param + 0x0014) = 0x00000000 +# set *(unsigned long *)($param + 0x0014) = 0x00000000 # M32R_CPUCLK set *(unsigned long *)($param + 0x0018) = 0d300000000 # M32R_BUSCLK @@ -191,15 +191,15 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x console=tty1 video=s1d13xxxfb:mode:240x320-16 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=16M \0" + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=32M \0" end # Boot define boot set_kernel_parameters set $fp = 0 - set $pc = 0x08001000 - set *(unsigned char *)0xffffffff = 0x03 + set $pc = 0x08002000 +# set *(unsigned char *)0xffffffff = 0x03 si c end diff --git a/arch/m32r/mappi/defconfig.nommu b/arch/m32r/mappi/defconfig.nommu index cae54bf18..714aa6e70 100644 --- a/arch/m32r/mappi/defconfig.nommu +++ b/arch/m32r/mappi/defconfig.nommu @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:10:57 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -11,10 +15,12 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" # CONFIG_POSIX_MQUEUE is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set @@ -22,17 +28,19 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y # CONFIG_IKCONFIG_PROC is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support @@ -42,6 +50,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -71,21 +80,11 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set -# -# M32R drivers -# -# CONFIG_M32RPCC is not set -CONFIG_M32R_NE2000=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -93,9 +92,17 @@ CONFIG_M32R_NE2000=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -# CONFIG_PCMCIA is not set +CONFIG_PCCARD=y +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# +# CONFIG_TCIC is not set +CONFIG_M32R_PCC=y # # PCI Hotplug Support @@ -138,12 +145,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -199,6 +219,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -218,7 +241,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -235,7 +257,48 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set +CONFIG_NE2000=y + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -270,6 +333,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -302,7 +367,6 @@ CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -321,8 +385,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set # CONFIG_RAW_DRIVER is not set # @@ -362,12 +430,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -377,10 +461,15 @@ CONFIG_EXT2_FS=y # CONFIG_JBD is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -401,7 +490,6 @@ CONFIG_EXT2_FS=y # Pseudo filesystems # CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_DEVFS_FS=y CONFIG_DEVFS_MOUNT=y @@ -440,9 +528,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -508,12 +596,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -521,6 +611,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/mappi/defconfig.smp b/arch/m32r/mappi/defconfig.smp index b0fe57100..956a8e2f9 100644 --- a/arch/m32r/mappi/defconfig.smp +++ b/arch/m32r/mappi/defconfig.smp @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:11:02 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -12,10 +16,12 @@ CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +30,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -76,6 +86,7 @@ CONFIG_IRAM_START=0x00f00000 CONFIG_IRAM_SIZE=0x00080000 CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set CONFIG_SMP=y @@ -83,17 +94,6 @@ CONFIG_CHIP_M32700_TS1=y CONFIG_NR_CPUS=2 # CONFIG_NUMA is not set -# -# M32R drivers -# -CONFIG_M32RPCC=y -CONFIG_M32R_NE2000=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -101,11 +101,17 @@ CONFIG_M32R_NE2000=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +CONFIG_M32R_PCC=y # # PCI Hotplug Support @@ -136,6 +142,7 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y +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 @@ -181,6 +188,7 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -207,12 +215,25 @@ CONFIG_MTD_CFI_I2=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -231,7 +252,6 @@ CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -291,6 +311,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -310,7 +333,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -327,7 +349,48 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set +CONFIG_NE2000=y + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -365,6 +428,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -397,7 +462,6 @@ CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -416,7 +480,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -462,12 +525,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -477,10 +556,15 @@ CONFIG_EXT2_FS=y # CONFIG_JBD is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -513,6 +597,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -533,6 +618,7 @@ CONFIG_JFFS_PROC_FS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_FS_NOR_ECC is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -555,9 +641,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -623,12 +709,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -636,6 +724,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/mappi/defconfig.up b/arch/m32r/mappi/defconfig.up index b4ab5ff29..c9253e94e 100644 --- a/arch/m32r/mappi/defconfig.up +++ b/arch/m32r/mappi/defconfig.up @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:11:07 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -12,10 +16,12 @@ CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +30,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -75,21 +85,11 @@ CONFIG_IRAM_START=0x00f00000 CONFIG_IRAM_SIZE=0x00080000 CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set -# -# M32R drivers -# -CONFIG_M32RPCC=y -CONFIG_M32R_NE2000=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -97,11 +97,17 @@ CONFIG_M32R_NE2000=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +CONFIG_M32R_PCC=y # # PCI Hotplug Support @@ -132,6 +138,7 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y +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 @@ -177,6 +184,7 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -203,12 +211,25 @@ CONFIG_MTD_CFI_I2=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -227,7 +248,6 @@ CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -287,6 +307,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -306,7 +329,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -323,7 +345,48 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set +CONFIG_NE2000=y + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -361,6 +424,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -393,7 +458,6 @@ CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -412,7 +476,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -458,12 +521,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -473,10 +552,15 @@ CONFIG_EXT2_FS=y # CONFIG_JBD is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -509,6 +593,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -529,6 +614,7 @@ CONFIG_JFFS_PROC_FS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_FS_NOR_ECC is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -551,9 +637,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -619,12 +705,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -632,6 +720,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/mappi/dot.gdbinit b/arch/m32r/mappi/dot.gdbinit index ea566b691..7a1d29386 100644 --- a/arch/m32r/mappi/dot.gdbinit +++ b/arch/m32r/mappi/dot.gdbinit @@ -1,9 +1,9 @@ # .gdbinit file -# $Id$ +# $Id: dot.gdbinit.mappi,v 1.4 2004/10/20 02:24:37 takata Exp $ #----- # NOTE: this file is generated by a script, "gen_gdbinit.pl". # (Please type "gen_gdbinit.pl --help" and check the help message). -# $ Id: gen_gdbinit.pl,v 1.8 2004/02/27 07:08:32 takata Exp $ +# $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $ #----- # target platform: mappi @@ -192,11 +192,11 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x08002000 + set $param = (void*)0x08001000 # INITRD_START - set *(unsigned long *)($param + 0x0010) = 0x082a0000 +# set *(unsigned long *)($param + 0x0010) = 0x08300000 # INITRD_SIZE - set *(unsigned long *)($param + 0x0014) = 0x00000000 +# set *(unsigned long *)($param + 0x0014) = 0x00000000 # M32R_CPUCLK set *(unsigned long *)($param + 0x0018) = 0d360000000 # M32R_BUSCLK @@ -205,14 +205,14 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.x nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" end # Boot define boot set_kernel_parameters set $fp = 0 - set $pc=0x08001000 + set $pc = 0x08002000 si c end @@ -236,7 +236,7 @@ sdireset file vmlinux target m32rsdi setup -#load_module +#load_modules #set_breakpoints #boot diff --git a/arch/m32r/mappi/dot.gdbinit.nommu b/arch/m32r/mappi/dot.gdbinit.nommu index 1ca03f872..297536cf6 100644 --- a/arch/m32r/mappi/dot.gdbinit.nommu +++ b/arch/m32r/mappi/dot.gdbinit.nommu @@ -192,7 +192,7 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x00002000 + set $param = (void*)0x00001000 # INITRD_START #set *(unsigned long *)($param + 0x0010) = 0x082a0000 # INITRD_SIZE @@ -205,14 +205,14 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.bbox-httpd nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.bbox-httpd nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" end # Boot define boot set_kernel_parameters set $fp = 0 - set $pc=0x00001000 + set $pc=0x00002000 set *(long *)0xfffffff4=0x8080 # b load_flat_binary # set *(unsigned char *)0x08001003=0x63 diff --git a/arch/m32r/mappi/dot.gdbinit.smp b/arch/m32r/mappi/dot.gdbinit.smp index db0274fef..171489a44 100644 --- a/arch/m32r/mappi/dot.gdbinit.smp +++ b/arch/m32r/mappi/dot.gdbinit.smp @@ -269,11 +269,11 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x08002000 + set $param = (void*)0x08001000 # INITRD_START # set *(unsigned long *)($param + 0x0010) = 0x082a0000 # INITRD_SIZE - set *(unsigned long *)($param + 0x0014) = 0x00000000 +# set *(unsigned long *)($param + 0x0014) = 0x00000000 # M32R_CPUCLK set *(unsigned long *)($param + 0x0018) = 0d160000000 # set *(unsigned long *)($param + 0x0018) = 0d80000000 @@ -284,14 +284,14 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=tty1 console=ttyD0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.x nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" + set {char[0x200]}($param + 0x100) = "console=tty1 console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.x nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" # set {char[0x200]}($param + 0x100) = "console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.x nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" end # Boot define boot set_kernel_parameters - set $pc=0x08001000 + set $pc=0x08002000 set *(unsigned char *)0x08001003=0x03 si c @@ -309,7 +309,7 @@ define boot_mp set *(unsigned long *)0x00eff2f8 = 0x2 x 0x00eff2f8 - set $pc=0x08001000 + set $pc=0x08002000 si c end @@ -320,7 +320,7 @@ end ## Boot UP define boot_up set_kernel_parameters - set $pc=0x08001000 + set $pc=0x08002000 si c end diff --git a/arch/m32r/mappi2/defconfig.vdec2 b/arch/m32r/mappi2/defconfig.vdec2 index 7f6125faf..c14791d27 100644 --- a/arch/m32r/mappi2/defconfig.vdec2 +++ b/arch/m32r/mappi2/defconfig.vdec2 @@ -1,11 +1,13 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc1-bk21 -# Fri Nov 12 16:08:58 2004 +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:11:10 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -79,6 +81,7 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set @@ -94,7 +97,6 @@ CONFIG_PREEMPT=y # CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set -# CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=y # @@ -142,10 +144,12 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set CONFIG_INITRAMFS_SOURCE="" @@ -158,6 +162,7 @@ CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -215,12 +220,12 @@ 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 # # SCSI low-level drivers # # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_QLOGIC_1280_1040 is not set # CONFIG_SCSI_DEBUG is not set # @@ -392,6 +397,7 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set # CONFIG_SERIO_RAW is not set # @@ -445,7 +451,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -515,11 +520,25 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -537,6 +556,10 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -607,7 +630,6 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set @@ -676,7 +698,8 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # @@ -690,6 +713,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c index 3e49ff64b..bf3104a15 100644 --- a/arch/m32r/mm/discontig.c +++ b/arch/m32r/mm/discontig.c @@ -75,7 +75,7 @@ unsigned long __init setup_memory(void) mem_prof_init(); - for (nid = 0 ; nid < numnodes ; nid++) { + for_each_online_node(nid) { mp = &mem_prof[nid]; NODE_DATA(nid)=(pg_data_t *)&m32r_node_data[nid]; NODE_DATA(nid)->bdata = &node_bdata[nid]; @@ -135,12 +135,12 @@ unsigned long __init zone_sizes_init(void) mem_prof_t *mp; pgdat_list = NULL; - for (nid = numnodes - 1 ; nid >= 0 ; nid--) { + for (nid = num_online_nodes() - 1 ; nid >= 0 ; nid--) { NODE_DATA(nid)->pgdat_next = pgdat_list; pgdat_list = NODE_DATA(nid); } - for (nid = 0 ; nid < numnodes ; nid++) { + for_each_online_node(nid) { mp = &mem_prof[nid]; for (i = 0 ; i < MAX_NR_ZONES ; i++) { zones_size[i] = 0; diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c index 393ff03ae..bf7fb58ef 100644 --- a/arch/m32r/mm/fault.c +++ b/arch/m32r/mm/fault.c @@ -2,13 +2,12 @@ * linux/arch/m32r/mm/fault.c * * Copyright (c) 2001, 2002 Hitoshi Yamamoto, and H. Kondo + * Copyright (c) 2004 Naoto Sugai, NIIBE Yutaka * * Some code taken from i386 version. * Copyright (C) 1995 Linus Torvalds */ -/* $Id$ */ - #include #include #include @@ -96,6 +95,11 @@ void bust_spinlocks(int yes) * bit 2 == 0 means kernel, 1 means user-mode * bit 3 == 0 means data, 1 means instruction *======================================================================*/ +#define ACE_PROTECTION 1 +#define ACE_WRITE 2 +#define ACE_USERMODE 4 +#define ACE_INSTRUCTION 8 + asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address) { @@ -126,10 +130,10 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, * nothing more. * * This verifies that the fault happens in kernel space - * (error_code & 4) == 0, and that the fault was not a - * protection error (error_code & 1) == 0. + * (error_code & ACE_USERMODE) == 0, and that the fault was not a + * protection error (error_code & ACE_PROTECTION) == 0. */ - if (address >= TASK_SIZE && !(error_code & 4)) + if (address >= TASK_SIZE && !(error_code & ACE_USERMODE)) goto vmalloc_fault; mm = tsk->mm; @@ -157,7 +161,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, * thus avoiding the deadlock. */ if (!down_read_trylock(&mm->mmap_sem)) { - if ((error_code & 4) == 0 && + if ((error_code & ACE_USERMODE) == 0 && !search_exception_tables(regs->psw)) goto bad_area_nosemaphore; down_read(&mm->mmap_sem); @@ -171,7 +175,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, if (!(vma->vm_flags & VM_GROWSDOWN)) goto bad_area; #if 0 - if (error_code & 4) { + if (error_code & ACE_USERMODE) { /* * accessing the stack below "spu" is always a bug. * The "+ 4" is there due to the push instruction @@ -191,27 +195,34 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, good_area: info.si_code = SEGV_ACCERR; write = 0; - switch (error_code & 3) { + switch (error_code & (ACE_WRITE|ACE_PROTECTION)) { default: /* 3: write, present */ /* fall through */ - case 2: /* write, not present */ + case ACE_WRITE: /* write, not present */ if (!(vma->vm_flags & VM_WRITE)) goto bad_area; write++; break; - case 1: /* read, present */ + case ACE_PROTECTION: /* read, present */ case 0: /* read, not present */ if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } + /* + * For instruction access exception, check if the area is executable + */ + if ((error_code & ACE_INSTRUCTION) && !(vma->vm_flags & VM_EXEC)) + goto bad_area; + survive: /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo * the fault. */ - addr = (address & PAGE_MASK) | (error_code & 8); + addr = (address & PAGE_MASK); + set_thread_fault_code(error_code); switch (handle_mm_fault(mm, vma, addr, write)) { case VM_FAULT_MINOR: tsk->min_flt++; @@ -226,7 +237,7 @@ survive: default: BUG(); } - + set_thread_fault_code(0); up_read(&mm->mmap_sem); return; @@ -239,7 +250,7 @@ bad_area: bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ - if (error_code & 4) { + if (error_code & ACE_USERMODE) { tsk->thread.address = address; tsk->thread.error_code = error_code | (address >= TASK_SIZE); tsk->thread.trap_no = 14; @@ -295,7 +306,7 @@ out_of_memory: goto survive; } printk("VM: killing process %s\n", tsk->comm); - if (error_code & 4) + if (error_code & ACE_USERMODE) do_exit(SIGKILL); goto no_context; @@ -303,7 +314,7 @@ do_sigbus: up_read(&mm->mmap_sem); /* Kernel mode? Handle exception or die */ - if (!(error_code & 4)) + if (!(error_code & ACE_USERMODE)) goto no_context; tsk->thread.address = address; @@ -352,7 +363,7 @@ vmalloc_fault: if (!pte_present(*pte_k)) goto no_context; - addr = (address & PAGE_MASK) | (error_code & 8); + addr = (address & PAGE_MASK) | (error_code & ACE_INSTRUCTION); update_mmu_cache(NULL, addr, *pte_k); return; } @@ -370,7 +381,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr, unsigned long *entry1, *entry2; unsigned long pte_data, flags; unsigned int *entry_dat; - int inst = vaddr & 8; + int inst = get_thread_fault_code() & ACE_INSTRUCTION; int i; /* Ptrace may call this routine. */ diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c index a290e3793..ec968e453 100644 --- a/arch/m32r/mm/init.c +++ b/arch/m32r/mm/init.c @@ -9,8 +9,6 @@ * Copyright (C) 1995 Linus Torvalds */ -/* $Id$ */ - #include #include #include @@ -18,9 +16,10 @@ #include #include #include +#include +#include #include #include -#include #include #include #include @@ -153,7 +152,7 @@ int __init reservedpages_count(void) int reservedpages, nid, i; reservedpages = 0; - for (nid = 0 ; nid < numnodes ; nid++) + for_each_online_node(nid) for (i = 0 ; i < MAX_LOW_PFN(nid) - START_PFN(nid) ; i++) if (PageReserved(NODE_DATA(nid)->node_mem_map + i)) reservedpages++; @@ -174,7 +173,7 @@ void __init mem_init(void) #endif num_physpages = 0; - for (nid = 0 ; nid < numnodes ; nid++) + for_each_online_node(nid) num_physpages += MAX_LOW_PFN(nid) - START_PFN(nid) + 1; num_physpages -= hole_pages; @@ -193,7 +192,7 @@ void __init mem_init(void) memset(empty_zero_page, 0, PAGE_SIZE); /* this will put all low memory onto the freelists */ - for (nid = 0 ; nid < numnodes ; nid++) + for_each_online_node(nid) totalram_pages += free_all_bootmem_node(NODE_DATA(nid)); reservedpages = reservedpages_count() - hole_pages; diff --git a/arch/m32r/oaks32r/defconfig.nommu b/arch/m32r/oaks32r/defconfig.nommu index 816b53ee7..f2da9be72 100644 --- a/arch/m32r/oaks32r/defconfig.nommu +++ b/arch/m32r/oaks32r/defconfig.nommu @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:11:13 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -11,10 +15,12 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" # CONFIG_POSIX_MQUEUE is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set @@ -22,16 +28,18 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support @@ -41,6 +49,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -66,20 +75,11 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PREEMPT=y # CONFIG_HAVE_DEC_LOCK is not set # CONFIG_SMP is not set -# -# M32R drivers -# -CONFIG_M32R_NE2000=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -87,9 +87,13 @@ CONFIG_M32R_NE2000=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set # # PCI Hotplug Support @@ -132,12 +136,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -193,6 +210,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -212,7 +232,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -229,7 +248,43 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set +CONFIG_NE2000=y + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -264,6 +319,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -296,7 +353,6 @@ CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -315,7 +371,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -356,12 +411,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -371,10 +442,15 @@ CONFIG_EXT2_FS=y # CONFIG_JBD is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -395,7 +471,6 @@ CONFIG_EXT2_FS=y # Pseudo filesystems # CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y @@ -432,9 +507,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -500,12 +575,14 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_FRAME_POINTER is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -513,6 +590,10 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/oaks32r/dot.gdbinit.nommu b/arch/m32r/oaks32r/dot.gdbinit.nommu index 48420f7e8..d481d972b 100644 --- a/arch/m32r/oaks32r/dot.gdbinit.nommu +++ b/arch/m32r/oaks32r/dot.gdbinit.nommu @@ -1,9 +1,9 @@ # .gdbinit file -# $Id: dot.gdbinit.oaks32r,v 1.2 2004/04/15 02:33:14 takata Exp $ +# $Id: dot.gdbinit.oaks32r,v 1.4 2004/10/20 02:24:37 takata Exp $ #----- # NOTE: this file is generated by a script, "gen_gdbinit.pl". # (Please type "gen_gdbinit.pl --help" and check the help message). -# $ Id: gen_gdbinit.pl,v 1.10 2004/04/15 02:10:45 takata Exp $ +# $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $ #----- # target platform: oaks32r @@ -103,11 +103,11 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x01002000 + set $param = (void*)0x01001000 # INITRD_START - set *(unsigned long *)($param + 0x0010) = 0x00000000 +# set *(unsigned long *)($param + 0x0010) = 0x00000000 # INITRD_SIZE - set *(unsigned long *)($param + 0x0014) = 0x00000000 +# set *(unsigned long *)($param + 0x0014) = 0x00000000 # M32R_CPUCLK set *(unsigned long *)($param + 0x0018) = 0d66666667 # M32R_BUSCLK @@ -116,15 +116,14 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 -# set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.busybox.flat nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0" end # Boot define boot set_kernel_parameters set $fp = 0 - set $pc = 0x01001000 + set $pc = 0x01002000 si c end diff --git a/arch/m32r/oprofile/init.c b/arch/m32r/oprofile/init.c index f5843c8cc..b7773e45c 100644 --- a/arch/m32r/oprofile/init.c +++ b/arch/m32r/oprofile/init.c @@ -12,14 +12,11 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops); - -int __init oprofile_arch_init(struct oprofile_operations ** ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { return -ENODEV; } - void oprofile_arch_exit(void) { } diff --git a/arch/m32r/opsput/defconfig.opsput b/arch/m32r/opsput/defconfig.opsput index 07eae9601..a87e1ea4c 100644 --- a/arch/m32r/opsput/defconfig.opsput +++ b/arch/m32r/opsput/defconfig.opsput @@ -1,9 +1,13 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc4 +# Wed Feb 16 21:11:41 2005 # CONFIG_M32R=y -CONFIG_UID16=y +# CONFIG_UID16 is not set CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Code maturity level options @@ -15,6 +19,7 @@ CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +29,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y # CONFIG_IKCONFIG_PROC is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +52,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -73,21 +82,10 @@ CONFIG_NOHIGHMEM=y # CONFIG_DISCONTIGMEM is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_PREEMPT is not set # CONFIG_SMP is not set -# -# M32R drivers -# -# CONFIG_M32R_CFC is not set -CONFIG_M32R_SMC91111=y -CONFIG_M32700UT_DS1302=y - -# -# Power management options (ACPI, APM) -# -# CONFIG_PM is not set - # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # @@ -95,11 +93,18 @@ CONFIG_M32700UT_DS1302=y # CONFIG_ISA is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=y +CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y + +# +# PC-card bridges +# # CONFIG_TCIC is not set +CONFIG_M32R_CFC=y +CONFIG_M32R_CFC_NUM=1 # # PCI Hotplug Support @@ -141,12 +146,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP 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_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -181,13 +199,12 @@ 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 # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -243,6 +260,9 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -262,7 +282,6 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -279,7 +298,50 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_SMC91X=y +# CONFIG_NE2000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# 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 # # ISDN subsystem @@ -314,6 +376,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -340,13 +404,12 @@ CONFIG_SERIO_SERPORT=y # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_M32R_SIO is not set +CONFIG_SERIAL_M32R_SIO=y +CONFIG_SERIAL_M32R_SIO_CONSOLE=y CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_SERIAL_M32R_PLDSIO_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -359,13 +422,13 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set +CONFIG_DS1302=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -411,12 +474,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -434,10 +513,15 @@ CONFIG_REISERFS_FS=m # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -471,6 +555,7 @@ CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -502,9 +587,9 @@ CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -570,19 +655,24 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_IOVIRT is not set # CONFIG_MAGIC_SYSRQ is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_FS is not set # CONFIG_FRAME_POINTER is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_PAGEALLOC is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -590,6 +680,10 @@ CONFIG_DEBUG_INFO=y # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/m32r/opsput/dot.gdbinit b/arch/m32r/opsput/dot.gdbinit index 9883f001d..b7e6c6640 100644 --- a/arch/m32r/opsput/dot.gdbinit +++ b/arch/m32r/opsput/dot.gdbinit @@ -7,6 +7,39 @@ set radix 0d16 set height 0 debug_chaos +# clk xin:cpu:bus=1:8:1 +define clock_init_on_181 + set *(unsigned long *)0x00ef400c = 0x2 + set *(unsigned long *)0x00ef4004 = 0x1 + shell sleep 0.1 + set *(unsigned long *)0x00ef4000 = 0x101 +end +# clk xin:cpu:bus=1:8:2 +define clock_init_on_182 + set *(unsigned long *)0x00ef400c = 0x1 + set *(unsigned long *)0x00ef4004 = 0x1 + shell sleep 0.1 + set *(unsigned long *)0x00ef4000 = 0x101 +end + +# clk xin:cpu:bus=1:8:4 +define clock_init_on_184 + set *(unsigned long *)0x00ef400c = 0x0 + set *(unsigned long *)0x00ef4004 = 0x1 + shell sleep 0.1 + set *(unsigned long *)0x00ef4000 = 0x101 +end + +# clk xin:cpu:bus=1:1:1 +define clock_init_off + shell sleep 0.1 + set *(unsigned long *)0x00ef4000 = 0x0 + shell sleep 0.1 + set *(unsigned long *)0x00ef4004 = 0x0 + shell sleep 0.1 + set *(unsigned long *)0x00ef400c = 0x0 +end + define tlb_init set $tlbbase = 0xfe000000 set *(unsigned long *)($tlbbase + 0x04) = 0x0 @@ -83,7 +116,7 @@ end # Set kernel parameters define set_kernel_parameters - set $param = (void*)0x88002000 + set $param = (void*)0x88001000 # INITRD_START # set *(unsigned long *)($param + 0x0010) = 0x08300000 # INITRD_SIZE @@ -97,7 +130,7 @@ define set_kernel_parameters # M32R_TIMER_DIVIDE set *(unsigned long *)($param + 0x0020) = 0d128 - set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x\ + set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 \ root=/dev/nfsroot \ nfsroot=192.168.0.1:/project/m32r-linux/export/root.2.6 \ nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \ @@ -106,16 +139,11 @@ end define boot set_kernel_parameters - set $pc=0x88001000 + set $pc=0x88002000 set $fp=0 set $evb=0x88000000 - # I/D-Cache ON - -# IPI -# set *(long *)0x00eff2f8 = 0x2 - set $fp=0 -# set *(unsigned long *)0xa0ef4000 = 0x100 si + c end # Show TLB entries @@ -151,11 +179,29 @@ define show_regs printf "EVB[%08lx]\n",$evb end +define restart + sdireset + sdireset + en 1 + set $pc=0x0 + c + tlb_init + setup + load_modules + boot +end + define setup debug_chaos +# Clock +# shell sleep 0.1 +# clock_init_off +# shell sleep 1 +# clock_init_on_182 +# shell sleep 0.1 +# SDRAM set *(unsigned long *)0xa0ef6004 = 0x0001053f set *(unsigned long *)0xa0ef6028 = 0x00031102 -# set *(unsigned long *)0xa0ef400c = 0x2 end sdireset @@ -165,16 +211,8 @@ target m32rsdi set $pc=0x0 b *0x30000 c +dis 1 setup tlb_init load_modules -#set *(long *)0xa0ef4000=0x101 -#set *(long *)0xa0ef400c=0x002 - boot -#b tme_handler -b *0x88000020 - - - - diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index fc2c3d0cb..22a76f8f7 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -21,6 +21,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + mainmenu "Linux/68k Kernel Configuration" source "init/Kconfig" @@ -185,17 +189,19 @@ config BVME6000 drivers for SCSI, Ethernet and serial ports later on. config HP300 - bool "HP9000/300 support" + bool "HP9000/300 and HP9000/400 support" depends on !MMU_SUN3 help - This option enables support for the HP9000/300 series of - workstations. Support for these machines is still very experimental. - If you plan to try to use the kernel on such a machine say Y here. + This option enables support for the HP9000/300 and HP9000/400 series + of workstations. Support for these machines is still somewhat + experimental. If you plan to try to use the kernel on such a machine + say Y here. Everybody else says N. config DIO bool "DIO bus support" depends on HP300 + default y help Say Y here to enable support for the "DIO" expansion bus used in HP300 machines. If you are using such a system you almost certainly @@ -379,8 +385,8 @@ config STRAM_SWAP bool "Support for ST-RAM as swap space" depends on ATARI && BROKEN ---help--- - Some Atari 68k macines (including the 520STF and 1020STE) divide - their addressible memory into ST and TT sections. The TT section + Some Atari 68k machines (including the 520STF and 1020STE) divide + their addressable memory into ST and TT sections. The TT section (up to 512MB) is the main memory; the ST section (up to 4MB) is accessible to the built-in graphics board, runs slower, and is present mainly for backward compatibility with older machines. @@ -582,11 +588,18 @@ config ADB_KEYBOARD config HPDCA tristate "HP DCA serial support" - depends on DIO + depends on DIO && SERIAL_8250 help If you want to use the internal "DCA" serial ports on an HP300 machine, say Y here. +config HPAPCI + tristate "HP APCI serial support" + depends on HP300 && SERIAL_8250 && EXPERIMENTAL + help + If you want to use the internal "APCI" serial ports on an HP400 + machine, say Y here. + config MVME147_SCC bool "SCC support for MVME147 serial ports" depends on MVME147 @@ -623,7 +636,7 @@ config DN_SERIAL config SERIAL_CONSOLE bool "Support for serial port console" - depends on (AMIGA || ATARI || MAC || HP300 || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || HPDCA=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) + depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) ---help--- If you say Y here, it will be possible to use a serial port as the system console (the system console is the device which receives all diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index 59c25bc9d..466e7407a 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -28,7 +28,7 @@ ifdef CONFIG_SUN3 LDFLAGS_vmlinux = -N endif -CHECKFLAGS += -D__mc68000__ -I$(shell $(CC) -print-file-name=include) +CHECKFLAGS += -D__mc68000__ # without -fno-strength-reduce the 53c7xx.c driver fails ;-( CFLAGS += -pipe -fno-strength-reduce -ffixed-a2 diff --git a/arch/m68k/atari/hades-pci.c b/arch/m68k/atari/hades-pci.c index 151726c04..8888debf7 100644 --- a/arch/m68k/atari/hades-pci.c +++ b/arch/m68k/atari/hades-pci.c @@ -311,7 +311,7 @@ static void __init hades_fixup(int pci_modify) * Go through all devices, fixing up irqs as we see fit: */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) { diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index 9ab7d81b5..53e2dc3d2 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -1034,7 +1034,7 @@ static struct block_device_operations stram_fops = { static struct gendisk *stram_disk; static struct request_queue *stram_queue; -static spinlock_t stram_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(stram_lock); int __init stram_device_init(void) { diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index a912df144..c1b233364 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:25 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:22:54 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -376,7 +376,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -731,6 +730,11 @@ CONFIG_DMASOUND=m # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 45ed61426..648361b54 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:29 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:22:58 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -302,7 +302,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -590,6 +589,11 @@ CONFIG_DUMMY_CONSOLE=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 2e3a1624b..1fb25c0b3 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:34 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:11 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -331,7 +331,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -643,6 +642,11 @@ CONFIG_DMASOUND=m # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index 5416c544c..f1f2cf027 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:38 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:15 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -302,7 +302,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -589,6 +588,11 @@ CONFIG_DUMMY_CONSOLE=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 3ff6b3b8c..53dde43dd 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:44 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:40 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -303,7 +303,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -591,6 +590,11 @@ CONFIG_DUMMY_CONSOLE=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 7d7fd0582..2452dac8d 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:47 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:44 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -338,7 +338,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -652,6 +651,11 @@ CONFIG_LOGO_MAC_CLUT224=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 84610d341..ea38e87a6 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:49 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:49 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -303,7 +303,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -606,6 +605,11 @@ CONFIG_LOGO_LINUX_CLUT224=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 688c9e78f..f931a6493 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:52 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:53 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -302,7 +302,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -605,6 +604,11 @@ CONFIG_LOGO_LINUX_CLUT224=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 6ede4e73a..713020cd6 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:55 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:57 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -356,7 +356,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -682,6 +681,11 @@ CONFIG_DMASOUND=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index e4e473e9b..783d00cbb 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:21:58 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:24:01 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -291,7 +291,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -595,6 +594,11 @@ CONFIG_LOGO_LINUX_CLUT224=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index f9acd19a0..c25f91347 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc3-m68k -# Sun Dec 5 14:22:01 2004 +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:24:05 2004 # CONFIG_M68K=y CONFIG_MMU=y @@ -302,7 +302,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -605,6 +604,11 @@ CONFIG_LOGO_LINUX_CLUT224=y # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # Character devices # diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig index 367125a02..78f57d398 100644 --- a/arch/m68k/defconfig +++ b/arch/m68k/defconfig @@ -1,28 +1,63 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-m68k +# Sun Dec 26 11:23:36 2004 # +CONFIG_M68K=y +CONFIG_MMU=y CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set # # Platform dependent setup # -# CONFIG_ISA is not set -# CONFIG_PCMCIA is not set +# CONFIG_SUN3 is not set CONFIG_AMIGA=y # CONFIG_ATARI is not set -# CONFIG_HADES is not set -# CONFIG_PCI is not set # CONFIG_MAC is not set # CONFIG_APOLLO is not set # CONFIG_VME is not set # CONFIG_HP300 is not set # CONFIG_SUN3X is not set -# CONFIG_SUN3 is not set # CONFIG_Q40 is not set # @@ -32,114 +67,89 @@ CONFIG_M68020=y CONFIG_M68030=y CONFIG_M68040=y # CONFIG_M68060 is not set +CONFIG_MMU_MOTOROLA=y # CONFIG_M68KFPU_EMU is not set # CONFIG_ADVANCED is not set # # General setup # -CONFIG_NET=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -CONFIG_KCORE_ELF=y -# CONFIG_KCORE_AOUT is not set -CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=y # CONFIG_BINFMT_MISC is not set CONFIG_ZORRO=y # CONFIG_AMIGA_PCMCIA is not set # CONFIG_HEARTBEAT is not set CONFIG_PROC_HARDWARE=y -# CONFIG_PARPORT is not set -# CONFIG_PRINTER is not set +# CONFIG_ZORRO_NAMES is not set # -# Loadable module support +# Device Drivers # -# CONFIG_MODULES is not set # -# Block devices +# Generic Driver Options # -# CONFIG_BLK_DEV_FD is not set -CONFIG_AMIGA_FLOPPY=y -# CONFIG_AMIGA_Z2RAM is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_MD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_INITRD=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y # -# Networking options +# Memory Technology Devices (MTD) # -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -# CONFIG_NETLINK is not set -# CONFIG_NETFILTER is not set -# CONFIG_FILTER is not set -CONFIG_UNIX=y -CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_PNP is not set -# CONFIG_IP_ROUTER is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_ALIAS is not set -# CONFIG_SYN_COOKIES is not set +# CONFIG_MTD is not set # -# (it is safe to leave these untouched) +# Parallel port support # -# CONFIG_SKB_LARGE is not set -# CONFIG_IPV6 is not set -# CONFIG_KHTTPD is not set -# CONFIG_ATM is not set +# CONFIG_PARPORT is not set # +# Plug and Play support # + # -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_DECNET is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_BRIDGE is not set -# CONFIG_LLC is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set +# Block devices +# +CONFIG_AMIGA_FLOPPY=y +# CONFIG_AMIGA_Z2RAM 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_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set # -# QoS and/or fair queueing +# IO Schedulers # -# CONFIG_NET_SCHED is not set +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # -# ATA/IDE/MFM/RLL support +# ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set -# CONFIG_BLK_DEV_HD is not set # -# SCSI support +# SCSI device support # CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y -CONFIG_SD_EXTRA_DEVS=40 CONFIG_CHR_DEV_ST=y -CONFIG_ST_EXTRA_DEVS=2 +# CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_SR_EXTRA_DEVS=2 # CONFIG_CHR_DEV_SG is not set # @@ -149,11 +159,18 @@ CONFIG_SR_EXTRA_DEVS=2 CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set +# +# SCSI Transport Attributes +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set + # # SCSI low-level drivers # +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_DEBUG is not set CONFIG_A3000_SCSI=y -# CONFIG_A4000T_SCSI is not set CONFIG_A2091_SCSI=y CONFIG_GVP11_SCSI=y # CONFIG_CYBERSTORM_SCSI is not set @@ -161,107 +178,394 @@ CONFIG_GVP11_SCSI=y # CONFIG_BLZ2060_SCSI is not set # CONFIG_BLZ1230_SCSI is not set # CONFIG_FASTLANE_SCSI is not set -# CONFIG_A4091_SCSI is not set -# CONFIG_WARPENGINE_SCSI is not set -# CONFIG_BLZ603EPLUS_SCSI is not set # CONFIG_OKTAGON_SCSI is not set # -# Network device support +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) # +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT 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 +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set -# CONFIG_SLIP is not set -# CONFIG_PPP is not set +# CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set -# CONFIG_ARIADNE is not set -# CONFIG_ZORRO8390 is not set -# CONFIG_A2065 is not set -# CONFIG_HYDRA is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# 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 + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +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 + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_RAW is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_AMIGA is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_AMIGA is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -CONFIG_BUSMOUSE=y -CONFIG_AMIGA_BUILTIN_SERIAL=y -# CONFIG_GVPIOEXT is not set -# CONFIG_GVPIOEXT_LP is not set -# CONFIG_GVPIOEXT_PLIP is not set -# CONFIG_MULTIFACE_III_TTY is not set -# CONFIG_SUN3X_ZS is not set -# CONFIG_SUN_KEYBOARD is not set -# CONFIG_SUN_MOUSE is not set -# CONFIG_SBUS is not set -# CONFIG_SERIAL_CONSOLE is not set -# CONFIG_USERIAL is not set -# CONFIG_WATCHDOG is not set +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_A2232 is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set # -# Sound support +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_GEN_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_CIRRUS is not set +CONFIG_FB_AMIGA=y +CONFIG_FB_AMIGA_OCS=y +CONFIG_FB_AMIGA_ECS=y +CONFIG_FB_AMIGA_AGA=y +# CONFIG_FB_FM2 is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +CONFIG_DUMMY_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE is not set + +# +# Logo configuration +# +# CONFIG_LOGO is not set + +# +# Sound # # CONFIG_SOUND is not set +# +# USB support +# +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# Character devices +# +CONFIG_AMIGA_BUILTIN_SERIAL=y +# CONFIG_MULTIFACE_III_TTY is not set +# CONFIG_GVPIOEXT is not set +# CONFIG_SERIAL_CONSOLE is not set + # # File systems # +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +CONFIG_MINIX_FS=y +# CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_VFAT_FS is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +# CONFIG_TMPFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -# CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set -CONFIG_MINIX_FS=y -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set +# CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set -CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -# CONFIG_DEVFS_MOUNT is not set -# CONFIG_DEVFS_DEBUG is not set -CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # -# CONFIG_CODA_FS is not set CONFIG_NFS_FS=y -# CONFIG_ROOT_NFS is not set +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set -CONFIG_SUNRPC=y CONFIG_LOCKD=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set # CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_AMIGA_PARTITION=y -CONFIG_NLS=y +CONFIG_MSDOS_PARTITION=y # # Native Language Support # +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set @@ -277,7 +581,15 @@ CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set @@ -285,44 +597,33 @@ CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set # -# Console drivers +# Kernel hacking # -CONFIG_FB=y +# CONFIG_DEBUG_KERNEL is not set # -# Frame-buffer support +# Security options # -CONFIG_FB=y -CONFIG_DUMMY_CONSOLE=y -# CONFIG_FB_CLGEN is not set -# CONFIG_FB_PM2 is not set -CONFIG_FB_AMIGA=y -CONFIG_FB_AMIGA_OCS=y -CONFIG_FB_AMIGA_ECS=y -CONFIG_FB_AMIGA_AGA=y -# CONFIG_FB_CYBER is not set -# CONFIG_FB_VIRGE is not set -# CONFIG_FB_RETINAZ3 is not set -# CONFIG_FB_FM2 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FBCON_ADVANCED is not set -CONFIG_FBCON_MFB=y -CONFIG_FBCON_AFB=y -CONFIG_FBCON_ILBM=y -# CONFIG_FBCON_FONTWIDTH8_ONLY is not set -# CONFIG_FBCON_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -CONFIG_FONT_PEARL_8x8=y +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set # -# Kernel hacking +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines # -# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index 31dcf1a39..a0b854f3f 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c @@ -8,55 +8,272 @@ */ #include -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include + +#include #include #include -#include /* hwreg_present() */ +#include /* readb() and writeb() */ +#include +#include #include "ints.h" #include "time.h" +unsigned long hp300_model; +unsigned long hp300_uart_scode = -1; +unsigned char ledstate; + +static char s_hp330[] __initdata = "330"; +static char s_hp340[] __initdata = "340"; +static char s_hp345[] __initdata = "345"; +static char s_hp360[] __initdata = "360"; +static char s_hp370[] __initdata = "370"; +static char s_hp375[] __initdata = "375"; +static char s_hp380[] __initdata = "380"; +static char s_hp385[] __initdata = "385"; +static char s_hp400[] __initdata = "400"; +static char s_hp425t[] __initdata = "425t"; +static char s_hp425s[] __initdata = "425s"; +static char s_hp425e[] __initdata = "425e"; +static char s_hp433t[] __initdata = "433t"; +static char s_hp433s[] __initdata = "433s"; +static char *hp300_models[] __initdata = { + [HP_320] = NULL, + [HP_330] = s_hp330, + [HP_340] = s_hp340, + [HP_345] = s_hp345, + [HP_350] = NULL, + [HP_360] = s_hp360, + [HP_370] = s_hp370, + [HP_375] = s_hp375, + [HP_380] = s_hp380, + [HP_385] = s_hp385, + [HP_400] = s_hp400, + [HP_425T] = s_hp425t, + [HP_425S] = s_hp425s, + [HP_425E] = s_hp425e, + [HP_433T] = s_hp433t, + [HP_433S] = s_hp433s, +}; + +static char hp300_model_name[13] = "HP9000/"; + extern void hp300_reset(void); extern irqreturn_t (*hp300_default_handler[])(int, void *, struct pt_regs *); extern int show_hp300_interrupts(struct seq_file *, void *); +#ifdef CONFIG_SERIAL_8250_CONSOLE +extern int hp300_setup_serial_console(void) __init; +#endif + +int __init hp300_parse_bootinfo(const struct bi_record *record) +{ + int unknown = 0; + const unsigned long *data = record->data; + + switch (record->tag) { + case BI_HP300_MODEL: + hp300_model = *data; + break; + + case BI_HP300_UART_SCODE: + hp300_uart_scode = *data; + break; + + case BI_HP300_UART_ADDR: + /* serial port address: ignored here */ + break; + + default: + unknown = 1; + } + + return unknown; +} #ifdef CONFIG_HEARTBEAT static void hp300_pulse(int x) { - if (x) - blinken_leds(0xfe); - else - blinken_leds(0xff); + if (x) + blinken_leds(0x10, 0); + else + blinken_leds(0, 0x10); } #endif static void hp300_get_model(char *model) { - strcpy(model, "HP9000/300"); + strcpy(model, hp300_model_name); +} + +#define RTCBASE 0xf0420000 +#define RTC_DATA 0x1 +#define RTC_CMD 0x3 + +#define RTC_BUSY 0x02 +#define RTC_DATA_RDY 0x01 + +#define rtc_busy() (in_8(RTCBASE + RTC_CMD) & RTC_BUSY) +#define rtc_data_available() (in_8(RTCBASE + RTC_CMD) & RTC_DATA_RDY) +#define rtc_status() (in_8(RTCBASE + RTC_CMD)) +#define rtc_command(x) out_8(RTCBASE + RTC_CMD, (x)) +#define rtc_read_data() (in_8(RTCBASE + RTC_DATA)) +#define rtc_write_data(x) out_8(RTCBASE + RTC_DATA, (x)) + +#define RTC_SETREG 0xe0 +#define RTC_WRITEREG 0xc2 +#define RTC_READREG 0xc3 + +#define RTC_REG_SEC2 0 +#define RTC_REG_SEC1 1 +#define RTC_REG_MIN2 2 +#define RTC_REG_MIN1 3 +#define RTC_REG_HOUR2 4 +#define RTC_REG_HOUR1 5 +#define RTC_REG_WDAY 6 +#define RTC_REG_DAY2 7 +#define RTC_REG_DAY1 8 +#define RTC_REG_MON2 9 +#define RTC_REG_MON1 10 +#define RTC_REG_YEAR2 11 +#define RTC_REG_YEAR1 12 + +#define RTC_HOUR1_24HMODE 0x8 + +#define RTC_STAT_MASK 0xf0 +#define RTC_STAT_RDY 0x40 + +static inline unsigned char hp300_rtc_read(unsigned char reg) +{ + unsigned char s, ret; + unsigned long flags; + + local_irq_save(flags); + + while (rtc_busy()); + rtc_command(RTC_SETREG); + while (rtc_busy()); + rtc_write_data(reg); + while (rtc_busy()); + rtc_command(RTC_READREG); + + do { + while (!rtc_data_available()); + s = rtc_status(); + ret = rtc_read_data(); + } while ((s & RTC_STAT_MASK) != RTC_STAT_RDY); + + local_irq_restore(flags); + + return ret; +} + +static inline unsigned char hp300_rtc_write(unsigned char reg, + unsigned char val) +{ + unsigned char s, ret; + unsigned long flags; + + local_irq_save(flags); + + while (rtc_busy()); + rtc_command(RTC_SETREG); + while (rtc_busy()); + rtc_write_data((val << 4) | reg); + while (rtc_busy()); + rtc_command(RTC_WRITEREG); + while (rtc_busy()); + rtc_command(RTC_READREG); + + do { + while (!rtc_data_available()); + s = rtc_status(); + ret = rtc_read_data(); + } while ((s & RTC_STAT_MASK) != RTC_STAT_RDY); + + local_irq_restore(flags); + + return ret; +} + +static int hp300_hwclk(int op, struct rtc_time *t) +{ + if (!op) { /* read */ + t->tm_sec = hp300_rtc_read(RTC_REG_SEC1) * 10 + + hp300_rtc_read(RTC_REG_SEC2); + t->tm_min = hp300_rtc_read(RTC_REG_MIN1) * 10 + + hp300_rtc_read(RTC_REG_MIN2); + t->tm_hour = (hp300_rtc_read(RTC_REG_HOUR1) & 3) * 10 + + hp300_rtc_read(RTC_REG_HOUR2); + t->tm_wday = -1; + t->tm_mday = hp300_rtc_read(RTC_REG_DAY1) * 10 + + hp300_rtc_read(RTC_REG_DAY2); + t->tm_mon = hp300_rtc_read(RTC_REG_MON1) * 10 + + hp300_rtc_read(RTC_REG_MON2) - 1; + t->tm_year = hp300_rtc_read(RTC_REG_YEAR1) * 10 + + hp300_rtc_read(RTC_REG_YEAR2); + if (t->tm_year <= 69) + t->tm_year += 100; + } else { + hp300_rtc_write(RTC_REG_SEC1, t->tm_sec / 10); + hp300_rtc_write(RTC_REG_SEC2, t->tm_sec % 10); + hp300_rtc_write(RTC_REG_MIN1, t->tm_min / 10); + hp300_rtc_write(RTC_REG_MIN2, t->tm_min % 10); + hp300_rtc_write(RTC_REG_HOUR1, + ((t->tm_hour / 10) & 3) | RTC_HOUR1_24HMODE); + hp300_rtc_write(RTC_REG_HOUR2, t->tm_hour % 10); + hp300_rtc_write(RTC_REG_DAY1, t->tm_mday / 10); + hp300_rtc_write(RTC_REG_DAY2, t->tm_mday % 10); + hp300_rtc_write(RTC_REG_MON1, (t->tm_mon + 1) / 10); + hp300_rtc_write(RTC_REG_MON2, (t->tm_mon + 1) % 10); + if (t->tm_year >= 100) + t->tm_year -= 100; + hp300_rtc_write(RTC_REG_YEAR1, t->tm_year / 10); + hp300_rtc_write(RTC_REG_YEAR2, t->tm_year % 10); + } + + return 0; +} + +static unsigned int hp300_get_ss(void) +{ + return hp300_rtc_read(RTC_REG_SEC1) * 10 + + hp300_rtc_read(RTC_REG_SEC2); } void __init config_hp300(void) { - mach_sched_init = hp300_sched_init; - mach_init_IRQ = hp300_init_IRQ; - mach_request_irq = hp300_request_irq; - mach_free_irq = hp300_free_irq; - mach_get_model = hp300_get_model; - mach_get_irq_list = show_hp300_interrupts; - mach_gettimeoffset = hp300_gettimeoffset; - mach_default_handler = &hp300_default_handler; - mach_reset = hp300_reset; + mach_sched_init = hp300_sched_init; + mach_init_IRQ = hp300_init_IRQ; + mach_request_irq = hp300_request_irq; + mach_free_irq = hp300_free_irq; + mach_get_model = hp300_get_model; + mach_get_irq_list = show_hp300_interrupts; + mach_gettimeoffset = hp300_gettimeoffset; + mach_default_handler = &hp300_default_handler; + mach_hwclk = hp300_hwclk; + mach_get_ss = hp300_get_ss; + mach_reset = hp300_reset; #ifdef CONFIG_HEARTBEAT - mach_heartbeat = hp300_pulse; + mach_heartbeat = hp300_pulse; #endif #ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; + conswitchp = &dummy_con; +#endif + mach_max_dma_address = 0xffffffff; + + if (hp300_model >= HP_330 && hp300_model <= HP_433S && hp300_model != HP_350) { + printk(KERN_INFO "Detected HP9000 model %s\n", hp300_models[hp300_model-HP_320]); + strcat(hp300_model_name, hp300_models[hp300_model-HP_320]); + } + else { + panic("Unknown HP9000 Model"); + } +#ifdef CONFIG_SERIAL_8250_CONSOLE + hp300_setup_serial_console(); #endif - mach_max_dma_address = 0xffffffff; } diff --git a/arch/m68k/hp300/ints.c b/arch/m68k/hp300/ints.c index 9fe4a9605..0c5bb403e 100644 --- a/arch/m68k/hp300/ints.c +++ b/arch/m68k/hp300/ints.c @@ -57,14 +57,21 @@ static irqreturn_t hp300_int_handler(int irq, void *dev_id, struct pt_regs *fp) return IRQ_HANDLED; } +static irqreturn_t hp300_badint(int irq, void *dev_id, struct pt_regs *fp) +{ + num_spurious += 1; + return IRQ_NONE; +} + irqreturn_t (*hp300_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { - [0] = hp300_int_handler, + [0] = hp300_badint, [1] = hp300_int_handler, [2] = hp300_int_handler, [3] = hp300_int_handler, [4] = hp300_int_handler, [5] = hp300_int_handler, [6] = hp300_int_handler, + [7] = hp300_int_handler }; /* dev_id had better be unique to each handler because it's the only way we have diff --git a/arch/m68k/hp300/reboot.S b/arch/m68k/hp300/reboot.S index aaecdbda2..52eb852e6 100644 --- a/arch/m68k/hp300/reboot.S +++ b/arch/m68k/hp300/reboot.S @@ -13,23 +13,4 @@ .globl hp300_reset hp300_reset: - .chip 68030 - oriw #0x0700,%sr /* cli() */ - movel hp300_phys_ram_base, %d1 - movel #0, %d0 - movec %d0, %vbr /* reset vector table */ - lea zero, %a0 - lea 1f, %a1 - add %d1, %a0 - add %d1, %a1 - pmove %tc, %a0@ - bclr #7, %a0@ - pmove %a0@, %tc /* goodbye MMU */ - jmp %a1@ -1: movel #0x808, %d0 - movec %d0, %cacr /* cache off */ - moveb #0, 0x1ffff - movel #0x1a4, %a0 - jmp %a0@ - -zero: .quad 0 + jmp hp300_reset diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index deb65b4d0..8da5b1b31 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "ints.h" /* Clock hardware definitions */ @@ -38,11 +39,13 @@ static irqreturn_t hp300_tick(int irq, void *dev_id, struct pt_regs *regs) { - unsigned long tmp; - irqreturn_t (*vector)(int, void *, struct pt_regs *) = dev_id; - in_8(CLOCKBASE + CLKSR); - asm volatile ("movpw %1@(5),%0" : "=d" (tmp) : "a" (CLOCKBASE)); - return vector(irq, NULL, regs); + unsigned long tmp; + irqreturn_t (*vector)(int, void *, struct pt_regs *) = dev_id; + in_8(CLOCKBASE + CLKSR); + asm volatile ("movpw %1@(5),%0" : "=d" (tmp) : "a" (CLOCKBASE)); + /* Turn off the network and SCSI leds */ + blinken_leds(0, 0xe0); + return vector(irq, NULL, regs); } unsigned long hp300_gettimeoffset(void) diff --git a/arch/m68k/kernel/bios32.c b/arch/m68k/kernel/bios32.c index 738531ca2..a901685eb 100644 --- a/arch/m68k/kernel/bios32.c +++ b/arch/m68k/kernel/bios32.c @@ -46,8 +46,6 @@ #define ALIGN(val,align) (((val) + ((align) - 1)) & ~((align) - 1)) -#define MAX(val1, val2) (((val1) > (val2)) ? val1 : val2) - /* * Offsets relative to the I/O and memory base addresses from where resources * are allocated. @@ -171,7 +169,7 @@ static void __init layout_dev(struct pci_dev *dev) * Align to multiple of size of minimum base. */ - alignto = MAX(0x040, size) ; + alignto = max_t(unsigned int, 0x040, size); base = ALIGN(io_base, alignto); io_base = base + size; pci_write_config_dword(dev, reg, base | PCI_BASE_ADDRESS_SPACE_IO); @@ -214,7 +212,7 @@ static void __init layout_dev(struct pci_dev *dev) * Align to multiple of size of minimum base. */ - alignto = MAX(0x1000, size) ; + alignto = max_t(unsigned int, 0x1000, size); base = ALIGN(mem_base, alignto); mem_base = base + size; pci_write_config_dword(dev, reg, base); diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 59ee17ab5..e964015a3 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -663,3 +663,50 @@ sys_call_table: .long sys_lremovexattr .long sys_fremovexattr .long sys_futex /* 235 */ + .long sys_sendfile64 + .long sys_mincore + .long sys_madvise + .long sys_fcntl64 + .long sys_readahead /* 240 */ + .long sys_io_setup + .long sys_io_destroy + .long sys_io_getevents + .long sys_io_submit + .long sys_io_cancel /* 245 */ + .long sys_fadvise64 + .long sys_exit_group + .long sys_lookup_dcookie + .long sys_epoll_create + .long sys_epoll_ctl /* 250 */ + .long sys_epoll_wait + .long sys_remap_file_pages + .long sys_set_tid_address + .long sys_timer_create + .long sys_timer_settime /* 255 */ + .long sys_timer_gettime + .long sys_timer_getoverrun + .long sys_timer_delete + .long sys_clock_settime + .long sys_clock_gettime /* 260 */ + .long sys_clock_getres + .long sys_clock_nanosleep + .long sys_statfs64 + .long sys_fstatfs64 + .long sys_tgkill /* 265 */ + .long sys_utimes + .long sys_fadvise64_64 + .long sys_mbind + .long sys_get_mempolicy + .long sys_set_mempolicy /* 270 */ + .long sys_mq_open + .long sys_mq_unlink + .long sys_mq_timedsend + .long sys_mq_timedreceive + .long sys_mq_notify /* 275 */ + .long sys_mq_getsetattr + .long sys_waitid + .long sys_ni_syscall /* for sys_vserver */ + .long sys_add_key + .long sys_request_key /* 280 */ + .long sys_keyctl + diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index b1e5ae099..7cd6de17c 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -24,6 +24,7 @@ ** 1998/08/30 David Kilzer: Added support for font_desc structures ** for linux-2.1.115 ** 9/02/11 Richard Zidlicky: added Q40 support (initial vesion 99/01/01) +** 2004/05/13 Kars de Jong: Finalised HP300 support ** ** This file is subject to the terms and conditions of the GNU General Public ** License. See the file README.legal in the main directory of this archive @@ -313,9 +314,6 @@ #ifdef CONFIG_Q40 .globl q40_mem_cptr #endif -#ifdef CONFIG_HP300 -.globl hp300_phys_ram_base -#endif CPUTYPE_040 = 1 /* indicates an 040 */ CPUTYPE_060 = 2 /* indicates an 060 */ @@ -467,7 +465,7 @@ func_define mmu_get_ptr_table_entry,2 func_define mmu_get_page_table_entry,2 func_define mmu_print func_define get_new_page -#ifdef CONFIG_HP300 +#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO) func_define set_leds #endif @@ -594,6 +592,7 @@ ENTRY(_stext) .long MACH_BVME6000, BVME6000_BOOTI_VERSION .long MACH_MAC, MAC_BOOTI_VERSION .long MACH_Q40, Q40_BOOTI_VERSION + .long MACH_HP300, HP300_BOOTI_VERSION .long 0 1: jra __start @@ -605,65 +604,6 @@ ENTRY(_start) jra __start __INIT ENTRY(__start) - -#ifdef CONFIG_HP300 -/* This is a hack. The HP NetBSD bootloader loads us at an arbitrary - address (apparently 0xff002000 in practice) which is not good if we need - to be able to map this to VA 0x1000. We could do it with pagetables but - a better solution seems to be to relocate the kernel in physical memory - before we start. - - So, we copy the entire kernel image (code+data+bss) down to the 16MB - boundary that marks the start of RAM. This is slightly tricky because - we must not overwrite the copying code itself. :-) */ - -/* 15/5/98. The start address of physical RAM changes depending on how much - RAM is present. This is actually a blessing in disguise as it provides - a way for us to work out the RAM size rather than hardwiring it. */ - - lea %pc@(_start),%a0 - movel %a0,%d6 - and #0xffff0000, %d6 - lea %pc@(hp300_phys_ram_base),%a0 - movel %d6, %a0@ - movel %pc@(L(custom)),%a3 - moveb #0xfe,%d7 - moveb %d7,%a3@(0x1ffff) - lea %pc@(Lcopystart),%a0 - lea %pc@(Lcopyend),%a1 - movel %d6,%a2 /* Start of physical RAM */ -1: moveb %a0@+,%d0 - moveb %d0,%a2@+ - cmpl %a0,%a1 - jbne 1b - movel %d6,%a2 - moveb #0xfd,%d7 - moveb %d7,%a3@(0x1ffff) - lea %pc@(_stext),%a0 - lea %pc@(_end),%a1 - jmp %a2@ - -Lcopystart: - moveb #0xf7,%d7 - moveb %d7,%a3@(0x1ffff) - movel %d6,%a2 /* Start of kernel */ - add #0x1000,%a2 -1: moveb %a0@+,%d0 - moveb %d0,%a2@+ - cmpl %a0,%a1 - jbne 1b - moveb #0,%d7 - moveb %d7,%a3@(0x1ffff) - movel %d6,%a0 - addl #Lstart1,%a0 - jmp %a0@ -Lcopyend: - -Lstart1: - moveb #0x3f,%d7 - moveb %d7,%a3@(0x1ffff) -#endif /* CONFIG_HP300 */ - /* * Setup initial stack pointer */ @@ -672,8 +612,6 @@ Lstart1: /* * Record the CPU and machine type. */ - -#ifndef CONFIG_HP300 get_bi_record BI_MACHTYPE lea %pc@(m68k_machtype),%a1 movel %a0@,%a1@ @@ -689,23 +627,8 @@ Lstart1: get_bi_record BI_CPUTYPE lea %pc@(m68k_cputype),%a1 movel %a0@,%a1@ -#else /* CONFIG_HP300 */ - /* FIXME HP300 doesn't use bootinfo yet */ - movel #MACH_HP300,%d4 - lea %pc@(m68k_machtype),%a0 - movel %d4,%a0@ - movel #FPU_68881,%d0 - lea %pc@(m68k_fputype),%a0 - movel %d0,%a0@ - movel #MMU_68030,%d0 - lea %pc@(m68k_mmutype),%a0 - movel %d0,%a0@ - movel #CPU_68030,%d0 - lea %pc@(m68k_cputype),%a0 - movel %d0,%a0@ - leds(0x1) -#endif /* CONFIG_HP300 */ + leds 0x1 #ifdef CONFIG_MAC /* @@ -956,6 +879,26 @@ L(gvtdone): #endif +#ifdef CONFIG_HP300 + is_not_hp300(L(nothp)) + + /* Get the address of the UART for serial debugging */ + get_bi_record BI_HP300_UART_ADDR + tstl %d0 + jbmi 1f + movel %a0@,%d3 + lea %pc@(L(uartbase)),%a0 + movel %d3,%a0@ + get_bi_record BI_HP300_UART_SCODE + tstl %d0 + jbmi 1f + movel %a0@,%d3 + lea %pc@(L(uart_scode)),%a0 + movel %d3,%a0@ +1: +L(nothp): +#endif + /* * Initialize serial port */ @@ -979,9 +922,7 @@ L(nocon): putc '\n' putc 'A' -#ifdef CONFIG_HP300 - leds(0x2) -#endif /* CONFIG_HP300 */ + leds 0x2 dputn %pc@(L(cputype)) dputn %pc@(m68k_supervisor_cachemode) dputn %pc@(m68k_pgtable_cachemode) @@ -1124,16 +1065,30 @@ L(notq40): #ifdef CONFIG_HP300 is_not_hp300(L(nothp300)) -/* On the HP300, we map the ROM, INTIO and DIO regions (phys. 0x00xxxxxx) - by mapping 32MB from 0xf0xxxxxx -> 0x00xxxxxx) using an 030 early - termination page descriptor. The ROM mapping is needed because the LEDs - are mapped there too. */ + /* On the HP300, we map the ROM, INTIO and DIO regions (phys. 0x00xxxxxx) + * by mapping 32MB (on 020/030) or 16 MB (on 040) from 0xf0xxxxxx -> 0x00xxxxxx). + * The ROM mapping is needed because the LEDs are mapped there too. + */ + is_040(1f) + + /* + * 030: Map the 32Meg range physical 0x0 upto logical 0xf000.0000 + */ mmu_map #0xf0000000,#0,#0x02000000,#_PAGE_NOCACHE030 -L(nothp300): + jbra L(mmu_init_done) -#endif +1: + /* + * 040: Map the 16Meg range physical 0x0 upto logical 0xf000.0000 + */ + mmu_map #0xf0000000,#0,#0x01000000,#_PAGE_NOCACHE_S + + jbra L(mmu_init_done) + +L(nothp300): +#endif /* CONFIG_HP300 */ #ifdef CONFIG_MVME147 @@ -1480,15 +1435,23 @@ L(mmu_fixup_done): #ifdef CONFIG_HP300 is_not_hp300(1f) /* - * Fix up the custom register to point to the new location of the LEDs. + * Fix up the iobase register to point to the new location of the LEDs. */ - movel #0xf0000000,L(custom) + movel #0xf0000000,L(iobase) /* * Energise the FPU and caches. */ + is_040(1f) movel #0x60,0xf05f400c -1: + jbra 2f + + /* + * 040: slightly different, apparently. + */ +1: movew #0,0xf05f400e + movew #0x64,0xf05f400e +2: #endif #ifdef CONFIG_SUN3X @@ -1585,7 +1548,6 @@ func_start get_bi_record,%d1 movel ARG1,%d0 lea %pc@(_end),%a0 -#ifndef CONFIG_HP300 1: tstw %a0@(BIR_TAG) jeq 3f cmpw %a0@(BIR_TAG),%d0 @@ -1599,7 +1561,6 @@ func_start get_bi_record,%d1 3: moveq #-1,%d0 lea %a0@(BIR_SIZE),%a0 4: -#endif /* CONFIG_HP300 */ func_return get_bi_record @@ -3013,6 +2974,10 @@ L(serial_init_not_mac): /* We count on the PROM initializing SIO1 */ #endif +#ifdef CONFIG_HP300 +/* We count on the boot loader initialising the UART */ +#endif + L(serial_init_done): func_return serial_init @@ -3205,9 +3170,31 @@ func_start serial_putc,%d0/%d1/%a0/%a1 1: moveb %a1@(LSRB0),%d0 andb #0x4,%d0 beq 1b + jbra L(serial_putc_done) 2: #endif +#ifdef CONFIG_HP300 + is_not_hp300(3f) + movl %pc@(L(iobase)),%a1 + addl %pc@(L(uartbase)),%a1 + movel %pc@(L(uart_scode)),%d1 /* Check the scode */ + jmi 3f /* Unset? Exit */ + cmpi #256,%d1 /* APCI scode? */ + jeq 2f +1: moveb %a1@(DCALSR),%d1 /* Output to DCA */ + andb #0x20,%d1 + beq 1b + moveb %d0,%a1@(DCADATA) + jbra L(serial_putc_done) +2: moveb %a1@(APCILSR),%d1 /* Output to APCI */ + andb #0x20,%d1 + beq 2b + moveb %d0,%a1@(APCIDATA) + jbra L(serial_putc_done) +3: +#endif + L(serial_putc_done): func_return serial_putc @@ -3295,7 +3282,7 @@ func_start set_leds,%d0/%a0 movel ARG1,%d0 #ifdef CONFIG_HP300 is_not_hp300(1f) - movel %pc@(L(custom)),%a0 + movel %pc@(L(iobase)),%a0 moveb %d0,%a0@(0x1ffff) jra 2f #endif @@ -3829,10 +3816,6 @@ L(showtest): __INITDATA .align 4 -#ifdef CONFIG_HP300 -hp300_phys_ram_base: -#endif - #if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \ defined(CONFIG_HP300) || defined(CONFIG_APOLLO) L(custom): @@ -3924,6 +3907,17 @@ LTHRB0 = 0x10416 LCPUCTRL = 0x10100 #endif +#if defined(CONFIG_HP300) +DCADATA = 0x11 +DCALSR = 0x1b +APCIDATA = 0x00 +APCILSR = 0x14 +L(uartbase): + .long 0 +L(uart_scode): + .long -1 +#endif + __FINIT .data .align 4 diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index 0e0c31fd5..1e143b467 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@ -279,7 +279,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) long tmp; ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 1d2563e11..d6ca99242 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -109,6 +109,7 @@ extern int q40_parse_bootinfo(const struct bi_record *); extern int bvme6000_parse_bootinfo(const struct bi_record *); extern int mvme16x_parse_bootinfo(const struct bi_record *); extern int mvme147_parse_bootinfo(const struct bi_record *); +extern int hp300_parse_bootinfo(const struct bi_record *); extern void config_amiga(void); extern void config_atari(void); @@ -175,6 +176,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) unknown = mvme16x_parse_bootinfo(record); else if (MACH_IS_MVME147) unknown = mvme147_parse_bootinfo(record); + else if (MACH_IS_HP300) + unknown = hp300_parse_bootinfo(record); else unknown = 1; } @@ -204,20 +207,8 @@ void __init setup_arch(char **cmdline_p) int i; char *p, *q; - if (!MACH_IS_HP300) { - /* The bootinfo is located right after the kernel bss */ - m68k_parse_bootinfo((const struct bi_record *)&_end); - } else { - /* FIXME HP300 doesn't use bootinfo yet */ - extern unsigned long hp300_phys_ram_base; - unsigned long hp300_mem_size = 0xffffffff-hp300_phys_ram_base; - m68k_cputype = CPU_68030; - m68k_fputype = FPU_68882; - m68k_memory[0].addr = hp300_phys_ram_base; - /* 0.5M fudge factor */ - m68k_memory[0].size = hp300_mem_size-512*1024; - m68k_num_memory++; - } + /* The bootinfo is located right after the kernel bss */ + m68k_parse_bootinfo((const struct bi_record *)&_end); if (CPU_IS_040) m68k_is040or060 = 4; @@ -352,7 +343,7 @@ void __init setup_arch(char **cmdline_p) #ifndef CONFIG_SUN3 startmem= m68k_memory[0].addr; endmem = startmem + m68k_memory[0].size; - high_memory = PAGE_OFFSET; + high_memory = (void *)PAGE_OFFSET; for (i = 0; i < m68k_num_memory; i++) { m68k_memory[i].size &= MASK_256K; if (m68k_memory[i].addr < startmem) @@ -550,7 +541,5 @@ void check_bugs(void) "emulation project\n" ); panic( "no FPU" ); } - -#endif /* CONFIG_SUN3 */ - +#endif /* !CONFIG_M68KFPU_EMU */ } diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 11d122980..e47e19588 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -45,6 +45,9 @@ static inline int set_rtc_mmss(unsigned long nowtime) static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index 42aeea9fc..e58654f3f 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -15,7 +15,7 @@ SECTIONS SCHED_TEXT *(.fixup) *(.gnu.warning) - } = 0x4e75 + } :text = 0x4e75 . = ALIGN(16); /* Exception table */ __start___ex_table = .; @@ -34,7 +34,7 @@ SECTIONS .bss : { *(.bss) } /* BSS */ . = ALIGN(16); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + .data.cacheline_aligned : { *(.data.cacheline_aligned) } :data _edata = .; /* End of data section */ diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 7a18ed062..cc37e8d3c 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -16,7 +16,7 @@ SECTIONS SCHED_TEXT *(.fixup) *(.gnu.warning) - } = 0x4e75 + } :text = 0x4e75 RODATA _etext = .; /* End of text section */ @@ -28,7 +28,7 @@ SECTIONS __start___ex_table = .; *(__ex_table) __stop___ex_table = .; - } + } :data /* End of data goes *here* so that freeing init code works properly. */ _edata = .; diff --git a/arch/m68k/kernel/vmlinux.lds.S b/arch/m68k/kernel/vmlinux.lds.S index 48e85d1d9..497b924f3 100644 --- a/arch/m68k/kernel/vmlinux.lds.S +++ b/arch/m68k/kernel/vmlinux.lds.S @@ -1,5 +1,9 @@ #include - +PHDRS +{ + text PT_LOAD FILEHDR PHDRS FLAGS (7); + data PT_LOAD FLAGS (7); +} #ifdef CONFIG_SUN3 #include "vmlinux-sun3.lds" #else diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c index 484ba8b50..4a5c5445c 100644 --- a/arch/m68k/lib/checksum.c +++ b/arch/m68k/lib/checksum.c @@ -134,8 +134,8 @@ EXPORT_SYMBOL(csum_partial); */ unsigned int -csum_partial_copy_from_user(const char *src, char *dst, int len, - int sum, int *csum_err) +csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, + int len, int sum, int *csum_err) { /* * GCC doesn't like more than 10 operands for the asm @@ -326,7 +326,7 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, */ unsigned int -csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum) +csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, int sum) { unsigned long tmp1, tmp2; __asm__("movel %2,%4\n\t" diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c index 09985ae7f..1453a6013 100644 --- a/arch/m68k/mm/memory.c +++ b/arch/m68k/mm/memory.c @@ -77,7 +77,7 @@ pmd_t *get_pointer_table (void) ptable_desc *new; if (!(page = (void *)get_zeroed_page(GFP_KERNEL))) - return 0; + return NULL; flush_tlb_kernel_page(page); nocache_page(page); diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index e58d9e362..d855fec26 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c @@ -258,7 +258,7 @@ void __init paging_init(void) printk ("before free_area_init\n"); #endif zones_size[0] = (mach_max_dma_address < (unsigned long)high_memory ? - mach_max_dma_address : (unsigned long)high_memory); + (mach_max_dma_address+1) : (unsigned long)high_memory); zones_size[1] = (unsigned long)high_memory - zones_size[0]; zones_size[0] = (zones_size[0] - PAGE_OFFSET) >> PAGE_SHIFT; diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index 256c5eeb5..a47be196a 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c @@ -7,7 +7,6 @@ * */ -#include #include #include #include diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 0b5730cd9..02b626bae 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 1215b5bea..f8ecc2664 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -11,7 +11,6 @@ * */ -#include #include #include #include diff --git a/arch/m68k/sun3/Makefile b/arch/m68k/sun3/Makefile index de3867d02..4d4f0695d 100644 --- a/arch/m68k/sun3/Makefile +++ b/arch/m68k/sun3/Makefile @@ -4,5 +4,4 @@ obj-y := sun3_ksyms.o sun3ints.o sun3dvma.o sbus.o idprom.o -obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o \ - intersil.o +obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o intersil.o diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 0d9876190..7a0e3a220 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include @@ -21,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -46,6 +47,8 @@ extern void prom_reboot (char *) __attribute__ ((__noreturn__)); */ unsigned long vmalloc_end; +EXPORT_SYMBOL(vmalloc_end); + unsigned long pmeg_vaddr[PMEGS_NUM]; unsigned char pmeg_alloc[PMEGS_NUM]; unsigned char pmeg_ctx[PMEGS_NUM]; diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index 47e677d0d..f04a1d25f 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c @@ -6,6 +6,7 @@ * Contains common routines for sun3/sun3x DVMA management. */ +#include #include #include #include diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index bca65bd06..e62a033cd 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -6,6 +6,7 @@ * for more details. */ +#include #include #include #include @@ -85,6 +86,9 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp) intersil_clear(); #endif do_timer(fp); +#ifndef CONFIG_SMP + update_process_times(user_mode(fp)); +#endif if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20)) sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160) /20]); diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 756d6277f..0ef547f54 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -6,6 +6,7 @@ * based on code from Oliver Jowett */ +#include #include #include #include @@ -70,7 +71,7 @@ void __init config_sun3x(void) mach_get_model = sun3_get_model; mach_get_hardware_list = sun3x_get_hardware_list; -#if defined(CONFIG_DUMMY_CONSOLE) +#ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index 90cd4079b..dda641993 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig @@ -29,6 +29,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default n +config GENERIC_CALIBRATE_DELAY + bool + default y + source "init/Kconfig" menu "Processor type and features" @@ -72,15 +76,20 @@ config M5249 help Motorola ColdFire 5249 processor support. +config M527x + bool "MCF527x" + help + Freescale (Motorola) ColdFire 5270/5271/5274/5275 processor support. + config M5272 bool "MCF5272" help Motorola ColdFire 5272 processor support. -config M5282 - bool "MCF5282" +config M528x + bool "MCF528x" help - Motorola ColdFire 5282 processor support. + Motorola ColdFire 5280/5282 processor support. config M5307 bool "MCF5307" @@ -96,7 +105,7 @@ endchoice config COLDFIRE bool - depends on (M5206 || M5206e || M5249 || M5272 || M5282 || M5307 || M5407) + depends on (M5206 || M5206e || M5249 || M527x || M5272 || M528x || M5307 || M5407) default y choice @@ -117,82 +126,97 @@ config CLOCK_AUTO config CLOCK_11MHz bool "11MHz" help - Select an 11MHz CPU clock frequency. + Select a 11MHz CPU clock frequency. config CLOCK_16MHz bool "16MHz" help - Select an 16MHz CPU clock frequency. + Select a 16MHz CPU clock frequency. config CLOCK_20MHz bool "20MHz" help - Select an 20MHz CPU clock frequency. + Select a 20MHz CPU clock frequency. config CLOCK_24MHz bool "24MHz" help - Select an 24MHz CPU clock frequency. + Select a 24MHz CPU clock frequency. config CLOCK_25MHz bool "25MHz" help - Select an 25MHz CPU clock frequency. + Select a 25MHz CPU clock frequency. config CLOCK_33MHz bool "33MHz" help - Select an 33MHz CPU clock frequency. + Select a 33MHz CPU clock frequency. config CLOCK_40MHz bool "40MHz" help - Select an 40MHz CPU clock frequency. + Select a 40MHz CPU clock frequency. config CLOCK_45MHz bool "45MHz" help - Select an 45MHz CPU clock frequency. + Select a 45MHz CPU clock frequency. config CLOCK_48MHz bool "48MHz" help - Select an 48MHz CPU clock frequency. + Select a 48MHz CPU clock frequency. config CLOCK_50MHz bool "50MHz" help - Select an 50MHz CPU clock frequency. + Select a 50MHz CPU clock frequency. config CLOCK_54MHz bool "54MHz" help - Select an 54MHz CPU clock frequency. + Select a 54MHz CPU clock frequency. config CLOCK_60MHz bool "60MHz" help - Select an 60MHz CPU clock frequency. + Select a 60MHz CPU clock frequency. config CLOCK_64MHz bool "64MHz" help - Select an 64MHz CPU clock frequency. + Select a 64MHz CPU clock frequency. config CLOCK_66MHz bool "66MHz" help - Select an 66MHz CPU clock frequency. + Select a 66MHz CPU clock frequency. config CLOCK_70MHz bool "70MHz" help - Select an 70MHz CPU clock frequency. + Select a 70MHz CPU clock frequency. + +config CLOCK_100MHz + bool "100MHz" + help + Select a 100MHz CPU clock frequency. config CLOCK_140MHz bool "140MHz" help - Select an 140MHz CPU clock frequency. + Select a 140MHz CPU clock frequency. + +config CLOCK_150MHz + bool "150MHz" + help + Select a 150MHz CPU clock frequency. + +config CLOCK_166MHz + bool "166MHz" + help + Select a 166MHz CPU clock frequency. endchoice @@ -284,6 +308,18 @@ config M5249C3 help Support for the Motorola M5249C3 board. +config M5271EVB + bool "Freescale (Motorola) M5271EVB board support" + depends on M527x + help + Support for the Freescale (Motorola) M5271EVB board. + +config M5275EVB + bool "Freescale (Motorola) M5275EVB board support" + depends on M527x + help + Support for the Freescale (Motorola) M5275EVB board. + config M5272C3 bool "Motorola M5272C3 board support" depends on M5272 @@ -296,15 +332,15 @@ config COBRA5272 help Support for the senTec COBRA5272 board. -config M5282C3 - bool "Motorola M5282C3 board support" - depends on M5282 +config M5282EVB + bool "Motorola M5282EVB board support" + depends on M528x help - Support for the Motorola M5282C3 board. + Support for the Motorola M5282EVB board. config COBRA5282 bool "senTec COBRA5282 board support" - depends on M5282 + depends on M528x help Support for the senTec COBRA5282 board. @@ -344,6 +380,18 @@ config CLEOPATRA help Support for the Feith Cleopatra boards. +config CANCam + bool "Feith CANCam board support" + depends on M5272 + help + Support for the Feith CANCam board. + +config SCALES + bool "Feith SCALES board support" + depends on M5272 + help + Support for the Feith SCALES board. + config NETtel bool "SecureEdge/NETtel board support" depends on (M5206e || M5272 || M5307) @@ -356,6 +404,12 @@ config SNAPGEAR help Special additional support for SnapGear router boards. +config CPU16B + bool "Sneha Technologies S.L. Sarasvati board support" + depends on M5272 + help + Support for the SNEHA CPU16B board. + config ROMFS_FROM_ROM bool " ROMFS image not RAM resident" depends on (NETtel || SNAPGEAR) @@ -376,13 +430,23 @@ config ARNEWSH config MOTOROLA bool default y - depends on (M5206eC3 || M5249C3 || M5272C3 || M5282C3 || M5307C3 || M5407C3) + depends on (M5206eC3 || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5407C3) + +config HW_FEITH + bool + default y + depends on (CLEOPATRA || CANCam || SCALES) config senTec bool default y depends on (COBRA5272 || COBRA5282) +config SNEHA + bool + default y + depends on CPU16B + config LARGE_ALLOCS bool "Allow allocating large blocks (> 1MB) of memory" help @@ -466,11 +530,6 @@ config ROMKERNEL help The kernel will be resident in FLASH/ROM when running. -config HIMEMKERNEL - bool "HIMEM" - help - The kernel will be resident in high memory when running. - endchoice endmenu diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile index e6be8b778..2524de272 100644 --- a/arch/m68knommu/Makefile +++ b/arch/m68knommu/Makefile @@ -15,8 +15,9 @@ platform-$(CONFIG_M68360) := 68360 platform-$(CONFIG_M5206) := 5206 platform-$(CONFIG_M5206e) := 5206e platform-$(CONFIG_M5249) := 5249 +platform-$(CONFIG_M527x) := 527x platform-$(CONFIG_M5272) := 5272 -platform-$(CONFIG_M5282) := 5282 +platform-$(CONFIG_M528x) := 528x platform-$(CONFIG_M5307) := 5307 platform-$(CONFIG_M5407) := 5407 PLATFORM := $(platform-y) @@ -28,12 +29,16 @@ board-$(CONFIG_UCQUICC) := uCquicc board-$(CONFIG_DRAGEN2) := de2 board-$(CONFIG_ARNEWSH) := ARNEWSH board-$(CONFIG_MOTOROLA) := MOTOROLA +board-$(CONFIG_M5271EVB) := M5271EVB +board-$(CONFIG_M5275EVB) := M5275EVB +board-$(CONFIG_M5282EVB) := M5282EVB board-$(CONFIG_ELITE) := eLITE board-$(CONFIG_eLIA) := eLIA board-$(CONFIG_NETtel) := NETtel board-$(CONFIG_SECUREEDGEMP3) := MP3 board-$(CONFIG_CLEOPATRA) := CLEOPATRA -board-$(CONFIG_senTec) := senTec +board-$(CONFIG_senTec) := senTec +board-$(CONFIG_SNEHA) := SNEHA BOARD := $(board-y) model-$(CONFIG_RAMKERNEL) := ram @@ -50,8 +55,9 @@ MODEL := $(model-y) cpuclass-$(CONFIG_M5206) := 5307 cpuclass-$(CONFIG_M5206e) := 5307 cpuclass-$(CONFIG_M5249) := 5307 +cpuclass-$(CONFIG_M527x) := 5307 cpuclass-$(CONFIG_M5272) := 5307 -cpuclass-$(CONFIG_M5282) := 5307 +cpuclass-$(CONFIG_M528x) := 5307 cpuclass-$(CONFIG_M5407) := 5307 cpuclass-$(CONFIG_M68EZ328) := 68328 cpuclass-$(CONFIG_M68VZ328) := 68328 @@ -69,8 +75,9 @@ export PLATFORM BOARD MODEL CPUCLASS cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200 cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200 cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200 +cflags-$(CONFIG_M527x) := -m5307 -Wa,-S -Wa,-m5307 cflags-$(CONFIG_M5272) := -m5307 -Wa,-S -Wa,-m5307 -cflags-$(CONFIG_M5282) := -m5307 -Wa,-S -Wa,-m5307 +cflags-$(CONFIG_M528x) := -m5307 -Wa,-S -Wa,-m5307 cflags-$(CONFIG_M5307) := -m5307 -Wa,-S -Wa,-m5307 cflags-$(CONFIG_M5407) := -m5200 -Wa,-S -Wa,-m5200 cflags-$(CONFIG_M68328) := -m68000 @@ -82,7 +89,7 @@ AFLAGS += $(cflags-y) CFLAGS += $(cflags-y) CFLAGS += -fno-builtin -CFLAGS += -O2 -g +CFLAGS += -O1 -g CFLAGS += -D__linux__ CFLAGS += -DUTS_SYSNAME=\"uClinux\" diff --git a/arch/m68knommu/defconfig b/arch/m68knommu/defconfig index b101057f0..e4bd31be9 100644 --- a/arch/m68knommu/defconfig +++ b/arch/m68knommu/defconfig @@ -35,8 +35,9 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_M5206 is not set # CONFIG_M5206e is not set # CONFIG_M5249 is not set +# CONFIG_M527x is not set CONFIG_M5272=y -# CONFIG_M5282 is not set +# CONFIG_M528x is not set # CONFIG_M5307 is not set # CONFIG_M5407 is not set CONFIG_COLDFIRE=y @@ -55,7 +56,10 @@ CONFIG_COLDFIRE=y # CONFIG_CLOCK_60MHz is not set CONFIG_CLOCK_66MHz=y # CONFIG_CLOCK_70MHz is not set +# CONFIG_CLOCK_100MHz is not set # CONFIG_CLOCK_140MHz is not set +# CONFIG_CLOCK_150MHz is not set +# CONFIG_CLOCK_166MHz is not set # # Platform diff --git a/arch/m68knommu/kernel/module.c b/arch/m68knommu/kernel/module.c index 8eb130e8b..3b1a2ff61 100644 --- a/arch/m68knommu/kernel/module.c +++ b/arch/m68knommu/kernel/module.c @@ -82,9 +82,38 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, unsigned int relsec, struct module *me) { - printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", - me->name); - return -ENOEXEC; + unsigned int i; + Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; + Elf32_Sym *sym; + uint32_t *location; + + DEBUGP("Applying relocate_add section %u to %u\n", relsec, + sechdrs[relsec].sh_info); + for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { + /* This is where to make the change */ + location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr + + rel[i].r_offset; + /* This is the symbol it is referring to. Note that all + undefined symbols have been resolved. */ + sym = (Elf32_Sym *)sechdrs[symindex].sh_addr + + ELF32_R_SYM(rel[i].r_info); + + switch (ELF32_R_TYPE(rel[i].r_info)) { + case R_68K_32: + /* We add the value into the location given */ + *location = rel[i].r_addend + sym->st_value; + break; + case R_68K_PC32: + /* Add the value, subtract its postition */ + *location = rel[i].r_addend + sym->st_value - (uint32_t)location; + break; + default: + printk(KERN_ERR "module %s: Unknown relocation: %u\n", + me->name, ELF32_R_TYPE(rel[i].r_info)); + return -ENOEXEC; + } + } + return 0; } int module_finalize(const Elf_Ehdr *hdr, diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c index b0901d817..2b6c9d32b 100644 --- a/arch/m68knommu/kernel/process.c +++ b/arch/m68knommu/kernel/process.c @@ -199,7 +199,7 @@ int copy_thread(int nr, unsigned long clone_flags, struct switch_stack * childstack, *stack; unsigned long stack_offset, *retp; - stack_offset = KTHREAD_SIZE - sizeof(struct pt_regs); + stack_offset = THREAD_SIZE - sizeof(struct pt_regs); childregs = (struct pt_regs *) ((unsigned long) p->thread_info + stack_offset); *childregs = *regs; @@ -342,7 +342,7 @@ void dump(struct pt_regs *fp) (int) current->mm->brk); printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n\n", (int) current->mm->start_stack, - (int)(((unsigned long) current) + KTHREAD_SIZE)); + (int)(((unsigned long) current) + THREAD_SIZE)); } printk(KERN_EMERG "PC: %08lx\n", fp->pc); diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c index 9276a052c..6eee84346 100644 --- a/arch/m68knommu/kernel/ptrace.c +++ b/arch/m68knommu/kernel/ptrace.c @@ -266,7 +266,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) long tmp; ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c index edcecd4d0..557238596 100644 --- a/arch/m68knommu/kernel/setup.c +++ b/arch/m68knommu/kernel/setup.c @@ -1,7 +1,7 @@ /* * linux/arch/m68knommu/kernel/setup.c * - * Copyright (C) 1999-2002 Greg Ungerer (gerg@snapgear.com) + * Copyright (C) 1999-2004 Greg Ungerer (gerg@snapgear.com) * Copyright (C) 1998,1999 D. Jeff Dionne * Copyleft ()) 2000 James D. Schettine {james@telos-systems.com} * Copyright (C) 1998 Kenneth Albanowski @@ -106,11 +106,14 @@ void (*mach_power_off)( void ) = NULL; #if defined(CONFIG_M5249) #define CPU "COLDFIRE(m5249)" #endif +#if defined(CONFIG_M527x) + #define CPU "COLDFIRE(m5270/5271/5274/5275)" +#endif #if defined(CONFIG_M5272) #define CPU "COLDFIRE(m5272)" #endif -#if defined(CONFIG_M5282) - #define CPU "COLDFIRE(m5282)" +#if defined(CONFIG_M528x) + #define CPU "COLDFIRE(m5280/5282)" #endif #if defined(CONFIG_M5307) #define CPU "COLDFIRE(m5307)" diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c index 0d5891567..c19722c5d 100644 --- a/arch/m68knommu/kernel/signal.c +++ b/arch/m68knommu/kernel/signal.c @@ -745,147 +745,44 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, * Note that 'init' is a special process: it doesn't get signals it doesn't * want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. - * - * Note that we go through the signals twice: once to check the signals - * that the kernel can handle, and then we build all the user-level signal - * handling stack-frames in one go after that. */ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) { + struct k_sigaction ka; siginfo_t info; - struct k_sigaction *ka; - - current->thread.esp0 = (unsigned long) regs; + int signr; + + /* + * We want the common case to go fast, which + * is why we may in certain cases get here from + * kernel mode. Just return without doing anything + * if so. + */ + if (!user_mode(regs)) + return 1; if (!oldset) oldset = ¤t->blocked; - for (;;) { - int signr; - - signr = get_signal_to_deliver(&info, regs, NULL); - - if (!signr) - break; - - if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { - current->exit_code = signr; - current->state = TASK_STOPPED; - regs->sr &= ~PS_T; - - /* Did we come from a system call? */ - if (regs->orig_d0 >= 0) { - /* Restart the system call the same way as - if the process were not traced. */ - struct k_sigaction *ka = - ¤t->sighand->action[signr-1]; - int has_handler = - (ka->sa.sa_handler != SIG_IGN && - ka->sa.sa_handler != SIG_DFL); - handle_restart(regs, ka, has_handler); - } - notify_parent(current, SIGCHLD); - schedule(); - - /* We're back. Did the debugger cancel the sig? */ - if (!(signr = current->exit_code)) { - discard_frame: - continue; - } - current->exit_code = 0; - - /* The debugger continued. Ignore SIGSTOP. */ - if (signr == SIGSTOP) - goto discard_frame; - - /* Update the siginfo structure. Is this good? */ - if (signr != info.si_signo) { - info.si_signo = signr; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->parent->pid; - info.si_uid = current->parent->uid; - } - - /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(¤t->blocked, signr)) { - send_sig_info(signr, &info, current); - continue; - } - } - - ka = ¤t->sighand->action[signr-1]; - if (ka->sa.sa_handler == SIG_IGN) { - if (signr != SIGCHLD) - continue; - /* Check for SIGCHLD: it's special. */ - while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - /* nothing */; - continue; - } - - if (ka->sa.sa_handler == SIG_DFL) { - int exit_code = signr; - - if (current->pid == 1) - continue; - - switch (signr) { - case SIGCONT: case SIGCHLD: - case SIGWINCH: case SIGURG: - continue; - - case SIGTSTP: case SIGTTIN: case SIGTTOU: - if (is_orphaned_pgrp(process_group(current))) - continue; - /* FALLTHRU */ - - case SIGSTOP: - current->state = TASK_STOPPED; - current->exit_code = signr; - if (!(current->parent->sighand->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) - notify_parent(current, SIGCHLD); - schedule(); - continue; - - case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGIOT: case SIGFPE: case SIGSEGV: - case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if (do_coredump(signr, exit_code, regs)) - exit_code |= 0x80; - /* FALLTHRU */ - - default: - sigaddset(¤t->pending.signal, signr); - recalc_sigpending(); - current->flags |= PF_SIGNALED; - do_exit(exit_code); - /* NOTREACHED */ - } - } - + signr = get_signal_to_deliver(&info, &ka, regs, NULL); + if (signr > 0) { /* Whee! Actually deliver the signal. */ - handle_signal(signr, ka, &info, oldset, regs); + handle_signal(signr, &ka, &info, oldset, regs); return 1; } /* Did we come from a system call? */ - if (regs->orig_d0 >= 0) + if (regs->orig_d0 >= 0) { /* Restart the system call - no handlers present */ - handle_restart(regs, NULL, 0); - - /* If we are about to discard some frame stuff we must copy - over the remaining frame. */ - if (regs->stkadj) { - struct pt_regs *tregs = - (struct pt_regs *) ((ulong) regs + regs->stkadj); - - /* This must be copied with decreasing addresses to - handle overlaps. */ - tregs->vector = 0; - tregs->format = 0; - tregs->pc = regs->pc; - tregs->sr = regs->sr; + if (regs->d0 == -ERESTARTNOHAND + || regs->d0 == -ERESTARTSYS + || regs->d0 == -ERESTARTNOINTR) { + regs->d0 = regs->orig_d0; + regs->pc -= 2; + } else if (regs->d0 == -ERESTART_RESTARTBLOCK) { + regs->d0 = __NR_restart_syscall; + regs->pc -= 2; + } } return 0; } diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 01a8c1d20..897deaa06 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S @@ -185,7 +185,7 @@ ENTRY(sys_call_table) .long sys_ni_syscall /* sys_mremap */ .long sys_setresuid16 .long sys_getresuid16 /* 165 */ - .long sys_ni_syscall /* for vm86 */ + .long sys_getpagesize /* sys_getpagesize */ .long sys_ni_syscall /* old "query_module" */ .long sys_poll .long sys_ni_syscall /* sys_nfsservctl */ @@ -237,42 +237,70 @@ ENTRY(sys_call_table) .long sys_setfsuid /* 215 */ .long sys_setfsgid .long sys_pivot_root - .long sys_ni_syscall /* sys_mincore */ - .long sys_ni_syscall /* sys_madvise */ - .long sys_getdents64 /* 220 */ - .long sys_fcntl64 - .long sys_ni_syscall /* reserved for TUX */ .long sys_ni_syscall + .long sys_ni_syscall + .long sys_getdents64 /* 220 */ .long sys_gettid - .long sys_ni_syscall /* 225 */ /* sys_readahead */ + .long sys_tkill .long sys_setxattr .long sys_lsetxattr - .long sys_fsetxattr + .long sys_fsetxattr /* 225 */ .long sys_getxattr - .long sys_lgetxattr /* 230 */ + .long sys_lgetxattr .long sys_fgetxattr .long sys_listxattr - .long sys_llistxattr + .long sys_llistxattr /* 230 */ .long sys_flistxattr - .long sys_removexattr /* 235 */ + .long sys_removexattr .long sys_lremovexattr .long sys_fremovexattr - .long sys_tkill + .long sys_futex /* 235 */ .long sys_sendfile64 - .long sys_futex /* 240 */ - .long sys_sched_setaffinity - .long sys_sched_getaffinity - .long sys_ni_syscall /* sys_set_thread_area */ - .long sys_ni_syscall /* sys_get_thread_area */ - .long sys_io_setup /* 245 */ + .long sys_ni_syscall /* sys_mincore */ + .long sys_ni_syscall /* sys_madvise */ + .long sys_fcntl64 + .long sys_readahead /* 240 */ + .long sys_io_setup .long sys_io_destroy .long sys_io_getevents .long sys_io_submit - .long sys_io_cancel - .long sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */ - .long sys_ni_syscall /* sys_freec_hugepages */ + .long sys_io_cancel /* 245 */ + .long sys_fadvise64 .long sys_exit_group .long sys_lookup_dcookie + .long sys_epoll_create + .long sys_epoll_ctl /* 250 */ + .long sys_epoll_wait + .long sys_ni_syscall /* sys_remap_file_pages */ + .long sys_set_tid_address + .long sys_timer_create + .long sys_timer_settime /* 255 */ + .long sys_timer_gettime + .long sys_timer_getoverrun + .long sys_timer_delete + .long sys_clock_settime + .long sys_clock_gettime /* 260 */ + .long sys_clock_getres + .long sys_clock_nanosleep + .long sys_statfs64 + .long sys_fstatfs64 + .long sys_tgkill /* 265 */ + .long sys_utimes + .long sys_fadvise64_64 + .long sys_mbind + .long sys_get_mempolicy + .long sys_set_mempolicy /* 270 */ + .long sys_mq_open + .long sys_mq_unlink + .long sys_mq_timedsend + .long sys_mq_timedreceive + .long sys_mq_notify /* 275 */ + .long sys_mq_getsetattr + .long sys_waitid + .long sys_ni_syscall /* sys_setaltroot */ + .long sys_ni_syscall /* sys_add_key */ + .long sys_ni_syscall /* 280 */ /* sys_request_key */ + .long sys_ni_syscall /* sys_keyctl */ .rept NR_syscalls-(.-sys_call_table)/4 .long sys_ni_syscall diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index e328f2810..5c3ca6716 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -57,6 +57,9 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) write_seqlock(&xtime_lock); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif if (current->pid) profile_tick(CPU_PROFILING, regs); diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S index 87f3bc407..31cb12892 100644 --- a/arch/m68knommu/kernel/vmlinux.lds.S +++ b/arch/m68knommu/kernel/vmlinux.lds.S @@ -1,7 +1,7 @@ /* * vmlinux.lds.S -- master linker script for m68knommu arch * - * (C) Copyright 2002-2003, Greg Ungerer + * (C) Copyright 2002-2004, Greg Ungerer * * This ends up looking compilcated, because of the number of * address variations for ram and rom/flash layouts. The real @@ -117,29 +117,28 @@ */ #if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \ defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \ - defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) + defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \ + defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB) #define RAM_START 0x20000 #define RAM_LENGTH 0x3e0000 #endif /* - * The senTec COBRA5272 board has nearly the same - * memory layout as the M5272C3. - * We assume 16MB ram. + * The senTec COBRA5272 board has nearly the same memory layout as + * the M5272C3. We assume 16MiB ram. */ #if defined(CONFIG_COBRA5272) #define RAM_START 0x20000 #define RAM_LENGTH 0xfe0000 #endif -#if defined(CONFIG_M5282C3) +#if defined(CONFIG_M5282EVB) #define RAM_START 0x10000 #define RAM_LENGTH 0x3f0000 #endif /* - * The senTec COBRA5282 board has the same - * memory layout as the M5282C3. + * The senTec COBRA5282 board has the same memory layout as the M5282EVB. */ #if defined(CONFIG_COBRA5282) #define RAM_START 0x10000 @@ -153,11 +152,22 @@ */ #if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ - defined(CONFIG_CLEOPATRA) + defined(CONFIG_HW_FEITH) #define RAM_START 0x400 #define RAM_LENGTH 0x3ffc00 #endif +/* + * Sneha Boards mimimun memmory + * The end of RAM will vary depending on how much ram is fitted, + * but this isn't important here, we assume at least 4MiB. + */ +#if defined(CONFIG_CPU16B) +#define RAM_START 0x20000 +#define RAM_LENGTH 0x3e0000 +#endif + + #if defined(CONFIG_RAMKERNEL) #define TEXT ram #define DATA ram @@ -247,6 +257,11 @@ SECTIONS { /* Kernel symbol table: strings */ *(__ksymtab_strings) + /* Built-in module parameters */ + __start___param = .; + *(__param) + __stop___param = .; + . = ALIGN(4) ; _etext = . ; } > TEXT @@ -303,7 +318,7 @@ SECTIONS { __initramfs_start = .; *(.init.ramfs) __initramfs_end = .; - . = ALIGN(4); + . = ALIGN(4096); __init_end = .; } > INIT diff --git a/arch/m68knommu/lib/Makefile b/arch/m68knommu/lib/Makefile index 0c734d9a7..e051a7913 100644 --- a/arch/m68knommu/lib/Makefile +++ b/arch/m68knommu/lib/Makefile @@ -4,4 +4,4 @@ lib-y := ashldi3.o ashrdi3.o lshrdi3.o \ muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \ - checksum.o semaphore.o memcpy.o memset.o + checksum.o semaphore.o memcpy.o memset.o delay.o diff --git a/arch/m68knommu/lib/checksum.c b/arch/m68knommu/lib/checksum.c index 94d335c95..7bec6fdee 100644 --- a/arch/m68knommu/lib/checksum.c +++ b/arch/m68knommu/lib/checksum.c @@ -31,6 +31,7 @@ /* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access kills, so most of the assembly has to go. */ +#include #include static inline unsigned short from32to16(unsigned long x) @@ -139,7 +140,8 @@ unsigned short ip_compute_csum(const unsigned char * buff, int len) */ unsigned int -csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) +csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, + int len, int sum, int *csum_err) { if (csum_err) *csum_err = 0; memcpy(dst, src, len); @@ -151,7 +153,7 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *c */ unsigned int -csum_partial_copy(const char *src, char *dst, int len, int sum) +csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, int sum) { memcpy(dst, src, len); return csum_partial(dst, len, sum); diff --git a/arch/m68knommu/lib/delay.c b/arch/m68knommu/lib/delay.c index 7bd4323dc..5bd5472d3 100644 --- a/arch/m68knommu/lib/delay.c +++ b/arch/m68knommu/lib/delay.c @@ -8,9 +8,12 @@ * published by the Free Software Foundation. */ +#include #include #include +EXPORT_SYMBOL(udelay); + void udelay(unsigned long usecs) { _udelay(usecs); diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c index ce33f2f0b..89f0b554f 100644 --- a/arch/m68knommu/mm/init.c +++ b/arch/m68knommu/mm/init.c @@ -38,7 +38,6 @@ #include #include #include -#include #undef DEBUG @@ -169,7 +168,7 @@ void mem_init(void) high_memory = (void *) end_mem; start_mem = PAGE_ALIGN(start_mem); - max_mapnr = num_physpages = MAP_NR(high_memory); + max_mapnr = num_physpages = (((unsigned long) high_memory) - PAGE_OFFSET) >> PAGE_SHIFT; /* this will put all memory onto the freelists */ totalram_pages = free_all_bootmem(); diff --git a/arch/m68knommu/mm/memory.c b/arch/m68knommu/mm/memory.c index 9ec7dfee5..0eef72915 100644 --- a/arch/m68knommu/mm/memory.c +++ b/arch/m68knommu/mm/memory.c @@ -24,7 +24,6 @@ #include #include #include -#include #include /* diff --git a/arch/m68knommu/platform/5206e/MOTOROLA/crt0_ram.S b/arch/m68knommu/platform/5206e/MOTOROLA/crt0_ram.S index fdb9392b5..2049f44fd 100644 --- a/arch/m68knommu/platform/5206e/MOTOROLA/crt0_ram.S +++ b/arch/m68knommu/platform/5206e/MOTOROLA/crt0_ram.S @@ -21,7 +21,6 @@ */ #define MEM_BASE 0x00000000 /* Memory base at address 0 */ -#define MEM_SIZE 0x00400000 /* Memory size 4Mb */ #define VBR_BASE MEM_BASE /* Vector address */ /*****************************************************************************/ @@ -78,9 +77,36 @@ _start: /* - * Set to 4 meg for the Cadre III board (m5206e). + * SDRAM size for the Cadre III board (m5206e). */ +#if defined(CONFIG_RAMAUTO) + movea.l #0x00000000,%a0 + move.l MCF_MBAR+MCFSIM_DCMR0,%d0 + and.l #0x00fe0000, %d0 + beq noaddr1 + add.l #0x00020000,%d0 + move.l %d0,%a0 +noaddr1: + move.l MCF_MBAR+MCFSIM_DCMR1,%d0 + and.l #0x00fe0000, %d0 + beq noaddr2 + add.l #0x00020000,%d0 + add.l %d0,%a0 +noaddr2: + +#else + +#if defined(CONFIG_RAM32MB) +#define MEM_SIZE 0x02000000 /* Memory size 32Mb */ +#elif defined(CONFIG_RAM16MB) +#define MEM_SIZE 0x01000000 /* Memory size 16Mb */ +#elif defined(CONFIG_RAM8MB) +#define MEM_SIZE 0x00800000 /* Memory size 8Mb */ +#else +#define MEM_SIZE 0x00400000 /* Memory size 4Mb */ +#endif move.l #MEM_SIZE, %a0 +#endif move.l %a0, %d0 /* Mem end addr is in a0 */ move.l %d0, %sp /* Set up initial stack ptr */ diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c index cd7c90446..f35b8606c 100644 --- a/arch/m68knommu/platform/5206e/config.c +++ b/arch/m68knommu/platform/5206e/config.c @@ -22,7 +22,6 @@ #include #include #include -#include /***************************************************************************/ diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index a1bed394d..289c1821b 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c @@ -21,7 +21,6 @@ #include #include #include -#include /***************************************************************************/ diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c index e325c19fb..a9e0dcee1 100644 --- a/arch/m68knommu/platform/5272/config.c +++ b/arch/m68knommu/platform/5272/config.c @@ -23,7 +23,6 @@ #include #include #include -#include /***************************************************************************/ @@ -110,7 +109,7 @@ void config_BSP(char *commandp, int size) #if defined(CONFIG_BOOTPARAM) strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); commandp[size-1] = 0; -#elif defined(CONFIG_NETtel) +#elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0004000, size); commandp[size-1] = 0; @@ -118,6 +117,10 @@ void config_BSP(char *commandp, int size) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xffe06000, size); commandp[size-1] = 0; +#elif defined(CONFIG_CANCam) + /* Copy command line from FLASH to local buffer... */ + memcpy(commandp, (char *) 0xf0010000, size); + commandp[size-1] = 0; #else memset(commandp, 0, size); #endif diff --git a/arch/m68knommu/platform/5307/Makefile b/arch/m68knommu/platform/5307/Makefile index 9959b838e..3f5461088 100644 --- a/arch/m68knommu/platform/5307/Makefile +++ b/arch/m68knommu/platform/5307/Makefile @@ -20,8 +20,10 @@ obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o obj-$(CONFIG_M5206) += timers.o obj-$(CONFIG_M5206e) += timers.o obj-$(CONFIG_M5249) += timers.o +obj-$(CONFIG_M527x) += pit.o obj-$(CONFIG_M5272) += timers.o obj-$(CONFIG_M5307) += config.o timers.o +obj-$(CONFIG_M528x) += pit.o obj-$(CONFIG_M5407) += timers.o ifeq ($(CONFIG_M5307),y) diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c index e816437f2..3f505dabf 100644 --- a/arch/m68knommu/platform/5307/config.c +++ b/arch/m68knommu/platform/5307/config.c @@ -23,7 +23,6 @@ #include #include #include -#include #include /***************************************************************************/ diff --git a/arch/m68knommu/platform/5307/vectors.c b/arch/m68knommu/platform/5307/vectors.c index 1f882ca21..ac313a160 100644 --- a/arch/m68knommu/platform/5307/vectors.c +++ b/arch/m68knommu/platform/5307/vectors.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include /***************************************************************************/ diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c index ef76b156d..f7c9018b8 100644 --- a/arch/m68knommu/platform/5407/config.c +++ b/arch/m68knommu/platform/5407/config.c @@ -23,7 +23,6 @@ #include #include #include -#include /***************************************************************************/ diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 03562f510..140da2afd 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -11,7 +11,7 @@ config MIPS64 only select this option if you have hardware that actually has a 64-bit processor and if your application will actually benefit from 64-bit processing, otherwise say N. You must say Y for kernels for - SGI IP27 (Origin 200 and 2000). If in doubt say N. + SGI IP27 (Origin 200 and 2000) and SGI IP32 (O2). If in doubt say N. config 64BIT def_bool MIPS64 @@ -29,6 +29,10 @@ menu "Machine selection" config MACH_JAZZ bool "Support for the Jazz family of machines" + select ARC + select ARC32 + select GENERIC_ISA_DMA + select I8259 select ISA help This a family of machines based on the MIPS R4030 chipset which was @@ -66,17 +70,24 @@ config OLIVETTI_M700 the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at . -config BAGET_MIPS - bool "Support for BAGET MIPS series (EXPERIMENTAL)" - depends on MIPS32 && EXPERIMENTAL - help - This enables support for the Baget, a Russian embedded system. For - more details about the Baget see the Linux/MIPS FAQ on - . - config MACH_VR41XX bool "Support for NEC VR41XX-based machines" +config NEC_CMBVR4133 + bool "Support for NEC CMB-VR4133" + depends on MACH_VR41XX + select CPU_VR41XX + select DMA_NONCOHERENT + select IRQ_CPU + select HW_HAS_PCI + select PCI_VR41XX + +config ROCKHOPPER + bool "Support for Rockhopper baseboard" + depends on NEC_CMBVR4133 + select I8259 + select HAVE_STD_PC_SERIAL_PORT + config CASIO_E55 bool "Support for CASIO CASSIOPEIA E-10/15/55/65" depends on MACH_VR41XX @@ -111,6 +122,10 @@ config TANBAC_TB0229 The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured by TANBAC. Please refer to about VR4131DIMM. +config TANBAC_TB0219 + bool "Added TANBAC TB0219 Base board support" + depends on TANBAC_TB0229 + config VICTOR_MPC30X bool "Support for Victor MP-C303/304" select DMA_NONCOHERENT @@ -146,16 +161,19 @@ config TOSHIBA_JMR3927 depends on MIPS32 select DMA_NONCOHERENT select HW_HAS_PCI + select SWAP_IO_SPACE config MIPS_COBALT bool "Support for Cobalt Server (EXPERIMENTAL)" depends on EXPERIMENTAL select DMA_NONCOHERENT select HW_HAS_PCI + select I8259 select IRQ_CPU config MACH_DECSTATION bool "Support for DECstations" + select BOOT_ELF32 select DMA_NONCOHERENT select IRQ_CPU depends on MIPS32 || EXPERIMENTAL @@ -179,6 +197,7 @@ config MIPS_EV64120 depends on EXPERIMENTAL select DMA_NONCOHERENT select HW_HAS_PCI + select MIPS_GT64120 help This is an evaluation board based on the Galileo GT-64120 single-chip system controller that contains a MIPS R5000 compatible @@ -198,6 +217,7 @@ config MIPS_EV96100 select IRQ_CPU select MIPS_GT96100 select RM7000_CPU_SCACHE + select SWAP_IO_SPACE help This is an evaluation board based on the Galileo GT-96100 LAN/WAN communications controllers containing a MIPS R5000 compatible core @@ -219,6 +239,7 @@ config LASAT bool "Support for LASAT Networks platforms" select DMA_NONCOHERENT select HW_HAS_PCI + select MIPS_GT64120 select R5000_CPU_SCACHE config PICVUE @@ -237,13 +258,6 @@ config LASAT_SYSCTL bool "LASAT sysctl interface" depends on LASAT -config HP_LASERJET - bool "Support for Hewlett Packard LaserJet board" - depends on BROKEN - select DMA_NONCOHERENT - select HW_HAS_PCI - select IRQ_CPU - config MIPS_ITE8172 bool "Support for ITE 8172G board" select DMA_NONCOHERENT @@ -266,17 +280,25 @@ config IT8172_REVC config MIPS_ATLAS bool "Support for MIPS Atlas board" + select BOOT_ELF32 select DMA_NONCOHERENT select HW_HAS_PCI + select MIPS_GT64120 + select SWAP_IO_SPACE help This enables support for the QED R5231-based MIPS Atlas evaluation board. config MIPS_MALTA bool "Support for MIPS Malta board" + select BOOT_ELF32 select HAVE_STD_PC_SERIAL_PORT select DMA_NONCOHERENT + select GENERIC_ISA_DMA select HW_HAS_PCI + select I8259 + select MIPS_GT64120 + select SWAP_IO_SPACE help This enables support for the VR5000-based MIPS Malta evaluation board. @@ -293,7 +315,9 @@ config MOMENCO_OCELOT select HW_HAS_PCI select IRQ_CPU select IRQ_CPU_RM7K + select MIPS_GT64120 select RM7000_CPU_SCACHE + select SWAP_IO_SPACE help The Ocelot is a MIPS-based Single Board Computer (SBC) made by Momentum Computer . @@ -306,6 +330,7 @@ config MOMENCO_OCELOT_G select IRQ_CPU_RM7K select PCI_MARVELL select RM7000_CPU_SCACHE + select SWAP_IO_SPACE help The Ocelot is a MIPS-based Single Board Computer (SBC) made by Momentum Computer . @@ -318,12 +343,29 @@ config MOMENCO_OCELOT_C select IRQ_MV64340 select PCI_MARVELL select RM7000_CPU_SCACHE + select SWAP_IO_SPACE help The Ocelot is a MIPS-based Single Board Computer (SBC) made by Momentum Computer . +config MOMENCO_OCELOT_3 + bool "Support for Momentum Ocelot-3 board" + select BOOT_ELF32 + select DMA_NONCOHERENT + select HW_HAS_PCI + select IRQ_CPU + select IRQ_CPU_RM7K + select IRQ_MV64340 + select PCI_MARVELL + select RM7000_CPU_SCACHE + select SWAP_IO_SPACE + help + The Ocelot-3 is based off Discovery III System Controller and + PMC-Sierra Rm79000 core. + config MOMENCO_JAGUAR_ATX bool "Support for Momentum Jaguar board" + select BOOT_ELF32 select DMA_NONCOHERENT select HW_HAS_PCI select IRQ_CPU @@ -332,6 +374,7 @@ config MOMENCO_JAGUAR_ATX select LIMITED_DMA select PCI_MARVELL select RM7000_CPU_SCACHE + select SWAP_IO_SPACE help The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by Momentum Computer . @@ -349,6 +392,8 @@ config PMC_YOSEMITE select HW_HAS_PCI select IRQ_CPU select IRQ_CPU_RM7K + select IRQ_CPU_RM9K + select SWAP_IO_SPACE help Yosemite is an evaluation board for the RM9000x2 processor manufactured by PMC-Sierra @@ -364,6 +409,7 @@ config DDB5074 select HAVE_STD_PC_SERIAL_PORT select HW_HAS_PCI select IRQ_CPU + select I8259 select ISA help This enables support for the VR5000-based NEC DDB Vrc-5074 @@ -375,6 +421,7 @@ config DDB5476 select HAVE_STD_PC_SERIAL_PORT select HW_HAS_PCI select IRQ_CPU + select I8259 select ISA help This enables support for the R5432-based NEC DDB Vrc-5476 @@ -388,6 +435,7 @@ config DDB5477 bool "Support for NEC DDB Vrc-5477" select DMA_NONCOHERENT select HW_HAS_PCI + select I8259 select IRQ_CPU help This enables support for the R5432-based NEC DDB Vrc-5477, @@ -408,9 +456,13 @@ config NEC_OSPREY config SGI_IP22 bool "Support for SGI IP22 (Indy/Indigo2)" + select ARC + select ARC32 + select BOOT_ELF32 select DMA_NONCOHERENT select IP22_CPU_SCACHE select IRQ_CPU + select SWAP_IO_SPACE help This are the SGI Indy, Challenge S and Indigo2, as well as certain OEM variants like the Tandem CMN B006S. To compile a Linux kernel @@ -419,8 +471,11 @@ config SGI_IP22 config SGI_IP27 bool "Support for SGI IP27 (Origin200/2000)" depends on MIPS64 + select ARC + select ARC64 select DMA_IP27 select HW_HAS_PCI + select PCI_DOMAINS help This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics workstations. To compile a Linux kernel that runs on these, say Y @@ -462,9 +517,9 @@ config MAPPED_KERNEL bool "Mapped kernel support" depends on SGI_IP27 help - Change the way a Linux kernel is loaded unto memory on a MIPS64 + Change the way a Linux kernel is loaded into memory on a MIPS64 machine. This is required in order to support text replication and - NUMA. If you need to undersatand it, read the source code. + NUMA. If you need to understand it, read the source code. config REPLICATE_KTEXT bool "Kernel text replication support" @@ -483,7 +538,12 @@ config REPLICATE_EXHANDLERS config SGI_IP32 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on MIPS64 && EXPERIMENTAL + select ARC + select ARC32 + select BOOT_ELF32 + select OWN_DMA + select DMA_IP32 select DMA_NONCOHERENT select HW_HAS_PCI select R5000_CPU_SCACHE @@ -498,55 +558,58 @@ config SOC_AU1X00 choice prompt "Au1X00 SOC Type" depends on SOC_AU1X00 - help - Say Y here to enable support for one of three AMD/Alchemy - SOCs. For additional documentation see www.amd.com. + help + Say Y here to enable support for one of three AMD/Alchemy + SOCs. For additional documentation see www.amd.com. config SOC_AU1000 - bool "SOC_AU1000" + bool "SOC_AU1000" config SOC_AU1100 - bool "SOC_AU1100" + bool "SOC_AU1100" config SOC_AU1500 - bool "SOC_AU1500" + bool "SOC_AU1500" config SOC_AU1550 - bool "SOC_AU1550" + bool "SOC_AU1550" endchoice choice - prompt "AMD/Alchemy Au1x00 board support" - depends on SOC_AU1X00 + prompt "AMD/Alchemy Au1x00 board support" + depends on SOC_AU1X00 help These are evaluation boards built by AMD/Alchemy to showcase their Au1X00 Internet Edge Processors. The SOC design is based on the MIPS32 architecture running at 266/400/500MHz - with many integrated peripherals. Further information can be - found at their website, . Say Y here if you - wish to build a kernel for this platform. + with many integrated peripherals. Further information can be + found at their website, . Say Y here if you + wish to build a kernel for this platform. config MIPS_PB1000 bool "PB1000 board" depends on SOC_AU1000 select DMA_NONCOHERENT select HW_HAS_PCI + select SWAP_IO_SPACE config MIPS_PB1100 bool "PB1100 board" depends on SOC_AU1100 select DMA_NONCOHERENT select HW_HAS_PCI + select SWAP_IO_SPACE config MIPS_PB1500 bool "PB1500 board" depends on SOC_AU1500 - select DMA_NONCOHERENT + select DMA_COHERENT select HW_HAS_PCI config MIPS_PB1550 bool "PB1550 board" depends on SOC_AU1550 - select DMA_NONCOHERENT + select DMA_COHERENT select HW_HAS_PCI + select MIPS_DISABLE_OBSOLETE_IDE config MIPS_DB1000 bool "DB1000 board" @@ -562,13 +625,16 @@ config MIPS_DB1100 config MIPS_DB1500 bool "DB1500 board" depends on SOC_AU1500 - select DMA_NONCOHERENT + select DMA_COHERENT select HW_HAS_PCI + select MIPS_DISABLE_OBSOLETE_IDE config MIPS_DB1550 bool "DB1550 board" depends on SOC_AU1550 select HW_HAS_PCI + select DMA_COHERENT + select MIPS_DISABLE_OBSOLETE_IDE config MIPS_BOSPORUS bool "Bosporus board" @@ -588,6 +654,7 @@ config MIPS_XXS1500 config MIPS_MTX1 bool "4G Systems MTX-1 board" depends on SOC_AU1500 + select HW_HAS_PCI select DMA_NONCOHERENT endchoice @@ -595,7 +662,9 @@ endchoice config SIBYTE_SB1xxx_SOC bool "Support for Broadcom BCM1xxx SOCs (EXPERIMENTAL)" depends on EXPERIMENTAL + select BOOT_ELF32 select DMA_COHERENT + select SWAP_IO_SPACE choice prompt "BCM1xxx SOC-based board" @@ -704,6 +773,7 @@ choice config CPU_SB1_PASS_1 bool "1250 Pass1" depends on SIBYTE_SB1250 + select CPU_HAS_PREFETCH config CPU_SB1_PASS_2_1250 bool "1250 An" @@ -715,12 +785,14 @@ config CPU_SB1_PASS_2_1250 config CPU_SB1_PASS_2_2 bool "1250 Bn" depends on SIBYTE_SB1250 + select CPU_HAS_PREFETCH help Also called BCM1250 Pass 2.2 config CPU_SB1_PASS_4 bool "1250 Cn" depends on SIBYTE_SB1250 + select CPU_HAS_PREFETCH help Also called BCM1250 Pass 3 @@ -732,6 +804,7 @@ config CPU_SB1_PASS_2_112x config CPU_SB1_PASS_3 bool "112x An" depends on SIBYTE_BCM112X + select CPU_HAS_PREFETCH endchoice @@ -802,9 +875,14 @@ config SIBYTE_TBPROF config SNI_RM200_PCI bool "Support for SNI RM200 PCI" + select ARC + select ARC32 + select BOOT_ELF32 select DMA_NONCOHERENT + select GENERIC_ISA_DMA select HAVE_STD_PC_SERIAL_PORT select HW_HAS_PCI + select I8259 select ISA help The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens @@ -816,8 +894,18 @@ config TOSHIBA_RBTX4927 bool "Support for Toshiba TBTX49[23]7 board" depends on MIPS32 select DMA_NONCOHERENT + select HAS_TXX9_SERIAL select HW_HAS_PCI + select I8259 select ISA + select SWAP_IO_SPACE + help + This Toshiba board is based on the TX4927 processor. Say Y here to + support this machine type + +config TOSHIBA_FPCIB0 + bool "FPCIB0 Backplane Support" + depends on TOSHIBA_RBTX4927 config RWSEM_GENERIC_SPINLOCK bool @@ -826,6 +914,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config HAVE_DEC_LOCK bool default y @@ -881,10 +973,13 @@ config MIPS_NILE4 depends on LASAT default y +config MIPS_DISABLE_OBSOLETE_IDE + bool + config CPU_LITTLE_ENDIAN bool "Generate little endian code" - default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || HP_LASERJET || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA - default n if BAGET_MIPS || MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927 + default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA + default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927 help Some MIPS machines can be configured for either little or big endian byte order. These modes require different kernels. Say Y if your @@ -922,6 +1017,7 @@ config MIPS_GT64120 config MIPS_TX3927 bool depends on TOSHIBA_JMR3927 + select HAS_TXX9_SERIAL default y config PCI_MARVELL @@ -934,8 +1030,6 @@ config ITE_BOARD_GEN config SWAP_IO_SPACE bool - depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 || SIBYTE_SB1xxx_SOC || SGI_IP22 || MOMENCO_OCELOT_C || MOMENCO_OCELOT_G || MOMENCO_OCELOT || MOMENCO_JAGUAR_ATX || MIPS_MALTA || MIPS_ATLAS || MIPS_EV96100 || MIPS_PB1100 || MIPS_PB1000 - default y # # Unfortunately not all GT64120 systems run the chip at the same clock. @@ -959,7 +1053,7 @@ config SYSCLK_100 endchoice -config AU1000_USB_DEVICE +config AU1X00_USB_DEVICE bool depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 default n @@ -984,7 +1078,7 @@ config IT8712 config BOOT_ELF32 bool - depends on MACH_DECSTATION || MIPS_ATLAS || MIPS_MALTA || MOMENCO_JAGUAR_ATX || SIBYTE_SB1xxx_SOC || SGI_IP32 || SGI_IP22 || SNI_RM200_PCI + depends on MACH_DECSTATION || MIPS_ATLAS || MIPS_MALTA || MOMENCO_JAGUAR_ATX || MOMENCO_OCELOT_3 || SIBYTE_SB1xxx_SOC || SGI_IP32 || SGI_IP22 || SNI_RM200_PCI default y config MIPS_L1_CACHE_SHIFT @@ -1033,11 +1127,6 @@ config FB (e.g. an accelerated X server) and that are not frame buffer device-aware may cause unexpected results. If unsure, say N. -config FB_G364 - bool - depends on MIPS_MAGNUM_4000 || OLIVETTI_M700 - default y - config HAVE_STD_PC_SERIAL_PORT bool @@ -1085,10 +1174,6 @@ config TOSHIBA_BOARDS depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 default y -config TANBAC_TB0219 - bool "Added TANBAC TB0219 Base board support" - depends on TANBAC_TB0229 - endmenu menu "CPU selection" @@ -1156,9 +1241,9 @@ config CPU_R6000 processors are extremly rare and the support for them is incomplete. config CPU_NEVADA - bool "R52xx" + bool "RM52xx" help - MIPS Technologies R52x0-series ("Nevada") processors. + QED / PMC-Sierra RM52xx-series ("Nevada") processors. config CPU_R8000 bool "R8000" @@ -1333,7 +1418,7 @@ config CPU_HAS_SYNC # config HIGHMEM bool "High Memory Support" - depends on MIPS32 && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(BAGET_MIPS || MACH_DECSTATION || MOMENCO_JAGUAR_ATX) + depends on MIPS32 && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(MACH_DECSTATION || MOMENCO_JAGUAR_ATX) config SMP bool "Multi-Processing support" @@ -1420,6 +1505,10 @@ config PCI information about which PCI hardware does work under Linux and which doesn't. +config PCI_DOMAINS + bool + depends on PCI + source "drivers/pci/Kconfig" # @@ -1486,9 +1575,24 @@ config TRAD_SIGNALS bool default y if MIPS32 +config BUILD_ELF64 + bool "Use 64-bit ELF format for building" + depends on MIPS64 + help + A 64-bit kernel is usually built using the 64-bit ELF binary object + format as it's one that allows arbitrary 64-bit constructs. For + kernels that are loaded within the KSEG compatibility segments the + 32-bit ELF format can optionally be used resulting in a somewhat + smaller binary, but this option is not explicitly supported by the + toolchain and since binutils 2.14 it does not even work at all. + + Say Y to use the 64-bit format or N to use the 32-bit one. + + If unsure say Y. + config BINFMT_IRIX bool "Include IRIX binary compatibility" - depends on !CPU_LITTLE_ENDIAN && MIPS32 + depends on !CPU_LITTLE_ENDIAN && MIPS32 && BROKEN config MIPS32_COMPAT bool "Kernel support for Linux/MIPS 32-bit binary compatibility" @@ -1534,24 +1638,6 @@ config PM endmenu -menu "MIPS initrd options" - depends on BLK_DEV_INITRD - -config EMBEDDED_RAMDISK - bool "Embed root filesystem ramdisk into the kernel" - -config EMBEDDED_RAMDISK_IMAGE - string "Filename of gziped ramdisk image" - depends on EMBEDDED_RAMDISK - default "ramdisk.gz" - help - This is the filename of the ramdisk image to be built into the - kernel. Relative pathnames are relative to arch/mips/ramdisk/. - The ramdisk image is not part of the kernel distribution; you must - provide one yourself. - -endmenu - source "drivers/Kconfig" source "fs/Kconfig" @@ -1565,3 +1651,14 @@ source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" + +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + +config GENERIC_IRQ_PROBE + bool + default y diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 5025c01b9..bc1c44274 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -5,13 +5,19 @@ # # Copyright (C) 1994, 95, 96, 2003 by Ralf Baechle # DECStation modifications by Paul M. Antoine, 1996 -# Copyright (C) 2002, 2003 Maciej W. Rozycki +# Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions # for "archclean" cleaning up for this architecture. # +as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \ + -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \ + else echo "$(2)"; fi ;) + +cflags-y := + # # Select the object file format to substitute into the linker script. # @@ -20,22 +26,24 @@ ifdef CONFIG_CPU_LITTLE_ENDIAN 64bit-tool-prefix = mips64el-linux- 32bit-bfd = elf32-tradlittlemips 64bit-bfd = elf64-tradlittlemips +32bit-emul = elf32ltsmip +64bit-emul = elf64ltsmip else 32bit-tool-prefix = mips-linux- 64bit-tool-prefix = mips64-linux- 32bit-bfd = elf32-tradbigmips 64bit-bfd = elf64-tradbigmips +32bit-emul = elf32btsmip +64bit-emul = elf64btsmip endif ifdef CONFIG_MIPS32 gcc-abi = 32 -gas-abi = 32 tool-prefix = $(32bit-tool-prefix) UTS_MACHINE := mips endif ifdef CONFIG_MIPS64 gcc-abi = 64 -gas-abi = 32 tool-prefix = $(64bit-tool-prefix) UTS_MACHINE := mips64 endif @@ -44,6 +52,20 @@ ifdef CONFIG_CROSSCOMPILE CROSS_COMPILE := $(tool-prefix) endif +ifdef CONFIG_BUILD_ELF64 +gas-abi = 64 +ld-emul = $(64bit-emul) +vmlinux-32 = vmlinux.32 +vmlinux-64 = vmlinux +else +gas-abi = 32 +ld-emul = $(32bit-emul) +vmlinux-32 = vmlinux +vmlinux-64 = vmlinux.64 + +cflags-$(CONFIG_MIPS64) += $(call cc-option,-mno-explicit-relocs) +endif + # # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel # code since it only slows down the whole thing. At some point we might make @@ -54,7 +76,7 @@ endif # machines may also. Since BFD is incredibly buggy with respect to # crossformat linking we rely on the elf2ecoff tool for format conversion. # -cflags-y := -I $(TOPDIR)/include/asm/gcc +cflags-y += -I $(TOPDIR)/include/asm/gcc cflags-y += -G 0 -mno-abicalls -fno-pic -pipe cflags-y += $(call cc-option, -finline-limit=100000) LDFLAGS_vmlinux += -G 0 -static -n @@ -141,6 +163,10 @@ cflags-$(CONFIG_CPU_R4X00) += \ $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \ -Wa,--trap +cflags-$(CONFIG_CPU_TX49XX) += \ + $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \ + -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32) += \ $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \ -Wa,--trap @@ -188,14 +214,6 @@ MODFLAGS += -msb1-pass1-workarounds endif endif -# -# ramdisk/initrd support -# You need a compressed ramdisk image, named -# CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames -# are relative to arch/mips/ramdisk/. -# -core-$(CONFIG_EMBEDDED_RAMDISK) += arch/mips/ramdisk/ - # # Firmware support # @@ -211,7 +229,7 @@ libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/ # core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ cflags-$(CONFIG_MACH_JAZZ) += -Iinclude/asm-mips/mach-jazz -load-$(CONFIG_MACH_JAZZ) += 0x80080000 +load-$(CONFIG_MACH_JAZZ) += 0xffffffff80080000 # # Common Alchemy Au1x00 stuff @@ -224,87 +242,88 @@ cflags-$(CONFIG_SOC_AU1X00) += -Iinclude/asm-mips/mach-au1x00 # libs-$(CONFIG_MIPS_PB1000) += arch/mips/au1000/pb1000/ cflags-$(CONFIG_MIPS_PB1000) += -Iinclude/asm-mips/mach-pb1x00 -load-$(CONFIG_MIPS_PB1000) += 0x80100000 +load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000 # # AMD Alchemy Pb1100 eval board # libs-$(CONFIG_MIPS_PB1100) += arch/mips/au1000/pb1100/ cflags-$(CONFIG_MIPS_PB1100) += -Iinclude/asm-mips/mach-pb1x00 -load-$(CONFIG_MIPS_PB1100) += 0x80100000 +load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000 # # AMD Alchemy Pb1500 eval board # libs-$(CONFIG_MIPS_PB1500) += arch/mips/au1000/pb1500/ cflags-$(CONFIG_MIPS_PB1500) += -Iinclude/asm-mips/mach-pb1x00 -load-$(CONFIG_MIPS_PB1500) += 0x80100000 +load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000 # # AMD Alchemy Pb1550 eval board # libs-$(CONFIG_MIPS_PB1550) += arch/mips/au1000/pb1550/ cflags-$(CONFIG_MIPS_PB1550) += -Iinclude/asm-mips/mach-pb1x00 -load-$(CONFIG_MIPS_PB1550) += 0x80100000 +load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000 # # AMD Alchemy Db1000 eval board # libs-$(CONFIG_MIPS_DB1000) += arch/mips/au1000/db1x00/ cflags-$(CONFIG_MIPS_DB1000) += -Iinclude/asm-mips/mach-db1x00 -load-$(CONFIG_MIPS_DB1000) += 0x80100000 +load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 # # AMD Alchemy Db1100 eval board # libs-$(CONFIG_MIPS_DB1100) += arch/mips/au1000/db1x00/ cflags-$(CONFIG_MIPS_DB1100) += -Iinclude/asm-mips/mach-db1x00 -load-$(CONFIG_MIPS_DB1100) += 0x80100000 +load-$(CONFIG_MIPS_DB1100) += 0xffffffff80100000 # # AMD Alchemy Db1500 eval board # libs-$(CONFIG_MIPS_DB1500) += arch/mips/au1000/db1x00/ cflags-$(CONFIG_MIPS_DB1500) += -Iinclude/asm-mips/mach-db1x00 -load-$(CONFIG_MIPS_DB1500) += 0x80100000 +load-$(CONFIG_MIPS_DB1500) += 0xffffffff80100000 + +# +# AMD Alchemy Db1550 eval board +# +libs-$(CONFIG_MIPS_DB1550) += arch/mips/au1000/db1x00/ +cflags-$(CONFIG_MIPS_DB1550) += -Iinclude/asm-mips/mach-db1x00 +load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 # # AMD Alchemy Bosporus eval board # libs-$(CONFIG_MIPS_BOSPORUS) += arch/mips/au1000/db1x00/ cflags-$(CONFIG_MIPS_BOSPORUS) += -Iinclude/asm-mips/mach-db1x00 -load-$(CONFIG_MIPS_BOSPORUS) += 0x80100000 +load-$(CONFIG_MIPS_BOSPORUS) += 0xffffffff80100000 # # AMD Alchemy Mirage eval board # libs-$(CONFIG_MIPS_MIRAGE) += arch/mips/au1000/db1x00/ cflags-$(CONFIG_MIPS_MIRAGE) += -Iinclude/asm-mips/mach-db1x00 -load-$(CONFIG_MIPS_MIRAGE) += 0x80100000 +load-$(CONFIG_MIPS_MIRAGE) += 0xffffffff80100000 # # 4G-Systems eval board # libs-$(CONFIG_MIPS_MTX1) += arch/mips/au1000/mtx-1/ -load-$(CONFIG_MIPS_MTX1) += 0x80100000 +load-$(CONFIG_MIPS_MTX1) += 0xffffffff80100000 # # MyCable eval board # libs-$(CONFIG_MIPS_XXS1500) += arch/mips/au1000/xxs1500/ -load-$(CONFIG_MIPS_XXS1500) += 0x80100000 - -# -# Baget/MIPS -# -libs-$(CONFIG_BAGET_MIPS) += arch/mips/baget/ arch/mips/baget/prom/ -load-$(CONFIG_BAGET_MIPS) += 0x80001000 +load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 # # Cobalt Server # core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ -load-$(CONFIG_MIPS_COBALT) += 0x80080000 +load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000 # # DECstation family @@ -312,7 +331,7 @@ load-$(CONFIG_MIPS_COBALT) += 0x80080000 core-$(CONFIG_MACH_DECSTATION) += arch/mips/dec/ cflags-$(CONFIG_MACH_DECSTATION)+= -Iinclude/asm-mips/mach-dec libs-$(CONFIG_MACH_DECSTATION) += arch/mips/dec/prom/ -load-$(CONFIG_MACH_DECSTATION) += 0x80040000 +load-$(CONFIG_MACH_DECSTATION) += 0xffffffff80040000 CLEAN_FILES += drivers/tc/lk201-map.c # @@ -321,33 +340,27 @@ CLEAN_FILES += drivers/tc/lk201-map.c core-$(CONFIG_MIPS_EV64120) += arch/mips/gt64120/ev64120/ core-$(CONFIG_MIPS_EV64120) += arch/mips/gt64120/common/ cflags-$(CONFIG_MIPS_EV64120) += -Iinclude/asm-mips/mach-ev64120 -load-$(CONFIG_MIPS_EV64120) += 0x80100000 +load-$(CONFIG_MIPS_EV64120) += 0xffffffff80100000 # # Galileo EV96100 Board # core-$(CONFIG_MIPS_EV96100) += arch/mips/galileo-boards/ev96100/ cflags-$(CONFIG_MIPS_EV96100) += -Iinclude/asm-mips/mach-ev96100 -load-$(CONFIG_MIPS_EV96100) += 0x80100000 +load-$(CONFIG_MIPS_EV96100) += 0xffffffff80100000 # # Globespan IVR eval board with QED 5231 CPU # core-$(CONFIG_ITE_BOARD_GEN) += arch/mips/ite-boards/generic/ core-$(CONFIG_MIPS_IVR) += arch/mips/ite-boards/ivr/ -load-$(CONFIG_MIPS_IVR) += 0x80100000 - -# -# HP LaserJet -# -core-$(CONFIG_HP_LASERJET) += arch/mips/hp-lj/ -load-$(CONFIG_HP_LASERJET) += 0x80030000 +load-$(CONFIG_MIPS_IVR) += 0xffffffff80100000 # # ITE 8172 eval board with QED 5231 CPU # core-$(CONFIG_MIPS_ITE8172) += arch/mips/ite-boards/qed-4n-s01b/ -load-$(CONFIG_MIPS_ITE8172) += 0x80100000 +load-$(CONFIG_MIPS_ITE8172) += 0xffffffff80100000 # # For all MIPS, Inc. eval boards @@ -360,20 +373,20 @@ core-$(CONFIG_MIPS_BOARDS_GEN) += arch/mips/mips-boards/generic/ core-$(CONFIG_MIPS_ATLAS) += arch/mips/mips-boards/atlas/ cflags-$(CONFIG_MIPS_ATLAS) += -Iinclude/asm-mips/mach-atlas cflags-$(CONFIG_MIPS_ATLAS) += -Iinclude/asm-mips/mach-mips -load-$(CONFIG_MIPS_ATLAS) += 0x80100000 +load-$(CONFIG_MIPS_ATLAS) += 0xffffffff80100000 # # MIPS Malta board # core-$(CONFIG_MIPS_MALTA) += arch/mips/mips-boards/malta/ cflags-$(CONFIG_MIPS_MALTA) += -Iinclude/asm-mips/mach-mips -load-$(CONFIG_MIPS_MALTA) += 0x80100000 +load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 # # MIPS SEAD board # core-$(CONFIG_MIPS_SEAD) += arch/mips/mips-boards/sead/ -load-$(CONFIG_MIPS_SEAD) += 0x80100000 +load-$(CONFIG_MIPS_SEAD) += 0xffffffff80100000 # # Momentum Ocelot board @@ -384,7 +397,7 @@ load-$(CONFIG_MIPS_SEAD) += 0x80100000 core-$(CONFIG_MOMENCO_OCELOT) += arch/mips/gt64120/common/ \ arch/mips/gt64120/momenco_ocelot/ cflags-$(CONFIG_MOMENCO_OCELOT) += -Iinclude/asm-mips/mach-ocelot -load-$(CONFIG_MOMENCO_OCELOT) += 0x80100000 +load-$(CONFIG_MOMENCO_OCELOT) += 0xffffffff80100000 # # Momentum Ocelot-G board @@ -393,7 +406,7 @@ load-$(CONFIG_MOMENCO_OCELOT) += 0x80100000 # mips_io_port_base. # core-$(CONFIG_MOMENCO_OCELOT_G) += arch/mips/momentum/ocelot_g/ -load-$(CONFIG_MOMENCO_OCELOT_G) += 0x80100000 +load-$(CONFIG_MOMENCO_OCELOT_G) += 0xffffffff80100000 # # Momentum Ocelot-C and -CS boards @@ -401,14 +414,21 @@ load-$(CONFIG_MOMENCO_OCELOT_G) += 0x80100000 # The Ocelot-C[S] setup.o must be linked early - it does the ioremap() for the # mips_io_port_base. core-$(CONFIG_MOMENCO_OCELOT_C) += arch/mips/momentum/ocelot_c/ -load-$(CONFIG_MOMENCO_OCELOT_C) += 0x80100000 +load-$(CONFIG_MOMENCO_OCELOT_C) += 0xffffffff80100000 # # PMC-Sierra Yosemite # core-$(CONFIG_PMC_YOSEMITE) += arch/mips/pmc-sierra/yosemite/ cflags-$(CONFIG_PMC_YOSEMITE) += -Iinclude/asm-mips/mach-yosemite -load-$(CONFIG_PMC_YOSEMITE) += 0x80100000 +load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000 + +# +# Momentum Ocelot-3 +# +core-$(CONFIG_MOMENCO_OCELOT_3) += arch/mips/momentum/ocelot_3/ +cflags-$(CONFIG_MOMENCO_OCELOT_3) += -Iinclude/asm-mips/mach-ocelot3 +load-$(CONFIG_MOMENCO_OCELOT_3) += 0xffffffff80100000 # # Momentum Jaguar ATX @@ -416,9 +436,9 @@ load-$(CONFIG_PMC_YOSEMITE) += 0x80100000 core-$(CONFIG_MOMENCO_JAGUAR_ATX) += arch/mips/momentum/jaguar_atx/ cflags-$(CONFIG_MOMENCO_JAGUAR_ATX) += -Iinclude/asm-mips/mach-ja #ifdef CONFIG_JAGUAR_DMALOW -#load-$(CONFIG_MOMENCO_JAGUAR_ATX) += 0x88000000 +#load-$(CONFIG_MOMENCO_JAGUAR_ATX) += 0xffffffff88000000 #else -load-$(CONFIG_MOMENCO_JAGUAR_ATX) += 0x80100000 +load-$(CONFIG_MOMENCO_JAGUAR_ATX) += 0xffffffff80100000 #endif # @@ -430,30 +450,30 @@ core-$(CONFIG_DDB5XXX_COMMON) += arch/mips/ddb5xxx/common/ # NEC DDB Vrc-5074 # core-$(CONFIG_DDB5074) += arch/mips/ddb5xxx/ddb5074/ -load-$(CONFIG_DDB5074) += 0x80080000 +load-$(CONFIG_DDB5074) += 0xffffffff80080000 # # NEC DDB Vrc-5476 # core-$(CONFIG_DDB5476) += arch/mips/ddb5xxx/ddb5476/ -load-$(CONFIG_DDB5476) += 0x80080000 +load-$(CONFIG_DDB5476) += 0xffffffff80080000 # # NEC DDB Vrc-5477 # core-$(CONFIG_DDB5477) += arch/mips/ddb5xxx/ddb5477/ -load-$(CONFIG_DDB5477) += 0x80100000 +load-$(CONFIG_DDB5477) += 0xffffffff80100000 core-$(CONFIG_LASAT) += arch/mips/lasat/ cflags-$(CONFIG_LASAT) += -Iinclude/asm-mips/mach-lasat -load-$(CONFIG_LASAT) += 0x80000000 +load-$(CONFIG_LASAT) += 0xffffffff80000000 # # NEC Osprey (vr4181) board # core-$(CONFIG_NEC_OSPREY) += arch/mips/vr4181/common/ \ arch/mips/vr4181/osprey/ -load-$(CONFIG_NEC_OSPREY) += 0x80002000 +load-$(CONFIG_NEC_OSPREY) += 0xffffffff80002000 # # Common VR41xx @@ -461,74 +481,94 @@ load-$(CONFIG_NEC_OSPREY) += 0x80002000 core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/ cflags-$(CONFIG_MACH_VR41XX) += -Iinclude/asm-mips/mach-vr41xx +# +# NEC VR4133 +# +core-$(CONFIG_NEC_CMBVR4133) += arch/mips/vr41xx/nec-cmbvr4133/ +load-$(CONFIG_NEC_CMBVR4133) += 0xffffffff80100000 + # # ZAO Networks Capcella (VR4131) # core-$(CONFIG_ZAO_CAPCELLA) += arch/mips/vr41xx/zao-capcella/ -load-$(CONFIG_ZAO_CAPCELLA) += 0x80000000 +load-$(CONFIG_ZAO_CAPCELLA) += 0xffffffff80000000 # # Victor MP-C303/304 (VR4122) # core-$(CONFIG_VICTOR_MPC30X) += arch/mips/vr41xx/victor-mpc30x/ -load-$(CONFIG_VICTOR_MPC30X) += 0x80001000 +load-$(CONFIG_VICTOR_MPC30X) += 0xffffffff80001000 # # IBM WorkPad z50 (VR4121) # core-$(CONFIG_IBM_WORKPAD) += arch/mips/vr41xx/ibm-workpad/ -load-$(CONFIG_IBM_WORKPAD) += 0x80004000 +load-$(CONFIG_IBM_WORKPAD) += 0xffffffff80004000 # # CASIO CASSIPEIA E-55/65 (VR4111) # core-$(CONFIG_CASIO_E55) += arch/mips/vr41xx/casio-e55/ -load-$(CONFIG_CASIO_E55) += 0x80004000 +load-$(CONFIG_CASIO_E55) += 0xffffffff80004000 # # TANBAC TB0226 Mbase (VR4131) # core-$(CONFIG_TANBAC_TB0226) += arch/mips/vr41xx/tanbac-tb0226/ -load-$(CONFIG_TANBAC_TB0226) += 0x80000000 +load-$(CONFIG_TANBAC_TB0226) += 0xffffffff80000000 # # TANBAC TB0229 VR4131DIMM (VR4131) # core-$(CONFIG_TANBAC_TB0229) += arch/mips/vr41xx/tanbac-tb0229/ -load-$(CONFIG_TANBAC_TB0229) += 0x80000000 +load-$(CONFIG_TANBAC_TB0229) += 0xffffffff80000000 # # SGI IP22 (Indy/Indigo2) # -# Set the load address to >= 0x88069000 if you want to leave space for symmon, -# 0x80002000 for production kernels. Note that the value must be aligned to -# a multiple of the kernel stack size or the handling of the current variable -# will break so for 64-bit kernels we have to raise the start address by 8kb. +# Set the load address to >= 0xffffffff88069000 if you want to leave space for +# symmon, 0xffffffff80002000 for production kernels. Note that the value must +# be aligned to a multiple of the kernel stack size or the handling of the +# current variable will break so for 64-bit kernels we have to raise the start +# address by 8kb. # core-$(CONFIG_SGI_IP22) += arch/mips/sgi-ip22/ cflags-$(CONFIG_SGI_IP22) += -Iinclude/asm-mips/mach-ip22 ifdef CONFIG_MIPS32 -load-$(CONFIG_SGI_IP22) += 0x88002000 +load-$(CONFIG_SGI_IP22) += 0xffffffff88002000 endif ifdef CONFIG_MIPS64 -load-$(CONFIG_SGI_IP22) += 0x88004000 +load-$(CONFIG_SGI_IP22) += 0xffffffff88004000 endif # # SGI-IP27 (Origin200/2000) # # Set the load address to >= 0xc000000000300000 if you want to leave space for -# symmon, 0xc00000000001c000 for production kernels. Note that the value -# must be 16kb aligned or the handling of the current variable will break. +# symmon, 0xc00000000001c000 for production kernels. Note that the value must +# be 16kb aligned or the handling of the current variable will break. # ifdef CONFIG_SGI_IP27 core-$(CONFIG_SGI_IP27) += arch/mips/sgi-ip27/ cflags-$(CONFIG_SGI_IP27) += -Iinclude/asm-mips/mach-ip27 -#load-$(CONFIG_SGI_IP27) += 0xa80000000001c000 +ifdef CONFIG_BUILD_ELF64 +ifdef CONFIG_MAPPED_KERNEL +load-$(CONFIG_SGI_IP27) += 0xc00000004001c000 +OBJCOPYFLAGS := --change-addresses=0x3fffffff80000000 +dataoffset-$(CONFIG_SGI_IP27) += 0x01000000 +else +load-$(CONFIG_SGI_IP27) += 0xa80000000001c000 +OBJCOPYFLAGS := --change-addresses=0x57ffffff80000000 +endif +else ifdef CONFIG_MAPPED_KERNEL -load-$(CONFIG_SGI_IP27) += 0xc001c000 +load-$(CONFIG_SGI_IP27) += 0xffffffffc001c000 +OBJCOPYFLAGS := --change-addresses=0xc000000080000000 +dataoffset-$(CONFIG_SGI_IP27) += 0x01000000 else -load-$(CONFIG_SGI_IP27) += 0x8001c000 +load-$(CONFIG_SGI_IP27) += 0xffffffff8001c000 +OBJCOPYFLAGS := --change-addresses=0xa800000080000000 +endif endif endif @@ -536,18 +576,13 @@ endif # SGI-IP32 (O2) # # Set the load address to >= 80069000 if you want to leave space for symmon, -# 0x80002000 for production kernels. Note that the value must be aligned to +# 0xffffffff80004000 for production kernels. Note that the value must be aligned to # a multiple of the kernel stack size or the handling of the current variable -# will break so for 64-bit kernels we have to raise the start address by 8kb. +# will break. # core-$(CONFIG_SGI_IP32) += arch/mips/sgi-ip32/ cflags-$(CONFIG_SGI_IP32) += -Iinclude/asm-mips/mach-ip32 -ifdef CONFIG_MIPS32 -load-$(CONFIG_SGI_IP32) += 0x80002000 -endif -ifdef CONFIG_MIPS64 -load-$(CONFIG_SGI_IP32) += 0x80004000 -endif +load-$(CONFIG_SGI_IP32) += 0xffffffff80004000 # # Sibyte SB1250 SOC @@ -557,8 +592,10 @@ endif # removed (as happens, even if they have __initcall/module_init) # core-$(CONFIG_SIBYTE_BCM112X) += arch/mips/sibyte/sb1250/ +cflags-$(CONFIG_SIBYTE_BCM112X) += -Iinclude/asm-mips/mach-sibyte core-$(CONFIG_SIBYTE_SB1250) += arch/mips/sibyte/sb1250/ +cflags-$(CONFIG_SIBYTE_SB1250) += -Iinclude/asm-mips/mach-sibyte # # Sibyte BCM91120x (Carmel) board @@ -568,31 +605,31 @@ core-$(CONFIG_SIBYTE_SB1250) += arch/mips/sibyte/sb1250/ # Sibyte SWARM board # libs-$(CONFIG_SIBYTE_CARMEL) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_CARMEL) := 0x80100000 +load-$(CONFIG_SIBYTE_CARMEL) := 0xffffffff80100000 libs-$(CONFIG_SIBYTE_CRHINE) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_CRHINE) := 0x80100000 +load-$(CONFIG_SIBYTE_CRHINE) := 0xffffffff80100000 libs-$(CONFIG_SIBYTE_CRHONE) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_CRHONE) := 0x80100000 +load-$(CONFIG_SIBYTE_CRHONE) := 0xffffffff80100000 libs-$(CONFIG_SIBYTE_RHONE) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_RHONE) := 0x80100000 +load-$(CONFIG_SIBYTE_RHONE) := 0xffffffff80100000 libs-$(CONFIG_SIBYTE_SENTOSA) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_SENTOSA) := 0x80100000 +load-$(CONFIG_SIBYTE_SENTOSA) := 0xffffffff80100000 libs-$(CONFIG_SIBYTE_SWARM) += arch/mips/sibyte/swarm/ -load-$(CONFIG_SIBYTE_SWARM) := 0x80100000 +load-$(CONFIG_SIBYTE_SWARM) := 0xffffffff80100000 # # SNI RM200 PCI # core-$(CONFIG_SNI_RM200_PCI) += arch/mips/sni/ cflags-$(CONFIG_SNI_RM200_PCI) += -Iinclude/asm-mips/mach-rm200 -load-$(CONFIG_SNI_RM200_PCI) += 0x80600000 +load-$(CONFIG_SNI_RM200_PCI) += 0xffffffff80600000 # # Toshiba JMR-TX3927 board # core-$(CONFIG_TOSHIBA_JMR3927) += arch/mips/jmr3927/rbhma3100/ \ arch/mips/jmr3927/common/ -load-$(CONFIG_TOSHIBA_JMR3927) += 0x80050000 +load-$(CONFIG_TOSHIBA_JMR3927) += 0xffffffff80050000 # # Toshiba RBTX4927 board or @@ -600,20 +637,11 @@ load-$(CONFIG_TOSHIBA_JMR3927) += 0x80050000 # core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/toshiba_rbtx4927/ core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/common/ -load-$(CONFIG_TOSHIBA_RBTX4927) += 0x80020000 +load-$(CONFIG_TOSHIBA_RBTX4927) += 0xffffffff80020000 cflags-y += -Iinclude/asm-mips/mach-generic drivers-$(CONFIG_PCI) += arch/mips/pci/ -ifdef CONFIG_MIPS32 -build-bfd = $(32bit-bfd) -cflags-y += $(32bit-isa-y) -endif -ifdef CONFIG_MIPS64 -build-bfd = $(64bit-bfd) -cflags-y += $(64bit-isa-y) -endif - ifdef CONFIG_MIPS32 ifdef CONFIG_CPU_LITTLE_ENDIAN JIFFIES = jiffies_64 @@ -624,16 +652,12 @@ else JIFFIES = jiffies_64 endif -# -# Some machines like the Indy need 32-bit ELF binaries for booting purposes. -# Other need ECOFF, so we build a 32-bit ELF binary for them which we then -# convert to ECOFF using elf2ecoff. -# -# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit -# ELF files from 32-bit files by conversion. -# -#AS += -64 -#LDFLAGS += -m elf64bmip +AFLAGS += $(cflags-y) +CFLAGS += $(cflags-y) + +LDFLAGS += -m $(ld-emul) + +OBJCOPYFLAGS += --remove-section=.reginfo # # Choosing incompatible machines durings configuration will result in @@ -642,14 +666,10 @@ endif # CPPFLAGS_vmlinux.lds := \ + $(CFLAGS) \ -D"LOADADDR=$(load-y)" \ -D"JIFFIES=$(JIFFIES)" \ - -imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h - -AFLAGS += $(cflags-y) -CFLAGS += $(cflags-y) - -LDFLAGS += --oformat $(32bit-bfd) + -D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)" head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o @@ -659,44 +679,46 @@ libs-$(CONFIG_MIPS64) += arch/mips/lib-64/ core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/ -ifdef CONFIG_BAGET_MIPS - -BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget - -balo: vmlinux - $(BAGETBOOT) balo - -endif +drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/ ifdef CONFIG_LASAT rom.bin rom.sw: vmlinux $(call descend,arch/mips/lasat/image,$@) endif -ifdef CONFIG_MAPPED_KERNEL -vmlinux.64: vmlinux - $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo \ - --change-addresses=0xc000000080000000 $< $@ -else +# +# Some machines like the Indy need 32-bit ELF binaries for booting purposes. +# Other need ECOFF, so we build a 32-bit ELF binary for them which we then +# convert to ECOFF using elf2ecoff. +# +vmlinux.32: vmlinux + $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@ + +# +# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit +# ELF files from 32-bit files by conversion. +# vmlinux.64: vmlinux - $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo \ - --change-addresses=0xa800000080000000 $< $@ -endif + $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ -makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1) +makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) -ifdef CONFIG_SGI_IP27 -all: vmlinux.64 +ifdef CONFIG_BOOT_ELF32 +all: $(vmlinux-32) +endif + +ifdef CONFIG_BOOT_ELF64 +all: $(vmlinux-64) endif ifdef CONFIG_SNI_RM200_PCI all: vmlinux.ecoff endif -vmlinux.ecoff vmlinux.rm200: vmlinux +vmlinux.ecoff vmlinux.rm200: $(vmlinux-32) +@$(call makeboot,$@) -vmlinux.srec: vmlinux +vmlinux.srec: $(vmlinux-32) +@$(call makeboot,$@) CLEAN_FILES += vmlinux.ecoff \ @@ -706,7 +728,6 @@ CLEAN_FILES += vmlinux.ecoff \ archclean: @$(MAKE) $(clean)=arch/mips/boot - @$(MAKE) $(clean)=arch/mips/baget @$(MAKE) $(clean)=arch/mips/lasat # Generate #include #include #include @@ -39,8 +40,8 @@ #include #include #include +#include -#include #include #include #include @@ -91,10 +92,10 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = { #elif defined(CONFIG_SOC_AU1500) - { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_PCI_INTA, INTC_INT_LOW_LEVEL, 0 }, { AU1000_PCI_INTB, INTC_INT_LOW_LEVEL, 0 }, - { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_PCI_INTC, INTC_INT_LOW_LEVEL, 0 }, { AU1000_PCI_INTD, INTC_INT_LOW_LEVEL, 0 }, { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0}, @@ -117,16 +118,16 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = { { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, - { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, - { AU1000_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, #elif defined(CONFIG_SOC_AU1100) - { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, - { AU1000_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, - { 2/*AU1000_SD_INT*/, INTC_INT_HIGH_LEVEL, 0}, - { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_SD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0}, @@ -151,9 +152,9 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = { { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, - { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, /*{ AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0},*/ - /*{ AU1000_LCD_INT, INTC_INT_HIGH_LEVEL, 0 },*/ + { AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, #elif defined(CONFIG_SOC_AU1550) @@ -187,6 +188,32 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = { { AU1550_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, { AU1550_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, +#elif defined(CONFIG_SOC_AU1200) + + { AU1200_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_SWT_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_SD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_DDMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_BE_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_FE_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_PSC0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0}, + { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_BOTH_INT, INTC_INT_HIGH_LEVEL, 0}, + #else #error "Error: Unknown Alchemy SOC" #endif diff --git a/arch/mips/au1000/common/cputable.c b/arch/mips/au1000/common/cputable.c index 26744b317..f5521dfcc 100644 --- a/arch/mips/au1000/common/cputable.c +++ b/arch/mips/au1000/common/cputable.c @@ -11,8 +11,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ - -#include #include #include #include @@ -39,6 +37,7 @@ struct cpu_spec cpu_specs[] = { { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 }, { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 }, { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 }, + { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 }, { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 }, }; diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c index 9f6c61c25..adfc3172a 100644 --- a/arch/mips/au1000/common/dbdma.c +++ b/arch/mips/au1000/common/dbdma.c @@ -29,7 +29,7 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ - +#include #include #include #include @@ -37,10 +37,13 @@ #include #include #include +#include #include #include #include +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) + /* * The Descriptor Based DMA supports up to 16 channels. * @@ -52,7 +55,7 @@ * functions. The drivers allocate the data buffers and assign them * to the descriptors. */ -static spinlock_t au1xxx_dbdma_spin_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(au1xxx_dbdma_spin_lock); /* I couldn't find a macro that did this...... */ @@ -63,6 +66,7 @@ static int dbdma_initialized; static void au1xxx_dbdma_init(void); typedef struct dbdma_device_table { + u32 dev_id; u32 dev_flags; u32 dev_tsize; u32 dev_devwidth; @@ -89,64 +93,116 @@ typedef struct dbdma_chan_config { #define DEV_FLAGS_IN (1 << 3) static dbdev_tab_t dbdev_tab[] = { +#ifdef CONFIG_SOC_AU1550 /* UARTS */ - { DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, - { DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, - { DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, - { DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, + { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, + { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, + { DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, + { DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, /* EXT DMA */ - { 0, 0, 0, 0x00000000, 0, 0 }, - { 0, 0, 0, 0x00000000, 0, 0 }, - { 0, 0, 0, 0x00000000, 0, 0 }, - { 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, /* USB DEV */ - { DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, - { DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, - { DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, - { DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, - { DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, - { DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, + { DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, + { DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, + { DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, + { DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, + { DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, + { DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, /* PSC 0 */ - { DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, - { DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, /* PSC 1 */ - { DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, - { DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, /* PSC 2 */ - { DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, - { DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, + { DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, + { DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, /* PSC 3 */ - { DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, - { DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, + { DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, + { DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, - { 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ - { 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ + { DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ + { DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ /* MAC 0 */ - { DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, - { DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, /* MAC 1 */ - { DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, - { DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + +#endif /* CONFIG_SOC_AU1550 */ + +#ifdef CONFIG_SOC_AU1200 + { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, + { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, + { DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, + { DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, + + { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, - /* reserved */ - { DEV_FLAGS_INUSE, 0, 0, 0x00000000, 0, 0 }, - { DEV_FLAGS_INUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, - /* Memory */ - { DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, /* throttle */ - { DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, /* always */ +#endif // CONFIG_SOC_AU1200 + + { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, }; +#define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t)) + static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; +static dbdev_tab_t * +find_dbdev_id (u32 id) +{ + int i; + dbdev_tab_t *p; + for (i = 0; i < DBDEV_TAB_SIZE; ++i) { + p = &dbdev_tab[i]; + if (p->dev_id == id) + return p; + } + return NULL; +} + /* Allocate a channel and return a non-zero descriptor if successful. */ u32 @@ -172,8 +228,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS)) return 0; - stp = &dbdev_tab[srcid]; - dtp = &dbdev_tab[destid]; + if ((stp = find_dbdev_id(srcid)) == NULL) return 0; + if ((dtp = find_dbdev_id(destid)) == NULL) return 0; + used = 0; rv = 0; @@ -212,7 +269,7 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, /* If kmalloc fails, it is caught below same * as a channel not available. */ - ctp = (chan_tab_t *)kmalloc(sizeof(chan_tab_t), GFP_KERNEL); + ctp = kmalloc(sizeof(chan_tab_t), GFP_KERNEL); chan_tab_ptr[i] = ctp; ctp->chan_index = chan = i; break; @@ -337,8 +394,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries) /* Initialize the rings with as much information as we know. */ - srcid = stp - dbdev_tab; /* Index is channel device ID */ - destid = dtp - dbdev_tab; + srcid = stp->dev_id; + destid = dtp->dev_id; cmd0 = cmd1 = src1 = dest1 = 0; src0 = dest0 = 0; @@ -691,7 +748,7 @@ au1xxx_dbdma_chan_free(u32 chanid) kfree(ctp); } -static void +static irqreturn_t dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 intstat; @@ -718,6 +775,7 @@ dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs) ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + return IRQ_HANDLED; } static void @@ -773,3 +831,6 @@ au1xxx_dbdma_dump(u32 chanid) dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); } while (dp != ctp->chan_desc_base); } + +#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ + diff --git a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c index f364091d0..372c33f13 100644 --- a/arch/mips/au1000/common/dma.c +++ b/arch/mips/au1000/common/dma.c @@ -7,6 +7,7 @@ * Copyright 2000 MontaVista Software Inc. * Author: MontaVista Software, Inc. * stevel@mvista.com or source@mvista.com + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -29,7 +30,8 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ - +#include +#include #include #include #include @@ -37,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +62,7 @@ */ -spinlock_t au1000_dma_spin_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(au1000_dma_spin_lock); struct dma_chan au1000_dma_table[NUM_AU1000_DMA_CHANNELS] = { {.dev_id = -1,}, @@ -71,6 +74,7 @@ struct dma_chan au1000_dma_table[NUM_AU1000_DMA_CHANNELS] = { {.dev_id = -1,}, {.dev_id = -1,} }; +EXPORT_SYMBOL(au1000_dma_table); // Device FIFO addresses and default DMA modes static const struct dma_dev { @@ -216,6 +220,7 @@ int request_au1000_dma(int dev_id, const char *dev_str, return i; } +EXPORT_SYMBOL(request_au1000_dma); void free_au1000_dma(unsigned int dmanr) { @@ -233,4 +238,6 @@ void free_au1000_dma(unsigned int dmanr) chan->irq_dev = NULL; chan->dev_id = -1; } +EXPORT_SYMBOL(free_au1000_dma); + #endif // AU1000 AU1500 AU1100 diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c index 5104328f7..d1eb5a4a9 100644 --- a/arch/mips/au1000/common/irq.c +++ b/arch/mips/au1000/common/irq.c @@ -41,8 +41,8 @@ #include #include #include +#include -#include #include #include #include @@ -66,10 +66,6 @@ #define EXT_INTC1_REQ1 5 /* IP 5 */ #define MIPS_TIMER_IP 7 /* IP 7 */ -#ifdef CONFIG_KGDB -extern void breakpoint(void); -#endif - extern asmlinkage void au1000_IRQ(void); extern void set_debug_traps(void); extern irq_cpustat_t irq_stat [NR_CPUS]; @@ -84,14 +80,13 @@ static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr); inline void local_enable_irq(unsigned int irq_nr); inline void local_disable_irq(unsigned int irq_nr); -extern void __init init_generic_irq(void); void (*board_init_irq)(void); #ifdef CONFIG_PM extern void counter0_irq(int irq, void *dev_id, struct pt_regs *regs); #endif -static spinlock_t irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_lock); static unsigned int startup_irq(unsigned int irq_nr) @@ -420,7 +415,7 @@ static void setup_local_irq(unsigned int irq_nr, int type, int int_req) } -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; unsigned long cp0_status; @@ -434,8 +429,6 @@ void __init init_IRQ(void) memset(irq_desc, 0, sizeof(irq_desc)); set_except_vector(0, au1000_IRQ); - init_generic_irq(); - /* Initialize interrupt controllers to a safe state. */ au_writel(0xffffffff, IC0_CFG0CLR); @@ -482,13 +475,6 @@ void __init init_IRQ(void) */ if (board_init_irq) (*board_init_irq)(); - -#ifdef CONFIG_KGDB - /* If local serial I/O used for debug port, enter kgdb at once */ - puts("Waiting for kgdb to connect..."); - set_debug_traps(); - breakpoint(); -#endif } diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c index d5ccbd221..533721eef 100644 --- a/arch/mips/au1000/common/pci.c +++ b/arch/mips/au1000/common/pci.c @@ -6,6 +6,8 @@ * Author: MontaVista Software, Inc. * ppopov@mvista.com or source@mvista.com * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * Support for all devices (greater than 16) added by David Gathright. * * This program is free software; you can redistribute it and/or modify it @@ -35,7 +37,6 @@ #include #include -#include /* TBD */ static struct resource pci_io_resource = { @@ -67,23 +68,23 @@ static unsigned long virt_io_addr; static int __init au1x_pci_setup(void) { #if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) - int i; - struct pci_dev *dev; - virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START, Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1); if (!virt_io_addr) { printk(KERN_ERR "Unable to ioremap pci space\n"); - return; + return 1; } #ifdef CONFIG_DMA_NONCOHERENT /* - * Set the NC bit in controller for pre-AC silicon + * Set the NC bit in controller for Au1500 pre-AC silicon */ - au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG); - printk("Non-coherent PCI accesses enabled\n"); + u32 prid = read_c0_prid(); + if ( (prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) { + au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG); + printk("Non-coherent PCI accesses enabled\n"); + } #endif set_io_port_base(virt_io_addr); diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c index 22acce04a..0776b2db5 100644 --- a/arch/mips/au1000/common/platform.c +++ b/arch/mips/au1000/common/platform.c @@ -7,7 +7,6 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ -#include #include #include #include diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c index d9ec5876e..c40daccbb 100644 --- a/arch/mips/au1000/common/power.c +++ b/arch/mips/au1000/common/power.c @@ -66,7 +66,7 @@ extern void local_enable_irq(unsigned int irq_nr); #define ACPI_SLEEP 21 -static spinlock_t pm_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pm_lock); /* We need to save/restore a bunch of core registers that are * either volatile or reset to some state across a processor sleep. diff --git a/arch/mips/au1000/common/puts.c b/arch/mips/au1000/common/puts.c index 7d3a509a1..c2ae4624b 100644 --- a/arch/mips/au1000/common/puts.c +++ b/arch/mips/au1000/common/puts.c @@ -92,7 +92,7 @@ puts(unsigned char *cp) } void -fputs(unsigned char *cp) +fputs(const char *cp) { unsigned char ch; int i = 0; diff --git a/arch/mips/au1000/common/reset.c b/arch/mips/au1000/common/reset.c index 5bbc6cf05..65b84db80 100644 --- a/arch/mips/au1000/common/reset.c +++ b/arch/mips/au1000/common/reset.c @@ -43,6 +43,7 @@ extern void (*flush_cache_all)(void); void au1000_restart(char *command) { /* Set all integrated peripherals to disabled states */ + extern void board_reset (void); u32 prid = read_c0_prid(); printk(KERN_NOTICE "\n** Resetting Integrated Peripherals\n"); @@ -154,18 +155,10 @@ void au1000_restart(char *command) flush_cache_all(); write_c0_wired(0); -#if defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) - /* Do a HW reset if the board can do it */ - - au_writel(0x00000000, 0xAE00001C); -#endif - -#if defined(CONFIG_MIPS_PB1550) - /* reset entire system */ - au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C); - au_sync(); -#endif + /* Give board a chance to do a hardware reset */ + board_reset(); + /* Jump to the beggining in case board_reset() is empty */ __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000)); } diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c index d4c92fa67..dbc8b1bda 100644 --- a/arch/mips/au1000/common/setup.c +++ b/arch/mips/au1000/common/setup.c @@ -3,6 +3,8 @@ * Author: MontaVista Software, Inc. * ppopov@mvista.com or source@mvista.com * + * Updates to 2.6, Pete Popov, Embedded Alley Solutions, 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 @@ -40,11 +42,6 @@ #include #include -#ifdef CONFIG_BLK_DEV_INITRD -extern unsigned long initrd_start, initrd_end; -extern void * __rd_start, * __rd_end; -#endif - extern char * __init prom_getcmdline(void); extern void __init board_setup(void); extern void au1000_restart(char *); @@ -56,12 +53,9 @@ extern void (*board_time_init)(void); extern void au1x_time_init(void); extern void (*board_timer_setup)(struct irqaction *irq); extern void au1x_timer_setup(struct irqaction *irq); -#if defined(CONFIG_64BIT_PHYS_ADDR) && (defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)) -extern phys_t (*fixup_bigphys_addr)(phys_t phys_addr, phys_t size); -static phys_t au1500_fixup_bigphys_addr(phys_t phys_addr, phys_t size); -#endif extern void au1xxx_time_init(void); extern void au1xxx_timer_setup(struct irqaction *irq); +extern void set_cpuspec(void); static int __init au1x00_setup(void) { @@ -76,7 +70,7 @@ static int __init au1x00_setup(void) prid = read_c0_prid(); cpupll = (au_readl(0xB1900060) & 0x3F) * 12; - printk("(PRId %08X) @ %dMHZ\n", prid, cpupll); + printk("(PRId %08lx) @ %ldMHZ\n", prid, cpupll); bclk = sp->cpu_bclk; if (bclk) @@ -146,9 +140,6 @@ static int __init au1x00_setup(void) _machine_power_off = au1000_power_off; board_time_init = au1xxx_time_init; board_timer_setup = au1xxx_timer_setup; -#if defined(CONFIG_64BIT_PHYS_ADDR) && (defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)) - fixup_bigphys_addr = au1500_fixup_bigphys_addr; -#endif /* IO/MEM resources. */ set_io_port_base(0); @@ -157,62 +148,48 @@ static int __init au1x00_setup(void) iomem_resource.start = IOMEM_RESOURCE_START; iomem_resource.end = IOMEM_RESOURCE_END; -#ifdef CONFIG_BLK_DEV_INITRD - ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); - initrd_start = (unsigned long)&__rd_start; - initrd_end = (unsigned long)&__rd_end; -#endif - -#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) -#ifdef CONFIG_USB_OHCI - if ((argptr = strstr(argptr, "usb_ohci=")) == NULL) { - char usb_args[80]; - argptr = prom_getcmdline(); - memset(usb_args, 0, sizeof(usb_args)); - sprintf(usb_args, " usb_ohci=base:0x%x,len:0x%x,irq:%d", - USB_OHCI_BASE, USB_OHCI_LEN, AU1000_USB_HOST_INT); - strcat(argptr, usb_args); - } -#endif - -#ifdef CONFIG_USB_OHCI - /* enable host controller and wait for reset done */ - au_writel(0x08, USB_HOST_CONFIG); - udelay(1000); - au_writel(0x0E, USB_HOST_CONFIG); - udelay(1000); - au_readl(USB_HOST_CONFIG); /* throw away first read */ - while (!(au_readl(USB_HOST_CONFIG) & 0x10)) - au_readl(USB_HOST_CONFIG); -#endif -#endif /* defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) */ - while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_E0S); au_writel(SYS_CNTRL_E0 | SYS_CNTRL_EN0, SYS_COUNTER_CNTRL); au_sync(); while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S); au_writel(0, SYS_TOYTRIM); + return 0; } early_initcall(au1x00_setup); -#if defined(CONFIG_64BIT_PHYS_ADDR) && (defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)) -/* This routine should be valid for all Au1500 based boards */ -static phys_t au1500_fixup_bigphys_addr(phys_t phys_addr, phys_t size) +#if defined(CONFIG_64BIT_PHYS_ADDR) +/* This routine should be valid for all Au1x based boards */ +phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) { - u32 pci_start = (u32)Au1500_PCI_MEM_START; - u32 pci_end = (u32)Au1500_PCI_MEM_END; + u32 start, end; /* Don't fixup 36 bit addresses */ if ((phys_addr >> 32) != 0) return phys_addr; +#ifdef CONFIG_PCI + start = (u32)Au1500_PCI_MEM_START; + end = (u32)Au1500_PCI_MEM_END; /* check for pci memory window */ - if ((phys_addr >= pci_start) && ((phys_addr + size) < pci_end)) { - return (phys_t)((phys_addr - pci_start) + - Au1500_PCI_MEM_START); + if ((phys_addr >= start) && ((phys_addr + size) < end)) { + return (phys_t)((phys_addr - start) + Au1500_PCI_MEM_START); } - else - return phys_addr; +#endif + + /* All Au1x SOCs have a pcmcia controller */ + /* We setup our 32 bit pseudo addresses to be equal to the + * 36 bit addr >> 4, to make it easier to check the address + * and fix it. + * The Au1x socket 0 phys attribute address is 0xF 4000 0000. + * The pseudo address we use is 0xF400 0000. Any address over + * 0xF400 0000 is a pcmcia pseudo address. + */ + if ((phys_addr >= 0xF4000000) && (phys_addr < 0xFFFFFFFF)) { + return (phys_t)(phys_addr << 4); + } + + /* default nop */ + return phys_addr; } #endif diff --git a/arch/mips/au1000/common/sleeper.S b/arch/mips/au1000/common/sleeper.S index c467abedb..44dac3b0d 100644 --- a/arch/mips/au1000/common/sleeper.S +++ b/arch/mips/au1000/common/sleeper.S @@ -9,7 +9,6 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ -#include #include #include #include diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index a72de9727..fe418f162 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -68,7 +69,7 @@ extern void startup_match20_interrupt(void); static unsigned long last_pc0, last_match20; #endif -static spinlock_t time_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(time_lock); static inline void ack_r4ktimer(unsigned long newval) { @@ -99,6 +100,9 @@ void mips_timer_interrupt(struct pt_regs *regs) kstat_this_cpu.irqs[irq]++; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); @@ -137,6 +141,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) while (time_elapsed > 0) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif time_elapsed -= MATCH20_INC; last_match20 += MATCH20_INC; jiffie_drift++; @@ -153,6 +160,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) if (jiffie_drift >= 999) { jiffie_drift -= 999; do_timer(regs); /* increment jiffies by one */ +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } } @@ -294,8 +304,7 @@ unsigned long cal_r4koff(void) /* This is for machines which generate the exact clock. */ #define USECS_PER_JIFFY (1000000/HZ) -#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff) - +#define USECS_PER_JIFFY_FRAC (0x100000000LL*1000000/HZ&0xffffffff) static unsigned long div64_32(unsigned long v1, unsigned long v2, unsigned long v3) @@ -342,9 +351,9 @@ static unsigned long do_fast_cp0_gettimeoffset(void) __asm__("multu\t%1,%2\n\t" "mfhi\t%0" - :"=r" (res) - :"r" (count), - "r" (quotient)); + : "=r" (res) + : "r" (count), "r" (quotient) + : "hi", "lo", GCC_REG_ACCUM); /* * Due to possible jiffies inconsistencies, we need to check @@ -397,10 +406,6 @@ void au1xxx_timer_setup(struct irqaction *irq) r4k_cur = (read_c0_count() + r4k_offset); write_c0_compare(r4k_cur); - /* no RTC on the pb1000 */ - xtime.tv_sec = 0; - //xtime.tv_usec = 0; - #ifdef CONFIG_PM /* * setup counter 0, since it keeps ticking after a diff --git a/arch/mips/au1000/common/usbdev.c b/arch/mips/au1000/common/usbdev.c index 21e2a91aa..447a9a461 100644 --- a/arch/mips/au1000/common/usbdev.c +++ b/arch/mips/au1000/common/usbdev.c @@ -61,8 +61,6 @@ #define vdbg(fmt, arg...) do {} while (0) #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) - #define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL) #define EP_FIFO_DEPTH 8 @@ -211,9 +209,8 @@ dump_setup(struct usb_ctrlrequest* s) static inline usbdev_pkt_t * alloc_packet(endpoint_t * ep, int data_size, void* data) { - usbdev_pkt_t* pkt = - (usbdev_pkt_t *)kmalloc(sizeof(usbdev_pkt_t) + data_size, - ALLOC_FLAGS); + usbdev_pkt_t* pkt = kmalloc(sizeof(usbdev_pkt_t) + data_size, + ALLOC_FLAGS); if (!pkt) return NULL; pkt->ep_addr = ep->address; @@ -769,7 +766,7 @@ do_get_descriptor(struct usb_dev* dev, struct usb_ctrlrequest* setup) dev->conf_desc), 0); } else { - int len = dev->conf_desc->wTotalLength; + int len = le16_to_cpu(dev->conf_desc->wTotalLength); dbg("sending whole config desc," " size=%d, our size=%d", desc_len, len); desc_len = desc_len > len ? len : desc_len; @@ -1401,7 +1398,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc, epd->bEndpointAddress |= (u8)ep->address; ep->direction = epd->bEndpointAddress & 0x80; ep->type = epd->bmAttributes & 0x03; - ep->max_pkt_size = epd->wMaxPacketSize; + ep->max_pkt_size = le16_to_cpu(epd->wMaxPacketSize); spin_lock_init(&ep->lock); ep->desc = epd; ep->reg = &ep_reg[ep->address]; @@ -1410,7 +1407,7 @@ usbdev_init(struct usb_device_descriptor* dev_desc, /* * initialize the full config descriptor */ - usbdev.full_conf_desc = fcd = kmalloc(config_desc->wTotalLength, + usbdev.full_conf_desc = fcd = kmalloc(le16_to_cpu(config_desc->wTotalLength), ALLOC_FLAGS); if (!fcd) { err("failed to alloc full config descriptor"); diff --git a/arch/mips/au1000/csb250/board_setup.c b/arch/mips/au1000/csb250/board_setup.c index 63f40dc74..90426eaff 100644 --- a/arch/mips/au1000/csb250/board_setup.c +++ b/arch/mips/au1000/csb250/board_setup.c @@ -45,16 +45,6 @@ #include #include -#ifdef CONFIG_USB_OHCI -// Enable the workaround for the OHCI DoneHead -// register corruption problem. -#define CONFIG_AU1000_OHCI_FIX -#endif - -#ifdef CONFIG_RTC -extern struct rtc_ops csb250_rtc_ops; -#endif - extern int (*board_pci_idsel)(unsigned int devsel, int assert); int csb250_pci_idsel(unsigned int devsel, int assert); @@ -203,7 +193,6 @@ void __init board_setup(void) au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL); #ifdef CONFIG_RTC - rtc_ops = &csb250_rtc_ops; // Enable the RTC if not already enabled if (!(au_readl(0xac000028) & 0x20)) { printk("enabling clock ...\n"); diff --git a/arch/mips/au1000/csb250/irqmap.c b/arch/mips/au1000/csb250/irqmap.c index d7fbda492..5cb1166be 100644 --- a/arch/mips/au1000/csb250/irqmap.c +++ b/arch/mips/au1000/csb250/irqmap.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/au1000/db1x00/board_setup.c b/arch/mips/au1000/db1x00/board_setup.c index 541837dba..ac05ba0ff 100644 --- a/arch/mips/au1000/db1x00/board_setup.c +++ b/arch/mips/au1000/db1x00/board_setup.c @@ -48,6 +48,12 @@ /* not correct for db1550 */ static BCSR * const bcsr = (BCSR *)0xAE000000; +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writel(0x00000000, 0xAE00001C); +} + void __init board_setup(void) { u32 pin_func; diff --git a/arch/mips/au1000/db1x00/irqmap.c b/arch/mips/au1000/db1x00/irqmap.c index cbae591f0..8f6ef0dbe 100644 --- a/arch/mips/au1000/db1x00/irqmap.c +++ b/arch/mips/au1000/db1x00/irqmap.c @@ -40,8 +40,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/au1000/db1x00/mirage_ts.c b/arch/mips/au1000/db1x00/mirage_ts.c index 585861e80..ade35e432 100644 --- a/arch/mips/au1000/db1x00/mirage_ts.c +++ b/arch/mips/au1000/db1x00/mirage_ts.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -68,7 +69,7 @@ int wm97xx_comodule_present = 1; #define err(format, arg...) printk(KERN_ERR TS_NAME ": " format "\n" , ## arg) #define info(format, arg...) printk(KERN_INFO TS_NAME ": " format "\n" , ## arg) #define warn(format, arg...) printk(KERN_WARNING TS_NAME ": " format "\n" , ## arg) -#define DPRINTK(format, arg...) printk(__FUNCTION__ ": " format "\n" , ## arg) +#define DPRINTK(format, arg...) printk("%s: " format "\n", __FUNCTION__ , ## arg) #define PEN_DOWN_IRQ AU1000_GPIO_7 @@ -147,10 +148,7 @@ static int ts_thread(void *id) ts = wm97xx_ts_get_handle(0); /* proceed only after everybody is ready */ - while ( ! wm97xx_ts_ready(ts) ) { - /* give a little time for initializations to complete */ - interruptible_sleep_on_timeout(&pendown_wait, HZ / 4); - } + wait_event_timeout(pendown_wait, wm97xx_ts_ready(ts), HZ/4); /* board-specific calibration */ wm97xx_ts_set_cal(ts, diff --git a/arch/mips/au1000/hydrogen3/board_setup.c b/arch/mips/au1000/hydrogen3/board_setup.c index 84e1e4119..2efae1064 100644 --- a/arch/mips/au1000/hydrogen3/board_setup.c +++ b/arch/mips/au1000/hydrogen3/board_setup.c @@ -45,14 +45,14 @@ #include #include -extern struct rtc_ops no_rtc_ops; +void board_reset (void) +{ +} void __init board_setup(void) { u32 pin_func; - rtc_ops = &no_rtc_ops; - #ifdef CONFIG_AU1X00_USB_DEVICE // 2nd USB port is USB device pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000); diff --git a/arch/mips/au1000/hydrogen3/irqmap.c b/arch/mips/au1000/hydrogen3/irqmap.c index a335c90bd..6eacaa0da 100644 --- a/arch/mips/au1000/hydrogen3/irqmap.c +++ b/arch/mips/au1000/hydrogen3/irqmap.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/au1000/mtx-1/board_setup.c b/arch/mips/au1000/mtx-1/board_setup.c index 54a89a6c8..638de7bb4 100644 --- a/arch/mips/au1000/mtx-1/board_setup.c +++ b/arch/mips/au1000/mtx-1/board_setup.c @@ -34,24 +34,24 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include -#include +#include -extern struct rtc_ops no_rtc_ops; +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writel(0x00000000, 0xAE00001C); +} void __init board_setup(void) { - rtc_ops = &no_rtc_ops; - #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) #ifdef CONFIG_AU1X00_USB_DEVICE // 2nd USB port is USB device @@ -60,7 +60,7 @@ void __init board_setup(void) // enable USB power switch au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR ); au_writel( 0x100000, GPIO2_OUTPUT ); -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1000_USB_DEVICE) +#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) #ifdef CONFIG_PCI #if defined(__MIPSEB__) diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c index 780cec37c..02e7dbcff 100644 --- a/arch/mips/au1000/mtx-1/init.c +++ b/arch/mips/au1000/mtx-1/init.c @@ -28,17 +28,15 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ - +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include int prom_argc; char **prom_argv, **prom_envp; @@ -50,25 +48,24 @@ const char *get_system_type(void) return "MTX-1"; } -int __init prom_init(int argc, char **argv, char **envp, int *prom_vec) +void __init prom_init(void) { unsigned char *memsize_str; unsigned long memsize; - prom_argc = argc; - prom_argv = argv; - prom_envp = envp; + prom_argc = fw_arg0; + prom_argv = (char **) fw_arg1; + prom_envp = (char **) fw_arg2; mips_machgroup = MACH_GROUP_ALCHEMY; mips_machtype = MACH_MTX1; /* set the platform # */ + prom_init_cmdline(); memsize_str = prom_getenv("memsize"); - if (!memsize_str) { + if (!memsize_str) memsize = 0x04000000; - } else { + else memsize = simple_strtol(memsize_str, NULL, 0); - } add_memory_region(0, memsize, BOOT_MEM_RAM); - return 0; } diff --git a/arch/mips/au1000/mtx-1/irqmap.c b/arch/mips/au1000/mtx-1/irqmap.c index 720bc759d..ddcb9d089 100644 --- a/arch/mips/au1000/mtx-1/irqmap.c +++ b/arch/mips/au1000/mtx-1/irqmap.c @@ -39,18 +39,20 @@ #include #include #include +#include -#include #include #include #include #include -#include +#include -/* Need to define this. -*/ au1xxx_irq_map_t au1xxx_irq_map[] = { - { 0. 0. 0} + { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, + { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, + { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, + { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, }; -int au1xxx_nr_irqs = 0; +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t); diff --git a/arch/mips/au1000/pb1000/board_setup.c b/arch/mips/au1000/pb1000/board_setup.c index ab53e1a6c..2fa211b69 100644 --- a/arch/mips/au1000/pb1000/board_setup.c +++ b/arch/mips/au1000/pb1000/board_setup.c @@ -37,16 +37,12 @@ #include #include #include -#include -#include +#include +#include -#ifdef CONFIG_USB_OHCI -// Enable the workaround for the OHCI DoneHead -// register corruption problem. -#define CONFIG_AU1000_OHCI_FIX - ^^^^^^^^^^^^^^^^^^^^^^ - !!! I shall not define symbols starting with CONFIG_ !!! -#endif +void board_reset (void) +{ +} void __init board_setup(void) { diff --git a/arch/mips/au1000/pb1000/irqmap.c b/arch/mips/au1000/pb1000/irqmap.c index 215b07a6d..a3c460e3c 100644 --- a/arch/mips/au1000/pb1000/irqmap.c +++ b/arch/mips/au1000/pb1000/irqmap.c @@ -39,13 +39,13 @@ #include #include #include +#include -#include #include #include #include #include -#include +#include au1xxx_irq_map_t au1xxx_irq_map[] = { { AU1000_GPIO_15, INTC_INT_LOW_LEVEL, 0 }, diff --git a/arch/mips/au1000/pb1100/board_setup.c b/arch/mips/au1000/pb1100/board_setup.c index abe5f47bc..13c2f6ca7 100644 --- a/arch/mips/au1000/pb1100/board_setup.c +++ b/arch/mips/au1000/pb1100/board_setup.c @@ -37,16 +37,14 @@ #include #include #include -#include -#include +#include +#include -#ifdef CONFIG_USB_OHCI -// Enable the workaround for the OHCI DoneHead -// register corruption problem. -#define CONFIG_AU1000_OHCI_FIX - ^^^^^^^^^^^^^^^^^^^^^^ - !!! I shall not define symbols starting with CONFIG_ !!! -#endif +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writel(0x00000000, 0xAE00001C); +} void __init board_setup(void) { diff --git a/arch/mips/au1000/pb1100/irqmap.c b/arch/mips/au1000/pb1100/irqmap.c index 6333deb60..43be7158b 100644 --- a/arch/mips/au1000/pb1100/irqmap.c +++ b/arch/mips/au1000/pb1100/irqmap.c @@ -39,13 +39,13 @@ #include #include #include +#include -#include #include #include #include #include -#include +#include au1xxx_irq_map_t au1xxx_irq_map[] = { { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card Fully_Interted# diff --git a/arch/mips/au1000/pb1500/board_setup.c b/arch/mips/au1000/pb1500/board_setup.c index 5b7ee00dc..30bb87282 100644 --- a/arch/mips/au1000/pb1500/board_setup.c +++ b/arch/mips/au1000/pb1500/board_setup.c @@ -40,13 +40,11 @@ #include #include -#ifdef CONFIG_USB_OHCI -// Enable the workaround for the OHCI DoneHead -// register corruption problem. -#define CONFIG_AU1000_OHCI_FIX - ^^^^^^^^^^^^^^^^^^^^^^ - !!! I shall not define symbols starting with CONFIG_ !!! -#endif +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writel(0x00000000, 0xAE00001C); +} void __init board_setup(void) { diff --git a/arch/mips/au1000/pb1500/irqmap.c b/arch/mips/au1000/pb1500/irqmap.c index 79c4e0fd6..476e25001 100644 --- a/arch/mips/au1000/pb1500/irqmap.c +++ b/arch/mips/au1000/pb1500/irqmap.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/au1000/pb1550/board_setup.c b/arch/mips/au1000/pb1550/board_setup.c index 6cd5cc801..05fd27dc2 100644 --- a/arch/mips/au1000/pb1550/board_setup.c +++ b/arch/mips/au1000/pb1550/board_setup.c @@ -27,7 +27,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include @@ -45,6 +44,12 @@ #include #include +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C); +} + void __init board_setup(void) { u32 pin_func; diff --git a/arch/mips/au1000/pb1550/irqmap.c b/arch/mips/au1000/pb1550/irqmap.c index 4f692163b..889d4949e 100644 --- a/arch/mips/au1000/pb1550/irqmap.c +++ b/arch/mips/au1000/pb1550/irqmap.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/au1000/xxs1500/board_setup.c b/arch/mips/au1000/xxs1500/board_setup.c index 3dcaef1bd..9dadc8253 100644 --- a/arch/mips/au1000/xxs1500/board_setup.c +++ b/arch/mips/au1000/xxs1500/board_setup.c @@ -40,6 +40,12 @@ #include #include +void board_reset (void) +{ + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ + au_writel(0x00000000, 0xAE00001C); +} + void __init board_setup(void) { u32 pin_func; diff --git a/arch/mips/au1000/xxs1500/irqmap.c b/arch/mips/au1000/xxs1500/irqmap.c index d751f48a6..954800a0a 100644 --- a/arch/mips/au1000/xxs1500/irqmap.c +++ b/arch/mips/au1000/xxs1500/irqmap.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include #include #include #include diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile index c010290e5..efbeac326 100644 --- a/arch/mips/boot/Makefile +++ b/arch/mips/boot/Makefile @@ -4,6 +4,7 @@ # for more details. # # Copyright (C) 1995, 1998, 2001, 2002 by Ralf Baechle +# Copyright (C) 2004 Maciej W. Rozycki # # @@ -19,29 +20,30 @@ endif # Drop some uninteresting sections in the kernel. # This is only relevant for ELF kernels but doesn't hurt a.out # -drop-sections = .reginfo .mdebug .comment .note .pdr +drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options strip-flags = $(addprefix --remove-section=,$(drop-sections)) +VMLINUX = vmlinux + all: vmlinux.ecoff vmlinux.srec addinitrd -vmlinux.ecoff: $(obj)/elf2ecoff vmlinux - $(obj)/elf2ecoff vmlinux vmlinux.ecoff $(E2EFLAGS) +vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) + $(obj)/elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS) $(obj)/elf2ecoff: $(obj)/elf2ecoff.c $(HOSTCC) -o $@ $^ -vmlinux.srec: vmlinux - $(OBJCOPY) -S -O srec $(strip-flags) vmlinux $(obj)/vmlinux.srec +vmlinux.srec: $(VMLINUX) + $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec $(obj)/addinitrd: $(obj)/addinitrd.c $(HOSTCC) -o $@ $^ archhelp: @echo '* vmlinux.ecoff - ECOFF boot image' + @echo '* vmlinux.srec - SREC boot image' clean-files += addinitrd \ elf2ecoff \ vmlinux.ecoff \ - vmlinux.srec \ - zImage.tmp \ - zImage + vmlinux.srec diff --git a/arch/mips/boot/addinitrd.c b/arch/mips/boot/addinitrd.c index 38261f1ae..8b3033304 100644 --- a/arch/mips/boot/addinitrd.c +++ b/arch/mips/boot/addinitrd.c @@ -2,6 +2,8 @@ * addinitrd - program to add a initrd image to an ecoff kernel * * (C) 1999 Thomas Bogendoerfer + * minor modifications, cleanup: Guido Guenther + * further cleanup: Maciej W. Rozycki */ #include @@ -54,7 +56,7 @@ int main (int argc, char *argv[]) exit (1); } - if ((fd_vmlinux = open (argv[1],O_RDWR)) < 0) + if ((fd_vmlinux = open (argv[1],O_RDONLY)) < 0) die ("open vmlinux"); if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile) die ("read file header"); @@ -78,6 +80,11 @@ int main (int argc, char *argv[]) swab = 1; } + /* make sure we have an empty data segment for the initrd */ + if (eaout.dsize || esecs[1].s_size) { + fprintf (stderr, "Data segment not empty. Giving up!\n"); + exit (1); + } if ((fd_initrd = open (argv[2], O_RDONLY)) < 0) die ("open initrd"); if (fstat (fd_initrd, &st) < 0) diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c index ba46e8f1e..6d2a81581 100644 --- a/arch/mips/cobalt/irq.c +++ b/arch/mips/cobalt/irq.c @@ -87,7 +87,7 @@ asmlinkage void cobalt_irq(struct pt_regs *regs) } } -void __init init_IRQ(void) +void __init arch_init_irq(void) { set_except_vector(0, cobalt_handle_int); diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c index 1c4610673..6b4737e42 100644 --- a/arch/mips/cobalt/setup.c +++ b/arch/mips/cobalt/setup.c @@ -5,7 +5,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996, 1997 by Ralf Baechle + * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv) * */ @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig index 9e0a5bc52..caad7ca27 100644 --- a/arch/mips/configs/atlas_defconfig +++ b/arch/mips/configs/atlas_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:00 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,29 +26,37 @@ CONFIG_SYSVIPC=y CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_HOTPLUG is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support # -# CONFIG_MODULES is not set +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -62,6 +72,7 @@ CONFIG_MIPS_ATLAS=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -69,12 +80,12 @@ CONFIG_MIPS_ATLAS=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_MIPS_BONITO64=y @@ -85,7 +96,6 @@ CONFIG_MIPS_GT64120=y CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -112,13 +122,11 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,13 +137,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -144,7 +165,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y # # Memory Technology Devices (MTD) @@ -167,20 +190,58 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support # -# CONFIG_IDE is not set +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/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_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_ARM 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 @@ -192,23 +253,25 @@ CONFIG_SCSI_PROC_FS=y # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y # # SCSI Transport Attributes # -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_ISCSI_ATTRS=m # # SCSI low-level drivers @@ -221,7 +284,8 @@ CONFIG_BLK_DEV_SD=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -230,8 +294,13 @@ CONFIG_BLK_DEV_SD=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set +CONFIG_SCSI_SYM53C8XX_2=y +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set @@ -242,7 +311,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set @@ -251,7 +319,21 @@ CONFIG_SCSI_QLA2XXX=y # # Multi-device support (RAID and LVM) # -# CONFIG_MD is not set +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=m +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m # # Fusion MPT device support @@ -277,52 +359,260 @@ CONFIG_NET=y # Networking options # CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set +CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_FWMARK=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y -# CONFIG_IP_PNP_DHCP is not set -# CONFIG_IP_PNP_BOOTP is not set +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_IPV6 is not set -# CONFIG_NETFILTER is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +CONFIG_IP_TCPDIAG_IPV6=y + +# +# IP: Virtual Server Configuration +# +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_IPV6_TUNNEL=m +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_LIMIT=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_MAC=m +CONFIG_IP_NF_MATCH_PKTTYPE=m +CONFIG_IP_NF_MATCH_MARK=m +CONFIG_IP_NF_MATCH_MULTIPORT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_DSCP=m +CONFIG_IP_NF_MATCH_AH_ESP=m +CONFIG_IP_NF_MATCH_LENGTH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_TCPMSS=m +CONFIG_IP_NF_MATCH_HELPER=m +CONFIG_IP_NF_MATCH_STATE=m +CONFIG_IP_NF_MATCH_CONNTRACK=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_PHYSDEV=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_NAT_SNMP_BASIC=m +CONFIG_IP_NF_NAT_IRC=m +CONFIG_IP_NF_NAT_FTP=m +CONFIG_IP_NF_NAT_TFTP=m +CONFIG_IP_NF_NAT_AMANDA=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_DSCP=m +CONFIG_IP_NF_TARGET_MARK=m +CONFIG_IP_NF_TARGET_CLASSIFY=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_LIMIT=m +CONFIG_IP6_NF_MATCH_MAC=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_MULTIPORT=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_MARK=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AHESP=m +CONFIG_IP6_NF_MATCH_LENGTH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_PHYSDEV=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_MARK=m +CONFIG_IP6_NF_RAW=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) # -# CONFIG_IP_SCTP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y # CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set +CONFIG_LLC=m # CONFIG_LLC2 is not set # CONFIG_IPX is not set -# CONFIG_ATALK is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=y +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set +CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # -# CONFIG_NET_SCHED is not set -# CONFIG_NET_CLS_ROUTE is not set +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CLK_JIFFIES=y +# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set +# CONFIG_NET_SCH_CLK_CPU is not set +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y +CONFIG_NET_CLS=y +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_NET_CLS_IND=y +# CONFIG_CLS_U32_MARK is not set +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_CLS_POLICE=y # # Network testing @@ -334,10 +624,10 @@ CONFIG_XFRM=y # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m # CONFIG_ETHERTAP is not set # @@ -349,7 +639,7 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -359,7 +649,26 @@ CONFIG_NET_ETHERNET=y # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set -# CONFIG_NET_PCI is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=y +# 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 +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO 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_LAN_SAA9730=y # # Ethernet (1000 Mbit) @@ -372,6 +681,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -420,7 +730,7 @@ CONFIG_INPUT=y # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV=m CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 @@ -439,12 +749,17 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=y # # Input Device Drivers # # CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +CONFIG_MOUSE_SERIAL=m +# CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -473,7 +788,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -493,8 +807,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -503,6 +815,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -520,13 +837,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -537,38 +855,85 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set +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_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_PROC_INFO=y +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +# CONFIG_XFS_RT is not set +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_QUOTA=y +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -588,18 +953,20 @@ CONFIG_RAMFS=y # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set +CONFIG_AFFS_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_CRAMFS=m +CONFIG_VXFS_FS=m # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems @@ -608,13 +975,17 @@ CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set -# CONFIG_NFSD is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V4 is not set +# CONFIG_NFSD_TCP is not set CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set +CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -630,28 +1001,104 @@ CONFIG_MSDOS_PARTITION=y # # Native Language Support # -# CONFIG_NLS is not set +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Profiling support +# +# CONFIG_PROFILING is not set # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# # # Library routines # -CONFIG_CRC16=y -# CONFIG_CRC32 is not set -# CONFIG_LIBCRC32C is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig index b59e45387..1b7f8a702 100644 --- a/arch/mips/configs/capcella_defconfig +++ b/arch/mips/configs/capcella_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:00 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,14 +50,15 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set # CONFIG_CASIO_E55 is not set # CONFIG_IBM_WORKPAD is not set # CONFIG_TANBAC_TB0226 is not set @@ -75,6 +81,7 @@ CONFIG_VRC4173=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -82,18 +89,17 @@ CONFIG_VRC4173=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -122,7 +128,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -133,6 +138,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -147,7 +166,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -171,11 +192,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -193,7 +229,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -257,10 +292,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -278,7 +316,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -400,6 +437,8 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=m +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -434,7 +473,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -466,8 +504,6 @@ CONFIG_WATCHDOG=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -476,6 +512,11 @@ CONFIG_WATCHDOG=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -493,13 +534,14 @@ CONFIG_WATCHDOG=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -510,12 +552,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -529,6 +587,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -541,7 +600,8 @@ CONFIG_AUTOFS4_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -589,6 +649,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -606,16 +667,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -623,9 +691,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig index d47f67bb5..886185456 100644 --- a/arch/mips/configs/cobalt_defconfig +++ b/arch/mips/configs/cobalt_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:00 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,18 +26,21 @@ CONFIG_SYSVIPC=y CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_HOTPLUG is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +51,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set CONFIG_MIPS_COBALT=y @@ -62,6 +66,7 @@ CONFIG_MIPS_COBALT=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -69,12 +74,12 @@ CONFIG_MIPS_COBALT=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_I8259=y @@ -82,7 +87,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_GT64111=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -113,7 +117,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -124,6 +127,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -138,7 +155,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y # # Memory Technology Devices (MTD) @@ -162,12 +181,27 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -185,7 +219,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -245,10 +278,13 @@ CONFIG_INET=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -266,7 +302,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -388,6 +423,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -422,7 +459,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -442,8 +478,6 @@ CONFIG_COBALT_LCD=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -452,6 +486,11 @@ CONFIG_COBALT_LCD=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -469,13 +508,14 @@ CONFIG_COBALT_LCD=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -486,12 +526,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -509,6 +565,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -521,7 +578,8 @@ CONFIG_FS_POSIX_ACL=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -566,6 +624,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -583,16 +642,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -600,9 +666,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig index 62e748bfd..19cac1bf4 100644 --- a/arch/mips/configs/db1000_defconfig +++ b/arch/mips/configs/db1000_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:01 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set CONFIG_SOC_AU1X00=y CONFIG_SOC_AU1000=y # CONFIG_SOC_AU1100 is not set @@ -96,11 +101,11 @@ CONFIG_MIPS_DB1000=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -127,13 +132,11 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set CONFIG_64BIT_PHYS_ADDR=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -143,10 +146,15 @@ CONFIG_HW_HAS_PCI=y CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m + +# +# PC-card bridges +# # CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set @@ -168,6 +176,7 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set @@ -189,11 +198,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -217,7 +241,6 @@ CONFIG_BLK_DEV_LOOP=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -251,6 +274,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -264,13 +290,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -288,7 +313,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -316,7 +340,7 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y # @@ -341,13 +365,13 @@ CONFIG_MIPS_AU1X00_ENET=y # CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m # # Wan interfaces @@ -401,6 +425,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -436,7 +462,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -450,19 +475,16 @@ CONFIG_LEGACY_PTY_COUNT=256 CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -470,6 +492,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -487,13 +514,14 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -503,12 +531,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -535,6 +579,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -547,7 +592,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -560,6 +606,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -595,6 +642,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -652,16 +700,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -675,24 +730,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig index d6b544edb..035ac95d1 100644 --- a/arch/mips/configs/db1100_defconfig +++ b/arch/mips/configs/db1100_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:01 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set CONFIG_SOC_AU1X00=y # CONFIG_SOC_AU1000 is not set CONFIG_SOC_AU1100=y @@ -96,11 +101,11 @@ CONFIG_MIPS_DB1100=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -127,13 +132,11 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -141,10 +144,15 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m + +# +# PC-card bridges +# # CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set @@ -166,6 +174,7 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set @@ -187,11 +196,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -215,7 +239,6 @@ CONFIG_BLK_DEV_LOOP=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -249,6 +272,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -262,13 +288,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -286,7 +311,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -314,7 +338,7 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=m # CONFIG_MIPS_AU1X00_ENET is not set # @@ -339,13 +363,13 @@ CONFIG_NET_ETHERNET=y # CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m # # Wan interfaces @@ -399,6 +423,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +CONFIG_SERIO_LIBPS2=m +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -431,7 +457,6 @@ CONFIG_HW_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -445,19 +470,16 @@ CONFIG_LEGACY_PTY_COUNT=256 CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -465,6 +487,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -482,13 +509,14 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -498,12 +526,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -530,6 +574,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -542,7 +587,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -555,6 +601,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -590,6 +637,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -647,16 +695,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -670,24 +725,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig index 97a22cb43..c38c4ed18 100644 --- a/arch/mips/configs/db1500_defconfig +++ b/arch/mips/configs/db1500_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:01 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set CONFIG_SOC_AU1X00=y # CONFIG_SOC_AU1000 is not set # CONFIG_SOC_AU1100 is not set @@ -96,11 +101,12 @@ CONFIG_MIPS_DB1500=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y -CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_COHERENT=y +CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -127,32 +133,42 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set CONFIG_64BIT_PHYS_ADDR=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # CONFIG_HW_HAS_PCI=y -# CONFIG_PCI is not set +CONFIG_PCI=y +CONFIG_PCI_LEGACY_PROC=y +CONFIG_PCI_NAMES=y CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +# CONFIG_YENTA is not set +# CONFIG_PD6729 is not set +# CONFIG_I82092 is not set # CONFIG_TCIC is not set -# CONFIG_PCMCIA_AU1X00 is not set +CONFIG_PCMCIA_AU1X00=m # # PCI Hotplug Support # +# CONFIG_HOTPLUG_PCI is not set # # Executable file formats @@ -168,6 +184,7 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set @@ -197,13 +214,25 @@ CONFIG_MTD_CFI=y # CONFIG_MTD_JEDECPROBE is not set CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_AMDSTD_RETRY=0 # CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_XIP is not set # # Mapping drivers for chip access @@ -217,9 +246,12 @@ CONFIG_MTD_DB1X00_USER=y # # Self-contained MTD device drivers # +# CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -246,11 +278,32 @@ CONFIG_MTD_DB1X00_USER=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -269,12 +322,12 @@ CONFIG_BLK_DEV_IDECS=m # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes # -CONFIG_IDE_GENERIC=y +# CONFIG_IDE_GENERIC is not set +# CONFIG_BLK_DEV_IDEPCI is not set # CONFIG_IDE_ARM is not set # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set @@ -302,6 +355,7 @@ CONFIG_IDE_GENERIC=y # # I2O device support # +# CONFIG_I2O is not set # # Networking support @@ -331,6 +385,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -344,13 +401,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -368,7 +424,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -392,24 +447,51 @@ CONFIG_NETDEVICES=y # CONFIG_TUN is not set # CONFIG_ETHERTAP is not set +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y # CONFIG_MII is not set CONFIG_MIPS_AU1X00_ENET=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_NET_PCI is not set # # Ethernet (1000 Mbit) # +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set # # Token Ring devices # +# CONFIG_TR is not set # # Wireless LAN (non-hamradio) @@ -419,20 +501,14 @@ CONFIG_MIPS_AU1X00_ENET=y # # PCMCIA network device support # -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET 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=m CONFIG_PPP_MULTILINK=y # CONFIG_PPP_FILTER is not set @@ -481,6 +557,9 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -514,7 +593,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -533,14 +611,12 @@ CONFIG_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -548,6 +624,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -565,21 +646,166 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# +# CONFIG_SND is not set + +# +# Open Sound System +# +CONFIG_SOUND_PRIME=y +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_SONICVIBES is not set +CONFIG_SOUND_AU1000=y +# 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_SOUND_OSS is not set +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_AD1980 is not set # # USB support # +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +# CONFIG_USB_DEVICEFS is not set +# CONFIG_USB_BANDWIDTH is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# USB Host Controller Drivers +# +# CONFIG_USB_EHCI_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH_TTY is not set +# CONFIG_USB_MIDI is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER 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_STORAGE is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y +# CONFIG_HID_FF is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_MTOUCH is not set +# CONFIG_USB_EGALAX is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_DABUSB is not set + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# 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 + +# +# USB port drivers +# + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 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_LED is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set +# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set + +# +# USB ATM/DSL drivers +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -606,6 +832,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -618,7 +845,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -631,6 +859,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -668,6 +897,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -725,16 +955,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -748,24 +985,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig index 73d45f7e2..ee81309ae 100644 --- a/arch/mips/configs/db1550_defconfig +++ b/arch/mips/configs/db1550_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc2 -# Sun Nov 21 14:11:57 2004 +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:02 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -101,12 +101,12 @@ CONFIG_MIPS_DB1550=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_COHERENT=y CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -133,7 +133,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set CONFIG_64BIT_PHYS_ADDR=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y @@ -154,7 +153,6 @@ CONFIG_MMU=y # CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set -# CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=m CONFIG_CARDBUS=y @@ -252,6 +250,7 @@ CONFIG_MTD_DB1550_USER=y # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -268,6 +267,7 @@ CONFIG_MTD_NAND=m CONFIG_MTD_NAND_IDS=m CONFIG_MTD_NAND_AU1550=m # CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set # # Parallel port support @@ -286,11 +286,13 @@ CONFIG_MTD_NAND_AU1550=m # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m @@ -304,6 +306,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -433,8 +436,6 @@ CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -596,6 +597,7 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set CONFIG_SERIO_RAW=m # @@ -649,7 +651,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # @@ -685,6 +686,8 @@ CONFIG_SYNCLINK_CS=m # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -698,11 +701,25 @@ CONFIG_SYNCLINK_CS=m CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -852,6 +869,11 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # @@ -894,6 +916,10 @@ CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig index 07803efb6..d43ed57c4 100644 --- a/arch/mips/configs/ddb5476_defconfig +++ b/arch/mips/configs/ddb5476_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:02 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +51,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -62,6 +66,7 @@ CONFIG_IOSCHED_CFQ=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -69,12 +74,12 @@ CONFIG_DDB5476=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_I8259=y @@ -82,7 +87,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_DDB5XXX_COMMON=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_FB=y CONFIG_HAVE_STD_PC_SERIAL_PORT=y # @@ -114,7 +118,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -126,6 +129,21 @@ CONFIG_PCI_NAMES=y CONFIG_ISA=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# +CONFIG_PCMCIA_PROBE=y + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -140,7 +158,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -166,11 +186,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -188,7 +223,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -257,10 +291,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -278,7 +315,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -407,6 +443,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -441,7 +479,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -461,8 +498,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -471,6 +506,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -488,6 +528,9 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set @@ -499,6 +542,7 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY 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 @@ -520,6 +564,7 @@ CONFIG_DUMMY_CONSOLE=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -530,12 +575,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -549,6 +610,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -561,7 +623,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -607,6 +670,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -624,16 +688,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="ip=any" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -641,9 +712,15 @@ CONFIG_CMDLINE="ip=any" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig index c09e58c63..5a032cdef 100644 --- a/arch/mips/configs/ddb5477_defconfig +++ b/arch/mips/configs/ddb5477_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:02 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +51,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -62,6 +66,7 @@ CONFIG_IOSCHED_CFQ=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -70,12 +75,12 @@ CONFIG_DDB5477=y CONFIG_DDB5477_BUS_FREQUENCY=0 # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_I8259=y @@ -83,7 +88,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_DDB5XXX_COMMON=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -114,7 +118,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -125,6 +128,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -139,7 +156,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -163,11 +182,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -225,10 +259,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -246,7 +283,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -308,7 +344,6 @@ CONFIG_PCNET32=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # CONFIG_LAN_SAA9730 is not set # @@ -322,6 +357,7 @@ CONFIG_PCNET32=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -388,6 +424,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -422,7 +460,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -442,8 +479,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -452,6 +487,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -469,13 +509,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -486,12 +527,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -505,6 +562,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -517,7 +575,8 @@ CONFIG_AUTOFS4_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -565,6 +624,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -582,16 +642,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="ip=any" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -599,9 +666,15 @@ CONFIG_CMDLINE="ip=any" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig index e7dc8efb0..32ada79da 100644 --- a/arch/mips/configs/decstation_defconfig +++ b/arch/mips/configs/decstation_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:03 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_MACH_DECSTATION=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,12 +80,12 @@ CONFIG_MACH_DECSTATION=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y @@ -87,7 +93,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=4 -# CONFIG_FB is not set # # CPU selection @@ -116,7 +121,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_WB=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -124,6 +128,19 @@ CONFIG_CPU_HAS_WB=y CONFIG_TC=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -138,7 +155,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -158,10 +177,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -195,15 +229,14 @@ CONFIG_SCSI_CONSTANTS=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # CONFIG_SCSI_DECNCR=y # CONFIG_SCSI_DECSII is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -218,7 +251,6 @@ CONFIG_SCSI_DECNCR=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -251,10 +283,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -272,7 +307,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -365,6 +399,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -398,7 +434,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -413,13 +448,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -428,6 +460,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -445,13 +482,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -461,12 +499,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -484,6 +538,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -496,7 +551,8 @@ CONFIG_FS_POSIX_ACL=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -566,16 +622,23 @@ CONFIG_ULTRIX_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -583,9 +646,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig index b771f906f..52074a208 100644 --- a/arch/mips/configs/e55_defconfig +++ b/arch/mips/configs/e55_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:03 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,14 +50,15 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set CONFIG_CASIO_E55=y # CONFIG_IBM_WORKPAD is not set # CONFIG_TANBAC_TB0226 is not set @@ -74,6 +80,7 @@ CONFIG_CASIO_E55=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -81,18 +88,17 @@ CONFIG_CASIO_E55=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -121,7 +127,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,6 +134,20 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_ISA=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# +CONFIG_PCMCIA_PROBE=y + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -143,7 +162,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -165,10 +186,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -186,7 +222,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -220,7 +255,6 @@ CONFIG_IDE_GENERIC=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -251,10 +285,13 @@ CONFIG_IP_MULTICAST=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -272,7 +309,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -380,6 +416,8 @@ CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -414,7 +452,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -442,13 +479,10 @@ CONFIG_WATCHDOG=y # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -457,6 +491,11 @@ CONFIG_WATCHDOG=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -474,6 +513,7 @@ CONFIG_WATCHDOG=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support @@ -481,6 +521,7 @@ CONFIG_WATCHDOG=y # CONFIG_VGA_CONSOLE is not set # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -490,12 +531,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -509,6 +566,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -521,7 +579,8 @@ CONFIG_AUTOFS4_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -568,6 +627,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -585,16 +645,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -602,9 +669,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig index 541629004..360e842fd 100644 --- a/arch/mips/configs/ev64120_defconfig +++ b/arch/mips/configs/ev64120_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:03 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y # CONFIG_KMOD is not set # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -68,6 +73,7 @@ CONFIG_MIPS_EV64120=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -75,12 +81,12 @@ CONFIG_MIPS_EV64120=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -89,7 +95,6 @@ CONFIG_MIPS_GT64120=y # CONFIG_SYSCLK_83 is not set CONFIG_SYSCLK_100=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -121,7 +126,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -132,13 +136,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -147,7 +164,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -171,11 +190,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -232,10 +266,13 @@ CONFIG_IP_PNP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -253,7 +290,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -382,6 +418,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -416,7 +454,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -436,8 +473,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -446,6 +481,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -463,13 +503,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -480,12 +521,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -499,6 +556,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -511,7 +569,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -557,6 +616,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -574,16 +634,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal ip=192.168.1.211:192.168.1.1:::gt::" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -591,9 +658,15 @@ CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/d # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +CONFIG_CRC_CCITT=y # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig index eb13fd96d..657a9508d 100644 --- a/arch/mips/configs/ev96100_defconfig +++ b/arch/mips/configs/ev96100_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:03 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y # CONFIG_KMOD is not set # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_MIPS_EV96100=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,12 +80,12 @@ CONFIG_MIPS_EV96100=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -88,7 +94,6 @@ CONFIG_MIPS_GT64120=y CONFIG_SWAP_IO_SPACE=y CONFIG_MIPS_GT96100=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -123,7 +128,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -132,13 +136,25 @@ CONFIG_HW_HAS_PCI=y # CONFIG_PCI is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -147,7 +163,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -167,10 +185,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -194,7 +227,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -226,10 +258,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -247,7 +282,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -340,6 +374,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -374,7 +410,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -389,13 +424,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -404,6 +436,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -421,13 +458,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -437,12 +475,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -456,6 +510,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -468,7 +523,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -514,6 +570,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -531,16 +588,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -548,9 +612,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig index 8bc7792d6..3fb102e6a 100644 --- a/arch/mips/configs/ip22_defconfig +++ b/arch/mips/configs/ip22_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:04 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,6 +27,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y @@ -32,11 +35,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,13 +51,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -68,6 +73,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -75,22 +81,21 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set CONFIG_SGI_IP22=y -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_IRQ_CPU=y CONFIG_SWAP_IO_SPACE=y +CONFIG_ARC32=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_ARC32=y -# CONFIG_FB is not set CONFIG_ARC_CONSOLE=y CONFIG_ARC_PROMLIB=y @@ -126,7 +131,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -134,13 +138,25 @@ CONFIG_CPU_HAS_SYNC=y # CONFIG_EISA is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_TRAD_SIGNALS=y -CONFIG_BINFMT_IRIX=y # # Device Drivers @@ -149,7 +165,9 @@ CONFIG_BINFMT_IRIX=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -169,10 +187,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -207,14 +240,13 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # CONFIG_SGIWD93_SCSI=y -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -229,7 +261,6 @@ CONFIG_SGIWD93_SCSI=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -263,6 +294,9 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration @@ -302,6 +336,7 @@ CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set @@ -310,6 +345,9 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -334,15 +372,23 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -354,18 +400,13 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m -CONFIG_IP_NF_COMPAT_IPCHAINS=m -CONFIG_IP_NF_COMPAT_IPFWADM=m -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_MATCH_ADDRTYPE=m -CONFIG_IP_NF_MATCH_REALM=m # # IPv6: Netfilter Configuration @@ -414,16 +455,17 @@ CONFIG_SCTP_HMAC_MD5=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y +# CONFIG_NET_SCH_CLK_JIFFIES is not set +CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y +# CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m @@ -431,7 +473,7 @@ CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m -CONFIG_NET_SCH_DELAY=m +CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y @@ -443,6 +485,7 @@ CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set +# CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set @@ -515,7 +558,7 @@ CONFIG_INPUT=y # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV=m CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 @@ -533,6 +576,8 @@ CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -543,7 +588,10 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_SERIAL=m +# CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -569,7 +617,6 @@ CONFIG_SERIAL_CORE=m CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -588,17 +635,14 @@ CONFIG_WATCHDOG=y # CONFIG_SOFT_WATCHDOG is not set CONFIG_INDYDOG=m # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set CONFIG_SGI_DS1286=m +# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set CONFIG_RAW_DRIVER=m CONFIG_MAX_RAW_DEVS=256 @@ -608,6 +652,11 @@ CONFIG_MAX_RAW_DEVS=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -625,12 +674,12 @@ CONFIG_MAX_RAW_DEVS=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_SGI_NEWPORT_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FONT_8x16=y @@ -643,6 +692,7 @@ CONFIG_LOGO=y # CONFIG_LOGO_LINUX_VGA16 is not set # CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_LOGO_SGI_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -652,12 +702,28 @@ CONFIG_LOGO_SGI_CLUT224=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -684,6 +750,7 @@ CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -695,6 +762,7 @@ CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -754,10 +822,17 @@ CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set # CONFIG_AFS_FS is not set # @@ -824,16 +899,23 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -841,30 +923,40 @@ CONFIG_CMDLINE="" # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_BLOWFISH=y -CONFIG_CRYPTO_TWOFISH=y -CONFIG_CRYPTO_SERPENT=y -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m -# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# # # Library routines # -CONFIG_CRC16=m -# CONFIG_CRC32 is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=m CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index 2962c1db7..13472292d 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:04 2005 # CONFIG_MIPS=y CONFIG_MIPS64=y @@ -10,11 +12,12 @@ CONFIG_64BIT=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -23,6 +26,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y @@ -30,11 +34,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +50,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -65,6 +72,7 @@ CONFIG_STOP_MACHINE=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -75,7 +83,7 @@ CONFIG_STOP_MACHINE=y CONFIG_SGI_IP27=y # CONFIG_SGI_SN0_N_MODE is not set CONFIG_DISCONTIGMEM=y -# CONFIG_NUMA is not set +CONFIG_NUMA=y # CONFIG_MAPPED_KERNEL is not set # CONFIG_REPLICATE_KTEXT is not set # CONFIG_REPLICATE_EXHANDLERS is not set @@ -83,12 +91,12 @@ CONFIG_DISCONTIGMEM=y # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y CONFIG_DMA_IP27=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_MIPS_L1_CACHE_SHIFT=7 -# CONFIG_FB is not set CONFIG_ARC64=y CONFIG_BOOT_ELF64=y CONFIG_QL_ISP_A64=y @@ -124,7 +132,6 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_SMP=y CONFIG_NR_CPUS=64 # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_MIPS_INSANE_LARGE is not set # @@ -132,15 +139,31 @@ CONFIG_NR_CPUS=64 # CONFIG_HW_HAS_PCI=y CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set +# CONFIG_BUILD_ELF64 is not set CONFIG_MIPS32_COMPAT=y CONFIG_COMPAT=y CONFIG_MIPS32_O32=y @@ -154,7 +177,9 @@ CONFIG_BINFMT_ELF32=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -178,10 +203,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_CRYPTOLOOP=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -215,6 +256,7 @@ CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -226,7 +268,8 @@ CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -235,6 +278,7 @@ CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -247,7 +291,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -255,7 +298,21 @@ CONFIG_SCSI_QLA2XXX=y # # Multi-device support (RAID and LVM) # -# CONFIG_MD is not set +CONFIG_MD=y +CONFIG_BLK_DEV_MD=y +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=y +CONFIG_MD_RAID1=y +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=y +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m # # Fusion MPT device support @@ -300,10 +357,13 @@ CONFIG_IP_PNP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -321,37 +381,38 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y -CONFIG_NET_SCH_CBQ=y -CONFIG_NET_SCH_HTB=y -CONFIG_NET_SCH_HFSC=y -CONFIG_NET_SCH_CSZ=y -CONFIG_NET_SCH_PRIO=y -CONFIG_NET_SCH_RED=y -CONFIG_NET_SCH_SFQ=y -CONFIG_NET_SCH_TEQL=y -CONFIG_NET_SCH_TBF=y -CONFIG_NET_SCH_GRED=y -CONFIG_NET_SCH_DSMARK=y -CONFIG_NET_SCH_DELAY=y -# CONFIG_NET_SCH_INGRESS is not set +# CONFIG_NET_SCH_CLK_JIFFIES is not set +CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y +# CONFIG_NET_SCH_CLK_CPU is not set +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y -CONFIG_NET_CLS_TCINDEX=y -CONFIG_NET_CLS_ROUTE4=y +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y -CONFIG_NET_CLS_FW=y -CONFIG_NET_CLS_U32=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set -CONFIG_NET_CLS_RSVP=y -CONFIG_NET_CLS_RSVP6=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y @@ -465,6 +526,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -497,7 +560,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -509,8 +571,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set CONFIG_SGI_IP27_RTC=y +# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -518,7 +580,6 @@ CONFIG_SGI_IP27_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -527,6 +588,11 @@ CONFIG_SGI_IP27_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -544,6 +610,8 @@ CONFIG_SGI_IP27_RTC=y # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -554,12 +622,28 @@ CONFIG_SGI_IP27_RTC=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -577,11 +661,17 @@ 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_XFS_FS=m +# CONFIG_XFS_RT is not set +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set -CONFIG_AUTOFS_FS=y +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m # CONFIG_AUTOFS4_FS is not set # @@ -593,7 +683,8 @@ CONFIG_AUTOFS_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -634,13 +725,14 @@ CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y +# CONFIG_ROOT_NFS is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -672,16 +764,23 @@ CONFIG_SGI_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -695,24 +794,34 @@ CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=y CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_SERPENT=y -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=y CONFIG_CRYPTO_CAST6=y +CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=y +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m -# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig index 7cfe80b94..bdf141547 100644 --- a/arch/mips/configs/ip32_defconfig +++ b/arch/mips/configs/ip32_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:04 2005 # CONFIG_MIPS=y CONFIG_MIPS64=y @@ -10,12 +12,12 @@ CONFIG_64BIT=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -60,6 +65,7 @@ CONFIG_IOSCHED_CFQ=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -72,14 +78,16 @@ CONFIG_SGI_IP32=y # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y +CONFIG_DMA_IP32=y +CONFIG_OWN_DMA=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set +CONFIG_ARC32=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_ARC32=y -# CONFIG_FB is not set CONFIG_ARC_MEMORY=y CONFIG_ARC_PROMLIB=y @@ -114,7 +122,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -125,11 +132,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y +# CONFIG_BUILD_ELF64 is not set CONFIG_MIPS32_COMPAT=y CONFIG_COMPAT=y CONFIG_MIPS32_O32=y @@ -143,7 +165,9 @@ CONFIG_BINFMT_ELF32=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -167,11 +191,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -206,6 +245,7 @@ CONFIG_SCSI_LOGGING=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -217,13 +257,13 @@ CONFIG_SCSI_LOGGING=y CONFIG_SCSI_AIC7XXX=y CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 -# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set CONFIG_AIC7XXX_DEBUG_ENABLE=y CONFIG_AIC7XXX_DEBUG_MASK=0 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -232,6 +272,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -244,7 +285,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -296,10 +336,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -317,7 +360,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -442,6 +484,8 @@ CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set # CONFIG_SERIO_MACEPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -476,7 +520,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -496,8 +539,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -506,6 +547,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -523,13 +569,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -540,12 +587,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -559,6 +622,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -571,7 +635,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -584,6 +649,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -618,6 +684,7 @@ CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -645,16 +712,23 @@ CONFIG_SGI_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -662,9 +736,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig index 520acac13..1ca774638 100644 --- a/arch/mips/configs/it8172_defconfig +++ b/arch/mips/configs/it8172_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:05 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -26,17 +28,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,13 +51,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -69,6 +74,7 @@ CONFIG_MIPS_ITE8172=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -76,12 +82,12 @@ CONFIG_MIPS_ITE8172=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y @@ -89,7 +95,6 @@ CONFIG_ITE_BOARD_GEN=y CONFIG_IT8172_CIR=y CONFIG_IT8712=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -120,7 +125,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,6 +133,19 @@ CONFIG_HW_HAS_PCI=y # CONFIG_PCI is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -143,7 +160,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -170,13 +189,24 @@ CONFIG_MTD_CFI=y # CONFIG_MTD_JEDECPROBE is not set CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_CFI_AMDSTD is not set # CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_XIP is not set # # Mapping drivers for chip access @@ -185,14 +215,16 @@ CONFIG_MTD_CFI_INTELEXT=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_PHYSMAP_START=0x8000000 CONFIG_MTD_PHYSMAP_LEN=0x2000000 -CONFIG_MTD_PHYSMAP_BUSWIDTH=4 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 # # Self-contained MTD device drivers # # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -219,11 +251,26 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4 # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -241,7 +288,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -269,7 +315,6 @@ CONFIG_IDE_GENERIC=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -302,10 +347,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -323,7 +371,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -415,6 +462,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -453,7 +502,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -468,13 +516,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -483,6 +528,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -500,13 +550,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -525,8 +576,6 @@ CONFIG_SOUND_PRIME=y # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set -# CONFIG_SOUND_ESSSOLO1 is not set -# CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_SONICVIBES is not set CONFIG_SOUND_IT8172=y # CONFIG_SOUND_TRIDENT is not set @@ -538,12 +587,28 @@ CONFIG_SOUND_IT8172=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -557,6 +622,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -569,7 +635,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -617,6 +684,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -634,16 +702,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -651,9 +726,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig index 8eace13a3..c6eef708b 100644 --- a/arch/mips/configs/ivr_defconfig +++ b/arch/mips/configs/ivr_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:05 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -26,17 +28,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,13 +51,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -68,6 +73,7 @@ CONFIG_MIPS_IVR=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -75,19 +81,18 @@ CONFIG_MIPS_IVR=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_ITE_BOARD_GEN=y CONFIG_IT8172_CIR=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -118,7 +123,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,6 +133,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -143,7 +161,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -167,11 +187,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -189,7 +224,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -252,10 +286,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -273,7 +310,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -395,6 +431,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -431,7 +469,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -450,8 +487,6 @@ CONFIG_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -460,6 +495,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -477,13 +517,14 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -494,12 +535,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -513,6 +570,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -525,7 +583,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -571,6 +630,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -588,16 +648,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -605,9 +672,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig index 141dc6da4..757c4e88c 100644 --- a/arch/mips/configs/jaguar-atx_defconfig +++ b/arch/mips/configs/jaguar-atx_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:05 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # # CONFIG_EXPERIMENTAL is not set CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -24,6 +26,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y @@ -31,11 +34,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -43,6 +48,7 @@ CONFIG_IOSCHED_CFQ=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # @@ -60,6 +66,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set CONFIG_MOMENCO_JAGUAR_ATX=y CONFIG_JAGUAR_DMALOW=y # CONFIG_PMC_YOSEMITE is not set @@ -71,6 +78,7 @@ CONFIG_JAGUAR_DMALOW=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_LIMITED_DMA=y @@ -82,7 +90,6 @@ CONFIG_PCI_MARVELL=y CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -119,7 +126,6 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_HIGHMEM=y # CONFIG_SMP is not set # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -130,13 +136,25 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -145,7 +163,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -168,11 +188,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -228,7 +263,12 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_NETFILTER is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=m # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set @@ -282,7 +322,6 @@ CONFIG_NET_PCI=y # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_DGRS is not set CONFIG_EEPRO100=y -# CONFIG_EEPRO100_PIO is not set # CONFIG_E100 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set @@ -293,7 +332,6 @@ CONFIG_EEPRO100=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -305,6 +343,7 @@ CONFIG_EEPRO100=y # CONFIG_HAMACHI is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set CONFIG_MV643XX_ETH=y CONFIG_MV643XX_ETH_0=y @@ -388,7 +427,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -408,8 +446,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -418,6 +454,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -435,6 +476,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -445,12 +488,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -463,6 +522,7 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -475,7 +535,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -529,13 +590,15 @@ CONFIG_MSDOS_PARTITION=y # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -543,9 +606,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig index 4580138f2..e5a613906 100644 --- a/arch/mips/configs/jmr3927_defconfig +++ b/arch/mips/configs/jmr3927_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:06 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +51,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set CONFIG_TOSHIBA_JMR3927=y # CONFIG_MIPS_COBALT is not set @@ -62,6 +66,7 @@ CONFIG_TOSHIBA_JMR3927=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -69,19 +74,18 @@ CONFIG_TOSHIBA_JMR3927=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_MIPS_TX3927=y CONFIG_SWAP_IO_SPACE=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_FB=y CONFIG_TOSHIBA_BOARDS=y # @@ -111,7 +115,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set CONFIG_RTC_DS1742=y # @@ -123,13 +126,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -138,7 +154,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -162,11 +180,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -224,10 +257,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -245,7 +281,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -367,6 +402,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -391,6 +428,7 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -415,7 +453,6 @@ CONFIG_TXX927_SERIAL_CONSOLE=y # CONFIG_UNIX98_PTYS is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -435,8 +472,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -445,6 +480,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -462,6 +502,9 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set @@ -473,6 +516,7 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY 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 @@ -486,7 +530,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE is not set @@ -494,6 +537,7 @@ CONFIG_DUMMY_CONSOLE=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -504,12 +548,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -522,6 +582,7 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -534,7 +595,8 @@ CONFIG_DUMMY_CONSOLE=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -578,6 +640,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -595,16 +658,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -612,9 +682,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig index 3f9fb458b..1e7697834 100644 --- a/arch/mips/configs/lasat200_defconfig +++ b/arch/mips/configs/lasat200_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:06 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -71,6 +76,7 @@ CONFIG_LASAT_SYSCTL=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -78,19 +84,18 @@ CONFIG_LASAT_SYSCTL=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_MIPS_NILE4=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_GT64120=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -124,7 +129,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -135,6 +139,20 @@ CONFIG_PCI_LEGACY_PROC=y # CONFIG_PCI_NAMES is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -149,7 +167,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -177,13 +197,24 @@ CONFIG_MTD_CFI=y # CONFIG_MTD_JEDECPROBE is not set CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_AMDSTD_RETRY=0 # CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set # # Mapping drivers for chip access @@ -197,8 +228,10 @@ CONFIG_MTD_LASAT=y # # CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -229,11 +262,26 @@ CONFIG_MTD_LASAT=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -251,7 +299,6 @@ CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -266,7 +313,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -340,10 +386,13 @@ CONFIG_INET=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -361,7 +410,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -482,6 +530,8 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -516,7 +566,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -536,8 +585,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -546,6 +593,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -563,13 +615,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -580,12 +633,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -604,6 +673,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -616,7 +686,8 @@ CONFIG_FS_MBCACHE=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -664,6 +735,7 @@ CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -681,16 +753,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -698,9 +777,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index 3259148a2..61fb9fb97 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:53:14 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,18 +26,21 @@ CONFIG_SYSVIPC=y CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_HOTPLUG is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_MIPS_MALTA=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,12 +80,12 @@ CONFIG_MIPS_MALTA=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_GENERIC_ISA_DMA=y @@ -92,7 +98,6 @@ CONFIG_MIPS_GT64120=y CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set CONFIG_HAVE_STD_PC_SERIAL_PORT=y # @@ -119,14 +124,11 @@ 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_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -137,6 +139,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -151,7 +167,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y # # Memory Technology Devices (MTD) @@ -170,37 +188,189 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Block devices # -# CONFIG_BLK_DEV_FD is not set +CONFIG_BLK_DEV_FD=m # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_UMEM=m +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support # -# CONFIG_IDE is not set +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/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_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_IDEPCI_SHARE_IRQ is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +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 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# 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_SC1200 is not set +CONFIG_BLK_DEV_PIIX=y +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# 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_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_SCSI is not set +CONFIG_SCSI=m +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +CONFIG_CHR_DEV_ST=m +CONFIG_CHR_DEV_OSST=m +CONFIG_BLK_DEV_SR=m +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=m + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y + +# +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=m +CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_ISCSI_ATTRS=m + +# +# SCSI low-level drivers +# +CONFIG_BLK_DEV_3W_XXXX_RAID=m +CONFIG_SCSI_3W_9XXX=m +CONFIG_SCSI_ACARD=m +CONFIG_SCSI_AACRAID=m +CONFIG_SCSI_AIC7XXX=m +CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 +# CONFIG_AIC7XXX_DEBUG_ENABLE is not set +CONFIG_AIC7XXX_DEBUG_MASK=0 +CONFIG_AIC7XXX_REG_PRETTY_PRINT=y +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +CONFIG_SCSI_QLA2XXX=m +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set # # Multi-device support (RAID and LVM) # -# CONFIG_MD is not set +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=m +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m # # Fusion MPT device support # +# CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support @@ -220,52 +390,261 @@ CONFIG_NET=y # # Networking options # -# CONFIG_PACKET is not set +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_FWMARK=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_BROADCAST=y +CONFIG_IP_MROUTE=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_IPV6 is not set -# CONFIG_NETFILTER is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +CONFIG_IP_TCPDIAG_IPV6=y + +# +# IP: Virtual Server Configuration +# +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS transport protocol load balancing support +# +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_PROTO_ESP=y +CONFIG_IP_VS_PROTO_AH=y + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_IPV6_TUNNEL=m +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_LIMIT=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_MAC=m +CONFIG_IP_NF_MATCH_PKTTYPE=m +CONFIG_IP_NF_MATCH_MARK=m +CONFIG_IP_NF_MATCH_MULTIPORT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_DSCP=m +CONFIG_IP_NF_MATCH_AH_ESP=m +CONFIG_IP_NF_MATCH_LENGTH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_TCPMSS=m +CONFIG_IP_NF_MATCH_HELPER=m +CONFIG_IP_NF_MATCH_STATE=m +CONFIG_IP_NF_MATCH_CONNTRACK=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_PHYSDEV=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_IP_NF_NAT_SNMP_BASIC=m +CONFIG_IP_NF_NAT_IRC=m +CONFIG_IP_NF_NAT_FTP=m +CONFIG_IP_NF_NAT_TFTP=m +CONFIG_IP_NF_NAT_AMANDA=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_DSCP=m +CONFIG_IP_NF_TARGET_MARK=m +CONFIG_IP_NF_TARGET_CLASSIFY=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_LIMIT=m +CONFIG_IP6_NF_MATCH_MAC=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_MULTIPORT=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_MARK=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AHESP=m +CONFIG_IP6_NF_MATCH_LENGTH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_PHYSDEV=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_MARK=m +CONFIG_IP6_NF_RAW=m + +# +# Bridge: Netfilter Configuration +# +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_BROUTE=m +CONFIG_BRIDGE_EBT_T_FILTER=m +CONFIG_BRIDGE_EBT_T_NAT=m +CONFIG_BRIDGE_EBT_802_3=m +CONFIG_BRIDGE_EBT_AMONG=m +CONFIG_BRIDGE_EBT_ARP=m +CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m +CONFIG_BRIDGE_EBT_MARK=m +CONFIG_BRIDGE_EBT_PKTTYPE=m +CONFIG_BRIDGE_EBT_STP=m +CONFIG_BRIDGE_EBT_VLAN=m +CONFIG_BRIDGE_EBT_ARPREPLY=m +CONFIG_BRIDGE_EBT_DNAT=m +CONFIG_BRIDGE_EBT_MARK_T=m +CONFIG_BRIDGE_EBT_REDIRECT=m +CONFIG_BRIDGE_EBT_SNAT=m +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) # -# CONFIG_IP_SCTP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y # CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set +CONFIG_LLC=m # CONFIG_LLC2 is not set # CONFIG_IPX is not set -# CONFIG_ATALK is not set +CONFIG_ATALK=m +CONFIG_DEV_APPLETALK=y +CONFIG_IPDDP=m +CONFIG_IPDDP_ENCAP=y +CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set -# CONFIG_NET_DIVERT is not set +CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # -# CONFIG_NET_SCHED is not set -# CONFIG_NET_CLS_ROUTE is not set +CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CLK_JIFFIES=y +# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set +# CONFIG_NET_SCH_CLK_CPU is not set +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y +CONFIG_NET_CLS=y +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +# CONFIG_CLS_U32_PERF is not set +CONFIG_NET_CLS_IND=y +# CONFIG_CLS_U32_MARK is not set +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_CLS_POLICE=y # # Network testing @@ -277,10 +656,10 @@ CONFIG_XFRM=y # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set +CONFIG_DUMMY=m +CONFIG_BONDING=m +CONFIG_EQUALIZER=m +CONFIG_TUN=m # CONFIG_ETHERTAP is not set # @@ -321,7 +700,6 @@ CONFIG_PCNET32=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # CONFIG_LAN_SAA9730 is not set # @@ -335,6 +713,7 @@ CONFIG_PCNET32=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -361,6 +740,7 @@ CONFIG_PCNET32=y # 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 @@ -401,6 +781,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -435,7 +817,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -454,8 +835,6 @@ CONFIG_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -464,6 +843,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -481,13 +865,14 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -498,38 +883,85 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_QUOTA is not set +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_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +CONFIG_REISERFS_PROC_INFO=y +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +# CONFIG_XFS_RT is not set +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_MINIX_FS=m +CONFIG_ROMFS_FS=m +CONFIG_QUOTA=y +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=m +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -549,18 +981,20 @@ CONFIG_RAMFS=y # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -CONFIG_EFS_FS=y -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set +CONFIG_AFFS_FS=m +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +CONFIG_BEFS_FS=m +# CONFIG_BEFS_DEBUG is not set +CONFIG_BFS_FS=m +CONFIG_EFS_FS=m +CONFIG_CRAMFS=m +CONFIG_VXFS_FS=m # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set +CONFIG_SYSV_FS=m +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems @@ -579,6 +1013,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -594,28 +1029,104 @@ CONFIG_MSDOS_PARTITION=y # # Native Language Support # -# CONFIG_NLS is not set +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Profiling support +# +# CONFIG_PROFILING is not set # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig index 2c3c1f0a1..31b8f2ad7 100644 --- a/arch/mips/configs/mpc30x_defconfig +++ b/arch/mips/configs/mpc30x_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:07 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,14 +50,15 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set # CONFIG_CASIO_E55 is not set # CONFIG_IBM_WORKPAD is not set # CONFIG_TANBAC_TB0226 is not set @@ -75,6 +81,7 @@ CONFIG_VRC4173=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -82,18 +89,17 @@ CONFIG_VRC4173=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -122,7 +128,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -133,6 +138,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -147,7 +166,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -171,11 +192,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -234,10 +270,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -255,7 +294,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -377,6 +415,8 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -411,7 +451,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -431,8 +470,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -441,6 +478,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -458,13 +500,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -475,12 +518,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -494,6 +553,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -506,7 +566,8 @@ CONFIG_AUTOFS4_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -552,6 +613,7 @@ CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -569,16 +631,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -592,24 +661,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig index 37fbacb20..2cce682ff 100644 --- a/arch/mips/configs/ocelot_3_defconfig +++ b/arch/mips/configs/ocelot_3_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc2 -# Sun Nov 21 14:12:03 2004 +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:07 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -86,6 +86,7 @@ CONFIG_MOMENCO_OCELOT_3=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -96,7 +97,6 @@ CONFIG_PCI_MARVELL=y CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_FB=y # # CPU selection @@ -143,6 +143,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -159,6 +173,7 @@ CONFIG_TRAD_SIGNALS=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -182,11 +197,13 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set @@ -198,6 +215,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -231,6 +249,7 @@ CONFIG_SCSI_PROC_FS=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -260,14 +279,12 @@ CONFIG_SCSI_PROC_FS=y # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=m # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set @@ -346,8 +363,6 @@ CONFIG_NETFILTER=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set # # IPv6: Netfilter Configuration @@ -524,6 +539,7 @@ CONFIG_SERIO=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set # CONFIG_SERIO_RAW is not set # @@ -577,7 +593,6 @@ CONFIG_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -608,6 +623,7 @@ CONFIG_RTC=y # # Graphics support # +CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set @@ -648,6 +664,7 @@ CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -661,11 +678,25 @@ CONFIG_LOGO_LINUX_CLUT224=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -816,6 +847,11 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # @@ -834,6 +870,10 @@ CONFIG_CMDLINE="ip=any root=nfs" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig index c7eb418e3..0cbf48a62 100644 --- a/arch/mips/configs/ocelot_c_defconfig +++ b/arch/mips/configs/ocelot_c_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:07 2005 # CONFIG_MIPS=y CONFIG_MIPS64=y @@ -10,12 +12,12 @@ CONFIG_64BIT=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +26,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -59,6 +64,7 @@ CONFIG_IOSCHED_CFQ=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set CONFIG_MOMENCO_OCELOT_C=y +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -71,6 +77,7 @@ CONFIG_MOMENCO_OCELOT_C=y # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -79,7 +86,6 @@ CONFIG_IRQ_MV64340=y CONFIG_PCI_MARVELL=y CONFIG_SWAP_IO_SPACE=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -112,7 +118,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -123,11 +128,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set +# CONFIG_BUILD_ELF64 is not set CONFIG_MIPS32_COMPAT=y CONFIG_COMPAT=y CONFIG_MIPS32_O32=y @@ -141,7 +161,9 @@ CONFIG_BINFMT_ELF32=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -165,10 +187,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -225,10 +262,13 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -246,7 +286,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -369,6 +408,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -403,7 +444,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -423,8 +463,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -433,6 +471,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -450,13 +493,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -467,12 +511,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -486,6 +546,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -498,7 +559,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -546,6 +608,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -563,16 +626,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -580,9 +650,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig index 2f5c2d2f7..4043950d3 100644 --- a/arch/mips/configs/ocelot_defconfig +++ b/arch/mips/configs/ocelot_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:08 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +51,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -62,6 +66,7 @@ CONFIG_IOSCHED_CFQ=y CONFIG_MOMENCO_OCELOT=y # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -69,12 +74,12 @@ CONFIG_MOMENCO_OCELOT=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -86,7 +91,6 @@ CONFIG_SWAP_IO_SPACE=y # CONFIG_SYSCLK_83 is not set CONFIG_SYSCLK_100=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -121,7 +125,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -130,13 +133,25 @@ CONFIG_HW_HAS_PCI=y # CONFIG_PCI is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -145,7 +160,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -165,10 +182,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -192,7 +224,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -224,10 +255,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -245,7 +279,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -337,6 +370,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -371,7 +406,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -386,13 +420,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -401,6 +432,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -418,13 +454,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -434,12 +471,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -453,6 +506,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -465,7 +519,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -513,6 +568,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -530,16 +586,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -547,9 +610,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig index a6e93370f..3870af453 100644 --- a/arch/mips/configs/ocelot_g_defconfig +++ b/arch/mips/configs/ocelot_g_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:08 2005 # CONFIG_MIPS=y CONFIG_MIPS64=y @@ -10,12 +12,12 @@ CONFIG_64BIT=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +26,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -59,6 +64,7 @@ CONFIG_IOSCHED_CFQ=y # CONFIG_MOMENCO_OCELOT is not set CONFIG_MOMENCO_OCELOT_G=y # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -71,6 +77,7 @@ CONFIG_MOMENCO_OCELOT_G=y # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set @@ -82,7 +89,6 @@ CONFIG_SWAP_IO_SPACE=y # CONFIG_SYSCLK_83 is not set CONFIG_SYSCLK_100=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -115,7 +121,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -126,11 +131,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set +# CONFIG_BUILD_ELF64 is not set CONFIG_MIPS32_COMPAT=y CONFIG_COMPAT=y CONFIG_MIPS32_O32=y @@ -144,7 +164,9 @@ CONFIG_BINFMT_ELF32=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -168,10 +190,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=y # # ATA/ATAPI/MFM/RLL support @@ -228,10 +265,13 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -249,7 +289,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -372,6 +411,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -406,7 +447,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -426,8 +466,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -436,6 +474,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -453,13 +496,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -470,12 +514,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -489,6 +549,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -501,7 +562,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -549,6 +611,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -566,16 +629,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -583,9 +653,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/osprey_defconfig b/arch/mips/configs/osprey_defconfig index 11564910e..989cb9e7a 100644 --- a/arch/mips/configs/osprey_defconfig +++ b/arch/mips/configs/osprey_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:08 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,18 +80,17 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set CONFIG_NEC_OSPREY=y # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set CONFIG_VR4181=y # @@ -115,13 +120,25 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -136,7 +153,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -156,10 +175,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -183,7 +217,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -216,10 +249,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -237,7 +273,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -329,6 +364,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -363,7 +400,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -378,13 +414,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -393,6 +426,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -410,13 +448,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -426,12 +465,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -445,6 +500,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -457,7 +513,8 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -505,6 +562,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -522,16 +580,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="ip=bootp ether=46,0x03fe0300,eth0" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -539,9 +604,15 @@ CONFIG_CMDLINE="ip=bootp ether=46,0x03fe0300,eth0" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set CONFIG_LIBCRC32C=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig index 5bc312a3c..6cdabd550 100644 --- a/arch/mips/configs/pb1100_defconfig +++ b/arch/mips/configs/pb1100_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:08 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,16 +80,34 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SOC_AU1X00 is not set +CONFIG_SOC_AU1X00=y +# CONFIG_SOC_AU1000 is not set +CONFIG_SOC_AU1100=y +# CONFIG_SOC_AU1500 is not set +# CONFIG_SOC_AU1550 is not set +# CONFIG_MIPS_PB1000 is not set +CONFIG_MIPS_PB1100=y +# CONFIG_MIPS_PB1500 is not set +# CONFIG_MIPS_PB1550 is not set +# CONFIG_MIPS_DB1000 is not set +# CONFIG_MIPS_DB1100 is not set +# CONFIG_MIPS_DB1500 is not set +# CONFIG_MIPS_DB1550 is not set +# CONFIG_MIPS_BOSPORUS is not set +# CONFIG_MIPS_MIRAGE is not set +# CONFIG_MIPS_XXS1500 is not set +# CONFIG_MIPS_MTX1 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y +CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SWAP_IO_SPACE=y +# CONFIG_AU1X00_USB_DEVICE is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -110,25 +134,31 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # +CONFIG_HW_HAS_PCI=y +# CONFIG_PCI is not set CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m + +# +# PC-card bridges +# # CONFIG_TCIC is not set +# CONFIG_PCMCIA_AU1X00 is not set # # PCI Hotplug Support @@ -148,13 +178,84 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) # -# CONFIG_MTD is not set +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_CONCAT is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_AMDSTD_RETRY=0 +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_PHYSMAP is not set +CONFIG_MTD_PB1100=y +CONFIG_MTD_PB1500_BOOT=y +CONFIG_MTD_PB1500_USER=y + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set # # Parallel port support @@ -169,11 +270,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -197,7 +313,6 @@ CONFIG_BLK_DEV_LOOP=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -231,6 +346,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -244,13 +362,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -268,7 +385,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -297,6 +413,7 @@ CONFIG_NETDEVICES=y # CONFIG_NET_ETHERNET=y # CONFIG_MII is not set +# CONFIG_MIPS_AU1X00_ENET is not set # # Ethernet (1000 Mbit) @@ -318,15 +435,7 @@ CONFIG_NET_ETHERNET=y # # PCMCIA network device support # -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set +# CONFIG_NET_PCMCIA is not set # # Wan interfaces @@ -380,6 +489,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -397,6 +508,8 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_AU1X00_GPIO is not set +# CONFIG_TS_AU1X00_ADS7846 is not set # # Serial drivers @@ -406,10 +519,10 @@ CONFIG_HW_CONSOLE=y # # Non-8250 serial port support # +# CONFIG_SERIAL_AU1X00 is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -423,19 +536,16 @@ CONFIG_LEGACY_PTY_COUNT=256 CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -443,6 +553,11 @@ CONFIG_RTC=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -460,13 +575,14 @@ CONFIG_RTC=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -476,12 +592,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -508,6 +640,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -520,7 +653,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -533,6 +667,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -546,6 +681,8 @@ CONFIG_RAMFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set CONFIG_CRAMFS=m # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set @@ -568,6 +705,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -625,16 +763,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -648,24 +793,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig index aeecf8550..2aebbd2e8 100644 --- a/arch/mips/configs/pb1500_defconfig +++ b/arch/mips/configs/pb1500_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:09 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set CONFIG_SOC_AU1X00=y # CONFIG_SOC_AU1000 is not set # CONFIG_SOC_AU1100 is not set @@ -96,12 +101,12 @@ CONFIG_MIPS_PB1500=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y -CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_COHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_AU1000_USB_DEVICE is not set +# CONFIG_AU1X00_USB_DEVICE is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -128,13 +133,11 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set CONFIG_64BIT_PHYS_ADDR=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -146,15 +149,22 @@ CONFIG_PCI_NAMES=y CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_CARDBUS=y + +# +# PC-card bridges +# # CONFIG_YENTA is not set CONFIG_PD6729=m # CONFIG_I82092 is not set # CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set +CONFIG_PCCARD_NONSTATIC=m # # PCI Hotplug Support @@ -175,6 +185,7 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set @@ -200,12 +211,27 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -219,12 +245,11 @@ CONFIG_BLK_DEV_IDE=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_IDECS=m # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -238,7 +263,6 @@ CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set # CONFIG_IDEDMA_PCI_AUTO is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -317,6 +341,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -330,13 +357,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -354,7 +380,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -387,7 +412,7 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set @@ -434,13 +459,13 @@ CONFIG_MIPS_AU1X00_ENET=y # CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +CONFIG_PCMCIA_AXNET=m # # Wan interfaces @@ -497,6 +522,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -530,7 +557,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -550,14 +576,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -565,6 +589,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -582,6 +611,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -592,12 +623,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -624,6 +671,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -636,7 +684,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -649,6 +698,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -684,6 +734,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -741,16 +792,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -764,24 +822,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig index 519cd8f26..9e21edc28 100644 --- a/arch/mips/configs/pb1550_defconfig +++ b/arch/mips/configs/pb1550_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:09 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,13 +50,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +72,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +80,6 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set CONFIG_SOC_AU1X00=y # CONFIG_SOC_AU1000 is not set # CONFIG_SOC_AU1100 is not set @@ -96,11 +101,12 @@ CONFIG_MIPS_PB1550=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y -CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_COHERENT=y +CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -127,13 +133,11 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set CONFIG_64BIT_PHYS_ADDR=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -145,15 +149,22 @@ CONFIG_PCI_NAMES=y CONFIG_MMU=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # -CONFIG_PCMCIA=m +CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=m +CONFIG_CARDBUS=y + +# +# PC-card bridges +# # CONFIG_YENTA is not set CONFIG_PD6729=m # CONFIG_I82092 is not set # CONFIG_TCIC is not set -CONFIG_PCMCIA_AU1X00=m +# CONFIG_PCMCIA_AU1X00 is not set +CONFIG_PCCARD_NONSTATIC=m # # PCI Hotplug Support @@ -174,6 +185,7 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set @@ -199,12 +211,27 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -218,12 +245,11 @@ CONFIG_BLK_DEV_IDE=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_IDECS=m # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -237,7 +263,6 @@ CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set # CONFIG_IDEDMA_PCI_AUTO is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -316,6 +341,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -329,13 +357,12 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_COMPAT_IPCHAINS is not set -# CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -353,7 +380,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -431,15 +457,7 @@ CONFIG_MIPS_AU1X00_ENET=y # # PCMCIA network device support # -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_3C589=m -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_AXNET is not set +# CONFIG_NET_PCMCIA is not set # # Wan interfaces @@ -496,6 +514,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -529,7 +549,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -549,14 +568,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # # PCMCIA character devices # -# CONFIG_SYNCLINK_CS is not set +CONFIG_SYNCLINK_CS=m # CONFIG_RAW_DRIVER is not set # @@ -564,6 +581,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -581,6 +603,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -591,12 +615,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -623,6 +663,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -635,7 +676,8 @@ CONFIG_AUTOFS4_FS=m # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -648,6 +690,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -683,6 +726,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set @@ -740,16 +784,23 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -763,24 +814,34 @@ CONFIG_CRYPTO_NULL=y # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set CONFIG_CRYPTO_TWOFISH=y # CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig index 2ec393280..d0c85a400 100644 --- a/arch/mips/configs/rm200_defconfig +++ b/arch/mips/configs/rm200_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:09 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -26,6 +28,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y @@ -33,11 +36,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -47,13 +52,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -69,6 +74,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -76,22 +82,21 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set CONFIG_SNI_RM200_PCI=y # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y CONFIG_DMA_NONCOHERENT=y CONFIG_GENERIC_ISA_DMA=y CONFIG_I8259=y CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_ARC32=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_ARC32=y -# CONFIG_FB is not set CONFIG_HAVE_STD_PC_SERIAL_PORT=y CONFIG_ARC_CONSOLE=y CONFIG_ARC_MEMORY=y @@ -127,7 +132,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -140,6 +144,21 @@ CONFIG_ISA=y # CONFIG_EISA is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# +CONFIG_PCMCIA_PROBE=y + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -154,7 +173,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -218,13 +239,29 @@ CONFIG_PARIDE_ON26=m # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m -# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_SX8=m +CONFIG_BLK_DEV_UB=m CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -259,6 +296,7 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -275,7 +313,9 @@ CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_IN2000 is not set -# CONFIG_SCSI_MEGARAID is not set +CONFIG_MEGARAID_NEWGEN=y +CONFIG_MEGARAID_MM=m +CONFIG_MEGARAID_MAILBOX=m # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -287,6 +327,7 @@ CONFIG_SCSI_SPI_ATTRS=y # 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_PPA=m CONFIG_SCSI_IMM=m @@ -311,7 +352,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set @@ -333,14 +373,16 @@ CONFIG_BLK_DEV_MD=m CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=m # CONFIG_DM_CRYPT is not set -# CONFIG_DM_SNAPSHOT is not set -# CONFIG_DM_MIRROR is not set -# CONFIG_DM_ZERO is not set +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m # # Fusion MPT device support @@ -385,6 +427,9 @@ CONFIG_IP_PIMSM_V2=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration @@ -395,6 +440,7 @@ CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set @@ -404,6 +450,9 @@ CONFIG_BRIDGE_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -429,15 +478,23 @@ CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_PHYSDEV=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -449,18 +506,13 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m -CONFIG_IP_NF_COMPAT_IPCHAINS=m -CONFIG_IP_NF_COMPAT_IPFWADM=m -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m -# CONFIG_IP_NF_MATCH_ADDRTYPE is not set -# CONFIG_IP_NF_MATCH_REALM is not set # # IPv6: Netfilter Configuration @@ -480,6 +532,7 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m @@ -513,6 +566,7 @@ CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m +# CONFIG_BRIDGE_EBT_ULOG is not set CONFIG_XFRM=y # CONFIG_XFRM_USER is not set @@ -524,7 +578,6 @@ CONFIG_XFRM=y CONFIG_BRIDGE=m # CONFIG_VLAN_8021Q is not set CONFIG_DECNET=m -# CONFIG_DECNET_SIOCGIFCONF is not set # CONFIG_DECNET_ROUTER is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set @@ -534,16 +587,17 @@ CONFIG_DECNET=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y +CONFIG_NET_SCH_CLK_JIFFIES=y +# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set +# CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m @@ -551,7 +605,7 @@ CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m -CONFIG_NET_SCH_DELAY=m +CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y @@ -563,6 +617,7 @@ CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set +# CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set @@ -653,7 +708,6 @@ CONFIG_PCNET32=y # CONFIG_CS89x0 is not set # CONFIG_DGRS is not set CONFIG_EEPRO100=m -# CONFIG_EEPRO100_PIO is not set # CONFIG_E100 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set @@ -665,7 +719,6 @@ CONFIG_EEPRO100=m # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # CONFIG_LAN_SAA9730 is not set # CONFIG_NET_POCKET is not set @@ -680,6 +733,7 @@ CONFIG_EEPRO100=m # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +CONFIG_VIA_VELOCITY=m # CONFIG_TIGON3 is not set # @@ -749,6 +803,8 @@ CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_PARKBD=m # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -801,7 +857,6 @@ CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set CONFIG_PPDEV=m CONFIG_TIPAR=m -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -821,8 +876,6 @@ CONFIG_RTC=m # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -831,6 +884,16 @@ CONFIG_RTC=m # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +CONFIG_W1=m +CONFIG_W1_MATROX=m +CONFIG_W1_DS9490=m +CONFIG_W1_DS9490_BRIDGE=m +CONFIG_W1_THERM=m +CONFIG_W1_SMEM=m + # # Misc devices # @@ -848,6 +911,7 @@ CONFIG_RTC=m # # Graphics support # +# CONFIG_FB is not set # # Console display driver support @@ -855,6 +919,7 @@ CONFIG_RTC=m CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -873,6 +938,9 @@ CONFIG_USB=m CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -882,6 +950,7 @@ CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=m +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -889,6 +958,10 @@ CONFIG_USB_UHCI_HCD=m CONFIG_USB_BLUETOOTH_TTY=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set @@ -901,7 +974,7 @@ CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y @@ -930,7 +1003,6 @@ CONFIG_USB_XPAD=m # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m -CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices @@ -942,7 +1014,7 @@ CONFIG_USB_DABUSB=m # # -# USB Network adaptors +# USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m @@ -959,6 +1031,7 @@ CONFIG_USB_BELKIN=y CONFIG_USB_GENESYS=y CONFIG_USB_NET1080=y CONFIG_USB_PL2301=y +CONFIG_USB_KC2190=y # # Intelligent USB Devices/Gadgets @@ -986,6 +1059,7 @@ CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CYPRESS_M8=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m @@ -993,6 +1067,8 @@ CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_KEYSPAN_MPR=y @@ -1013,6 +1089,7 @@ CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_SAFE=m CONFIG_USB_SERIAL_SAFE_PADDED=y +# CONFIG_USB_SERIAL_TI is not set CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m @@ -1023,33 +1100,35 @@ CONFIG_USB_EZUSB=y # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set -CONFIG_USB_TIGL=m CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m CONFIG_USB_CYTHERM=m +CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m +# CONFIG_USB_IDMOUSE is not set CONFIG_USB_TEST=m +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # -CONFIG_USB_GADGET=m -CONFIG_USB_GADGET_NET2280=y -CONFIG_USB_NET2280=m -# CONFIG_USB_GADGET_PXA2XX is not set -# CONFIG_USB_GADGET_GOKU is not set -# CONFIG_USB_GADGET_SA1100 is not set -# CONFIG_USB_GADGET_DUMMY_HCD is not set -CONFIG_USB_GADGET_DUALSPEED=y -CONFIG_USB_ZERO=m -CONFIG_USB_ETH=m -# CONFIG_USB_ETH_RNDIS is not set -CONFIG_USB_GADGETFS=m -# CONFIG_USB_FILE_STORAGE is not set -# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set # # File systems @@ -1069,10 +1148,7 @@ CONFIG_REISERFS_FS=m CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y -CONFIG_JFS_FS=m -# CONFIG_JFS_POSIX_ACL is not set -# CONFIG_JFS_DEBUG is not set -# CONFIG_JFS_STATISTICS is not set +# CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set @@ -1083,6 +1159,7 @@ CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m # CONFIG_QUOTA is not set CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -1094,6 +1171,7 @@ CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -1136,7 +1214,6 @@ CONFIG_CRAMFS=m CONFIG_VXFS_FS=m CONFIG_HPFS_FS=m CONFIG_QNX4FS_FS=m -# CONFIG_QNX4FS_RW is not set CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set @@ -1158,11 +1235,13 @@ CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_POSIX is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y @@ -1225,7 +1304,7 @@ CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m -# CONFIG_NLS_ASCII is not set +CONFIG_NLS_ASCII=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m @@ -1241,16 +1320,23 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -1264,6 +1350,7 @@ CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m @@ -1271,17 +1358,26 @@ CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_MICHAEL_MIC=m # CONFIG_CRYPTO_CRC32C is not set CONFIG_CRYPTO_TEST=m +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig index 41d73cf45..84978b707 100644 --- a/arch/mips/configs/sb1250-swarm_defconfig +++ b/arch/mips/configs/sb1250-swarm_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:10 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,11 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -24,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -44,6 +50,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y @@ -51,7 +58,6 @@ CONFIG_STOP_MACHINE=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -67,6 +73,7 @@ CONFIG_STOP_MACHINE=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -74,7 +81,6 @@ CONFIG_STOP_MACHINE=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set CONFIG_SIBYTE_SB1xxx_SOC=y CONFIG_SIBYTE_SWARM=y @@ -104,13 +110,13 @@ CONFIG_SIBYTE_CFE=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_COHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -137,8 +143,7 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_SIBYTE_DMA_PAGEOPS is not set -# CONFIG_CPU_HAS_PREFETCH is not set -CONFIG_VTAG_ICACHE=y +CONFIG_CPU_HAS_PREFETCH=y CONFIG_SB1_PASS_1_WORKAROUNDS=y # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set @@ -149,7 +154,6 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_SMP=y CONFIG_NR_CPUS=2 # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -160,18 +164,26 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set - -# -# MIPS initrd options -# -# CONFIG_EMBEDDED_RAMDISK is not set # # Device Drivers @@ -180,7 +192,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -204,13 +218,28 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# 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_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=9220 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -228,7 +257,6 @@ CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDETAPE=y CONFIG_BLK_DEV_IDEFLOPPY=y # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -292,10 +320,13 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -313,7 +344,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -347,7 +377,6 @@ CONFIG_NETDEVICES=y # CONFIG_NET_ETHERNET=y CONFIG_MII=y -CONFIG_NET_SB1250_MAC=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -369,6 +398,7 @@ CONFIG_NET_SB1250_MAC=y # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set +CONFIG_NET_SB1250_MAC=y # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set @@ -428,6 +458,8 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -440,6 +472,8 @@ CONFIG_SERIO_SERPORT=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -458,7 +492,6 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -478,7 +511,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -487,6 +519,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -504,6 +541,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -514,12 +553,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -537,6 +592,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -549,7 +605,8 @@ CONFIG_FS_POSIX_ACL=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -595,6 +652,7 @@ CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -612,17 +670,24 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # CONFIG_SB1XXX_CORELIS is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -636,24 +701,34 @@ CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=y CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_SERPENT=y -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig index b641d81e4..7c718a429 100644 --- a/arch/mips/configs/sead_defconfig +++ b/arch/mips/configs/sead_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:10 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y # CONFIG_SYSVIPC is not set # CONFIG_BSD_PROCESS_ACCT is not set @@ -30,11 +32,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,7 +49,6 @@ CONFIG_IOSCHED_CFQ=y # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -61,6 +64,7 @@ CONFIG_MIPS_SEAD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -68,19 +72,18 @@ CONFIG_MIPS_SEAD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_BOARDS_GEN=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -107,19 +110,30 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y -# CONFIG_VTAG_ICACHE is not set # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -127,12 +141,6 @@ CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# -# MIPS initrd options -# -CONFIG_EMBEDDED_RAMDISK=y -CONFIG_EMBEDDED_RAMDISK_IMAGE="ramdisk.gz" - # # Device Drivers # @@ -140,7 +148,9 @@ CONFIG_EMBEDDED_RAMDISK_IMAGE="ramdisk.gz" # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -160,12 +170,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=18432 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=y +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -189,7 +213,6 @@ CONFIG_BLK_DEV_INITRD=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -237,6 +260,8 @@ CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=y # # Input Device Drivers @@ -271,7 +296,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_UNIX98_PTYS is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -286,13 +310,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -301,6 +322,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -317,13 +343,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -333,12 +360,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -356,6 +399,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -368,7 +412,8 @@ CONFIG_FS_POSIX_ACL=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -410,16 +455,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -427,9 +479,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=y +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig index 9933eede8..e01727cd0 100644 --- a/arch/mips/configs/tb0226_defconfig +++ b/arch/mips/configs/tb0226_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:12 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,14 +50,15 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set # CONFIG_CASIO_E55 is not set # CONFIG_IBM_WORKPAD is not set CONFIG_TANBAC_TB0226=y @@ -73,6 +79,7 @@ CONFIG_TANBAC_TB0226=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -80,18 +87,17 @@ CONFIG_TANBAC_TB0226=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_FB=y # # CPU selection @@ -120,7 +126,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,6 +134,19 @@ CONFIG_HW_HAS_PCI=y # CONFIG_PCI is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -143,7 +161,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -163,12 +183,27 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -187,7 +222,6 @@ CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDEFLOPPY is not set CONFIG_BLK_DEV_IDESCSI=y # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -226,13 +260,12 @@ CONFIG_SCSI_CONSTANTS=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -247,7 +280,6 @@ CONFIG_SCSI_CONSTANTS=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -270,7 +302,6 @@ CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y @@ -285,8 +316,13 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -304,7 +340,6 @@ CONFIG_SYN_COOKIES=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -403,6 +438,8 @@ CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -437,7 +474,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -452,13 +488,10 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -467,6 +500,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -484,13 +522,15 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE is not set @@ -498,6 +538,7 @@ CONFIG_DUMMY_CONSOLE=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -517,12 +558,28 @@ CONFIG_SOUND=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -536,6 +593,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=m # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y @@ -568,6 +626,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -605,6 +664,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m CONFIG_SMB_NLS_DEFAULT=y CONFIG_SMB_NLS_REMOTE="cp932" @@ -663,16 +723,23 @@ CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -680,11 +747,17 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +CONFIG_CRC_CCITT=m # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig index 5be7f568f..c6ba3de27 100644 --- a/arch/mips/configs/tb0229_defconfig +++ b/arch/mips/configs/tb0229_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:12 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,22 +50,24 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set # CONFIG_CASIO_E55 is not set # CONFIG_IBM_WORKPAD is not set # CONFIG_TANBAC_TB0226 is not set CONFIG_TANBAC_TB0229=y +CONFIG_TANBAC_TB0219=y # CONFIG_VICTOR_MPC30X is not set # CONFIG_ZAO_CAPCELLA is not set CONFIG_PCI_VR41XX=y -CONFIG_VRC4173=y +# CONFIG_VRC4173 is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set # CONFIG_MACH_DECSTATION is not set @@ -75,6 +82,7 @@ CONFIG_VRC4173=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -82,19 +90,17 @@ CONFIG_VRC4173=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set -CONFIG_TANBAC_TB0219=y # # CPU selection @@ -123,7 +129,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -134,6 +139,20 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Executable file formats # @@ -148,7 +167,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -172,14 +193,29 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -227,7 +263,6 @@ CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y @@ -243,10 +278,13 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -264,7 +302,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -297,7 +334,7 @@ CONFIG_DUMMY=m # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -307,7 +344,26 @@ CONFIG_NET_ETHERNET=y # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set -# CONFIG_NET_PCI is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=y +# 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=y +# CONFIG_E100 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO 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_LAN_SAA9730 is not set # # Ethernet (1000 Mbit) @@ -320,6 +376,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -396,6 +453,8 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -430,7 +489,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -450,8 +508,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -460,6 +516,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -477,13 +538,14 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -494,12 +556,28 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -515,6 +593,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set CONFIG_JFS_FS=m # CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_XFS_FS=y @@ -526,6 +605,7 @@ CONFIG_XFS_POSIX_ACL=y CONFIG_ROMFS_FS=m # CONFIG_QUOTA is not set CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y @@ -558,6 +638,7 @@ CONFIG_SYSFS=y CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -595,6 +676,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m CONFIG_SMB_NLS_DEFAULT=y CONFIG_SMB_NLS_REMOTE="cp932" @@ -653,16 +735,23 @@ CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # -CONFIG_CROSSCOMPILE=y -CONFIG_CMDLINE="" # CONFIG_DEBUG_KERNEL is not set +CONFIG_CROSSCOMPILE=y +CONFIG_CMDLINE="mem=64M console=ttyS0,38400 ip=bootp root=/dev/nfs" # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -670,11 +759,17 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m -# CONFIG_CRC32 is not set +CONFIG_CRC_CCITT=m +CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig index e0bc0d0b2..915c43b6e 100644 --- a/arch/mips/configs/workpad_defconfig +++ b/arch/mips/configs/workpad_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:12 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,17 +27,20 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -45,14 +50,15 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set CONFIG_MACH_VR41XX=y +# CONFIG_NEC_CMBVR4133 is not set # CONFIG_CASIO_E55 is not set CONFIG_IBM_WORKPAD=y # CONFIG_TANBAC_TB0226 is not set @@ -74,6 +80,7 @@ CONFIG_VRC4171=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -81,18 +88,17 @@ CONFIG_VRC4171=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set # CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_NONCOHERENT=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -121,7 +127,6 @@ CONFIG_PAGE_SIZE_4KB=y # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -129,6 +134,20 @@ CONFIG_CPU_HAS_SYNC=y CONFIG_ISA=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# +CONFIG_PCMCIA_PROBE=y + +# +# PCI Hotplug Support +# + # # Executable file formats # @@ -143,7 +162,9 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -165,10 +186,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -186,7 +222,6 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -220,7 +255,6 @@ CONFIG_IDE_GENERIC=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -251,10 +285,13 @@ CONFIG_IP_MULTICAST=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) @@ -272,7 +309,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -380,6 +416,8 @@ CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -414,7 +452,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -442,13 +479,10 @@ CONFIG_WATCHDOG=y # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -457,6 +491,11 @@ CONFIG_WATCHDOG=y # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -474,6 +513,7 @@ CONFIG_WATCHDOG=y # # Graphics support # +# CONFIG_FB is not set # # Console display driver support @@ -481,6 +521,7 @@ CONFIG_WATCHDOG=y # CONFIG_VGA_CONSOLE is not set # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -490,12 +531,28 @@ CONFIG_DUMMY_CONSOLE=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -513,6 +570,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y @@ -525,7 +583,8 @@ CONFIG_AUTOFS4_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -572,6 +631,7 @@ CONFIG_LOCKD=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -589,16 +649,23 @@ CONFIG_MSDOS_PARTITION=y # # CONFIG_NLS is not set +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -606,9 +673,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig index bf259d809..562f2b804 100644 --- a/arch/mips/configs/yosemite_defconfig +++ b/arch/mips/configs/yosemite_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:13 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # # CONFIG_EXPERIMENTAL is not set CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y -CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -24,18 +26,22 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -43,7 +49,9 @@ CONFIG_IOSCHED_CFQ=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y # # Machine selection @@ -60,6 +68,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set CONFIG_PMC_YOSEMITE=y # CONFIG_HYPERTRANSPORT is not set @@ -71,13 +80,15 @@ CONFIG_PMC_YOSEMITE=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_DMA_COHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_IRQ_CPU=y CONFIG_IRQ_CPU_RM7K=y +CONFIG_IRQ_CPU_RM9K=y +CONFIG_SWAP_IO_SPACE=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_FB is not set # # CPU selection @@ -110,9 +121,9 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y CONFIG_HIGHMEM=y -# CONFIG_SMP is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=2 # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -123,13 +134,25 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_BINFMT_IRIX is not set # # Device Drivers @@ -138,7 +161,10 @@ CONFIG_TRAD_SIGNALS=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -161,11 +187,26 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set +# 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_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -222,7 +263,12 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_NETFILTER is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=m # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set @@ -362,7 +408,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -374,7 +419,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set +CONFIG_GEN_RTC=y +CONFIG_GEN_RTC_X=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -382,8 +428,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -392,6 +436,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -409,6 +458,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -419,12 +470,28 @@ CONFIG_LEGACY_PTY_COUNT=256 # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -437,6 +504,7 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -449,7 +517,8 @@ CONFIG_LEGACY_PTY_COUNT=256 # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -460,6 +529,7 @@ CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -503,13 +573,27 @@ CONFIG_MSDOS_PARTITION=y # # Kernel hacking # +CONFIG_DEBUG_KERNEL=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_HIGHMEM is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_KGDB is not set +# CONFIG_RUNTIME_DEBUG is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -517,9 +601,15 @@ CONFIG_CMDLINE="" # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # -CONFIG_CRC16=m +# CONFIG_CRC_CCITT is not set # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/ddb5xxx/common/Makefile b/arch/mips/ddb5xxx/common/Makefile index b2d4800a6..bc44e3032 100644 --- a/arch/mips/ddb5xxx/common/Makefile +++ b/arch/mips/ddb5xxx/common/Makefile @@ -2,4 +2,4 @@ # Makefile for the common code of NEC DDB-Vrc5xxx board # -obj-y += irq.o nile4.o prom.o rtc_ds1386.o +obj-y += nile4.o prom.o rtc_ds1386.o diff --git a/arch/mips/ddb5xxx/ddb5074/irq.c b/arch/mips/ddb5xxx/ddb5074/irq.c index 547386de4..45088a1be 100644 --- a/arch/mips/ddb5xxx/ddb5074/irq.c +++ b/arch/mips/ddb5xxx/ddb5074/irq.c @@ -4,7 +4,6 @@ * Copyright (C) 2000 Geert Uytterhoeven * Sony Software Development Center Europe (SDCE), Brussels */ -#include #include #include #include @@ -134,14 +133,8 @@ void ddb_8254timer_irq(void) printk("ddb_8254timer_irq called\n"); } -void __init ddb_irq_setup(void) +void __init arch_init_irq(void) { -#ifdef CONFIG_KGDB - if (remote_debug) - set_debug_traps(); - breakpoint(); /* you may move this line to whereever you want :-) */ -#endif - /* setup cascade interrupts */ setup_irq(NILE4_IRQ_BASE + NILE4_INT_INTE, &irq_cascade); setup_irq(CPU_IRQ_BASE + CPU_NILE4_CASCADE, &irq_cascade); @@ -163,6 +156,4 @@ void __init ddb_irq_setup(void) /* Enable the interrupt cascade */ nile4_enable_irq(NILE4_IRQ_BASE+IRQ_I8259_CASCADE); - - } diff --git a/arch/mips/ddb5xxx/ddb5074/nile4_pic.c b/arch/mips/ddb5xxx/ddb5074/nile4_pic.c index 7c99c8192..68c127cd7 100644 --- a/arch/mips/ddb5xxx/ddb5074/nile4_pic.c +++ b/arch/mips/ddb5xxx/ddb5074/nile4_pic.c @@ -222,7 +222,6 @@ static hw_irq_controller nile4_irq_controller = { void nile4_irq_setup(u32 base) { int i; - extern irq_desc_t irq_desc[]; irq_base=base; @@ -258,7 +257,6 @@ void nile4_irq_setup(u32 base) { irq_desc[i].depth = 1; irq_desc[i].handler = &nile4_irq_controller; } - } #if defined(CONFIG_RUNTIME_DEBUG) diff --git a/arch/mips/ddb5xxx/ddb5074/setup.c b/arch/mips/ddb5xxx/ddb5074/setup.c index d652aec27..a73a5978d 100644 --- a/arch/mips/ddb5xxx/ddb5074/setup.c +++ b/arch/mips/ddb5xxx/ddb5074/setup.c @@ -4,7 +4,6 @@ * Copyright (C) 2000 Geert Uytterhoeven * Sony Software Development Center Europe (SDCE), Brussels */ -#include #include #include #include @@ -26,11 +25,6 @@ #include #include -#ifdef CONFIG_KGDB -extern void rs_kgdb_hook(int); -extern void breakpoint(void); -#endif - static void (*back_to_prom) (void) = (void (*)(void)) 0xbfc00000; static void ddb_machine_restart(char *command) @@ -63,7 +57,6 @@ static void ddb_machine_power_off(void) } while (1); } -extern void ddb_irq_setup(void); extern void rtc_ds1386_init(unsigned long base); extern void (*board_timer_setup) (struct irqaction * irq); @@ -94,9 +87,6 @@ static void __init ddb_time_init(void) static void __init ddb5074_setup(void) { - extern int panic_timeout; - - irq_setup = ddb_irq_setup; set_io_port_base(NILE4_PCI_IO_BASE); isa_slot_offset = NILE4_PCI_MEM_BASE; board_timer_setup = ddb_timer_init; diff --git a/arch/mips/ddb5xxx/ddb5476/irq.c b/arch/mips/ddb5xxx/ddb5476/irq.c index 6a1202aec..5388b5868 100644 --- a/arch/mips/ddb5xxx/ddb5476/irq.c +++ b/arch/mips/ddb5xxx/ddb5476/irq.c @@ -115,7 +115,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *irqaction); extern void mips_cpu_irq_init(u32 irq_base); extern void vrc5476_irq_init(u32 irq_base); -void __init ddb5476_irq_setup(void) +void __init arch_init_irq(void) { /* hardware initialization */ nile4_irq_setup(); diff --git a/arch/mips/ddb5xxx/ddb5476/setup.c b/arch/mips/ddb5xxx/ddb5476/setup.c index 2c53c7a47..71531f814 100644 --- a/arch/mips/ddb5xxx/ddb5476/setup.c +++ b/arch/mips/ddb5xxx/ddb5476/setup.c @@ -4,7 +4,6 @@ * Copyright (C) 2000 Geert Uytterhoeven * Sony Software Development Center Europe (SDCE), Brussels */ -#include #include #include #include @@ -36,10 +35,6 @@ #define TIMER_IRQ (VRC5476_IRQ_BASE + VRC5476_IRQ_GPT) #endif -#ifdef CONFIG_KGDB -extern void breakpoint(void); -#endif - static void (*back_to_prom) (void) = (void (*)(void)) 0xbfc00000; static void ddb_machine_restart(char *command) @@ -70,7 +65,6 @@ static void ddb_machine_power_off(void) while (1); } -extern void ddb_irq_setup(void); extern void rtc_ds1386_init(unsigned long base); static void __init ddb_time_init(void) @@ -129,14 +123,9 @@ static struct { static void ddb5476_board_init(void); -extern void ddb5476_irq_setup(void); -extern void (*irq_setup)(void); static void __init ddb5476_setup(void) { - extern int panic_timeout; - - irq_setup = ddb5476_irq_setup; set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE)); board_time_init = ddb_time_init; diff --git a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c index c662dd209..a77682be0 100644 --- a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c +++ b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c @@ -66,15 +66,14 @@ static hw_irq_controller vrc5476_irq_controller = { void __init vrc5476_irq_init(u32 base) { - extern irq_desc_t irq_desc[]; u32 i; irq_base = base; for (i= base; i< base + NUM_VRC5476_IRQ; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = NULL; - irq_desc[i].depth = 1; - irq_desc[i].handler = &vrc5476_irq_controller; + irq_desc[i].depth = 1; + irq_desc[i].handler = &vrc5476_irq_controller; } } diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c index dfc2559aa..5f027bfa4 100644 --- a/arch/mips/ddb5xxx/ddb5477/irq.c +++ b/arch/mips/ddb5xxx/ddb5477/irq.c @@ -79,11 +79,8 @@ extern asmlinkage void ddb5477_handle_int(void); extern int setup_irq(unsigned int irq, struct irqaction *irqaction); static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; -void -ddb5477_irq_setup(void) +void __init arch_init_irq(void) { - db_run(printk("ddb5477_irq_setup invoked.\n")); - /* by default, we disable all interrupts and route all vrc5477 * interrupts to pin 0 (irq 2) */ ddb_out32(DDB_INTCTRL0, 0); diff --git a/arch/mips/ddb5xxx/ddb5477/irq_5477.c b/arch/mips/ddb5xxx/ddb5477/irq_5477.c index ab8b838f9..0d5e70620 100644 --- a/arch/mips/ddb5xxx/ddb5477/irq_5477.c +++ b/arch/mips/ddb5xxx/ddb5477/irq_5477.c @@ -100,10 +100,8 @@ hw_irq_controller vrc5477_irq_controller = { NULL /* no affinity stuff for UP */ }; -void -vrc5477_irq_init(u32 irq_base) +void __init vrc5477_irq_init(u32 irq_base) { - extern irq_desc_t irq_desc[]; u32 i; for (i= irq_base; i< irq_base+ NUM_5477_IRQ; i++) { diff --git a/arch/mips/ddb5xxx/ddb5477/setup.c b/arch/mips/ddb5xxx/ddb5477/setup.c index dc02a3a80..15c6e543b 100644 --- a/arch/mips/ddb5xxx/ddb5477/setup.c +++ b/arch/mips/ddb5xxx/ddb5477/setup.c @@ -3,6 +3,8 @@ * Copyright 2001 MontaVista Software Inc. * Author: jsun@mvista.com or jsun@junsun.net * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * arch/mips/ddb5xxx/ddb5477/setup.c * Setup file for DDB5477. * @@ -35,7 +37,6 @@ #include #include #include -#include #include @@ -165,20 +166,15 @@ static void __init ddb_timer_setup(struct irqaction *irq) } static void ddb5477_board_init(void); -extern void ddb5477_irq_setup(void); -extern void (*irq_setup)(void); extern struct pci_controller ddb5477_ext_controller; extern struct pci_controller ddb5477_io_controller; static int ddb5477_setup(void) { - extern int panic_timeout; - /* initialize board - we don't trust the loader */ ddb5477_board_init(); - irq_setup = ddb5477_irq_setup; set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE)); board_time_init = ddb_time_init; diff --git a/arch/mips/dec/boot/decstation.c b/arch/mips/dec/boot/decstation.c index f7e3dc366..56fd42775 100644 --- a/arch/mips/dec/boot/decstation.c +++ b/arch/mips/dec/boot/decstation.c @@ -1,7 +1,6 @@ /* * arch/mips/dec/decstation.c */ -#include #define RELOC #define INITRD @@ -26,7 +25,6 @@ #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c)) extern int _ftext, _end; /* begin and end of kernel image */ -extern void *__rd_start, *__rd_end; /* begin and end of ramdisk image */ extern void kernel_entry(int, char **, unsigned long, int *); void * memcpy(void * dest, const void *src, unsigned int count) @@ -81,11 +79,5 @@ void dec_entry(int argc, char **argv, rex_clear_cache(); } -#ifdef CONFIG_BLK_DEV_INITRD - LOADER_TYPE = 1; - INITRD_START = (long)&__rd_start; - INITRD_SIZE = (long)&__rd_end - (long)&__rd_start; -#endif - kernel_entry(argc, argv, magic, prom_vec); } diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c index 98474ac7a..d5bca5d23 100644 --- a/arch/mips/dec/ioasic-irq.c +++ b/arch/mips/dec/ioasic-irq.c @@ -21,7 +21,7 @@ #include -static spinlock_t ioasic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ioasic_lock); static int ioasic_irq_base; diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c index dfa505e7f..e0bfcd152 100644 --- a/arch/mips/dec/kn02-irq.c +++ b/arch/mips/dec/kn02-irq.c @@ -29,7 +29,7 @@ * There is no default value -- it has to be initialized. */ u32 cached_kn02_csr; -spinlock_t kn02_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(kn02_lock); static int kn02_irq_base; diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index 83b079abd..6a69309ba 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -8,7 +8,6 @@ * Copyright (C) 1998 Harald Koerfgen * Copyright (C) 2000, 2001, 2002, 2003 Maciej W. Rozycki */ -#include #include #include #include @@ -48,11 +47,6 @@ extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs); extern asmlinkage void decstation_handle_int(void); -#ifdef CONFIG_BLK_DEV_INITRD -extern unsigned long initrd_start, initrd_end; -extern void * __rd_start, * __rd_end; -#endif - spinlock_t ioasic_ssr_lock; volatile u32 *ioasic_base; @@ -136,11 +130,6 @@ extern void dec_timer_setup(struct irqaction *); static void __init decstation_setup(void) { -#ifdef CONFIG_BLK_DEV_INITRD - ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); - initrd_start = (unsigned long)&__rd_start; - initrd_end = (unsigned long)&__rd_end; -#endif board_be_init = dec_be_init; board_time_init = dec_time_init; board_timer_setup = dec_timer_setup; @@ -701,7 +690,7 @@ void __init dec_init_kn03(void) } /* dec_init_kn03 */ -void __init init_IRQ(void) +void __init arch_init_irq(void) { switch (mips_machtype) { case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */ diff --git a/arch/mips/defconfig b/arch/mips/defconfig index 8bc7792d6..d55fe6659 100644 --- a/arch/mips/defconfig +++ b/arch/mips/defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:48:59 2005 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -11,12 +13,12 @@ CONFIG_MIPS32=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -25,6 +27,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y @@ -32,11 +35,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,13 +51,13 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y # # Machine selection # # CONFIG_MACH_JAZZ is not set -# CONFIG_BAGET_MIPS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_TOSHIBA_JMR3927 is not set # CONFIG_MIPS_COBALT is not set @@ -68,6 +73,7 @@ CONFIG_KMOD=y # CONFIG_MOMENCO_OCELOT is not set # CONFIG_MOMENCO_OCELOT_G is not set # CONFIG_MOMENCO_OCELOT_C is not set +# CONFIG_MOMENCO_OCELOT_3 is not set # CONFIG_MOMENCO_JAGUAR_ATX is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_DDB5074 is not set @@ -75,22 +81,21 @@ CONFIG_KMOD=y # CONFIG_DDB5477 is not set # CONFIG_NEC_OSPREY is not set CONFIG_SGI_IP22=y -# CONFIG_SGI_IP32 is not set # CONFIG_SOC_AU1X00 is not set # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set # CONFIG_TOSHIBA_RBTX4927 is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y CONFIG_DMA_NONCOHERENT=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_IRQ_CPU=y CONFIG_SWAP_IO_SPACE=y +CONFIG_ARC32=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_ARC32=y -# CONFIG_FB is not set CONFIG_ARC_CONSOLE=y CONFIG_ARC_PROMLIB=y @@ -126,7 +131,6 @@ CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_LLDSCD=y CONFIG_CPU_HAS_SYNC=y # CONFIG_PREEMPT is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # # Bus options (PCI, PCMCIA, EISA, ISA, TC) @@ -134,13 +138,25 @@ CONFIG_CPU_HAS_SYNC=y # CONFIG_EISA is not set CONFIG_MMU=y +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_TRAD_SIGNALS=y -CONFIG_BINFMT_IRIX=y # # Device Drivers @@ -149,7 +165,9 @@ CONFIG_BINFMT_IRIX=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -169,10 +187,25 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Block devices # # CONFIG_BLK_DEV_FD is not set +# 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 is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -207,14 +240,13 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FC_ATTRS is not set +CONFIG_SCSI_ISCSI_ATTRS=m # # SCSI low-level drivers # CONFIG_SGIWD93_SCSI=y -# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_SATA is not set -# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_DEBUG is not set # @@ -229,7 +261,6 @@ CONFIG_SGIWD93_SCSI=y # # IEEE 1394 (FireWire) support # -# CONFIG_IEEE1394 is not set # # I2O device support @@ -263,6 +294,9 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=m +CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration @@ -302,6 +336,7 @@ CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set @@ -310,6 +345,9 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -334,15 +372,23 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -354,18 +400,13 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m -CONFIG_IP_NF_COMPAT_IPCHAINS=m -CONFIG_IP_NF_COMPAT_IPFWADM=m -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_MATCH_ADDRTYPE=m -CONFIG_IP_NF_MATCH_REALM=m # # IPv6: Netfilter Configuration @@ -414,16 +455,17 @@ CONFIG_SCTP_HMAC_MD5=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y +# CONFIG_NET_SCH_CLK_JIFFIES is not set +CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y +# CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m @@ -431,7 +473,7 @@ CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m -CONFIG_NET_SCH_DELAY=m +CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y @@ -443,6 +485,7 @@ CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set +# CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set @@ -515,7 +558,7 @@ CONFIG_INPUT=y # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV=m CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 @@ -533,6 +576,8 @@ CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_RAW=m # # Input Device Drivers @@ -543,7 +588,10 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_SERIAL=m +# CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -569,7 +617,6 @@ CONFIG_SERIAL_CORE=m CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -588,17 +635,14 @@ CONFIG_WATCHDOG=y # CONFIG_SOFT_WATCHDOG is not set CONFIG_INDYDOG=m # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set CONFIG_SGI_DS1286=m +# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set # CONFIG_DRM is not set CONFIG_RAW_DRIVER=m CONFIG_MAX_RAW_DEVS=256 @@ -608,6 +652,11 @@ CONFIG_MAX_RAW_DEVS=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -625,12 +674,12 @@ CONFIG_MAX_RAW_DEVS=256 # # Graphics support # +# CONFIG_FB is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_SGI_NEWPORT_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FONT_8x16=y @@ -643,6 +692,7 @@ CONFIG_LOGO=y # CONFIG_LOGO_LINUX_VGA16 is not set # CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_LOGO_SGI_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -652,12 +702,28 @@ CONFIG_LOGO_SGI_CLUT224=y # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # File systems # @@ -684,6 +750,7 @@ CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -695,6 +762,7 @@ CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -754,10 +822,17 @@ CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set +CONFIG_CODA_FS=m +# CONFIG_CODA_FS_OLD_API is not set # CONFIG_AFS_FS is not set # @@ -824,16 +899,23 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # +# CONFIG_DEBUG_KERNEL is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" -# CONFIG_DEBUG_KERNEL is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -841,30 +923,40 @@ CONFIG_CMDLINE="" # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_BLOWFISH=y -CONFIG_CRYPTO_TWOFISH=y -CONFIG_CRYPTO_SERPENT=y -CONFIG_CRYPTO_AES=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m -# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# # # Library routines # -CONFIG_CRC16=m -# CONFIG_CRC32 is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=m CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y diff --git a/arch/mips/galileo-boards/ev96100/irq.c b/arch/mips/galileo-boards/ev96100/irq.c index 0e1ee11d9..97bf094da 100644 --- a/arch/mips/galileo-boards/ev96100/irq.c +++ b/arch/mips/galileo-boards/ev96100/irq.c @@ -59,9 +59,8 @@ asmlinkage void ev96100_cpu_irq(unsigned int pendin) do_IRQ(ffz8(pending >> 8), regs); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { set_except_vector(0, ev96100IRQ); - init_generic_irq(); mips_cpu_irq_init(0); } diff --git a/arch/mips/galileo-boards/ev96100/time.c b/arch/mips/galileo-boards/ev96100/time.c index 10189b95d..bff5b1c17 100644 --- a/arch/mips/galileo-boards/ev96100/time.c +++ b/arch/mips/galileo-boards/ev96100/time.c @@ -32,6 +32,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -73,6 +74,9 @@ void mips_timer_interrupt(struct pt_regs *regs) do { kstat_this_cpu.irqs[irq]++; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c index 44f33caf2..2287b5953 100644 --- a/arch/mips/gt64120/common/time.c +++ b/arch/mips/gt64120/common/time.c @@ -36,6 +36,9 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) handled = 1; irq_src &= ~0x00000800; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } GT_WRITE(GT_INTRCAUSE_OFS, 0); @@ -62,7 +65,6 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) */ void gt64120_time_init(void) { - extern irq_desc_t irq_desc[NR_IRQS]; static struct irqaction timer; /* Disable timer first */ diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c index 537eab3fd..3b186159b 100644 --- a/arch/mips/gt64120/ev64120/irq.c +++ b/arch/mips/gt64120/ev64120/irq.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -119,7 +119,7 @@ void gt64120_irq_setup(void) /* Sets the exception_handler array. */ set_except_vector(0, galileo_handle_int); - cli(); + local_irq_disable(); /* * Enable timer. Other interrupts will be enabled as they are @@ -128,7 +128,7 @@ void gt64120_irq_setup(void) set_c0_status(IE_IRQ2); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; @@ -138,7 +138,7 @@ void __init init_IRQ(void) irq_desc[i].handler = &no_irq_type; irq_desc[i].action = NULL; irq_desc[i].depth = 0; - irq_desc[i].lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&irq_desc[i].lock); } gt64120_irq_setup(); diff --git a/arch/mips/gt64120/momenco_ocelot/dbg_io.c b/arch/mips/gt64120/momenco_ocelot/dbg_io.c index 3ef3584cf..8720bccfd 100644 --- a/arch/mips/gt64120/momenco_ocelot/dbg_io.c +++ b/arch/mips/gt64120/momenco_ocelot/dbg_io.c @@ -1,6 +1,6 @@ #include -#if defined(CONFIG_KGDB) +#ifdef CONFIG_KGDB #include /* For the serial port location and base baud */ diff --git a/arch/mips/gt64120/momenco_ocelot/irq.c b/arch/mips/gt64120/momenco_ocelot/irq.c index 681227780..4f108da71 100644 --- a/arch/mips/gt64120/momenco_ocelot/irq.c +++ b/arch/mips/gt64120/momenco_ocelot/irq.c @@ -28,7 +28,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ -#include #include #include #include @@ -41,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,7 +50,7 @@ extern asmlinkage void ocelot_handle_int(void); -void __init init_IRQ(void) +void __init arch_init_irq(void) { /* * Clear all of the interrupts while we change the able around a bit. @@ -63,13 +62,6 @@ void __init init_IRQ(void) /* Sets the first-level interrupt dispatcher. */ set_except_vector(0, ocelot_handle_int); - init_generic_irq(); mips_cpu_irq_init(0); rm7k_cpu_irq_init(8); - -#ifdef CONFIG_KGDB - printk("start kgdb ...\n"); - set_debug_traps(); - breakpoint(); /* you may move this line to whereever you want :-) */ -#endif } diff --git a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c index 58457bca9..d610f8c17 100644 --- a/arch/mips/gt64120/momenco_ocelot/setup.c +++ b/arch/mips/gt64120/momenco_ocelot/setup.c @@ -304,7 +304,7 @@ static void __init momenco_ocelot_setup(void) } /* Fix up the DiskOnChip mapping */ - GT_WRITE(0x468, 0xfef73); + GT_WRITE(GT_DEV_B3_OFS, 0xfef73); } early_initcall(momenco_ocelot_setup); @@ -322,8 +322,8 @@ static void __init setup_l3cache(unsigned long size) printk("Enabling L3 cache..."); /* Enable the L3 cache in the GT64120A's CPU Configuration register */ - tmp = GT_READ(0); - GT_WRITE(0, tmp | (1<<14)); + tmp = GT_READ(GT_CPU_OFS); + GT_WRITE(GT_CPU_OFS, tmp | (1<<14)); /* Enable the L3 cache in the CPU */ set_c0_config(1<<12 /* CONF_TE */); diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c index 4be10d820..cb71b9024 100644 --- a/arch/mips/ite-boards/generic/irq.c +++ b/arch/mips/ite-boards/generic/irq.c @@ -32,7 +32,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include @@ -47,8 +46,8 @@ #include #include #include +#include -#include #include #include #include @@ -57,18 +56,6 @@ #include #include -#undef DEBUG_IRQ -#ifdef DEBUG_IRQ -/* note: prints function name for you */ -#define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args) -#else -#define DPRINTK(fmt, args...) -#endif - -#ifdef CONFIG_KGDB -extern void breakpoint(void); -#endif - /* revisit */ #define EXT_IRQ0_TO_IP 2 /* IP 2 */ #define EXT_IRQ5_TO_IP 7 /* IP 7 */ @@ -85,111 +72,50 @@ extern asmlinkage void it8172_IRQ(void); struct it8172_intc_regs volatile *it8172_hw0_icregs = (struct it8172_intc_regs volatile *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_INTC_BASE)); -/* Function for careful CP0 interrupt mask access */ -static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) -{ - unsigned long status = read_c0_status(); - status &= ~((clr_mask & 0xFF) << 8); - status |= (set_mask & 0xFF) << 8; - write_c0_status(status); -} - -static inline void mask_irq(unsigned int irq_nr) -{ - modify_cp0_intmask(irq_nr, 0); -} - -static inline void unmask_irq(unsigned int irq_nr) -{ - modify_cp0_intmask(0, irq_nr); -} - -void local_disable_irq(unsigned int irq_nr) -{ - unsigned long flags; - - local_irq_save(flags); - disable_it8172_irq(irq_nr); - local_irq_restore(flags); -} - -void local_enable_irq(unsigned int irq_nr) +static void disable_it8172_irq(unsigned int irq_nr) { - unsigned long flags; - - local_irq_save(flags); - enable_it8172_irq(irq_nr); - local_irq_restore(flags); -} - - -void disable_it8172_irq(unsigned int irq_nr) -{ - DPRINTK("disable_it8172_irq %d\n", irq_nr); - if ( (irq_nr >= IT8172_LPC_IRQ_BASE) && (irq_nr <= IT8172_SERIRQ_15)) { /* LPC interrupt */ - DPRINTK("DB lpc_mask %x\n", it8172_hw0_icregs->lpc_mask); it8172_hw0_icregs->lpc_mask |= (1 << (irq_nr - IT8172_LPC_IRQ_BASE)); - DPRINTK("DA lpc_mask %x\n", it8172_hw0_icregs->lpc_mask); - } - else if ( (irq_nr >= IT8172_LB_IRQ_BASE) && (irq_nr <= IT8172_IOCHK_IRQ)) { + } else if ( (irq_nr >= IT8172_LB_IRQ_BASE) && (irq_nr <= IT8172_IOCHK_IRQ)) { /* Local Bus interrupt */ - DPRINTK("DB lb_mask %x\n", it8172_hw0_icregs->lb_mask); it8172_hw0_icregs->lb_mask |= (1 << (irq_nr - IT8172_LB_IRQ_BASE)); - DPRINTK("DA lb_mask %x\n", it8172_hw0_icregs->lb_mask); - } - else if ( (irq_nr >= IT8172_PCI_DEV_IRQ_BASE) && (irq_nr <= IT8172_DMA_IRQ)) { + } else if ( (irq_nr >= IT8172_PCI_DEV_IRQ_BASE) && (irq_nr <= IT8172_DMA_IRQ)) { /* PCI and other interrupts */ - DPRINTK("DB pci_mask %x\n", it8172_hw0_icregs->pci_mask); it8172_hw0_icregs->pci_mask |= (1 << (irq_nr - IT8172_PCI_DEV_IRQ_BASE)); - DPRINTK("DA pci_mask %x\n", it8172_hw0_icregs->pci_mask); - } - else if ( (irq_nr >= IT8172_NMI_IRQ_BASE) && (irq_nr <= IT8172_POWER_NMI_IRQ)) { + } else if ( (irq_nr >= IT8172_NMI_IRQ_BASE) && (irq_nr <= IT8172_POWER_NMI_IRQ)) { /* NMI interrupts */ - DPRINTK("DB nmi_mask %x\n", it8172_hw0_icregs->nmi_mask); it8172_hw0_icregs->nmi_mask |= (1 << (irq_nr - IT8172_NMI_IRQ_BASE)); - DPRINTK("DA nmi_mask %x\n", it8172_hw0_icregs->nmi_mask); - } - else { + } else { panic("disable_it8172_irq: bad irq %d", irq_nr); } } -void enable_it8172_irq(unsigned int irq_nr) +static void enable_it8172_irq(unsigned int irq_nr) { - DPRINTK("enable_it8172_irq %d\n", irq_nr); if ( (irq_nr >= IT8172_LPC_IRQ_BASE) && (irq_nr <= IT8172_SERIRQ_15)) { /* LPC interrupt */ - DPRINTK("EB before lpc_mask %x\n", it8172_hw0_icregs->lpc_mask); it8172_hw0_icregs->lpc_mask &= ~(1 << (irq_nr - IT8172_LPC_IRQ_BASE)); - DPRINTK("EA after lpc_mask %x\n", it8172_hw0_icregs->lpc_mask); } else if ( (irq_nr >= IT8172_LB_IRQ_BASE) && (irq_nr <= IT8172_IOCHK_IRQ)) { /* Local Bus interrupt */ - DPRINTK("EB lb_mask %x\n", it8172_hw0_icregs->lb_mask); it8172_hw0_icregs->lb_mask &= ~(1 << (irq_nr - IT8172_LB_IRQ_BASE)); - DPRINTK("EA lb_mask %x\n", it8172_hw0_icregs->lb_mask); } else if ( (irq_nr >= IT8172_PCI_DEV_IRQ_BASE) && (irq_nr <= IT8172_DMA_IRQ)) { /* PCI and other interrupts */ - DPRINTK("EB pci_mask %x\n", it8172_hw0_icregs->pci_mask); it8172_hw0_icregs->pci_mask &= ~(1 << (irq_nr - IT8172_PCI_DEV_IRQ_BASE)); - DPRINTK("EA pci_mask %x\n", it8172_hw0_icregs->pci_mask); } else if ( (irq_nr >= IT8172_NMI_IRQ_BASE) && (irq_nr <= IT8172_POWER_NMI_IRQ)) { /* NMI interrupts */ - DPRINTK("EB nmi_mask %x\n", it8172_hw0_icregs->nmi_mask); it8172_hw0_icregs->nmi_mask &= ~(1 << (irq_nr - IT8172_NMI_IRQ_BASE)); - DPRINTK("EA nmi_mask %x\n", it8172_hw0_icregs->nmi_mask); } else { panic("enable_it8172_irq: bad irq %d", irq_nr); @@ -247,11 +173,11 @@ void enable_cpu_timer(void) unsigned long flags; local_irq_save(flags); - unmask_irq(1<lb_mask = 0xffff; it8172_hw0_icregs->lpc_mask = 0xffff; @@ -297,13 +221,6 @@ void __init init_IRQ(void) } irq_desc[MIPS_CPU_TIMER_IRQ].handler = &cp0_irq_type; set_c0_status(ALLINTS_NOTIMER); - -#ifdef CONFIG_KGDB - /* If local serial I/O used for debug port, enter kgdb at once */ - puts("Waiting for kgdb to connect..."); - set_debug_traps(); - breakpoint(); -#endif } void mips_spurious_interrupt(struct pt_regs *regs) @@ -318,7 +235,6 @@ void mips_spurious_interrupt(struct pt_regs *regs) cause = read_c0_cause(); printk("status %x cause %x\n", status, cause); printk("epc %x badvaddr %x \n", regs->cp0_epc, regs->cp0_badvaddr); -// while(1); #endif } @@ -339,9 +255,7 @@ void it8172_hw0_irqdispatch(struct pt_regs *regs) status >>= 1; } irq += IT8172_PCI_DEV_IRQ_BASE; - //printk("pci int %d\n", irq); - } - else if (intstatus & 0x1) { + } else if (intstatus & 0x1) { /* Local Bus interrupt */ irq = 0; status |= it8172_hw0_icregs->lb_req; @@ -350,9 +264,7 @@ void it8172_hw0_irqdispatch(struct pt_regs *regs) status >>= 1; } irq += IT8172_LB_IRQ_BASE; - //printk("lb int %d\n", irq); - } - else if (intstatus & 0x2) { + } else if (intstatus & 0x2) { /* LPC interrupt */ /* Since some lpc interrupts are edge triggered, * we could lose an interrupt this way because @@ -366,7 +278,6 @@ void it8172_hw0_irqdispatch(struct pt_regs *regs) status >>= 1; } irq += IT8172_LPC_IRQ_BASE; - //printk("LPC int %d\n", irq); } else return; diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index e81e23429..0b608fa98 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c @@ -17,13 +17,11 @@ extern asmlinkage void jazz_handle_int(void); -static spinlock_t r4030_lock = SPIN_LOCK_UNLOCKED; - -extern asmlinkage void sni_rm200_pci_handle_int(void); +static DEFINE_SPINLOCK(r4030_lock); static void enable_r4030_irq(unsigned int irq) { - unsigned int mask = 1 << (irq - JAZZ_IE_PARALLEL); + unsigned int mask = 1 << (irq - JAZZ_PARALLEL_IRQ); unsigned long flags; spin_lock_irqsave(&r4030_lock, flags); @@ -42,7 +40,7 @@ static unsigned int startup_r4030_irq(unsigned int irq) void disable_r4030_irq(unsigned int irq) { - unsigned int mask = ~(1 << (irq - JAZZ_IE_PARALLEL)); + unsigned int mask = ~(1 << (irq - JAZZ_PARALLEL_IRQ)); unsigned long flags; spin_lock_irqsave(&r4030_lock, flags); @@ -91,11 +89,10 @@ void __init init_r4030_ints(void) * driver compatibility reasons interrupts 0 - 15 to be the i8259 * interrupts even if the hardware uses a different interrupt numbering. */ -void __init init_IRQ (void) +void __init arch_init_irq(void) { set_except_vector(0, jazz_handle_int); - init_generic_irq(); init_i8259_irqs(); /* Integrated i8259 */ init_r4030_ints(); diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c index ceda294d5..46e421e14 100644 --- a/arch/mips/jazz/jazzdma.c +++ b/arch/mips/jazz/jazzdma.c @@ -29,7 +29,7 @@ static unsigned long vdma_pagetable_start; -static spinlock_t vdma_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(vdma_lock); /* * Debug stuff @@ -304,6 +304,8 @@ unsigned long vdma_phys2log(unsigned long paddr) return (i << 12) + (paddr & (VDMA_PAGESIZE - 1)); } +EXPORT_SYMBOL(vdma_phys2log); + /* * Translate a logical DMA address to a physical address */ @@ -394,6 +396,8 @@ void vdma_enable(int channel) R4030_CHNL_ENABLE); } +EXPORT_SYMBOL(vdma_enable); + /* * Disable a DMA channel */ @@ -429,6 +433,8 @@ void vdma_disable(int channel) *((volatile unsigned int *) JAZZ_DUMMY_DEVICE); } +EXPORT_SYMBOL(vdma_disable); + /* * Set DMA mode. This function accepts the mode values used * to set a PC-style DMA controller. For the SCSI and FDC @@ -496,6 +502,8 @@ void vdma_set_mode(int channel, int mode) } } +EXPORT_SYMBOL(vdma_set_mode); + /* * Set Transfer Address */ @@ -508,6 +516,8 @@ void vdma_set_addr(int channel, long addr) r4030_write_reg32(JAZZ_R4030_CHNL_ADDR + (channel << 5), addr); } +EXPORT_SYMBOL(vdma_set_addr); + /* * Set Transfer Count */ @@ -520,6 +530,8 @@ void vdma_set_count(int channel, int count) r4030_write_reg32(JAZZ_R4030_CHNL_COUNT + (channel << 5), count); } +EXPORT_SYMBOL(vdma_set_count); + /* * Get Residual */ diff --git a/arch/mips/jazz/reset.c b/arch/mips/jazz/reset.c index f7149c48c..2a9754750 100644 --- a/arch/mips/jazz/reset.c +++ b/arch/mips/jazz/reset.c @@ -11,8 +11,6 @@ #include #include -#define jazz_kh ((keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS) - #define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ static void jazz_write_output(unsigned char val) diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c index 4ab85b5b2..b9799b86f 100644 --- a/arch/mips/jmr3927/rbhma3100/irq.c +++ b/arch/mips/jmr3927/rbhma3100/irq.c @@ -45,8 +45,8 @@ #include #include #include +#include -#include #include #include #include @@ -89,38 +89,10 @@ static unsigned char irc_level[TX3927_NUM_IR] = { 6, 6, 6 /* TMR */ }; -static inline void mask_irq(unsigned int irq_nr) -{ - struct tb_irq_space* sp; - for (sp = tb_irq_spaces; sp; sp = sp->next) { - if (sp->start_irqno <= irq_nr && - irq_nr < sp->start_irqno + sp->nr_irqs) { - if (sp->mask_func) - sp->mask_func(irq_nr - sp->start_irqno, - sp->space_id); - break; - } - } -} - -static inline void unmask_irq(unsigned int irq_nr) -{ - struct tb_irq_space* sp; - for (sp = tb_irq_spaces; sp; sp = sp->next) { - if (sp->start_irqno <= irq_nr && - irq_nr < sp->start_irqno + sp->nr_irqs) { - if (sp->unmask_func) - sp->unmask_func(irq_nr - sp->start_irqno, - sp->space_id); - break; - } - } -} - static void jmr3927_irq_disable(unsigned int irq_nr); static void jmr3927_irq_enable(unsigned int irq_nr); -static spinlock_t jmr3927_irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(jmr3927_irq_lock); static unsigned int jmr3927_irq_startup(unsigned int irq) { @@ -133,9 +105,8 @@ static unsigned int jmr3927_irq_startup(unsigned int irq) static void jmr3927_irq_ack(unsigned int irq) { - if (irq == JMR3927_IRQ_IRC_TMR0) { + if (irq == JMR3927_IRQ_IRC_TMR0) jmr3927_tmrptr->tisr = 0; /* ack interrupt */ - } jmr3927_irq_disable(irq); } @@ -147,19 +118,37 @@ static void jmr3927_irq_end(unsigned int irq) static void jmr3927_irq_disable(unsigned int irq_nr) { + struct tb_irq_space* sp; unsigned long flags; spinlock_irqsave(&jmr3927_irq_lock, flags); - mask_irq(irq_nr); + for (sp = tb_irq_spaces; sp; sp = sp->next) { + if (sp->start_irqno <= irq_nr && + irq_nr < sp->start_irqno + sp->nr_irqs) { + if (sp->mask_func) + sp->mask_func(irq_nr - sp->start_irqno, + sp->space_id); + break; + } + } spinlock_irqrestore(&jmr3927_irq_lock, flags); } static void jmr3927_irq_enable(unsigned int irq_nr) { + struct tb_irq_space* sp; unsigned long flags; spinlock_irqsave(&jmr3927_irq_lock, flags); - unmask_irq(irq_nr); + for (sp = tb_irq_spaces; sp; sp = sp->next) { + if (sp->start_irqno <= irq_nr && + irq_nr < sp->start_irqno + sp->nr_irqs) { + if (sp->unmask_func) + sp->unmask_func(irq_nr - sp->start_irqno, + sp->space_id); + break; + } + } spinlock_irqrestore(&jmr3927_irq_lock, flags); } @@ -343,7 +332,8 @@ static struct irqaction pcierr_action = { int jmr3927_ether1_irq = 0; void jmr3927_irq_init(u32 irq_base); -void jmr3927_irq_setup(void) + +void __init arch_init_irq(void) { /* look for io board's presence */ int have_isac = jmr3927_have_isac(); @@ -421,24 +411,6 @@ void jmr3927_irq_setup(void) set_c0_status(ST0_IM); /* IE bit is still 0. */ } -void (*irq_setup)(void); - -void __init init_IRQ(void) -{ - -#ifdef CONFIG_KGDB - extern void breakpoint(void); - extern void set_debug_traps(void); - - puts("Wait for gdb client connection ...\n"); - set_debug_traps(); - breakpoint(); -#endif - - /* invoke board-specific irq setup */ - irq_setup(); -} - static hw_irq_controller jmr3927_irq_controller = { "jmr3927_irq", jmr3927_irq_startup, @@ -453,7 +425,6 @@ void jmr3927_irq_init(u32 irq_base) { u32 i; - init_generic_irq(); for (i= irq_base; i< irq_base + JMR3927_NR_IRQ_IRC + JMR3927_NR_IRQ_IOC; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = NULL; diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c index 13ddc5ce8..32039bb2f 100644 --- a/arch/mips/jmr3927/rbhma3100/setup.c +++ b/arch/mips/jmr3927/rbhma3100/setup.c @@ -108,7 +108,7 @@ static inline void do_reset(void) static void jmr3927_machine_restart(char *command) { - cli(); + local_irq_disable(); puts("Rebooting..."); do_reset(); } @@ -184,26 +184,19 @@ unsigned long jmr3927_do_gettimeoffset(void) } -#if defined(CONFIG_BLK_DEV_INITRD) -extern unsigned long __rd_start, __rd_end, initrd_start, initrd_end; -#endif - //#undef DO_WRITE_THROUGH #define DO_WRITE_THROUGH #define DO_ENABLE_CACHE extern char * __init prom_getcmdline(void); static void jmr3927_board_init(void); -extern void jmr3927_irq_setup(void); extern struct resource pci_io_resource; extern struct resource pci_mem_resource; static void __init jmr3927_setup(void) { - extern int panic_timeout; char *argptr; - irq_setup = jmr3927_irq_setup; set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); board_time_init = jmr3927_time_init; diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 86783790d..a0230ee0f 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile @@ -8,6 +8,9 @@ obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ time.o traps.o unaligned.o +binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \ + irix5sys.o sysirix.o + ifdef CONFIG_MODULES obj-y += mips_ksyms.o module.o obj-$(CONFIG_MIPS32) += module-elf32.o @@ -35,15 +38,16 @@ obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_NO_ISA) += dma-no-isa.o obj-$(CONFIG_I8259) += i8259.o obj-$(CONFIG_IRQ_CPU) += irq_cpu.o obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o +obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o obj-$(CONFIG_MIPS32) += scall32-o32.o obj-$(CONFIG_MIPS64) += scall64-64.o -obj-$(CONFIG_BINFMT_IRIX) += irixelf.o irixioctl.o irixsig.o sysirix.o \ - irixinv.o +obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.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 ptrace32.o diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c index 1375d4483..11ebe5d4c 100644 --- a/arch/mips/kernel/cpu-bugs64.c +++ b/arch/mips/kernel/cpu-bugs64.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Maciej W. Rozycki + * Copyright (C) 2003, 2004 Maciej W. Rozycki * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,7 @@ static inline void mult_sh_align_mod(long *v1, long *v2, long *w, ".set pop" : "=&r" (lv1), "=r" (lw) : "r" (m1), "r" (m2), "r" (s), "I" (0) - : "hi", "lo", "accum"); + : "hi", "lo", GCC_REG_ACCUM); /* We have to use single integers for m1 and m2 and a double * one for p to be sure the mulsidi3 gcc's RTL multiplication * instruction has the workaround applied. Older versions of diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 36777476d..4bb849582 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -100,6 +100,7 @@ static inline void check_wait(void) case CPU_R5000: case CPU_NEVADA: case CPU_RM7000: + case CPU_RM9000: case CPU_TX49XX: case CPU_4KC: case CPU_4KEC: diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index c1f842291..5eb429137 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef CONFIG_PREEMPT .macro preempt_stop reg=t0 @@ -139,7 +140,11 @@ LEAF(spurious_interrupt) 1: ll t0, %lo(irq_err_count)(t1) addiu t0, 1 sc t0, %lo(irq_err_count)(t1) +#if R10000_LLSC_WAR + beqzl t0, 1b +#else beqz t0, 1b +#endif #else lui t1, %hi(irq_err_count) lw t0, %lo(irq_err_count)(t1) diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c index 8b74e9c02..269889302 100644 --- a/arch/mips/kernel/gdb-stub.c +++ b/arch/mips/kernel/gdb-stub.c @@ -171,6 +171,8 @@ 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 */ diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index b8b83bccb..a5b0a389b 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -19,14 +19,25 @@ #include #include +#define PANIC_PIC(msg) \ + .set push; \ + .set reorder; \ + PTR_LA a0,8f; \ + .set noat; \ + PTR_LA AT, panic; \ + jr AT; \ +9: b 9b; \ + .set pop; \ + TEXT(msg) + __INIT NESTED(except_vec0_generic, 0, sp) - PANIC("Exception vector 0 called") + PANIC_PIC("Exception vector 0 called") END(except_vec0_generic) NESTED(except_vec1_generic, 0, sp) - PANIC("Exception vector 1 called") + PANIC_PIC("Exception vector 1 called") END(except_vec1_generic) /* @@ -142,19 +153,17 @@ NESTED(except_vec_ejtag_debug, 0, sp) NESTED(ejtag_debug_handler, PT_SIZE, sp) .set push .set noat - .set noreorder MTC0 k0, CP0_DESAVE mfc0 k0, CP0_DEBUG sll k0, k0, 30 # Check for SDBBP. bgez k0, ejtag_return - nop PTR_LA k0, ejtag_debug_buffer LONG_S k1, 0(k0) SAVE_ALL + move a0, sp jal ejtag_exception_handler - move a0, sp RESTORE_ALL PTR_LA k0, ejtag_debug_buffer LONG_L k1, 0(k0) @@ -163,7 +172,6 @@ ejtag_return: MFC0 k0, CP0_DESAVE .set mips32 deret - nop .set pop END(ejtag_debug_handler) diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index 89a8456d9..a64e87d22 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -90,15 +90,35 @@ .endm /* - * For the moment set ST0_KU so the CPU will not spit fire when - * executing 64-bit instructions. The full initialization of the - * CPU's status register is done later in per_cpu_trap_init(). + * For the moment disable interrupts, mark the kernel mode and + * set ST0_KX so that the CPU does not spit fire when using + * 64-bit addresses. A full initialization of the CPU's status + * register is done later in per_cpu_trap_init(). */ - .macro setup_c0_status -#ifdef CONFIG_MIPS64 + .macro setup_c0_status set clr + .set push mfc0 t0, CP0_STATUS - or t0, ST0_KX + or t0, ST0_CU0|\set|0x1f|\clr + xor t0, 0x1f|\clr mtc0 t0, CP0_STATUS + .set noreorder + sll zero,3 # ehb + .set pop + .endm + + .macro setup_c0_status_pri +#ifdef CONFIG_MIPS64 + setup_c0_status ST0_KX 0 +#else + setup_c0_status 0 0 +#endif + .endm + + .macro setup_c0_status_sec +#ifdef CONFIG_MIPS64 + setup_c0_status ST0_KX ST0_BEV +#else + setup_c0_status 0 ST0_BEV #endif .endm @@ -114,7 +134,7 @@ EXPORT(_stext) __INIT NESTED(kernel_entry, 16, sp) # kernel entry point - setup_c0_status + setup_c0_status_pri #ifdef CONFIG_SGI_IP27 GET_NASID_ASM t1 @@ -124,8 +144,6 @@ NESTED(kernel_entry, 16, sp) # kernel entry point ARC64_TWIDDLE_PC - CLI # disable interrupts - PTR_LA t0, __bss_start # clear .bss LONG_S zero, (t0) PTR_LA t1, __bss_stop - LONGSIZE @@ -144,7 +162,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point set_saved_sp sp, t0, t1 PTR_SUBU sp, 4 * SZREG # init stack pointer - jal start_kernel + j start_kernel END(kernel_entry) #ifdef CONFIG_SMP @@ -153,6 +171,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point * function after setting up the stack and gp registers. */ NESTED(smp_bootstrap, 16, sp) + setup_c0_status_sec + #ifdef CONFIG_SGI_IP27 GET_NASID_ASM t1 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ @@ -166,9 +186,7 @@ NESTED(smp_bootstrap, 16, sp) ARC64_TWIDDLE_PC #endif /* CONFIG_SGI_IP27 */ - CLI - setup_c0_status - jal start_secondary + j start_secondary END(smp_bootstrap) #endif /* CONFIG_SMP */ @@ -201,13 +219,3 @@ NESTED(smp_bootstrap, 16, sp) page invalid_pmd_table, _PMD_ORDER #endif page invalid_pte_table, _PTE_ORDER - -#ifdef CONFIG_MIPS64 - /* - * 64-bit kernel mappings are really screwed up ... - */ - page kptbl, _PGD_ORDER - .globl ekptbl - page kpmdtbl, 0 -ekptbl: -#endif diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c index 6fb136b7d..7eec7568b 100644 --- a/arch/mips/kernel/i8259.c +++ b/arch/mips/kernel/i8259.c @@ -209,7 +209,7 @@ spurious_8259A_irq: * lets ACK and report it. [once per IRQ] */ if (!(spurious_irq_mask & irqmask)) { - printk("spurious 8259A interrupt: IRQ%d.\n", irq); + printk(KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n", irq); spurious_irq_mask |= irqmask; } atomic_inc(&irq_err_count); @@ -295,7 +295,7 @@ void __init init_8259A(int auto_eoi) * IRQ2 is cascade interrupt to second interrupt controller */ static struct irqaction irq2 = { - no_action, 0, 0, "cascade", NULL, NULL + no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; static struct resource pic1_io_resource = { diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c index bc07d8112..519cd5d0a 100644 --- a/arch/mips/kernel/ioctl32.c +++ b/arch/mips/kernel/ioctl32.c @@ -47,6 +47,12 @@ COMPATIBLE_IOCTL(SBPROF_ZBSTOP) COMPATIBLE_IOCTL(SBPROF_ZBWAITFULL) #endif /* CONFIG_SIBYTE_TBPROF */ +/*HANDLE_IOCTL(RTC_IRQP_READ, w_long) +COMPATIBLE_IOCTL(RTC_IRQP_SET) +HANDLE_IOCTL(RTC_EPOCH_READ, w_long) +COMPATIBLE_IOCTL(RTC_EPOCH_SET) +*/ + IOCTL_TABLE_END int ioctl_table_size = ARRAY_SIZE(ioctl_start); diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index 0bcfb5ab6..c34a93a56 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -1,15 +1,16 @@ /* - * irixelf.c: Code to load IRIX ELF executables which conform to - * the MIPS ABI. + * This file is subject to 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) 1996 David S. Miller (dm@engr.sgi.com) + * irixelf.c: Code to load IRIX ELF executables conforming to the MIPS ABI. + * Based off of work by Eric Youngdale. * - * Based upon work which is: - * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com). + * Copyright (C) 1993 - 1994 Eric Youngdale + * Copyright (C) 1996 - 2004 David S. Miller + * Copyright (C) 2004 Steven J. Hill */ - #include - #include #include #include @@ -127,7 +128,9 @@ static void set_brk(unsigned long start, unsigned long end) end = PAGE_ALIGN(end); if (end <= start) return; + down_write(¤t->mm->mmap_sem); do_brk(start, end - start); + up_write(¤t->mm->mmap_sem); } @@ -209,13 +212,13 @@ unsigned long * create_irix_tables(char * p, int argc, int envc, __put_user((unsigned long)p,argv++); p += strlen_user(p); } - __put_user(NULL, argv); + __put_user((unsigned long) NULL, argv); current->mm->arg_end = current->mm->env_start = (unsigned long) p; while (envc-->0) { __put_user((unsigned long)p,envp++); p += strlen_user(p); } - __put_user(NULL, envp); + __put_user((unsigned long) NULL, envp); current->mm->env_end = (unsigned long) p; return sp; } @@ -265,9 +268,8 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex, return 0xffffffff; } - elf_phdata = (struct elf_phdr *) - kmalloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum, - GFP_KERNEL); + elf_phdata = kmalloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum, + GFP_KERNEL); if(!elf_phdata) { printk("Cannot kmalloc phdata for IRIX interp.\n"); @@ -376,7 +378,9 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex, /* Map the last of the bss segment */ if (last_bss > len) { + down_write(¤t->mm->mmap_sem); do_brk(len, (last_bss - len)); + up_write(¤t->mm->mmap_sem); } kfree(elf_phdata); @@ -436,9 +440,8 @@ static inline int look_for_irix_interpreter(char **name, if (*name != NULL) goto out; - *name = (char *) kmalloc((epp->p_filesz + - strlen(IRIX_INTERP_PREFIX)), - GFP_KERNEL); + *name = kmalloc((epp->p_filesz + strlen(IRIX_INTERP_PREFIX)), + GFP_KERNEL); if (!*name) return -ENOMEM; @@ -564,7 +567,9 @@ void irix_map_prda_page (void) unsigned long v; struct prda *pp; + down_write(¤t->mm->mmap_sem); v = do_brk (PRDA_ADDRESS, PAGE_SIZE); + up_write(¤t->mm->mmap_sem); if (v < 0) return; @@ -611,13 +616,14 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs) size = elf_ex.e_phentsize * elf_ex.e_phnum; if (size > 65536) goto out; - elf_phdata = (struct elf_phdr *) kmalloc(size, GFP_KERNEL); + elf_phdata = kmalloc(size, GFP_KERNEL); if (elf_phdata == NULL) { retval = -ENOMEM; goto out; } retval = kernel_read(bprm->file, elf_ex.e_phoff, (char *)elf_phdata, size); + if (retval < 0) goto out_free_ph; @@ -688,7 +694,7 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs) */ // current->mm->rss = 0; vx_rsspages_sub(current->mm, current->mm->rss); - setup_arg_pages(bprm, EXSTACK_DEFAULT); + setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT); current->mm->start_stack = bprm->p; /* At this point, we assume that the image should be loaded at @@ -815,8 +821,7 @@ static int load_irix_library(struct file *file) if(sizeof(struct elf_phdr) * elf_ex.e_phnum > PAGE_SIZE) return -ENOEXEC; - elf_phdata = (struct elf_phdr *) - kmalloc(sizeof(struct elf_phdr) * elf_ex.e_phnum, GFP_KERNEL); + elf_phdata = kmalloc(sizeof(struct elf_phdr) * elf_ex.e_phnum, GFP_KERNEL); if (elf_phdata == NULL) return -ENOMEM; @@ -856,8 +861,11 @@ static int load_irix_library(struct file *file) len = (elf_phdata->p_filesz + elf_phdata->p_vaddr+ 0xfff) & 0xfffff000; bss = elf_phdata->p_memsz + elf_phdata->p_vaddr; - if (bss > len) + if (bss > len) { + down_write(¤t->mm->mmap_sem); do_brk(len, bss-len); + up_write(¤t->mm->mmap_sem); + } kfree(elf_phdata); return 0; } @@ -929,7 +937,8 @@ unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt) } #ifdef DEBUG_ELF - printk("irix_mapelf: Success, returning %08lx\n", user_phdrp->p_vaddr); + printk("irix_mapelf: Success, returning %08lx\n", + (unsigned long) user_phdrp->p_vaddr); #endif fput(filp); return user_phdrp->p_vaddr; @@ -1056,7 +1065,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file) struct vm_area_struct *vma; struct elfhdr elf; off_t offset = 0, dataoff; - int limit = current->rlim[RLIMIT_CORE].rlim_cur; + int limit = current->signal->rlim[RLIMIT_CORE].rlim_cur; int numnote = 4; struct memelfnote notes[4]; struct elf_prstatus prstatus; /* NT_PRSTATUS */ @@ -1132,14 +1141,28 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file) psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid; psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current); psinfo.pr_sid = prstatus.pr_sid = current->signal->session; - prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime); - prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime); - prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime); - prstatus.pr_stime.tv_usec = CT_TO_USECS(current->stime); - prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->cutime); - prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->cutime); - prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->cstime); - prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->cstime); + if (current->pid == current->tgid) { + /* + * This is the record for the group leader. Add in the + * cumulative times of previous dead threads. This total + * won't include the time of each live thread whose state + * is included in the core dump. The final total reported + * to our parent process when it calls wait4 will include + * those sums as well as the little bit more time it takes + * this and each other thread to finish dying after the + * core dump synchronization phase. + */ + jiffies_to_timeval(current->utime + current->signal->utime, + &prstatus.pr_utime); + jiffies_to_timeval(current->stime + current->signal->stime, + &prstatus.pr_stime); + } else { + jiffies_to_timeval(current->utime, &prstatus.pr_utime); + jiffies_to_timeval(current->stime, &prstatus.pr_stime); + } + jiffies_to_timeval(current->signal->cutime, &prstatus.pr_cutime); + jiffies_to_timeval(current->signal->cstime, &prstatus.pr_cstime); + if (sizeof(elf_gregset_t) != sizeof(struct pt_regs)) { printk("sizeof(elf_gregset_t) (%d) != sizeof(struct pt_regs) " "(%d)\n", sizeof(elf_gregset_t), sizeof(struct pt_regs)); @@ -1278,6 +1301,20 @@ end_coredump: static int __init init_irix_binfmt(void) { + int init_inventory(void); + extern asmlinkage unsigned long sys_call_table; + extern asmlinkage unsigned long sys_call_table_irix5; + + init_inventory(); + + /* + * Copy the IRIX5 syscall table (8000 bytes) into the main syscall + * table. The IRIX5 calls are located by an offset of 8000 bytes + * from the beginning of the main table. + */ + memcpy((void *) ((unsigned long) &sys_call_table + 8000), + &sys_call_table_irix5, 8000); + return register_binfmt(&irix_format); } diff --git a/arch/mips/kernel/irixinv.c b/arch/mips/kernel/irixinv.c index eea258245..b8f1446ee 100644 --- a/arch/mips/kernel/irixinv.c +++ b/arch/mips/kernel/irixinv.c @@ -6,10 +6,8 @@ * Miguel de Icaza, 1997. */ #include -#include -#include -#include #include +#include #define MAX_INVENTORY 50 int inventory_items = 0; @@ -49,7 +47,7 @@ int dump_inventory_to_user (void *userbuf, int size) return inventory_items * sizeof (inventory_t); } -static int __init init_inventory(void) +int __init init_inventory(void) { /* * gross hack while we put the right bits all over the kernel @@ -77,5 +75,3 @@ static int __init init_inventory(void) return 0; } - -module_init(init_inventory); diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c index 15ae6af5a..298af9916 100644 --- a/arch/mips/kernel/irixsig.c +++ b/arch/mips/kernel/irixsig.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -100,7 +99,7 @@ static void setup_irix_frame(struct k_sigaction *ka, struct pt_regs *regs, __put_user((u64) regs->hi, &ctx->hi); __put_user((u64) regs->lo, &ctx->lo); __put_user((u64) regs->cp0_epc, &ctx->pc); - __put_user(current->used_math, &ctx->usedfp); + __put_user(!!used_math(), &ctx->usedfp); __put_user((u64) regs->cp0_cause, &ctx->cp0_cause); __put_user((u64) regs->cp0_badvaddr, &ctx->cp0_badvaddr); @@ -133,10 +132,8 @@ setup_irix_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, } static inline void handle_signal(unsigned long sig, siginfo_t *info, - sigset_t *oldset, struct pt_regs * regs) + struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - switch(regs->regs[0]) { case ERESTARTNOHAND: regs->regs[2] = EINTR; @@ -158,8 +155,6 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, else setup_irix_frame(ka, regs, sig, oldset); - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -171,6 +166,7 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs) { + struct k_sigaction ka; siginfo_t info; int signr; @@ -182,17 +178,15 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs) if (!user_mode(regs)) return 1; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs, NULL); + signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { - handle_signal(signr, &info, oldset, regs); + handle_signal(signr, &info, &ka, oldset, regs); return 1; } @@ -543,9 +537,9 @@ out: } /* This is here because of irix5_siginfo definition. */ -#define P_PID 0 -#define P_PGID 2 -#define P_ALL 7 +#define IRIX_P_PID 0 +#define IRIX_P_PGID 2 +#define IRIX_P_ALL 7 extern int getrusage(struct task_struct *, int, struct rusage __user *); @@ -582,11 +576,11 @@ asmlinkage int irix_waitsys(int type, int pid, struct irix5_siginfo *info, retval = -EINVAL; goto out; } - if (type != P_PID && type != P_PGID && type != P_ALL) { + if (type != IRIX_P_PID && type != IRIX_P_PGID && type != IRIX_P_ALL) { retval = -EINVAL; goto out; } - add_wait_queue(¤t->wait_chldexit, &wait); + add_wait_queue(¤t->signal->wait_chldexit, &wait); repeat: flag = 0; current->state = TASK_INTERRUPTIBLE; @@ -594,9 +588,9 @@ repeat: tsk = current; list_for_each(_p,&tsk->children) { p = list_entry(_p,struct task_struct,sibling); - if ((type == P_PID) && p->pid != pid) + if ((type == IRIX_P_PID) && p->pid != pid) continue; - if ((type == P_PGID) && process_group(p) != pid) + if ((type == IRIX_P_PGID) && process_group(p) != pid) continue; if ((p->exit_signal != SIGCHLD)) continue; @@ -630,9 +624,9 @@ repeat: } goto end_waitsys; - case TASK_ZOMBIE: - current->cutime += p->utime + p->cutime; - current->cstime += p->stime + p->cstime; + case EXIT_ZOMBIE: + current->signal->cutime += p->utime + p->signal->cutime; + current->signal->cstime += p->stime + p->signal->cstime; if (ru != NULL) getrusage(p, RUSAGE_BOTH, ru); __put_user(SIGCHLD, &info->sig); @@ -675,7 +669,7 @@ repeat: retval = -ECHILD; end_waitsys: current->state = TASK_RUNNING; - remove_wait_queue(¤t->wait_chldexit, &wait); + remove_wait_queue(¤t->signal->wait_chldexit, &wait); out: return retval; @@ -731,7 +725,7 @@ asmlinkage int irix_getcontext(struct pt_regs *regs) __put_user(regs->cp0_epc, &ctx->regs[35]); flags = 0x0f; - if(!current->used_math) { + if(!used_math()) { flags &= ~(0x08); } else { /* XXX wheee... */ diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c index cb9d2fe59..088bbbc86 100644 --- a/arch/mips/kernel/irq-mv6434x.c +++ b/arch/mips/kernel/irq-mv6434x.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include static unsigned int irq_base; diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index 7c1dae720..441157a1f 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -28,56 +28,33 @@ #include /* - * Controller mappings for all interrupt sources: + * 'what should we do if we get a hw irq event on an illegal vector'. + * each architecture has to answer this themselves. */ -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -static void register_irq_proc (unsigned int irq); +void ack_bad_irq(unsigned int irq) +{ + printk("unexpected IRQ # %d\n", irq); +} -/* - * Special irq handlers. - */ +atomic_t irq_err_count; -irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) -{ return IRQ_NONE; } +#undef do_IRQ /* - * Generic no controller code + * do_IRQ handles all normal device IRQ's (the special + * SMP cross-CPU interrupts have their own specific + * handlers). */ - -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) +asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs) { - /* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. - */ - printk("unexpected interrupt %d\n", irq); -} + irq_enter(); -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none + __do_IRQ(irq, regs); -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; + irq_exit(); -atomic_t irq_err_count; + return 1; +} /* * Generic, controller-independent functions: @@ -126,692 +103,20 @@ skip: return 0; } -#ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - while (irq_desc[irq].status & IRQ_INPROGRESS) - cpu_relax(); -} -#endif - -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - retval |= ret; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - - return retval; -} - -static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - struct irqaction *action; - - if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { - printk(KERN_ERR "irq event %d: bogus return value %x\n", - irq, action_ret); - } else { - printk(KERN_ERR "irq %d: nobody cared!\n", irq); - } - dump_stack(); - printk(KERN_ERR "handlers:\n"); - action = desc->action; - do { - printk(KERN_ERR "[<%p>]", action->handler); - print_symbol(" (%s)", - (unsigned long)action->handler); - printk("\n"); - action = action->next; - } while (action); -} - -static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - static int count = 100; - - if (count) { - count--; - __report_bad_irq(irq, desc, action_ret); - } -} - -static int noirqdebug; - -static int __init noirqdebug_setup(char *str) -{ - noirqdebug = 1; - printk("IRQ lockup detection disabled\n"); - return 1; -} - -__setup("noirqdebug", noirqdebug_setup); - -/* - * If 99,900 of the previous 100,000 interrupts have not been handled then - * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to - * turn the IRQ off. - * - * (The other 100-of-100,000 interrupts may have been a correctly-functioning - * device sharing an IRQ with the failing one) - * - * Called under desc->lock - */ -static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; - if (action_ret != IRQ_NONE) - report_bad_irq(irq, desc, action_ret); - } - - desc->irq_count++; - if (desc->irq_count < 100000) - return; - - desc->irq_count = 0; - if (desc->irqs_unhandled > 99900) { - /* - * The interrupt is stuck - */ - __report_bad_irq(irq, desc, action_ret); - /* - * Now kill the IRQ - */ - printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - desc->irqs_unhandled = 0; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -void inline disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. That is for two disables you need two enables. This - * function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ +#ifdef CONFIG_KGDB +extern void breakpoint(void); +extern void set_debug_traps(void); -void disable_irq(unsigned int irq) +static int kgdb_flag = 1; +static int __init nokgdb(char *str) { - irq_desc_t *desc = irq_desc + irq; - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} - -/** - * enable_irq - enable interrupt handling on an irq - * @irq: Interrupt to enable - * - * Re-enables the processing of interrupts on this IRQ line - * providing no disable_irq calls are now in effect. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~(IRQ_DISABLED | IRQ_INPROGRESS); - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced from %p\n", irq, - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/* - * do_IRQ handles all normal device IRQ's (the special - * SMP cross-CPU interrupts have their own specific - * handlers). - */ -asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) -{ - /* - * We ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; - unsigned int status; - - irq_enter(); - kstat_this_cpu.irqs[irq]++; - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (unlikely(!action)) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - irqreturn_t action_ret; - - spin_unlock(&desc->lock); - action_ret = handle_IRQ_event(irq, regs, action); - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; - -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->handler->end(irq); - spin_unlock(&desc->lock); - - irq_exit(); - + kgdb_flag = 0; return 1; } - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); - } +__setup("nokgdb", nokgdb); #endif - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_ATOMIC); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; -} - -EXPORT_SYMBOL(request_irq); - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function must not be called from interrupt context. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - -/* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - irq_desc_t *desc; - unsigned long val; - unsigned long delay; - - down(&probe_sem); - /* - * something may have generated an irq long ago and we want to - * flush such a longstanding irq before considering it as spurious. - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!irq_desc[i].action) - irq_desc[i].handler->startup(i); - spin_unlock_irq(&desc->lock); - } - - /* Wait for longstanding interrupts to trigger. */ - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) - /* about 20ms delay */ barrier(); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!desc->action) { - desc->status |= IRQ_AUTODETECT | IRQ_WAITING; - if (desc->handler->startup(i)) - desc->status |= IRQ_PENDING; - } - spin_unlock_irq(&desc->lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } else - if (i < 32) - val |= 1 << i; - } - spin_unlock_irq(&desc->lock); - } - - return val; -} - -EXPORT_SYMBOL(probe_irq_on); - -/* - * Return a mask of triggered interrupts (this - * can handle only legacy ISA interrupts). - */ - -/** - * probe_irq_mask - scan a bitmap of interrupt lines - * @val: mask of interrupts to consider - * - * Scan the ISA bus interrupt lines and return a bitmap of - * active interrupts. The interrupt probe logic state is then - * returned to its previous value. - * - * Note: we need to scan all the irq's even though we will - * only return ISA irq numbers - just so that we reset them - * all to a known state. - */ -unsigned int probe_irq_mask(unsigned long val) -{ - int i; - unsigned int mask; - - mask = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (i < 16 && !(status & IRQ_WAITING)) - mask |= 1 << i; - - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - return mask & val; -} - -/* - * Return the one interrupt that triggered (this can - * handle any interrupt source). - */ - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * there is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldnt happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. - */ - -int probe_irq_off(unsigned long val) -{ - int i, irq_found, nr_irqs; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -/* this was setup_x86_irq but it seems pretty generic */ -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_desc + irq; - - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -void __init init_generic_irq(void) +void __init init_IRQ(void) { int i; @@ -820,108 +125,16 @@ void __init init_generic_irq(void) irq_desc[i].action = NULL; irq_desc[i].depth = 1; irq_desc[i].handler = &no_irq_type; + spin_lock_init(&irq_desc[i].lock); } -} - -EXPORT_SYMBOL(disable_irq_nosync); -EXPORT_SYMBOL(disable_irq); -EXPORT_SYMBOL(enable_irq); -EXPORT_SYMBOL(probe_irq_mask); -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; + arch_init_irq(); -#ifdef CONFIG_SMP - -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; - -static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, const char *buffer, - unsigned long count, void *data) -{ - int irq = (long) data, full_count = count, err; - cpumask_t new_value, tmp; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, new_value); - - return full_count; -} - -#endif - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || - irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - -#ifdef CONFIG_SMP - { - struct proc_dir_entry *entry; - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; +#ifdef CONFIG_KGDB + if (kgdb_flag) { + printk("Wait for gdb client connection ...\n"); + set_debug_traps(); + breakpoint(); } #endif } - -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", 0); - - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) - register_irq_proc(i); -} diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index a53f31587..ce8077f6d 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -99,7 +99,7 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) } asmlinkage unsigned long -sys32_mmap2(unsigned long addr, size_t len, unsigned long prot, +sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { struct file * file = NULL; @@ -468,8 +468,7 @@ asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf, if (!(file->f_mode & FMODE_READ)) goto out; pos = merge_64(a4, a5); - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode, - file, pos, count); + ret = rw_verify_area(READ, file, &pos, count); if (ret) goto out; ret = -EINVAL; @@ -504,8 +503,7 @@ asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf, if (!(file->f_mode & FMODE_WRITE)) goto out; pos = merge_64(a4, a5); - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode, - file, pos, count); + ret = rw_verify_area(WRITE, file, &pos, count); if (ret) goto out; ret = -EINVAL; @@ -1117,7 +1115,7 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) err = sys_shmdt ((char *)A(ptr)); break; case SHMGET: - err = sys_shmget (first, second, third); + err = sys_shmget (first, (unsigned)second, third); break; case SHMCTL: err = do_sys32_shmctl (first, second, (void *)AA(ptr)); @@ -1194,13 +1192,6 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 *args) return error; } -#else /* CONFIG_SYSCTL */ - -asmlinkage long sys32_sysctl(struct sysctl_args32 *args) -{ - return -ENOSYS; -} - #endif /* CONFIG_SYSCTL */ asmlinkage long sys32_newuname(struct new_utsname * name) diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c index 169393cc9..eed29fc9d 100644 --- a/arch/mips/kernel/mips_ksyms.c +++ b/arch/mips/kernel/mips_ksyms.c @@ -5,9 +5,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03 by Ralf Baechle + * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05 by Ralf Baechle * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc. */ +#include +#include #include #include #include @@ -60,3 +62,6 @@ EXPORT_SYMBOL(__strnlen_user_asm); EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(invalid_pte_table); +#ifdef CONFIG_GENERIC_IRQ_PROBE +EXPORT_SYMBOL(probe_irq_mask); +#endif diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index 581687080..458af3c7a 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c @@ -2,7 +2,7 @@ #include static LIST_HEAD(dbe_list); -static spinlock_t dbe_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dbe_lock); /* Given an address, look for it in the module exception tables. */ const struct exception_table_entry *search_module_dbetables(unsigned long addr) diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 4bb61f32c..6e70c42c2 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -5,6 +5,7 @@ * * Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others. * Copyright (C) 1999, 2000 Silicon Graphics, Inc. + * Copyright (C) 2004 Thiemo Seufer */ #include #include @@ -75,7 +76,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) #endif status |= KU_USER; regs->cp0_status = status; - current->used_math = 0; + clear_used_math(); lose_fpu(); regs->cp0_epc = pc; regs->regs[29] = sp; @@ -99,28 +100,28 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, childksp = (unsigned long)ti + THREAD_SIZE - 32; + preempt_disable(); + if (is_fpu_owner()) { save_fp(p); } + preempt_enable(); + /* set up new TSS. */ childregs = (struct pt_regs *) childksp - 1; *childregs = *regs; childregs->regs[7] = 0; /* Clear error flag */ -#ifdef CONFIG_BINFMT_IRIX +#if defined(CONFIG_BINFMT_IRIX) if (current->personality != PER_LINUX) { /* Under IRIX things are a little different. */ - childregs->regs[2] = 0; childregs->regs[3] = 1; - regs->regs[2] = p->pid; regs->regs[3] = 0; - } else -#endif - { - childregs->regs[2] = 0; /* Child gets zero as return value */ - regs->regs[2] = p->pid; } +#endif + childregs->regs[2] = 0; /* Child gets zero as return value */ + regs->regs[2] = p->pid; if (childregs->cp0_status & ST0_CU0) { childregs->regs[28] = (unsigned long) ti; @@ -140,7 +141,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, p->thread.cp0_status = read_c0_status() & ~(ST0_CU2|ST0_CU1); childregs->cp0_status &= ~(ST0_CU2|ST0_CU1); clear_tsk_thread_flag(p, TIF_USEDFPU); - p->set_child_tid = p->clear_child_tid = NULL; return 0; } @@ -149,45 +149,66 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r) { memcpy(r, ¤t->thread.fpu, sizeof(current->thread.fpu)); + + return 1; +} + +void dump_regs(elf_greg_t *gp, struct pt_regs *regs) +{ + int i; + + for (i = 0; i < EF_R0; i++) + gp[i] = 0; + gp[EF_R0] = 0; + for (i = 1; i <= 31; i++) + gp[EF_R0 + i] = regs->regs[i]; + gp[EF_R26] = 0; + gp[EF_R27] = 0; + gp[EF_LO] = regs->lo; + gp[EF_HI] = regs->hi; + gp[EF_CP0_EPC] = regs->cp0_epc; + gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr; + gp[EF_CP0_STATUS] = regs->cp0_status; + gp[EF_CP0_CAUSE] = regs->cp0_cause; +#ifdef EF_UNUSED0 + gp[EF_UNUSED0] = 0; +#endif +} + +int dump_task_fpu (struct task_struct *t, elf_fpregset_t *fpr) +{ + memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu)); + return 1; } /* * Create a kernel thread */ +ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *)) +{ + do_exit(fn(arg)); +} + long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { - long retval; - - __asm__ __volatile__( - " move $6, $sp \n" - " move $4, %5 \n" - " li $2, %1 \n" - " syscall \n" - " beq $6, $sp, 1f \n" -#ifdef CONFIG_MIPS32 /* On o32 the caller has to create the stackframe */ - " subu $sp, 32 \n" + struct pt_regs regs; + + memset(®s, 0, sizeof(regs)); + + regs.regs[4] = (unsigned long) arg; + regs.regs[5] = (unsigned long) fn; + regs.cp0_epc = (unsigned long) kernel_thread_helper; + regs.cp0_status = read_c0_status(); +#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) + regs.cp0_status &= ~(ST0_KUP | ST0_IEC); + regs.cp0_status |= ST0_IEP; +#else + regs.cp0_status |= ST0_EXL; #endif - " move $4, %3 \n" - " jalr %4 \n" - " move $4, $2 \n" - " li $2, %2 \n" - " syscall \n" -#ifdef CONFIG_MIPS32 /* On o32 the caller has to deallocate the stackframe */ - " addiu $sp, 32 \n" -#endif - "1: move %0, $2" - : "=r" (retval) - : "i" (__NR_clone), "i" (__NR_exit), "r" (arg), "r" (fn), - "r" (flags | CLONE_VM | CLONE_UNTRACED) - /* - * The called subroutine might have destroyed any of the - * at, result, argument or temporary registers ... - */ - : "$2", "$3", "$4", "$5", "$6", "$7", "$8", - "$9","$10","$11","$12","$13","$14","$15","$24","$25","$31"); - - return retval; + + /* Ok, create the new process.. */ + return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); } struct mips_frame_info { @@ -268,7 +289,6 @@ arch_initcall(frame_info_init); */ unsigned long thread_saved_pc(struct task_struct *tsk) { - extern void ret_from_fork(void); struct thread_struct *t = &tsk->thread; /* New born processes are a special case */ diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index db86febff..0c41555d8 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -121,7 +121,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) tmp = regs->regs[addr]; break; case FPR_BASE ... FPR_BASE + 31: - if (child->used_math) { + if (tsk_used_math(child)) { fpureg_t *fregs = get_fpu_regs(child); #ifdef CONFIG_MIPS32 @@ -207,7 +207,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) case FPR_BASE ... FPR_BASE + 31: { fpureg_t *fregs = get_fpu_regs(child); - if (!child->used_math) { + if (!tsk_used_math(child)) { /* FP not yet used */ memset(&child->thread.fpu.hard, ~0, sizeof(child->thread.fpu.hard)); @@ -279,7 +279,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index df7a51cce..611dee919 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c @@ -112,7 +112,7 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) tmp = regs->regs[addr]; break; case FPR_BASE ... FPR_BASE + 31: - if (child->used_math) { + if (tsk_used_math(child)) { fpureg_t *fregs = get_fpu_regs(child); /* @@ -193,7 +193,7 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) case FPR_BASE ... FPR_BASE + 31: { fpureg_t *fregs = get_fpu_regs(child); - if (!child->used_math) { + if (!tsk_used_math(child)) { /* FP not yet used */ memset(&child->thread.fpu.hard, ~0, sizeof(child->thread.fpu.hard)); @@ -262,7 +262,7 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) */ case PTRACE_KILL: ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 9eb885d23..1fc3b2eb1 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -75,17 +75,8 @@ and t0, t0, t1 LONG_S t0, ST_OFF(t3) -#ifdef CONFIG_MIPS32 - fpu_save_double a0 t0 # clobbers t0 -#endif -#ifdef CONFIG_MIPS64 - sll t2, t0, 5 - bgez t2, 2f - sdc1 $f0, (THREAD_FPU + 0x00)(a0) - fpu_save_16odd a0 -2: - fpu_save_16even a0 t1 # clobbers t1 -#endif + fpu_save_double a0 t1 t0 t2 # c0_status passed in t1 + # clobbers t0 and t2 1: /* @@ -114,18 +105,10 @@ * Save a thread's fp context. */ LEAF(_save_fp) -#ifdef CONFIG_MIPS32 - fpu_save_double a0 t1 # clobbers t1 -#endif #ifdef CONFIG_MIPS64 - mfc0 t0, CP0_STATUS - sll t1, t0, 5 - bgez t1, 1f # 16 register mode? - fpu_save_16odd a0 -1: - fpu_save_16even a0 t1 # clobbers t1 - sdc1 $f0, (THREAD_FPU + 0x00)(a0) + mfc0 t1, CP0_STATUS #endif + fpu_save_double a0 t1 t0 t2 # clobbers t1 jr ra END(_save_fp) @@ -133,19 +116,7 @@ LEAF(_save_fp) * Restore a thread's fp context. */ LEAF(_restore_fp) -#ifdef CONFIG_MIPS32 fpu_restore_double a0, t1 # clobbers t1 -#endif -#ifdef CONFIG_MIPS64 - mfc0 t0, CP0_STATUS - sll t1, t0, 5 - bgez t1, 1f # 16 register mode? - - fpu_restore_16odd a0 -1: fpu_restore_16even a0, t0 # clobbers t0 - ldc1 $f0, (THREAD_FPU + 0x00)(a0) -#endif - jr ra END(_restore_fp) diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 24eab2f9d..344f2e29e 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S @@ -5,6 +5,7 @@ * * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle * Copyright (C) 2001 MIPS Technologies, Inc. + * Copyright (C) 2004 Thiemo Seufer */ #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include /* Highest syscall used of any syscall flavour */ @@ -31,26 +33,30 @@ NESTED(handle_sys, PT_SIZE, sp) lw t1, PT_EPC(sp) # skip syscall on return +#if defined(CONFIG_BINFMT_IRIX) sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number +#else + subu v0, v0, __NR_O32_Linux # check syscall number + sltiu t0, v0, __NR_O32_Linux_syscalls + 1 +#endif addiu t1, 4 # skip to next instruction sw t1, PT_EPC(sp) beqz t0, illegal_syscall - /* XXX Put both in one cacheline, should save a bit. */ - sll t0, v0, 2 - lw t2, sys_call_table(t0) # syscall routine - lbu t3, sys_narg_table(v0) # number of arguments - beqz t2, illegal_syscall; + sll t0, v0, 3 + la t1, sys_call_table + addu t1, t0 + lw t2, (t1) # syscall routine + lw t3, 4(t1) # >= 0 if we need stack arguments + beqz t2, illegal_syscall - subu t0, t3, 5 # 5 or more arguments? sw a3, PT_R26(sp) # save a3 for syscall restarting - bgez t0, stackargs + bgez t3, stackargs stack_done: - sw a3, PT_R26(sp) # save for syscall restart - LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? + lw t0, TI_FLAGS($28) # syscall tracing enabled? li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT - and t0, t1, t0 + and t0, t1 bnez t0, syscall_trace_entry # -> yes jalr t2 # Do The Real Thing (TM) @@ -65,13 +71,13 @@ stack_done: # restarting 1: sw v0, PT_R2(sp) # result -EXPORT(o32_syscall_exit) +o32_syscall_exit: local_irq_disable # make sure need_resched and # signals dont change between # sampling and return - LONG_L a2, TI_FLAGS($28) # current->work + lw a2, TI_FLAGS($28) # current->work li t0, _TIF_ALLWORK_MASK - and t0, a2, t0 + and t0, a2 bnez t0, o32_syscall_exit_work j restore_partial @@ -83,17 +89,16 @@ o32_syscall_exit_work: syscall_trace_entry: SAVE_STATIC - sw t2, PT_R1(sp) + move s0, t2 move a0, sp li a1, 0 jal do_syscall_trace - lw t2, PT_R1(sp) lw a0, PT_R4(sp) # Restore argument registers lw a1, PT_R5(sp) lw a2, PT_R6(sp) lw a3, PT_R7(sp) - jalr t2 + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 @@ -116,49 +121,48 @@ syscall_trace_entry: */ stackargs: lw t0, PT_R29(sp) # get old user stack pointer - subu t3, 4 - sll t1, t3, 2 # stack valid? - addu t1, t0 # end address - or t0, t1 - bltz t0, bad_stack # -> sp is bad - - lw t0, PT_R29(sp) # get old user stack pointer - PTR_LA t1, 4f # copy 1 to 3 arguments - sll t3, t3, 4 - subu t1, t3 - jr t1 - - /* Ok, copy the args from the luser stack to the kernel stack */ /* - * I know Ralf doesn't like nops but this avoids code - * duplication for R3000 targets (and this is the - * only place where ".set reorder" doesn't help). - * Harald. + * We intentionally keep the kernel stack a little below the top of + * userspace so we don't have to do a slower byte accurate check here. + */ + lw t5, TI_ADDR_LIMIT($28) + addu t4, t0, 32 + and t5, t4 + bltz t5, bad_stack # -> sp is bad + + /* Ok, copy the args from the luser stack to the kernel stack. + * t3 is the precomputed number of instruction bytes needed to + * load or store arguments 6-8. */ + + la t1, 5f # load up to 3 arguments + subu t1, t3 +1: lw t5, 16(t0) # argument #5 from usp .set push .set noreorder .set nomacro -1: lw t1, 24(t0) # argument #7 from usp - nop - sw t1, 24(sp) - nop -2: lw t1, 20(t0) # argument #5 from usp - nop - sw t1, 20(sp) - nop -3: lw t1, 16(t0) # argument #5 from usp - nop - sw t1, 16(sp) - nop -4: .set pop - - j stack_done # go back + jr t1 + addiu t1, 6f - 5f + +2: lw t8, 28(t0) # argument #8 from usp +3: lw t7, 24(t0) # argument #7 from usp +4: lw t6, 20(t0) # argument #6 from usp +5: jr t1 + sw t5, 16(sp) # argument #5 to ksp + + sw t8, 28(sp) # argument #8 to ksp + sw t7, 24(sp) # argument #7 to ksp + sw t6, 20(sp) # argument #6 to ksp +6: j stack_done # go back + nop + .set pop .section __ex_table,"a" PTR 1b,bad_stack PTR 2b,bad_stack PTR 3b,bad_stack + PTR 4b,bad_stack .previous /* @@ -177,7 +181,7 @@ bad_stack: * The system call does not exist in this kernel */ illegal_syscall: - li v0, ENOSYS # error + li v0, -ENOSYS # error sw v0, PT_R2(sp) li t0, 1 # set error flag sw t0, PT_R7(sp) @@ -199,7 +203,11 @@ illegal_syscall: 1: ll v0, (a1) move a0, a2 2: sc a0, (a1) +#if R10000_LLSC_WAR + beqzl a0, 1b +#else beqz a0, 1b +#endif .section __ex_table,"a" PTR 1b, bad_stack @@ -234,12 +242,12 @@ illegal_syscall: sw v0, PT_R2(sp) # result /* Success, so skip usual error handling garbage. */ - LONG_L a2, TI_FLAGS($28) # syscall tracing enabled? + lw a2, TI_FLAGS($28) # syscall tracing enabled? li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT and t0, a2, t0 bnez t0, 1f - b o32_syscall_exit + j o32_syscall_exit 1: SAVE_STATIC move a0, sp @@ -265,69 +273,49 @@ bad_alignment: END(sys_sysmips) LEAF(sys_syscall) - lw t0, PT_R29(sp) # user sp - - sltu v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1 - beqz v0, enosys - - sll v0, a0, 2 - la v1, sys_syscall - lw t2, sys_call_table(v0) # function pointer - lbu t4, sys_narg_table(a0) # number of arguments - - li v0, -EINVAL - beq t2, v1, out # do not recurse +#if defined(CONFIG_BINFMT_IRIX) + sltiu v0, a0, MAX_SYSCALL_NO + 1 # check syscall number +#else + subu t0, a0, __NR_O32_Linux # check syscall number + sltiu v0, t0, __NR_O32_Linux_syscalls + 1 +#endif + sll t1, t0, 3 + beqz v0, einval - beqz t2, enosys # null function pointer? + lw t2, sys_call_table(t1) # syscall routine - andi v0, t0, 0x3 # unaligned stack pointer? - bnez v0, sigsegv +#if defined(CONFIG_BINFMT_IRIX) + li v1, 4000 # nr of sys_syscall +#else + li v1, 4000 - __NR_O32_Linux # index of sys_syscall +#endif + beq t0, v1, einval # do not recurse - addu v0, t0, 16 # v0 = usp + 16 - addu t1, v0, 12 # 3 32-bit arguments - lw v1, TI_ADDR_LIMIT($28) - or v0, v0, t1 - and v1, v1, v0 - bltz v1, efault + /* Some syscalls like execve get their arguments from struct pt_regs + and claim zero arguments in the syscall table. Thus we have to + assume the worst case and shuffle around all potential arguments. + If you want performance, don't use indirect syscalls. */ move a0, a1 # shift argument registers move a1, a2 move a2, a3 - -1: lw a3, 16(t0) -2: lw t3, 20(t0) -3: lw t4, 24(t0) - - .section __ex_table, "a" - .word 1b, efault - .word 2b, efault - .word 3b, efault - .previous - - sw t3, 16(sp) # put into new stackframe - sw t4, 20(sp) - - bnez t4, 1f # zero arguments? - addu a0, sp, 32 # then pass sp in a0 -1: - - sw t3, 16(sp) - sw v1, 20(sp) + lw a3, 16(sp) + lw t4, 20(sp) + lw t5, 24(sp) + lw t6, 28(sp) + sw t4, 16(sp) + sw t5, 20(sp) + sw t6, 24(sp) + sw a0, PT_R4(sp) # .. and push back a0 - a3, some + sw a1, PT_R5(sp) # syscalls expect them there + sw a2, PT_R6(sp) + sw a3, PT_R7(sp) + sw a3, PT_R26(sp) # update a3 for syscall restarting jr t2 /* Unreached */ -enosys: li v0, -ENOSYS - b out - -sigsegv: - li a0, _SIGSEGV - move a1, $28 - jal force_sig - /* Fall through */ - -efault: li v0, -EFAULT - -out: jr ra +einval: li v0, -EINVAL + jr ra END(sys_syscall) .macro fifty ptr, nargs, from=1, to=50 @@ -345,12 +333,14 @@ out: jr ra .endm .macro syscalltable +#if defined(CONFIG_BINFMT_IRIX) mille sys_ni_syscall 0 /* 0 - 999 SVR4 flavour */ - #include "irix5sys.h" /* 1000 - 1999 32-bit IRIX */ + mille sys_ni_syscall 0 /* 1000 - 1999 32-bit IRIX */ mille sys_ni_syscall 0 /* 2000 - 2999 BSD43 flavour */ mille sys_ni_syscall 0 /* 3000 - 3999 POSIX flavour */ +#endif - sys sys_syscall 0 /* 4000 */ + sys sys_syscall 8 /* 4000 */ sys sys_exit 1 sys sys_fork 0 sys sys_read 3 @@ -401,7 +391,7 @@ out: jr ra sys sys_ni_syscall 0 /* was signal(2) */ sys sys_geteuid 0 sys sys_getegid 0 /* 4050 */ - sys sys_acct 0 + sys sys_acct 1 sys sys_umount 2 sys sys_ni_syscall 0 sys sys_ioctl 3 @@ -481,7 +471,7 @@ out: jr ra sys sys_init_module 5 sys sys_delete_module 1 sys sys_ni_syscall 0 /* 4130 was get_kernel_syms */ - sys sys_quotactl 0 + sys sys_quotactl 4 sys sys_getpgid 1 sys sys_fchdir 1 sys sys_bdflush 2 @@ -502,7 +492,7 @@ out: jr ra sys sys_sysmips 4 sys sys_ni_syscall 0 /* 4150 */ sys sys_getsid 1 - sys sys_fdatasync 0 + sys sys_fdatasync 1 sys sys_sysctl 1 sys sys_mlock 2 sys sys_munlock 2 /* 4155 */ @@ -618,7 +608,7 @@ out: jr ra sys sys_clock_nanosleep 4 /* 4265 */ sys sys_tgkill 3 sys sys_utimes 2 - sys sys_ni_syscall 0 /* sys_mbind */ + sys sys_mbind 4 sys sys_ni_syscall 0 /* sys_get_mempolicy */ sys sys_ni_syscall 0 /* 4270 sys_set_mempolicy */ sys sys_mq_open 4 @@ -628,22 +618,24 @@ out: jr ra sys sys_mq_notify 2 /* 4275 */ sys sys_mq_getsetattr 3 sys sys_ni_syscall 0 /* sys_vserver */ + sys sys_waitid 4 + sys sys_ni_syscall 0 /* available, was setaltroot */ + sys sys_add_key 5 + sys sys_request_key 4 + sys sys_keyctl 5 .endm + /* We pre-compute the number of _instruction_ bytes needed to + load or store the arguments 6-8. Negative values are ignored. */ + .macro sys function, nargs PTR \function + LONG (\nargs << 2) - (5 << 2) .endm .align 3 -sys_call_table: + .type sys_call_table,@object +EXPORT(sys_call_table) syscalltable .size sys_call_table, . - sys_call_table - - .macro sys function, nargs - .byte \nargs - .endm - -sys_narg_table: - syscalltable - .size sys_narg_table, . - sys_narg_table diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 3125b634f..32efb8881 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S @@ -18,6 +18,7 @@ #include #include #include +#include #ifndef CONFIG_BINFMT_ELF32 /* Neither O32 nor N32, so define handle_sys here */ @@ -37,8 +38,7 @@ NESTED(handle_sys64, PT_SIZE, sp) .set at #endif -FEXPORT(__handle_sys64) - subu t0, v0, __NR_64_Linux # check syscall number + dsubu t0, v0, __NR_64_Linux # check syscall number sltiu t0, t0, __NR_64_Linux_syscalls + 1 #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32) ld t1, PT_EPC(sp) # skip syscall on return @@ -53,8 +53,10 @@ FEXPORT(__handle_sys64) sd a3, PT_R26(sp) # save a3 for syscall restarting - LONG_L t0, TI_FLAGS($28) - bltz t0, syscall_trace_entry # syscall tracing enabled? + li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT + LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? + and t0, t1, t0 + bnez t0, syscall_trace_entry jalr t2 # Do The Real Thing (TM) @@ -63,12 +65,12 @@ FEXPORT(__handle_sys64) sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # set flag for syscall # restarting 1: sd v0, PT_R2(sp) # result -syscall_exit: +n64_syscall_exit: local_irq_disable # make sure need_resched and # signals dont change between # sampling and return @@ -86,24 +88,25 @@ n64_syscall_exit_work: syscall_trace_entry: SAVE_STATIC - sd t2,PT_R1(sp) + move s0, t2 move a0, sp li a1, 0 jal do_syscall_trace - ld t2,PT_R1(sp) ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) ld a2, PT_R6(sp) ld a3, PT_R7(sp) - jalr t2 + ld a4, PT_R8(sp) + ld a5, PT_R9(sp) + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # set flag for syscall restarting 1: sd v0, PT_R2(sp) # result @@ -111,11 +114,11 @@ syscall_trace_entry: illegal_syscall: /* This also isn't a 64-bit syscall, throw an error. */ - li v0, ENOSYS # error + li v0, -ENOSYS # error sd v0, PT_R2(sp) li t0, 1 # set error flag sd t0, PT_R7(sp) - j syscall_exit + j n64_syscall_exit END(handle_sys64) LEAF(mips_atomic_set) @@ -133,7 +136,11 @@ illegal_syscall: 1: ll v0, (a1) move a0, a2 2: sc a0, (a1) +#if R10000_LLSC_WAR + beqzl a0, 1b +#else beqz a0, 1b +#endif .section __ex_table,"a" PTR 1b, bad_stack @@ -168,12 +175,12 @@ illegal_syscall: sd v0, PT_R2(sp) # result /* Success, so skip usual error handling garbage. */ - LONG_L a2, TI_FLAGS($28) # syscall tracing enabled? li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT + LONG_L a2, TI_FLAGS($28) # syscall tracing enabled? and t0, a2, t0 bnez t0, 1f - b syscall_exit + j n64_syscall_exit 1: SAVE_STATIC move a0, sp @@ -198,17 +205,6 @@ bad_alignment: j _sys_sysmips END(sys_sysmips) - LEAF(sys_syscall) /* Quick'n'dirty ... */ - move v0, a0 - move a0, a1 - move a1, a2 - move a2, a3 - move a3, a4 - move a4, a5 - move a5, a6 - j __handle_sys64 - END(sys_syscall) - .align 3 sys_call_table: PTR sys_read /* 5000 */ @@ -438,7 +434,7 @@ sys_call_table: PTR sys_clock_nanosleep PTR sys_tgkill /* 5225 */ PTR sys_utimes - PTR sys_ni_syscall /* sys_mbind */ + PTR sys_mbind PTR sys_ni_syscall /* sys_get_mempolicy */ PTR sys_ni_syscall /* sys_set_mempolicy */ PTR sys_mq_open /* 5230 */ @@ -448,3 +444,8 @@ sys_call_table: PTR sys_mq_notify PTR sys_mq_getsetattr /* 5235 */ PTR sys_ni_syscall /* sys_vserver */ + PTR sys_waitid + PTR sys_ni_syscall /* available, was setaltroot */ + PTR sys_add_key + PTR sys_request_key /* 5240 */ + PTR sys_keyctl diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index c00459f8f..e52049c87 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -37,7 +37,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) .set at #endif - subu t0, v0, __NR_N32_Linux # check syscall number + dsubu t0, v0, __NR_N32_Linux # check syscall number sltiu t0, t0, __NR_N32_Linux_syscalls + 1 #ifndef CONFIG_MIPS32_O32 @@ -64,11 +64,10 @@ NESTED(handle_sysn32, PT_SIZE, sp) sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # set flag for syscall restarting 1: sd v0, PT_R2(sp) # result -FEXPORT(n32_syscall_exit) local_irq_disable # make sure need_resched and # signals dont change between # sampling and return @@ -86,28 +85,29 @@ n32_syscall_exit_work: n32_syscall_trace_entry: SAVE_STATIC - sd t2,PT_R1(sp) + move s0, t2 move a0, sp li a1, 0 jal do_syscall_trace - ld t2,PT_R1(sp) ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) ld a2, PT_R6(sp) ld a3, PT_R7(sp) - jalr t2 + ld a4, PT_R8(sp) + ld a5, PT_R9(sp) + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # set flag for syscall restarting 1: sd v0, PT_R2(sp) # result - j n32_syscall_exit + j syscall_exit not_n32_scall: /* This is not an n32 compatibility syscall, pass it on to @@ -243,7 +243,7 @@ EXPORT(sysn32_call_table) PTR sys_capget PTR sys_capset PTR sys32_rt_sigpending /* 6125 */ - PTR sys32_rt_sigtimedwait + PTR compat_sys_rt_sigtimedwait PTR sys32_rt_sigqueueinfo PTR sys32_rt_sigsuspend PTR sys32_sigaltstack @@ -334,8 +334,8 @@ EXPORT(sysn32_call_table) PTR sys_restart_syscall PTR sys_semtimedop /* 6215 */ PTR sys_fadvise64_64 - PTR sys_statfs64 - PTR sys_fstatfs64 + PTR compat_sys_statfs64 + PTR compat_sys_fstatfs64 PTR sys_sendfile64 PTR sys_timer_create /* 6220 */ PTR sys_timer_settime @@ -356,5 +356,10 @@ EXPORT(sysn32_call_table) PTR compat_sys_mq_timedsend PTR compat_sys_mq_timedreceive PTR compat_sys_mq_notify - PTR compat_sys_mq_getsetattr /* 6239 */ - PTR sys_ni_syscall /* sys_vserver */ + PTR compat_sys_mq_getsetattr + PTR sys_ni_syscall /* 6240, sys_vserver */ + PTR sys_waitid + PTR sys_ni_syscall /* available, was setaltroot */ + PTR sys_add_key + PTR sys_request_key + PTR sys_keyctl /* 6245 */ diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 3a89bf425..739f3998d 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -6,6 +6,7 @@ * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. + * Copyright (C) 2004 Thiemo Seufer * * Hairy, the userspace application uses a different argument passing * convention than the kernel, so we have to translate things from o32 @@ -31,7 +32,7 @@ NESTED(handle_sys, PT_SIZE, sp) .set at ld t1, PT_EPC(sp) # skip syscall on return - subu t0, v0, __NR_O32_Linux # check syscall number + dsubu t0, v0, __NR_O32_Linux # check syscall number sltiu t0, t0, __NR_O32_Linux_syscalls + 1 daddiu t1, 4 # skip to next instruction sd t1, PT_EPC(sp) @@ -43,21 +44,42 @@ NESTED(handle_sys, PT_SIZE, sp) RESTORE_ALL #endif + /* We don't want to stumble over broken sign extensions from + userland. O32 does never use the upper half. */ sll a0, a0, 0 sll a1, a1, 0 sll a2, a2, 0 sll a3, a3, 0 - /* XXX Put both in one cacheline, should save a bit. */ dsll t0, v0, 3 # offset into table ld t2, (sys_call_table - (__NR_O32_Linux * 8))(t0) - lbu t3, (sys_narg_table - __NR_O32_Linux)(v0) - subu t0, t3, 5 # 5 or more arguments? sd a3, PT_R26(sp) # save a3 for syscall restarting - bgez t0, stackargs -stack_done: + /* + * More than four arguments. Try to deal with it by copying the + * stack arguments from the user stack to the kernel stack. + * This Sucks (TM). + * + * We intentionally keep the kernel stack a little below the top of + * userspace so we don't have to do a slower byte accurate check here. + */ + ld t0, PT_R29(sp) # get old user stack pointer + daddu t1, t0, 32 + bltz t1, bad_stack + +1: lw a4, 16(t0) # argument #5 from usp +2: lw a5, 20(t0) # argument #6 from usp +3: lw a6, 24(t0) # argument #7 from usp +4: lw a7, 28(t0) # argument #8 from usp (for indirect syscalls) + + .section __ex_table,"a" + PTR 1b, bad_stack + PTR 2b, bad_stack + PTR 3b, bad_stack + PTR 4b, bad_stack + .previous + li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT LONG_L t0, TI_FLAGS($28) # syscall tracing enabled? and t0, t1, t0 @@ -70,11 +92,11 @@ stack_done: sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # flag for syscall restarting 1: sd v0, PT_R2(sp) # result -FEXPORT(o32_syscall_exit) +o32_syscall_exit: local_irq_disable # make need_resched and # signals dont change between # sampling and return @@ -92,16 +114,15 @@ o32_syscall_exit_work: trace_a_syscall: SAVE_STATIC - sd a4, PT_R8(sp) + sd a4, PT_R8(sp) # Save argument registers sd a5, PT_R9(sp) sd a6, PT_R10(sp) - sd a7, PT_R11(sp) + sd a7, PT_R11(sp) # For indirect syscalls - sd t2,PT_R1(sp) + move s0, t2 # Save syscall pointer move a0, sp li a1, 0 jal do_syscall_trace - ld t2,PT_R1(sp) ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) @@ -109,15 +130,16 @@ trace_a_syscall: ld a3, PT_R7(sp) ld a4, PT_R8(sp) ld a5, PT_R9(sp) - - jalr t2 + ld a6, PT_R10(sp) + ld a7, PT_R11(sp) # For indirect syscalls + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 sd t0, PT_R7(sp) # set error flag beqz t0, 1f - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) # set flag for syscall restarting 1: sd v0, PT_R2(sp) # result @@ -125,46 +147,11 @@ trace_a_syscall: /* ------------------------------------------------------------------------ */ - /* - * More than four arguments. Try to deal with it by copying the - * stack arguments from the user stack to the kernel stack. - * This Sucks (TM). - */ -stackargs: - ld t0, PT_R29(sp) # get old user stack pointer - subu t3, 4 - sll t1, t3, 2 # stack valid? - - addu t1, t0 # end address - or t0, t1 - bltz t0, bad_stack # -> sp is bad - - ld t0, PT_R29(sp) # get old user stack pointer - PTR_LA t1, 3f # copy 1 to 2 arguments - sll t3, t3, 2 - subu t1, t3 - jr t1 - - /* Ok, copy the args from the luser stack to the kernel stack */ - .set push - .set noreorder - .set nomacro -1: lw a5, 20(t0) # argument #6 from usp -2: lw a4, 16(t0) # argument #5 from usp -3: .set pop - - j stack_done # go back - - .section __ex_table,"a" - PTR 1b, bad_stack - PTR 2b, bad_stack - .previous - /* * The stackpointer for a call with more than 4 arguments is bad. */ bad_stack: - negu v0 # error + dnegu v0 # error sd v0, PT_R0(sp) sd v0, PT_R2(sp) li t0, 1 # set error flag @@ -181,375 +168,321 @@ not_o32_scall: #else j handle_sys64 #endif - -illegal_syscall: - /* This also isn't a 64-bit syscall, throw an error. */ - li v0, ENOSYS # error - sd v0, PT_R2(sp) - li t0, 1 # set error flag - sd t0, PT_R7(sp) - j o32_syscall_exit END(handle_sys) LEAF(sys32_syscall) - ld t0, PT_R29(sp) # user sp - sltu v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1 - beqz v0, enosys + beqz v0, einval dsll v0, a0, 3 - dla v1, sys32_syscall ld t2, (sys_call_table - (__NR_O32_Linux * 8))(v0) - lbu t3, (sys_narg_table - __NR_O32_Linux)(a0) - - li v0, -EINVAL - beq t2, v1, out # do not recurse - - beqz t2, enosys # null function pointer? - andi v0, t0, 0x3 # unaligned stack pointer? - bnez v0, sigsegv - - daddiu v0, t0, 16 # v0 = usp + 16 - daddu t1, v0, 12 # 3 32-bit arguments - ld v1, TI_ADDR_LIMIT($28) - or v0, v0, t1 - and v1, v1, v0 - bnez v1, efault + li v1, 4000 # indirect syscall number + beq a0, v1, einval # do not recurse move a0, a1 # shift argument registers move a1, a2 move a2, a3 - -1: lw a3, 16(t0) -2: lw t3, 20(t0) -3: lw t1, 24(t0) - - .section __ex_table,"a" - PTR 1b, efault - PTR 2b, efault - PTR 3b, efault - .previous - - sw t3, 16(sp) # put into new stackframe - sw t1, 20(sp) - - bnez t1, 1f # zero arguments? - daddu a0, sp, 32 # then pass sp in a0 -1: - - sw t3, 16(sp) - sw v1, 20(sp) + move a3, a4 + move a4, a5 + move a5, a6 + move a6, a7 + sd a0, PT_R4(sp) # ... and push back a0 - a3, some + sd a1, PT_R5(sp) # syscalls expect them there + sd a2, PT_R6(sp) + sd a3, PT_R7(sp) + sd a3, PT_R26(sp) # update a3 for syscall restarting jr t2 /* Unreached */ -enosys: li v0, -ENOSYS - b out - -sigsegv: - li a0, _SIGSEGV - move a1, $28 - jal force_sig - /* Fall through */ - -efault: li v0, -EFAULT - -out: jr ra +einval: li v0, -EINVAL + jr ra END(sys32_syscall) - .macro syscalltable - sys sys32_syscall 0 /* 4000 */ - sys sys_exit 1 - sys sys_fork 0 - sys sys_read 3 - sys sys_write 3 - sys sys_open 3 /* 4005 */ - sys sys_close 1 - sys sys_waitpid 3 - sys sys_creat 2 - sys sys_link 2 - sys sys_unlink 1 /* 4010 */ - sys sys32_execve 0 - sys sys_chdir 1 - sys sys_time 1 - sys sys_mknod 3 - sys sys_chmod 2 /* 4015 */ - sys sys_lchown 3 - sys sys_ni_syscall 0 - sys sys_ni_syscall 0 /* was sys_stat */ - sys sys_lseek 3 - sys sys_getpid 0 /* 4020 */ - sys sys_mount 5 - sys sys_oldumount 1 - sys sys_setuid 1 - sys sys_getuid 0 - sys sys_stime 1 /* 4025 */ - sys sys32_ptrace 4 - sys sys_alarm 1 - sys sys_ni_syscall 0 /* was sys_fstat */ - sys sys_pause 0 - sys compat_sys_utime 2 /* 4030 */ - sys sys_ni_syscall 0 - sys sys_ni_syscall 0 - sys sys_access 2 - sys sys_nice 1 - sys sys_ni_syscall 0 /* 4035 */ - sys sys_sync 0 - sys sys_kill 2 - sys sys_rename 2 - sys sys_mkdir 2 - sys sys_rmdir 1 /* 4040 */ - sys sys_dup 1 - sys sys_pipe 0 - sys compat_sys_times 1 - sys sys_ni_syscall 0 - sys sys_brk 1 /* 4045 */ - sys sys_setgid 1 - sys sys_getgid 0 - sys sys_ni_syscall 0 /* was signal 2 */ - sys sys_geteuid 0 - sys sys_getegid 0 /* 4050 */ - sys sys_acct 0 - sys sys_umount 2 - sys sys_ni_syscall 0 - sys compat_sys_ioctl 3 - sys compat_sys_fcntl 3 /* 4055 */ - sys sys_ni_syscall 2 - sys sys_setpgid 2 - sys sys_ni_syscall, 0 - sys sys_olduname 1 - sys sys_umask 1 /* 4060 */ - sys sys_chroot 1 - sys sys32_ustat 2 - sys sys_dup2 2 - sys sys_getppid 0 - sys sys_getpgrp 0 /* 4065 */ - sys sys_setsid 0 - sys sys32_sigaction 3 - sys sys_sgetmask 0 - sys sys_ssetmask 1 - sys sys_setreuid 2 /* 4070 */ - sys sys_setregid 2 - sys sys32_sigsuspend 0 - sys compat_sys_sigpending 1 - sys sys_sethostname 2 - sys compat_sys_setrlimit 2 /* 4075 */ - sys compat_sys_getrlimit 2 - sys compat_sys_getrusage 2 - sys sys32_gettimeofday 2 - sys sys32_settimeofday 2 - sys sys_getgroups 2 /* 4080 */ - sys sys_setgroups 2 - sys sys_ni_syscall 0 /* old_select */ - sys sys_symlink 2 - sys sys_ni_syscall 0 /* was sys_lstat */ - sys sys_readlink 3 /* 4085 */ - sys sys_uselib 1 - sys sys_swapon 2 - sys sys_reboot 3 - sys sys32_readdir 3 - sys old_mmap 6 /* 4090 */ - sys sys_munmap 2 - sys sys_truncate 2 - sys sys_ftruncate 2 - sys sys_fchmod 2 - sys sys_fchown 3 /* 4095 */ - sys sys_getpriority 2 - sys sys_setpriority 3 - sys sys_ni_syscall 0 - sys compat_sys_statfs 2 - sys compat_sys_fstatfs 2 /* 4100 */ - sys sys_ni_syscall 0 /* sys_ioperm */ - sys sys32_socketcall 2 - sys sys_syslog 3 - sys compat_sys_setitimer 3 - sys compat_sys_getitimer 2 /* 4105 */ - sys compat_sys_newstat 2 - sys compat_sys_newlstat 2 - sys compat_sys_newfstat 2 - sys sys_uname 1 - sys sys_ni_syscall 0 /* sys_ioperm *//* 4110 */ - sys sys_vhangup 0 - sys sys_ni_syscall 0 /* was sys_idle */ - sys sys_ni_syscall 0 /* sys_vm86 */ - sys sys32_wait4 4 - sys sys_swapoff 1 /* 4115 */ - sys sys32_sysinfo 1 - sys sys32_ipc 6 - sys sys_fsync 1 - sys sys32_sigreturn 0 - sys sys_clone 0 /* 4120 */ - sys sys_setdomainname 2 - sys sys32_newuname 1 - sys sys_ni_syscall 0 /* sys_modify_ldt */ - sys sys32_adjtimex 1 - sys sys_mprotect 3 /* 4125 */ - sys compat_sys_sigprocmask 3 - sys sys_ni_syscall 0 /* was creat_module */ - sys sys_init_module 5 - sys sys_delete_module 1 - sys sys_ni_syscall 0 /* 4130, get_kernel_syms */ - sys sys_quotactl 0 - sys sys_getpgid 1 - sys sys_fchdir 1 - sys sys_bdflush 2 - sys sys_sysfs 3 /* 4135 */ - sys sys32_personality 1 - sys sys_ni_syscall 0 /* for afs_syscall */ - sys sys_setfsuid 1 - sys sys_setfsgid 1 - sys sys32_llseek 5 /* 4140 */ - sys sys32_getdents 3 - sys compat_sys_select 5 - sys sys_flock 2 - sys sys_msync 3 - sys compat_sys_readv 3 /* 4145 */ - sys compat_sys_writev 3 - sys sys_cacheflush 3 - sys sys_cachectl 3 - sys sys_sysmips 4 - sys sys_ni_syscall 0 /* 4150 */ - sys sys_getsid 1 - sys sys_fdatasync 0 - sys sys32_sysctl 1 - sys sys_mlock 2 - sys sys_munlock 2 /* 4155 */ - sys sys_mlockall 1 - sys sys_munlockall 0 - sys sys_sched_setparam 2 - sys sys_sched_getparam 2 - sys sys_sched_setscheduler 3 /* 4160 */ - sys sys_sched_getscheduler 1 - sys sys_sched_yield 0 - sys sys_sched_get_priority_max 1 - sys sys_sched_get_priority_min 1 - sys sys32_sched_rr_get_interval 2 /* 4165 */ - sys compat_sys_nanosleep 2 - sys sys_mremap 4 - sys sys_accept 3 - sys sys_bind 3 - sys sys_connect 3 /* 4170 */ - sys sys_getpeername 3 - sys sys_getsockname 3 - sys sys_getsockopt 5 - sys sys_listen 2 - sys sys_recv 4 /* 4175 */ - sys sys_recvfrom 6 - sys compat_sys_recvmsg 3 - sys sys_send 4 - sys compat_sys_sendmsg 3 - sys sys_sendto 6 /* 4180 */ - sys compat_sys_setsockopt 5 - sys sys_shutdown 2 - sys sys_socket 3 - sys sys_socketpair 4 - sys sys_setresuid 3 /* 4185 */ - sys sys_getresuid 3 - sys sys_ni_syscall 0 /* was query_module */ - sys sys_poll 3 - sys sys_nfsservctl 3 - sys sys_setresgid 3 /* 4190 */ - sys sys_getresgid 3 - sys sys_prctl 5 - sys sys32_rt_sigreturn 0 - sys sys32_rt_sigaction 4 - sys sys32_rt_sigprocmask 4 /* 4195 */ - sys sys32_rt_sigpending 2 - sys sys32_rt_sigtimedwait 4 - sys sys32_rt_sigqueueinfo 3 - sys sys32_rt_sigsuspend 0 - sys sys32_pread 6 /* 4200 */ - sys sys32_pwrite 6 - sys sys_chown 3 - sys sys_getcwd 2 - sys sys_capget 2 - sys sys_capset 2 /* 4205 */ - sys sys32_sigaltstack 0 - sys sys32_sendfile 4 - sys sys_ni_syscall 0 - sys sys_ni_syscall 0 - sys sys32_mmap2 6 /* 4210 */ - sys sys32_truncate64 4 - sys sys32_ftruncate64 4 - sys sys_newstat 2 - sys sys_newlstat 2 - sys sys_newfstat 2 /* 4215 */ - sys sys_pivot_root 2 - sys sys_mincore 3 - sys sys_madvise 3 - sys sys_getdents64 3 - sys compat_sys_fcntl64 3 /* 4220 */ - sys sys_ni_syscall 0 - sys sys_gettid 0 - sys sys32_readahead 5 - sys sys_setxattr 5 - sys sys_lsetxattr 5 /* 4225 */ - sys sys_fsetxattr 5 - sys sys_getxattr 4 - sys sys_lgetxattr 4 - sys sys_fgetxattr 4 - sys sys_listxattr 3 /* 4230 */ - sys sys_llistxattr 3 - sys sys_flistxattr 3 - sys sys_removexattr 2 - sys sys_lremovexattr 2 - sys sys_fremovexattr 2 /* 4235 */ - sys sys_tkill 2 - sys sys_sendfile64 5 - sys compat_sys_futex 5 - sys compat_sys_sched_setaffinity 3 - sys compat_sys_sched_getaffinity 3 /* 4240 */ - sys sys_io_setup 2 - sys sys_io_destroy 1 - sys sys_io_getevents 5 - sys sys_io_submit 3 - sys sys_io_cancel 3 /* 4245 */ - sys sys_exit_group 1 - sys sys_lookup_dcookie 3 - sys sys_epoll_create 1 - sys sys_epoll_ctl 4 - sys sys_epoll_wait 3 /* 4250 */ - sys sys_remap_file_pages 5 - sys sys_set_tid_address 1 - sys sys_restart_syscall 0 - sys sys_fadvise64_64 7 - sys sys_statfs64 3 /* 4255 */ - sys sys_fstatfs64 2 - sys sys_timer_create 3 - sys sys_timer_settime 4 - sys sys_timer_gettime 2 - sys sys_timer_getoverrun 1 /* 4260 */ - sys sys_timer_delete 1 - sys sys_clock_settime 2 - sys sys_clock_gettime 2 - sys sys_clock_getres 2 - sys sys_clock_nanosleep 4 /* 4265 */ - sys sys_tgkill 3 - sys compat_sys_utimes 2 - sys sys_ni_syscall 0 /* sys_mbind */ - sys sys_ni_syscall 0 /* sys_get_mempolicy */ - sys sys_ni_syscall 0 /* 4270 sys_set_mempolicy */ - sys compat_sys_mq_open 4 - sys sys_mq_unlink 1 - sys compat_sys_mq_timedsend 5 - sys compat_sys_mq_timedreceive 5 - sys compat_sys_mq_notify 2 /* 4275 */ - sys compat_sys_mq_getsetattr 3 - sys sys_ni_syscall 0 /* sys_vserver */ - - .endm - - .macro sys function, nargs - PTR \function - .endm - .align 3 + .type sys_call_table,@object sys_call_table: - syscalltable - - .macro sys function, nargs - .byte \nargs - .endm - -sys_narg_table: - syscalltable + PTR sys32_syscall /* 4000 */ + PTR sys_exit + PTR sys_fork + PTR sys_read + PTR sys_write + PTR sys_open /* 4005 */ + PTR sys_close + PTR sys_waitpid + PTR sys_creat + PTR sys_link + PTR sys_unlink /* 4010 */ + PTR sys32_execve + PTR sys_chdir + PTR compat_sys_time + PTR sys_mknod + PTR sys_chmod /* 4015 */ + PTR sys_lchown + PTR sys_ni_syscall + PTR sys_ni_syscall /* was sys_stat */ + PTR sys_lseek + PTR sys_getpid /* 4020 */ + PTR sys_mount + PTR sys_oldumount + PTR sys_setuid + PTR sys_getuid + PTR compat_sys_stime /* 4025 */ + PTR sys32_ptrace + PTR sys_alarm + PTR sys_ni_syscall /* was sys_fstat */ + PTR sys_pause + PTR compat_sys_utime /* 4030 */ + PTR sys_ni_syscall + PTR sys_ni_syscall + PTR sys_access + PTR sys_nice + PTR sys_ni_syscall /* 4035 */ + PTR sys_sync + PTR sys_kill + PTR sys_rename + PTR sys_mkdir + PTR sys_rmdir /* 4040 */ + PTR sys_dup + PTR sys_pipe + PTR compat_sys_times + PTR sys_ni_syscall + PTR sys_brk /* 4045 */ + PTR sys_setgid + PTR sys_getgid + PTR sys_ni_syscall /* was signal 2 */ + PTR sys_geteuid + PTR sys_getegid /* 4050 */ + PTR sys_acct + PTR sys_umount + PTR sys_ni_syscall + PTR compat_sys_ioctl + PTR compat_sys_fcntl /* 4055 */ + PTR sys_ni_syscall + PTR sys_setpgid + PTR sys_ni_syscall + PTR sys_olduname + PTR sys_umask /* 4060 */ + PTR sys_chroot + PTR sys32_ustat + PTR sys_dup2 + PTR sys_getppid + PTR sys_getpgrp /* 4065 */ + PTR sys_setsid + PTR sys32_sigaction + PTR sys_sgetmask + PTR sys_ssetmask + PTR sys_setreuid /* 4070 */ + PTR sys_setregid + PTR sys32_sigsuspend + PTR compat_sys_sigpending + PTR sys_sethostname + PTR compat_sys_setrlimit /* 4075 */ + PTR compat_sys_getrlimit + PTR compat_sys_getrusage + PTR sys32_gettimeofday + PTR sys32_settimeofday + PTR sys_getgroups /* 4080 */ + PTR sys_setgroups + PTR sys_ni_syscall /* old_select */ + PTR sys_symlink + PTR sys_ni_syscall /* was sys_lstat */ + PTR sys_readlink /* 4085 */ + PTR sys_uselib + PTR sys_swapon + PTR sys_reboot + PTR sys32_readdir + PTR old_mmap /* 4090 */ + PTR sys_munmap + PTR sys_truncate + PTR sys_ftruncate + PTR sys_fchmod + PTR sys_fchown /* 4095 */ + PTR sys_getpriority + PTR sys_setpriority + PTR sys_ni_syscall + PTR compat_sys_statfs + PTR compat_sys_fstatfs /* 4100 */ + PTR sys_ni_syscall /* sys_ioperm */ + PTR sys32_socketcall + PTR sys_syslog + PTR compat_sys_setitimer + PTR compat_sys_getitimer /* 4105 */ + PTR compat_sys_newstat + PTR compat_sys_newlstat + PTR compat_sys_newfstat + PTR sys_uname + PTR sys_ni_syscall /* sys_ioperm *//* 4110 */ + PTR sys_vhangup + PTR sys_ni_syscall /* was sys_idle */ + PTR sys_ni_syscall /* sys_vm86 */ + PTR sys32_wait4 + PTR sys_swapoff /* 4115 */ + PTR sys32_sysinfo + PTR sys32_ipc + PTR sys_fsync + PTR sys32_sigreturn + PTR sys_clone /* 4120 */ + PTR sys_setdomainname + PTR sys32_newuname + PTR sys_ni_syscall /* sys_modify_ldt */ + PTR sys32_adjtimex + PTR sys_mprotect /* 4125 */ + PTR compat_sys_sigprocmask + PTR sys_ni_syscall /* was creat_module */ + PTR sys_init_module + PTR sys_delete_module + PTR sys_ni_syscall /* 4130, get_kernel_syms */ + PTR sys_quotactl + PTR sys_getpgid + PTR sys_fchdir + PTR sys_bdflush + PTR sys_sysfs /* 4135 */ + PTR sys32_personality + PTR sys_ni_syscall /* for afs_syscall */ + PTR sys_setfsuid + PTR sys_setfsgid + PTR sys32_llseek /* 4140 */ + PTR sys32_getdents + PTR compat_sys_select + PTR sys_flock + PTR sys_msync + PTR compat_sys_readv /* 4145 */ + PTR compat_sys_writev + PTR sys_cacheflush + PTR sys_cachectl + PTR sys_sysmips + PTR sys_ni_syscall /* 4150 */ + PTR sys_getsid + PTR sys_fdatasync + PTR sys32_sysctl + PTR sys_mlock + PTR sys_munlock /* 4155 */ + PTR sys_mlockall + PTR sys_munlockall + PTR sys_sched_setparam + PTR sys_sched_getparam + PTR sys_sched_setscheduler /* 4160 */ + PTR sys_sched_getscheduler + PTR sys_sched_yield + PTR sys_sched_get_priority_max + PTR sys_sched_get_priority_min + PTR sys32_sched_rr_get_interval /* 4165 */ + PTR compat_sys_nanosleep + PTR sys_mremap + PTR sys_accept + PTR sys_bind + PTR sys_connect /* 4170 */ + PTR sys_getpeername + PTR sys_getsockname + PTR sys_getsockopt + PTR sys_listen + PTR sys_recv /* 4175 */ + PTR sys_recvfrom + PTR compat_sys_recvmsg + PTR sys_send + PTR compat_sys_sendmsg + PTR sys_sendto /* 4180 */ + PTR compat_sys_setsockopt + PTR sys_shutdown + PTR sys_socket + PTR sys_socketpair + PTR sys_setresuid /* 4185 */ + PTR sys_getresuid + PTR sys_ni_syscall /* was query_module */ + PTR sys_poll + PTR sys_nfsservctl + PTR sys_setresgid /* 4190 */ + PTR sys_getresgid + PTR sys_prctl + PTR sys32_rt_sigreturn + PTR sys32_rt_sigaction + PTR sys32_rt_sigprocmask /* 4195 */ + PTR sys32_rt_sigpending + PTR compat_sys_rt_sigtimedwait + PTR sys32_rt_sigqueueinfo + PTR sys32_rt_sigsuspend + PTR sys32_pread /* 4200 */ + PTR sys32_pwrite + PTR sys_chown + PTR sys_getcwd + PTR sys_capget + PTR sys_capset /* 4205 */ + PTR sys32_sigaltstack + PTR sys32_sendfile + PTR sys_ni_syscall + PTR sys_ni_syscall + PTR sys32_mmap2 /* 4210 */ + PTR sys32_truncate64 + PTR sys32_ftruncate64 + PTR sys_newstat + PTR sys_newlstat + PTR sys_newfstat /* 4215 */ + PTR sys_pivot_root + PTR sys_mincore + PTR sys_madvise + PTR sys_getdents64 + PTR compat_sys_fcntl64 /* 4220 */ + PTR sys_ni_syscall + PTR sys_gettid + PTR sys32_readahead + PTR sys_setxattr + PTR sys_lsetxattr /* 4225 */ + PTR sys_fsetxattr + PTR sys_getxattr + PTR sys_lgetxattr + PTR sys_fgetxattr + PTR sys_listxattr /* 4230 */ + PTR sys_llistxattr + PTR sys_flistxattr + PTR sys_removexattr + PTR sys_lremovexattr + PTR sys_fremovexattr /* 4235 */ + PTR sys_tkill + PTR sys_sendfile64 + PTR compat_sys_futex + PTR compat_sys_sched_setaffinity + PTR compat_sys_sched_getaffinity /* 4240 */ + PTR sys_io_setup + PTR sys_io_destroy + PTR sys_io_getevents + PTR sys_io_submit + PTR sys_io_cancel /* 4245 */ + PTR sys_exit_group + PTR sys_lookup_dcookie + PTR sys_epoll_create + PTR sys_epoll_ctl + PTR sys_epoll_wait /* 4250 */ + PTR sys_remap_file_pages + PTR sys_set_tid_address + PTR sys_restart_syscall + PTR sys_fadvise64_64 + PTR compat_sys_statfs64 /* 4255 */ + PTR compat_sys_fstatfs64 + PTR sys_timer_create + PTR compat_sys_timer_settime + PTR compat_sys_timer_gettime + PTR sys_timer_getoverrun /* 4260 */ + PTR sys_timer_delete + PTR compat_sys_clock_settime + PTR compat_sys_clock_gettime + PTR compat_sys_clock_getres + PTR compat_sys_clock_nanosleep /* 4265 */ + PTR sys_tgkill + PTR compat_sys_utimes + PTR sys_ni_syscall /* sys_mbind */ + PTR sys_ni_syscall /* sys_get_mempolicy */ + PTR sys_ni_syscall /* 4270 sys_set_mempolicy */ + PTR compat_sys_mq_open + PTR sys_mq_unlink + PTR compat_sys_mq_timedsend + PTR compat_sys_mq_timedreceive + PTR compat_sys_mq_notify /* 4275 */ + PTR compat_sys_mq_getsetattr + PTR sys_ni_syscall /* sys_vserver */ + PTR sys_waitid + PTR sys_ni_syscall /* available, was setaltroot */ + PTR sys_add_key /* 4280 */ + PTR sys_request_key + PTR sys_keyctl + .size sys_call_table,.-sys_call_table diff --git a/arch/mips/kernel/semaphore.c b/arch/mips/kernel/semaphore.c index 4197b4109..9c40fe5a8 100644 --- a/arch/mips/kernel/semaphore.c +++ b/arch/mips/kernel/semaphore.c @@ -15,16 +15,14 @@ * indicate that some process(es) are waiting for the semaphore. */ -#include #include #include #include #include -#include +#include #include - -#ifdef CONFIG_CPU_HAS_LLSC - +#include +#include /* * Atomically update sem->count. * This does the equivalent of the following: @@ -33,50 +31,51 @@ * tmp = MAX(old_count, 0) + incr; * sem->count = tmp; * return old_count; - */ -static inline int __sem_update_count(struct semaphore *sem, int incr) -{ - int old_count, tmp; - - __asm__ __volatile__( - "1: ll %0, %2 \n" - " sra %1, %0, 31 \n" - " not %1 \n" - " and %1, %0, %1 \n" - " add %1, %1, %3 \n" - " sc %1, %2 \n" - " beqz %1, 1b \n" - : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) - : "r" (incr), "m" (sem->count)); - - return old_count; -} - -#else - -/* + * * On machines without lld/scd we need a spinlock to make the manipulation of * sem->count and sem->waking atomic. Scalability isn't an issue because * this lock is used on UP only so it's just an empty variable. */ -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; - static inline int __sem_update_count(struct semaphore *sem, int incr) { - unsigned long flags; int old_count, tmp; - spin_lock_irqsave(&semaphore_lock, flags); - old_count = atomic_read(&sem->count); - tmp = max_t(int, old_count, 0) + incr; - atomic_set(&sem->count, tmp); - spin_unlock_irqrestore(&semaphore_lock, flags); + if (cpu_has_llsc && R10000_LLSC_WAR) { + __asm__ __volatile__( + "1: ll %0, %2 \n" + " sra %1, %0, 31 \n" + " not %1 \n" + " and %1, %0, %1 \n" + " add %1, %1, %3 \n" + " sc %1, %2 \n" + " beqzl %1, 1b \n" + : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) + : "r" (incr), "m" (sem->count)); + } else if (cpu_has_llsc) { + __asm__ __volatile__( + "1: ll %0, %2 \n" + " sra %1, %0, 31 \n" + " not %1 \n" + " and %1, %0, %1 \n" + " add %1, %1, %3 \n" + " sc %1, %2 \n" + " beqz %1, 1b \n" + : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) + : "r" (incr), "m" (sem->count)); + } else { + static DEFINE_SPINLOCK(semaphore_lock); + unsigned long flags; + + spin_lock_irqsave(&semaphore_lock, flags); + old_count = atomic_read(&sem->count); + tmp = max_t(int, old_count, 0) + incr; + atomic_set(&sem->count, tmp); + spin_unlock_irqrestore(&semaphore_lock, flags); + } return old_count; } -#endif - void __up(struct semaphore *sem) { /* diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 711ad59d6..a7fd69c55 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -56,8 +56,6 @@ unsigned int PCI_DMA_BUS_IS_PHYS; EXPORT_SYMBOL(PCI_DMA_BUS_IS_PHYS); -extern void * __rd_start, * __rd_end; - /* * Setup information * @@ -194,6 +192,68 @@ static inline void parse_cmdline_early(void) } } +static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_end) +{ + /* + * "rd_start=0xNNNNNNNN" defines the memory address of an initrd + * "rd_size=0xNN" it's size + */ + unsigned long start = 0; + unsigned long size = 0; + unsigned long end; + char cmd_line[CL_SIZE]; + char *start_str; + char *size_str; + char *tmp; + + strcpy(cmd_line, command_line); + *command_line = 0; + tmp = cmd_line; + /* Ignore "rd_start=" strings in other parameters. */ + start_str = strstr(cmd_line, "rd_start="); + if (start_str && start_str != cmd_line && *(start_str - 1) != ' ') + start_str = strstr(start_str, " rd_start="); + while (start_str) { + if (start_str != cmd_line) + strncat(command_line, tmp, start_str - tmp); + start = memparse(start_str + 9, &start_str); + tmp = start_str + 1; + start_str = strstr(start_str, " rd_start="); + } + if (*tmp) + strcat(command_line, tmp); + + strcpy(cmd_line, command_line); + *command_line = 0; + tmp = cmd_line; + /* Ignore "rd_size" strings in other parameters. */ + size_str = strstr(cmd_line, "rd_size="); + if (size_str && size_str != cmd_line && *(size_str - 1) != ' ') + size_str = strstr(size_str, " rd_size="); + while (size_str) { + if (size_str != cmd_line) + strncat(command_line, tmp, size_str - tmp); + size = memparse(size_str + 8, &size_str); + tmp = size_str + 1; + size_str = strstr(size_str, " rd_size="); + } + if (*tmp) + strcat(command_line, tmp); + +#ifdef CONFIG_MIPS64 + /* HACK: Guess if the sign extension was forgotten */ + if (start > 0x0000000080000000 && start < 0x00000000ffffffff) + start |= 0xffffffff00000000; +#endif + + end = start + size; + if (start && end) { + *rd_start = start; + *rd_end = end; + return 1; + } + return 0; +} #define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT) #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) @@ -205,30 +265,42 @@ static inline void parse_cmdline_early(void) static inline void bootmem_init(void) { unsigned long start_pfn; + unsigned long reserved_end = (unsigned long)&_end; #ifndef CONFIG_SGI_IP27 - unsigned long bootmap_size, max_low_pfn, first_usable_pfn; + unsigned long first_usable_pfn; + unsigned long bootmap_size; int i; #endif #ifdef CONFIG_BLK_DEV_INITRD - unsigned long tmp; - unsigned long *initrd_header; - - tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8; - if (tmp < (unsigned long)&_end) - tmp += PAGE_SIZE; - initrd_header = (unsigned long *)tmp; - if (initrd_header[0] == 0x494E5244) { - initrd_start = (unsigned long)&initrd_header[2]; - initrd_end = initrd_start + initrd_header[1]; + int initrd_reserve_bootmem = 0; + + /* Board specific code should have set up initrd_start and initrd_end */ + ROOT_DEV = Root_RAM0; + if (parse_rd_cmdline(&initrd_start, &initrd_end)) { + reserved_end = max(reserved_end, initrd_end); + initrd_reserve_bootmem = 1; + } else { + unsigned long tmp; + u32 *initrd_header; + + tmp = ((reserved_end + PAGE_SIZE-1) & PAGE_MASK) - sizeof(u32) * 2; + if (tmp < reserved_end) + tmp += PAGE_SIZE; + initrd_header = (u32 *)tmp; + if (initrd_header[0] == 0x494E5244) { + initrd_start = (unsigned long)&initrd_header[2]; + initrd_end = initrd_start + initrd_header[1]; + reserved_end = max(reserved_end, initrd_end); + initrd_reserve_bootmem = 1; + } } - start_pfn = PFN_UP(CPHYSADDR((&_end)+(initrd_end - initrd_start) + PAGE_SIZE)); -#else +#endif /* CONFIG_BLK_DEV_INITRD */ + /* * Partially used pages are not usable - thus * we are rounding upwards. */ - start_pfn = PFN_UP(CPHYSADDR(&_end)); -#endif /* CONFIG_BLK_DEV_INITRD */ + start_pfn = PFN_UP(CPHYSADDR(reserved_end)); #ifndef CONFIG_SGI_IP27 /* Find the highest page frame number we have available. */ @@ -341,29 +413,28 @@ static inline void bootmem_init(void) /* Reserve the bootmap memory. */ reserve_bootmem(PFN_PHYS(first_usable_pfn), bootmap_size); -#endif +#endif /* CONFIG_SGI_IP27 */ #ifdef CONFIG_BLK_DEV_INITRD - /* Board specific code should have set up initrd_start and initrd_end */ - ROOT_DEV = Root_RAM0; - if (&__rd_start != &__rd_end) { - initrd_start = (unsigned long)&__rd_start; - initrd_end = (unsigned long)&__rd_end; - } initrd_below_start_ok = 1; if (initrd_start) { unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); printk("Initial ramdisk at: 0x%p (%lu bytes)\n", - (void *)initrd_start, - initrd_size); + (void *)initrd_start, initrd_size); if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { printk("initrd extends beyond end of memory " "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", - sizeof(long) * 2, CPHYSADDR(initrd_end), - sizeof(long) * 2, PFN_PHYS(max_low_pfn)); + sizeof(long) * 2, + (unsigned long long)CPHYSADDR(initrd_end), + sizeof(long) * 2, + (unsigned long long)PFN_PHYS(max_low_pfn)); initrd_start = initrd_end = 0; + initrd_reserve_bootmem = 0; } + + if (initrd_reserve_bootmem) + reserve_bootmem(CPHYSADDR(initrd_start), initrd_size); } #endif /* CONFIG_BLK_DEV_INITRD */ } @@ -372,10 +443,21 @@ static inline void resource_init(void) { int i; +#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) + /* + * The 64bit code in 32bit object format trick can't represent + * 64bit wide relocations for linker script symbols. + */ + code_resource.start = CPHYSADDR(&_text); + code_resource.end = CPHYSADDR(&_etext) - 1; + data_resource.start = CPHYSADDR(&_etext); + data_resource.end = CPHYSADDR(&_edata) - 1; +#else code_resource.start = virt_to_phys(&_text); code_resource.end = virt_to_phys(&_etext) - 1; data_resource.start = virt_to_phys(&_etext); data_resource.end = virt_to_phys(&_edata) - 1; +#endif /* * Request address space for all standard RAM. @@ -453,31 +535,10 @@ static void __init do_earlyinitcalls(void) void __init setup_arch(char **cmdline_p) { - unsigned int status; - cpu_probe(); prom_init(); cpu_report(); -#ifdef CONFIG_MIPS32 - /* Disable coprocessors and set FPU for 16/32 FPR register model */ - status = read_c0_status(); - status &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR); - status |= ST0_CU0; - write_c0_status(status); -#endif -#ifdef CONFIG_MIPS64 - /* - * On IP27, I am seeing the TS bit set when the kernel is loaded. - * Maybe because the kernel is in ckseg0 and not xkphys? Clear it - * anyway ... - */ - status = read_c0_status(); - status &= ~(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3); - status |= (ST0_CU0|ST0_KX|ST0_SX|ST0_FR); - write_c0_status(status); -#endif - #if defined(CONFIG_VT) #if defined(CONFIG_VGA_CONSOLE) conswitchp = &vga_con; diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 325705fcc..508026ae5 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -18,22 +18,25 @@ #include #include #include -#include #include +#include #include -#include +#include #include #include #include #include #include +#include + +#include "signal-common.h" #define DEBUG_SIG 0 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); +static int do_signal(sigset_t *oldset, struct pt_regs *regs); /* * Atomically swap in the new signal mask, and wait for a signal. @@ -41,7 +44,8 @@ extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); #ifdef CONFIG_TRAD_SIGNALS save_static_function(sys_sigsuspend); -static_unused int _sys_sigsuspend(struct pt_regs regs) +__attribute_used__ noinline static int +_sys_sigsuspend(nabi_no_regargs struct pt_regs regs) { sigset_t *uset, saveset, newset; @@ -68,7 +72,8 @@ static_unused int _sys_sigsuspend(struct pt_regs regs) #endif save_static_function(sys_rt_sigsuspend); -static_unused int _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) +__attribute_used__ noinline static int +_sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) { sigset_t *unewset, saveset, newset; size_t sigsetsize; @@ -149,65 +154,32 @@ asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs) return do_sigaltstack(uss, uoss, usp); } -asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) -{ - int err = 0; - - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; - - err |= __get_user(regs->cp0_epc, &sc->sc_pc); - err |= __get_user(regs->hi, &sc->sc_mdhi); - err |= __get_user(regs->lo, &sc->sc_mdlo); - -#define restore_gp_reg(i) do { \ - err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ -} while(0) - restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3); - restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6); - restore_gp_reg( 7); restore_gp_reg( 8); restore_gp_reg( 9); - restore_gp_reg(10); restore_gp_reg(11); restore_gp_reg(12); - restore_gp_reg(13); restore_gp_reg(14); restore_gp_reg(15); - restore_gp_reg(16); restore_gp_reg(17); restore_gp_reg(18); - restore_gp_reg(19); restore_gp_reg(20); restore_gp_reg(21); - restore_gp_reg(22); restore_gp_reg(23); restore_gp_reg(24); - restore_gp_reg(25); restore_gp_reg(26); restore_gp_reg(27); - restore_gp_reg(28); restore_gp_reg(29); restore_gp_reg(30); - restore_gp_reg(31); -#undef restore_gp_reg - - err |= __get_user(current->used_math, &sc->sc_used_math); - - if (current->used_math) { - /* restore fpu context if we have used it before */ - own_fpu(); - err |= restore_fp_context(sc); - } else { - /* signal handler may have used FPU. Give it up. */ - lose_fpu(); - } - - return err; -} +#if PLAT_TRAMPOLINE_STUFF_LINE +#define __tramp __attribute__((aligned(PLAT_TRAMPOLINE_STUFF_LINE))) +#else +#define __tramp +#endif #ifdef CONFIG_TRAD_SIGNALS struct sigframe { u32 sf_ass[4]; /* argument save space for o32 */ - u32 sf_code[2]; /* signal trampoline */ - struct sigcontext sf_sc; + u32 sf_code[2] __tramp; /* signal trampoline */ + struct sigcontext sf_sc __tramp; sigset_t sf_mask; }; #endif struct rt_sigframe { u32 rs_ass[4]; /* argument save space for o32 */ - u32 rs_code[2]; /* signal trampoline */ - struct siginfo rs_info; + u32 rs_code[2] __tramp; /* signal trampoline */ + struct siginfo rs_info __tramp; struct ucontext rs_uc; }; #ifdef CONFIG_TRAD_SIGNALS -asmlinkage void sys_sigreturn(struct pt_regs regs) +save_static_function(sys_sigreturn); +__attribute_used__ noinline static void +_sys_sigreturn(nabi_no_regargs struct pt_regs regs) { struct sigframe *frame; sigset_t blocked; @@ -244,7 +216,9 @@ badframe: } #endif -asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) +save_static_function(sys_rt_sigreturn); +__attribute_used__ noinline static void +_sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) { struct rt_sigframe *frame; sigset_t set; @@ -285,76 +259,6 @@ badframe: force_sig(SIGSEGV, current); } -inline int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) -{ - int err = 0; - - err |= __put_user(regs->cp0_epc, &sc->sc_pc); - err |= __put_user(regs->cp0_status, &sc->sc_status); - -#define save_gp_reg(i) do { \ - err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \ -} while(0) - __put_user(0, &sc->sc_regs[0]); save_gp_reg(1); save_gp_reg(2); - save_gp_reg(3); save_gp_reg(4); save_gp_reg(5); save_gp_reg(6); - save_gp_reg(7); save_gp_reg(8); save_gp_reg(9); save_gp_reg(10); - save_gp_reg(11); save_gp_reg(12); save_gp_reg(13); save_gp_reg(14); - save_gp_reg(15); save_gp_reg(16); save_gp_reg(17); save_gp_reg(18); - save_gp_reg(19); save_gp_reg(20); save_gp_reg(21); save_gp_reg(22); - save_gp_reg(23); save_gp_reg(24); save_gp_reg(25); save_gp_reg(26); - save_gp_reg(27); save_gp_reg(28); save_gp_reg(29); save_gp_reg(30); - save_gp_reg(31); -#undef save_gp_reg - - err |= __put_user(regs->hi, &sc->sc_mdhi); - err |= __put_user(regs->lo, &sc->sc_mdlo); - err |= __put_user(regs->cp0_cause, &sc->sc_cause); - err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); - - err |= __put_user(current->used_math, &sc->sc_used_math); - - if (!current->used_math) - goto out; - - /* - * Save FPU state to signal context. Signal handler will "inherit" - * current FPU state. - */ - if (!is_fpu_owner()) { - own_fpu(); - restore_fp(current); - } - err |= save_fp_context(sc); - -out: - return err; -} - -/* - * Determine which stack to use.. - */ -static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, - size_t frame_size) -{ - unsigned long sp; - - /* Default to using normal stack */ - sp = regs->regs[29]; - - /* - * FPU emulator may have it's own trampoline active just - * above the user stack, 16-bytes before the next lowest - * 16 byte boundary. Try to avoid trashing it. - */ - sp -= 32; - - /* This is the X/Open sanctioned signal stack switching. */ - if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) - sp = current->sas_ss_sp + current->sas_ss_size; - - return (void *)((sp - frame_size) & ALMASK); -} - #ifdef CONFIG_TRAD_SIGNALS static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set) @@ -372,6 +276,8 @@ static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, * li v0, __NR_sigreturn * syscall */ + if (PLAT_TRAMPOLINE_STUFF_LINE) + __clear_user(frame->sf_code, PLAT_TRAMPOLINE_STUFF_LINE); err |= __put_user(0x24020000 + __NR_sigreturn, frame->sf_code + 0); err |= __put_user(0x0000000c , frame->sf_code + 1); flush_cache_sigtramp((unsigned long) frame->sf_code); @@ -426,6 +332,8 @@ static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, * li v0, __NR_rt_sigreturn * syscall */ + if (PLAT_TRAMPOLINE_STUFF_LINE) + __clear_user(frame->rs_code, PLAT_TRAMPOLINE_STUFF_LINE); err |= __put_user(0x24020000 + __NR_rt_sigreturn, frame->rs_code + 0); err |= __put_user(0x0000000c , frame->rs_code + 1); flush_cache_sigtramp((unsigned long) frame->rs_code); @@ -517,8 +425,6 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, setup_frame(ka, regs, sig, oldset); #endif - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -531,7 +437,7 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs); -asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) +static int do_signal(sigset_t *oldset, struct pt_regs *regs) { struct k_sigaction ka; siginfo_t info; @@ -551,10 +457,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) if (!user_mode(regs)) return 1; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; @@ -587,8 +491,6 @@ no_signal: return 0; } -extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs); - /* * notification of userspace execution resumption * - triggered by current->work.notify_resume diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index a449a5651..59f069840 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c @@ -19,9 +19,10 @@ #include #include #include +#include #include -#include +#include #include #include #include @@ -29,6 +30,71 @@ #include #include +#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) + +typedef union sigval32 { + int sival_int; + s32 sival_ptr; +} sigval_t32; + +typedef struct compat_siginfo { + int si_signo; + int si_code; + int si_errno; + + union { + int _pad[SI_PAD_SIZE32]; + + /* kill() */ + struct { + compat_pid_t _pid; /* sender's pid */ + compat_uid_t _uid; /* sender's uid */ + } _kill; + + /* SIGCHLD */ + struct { + compat_pid_t _pid; /* which child */ + compat_uid_t _uid; /* sender's uid */ + int _status; /* exit code */ + compat_clock_t _utime; + compat_clock_t _stime; + } _sigchld; + + /* IRIX SIGCHLD */ + struct { + compat_pid_t _pid; /* which child */ + compat_clock_t _utime; + int _status; /* exit code */ + compat_clock_t _stime; + } _irix_sigchld; + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ + struct { + s32 _addr; /* faulting insn/memory ref. */ + } _sigfault; + + /* SIGPOLL, SIGXFSZ (To do ...) */ + struct { + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ + int _fd; + } _sigpoll; + + /* POSIX.1b timers */ + struct { + unsigned int _timer1; + unsigned int _timer2; + } _timer; + + /* POSIX.1b signals */ + struct { + compat_pid_t _pid; /* sender's pid */ + compat_uid_t _uid; /* sender's uid */ + sigval_t32 _sigval; + } _rt; + + } _sifields; +} compat_siginfo_t; + /* * Including would give use the 64-bit syscall numbers ... */ @@ -40,7 +106,7 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -extern asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs); +extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); /* 32-bit compatibility types */ @@ -126,8 +192,10 @@ static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t *ubuf) /* * Atomically swap in the new signal mask, and wait for a signal. */ + save_static_function(sys32_sigsuspend); -static_unused int _sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) +__attribute_used__ noinline static int +_sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) { compat_sigset_t *uset; sigset_t newset, saveset; @@ -154,7 +222,8 @@ static_unused int _sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) } save_static_function(sys32_rt_sigsuspend); -static_unused int _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) +__attribute_used__ noinline static int +_sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) { compat_sigset_t *uset; sigset_t newset, saveset; @@ -265,10 +334,10 @@ asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs) return ret; } -static asmlinkage int restore_sigcontext32(struct pt_regs *regs, - struct sigcontext32 *sc) +static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 *sc) { int err = 0; + __u32 used_math; /* Always make any pending restarted system calls return -EINTR */ current_thread_info()->restart_block.fn = do_no_restart_syscall; @@ -293,9 +362,12 @@ static asmlinkage int restore_sigcontext32(struct pt_regs *regs, restore_gp_reg(31); #undef restore_gp_reg - err |= __get_user(current->used_math, &sc->sc_used_math); + err |= __get_user(used_math, &sc->sc_used_math); + conditional_used_math(used_math); + + preempt_disable(); - if (current->used_math) { + if (used_math()) { /* restore fpu context if we have used it before */ own_fpu(); err |= restore_fp_context32(sc); @@ -304,6 +376,8 @@ static asmlinkage int restore_sigcontext32(struct pt_regs *regs, lose_fpu(); } + preempt_enable(); + return err; } @@ -317,15 +391,15 @@ struct sigframe { struct rt_sigframe32 { u32 rs_ass[4]; /* argument save space for o32 */ u32 rs_code[2]; /* signal trampoline */ - struct siginfo32 rs_info; + compat_siginfo_t rs_info; struct ucontext32 rs_uc; }; -static int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from) +int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from) { int err; - if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32))) + if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t))) return -EFAULT; /* If you change siginfo_t structure, please be sure @@ -368,7 +442,9 @@ static int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from) return err; } -asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs) +save_static_function(sys32_sigreturn); +__attribute_used__ noinline static void +_sys32_sigreturn(nabi_no_regargs struct pt_regs regs) { struct sigframe *frame; sigset_t blocked; @@ -404,7 +480,9 @@ badframe: force_sig(SIGSEGV, current); } -asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) +save_static_function(sys32_rt_sigreturn); +__attribute_used__ noinline static void +_sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) { struct rt_sigframe32 *frame; sigset_t set; @@ -480,21 +558,25 @@ static inline int setup_sigcontext32(struct pt_regs *regs, err |= __put_user(regs->cp0_cause, &sc->sc_cause); err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); - err |= __put_user(current->used_math, &sc->sc_used_math); + err |= __put_user(!!used_math(), &sc->sc_used_math); - if (!current->used_math) + if (!used_math()) goto out; /* * Save FPU state to signal context. Signal handler will "inherit" * current FPU state. */ + preempt_disable(); + if (!is_fpu_owner()) { own_fpu(); restore_fp(current); } err |= save_fp_context32(sc); + preempt_enable(); + out: return err; } @@ -601,7 +683,7 @@ static inline void setup_rt_frame(struct k_sigaction * ka, err |= __put_user(0x0000000c , frame->rs_code + 1); flush_cache_sigtramp((unsigned long) frame->rs_code); - /* Convert (siginfo_t -> siginfo_t32) and copy to user. */ + /* Convert (siginfo_t -> compat_siginfo_t) and copy to user. */ err |= copy_siginfo_to_user32(&frame->rs_info, info); /* Create the ucontext. */ @@ -649,10 +731,8 @@ give_sigsegv: } static inline void handle_signal(unsigned long sig, siginfo_t *info, - sigset_t *oldset, struct pt_regs * regs) + struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - switch (regs->regs[0]) { case ERESTART_RESTARTBLOCK: case ERESTARTNOHAND: @@ -676,8 +756,6 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, else setup_frame(ka, regs, sig, oldset); - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -687,8 +765,9 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info, } } -asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs) +int do_signal32(sigset_t *oldset, struct pt_regs *regs) { + struct k_sigaction ka; siginfo_t info; int signr; @@ -700,17 +779,15 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs) if (!user_mode(regs)) return 1; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs, NULL); + signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { - handle_signal(signr, &info, oldset, regs); + handle_signal(signr, &info, &ka, oldset, regs); return 1; } @@ -817,98 +894,7 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t *uset, return ret; } -asmlinkage int sys32_rt_sigtimedwait(compat_sigset_t *uthese, - siginfo_t32 *uinfo, struct compat_timespec *uts, - compat_time_t sigsetsize) -{ - int ret, sig; - sigset_t these; - compat_sigset_t these32; - struct timespec ts; - siginfo_t info; - long timeout = 0; - - /* - * As the result of a brainfarting competition a few years ago the - * size of sigset_t for the 32-bit kernel was choosen to be 128 bits - * but nothing so far is actually using that many, 64 are enough. So - * for now we just drop the high bits. - */ - if (copy_from_user (&these32, uthese, sizeof(compat_old_sigset_t))) - return -EFAULT; - - switch (_NSIG_WORDS) { -#ifdef __MIPSEB__ - case 4: these.sig[3] = these32.sig[6] | (((long)these32.sig[7]) << 32); - case 3: these.sig[2] = these32.sig[4] | (((long)these32.sig[5]) << 32); - case 2: these.sig[1] = these32.sig[2] | (((long)these32.sig[3]) << 32); - case 1: these.sig[0] = these32.sig[0] | (((long)these32.sig[1]) << 32); -#endif -#ifdef __MIPSEL__ - case 4: these.sig[3] = these32.sig[7] | (((long)these32.sig[6]) << 32); - case 3: these.sig[2] = these32.sig[5] | (((long)these32.sig[4]) << 32); - case 2: these.sig[1] = these32.sig[3] | (((long)these32.sig[2]) << 32); - case 1: these.sig[0] = these32.sig[1] | (((long)these32.sig[0]) << 32); -#endif - } - - /* - * Invert the set of allowed signals to get those we - * want to block. - */ - sigdelsetmask(&these, sigmask(SIGKILL)|sigmask(SIGSTOP)); - signotset(&these); - - if (uts) { - if (get_user (ts.tv_sec, &uts->tv_sec) || - get_user (ts.tv_nsec, &uts->tv_nsec)) - return -EINVAL; - if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0 - || ts.tv_sec < 0) - return -EINVAL; - } - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - if (!sig) { - /* None ready -- temporarily unblock those we're interested - in so that we'll be awakened when they arrive. */ - sigset_t oldblocked = current->blocked; - sigandsets(¤t->blocked, ¤t->blocked, &these); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - timeout = MAX_SCHEDULE_TIMEOUT; - if (uts) - timeout = (timespec_to_jiffies(&ts) - + (ts.tv_sec || ts.tv_nsec)); - - current->state = TASK_INTERRUPTIBLE; - timeout = schedule_timeout(timeout); - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - current->blocked = oldblocked; - recalc_sigpending(); - } - spin_unlock_irq(¤t->sighand->siglock); - - if (sig) { - ret = sig; - if (uinfo) { - if (copy_siginfo_to_user32(uinfo, &info)) - ret = -EFAULT; - } - } else { - ret = -EAGAIN; - if (timeout) - ret = -EINTR; - } - - return ret; -} - -asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo) +asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t *uinfo) { siginfo_t info; int ret; diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index d2f8b8cf6..3544208d4 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c @@ -26,18 +26,21 @@ #include #include #include +#include #include -#include #include #include #include #include #include #include +#include + +#include "signal-common.h" /* - * Including would give use the 64-bit syscall numbers ... */ #define __NR_N32_rt_sigreturn 6211 #define __NR_N32_restart_syscall 6214 @@ -59,17 +62,22 @@ struct ucontextn32 { sigset_t uc_sigmask; /* mask last for extensibility */ }; +#if PLAT_TRAMPOLINE_STUFF_LINE +#define __tramp __attribute__((aligned(PLAT_TRAMPOLINE_STUFF_LINE))) +#else +#define __tramp +#endif + struct rt_sigframe_n32 { u32 rs_ass[4]; /* argument save space for o32 */ - u32 rs_code[2]; /* signal trampoline */ - struct siginfo rs_info; + u32 rs_code[2] __tramp; /* signal trampoline */ + struct siginfo rs_info __tramp; struct ucontextn32 rs_uc; }; -extern asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc); -extern int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc); - -asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) +save_static_function(sysn32_rt_sigreturn); +__attribute_used__ noinline static void +_sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) { struct rt_sigframe_n32 *frame; sigset_t set; @@ -118,31 +126,6 @@ badframe: force_sig(SIGSEGV, current); } -/* - * Determine which stack to use.. - */ -static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, - size_t frame_size) -{ - unsigned long sp; - - /* Default to using normal stack */ - sp = regs->regs[29]; - - /* - * FPU emulator may have it's own trampoline active just - * above the user stack, 16-bytes before the next lowest - * 16 byte boundary. Try to avoid trashing it. - */ - sp -= 32; - - /* This is the X/Open sanctioned signal stack switching. */ - if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) - sp = current->sas_ss_sp + current->sas_ss_size; - - return (void *)((sp - frame_size) & ALMASK); -} - void setup_rt_frame_n32(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) { @@ -160,8 +143,10 @@ void setup_rt_frame_n32(struct k_sigaction * ka, * li v0, __NR_rt_sigreturn * syscall */ + if (PLAT_TRAMPOLINE_STUFF_LINE) + __clear_user(frame->rs_code, PLAT_TRAMPOLINE_STUFF_LINE); err |= __put_user(0x24020000 + __NR_N32_rt_sigreturn, frame->rs_code + 0); - err |= __put_user(0x0000000c , frame->rs_code + 1); + err |= __put_user(0x0000000c , frame->rs_code + 1); flush_cache_sigtramp((unsigned long) frame->rs_code); /* Create siginfo. */ diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 6d1c473f6..20245b7fd 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -18,7 +18,6 @@ * Copyright (C) 2000, 2001 Silicon Graphics, Inc. * Copyright (C) 2000, 2001, 2003 Broadcom Corporation */ -#include #include #include #include @@ -44,6 +43,7 @@ cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */ int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ +EXPORT_SYMBOL(phys_cpu_present_map); EXPORT_SYMBOL(cpu_online_map); cycles_t cacheflush_time; @@ -93,6 +93,7 @@ static void smp_tune_scheduling (void) } extern void __init calibrate_delay(void); +extern ATTRIB_NORET void cpu_idle(void); /* * First C code run on the secondary CPUs after being started up by @@ -122,7 +123,7 @@ asmlinkage void start_secondary(void) cpu_idle(); } -spinlock_t smp_call_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(smp_call_lock); struct call_data_struct *call_data; @@ -235,7 +236,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) init_new_context(current, &init_mm); current_thread_info()->cpu = 0; smp_tune_scheduling(); - prom_build_cpu_map(); prom_prepare_cpus(max_cpus); } diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index bdd7fbbf1..146b452dd 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -3,10 +3,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995, 1996, 1997, 2000, 2001 by Ralf Baechle + * Copyright (C) 1995, 1996, 1997, 2000, 2001, 05 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc. */ +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -66,11 +68,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, int do_color_align; unsigned long task_size; -#if CONFIG_MIPS32 - task_size = TASK_SIZE; -#else - task_size = (current->thread.mflags & MF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE; -#endif + task_size = STACK_TOP; if (flags & MAP_FIXED) { /* @@ -116,7 +114,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, } /* common code for old and new mmaps */ -static inline long +static inline unsigned long do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { @@ -140,8 +138,9 @@ out: return error; } -asmlinkage unsigned long old_mmap(unsigned long addr, size_t len, int prot, - int flags, int fd, off_t offset) +asmlinkage unsigned long +old_mmap(unsigned long addr, unsigned long len, int prot, + int flags, int fd, off_t offset) { unsigned long result; @@ -155,7 +154,7 @@ out: return result; } -asmlinkage long +asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { @@ -163,13 +162,15 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, } save_static_function(sys_fork); -static_unused int _sys_fork(nabi_no_regargs struct pt_regs regs) +__attribute_used__ noinline static int +_sys_fork(nabi_no_regargs struct pt_regs regs) { return do_fork(SIGCHLD, regs.regs[29], ®s, 0, NULL, NULL); } save_static_function(sys_clone); -static_unused int _sys_clone(nabi_no_regargs struct pt_regs regs) +__attribute_used__ noinline static int +_sys_clone(nabi_no_regargs struct pt_regs regs) { unsigned long clone_flags; unsigned long newsp; diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 15272d8c1..e26ff1dc5 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c @@ -129,16 +129,21 @@ asmlinkage int irix_prctl(struct pt_regs *regs) if (value > RLIM_INFINITY) value = RLIM_INFINITY; if (capable(CAP_SYS_ADMIN)) { - current->rlim[RLIMIT_STACK].rlim_max = - current->rlim[RLIMIT_STACK].rlim_cur = value; + task_lock(current->group_leader); + current->signal->rlim[RLIMIT_STACK].rlim_max = + current->signal->rlim[RLIMIT_STACK].rlim_cur = value; + task_unlock(current->group_leader); error = value; break; } - if (value > current->rlim[RLIMIT_STACK].rlim_max) { + task_lock(current->group_leader); + if (value > current->signal->rlim[RLIMIT_STACK].rlim_max) { error = -EINVAL; + task_unlock(current->group_leader); break; } - current->rlim[RLIMIT_STACK].rlim_cur = value; + current->signal->rlim[RLIMIT_STACK].rlim_cur = value; + task_unlock(current->group_leader); error = value; break; } @@ -146,7 +151,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs) case PR_GETSTACKSIZE: printk("irix_prctl[%s:%d]: Wants PR_GETSTACKSIZE\n", current->comm, current->pid); - error = current->rlim[RLIMIT_STACK].rlim_cur; + error = current->signal->rlim[RLIMIT_STACK].rlim_cur; break; case PR_MAXPPROCS: @@ -283,9 +288,9 @@ asmlinkage int irix_syssgi(struct pt_regs *regs) int pid = (int) regs->regs[base + 5]; char *buf = (char *) regs->regs[base + 6]; struct task_struct *p; - char comm[16]; + char tcomm[sizeof(current->comm)]; - retval = verify_area(VERIFY_WRITE, buf, 16); + retval = verify_area(VERIFY_WRITE, buf, sizeof(tcomm)); if (retval) break; read_lock(&tasklist_lock); @@ -295,11 +300,11 @@ asmlinkage int irix_syssgi(struct pt_regs *regs) retval = -ESRCH; break; } - memcpy(comm, p->comm, 16); + get_task_comm(tcomm, p); read_unlock(&tasklist_lock); /* XXX Need to check sizes. */ - copy_to_user(buf, p->comm, 16); + copy_to_user(buf, tcomm, sizeof(tcomm)); retval = 0; break; } @@ -559,7 +564,7 @@ asmlinkage int irix_brk(unsigned long brk) /* * Check against rlimit and stack.. */ - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim >= RLIM_INFINITY) rlim = ~0; if (brk - mm->end_code > rlim) { @@ -616,8 +621,14 @@ asmlinkage int irix_getgid(struct pt_regs *regs) asmlinkage int irix_stime(int value) { - if (!capable(CAP_SYS_TIME)) - return -EPERM; + int err; + struct timespec tv; + + tv.tv_sec = value; + tv.tv_nsec = 0; + err = security_settime(&tv, NULL); + if (err) + return err; write_seqlock_irq(&xtime_lock); xtime.tv_sec = value; @@ -915,8 +926,8 @@ asmlinkage int irix_getdomainname(char *name, int len) return error; down_read(&uts_sem); - if(len > (__NEW_UTS_LEN - 1)) - len = __NEW_UTS_LEN - 1; + if (len > __NEW_UTS_LEN) + len = __NEW_UTS_LEN; error = 0; if (copy_to_user(name, system_utsname.domainname, len)) error = -EFAULT; @@ -1639,7 +1650,7 @@ asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf) struct kstatfs kbuf; int error, i; - printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n", + printk("[%s:%d] Wheee.. irix_statvfs64(%s,%p)\n", current->comm, current->pid, fname, buf); error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs64)); if(error) @@ -1685,7 +1696,7 @@ asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf) struct file *file; int error, i; - printk("[%s:%d] Wheee.. irix_fstatvfs(%d,%p)\n", + printk("[%s:%d] Wheee.. irix_fstatvfs64(%d,%p)\n", current->comm, current->pid, fd, buf); error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs)); @@ -2134,7 +2145,7 @@ asmlinkage int irix_ulimit(int cmd, int arg) retval = -EINVAL; goto out; #endif - retval = current->rlim[RLIMIT_NOFILE].rlim_cur; + retval = current->signal->rlim[RLIMIT_NOFILE].rlim_cur; goto out; case 5: diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 915e5539e..648c82292 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -1,7 +1,7 @@ /* * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net - * Copyright (c) 2003 Maciej W. Rozycki + * Copyright (c) 2003, 2004 Maciej W. Rozycki * * Common time service routines for MIPS machines. See * Documentation/mips/time.README. @@ -11,7 +11,6 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ -#include #include #include #include @@ -26,6 +25,7 @@ #include #include +#include #include #include #include @@ -52,13 +52,7 @@ EXPORT_SYMBOL(jiffies_64); */ extern volatile unsigned long wall_jiffies; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; - -/* - * whether we emulate local_timer_interrupts for SMP machines. - */ -int emulate_local_timer_interrupt; - +DEFINE_SPINLOCK(rtc_lock); /* * By default we provide the null RTC ops @@ -277,7 +271,7 @@ static unsigned long fixed_rate_gettimeoffset(void) __asm__("multu %1,%2" : "=h" (res) : "r" (count), "r" (sll32_usecs_per_cycle) - : "lo", "accum"); + : "lo", GCC_REG_ACCUM); /* * Due to possible jiffies inconsistencies, we need to check @@ -332,7 +326,7 @@ static unsigned long calibrate_div32_gettimeoffset(void) __asm__("multu %1,%2" : "=h" (res) : "r" (count), "r" (quotient) - : "lo", "accum"); + : "lo", GCC_REG_ACCUM); /* * Due to possible jiffies inconsistencies, we need to check @@ -374,7 +368,7 @@ static unsigned long calibrate_div64_gettimeoffset(void) : "r" (timerhi), "m" (timerlo), "r" (tmp), "r" (USECS_PER_JIFFY), "r" (USECS_PER_JIFFY_FRAC) - : "hi", "lo", "accum"); + : "hi", "lo", GCC_REG_ACCUM); cached_quotient = quotient; } } @@ -388,7 +382,7 @@ static unsigned long calibrate_div64_gettimeoffset(void) __asm__("multu %1,%2" : "=h" (res) : "r" (count), "r" (quotient) - : "lo", "accum"); + : "lo", GCC_REG_ACCUM); /* * Due to possible jiffies inconsistencies, we need to check @@ -418,10 +412,7 @@ void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { if (current->pid) profile_tick(CPU_PROFILING, regs); -#ifdef CONFIG_SMP - /* in UP mode, update_process_times() is invoked by do_timer() */ update_process_times(user_mode(regs)); -#endif } /* @@ -505,7 +496,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) } } -#if !defined(CONFIG_SMP) /* * In UP mode, we call local_timer_interrupt() to do profiling * and process accouting. @@ -515,21 +505,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ local_timer_interrupt(irq, dev_id, regs); -#else /* CONFIG_SMP */ - - if (emulate_local_timer_interrupt) { - /* - * this is the place where we send out inter-process - * interrupts and let each CPU do its own profiling - * and process accouting. - * - * Obviously we need to call local_timer_interrupt() for - * the current CPU too. - */ - panic("Not implemented yet!!!"); - } -#endif /* CONFIG_SMP */ - return IRQ_HANDLED; } diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index af1b42b58..56c36e42e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -38,12 +38,9 @@ #include #include -extern asmlinkage void handle_mod(void); +extern asmlinkage void handle_tlbm(void); extern asmlinkage void handle_tlbl(void); extern asmlinkage void handle_tlbs(void); -extern asmlinkage void __xtlb_mod(void); -extern asmlinkage void __xtlb_tlbl(void); -extern asmlinkage void __xtlb_tlbs(void); extern asmlinkage void handle_adel(void); extern asmlinkage void handle_ades(void); extern asmlinkage void handle_ibe(void); @@ -82,7 +79,12 @@ void show_stack(struct task_struct *task, unsigned long *sp) long stackdata; int i; - sp = sp ? sp : (unsigned long *) &sp; + if (!sp) { + if (task && task != current) + sp = (unsigned long *) task->thread.reg29; + else + sp = (unsigned long *) &sp; + } printk("Stack :"); i = 0; @@ -110,8 +112,12 @@ void show_trace(struct task_struct *task, unsigned long *stack) const int field = 2 * sizeof(unsigned long); unsigned long addr; - if (!stack) - stack = (unsigned long*)&stack; + if (!stack) { + if (task && task != current) + stack = (unsigned long *) task->thread.reg29; + else + stack = (unsigned long *) &stack; + } printk("Call Trace:"); #ifdef CONFIG_KALLSYMS @@ -244,7 +250,7 @@ void show_registers(struct pt_regs *regs) printk("\n"); } -static spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(die_lock); NORET_TYPE void __die(const char * str, struct pt_regs * regs, const char * file, const char * func, unsigned long line) @@ -390,6 +396,8 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) goto sig; } + preempt_disable(); + if (ll_task == NULL || ll_task == current) { ll_bit = 1; } else { @@ -397,6 +405,8 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) } ll_task = current; + preempt_enable(); + regs->regs[(opcode & RT) >> 16] = value; compute_return_epc(regs); @@ -429,12 +439,18 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode) signal = SIGBUS; goto sig; } + + preempt_disable(); + if (ll_bit == 0 || ll_task != current) { regs->regs[reg] = 0; + preempt_enable(); compute_return_epc(regs); return; } + preempt_enable(); + if (put_user(regs->regs[reg], vaddr)) { signal = SIGSEGV; goto sig; @@ -494,6 +510,8 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) if (fcr31 & FPU_CSR_UNI_X) { int sig; + preempt_disable(); + /* * Unimplemented operation exception. If we've got the full * software emulator on-board, let's use it... @@ -519,6 +537,8 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) /* Restore the hardware register state */ restore_fp(current); + preempt_enable(); + /* If something went wrong, signal */ if (sig) force_sig(sig, current); @@ -638,12 +658,14 @@ asmlinkage void do_cpu(struct pt_regs *regs) break; case 1: + preempt_disable(); + own_fpu(); - if (current->used_math) { /* Using the FPU again. */ + if (used_math()) { /* Using the FPU again. */ restore_fp(current); } else { /* First time FPU user. */ init_fpu(); - current->used_math = 1; + set_used_math(); } if (!cpu_has_fpu) { @@ -653,6 +675,8 @@ asmlinkage void do_cpu(struct pt_regs *regs) force_sig(sig, current); } + preempt_enable(); + return; case 2: @@ -892,15 +916,21 @@ extern void tlb_init(void); void __init per_cpu_trap_init(void) { unsigned int cpu = smp_processor_id(); + unsigned int status_set = ST0_CU0; - /* Some firmware leaves the BEV flag set, clear it. */ - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_BEV); + /* + * Disable coprocessors and select 32-bit or 64-bit addressing + * and the 16/32 or 32/32 FPR register model. Reset the BEV + * flag that some firmware may have left set and the TS bit (for + * IP27). Set XX for ISA IV code to work. + */ #ifdef CONFIG_MIPS64 - set_c0_status(ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX); + status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; #endif - if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) - set_c0_status(ST0_XX); + status_set |= ST0_XX; + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, + status_set); /* * Some MIPS CPUs have a dedicated interrupt vector which reduces the @@ -977,16 +1007,10 @@ void __init trap_init(void) if (board_be_init) board_be_init(); -#ifdef CONFIG_MIPS32 - set_except_vector(1, handle_mod); + set_except_vector(1, handle_tlbm); set_except_vector(2, handle_tlbl); set_except_vector(3, handle_tlbs); -#endif -#ifdef CONFIG_MIPS64 - set_except_vector(1, __xtlb_mod); - set_except_vector(2, __xtlb_tlbl); - set_except_vector(3, __xtlb_tlbs); -#endif + set_except_vector(4, handle_adel); set_except_vector(5, handle_ades); @@ -1008,7 +1032,8 @@ void __init trap_init(void) set_except_vector(24, handle_mcheck); if (cpu_has_vce) - memcpy((void *)(CAC_BASE + 0x180), &except_vec3_r4000, 0x80); + /* Special exception: R4[04]00 uses also the divec space. */ + memcpy((void *)(CAC_BASE + 0x180), &except_vec3_r4000, 0x100); else if (cpu_has_4kex) memcpy((void *)(CAC_BASE + 0x180), &except_vec3_generic, 0x80); else @@ -1022,7 +1047,7 @@ void __init trap_init(void) * unaligned ldc1/sdc1 exception. The handlers have not been * written yet. Well, anyway there is no R6000 machine on the * current list of targets for Linux/MIPS. - * (Duh, crap, there is someone with a tripple R6k machine) + * (Duh, crap, there is someone with a triple R6k machine) */ //set_except_vector(14, handle_mc); //set_except_vector(15, handle_ndc); diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index e70684ee0..e830d788c 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -49,7 +49,7 @@ SECTIONS /* writeable */ .data : { /* Data */ - . = . + MAPPED_OFFSET; /* for CONFIG_MAPPED_KERNEL */ + . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ *(.data.init_task) *(.data) @@ -85,8 +85,6 @@ SECTIONS /* will be freed after init */ . = ALIGN(4096); /* Init code and data */ __init_begin = .; - /* /DISCARD/ doesn't work for .reginfo */ - .reginfo : { *(.reginfo) } .init.text : { _sinittext = .; *(.init.text) @@ -150,6 +148,15 @@ SECTIONS *(.exit.text) *(.exit.data) *(.exitcall.exit) + + /* ABI crap starts here */ + *(.comment) + *(.MIPS.options) + *(.note) + *(.options) + *(.pdr) + *(.reginfo) + *(.mdebug*) } /* This is the MIPS specific mdebug section. */ diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c index 08871349a..1148a2d20 100644 --- a/arch/mips/lasat/interrupt.c +++ b/arch/mips/lasat/interrupt.c @@ -125,12 +125,10 @@ void lasat_hw0_irqdispatch(struct pt_regs *regs) } } -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; - init_generic_irq(); - switch (mips_machtype) { case MACH_LASAT_100: lasat_int_status = (void *)LASAT_INT_STATUS_REG_100; @@ -147,7 +145,7 @@ void __init init_IRQ(void) *lasat_int_mask &= 0xffff; break; default: - panic("init_IRQ: mips_machtype incorrect"); + panic("arch_init_irq: mips_machtype incorrect"); } /* Now safe to set the exception vector. */ diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c index 0c21bb336..e371ed5cb 100644 --- a/arch/mips/lasat/setup.c +++ b/arch/mips/lasat/setup.c @@ -134,7 +134,7 @@ void __init serial_init(void) memset(&s, 0, sizeof(s)); - s.flags = STD_COM_FLAGS|UPF_RESOURCES; + s.flags = STD_COM_FLAGS; s.iotype = SERIAL_IO_MEM; if (mips_machtype == MACH_LASAT_100) { diff --git a/arch/mips/lib-32/dump_tlb.c b/arch/mips/lib-32/dump_tlb.c index b92fea692..019ac8f00 100644 --- a/arch/mips/lib-32/dump_tlb.c +++ b/arch/mips/lib-32/dump_tlb.c @@ -32,6 +32,8 @@ static inline const char *msk2str(unsigned int mask) case PM_256M: return "256Mb"; #endif } + + return "unknown"; } #define BARRIER() \ diff --git a/arch/mips/lib-64/dump_tlb.c b/arch/mips/lib-64/dump_tlb.c index eb0b6cf80..42f88e055 100644 --- a/arch/mips/lib-64/dump_tlb.c +++ b/arch/mips/lib-64/dump_tlb.c @@ -32,6 +32,8 @@ static inline const char *msk2str(unsigned int mask) case PM_256M: return "256Mb"; #endif } + + return "unknown"; } #define BARRIER() \ @@ -148,16 +150,16 @@ void dump_list_process(struct task_struct *t, void *address) printk("tasks->mm.pgd == %08lx\n", (unsigned long) t->mm->pgd); page_dir = pgd_offset(t->mm, 0); - printk("page_dir == %08lx\n", (unsigned long) page_dir); + printk("page_dir == %016lx\n", (unsigned long) page_dir); pgd = pgd_offset(t->mm, addr); - printk("pgd == %08lx, ", (unsigned long) pgd); + printk("pgd == %016lx\n", (unsigned long) pgd); pmd = pmd_offset(pgd, addr); - printk("pmd == %08lx, ", (unsigned long) pmd); + printk("pmd == %016lx\n", (unsigned long) pmd); pte = pte_offset(pmd, addr); - printk("pte == %08lx, ", (unsigned long) pte); + printk("pte == %016lx\n", (unsigned long) pte); page = *pte; printk("page == %08lx\n", pte_val(page)); @@ -190,7 +192,7 @@ unsigned int vtop(void *address) pgd = pgd_offset(current->mm, addr); pmd = pmd_offset(pgd, addr); pte = pte_offset(pmd, addr); - paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; + paddr = (CKSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; paddr |= (addr & ~PAGE_MASK); return paddr; diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 92b5947e5..0f4b55605 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -2,7 +2,7 @@ # Makefile for MIPS-specific library files.. # -lib-y += csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o strlen_user.o \ - strncpy_user.o strnlen_user.o +lib-y += csum_partial_copy.o dec_and_lock.o iomap.o memcpy.o promlib.o \ + strlen_user.o strncpy_user.o strnlen_user.o EXTRA_AFLAGS := $(CFLAGS) diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c index 0d6dce9b7..ffed0a6a1 100644 --- a/arch/mips/lib/csum_partial_copy.c +++ b/arch/mips/lib/csum_partial_copy.c @@ -6,16 +6,17 @@ * Copyright (C) 1994, 1995 Waldorf Electronics GmbH * Copyright (C) 1998, 1999 Ralf Baechle */ -#include +#include #include #include #include #include +#include /* * copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy_nocheck(const char *src, char *dst, +unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { /* @@ -32,11 +33,12 @@ unsigned int csum_partial_copy_nocheck(const char *src, char *dst, * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user (const char *src, char *dst, +unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { int missing; + might_sleep(); missing = copy_from_user(dst, src, len); if (missing) { memset(dst + len - missing, 0, missing); diff --git a/arch/mips/lib/dec_and_lock.c b/arch/mips/lib/dec_and_lock.c index b8aad5f39..e44e9579b 100644 --- a/arch/mips/lib/dec_and_lock.c +++ b/arch/mips/lib/dec_and_lock.c @@ -28,7 +28,7 @@ */ #ifndef ATOMIC_DEC_AND_LOCK -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) { int counter; int newcount; @@ -51,5 +51,5 @@ int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) return 0; } -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif /* ATOMIC_DEC_AND_LOCK */ diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S index 6e9212035..07660e86c 100644 --- a/arch/mips/lib/strlen_user.S +++ b/arch/mips/lib/strlen_user.S @@ -3,13 +3,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 1996, 1998, 1999 by Ralf Baechle + * Copyright (c) 1996, 1998, 1999, 2004 by Ralf Baechle * Copyright (c) 1999 Silicon Graphics, Inc. */ #include #include #include -#include #define EX(insn,reg,addr,handler) \ 9: insn reg, addr; \ diff --git a/arch/mips/lib/strnlen_user.S b/arch/mips/lib/strnlen_user.S index 0f3116255..6e7a8eed4 100644 --- a/arch/mips/lib/strnlen_user.S +++ b/arch/mips/lib/strnlen_user.S @@ -3,13 +3,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 1996, 1998, 1999 by Ralf Baechle + * Copyright (c) 1996, 1998, 1999, 2004 by Ralf Baechle * Copyright (c) 1999 Silicon Graphics, Inc. */ #include #include #include -#include #define EX(insn,reg,addr,handler) \ 9: insn reg, addr; \ diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index f39b021b0..20a552be0 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c @@ -2,7 +2,7 @@ * cp1emu.c: a MIPS coprocessor 1 (fpu) instruction emulator * * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com @@ -528,9 +528,9 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx) if (MIPSInst_FUNC(ir) != movc_op) return SIGILL; cond = fpucondbit[MIPSInst_RT(ir) >> 2]; - if (((ctx->fcr31 & cond) != 0) != ((MIPSInst_RT(ir) & 1) != 0)) - return 0; - xcp->regs[MIPSInst_RD(ir)] = xcp->regs[MIPSInst_RS(ir)]; + if (((ctx->fcr31 & cond) != 0) == ((MIPSInst_RT(ir) & 1) != 0)) + xcp->regs[MIPSInst_RD(ir)] = + xcp->regs[MIPSInst_RS(ir)]; break; #endif diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c index 30e6551b2..bcf73bb5c 100644 --- a/arch/mips/math-emu/dp_add.c +++ b/arch/mips/math-emu/dp_add.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_cmp.c b/arch/mips/math-emu/dp_cmp.c index e624e7367..8ab4f320a 100644 --- a/arch/mips/math-emu/dp_cmp.c +++ b/arch/mips/math-emu/dp_cmp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_div.c b/arch/mips/math-emu/dp_div.c index 373ac9916..6acedce3b 100644 --- a/arch/mips/math-emu/dp_div.c +++ b/arch/mips/math-emu/dp_div.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c index ff51afbb5..0065deaee 100644 --- a/arch/mips/math-emu/dp_fint.c +++ b/arch/mips/math-emu/dp_fint.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c index 346b09790..cb105b1dd 100644 --- a/arch/mips/math-emu/dp_flong.c +++ b/arch/mips/math-emu/dp_flong.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_frexp.c b/arch/mips/math-emu/dp_frexp.c index 7d8c5e6a5..e650cb10c 100644 --- a/arch/mips/math-emu/dp_frexp.c +++ b/arch/mips/math-emu/dp_frexp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_fsp.c b/arch/mips/math-emu/dp_fsp.c index 133eb3e1a..494d19ac7 100644 --- a/arch/mips/math-emu/dp_fsp.c +++ b/arch/mips/math-emu/dp_fsp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_logb.c b/arch/mips/math-emu/dp_logb.c index 22aeb2115..603388621 100644 --- a/arch/mips/math-emu/dp_logb.c +++ b/arch/mips/math-emu/dp_logb.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_modf.c b/arch/mips/math-emu/dp_modf.c index d77052584..25861a42c 100644 --- a/arch/mips/math-emu/dp_modf.c +++ b/arch/mips/math-emu/dp_modf.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c index e78f88a8c..f2373902f 100644 --- a/arch/mips/math-emu/dp_mul.c +++ b/arch/mips/math-emu/dp_mul.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_scalb.c b/arch/mips/math-emu/dp_scalb.c index bb0146183..b84e63383 100644 --- a/arch/mips/math-emu/dp_scalb.c +++ b/arch/mips/math-emu/dp_scalb.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c index 5f9d9d122..495c1ac94 100644 --- a/arch/mips/math-emu/dp_simple.c +++ b/arch/mips/math-emu/dp_simple.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c index d40cbd909..c35e871ae 100644 --- a/arch/mips/math-emu/dp_sqrt.c +++ b/arch/mips/math-emu/dp_sqrt.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c index b952f0dcc..b30c5b1f1 100644 --- a/arch/mips/math-emu/dp_sub.c +++ b/arch/mips/math-emu/dp_sub.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_tint.c b/arch/mips/math-emu/dp_tint.c index 84fd730e4..77b2b7ccf 100644 --- a/arch/mips/math-emu/dp_tint.c +++ b/arch/mips/math-emu/dp_tint.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/dp_tlong.c b/arch/mips/math-emu/dp_tlong.c index 5af061f17..d71113e07 100644 --- a/arch/mips/math-emu/dp_tlong.c +++ b/arch/mips/math-emu/dp_tlong.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c index d028a19f4..f0a364adb 100644 --- a/arch/mips/math-emu/ieee754.c +++ b/arch/mips/math-emu/ieee754.c @@ -8,7 +8,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h index 8777a0d16..b8772f469 100644 --- a/arch/mips/math-emu/ieee754.h +++ b/arch/mips/math-emu/ieee754.h @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754d.c b/arch/mips/math-emu/ieee754d.c index 87b287189..7e900f309 100644 --- a/arch/mips/math-emu/ieee754d.c +++ b/arch/mips/math-emu/ieee754d.c @@ -3,7 +3,7 @@ * * MIPS floating point support * - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * This program is free software; you can distribute it and/or modify it diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c index 104fb44d9..3e214aac4 100644 --- a/arch/mips/math-emu/ieee754dp.c +++ b/arch/mips/math-emu/ieee754dp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754dp.h b/arch/mips/math-emu/ieee754dp.h index 7d5d25682..a37370dae 100644 --- a/arch/mips/math-emu/ieee754dp.h +++ b/arch/mips/math-emu/ieee754dp.h @@ -4,7 +4,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h index fa4fd04a3..4a5a81d6b 100644 --- a/arch/mips/math-emu/ieee754int.h +++ b/arch/mips/math-emu/ieee754int.h @@ -4,7 +4,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754m.c b/arch/mips/math-emu/ieee754m.c index 29b4e3376..d66896cd8 100644 --- a/arch/mips/math-emu/ieee754m.c +++ b/arch/mips/math-emu/ieee754m.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c index 03a6f621d..adda851cd 100644 --- a/arch/mips/math-emu/ieee754sp.c +++ b/arch/mips/math-emu/ieee754sp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h index 20b0b6e9a..ae82f5129 100644 --- a/arch/mips/math-emu/ieee754sp.h +++ b/arch/mips/math-emu/ieee754sp.h @@ -4,7 +4,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/ieee754xcpt.c b/arch/mips/math-emu/ieee754xcpt.c index 9417fd700..7d8ef8965 100644 --- a/arch/mips/math-emu/ieee754xcpt.c +++ b/arch/mips/math-emu/ieee754xcpt.c @@ -1,6 +1,6 @@ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c index 5229fdc69..d8c4211bc 100644 --- a/arch/mips/math-emu/sp_add.c +++ b/arch/mips/math-emu/sp_add.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_cmp.c b/arch/mips/math-emu/sp_cmp.c index 0d5a7a1c3..d3eff6b04 100644 --- a/arch/mips/math-emu/sp_cmp.c +++ b/arch/mips/math-emu/sp_cmp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c index cca82fac7..2b437fcfd 100644 --- a/arch/mips/math-emu/sp_div.c +++ b/arch/mips/math-emu/sp_div.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_fdp.c b/arch/mips/math-emu/sp_fdp.c index c8d3c3a17..4093723d1 100644 --- a/arch/mips/math-emu/sp_fdp.c +++ b/arch/mips/math-emu/sp_fdp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c index eceab27d1..42d9ed4b9 100644 --- a/arch/mips/math-emu/sp_fint.c +++ b/arch/mips/math-emu/sp_fint.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c index 071cabb3d..1e26795cc 100644 --- a/arch/mips/math-emu/sp_flong.c +++ b/arch/mips/math-emu/sp_flong.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_frexp.c b/arch/mips/math-emu/sp_frexp.c index e547bcc87..359c6483d 100644 --- a/arch/mips/math-emu/sp_frexp.c +++ b/arch/mips/math-emu/sp_frexp.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_logb.c b/arch/mips/math-emu/sp_logb.c index 453f966dd..3c337219c 100644 --- a/arch/mips/math-emu/sp_logb.c +++ b/arch/mips/math-emu/sp_logb.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_modf.c b/arch/mips/math-emu/sp_modf.c index 305dea24d..4b1dbac79 100644 --- a/arch/mips/math-emu/sp_modf.c +++ b/arch/mips/math-emu/sp_modf.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c index 954bd7a1a..3f070f822 100644 --- a/arch/mips/math-emu/sp_mul.c +++ b/arch/mips/math-emu/sp_mul.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_scalb.c b/arch/mips/math-emu/sp_scalb.c index 65fdb51c5..44ceb87ea 100644 --- a/arch/mips/math-emu/sp_scalb.c +++ b/arch/mips/math-emu/sp_scalb.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c index 4ddbe6b22..c809830df 100644 --- a/arch/mips/math-emu/sp_simple.c +++ b/arch/mips/math-emu/sp_simple.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_sqrt.c b/arch/mips/math-emu/sp_sqrt.c index e6a4e8f09..8a934b9f7 100644 --- a/arch/mips/math-emu/sp_sqrt.c +++ b/arch/mips/math-emu/sp_sqrt.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c index 4a24f82a7..dbb802c1a 100644 --- a/arch/mips/math-emu/sp_sub.c +++ b/arch/mips/math-emu/sp_sub.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_tint.c b/arch/mips/math-emu/sp_tint.c index d77f46296..1d73d2abe 100644 --- a/arch/mips/math-emu/sp_tint.c +++ b/arch/mips/math-emu/sp_tint.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/math-emu/sp_tlong.c b/arch/mips/math-emu/sp_tlong.c index 9b1ac8d57..4be21aa81 100644 --- a/arch/mips/math-emu/sp_tlong.c +++ b/arch/mips/math-emu/sp_tlong.c @@ -3,7 +3,7 @@ */ /* * MIPS floating point support - * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. + * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * ######################################################################## diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c index 1e832a624..8f1d87521 100644 --- a/arch/mips/mips-boards/atlas/atlas_int.c +++ b/arch/mips/mips-boards/atlas/atlas_int.c @@ -23,7 +23,6 @@ * Atlas board. * */ -#include #include #include #include @@ -118,12 +117,7 @@ void atlas_hw0_irqdispatch(struct pt_regs *regs) do_IRQ(irq, regs); } -#ifdef CONFIG_KGDB -extern void breakpoint(void); -extern int remote_debug; -#endif - -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; @@ -145,11 +139,4 @@ void __init init_IRQ(void) irq_desc[i].handler = &atlas_irq_type; spin_lock_init(&irq_desc[i].lock); } - -#ifdef CONFIG_KGDB - if (remote_debug) { - set_debug_traps(); - breakpoint(); - } -#endif } diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c index 3940bb8fc..0a1dd9bbc 100644 --- a/arch/mips/mips-boards/atlas/atlas_setup.c +++ b/arch/mips/mips-boards/atlas/atlas_setup.c @@ -84,7 +84,7 @@ static void __init serial_init(void) #endif s.irq = ATLASINT_UART; s.uartclk = ATLAS_BASE_BAUD * 16; - s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | UPF_RESOURCES | ASYNC_AUTO_IRQ; + s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; s.iotype = SERIAL_IO_PORT; s.regshift = 3; diff --git a/arch/mips/mips-boards/generic/gdb_hook.c b/arch/mips/mips-boards/generic/gdb_hook.c index 73ff46f98..91a2ccbe3 100644 --- a/arch/mips/mips-boards/generic/gdb_hook.c +++ b/arch/mips/mips-boards/generic/gdb_hook.c @@ -18,7 +18,6 @@ * This is the interface to the remote debugger stub. */ #include -#include #include #include #include diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c index 636cdcd25..31caf0603 100644 --- a/arch/mips/mips-boards/generic/init.c +++ b/arch/mips/mips-boards/generic/init.c @@ -42,8 +42,6 @@ extern char rs_getDebugChar(void); extern int saa9730_kgdb_hook(int); extern int saa9730_putDebugChar(char); extern char saa9730_getDebugChar(void); - -int remote_debug = 0; #endif int prom_argc; @@ -219,7 +217,7 @@ void __init kgdb_config (void) generic_putDebugChar (*s++); } - remote_debug = 1; + kgdb_enabled = 1; /* Breakpoint is invoked after interrupts are initialised */ } } diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c index 56cf37a26..5ae2b43e4 100644 --- a/arch/mips/mips-boards/generic/memory.c +++ b/arch/mips/mips-boards/generic/memory.c @@ -77,7 +77,7 @@ struct prom_pmemblock * __init prom_getmdesc(void) mdesc[1].base = 0x00001000; mdesc[1].size = 0x000ef000; -#if (CONFIG_MIPS_MALTA) +#ifdef CONFIG_MIPS_MALTA /* * The area 0x000f0000-0x000fffff is allocated for BIOS memory by the * south bridge and PCI access always forwarded to the ISA Bus and diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c index cccd34cee..92c34bda0 100644 --- a/arch/mips/mips-boards/generic/pci.c +++ b/arch/mips/mips-boards/generic/pci.c @@ -2,6 +2,8 @@ * Carsten Langgaard, carstenl@mips.com * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * 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. @@ -24,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index 33e0f4b20..dd2db3596 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c @@ -1,6 +1,6 @@ /* * Carsten Langgaard, carstenl@mips.com - * Copyright (C) 2000, 2001 MIPS Technologies, Inc. + * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc. * Copyright (C) 2001 Ralf Baechle * * This program is free software; you can distribute it and/or modify it @@ -21,7 +21,6 @@ * The interrupt controller is located in the South Bridge a PIIX4 device * with two internal 82C95 interrupt controllers. */ -#include #include #include #include @@ -41,13 +40,7 @@ extern asmlinkage void mipsIRQ(void); -#ifdef CONFIG_KGDB -extern void breakpoint(void); -extern void set_debug_traps(void); -extern int remote_debug; -#endif - -static spinlock_t mips_irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mips_irq_lock); static inline int mips_pcibios_iack(void) { @@ -161,9 +154,9 @@ void corehi_irqdispatch(struct pt_regs *regs) case MIPS_REVISION_CORID_CORE_FPGAR2: data = GT_READ(GT_INTRCAUSE_OFS); printk("GT_INTRCAUSE = %08x\n", data); - data = GT_READ(0x70); - datahi = GT_READ(0x78); - printk("GT_CPU_ERR_ADDR = %02x%08x\n", datahi, data); + data = GT_READ(GT_CPUERR_ADDRLO_OFS); + datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); + printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, data); break; case MIPS_REVISION_CORID_BONITO64: case MIPS_REVISION_CORID_CORE_20K: @@ -187,18 +180,8 @@ void corehi_irqdispatch(struct pt_regs *regs) die("CoreHi interrupt", regs); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { set_except_vector(0, mipsIRQ); - init_generic_irq(); init_i8259_irqs(); - -#ifdef CONFIG_KGDB - if (remote_debug) { - set_debug_traps(); - breakpoint(); - } -#endif } - - diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c index 72a16bf1f..3377e66de 100644 --- a/arch/mips/mips-boards/malta/malta_setup.c +++ b/arch/mips/mips-boards/malta/malta_setup.c @@ -22,6 +22,13 @@ #include #include +#ifdef CONFIG_MTD +#include +#include +#include +#include +#endif + #include #include #include @@ -53,6 +60,30 @@ struct resource standard_io_resources[] = { { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, }; +#ifdef CONFIG_MTD +static struct mtd_partition malta_mtd_partitions[] = { + { + .name = "YAMON", + .offset = 0x0, + .size = 0x100000, + .mask_flags = MTD_WRITEABLE + }, + { + .name = "User FS", + .offset = 0x100000, + .size = 0x2e0000 + }, + { + .name = "Board Config", + .offset = 0x3e0000, + .size = 0x020000, + .mask_flags = MTD_WRITEABLE + } +}; + +#define number_partitions (sizeof(malta_mtd_partitions)/sizeof(struct mtd_partition)) +#endif + const char *get_system_type(void) { return "MIPS Malta"; @@ -132,13 +163,13 @@ static int __init malta_setup(void) } } else - panic ("Hardware DMA cache coherency not supported\n"); + panic("Hardware DMA cache coherency not supported"); #endif } #ifdef CONFIG_DMA_COHERENT else { - panic ("Hardware DMA cache coherency not supported\n"); + panic("Hardware DMA cache coherency not supported"); } #endif @@ -179,6 +210,15 @@ static int __init malta_setup(void) }; #endif #endif + +#ifdef CONFIG_MTD + /* + * Support for MTD on Malta. Use the generic physmap driver + */ + physmap_configure(0x1e000000, 0x400000, 4, NULL); + physmap_set_partitions(malta_mtd_partitions, number_partitions); +#endif + mips_reboot_setup(); board_time_init = mips_time_init; diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c index 19fb7e27c..e5109657e 100644 --- a/arch/mips/mips-boards/sead/sead_int.c +++ b/arch/mips/mips-boards/sead/sead_int.c @@ -37,7 +37,7 @@ asmlinkage void sead_hw1_irqdispatch(struct pt_regs *regs) do_IRQ(SEADINT_UART1, regs); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { /* * Mask out all interrupt @@ -47,6 +47,5 @@ void __init init_IRQ(void) /* Now safe to set the exception vector. */ set_except_vector(0, mipsIRQ); - init_generic_irq(); mips_cpu_irq_init(0); } diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c index ab6c619f2..29892b88a 100644 --- a/arch/mips/mips-boards/sead/sead_setup.c +++ b/arch/mips/mips-boards/sead/sead_setup.c @@ -73,7 +73,7 @@ static void __init serial_init(void) #endif s.irq = SEADINT_UART0; s.uartclk = SEAD_BASE_BAUD * 16; - s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | UPF_RESOURCES | ASYNC_AUTO_IRQ; + s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; s.iotype = 0; s.regshift = 3; diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile index 04c393f26..f61e038b4 100644 --- a/arch/mips/mm/Makefile +++ b/arch/mips/mm/Makefile @@ -2,7 +2,8 @@ # Makefile for the Linux/MIPS-specific parts of the memory manager. # -obj-y += cache.o extable.o fault.o init.o pgtable.o +obj-y += cache.o extable.o fault.o init.o pgtable.o \ + tlbex.o tlbex-fault.o obj-$(CONFIG_MIPS32) += ioremap.o pgtable-32.o obj-$(CONFIG_MIPS64) += pgtable-64.o @@ -26,40 +27,6 @@ obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o -# -# TLB exception handling code differs between 32-bit and 64-bit kernels. -# -ifdef CONFIG_MIPS32 -obj-$(CONFIG_CPU_R3000) += tlbex32-r3k.o -obj-$(CONFIG_CPU_TX49XX) += tlbex32-r4k.o -obj-$(CONFIG_CPU_R4300) += tlbex32-r4k.o -obj-$(CONFIG_CPU_R4X00) += tlbex32-r4k.o -obj-$(CONFIG_CPU_VR41XX) += tlbex32-r4k.o -obj-$(CONFIG_CPU_R5000) += tlbex32-r4k.o -obj-$(CONFIG_CPU_NEVADA) += tlbex32-r4k.o -obj-$(CONFIG_CPU_R5432) += tlbex32-r4k.o -obj-$(CONFIG_CPU_RM7000) += tlbex32-r4k.o -obj-$(CONFIG_CPU_RM9000) += tlbex32-r4k.o -obj-$(CONFIG_CPU_R10000) += tlbex32-r4k.o -obj-$(CONFIG_CPU_MIPS32) += tlbex32-r4k.o -obj-$(CONFIG_CPU_MIPS64) += tlbex32-r4k.o -obj-$(CONFIG_CPU_SB1) += tlbex32-r4k.o -obj-$(CONFIG_CPU_TX39XX) += tlbex32-r3k.o -endif -ifdef CONFIG_MIPS64 -obj-$(CONFIG_CPU_R4300) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_R4X00) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_R5000) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_NEVADA) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_R5432) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_RM7000) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_RM9000) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_R10000) += tlb64-glue-r4k.o tlbex64-r4k.o -obj-$(CONFIG_CPU_SB1) += tlb64-glue-sb1.o tlbex64-r4k.o -obj-$(CONFIG_CPU_MIPS64) += tlb64-glue-r4k.o tlbex64-r4k.o -endif - - obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o obj-$(CONFIG_RM7000_CPU_SCACHE) += sc-rm7k.o @@ -67,8 +34,11 @@ obj-$(CONFIG_RM7000_CPU_SCACHE) += sc-rm7k.o # # Choose one DMA coherency model # +ifndef CONFIG_OWN_DMA obj-$(CONFIG_DMA_COHERENT) += dma-coherent.o obj-$(CONFIG_DMA_NONCOHERENT) += dma-noncoherent.o +endif obj-$(CONFIG_DMA_IP27) += dma-ip27.o +obj-$(CONFIG_DMA_IP32) += dma-ip32.o EXTRA_AFLAGS := $(CFLAGS) diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c index 444df9c5a..887683b3c 100644 --- a/arch/mips/mm/c-r3k.c +++ b/arch/mips/mm/c-r3k.c @@ -7,7 +7,7 @@ * Tx39XX R4k style caches added. HK * Copyright (C) 1998, 1999, 2000 Harald Koerfgen * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov - * Copyright (C) 2001 Maciej W. Rozycki + * Copyright (C) 2001, 2004 Maciej W. Rozycki */ #include #include @@ -337,6 +337,8 @@ void __init ld_mmu_r23000(void) flush_data_cache_page = r3k_flush_data_cache_page; _dma_cache_wback_inv = r3k_dma_cache_wback_inv; + _dma_cache_wback = r3k_dma_cache_wback_inv; + _dma_cache_inv = r3k_dma_cache_wback_inv; printk("Primary instruction cache %ldkB, linesize %ld bytes.\n", icache_size >> 10, icache_lsize); diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index b22df2d80..b2808cea6 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -49,7 +49,7 @@ struct bcache_ops *bcops = &no_sc_ops; #define R4600_HIT_CACHEOP_WAR_IMPL \ do { \ if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) \ - *(volatile unsigned long *)KSEG1; \ + *(volatile unsigned long *)CKSEG1; \ if (R4600_V1_HIT_CACHEOP_WAR) \ __asm__ __volatile__("nop;nop;nop;nop"); \ } while (0) @@ -86,7 +86,7 @@ static inline void r4k_blast_dcache_page_indexed_setup(void) static void (* r4k_blast_dcache)(void); -static void r4k_blast_dcache_setup(void) +static inline void r4k_blast_dcache_setup(void) { unsigned long dc_lsize = cpu_dcache_line_size(); @@ -238,6 +238,22 @@ static inline void r4k_blast_scache_page_setup(void) r4k_blast_scache_page = blast_scache128_page; } +static void (* r4k_blast_scache_page_indexed)(unsigned long addr); + +static inline void r4k_blast_scache_page_indexed_setup(void) +{ + unsigned long sc_lsize = cpu_scache_line_size(); + + if (sc_lsize == 16) + r4k_blast_scache_page_indexed = blast_scache16_page_indexed; + else if (sc_lsize == 32) + r4k_blast_scache_page_indexed = blast_scache32_page_indexed; + else if (sc_lsize == 64) + r4k_blast_scache_page_indexed = blast_scache64_page_indexed; + else if (sc_lsize == 128) + r4k_blast_scache_page_indexed = blast_scache128_page_indexed; +} + static void (* r4k_blast_scache)(void); static inline void r4k_blast_scache_setup(void) @@ -254,16 +270,25 @@ static inline void r4k_blast_scache_setup(void) r4k_blast_scache = blast_scache128; } +/* + * This is former mm's flush_cache_all() which really should be + * flush_cache_vunmap these days ... + */ +static inline void local_r4k_flush_cache_all(void * args) +{ + r4k_blast_dcache(); + r4k_blast_icache(); +} + static void r4k_flush_cache_all(void) { if (!cpu_has_dc_aliases) return; - r4k_blast_dcache(); - r4k_blast_icache(); + on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); } -static void r4k___flush_cache_all(void) +static inline void local_r4k___flush_cache_all(void * args) { r4k_blast_dcache(); r4k_blast_icache(); @@ -279,9 +304,14 @@ static void r4k___flush_cache_all(void) } } -static void r4k_flush_cache_range(struct vm_area_struct *vma, - unsigned long start, unsigned long end) +static void r4k___flush_cache_all(void) +{ + on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); +} + +static inline void local_r4k_flush_cache_range(void * args) { + struct vm_area_struct *vma = args; int exec; if (!(cpu_context(smp_processor_id(), vma->vm_mm))) @@ -294,10 +324,15 @@ static void r4k_flush_cache_range(struct vm_area_struct *vma, r4k_blast_icache(); } -static void r4k_flush_cache_mm(struct mm_struct *mm) +static void r4k_flush_cache_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) { - if (!cpu_has_dc_aliases) - return; + on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); +} + +static inline void local_r4k_flush_cache_mm(void * args) +{ + struct mm_struct *mm = args; if (!cpu_context(smp_processor_id(), mm)) return; @@ -316,22 +351,30 @@ static void r4k_flush_cache_mm(struct mm_struct *mm) r4k_blast_scache(); } -static void r4k_flush_cache_page(struct vm_area_struct *vma, - unsigned long page) +static void r4k_flush_cache_mm(struct mm_struct *mm) +{ + if (!cpu_has_dc_aliases) + return; + + on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); +} + +struct flush_cache_page_args { + struct vm_area_struct *vma; + unsigned long page; +}; + +static inline void local_r4k_flush_cache_page(void *args) { + struct flush_cache_page_args *fcp_args = args; + struct vm_area_struct *vma = fcp_args->vma; + unsigned long page = fcp_args->page; int exec = vma->vm_flags & VM_EXEC; struct mm_struct *mm = vma->vm_mm; pgd_t *pgdp; pmd_t *pmdp; pte_t *ptep; - /* - * If ownes no valid ASID yet, cannot possibly have gotten - * this page into the cache. - */ - if (cpu_context(smp_processor_id(), mm) == 0) - return; - page &= PAGE_MASK; pgdp = pgd_offset(mm, page); pmdp = pmd_offset(pgdp, page); @@ -351,8 +394,11 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma, * in that case, which doesn't overly flush the cache too much. */ if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) { - if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) + if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { r4k_blast_dcache_page(page); + if (exec && !cpu_icache_snoops_remote_store) + r4k_blast_scache_page(page); + } if (exec) r4k_blast_icache_page(page); @@ -364,8 +410,11 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma, * to work correctly. */ page = INDEX_BASE + (page & (dcache_size - 1)); - if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) + if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { r4k_blast_dcache_page_indexed(page); + if (exec && !cpu_icache_snoops_remote_store) + r4k_blast_scache_page_indexed(page); + } if (exec) { if (cpu_has_vtag_icache) { int cpu = smp_processor_id(); @@ -377,20 +426,53 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma, } } +static void r4k_flush_cache_page(struct vm_area_struct *vma, + unsigned long page) +{ + struct flush_cache_page_args args; + + /* + * If ownes no valid ASID yet, cannot possibly have gotten + * this page into the cache. + */ + if (cpu_context(smp_processor_id(), vma->vm_mm) == 0) + return; + + args.vma = vma; + args.page = page; + + on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); +} + +static inline void local_r4k_flush_data_cache_page(void * addr) +{ + r4k_blast_dcache_page((unsigned long) addr); +} + static void r4k_flush_data_cache_page(unsigned long addr) { - r4k_blast_dcache_page(addr); + on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); } -static void r4k_flush_icache_range(unsigned long start, unsigned long end) +struct flush_icache_range_args { + unsigned long start; + unsigned long end; +}; + +static inline void local_r4k_flush_icache_range(void *args) { + struct flush_icache_range_args *fir_args = args; unsigned long dc_lsize = current_cpu_data.dcache.linesz; + unsigned long ic_lsize = current_cpu_data.icache.linesz; + unsigned long sc_lsize = current_cpu_data.scache.linesz; + unsigned long start = fir_args->start; + unsigned long end = fir_args->end; unsigned long addr, aend; if (!cpu_has_ic_fills_f_dc) { - if (end - start > dcache_size) + if (end - start > dcache_size) { r4k_blast_dcache(); - else { + } else { addr = start & ~(dc_lsize - 1); aend = (end - 1) & ~(dc_lsize - 1); @@ -402,23 +484,50 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end) addr += dc_lsize; } } + + if (!cpu_icache_snoops_remote_store) { + if (end - start > scache_size) { + r4k_blast_scache(); + } else { + addr = start & ~(sc_lsize - 1); + aend = (end - 1) & ~(sc_lsize - 1); + + while (1) { + /* Hit_Writeback_Inv_D */ + protected_writeback_scache_line(addr); + if (addr == aend) + break; + addr += sc_lsize; + } + } + } } if (end - start > icache_size) r4k_blast_icache(); else { - addr = start & ~(dc_lsize - 1); - aend = (end - 1) & ~(dc_lsize - 1); + addr = start & ~(ic_lsize - 1); + aend = (end - 1) & ~(ic_lsize - 1); while (1) { /* Hit_Invalidate_I */ protected_flush_icache_line(addr); if (addr == aend) break; - addr += dc_lsize; + addr += ic_lsize; } } } +static void r4k_flush_icache_range(unsigned long start, unsigned long end) +{ + struct flush_icache_range_args args; + + args.start = start; + args.end = end; + + on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); +} + /* * Ok, this seriously sucks. We use them to flush a user page but don't * know the virtual address, so we have to blast away the whole icache @@ -426,14 +535,17 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end) * least know the kernel address of the page so we can flush it * selectivly. */ -static void r4k_flush_icache_page(struct vm_area_struct *vma, struct page *page) + +struct flush_icache_page_args { + struct vm_area_struct *vma; + struct page *page; +}; + +static inline void local_r4k_flush_icache_page(void *args) { - /* - * If there's no context yet, or the page isn't executable, no icache - * flush is needed. - */ - if (!(vma->vm_flags & VM_EXEC)) - return; + struct flush_icache_page_args *fip_args = args; + struct vm_area_struct *vma = fip_args->vma; + struct page *page = fip_args->page; /* * Tricky ... Because we don't know the virtual address we've got the @@ -455,6 +567,8 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma, struct page *page) if (!cpu_has_ic_fills_f_dc) { unsigned long addr = (unsigned long) page_address(page); r4k_blast_dcache_page(addr); + if (!cpu_icache_snoops_remote_store) + r4k_blast_scache_page(addr); ClearPageDcacheDirty(page); } @@ -471,6 +585,25 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma, struct page *page) r4k_blast_icache(); } +static void r4k_flush_icache_page(struct vm_area_struct *vma, + struct page *page) +{ + struct flush_icache_page_args args; + + /* + * If there's no context yet, or the page isn't executable, no I-cache + * flush is needed. + */ + if (!(vma->vm_flags & VM_EXEC)) + return; + + args.vma = vma; + args.page = page; + + on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1); +} + + #ifdef CONFIG_DMA_NONCOHERENT static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) @@ -574,23 +707,27 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) * very much about what happens in that case. Usually a segmentation * fault will dump the process later on anyway ... */ -static void r4k_flush_cache_sigtramp(unsigned long addr) +static void local_r4k_flush_cache_sigtramp(void * arg) { unsigned long ic_lsize = current_cpu_data.icache.linesz; unsigned long dc_lsize = current_cpu_data.dcache.linesz; + unsigned long sc_lsize = current_cpu_data.scache.linesz; + unsigned long addr = (unsigned long) arg; R4600_HIT_CACHEOP_WAR_IMPL; protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); + if (!cpu_icache_snoops_remote_store) + protected_writeback_scache_line(addr & ~(sc_lsize - 1)); protected_flush_icache_line(addr & ~(ic_lsize - 1)); if (MIPS4K_ICACHE_REFILL_WAR) { __asm__ __volatile__ ( ".set push\n\t" ".set noat\n\t" ".set mips3\n\t" -#if CONFIG_MIPS32 +#ifdef CONFIG_MIPS32 "la $at,1f\n\t" #endif -#if CONFIG_MIPS64 +#ifdef CONFIG_MIPS64 "dla $at,1f\n\t" #endif "cache %0,($at)\n\t" @@ -604,6 +741,11 @@ static void r4k_flush_cache_sigtramp(unsigned long addr) __asm__ __volatile__ ("sync"); } +static void r4k_flush_cache_sigtramp(unsigned long addr) +{ + on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1); +} + static void r4k_flush_icache_all(void) { if (cpu_has_vtag_icache) @@ -642,8 +784,8 @@ static inline void rm7k_erratum31(void) } } -static char *way_string[] = { NULL, "direct mapped", "2-way", "3-way", "4-way", - "5-way", "6-way", "7-way", "8-way" +static char *way_string[] __initdata = { NULL, "direct mapped", "2-way", + "3-way", "4-way", "5-way", "6-way", "7-way", "8-way" }; static void __init probe_pcache(void) @@ -893,7 +1035,7 @@ static void __init probe_pcache(void) cpu_has_vtag_icache ? "virtually tagged" : "physically tagged", way_string[c->icache.ways], c->icache.linesz); - printk("Primary data cache %ldkB %s, linesize %d bytes.\n", + printk("Primary data cache %ldkB, %s, linesize %d bytes.\n", dcache_size >> 10, way_string[c->dcache.ways], c->dcache.linesz); } @@ -982,7 +1124,7 @@ static void __init setup_scache(void) case CPU_R4000MC: case CPU_R4400SC: case CPU_R4400MC: - probe_scache_kseg1 = (probe_func_t) (KSEG1ADDR(&probe_scache)); + probe_scache_kseg1 = (probe_func_t) (CKSEG1ADDR(&probe_scache)); sc_present = probe_scache_kseg1(config); if (sc_present) c->options |= MIPS_CPU_CACHE_CDEX_S; @@ -1081,6 +1223,7 @@ void __init ld_mmu_r4xx0(void) r4k_blast_icache_page_indexed_setup(); r4k_blast_icache_setup(); r4k_blast_scache_page_setup(); + r4k_blast_scache_page_indexed_setup(); r4k_blast_scache_setup(); /* diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c index 5bae2b0e9..ad41b2b46 100644 --- a/arch/mips/mm/c-sb1.c +++ b/arch/mips/mm/c-sb1.c @@ -20,10 +20,13 @@ */ #include #include -#include + +#include #include #include #include +#include +#include #include extern void sb1_dma_init(void); @@ -32,17 +35,17 @@ extern void sb1_dma_init(void); static unsigned long icache_size; static unsigned long dcache_size; -static unsigned long icache_line_size; -static unsigned long dcache_line_size; +static unsigned short icache_line_size; +static unsigned short dcache_line_size; static unsigned int icache_index_mask; static unsigned int dcache_index_mask; -static unsigned long icache_assoc; -static unsigned long dcache_assoc; +static unsigned short icache_assoc; +static unsigned short dcache_assoc; -static unsigned int icache_sets; -static unsigned int dcache_sets; +static unsigned short icache_sets; +static unsigned short dcache_sets; static unsigned int icache_range_cutoff; static unsigned int dcache_range_cutoff; @@ -449,6 +452,11 @@ static unsigned int decode_cache_line_size(unsigned int config_field) * 9:7 Dcache Associativity */ +static char *way_string[] = { + "direct mapped", "2-way", "3-way", "4-way", + "5-way", "6-way", "7-way", "8-way", +}; + static __init void probe_cache_sizes(void) { u32 config1; @@ -473,6 +481,13 @@ static __init void probe_cache_sizes(void) */ icache_range_cutoff = icache_sets * icache_line_size; dcache_range_cutoff = (dcache_sets / 2) * icache_line_size; + + printk("Primary instruction cache %ldkB, %s, linesize %d bytes.\n", + icache_size >> 10, way_string[icache_assoc - 1], + icache_line_size); + printk("Primary data cache %ldkB, %s, linesize %d bytes.\n", + dcache_size >> 10, way_string[dcache_assoc - 1], + dcache_line_size); } /* @@ -488,7 +503,7 @@ void ld_mmu_sb1(void) /* Special cache error handler for SB1 */ memcpy((void *)(CAC_BASE + 0x100), &except_vec2_sb1, 0x80); memcpy((void *)(UNCAC_BASE + 0x100), &except_vec2_sb1, 0x80); - memcpy((void *)KSEG1ADDR(&handle_vec2_sb1), &handle_vec2_sb1, 0x80); + memcpy((void *)CKSEG1ADDR(&handle_vec2_sb1), &handle_vec2_sb1, 0x80); probe_cache_sizes(); @@ -526,15 +541,14 @@ void ld_mmu_sb1(void) * before subsequent instruction fetch. */ __asm__ __volatile__( + ".set push \n" " .set noat \n" " .set noreorder \n" - " .set mips3\n\t \n" - " la $1, 1f \n" - " mtc0 $1, $14 \n" + " .set mips3 \n" + " " STR(PTR_LA) " $1, 1f \n" + " " STR(MTC0) " $1, $14 \n" " eret \n" - "1: .set mips0\n\t \n" - " .set at \n" - " .set reorder" + "1: .set pop" : : : "memory"); diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index 9654d74c5..9b0592dff 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c @@ -484,9 +484,9 @@ void __init ld_mmu_tx39(void) current_cpu_data.icache.waybit = 0; current_cpu_data.dcache.waybit = 0; - printk("Primary instruction cache %ldkb, linesize %d bytes\n", + printk("Primary instruction cache %ldkB, linesize %d bytes\n", icache_size >> 10, current_cpu_data.icache.linesz); - printk("Primary data cache %ldkb, linesize %d bytes\n", + printk("Primary data cache %ldkB, linesize %d bytes\n", dcache_size >> 10, current_cpu_data.dcache.linesz); build_clear_page(); diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 98ba86334..e51ae38dd 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -45,10 +45,17 @@ EXPORT_SYMBOL(_dma_cache_inv); #endif /* CONFIG_DMA_NONCOHERENT */ -asmlinkage int sys_cacheflush(void *addr, int bytes, int cache) +/* + * We could optimize the case where the cache argument is not BCACHE but + * that seems very atypical use ... + */ +asmlinkage int sys_cacheflush(unsigned long addr, unsigned long int bytes, + unsigned int cache) { - /* This should flush more selectivly ... */ - __flush_cache_all(); + if (verify_area(VERIFY_WRITE, (void *) addr, bytes)) + return -EFAULT; + + flush_icache_range(addr, addr + bytes); return 0; } diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c index eb9d655f9..13d96d627 100644 --- a/arch/mips/mm/cerr-sb1.c +++ b/arch/mips/mm/cerr-sb1.c @@ -251,14 +251,14 @@ static const uint8_t parity[256] = { /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */ static const uint64_t mask_72_64[8] = { - 0x0738C808099264FFL, - 0x38C808099264FF07L, - 0xC808099264FF0738L, - 0x08099264FF0738C8L, - 0x099264FF0738C808L, - 0x9264FF0738C80809L, - 0x64FF0738C8080992L, - 0xFF0738C808099264L + 0x0738C808099264FFULL, + 0x38C808099264FF07ULL, + 0xC808099264FF0738ULL, + 0x08099264FF0738C8ULL, + 0x099264FF0738C808ULL, + 0x9264FF0738C80809ULL, + 0x64FF0738C8080992ULL, + 0xFF0738C808099264ULL }; /* Calculate the parity on a range of bits */ @@ -330,9 +330,9 @@ static uint32_t extract_ic(unsigned short addr, int data) ((lru >> 4) & 0x3), ((lru >> 6) & 0x3)); } - va = (taglo & 0xC0000FFFFFFFE000) | addr; + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr; if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3)) - va |= 0x3FFFF00000000000; + va |= 0x3FFFF00000000000ULL; valid = ((taghi >> 29) & 1); if (valid) { tlo_tmp = taglo & 0xfff3ff; @@ -473,7 +473,7 @@ static uint32_t extract_dc(unsigned short addr, int data) : "r" ((way << 13) | addr)); taglo = ((unsigned long long)taglohi << 32) | taglolo; - pa = (taglo & 0xFFFFFFE000) | addr; + pa = (taglo & 0xFFFFFFE000ULL) | addr; if (way == 0) { lru = (taghi >> 14) & 0xff; prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n", diff --git a/arch/mips/mm/cex-sb1.S b/arch/mips/mm/cex-sb1.S index e7c062249..2c3a23aa8 100644 --- a/arch/mips/mm/cex-sb1.S +++ b/arch/mips/mm/cex-sb1.S @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c index 24e3d3b0f..14b020d39 100644 --- a/arch/mips/mm/highmem.c +++ b/arch/mips/mm/highmem.c @@ -8,7 +8,7 @@ void *__kmap(struct page *page) void *addr; might_sleep(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return page_address(page); addr = kmap_high(page); flush_tlb_one((unsigned long)addr); @@ -20,7 +20,7 @@ void __kunmap(struct page *page) { if (in_interrupt()) BUG(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return; kunmap_high(page); } @@ -41,7 +41,7 @@ void *__kmap_atomic(struct page *page, enum km_type type) /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ inc_preempt_count(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index e580a911b..d353091a8 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -61,7 +61,7 @@ unsigned long setup_zero_pages(void) else order = 0; - empty_zero_page = __get_free_pages(GFP_KERNEL, order); + empty_zero_page = __get_free_pages(GFP_KERNEL | __GFP_ZERO, order); if (!empty_zero_page) panic("Oh boy, that early out of memory?"); @@ -74,7 +74,6 @@ unsigned long setup_zero_pages(void) size = PAGE_SIZE << order; zero_page_mask = (size - 1) & PAGE_MASK; - memset((void *)empty_zero_page, 0, size); return 1UL << order; } @@ -204,7 +203,6 @@ void __init mem_init(void) unsigned long tmp, ram; #ifdef CONFIG_HIGHMEM - highmem_start_page = mem_map + highstart_pfn; #ifdef CONFIG_DISCONTIGMEM #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet" #endif diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index b95b91b14..adf352273 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c @@ -96,6 +96,15 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr, return error; } +/* + * Allow physical addresses to be fixed up to help 36 bit peripherals. + */ +phys_t __attribute__ ((weak)) +fixup_bigphys_addr(phys_t phys_addr, phys_t size) +{ + return phys_addr; +} + /* * Generic mapping function (not visible outside): */ @@ -110,7 +119,7 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr, * caller shouldn't need to know that small detail. */ -#define IS_LOW512(addr) (!((phys_t)(addr) & ~0x1fffffffUL)) +#define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) { @@ -119,6 +128,8 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) phys_t last_addr; void * addr; + phys_addr = fixup_bigphys_addr(phys_addr, size); + /* Don't allow wraparound or zero size */ last_addr = phys_addr + size - 1; if (!size || last_addr < phys_addr) @@ -171,15 +182,14 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) -void __iounmap(void *addr) +void __iounmap(volatile void __iomem *addr) { struct vm_struct *p; if (IS_KSEG1(addr)) return; - vfree((void *) (PAGE_MASK & (unsigned long) addr)); - p = remove_vm_area((void *) (PAGE_MASK & (unsigned long) addr)); + p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); if (!p) { printk(KERN_ERR "iounmap: bad address %p\n", addr); return; diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c index 467fdfe21..9f8b16541 100644 --- a/arch/mips/mm/pg-r4k.c +++ b/arch/mips/mm/pg-r4k.c @@ -3,9 +3,8 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org) + * Copyright (C) 2003, 04, 05 Ralf Baechle (ralf@linux-mips.org) */ -#include #include #include #include @@ -57,12 +56,6 @@ void copy_page(void *to, void *from) __attribute__((alias("copy_page_array"))); EXPORT_SYMBOL(copy_page); -/* - * An address fits into a single register so it's safe to use 64-bit registers - * if we have 64-bit adresses. - */ -#define cpu_has_64bit_registers cpu_has_64bit_addresses - /* * This is suboptimal for 32-bit kernels; we assume that R10000 is only used * with 64-bit kernels. The prefetch offsets have been experimentally tuned @@ -145,7 +138,7 @@ static inline void __build_load_reg(int reg) union mips_instruction mi; unsigned int width; - if (cpu_has_64bit_registers) { + if (cpu_has_64bit_gp_regs) { mi.i_format.opcode = ld_op; width = 8; } else { @@ -224,7 +217,7 @@ static inline void build_cdex_p(void) emit_instruction(mi); } -static void __build_store_reg(int reg) +static void __init __build_store_reg(int reg) { union mips_instruction mi; unsigned int width; @@ -266,7 +259,7 @@ static inline void build_addiu_a2_a0(unsigned long offset) BUG_ON(offset > 0x7fff); - mi.i_format.opcode = cpu_has_64bit_addresses ? daddiu_op : addiu_op; + mi.i_format.opcode = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op; mi.i_format.rs = 4; /* $a0 */ mi.i_format.rt = 6; /* $a2 */ mi.i_format.simmediate = offset; @@ -280,7 +273,7 @@ static inline void build_addiu_a1(unsigned long offset) BUG_ON(offset > 0x7fff); - mi.i_format.opcode = cpu_has_64bit_addresses ? daddiu_op : addiu_op; + mi.i_format.opcode = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op; mi.i_format.rs = 5; /* $a1 */ mi.i_format.rt = 5; /* $a1 */ mi.i_format.simmediate = offset; @@ -296,7 +289,7 @@ static inline void build_addiu_a0(unsigned long offset) BUG_ON(offset > 0x7fff); - mi.i_format.opcode = cpu_has_64bit_addresses ? daddiu_op : addiu_op; + mi.i_format.opcode = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op; mi.i_format.rs = 4; /* $a0 */ mi.i_format.rt = 4; /* $a0 */ mi.i_format.simmediate = offset; @@ -356,7 +349,7 @@ void __init build_clear_page(void) case CPU_R10000: case CPU_R12000: pref_src_mode = Pref_LoadStreamed; - pref_dst_mode = Pref_StoreRetained; + pref_dst_mode = Pref_StoreStreamed; break; default: diff --git a/arch/mips/mm/pg-sb1.c b/arch/mips/mm/pg-sb1.c index 43d960583..59d131b5e 100644 --- a/arch/mips/mm/pg-sb1.c +++ b/arch/mips/mm/pg-sb1.c @@ -2,6 +2,7 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1997, 2001 Ralf Baechle (ralf@gnu.org) * Copyright (C) 2000 SiByte, Inc. + * Copyright (C) 2005 Thiemo Seufer * * Written by Justin Carlson of SiByte, Inc. * and Kip Walker of Broadcom Corp. @@ -39,11 +40,7 @@ #define SB1_PREF_STORE_STREAMED_HINT "5" #endif -#ifdef CONFIG_SIBYTE_DMA_PAGEOPS static inline void clear_page_cpu(void *page) -#else -void clear_page(void *page) -#endif { unsigned char *addr = (unsigned char *) page; unsigned char *end = addr + PAGE_SIZE; @@ -57,90 +54,143 @@ void clear_page(void *page) * since we know we're on an SB1, we force the assembler to take * 64-bit operands to speed things up */ - do { - __asm__ __volatile__( - " .set mips4 \n" + __asm__ __volatile__( + " .set push \n" + " .set mips4 \n" + " .set noreorder \n" #ifdef CONFIG_CPU_HAS_PREFETCH - " pref " SB1_PREF_STORE_STREAMED_HINT ", 0(%0) \n" /* Prefetch the first 4 lines */ - " pref " SB1_PREF_STORE_STREAMED_HINT ", 32(%0) \n" - " pref " SB1_PREF_STORE_STREAMED_HINT ", 64(%0) \n" - " pref " SB1_PREF_STORE_STREAMED_HINT ", 96(%0) \n" + " daddiu %0, %0, 128 \n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%0) \n" /* Prefetch the first 4 lines */ + " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%0) \n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%0) \n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%0) \n" + "1: sd $0, -128(%0) \n" /* Throw out a cacheline of 0's */ + " sd $0, -120(%0) \n" + " sd $0, -112(%0) \n" + " sd $0, -104(%0) \n" + " daddiu %0, %0, 32 \n" + " bnel %0, %1, 1b \n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%0) \n" + " daddiu %0, %0, -128 \n" #endif - "1: sd $0, 0(%0) \n" /* Throw out a cacheline of 0's */ - " sd $0, 8(%0) \n" - " sd $0, 16(%0) \n" - " sd $0, 24(%0) \n" -#ifdef CONFIG_CPU_HAS_PREFETCH - " pref " SB1_PREF_STORE_STREAMED_HINT ",128(%0) \n" /* Prefetch 4 lines ahead */ -#endif - " .set mips0 \n" - : - : "r" (addr) - : "memory"); - addr += 32; - } while (addr != end); + " sd $0, 0(%0) \n" /* Throw out a cacheline of 0's */ + "1: sd $0, 8(%0) \n" + " sd $0, 16(%0) \n" + " sd $0, 24(%0) \n" + " daddiu %0, %0, 32 \n" + " bnel %0, %1, 1b \n" + " sd $0, 0(%0) \n" + " .set pop \n" + : "+r" (addr) + : "r" (end) + : "memory"); } -#ifdef CONFIG_SIBYTE_DMA_PAGEOPS static inline void copy_page_cpu(void *to, void *from) -#else -void copy_page(void *to, void *from) -#endif { - unsigned char *src = from; - unsigned char *dst = to; + unsigned char *src = (unsigned char *)from; + unsigned char *dst = (unsigned char *)to; unsigned char *end = src + PAGE_SIZE; /* - * This should be optimized in assembly...can't use ld/sd, though, - * because the top 32 bits could be nuked if we took an interrupt - * during the routine. And this is not a good place to be cli()'ing - * * The pref's used here are using "streaming" hints, which cause the * copied data to be kicked out of the cache sooner. A page copy often * ends up copying a lot more data than is commonly used, so this seems * to make sense in terms of reducing cache pollution, but I've no real * performance data to back this up */ - - do { - __asm__ __volatile__( - " .set mips4 \n" + __asm__ __volatile__( + " .set push \n" + " .set mips4 \n" + " .set noreorder \n" #ifdef CONFIG_CPU_HAS_PREFETCH - " pref " SB1_PREF_LOAD_STREAMED_HINT ", 0(%0)\n" /* Prefetch the first 3 lines */ - " pref " SB1_PREF_STORE_STREAMED_HINT ", 0(%1)\n" - " pref " SB1_PREF_LOAD_STREAMED_HINT ", 32(%0)\n" - " pref " SB1_PREF_STORE_STREAMED_HINT ", 32(%1)\n" - " pref " SB1_PREF_LOAD_STREAMED_HINT ", 64(%0)\n" - " pref " SB1_PREF_STORE_STREAMED_HINT ", 64(%1)\n" + " daddiu %0, %0, 128 \n" + " daddiu %1, %1, 128 \n" + " pref " SB1_PREF_LOAD_STREAMED_HINT ", -128(%0)\n" /* Prefetch the first 4 lines */ + " pref " SB1_PREF_STORE_STREAMED_HINT ", -128(%1)\n" + " pref " SB1_PREF_LOAD_STREAMED_HINT ", -96(%0)\n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -96(%1)\n" + " pref " SB1_PREF_LOAD_STREAMED_HINT ", -64(%0)\n" + " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%1)\n" + " pref " SB1_PREF_LOAD_STREAMED_HINT ", -32(%0)\n" + "1: pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%1)\n" +# ifdef CONFIG_MIPS64 + " ld $8, -128(%0) \n" /* Block copy a cacheline */ + " ld $9, -120(%0) \n" + " ld $10, -112(%0) \n" + " ld $11, -104(%0) \n" + " sd $8, -128(%1) \n" + " sd $9, -120(%1) \n" + " sd $10, -112(%1) \n" + " sd $11, -104(%1) \n" +# else + " lw $2, -128(%0) \n" /* Block copy a cacheline */ + " lw $3, -124(%0) \n" + " lw $6, -120(%0) \n" + " lw $7, -116(%0) \n" + " lw $8, -112(%0) \n" + " lw $9, -108(%0) \n" + " lw $10, -104(%0) \n" + " lw $11, -100(%0) \n" + " sw $2, -128(%1) \n" + " sw $3, -124(%1) \n" + " sw $6, -120(%1) \n" + " sw $7, -116(%1) \n" + " sw $8, -112(%1) \n" + " sw $9, -108(%1) \n" + " sw $10, -104(%1) \n" + " sw $11, -100(%1) \n" +# endif + " daddiu %0, %0, 32 \n" + " daddiu %1, %1, 32 \n" + " bnel %0, %2, 1b \n" + " pref " SB1_PREF_LOAD_STREAMED_HINT ", -32(%0)\n" + " daddiu %0, %0, -128 \n" + " daddiu %1, %1, -128 \n" #endif - "1: lw $2, 0(%0) \n" /* Block copy a cacheline */ - " lw $3, 4(%0) \n" - " lw $4, 8(%0) \n" - " lw $5, 12(%0) \n" - " lw $6, 16(%0) \n" - " lw $7, 20(%0) \n" - " lw $8, 24(%0) \n" - " lw $9, 28(%0) \n" -#ifdef CONFIG_CPU_HAS_PREFETCH - " pref " SB1_PREF_LOAD_STREAMED_HINT ", 96(%0) \n" /* Prefetch ahead */ - " pref " SB1_PREF_STORE_STREAMED_HINT ", 96(%1) \n" +#ifdef CONFIG_MIPS64 + " ld $8, 0(%0) \n" /* Block copy a cacheline */ + "1: ld $9, 8(%0) \n" + " ld $10, 16(%0) \n" + " ld $11, 24(%0) \n" + " sd $8, 0(%1) \n" + " sd $9, 8(%1) \n" + " sd $10, 16(%1) \n" + " sd $11, 24(%1) \n" +#else + " lw $2, 0(%0) \n" /* Block copy a cacheline */ + "1: lw $3, 4(%0) \n" + " lw $6, 8(%0) \n" + " lw $7, 12(%0) \n" + " lw $8, 16(%0) \n" + " lw $9, 20(%0) \n" + " lw $10, 24(%0) \n" + " lw $11, 28(%0) \n" + " sw $2, 0(%1) \n" + " sw $3, 4(%1) \n" + " sw $6, 8(%1) \n" + " sw $7, 12(%1) \n" + " sw $8, 16(%1) \n" + " sw $9, 20(%1) \n" + " sw $10, 24(%1) \n" + " sw $11, 28(%1) \n" +#endif + " daddiu %0, %0, 32 \n" + " daddiu %1, %1, 32 \n" + " bnel %0, %2, 1b \n" +#ifdef CONFIG_MIPS64 + " ld $8, 0(%0) \n" +#else + " lw $2, 0(%0) \n" +#endif + " .set pop \n" + : "+r" (src), "+r" (dst) + : "r" (end) +#ifdef CONFIG_MIPS64 + : "$8","$9","$10","$11","memory"); +#else + : "$2","$3","$6","$7","$8","$9","$10","$11","memory"); #endif - " sw $2, 0(%1) \n" - " sw $3, 4(%1) \n" - " sw $4, 8(%1) \n" - " sw $5, 12(%1) \n" - " sw $6, 16(%1) \n" - " sw $7, 20(%1) \n" - " sw $8, 24(%1) \n" - " sw $9, 28(%1) \n" - " .set mips0 \n" - : - : "r" (src), "r" (dst) - : "$2","$3","$4","$5","$6","$7","$8","$9","memory"); - src += 32; - dst += 32; - } while (src != end); } @@ -151,10 +201,10 @@ void copy_page(void *to, void *from) * particular CPU. */ typedef struct dmadscr_s { - uint64_t dscr_a; - uint64_t dscr_b; - uint64_t pad_a; - uint64_t pad_b; + u64 dscr_a; + u64 dscr_b; + u64 pad_a; + u64 pad_b; } dmadscr_t; static dmadscr_t page_descr[NR_CPUS] __attribute__((aligned(SMP_CACHE_BYTES))); @@ -162,14 +212,14 @@ static dmadscr_t page_descr[NR_CPUS] __attribute__((aligned(SMP_CACHE_BYTES))); void sb1_dma_init(void) { int cpu = smp_processor_id(); - uint64_t base_val = PHYSADDR(&page_descr[cpu]) | V_DM_DSCR_BASE_RINGSZ(1); - - __raw_writeq(base_val, - IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); - __raw_writeq(base_val | M_DM_DSCR_BASE_RESET, - IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); - __raw_writeq(base_val | M_DM_DSCR_BASE_ENABL, - IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); + u64 base_val = CPHYSADDR(&page_descr[cpu]) | V_DM_DSCR_BASE_RINGSZ(1); + + bus_writeq(base_val, + (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); + bus_writeq(base_val | M_DM_DSCR_BASE_RESET, + (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); + bus_writeq(base_val | M_DM_DSCR_BASE_ENABL, + (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); } void clear_page(void *page) @@ -177,46 +227,61 @@ void clear_page(void *page) int cpu = smp_processor_id(); /* if the page is above Kseg0, use old way */ - if (KSEGX(page) != CAC_BASE) + if ((long)KSEGX(page) != (long)CKSEG0) return clear_page_cpu(page); - page_descr[cpu].dscr_a = PHYSADDR(page) | M_DM_DSCRA_ZERO_MEM | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; + page_descr[cpu].dscr_a = CPHYSADDR(page) | M_DM_DSCRA_ZERO_MEM | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; page_descr[cpu].dscr_b = V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE); - __raw_writeq(1, IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); + bus_writeq(1, (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); /* * Don't really want to do it this way, but there's no * reliable way to delay completion detection. */ - while (!(__raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & M_DM_DSCR_BASE_INTERRUPT))) + while (!(bus_readq((void *)(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & + M_DM_DSCR_BASE_INTERRUPT)))) ; - __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); + bus_readq((void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); } void copy_page(void *to, void *from) { - unsigned long from_phys = PHYSADDR(from); - unsigned long to_phys = PHYSADDR(to); + unsigned long from_phys = CPHYSADDR(from); + unsigned long to_phys = CPHYSADDR(to); int cpu = smp_processor_id(); /* if either page is above Kseg0, use old way */ - if ((KSEGX(to) != CAC_BASE) || (KSEGX(from) != CAC_BASE)) + if ((long)KSEGX(to) != (long)CKSEG0 + || (long)KSEGX(from) != (long)CKSEG0) return copy_page_cpu(to, from); - page_descr[cpu].dscr_a = PHYSADDR(to_phys) | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; - page_descr[cpu].dscr_b = PHYSADDR(from_phys) | V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE); - __raw_writeq(1, IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); + page_descr[cpu].dscr_a = CPHYSADDR(to_phys) | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT; + page_descr[cpu].dscr_b = CPHYSADDR(from_phys) | V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE); + bus_writeq(1, (void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_COUNT))); /* * Don't really want to do it this way, but there's no * reliable way to delay completion detection. */ - while (!(__raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & M_DM_DSCR_BASE_INTERRUPT))) + while (!(bus_readq((void *)(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & + M_DM_DSCR_BASE_INTERRUPT)))) ; - __raw_readq(IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); + bus_readq((void *)IOADDR(A_DM_REGISTER(cpu, R_DM_DSCR_BASE))); } -#endif +#else /* !CONFIG_SIBYTE_DMA_PAGEOPS */ + +void clear_page(void *page) +{ + return clear_page_cpu(page); +} + +void copy_page(void *to, void *from) +{ + return copy_page_cpu(to, from); +} + +#endif /* !CONFIG_SIBYTE_DMA_PAGEOPS */ EXPORT_SYMBOL(clear_page); EXPORT_SYMBOL(copy_page); diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index 029d0687f..4f07f81e8 100644 --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c @@ -71,8 +71,8 @@ void __init pagetable_init(void) /* Initialize the entire pgd. */ pgd_init((unsigned long)swapper_pg_dir); - pgd_init((unsigned long)swapper_pg_dir + - sizeof(pgd_t ) * USER_PTRS_PER_PGD); + pgd_init((unsigned long)swapper_pg_dir + + sizeof(pgd_t) * USER_PTRS_PER_PGD); #ifdef CONFIG_HIGHMEM pgd_base = swapper_pg_dir; diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c index 7eb953305..44b5e97ff 100644 --- a/arch/mips/mm/pgtable-64.c +++ b/arch/mips/mm/pgtable-64.c @@ -52,29 +52,7 @@ void pmd_init(unsigned long addr, unsigned long pagetable) void __init pagetable_init(void) { - pmd_t *pmd; - pte_t *pte; - int i; - /* Initialize the entire pgd. */ pgd_init((unsigned long)swapper_pg_dir); pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); - memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE); - - memset((void *)kptbl, 0, PAGE_SIZE << PGD_ORDER); - memset((void *)kpmdtbl, 0, PAGE_SIZE); - set_pgd(swapper_pg_dir, __pgd((unsigned long)kpmdtbl)); - - /* - * The 64-bit kernel uses a flat pagetable for it's kernel mappings ... - */ - pmd = kpmdtbl; - pte = kptbl; - i = 0; - while (i < (1 << PGD_ORDER)) { - pmd_val(*pmd) = (unsigned long)pte; - pte += PTRS_PER_PTE; - pmd++; - i++; - } } diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c index 8c30f32a6..3b88fdeef 100644 --- a/arch/mips/mm/pgtable.c +++ b/arch/mips/mm/pgtable.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c index 9796a2279..4e92f931a 100644 --- a/arch/mips/mm/sc-rm7k.c +++ b/arch/mips/mm/sc-rm7k.c @@ -96,13 +96,13 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size) } /* - * This function is executed in the uncached segment KSEG1. + * This function is executed in the uncached segment CKSEG1. * It must not touch the stack, because the stack pointer still points - * into KSEG0. + * into CKSEG0. * * Three options: * - Write it in assembly and guarantee that we don't use the stack. - * - Disable caching for KSEG0 before calling it. + * - Disable caching for CKSEG0 before calling it. * - Pray that GCC doesn't randomly start using the stack. * * This being Linux, we obviously take the least sane of those options - diff --git a/arch/mips/mm/tlb-andes.c b/arch/mips/mm/tlb-andes.c index e1090c564..167e08e96 100644 --- a/arch/mips/mm/tlb-andes.c +++ b/arch/mips/mm/tlb-andes.c @@ -7,7 +7,6 @@ * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 2000 Kanoj Sarcar (kanoj@sgi.com) */ -#include #include #include #include @@ -17,10 +16,7 @@ #include #include -extern void except_vec0_generic(void); -extern void except_vec0_r4000(void); -extern void except_vec1_generic(void); -extern void except_vec1_r10k(void); +extern void build_tlb_refill_handler(void); #define NTLB_ENTRIES 64 #define NTLB_ENTRIES_HALF 32 @@ -88,7 +84,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, idx = read_c0_index(); write_c0_entrylo0(0); write_c0_entrylo1(0); - write_c0_entryhi(KSEG0); + write_c0_entryhi(CKSEG0); if(idx < 0) continue; tlb_write_indexed(); @@ -126,7 +122,7 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) idx = read_c0_index(); write_c0_entrylo0(0); write_c0_entrylo1(0); - write_c0_entryhi(KSEG0 + (idx << (PAGE_SHIFT+1))); + write_c0_entryhi(CKSEG0 + (idx << (PAGE_SHIFT+1))); if (idx < 0) continue; tlb_write_indexed(); @@ -154,7 +150,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) idx = read_c0_index(); write_c0_entrylo0(0); write_c0_entrylo1(0); - write_c0_entryhi(KSEG0); + write_c0_entryhi(CKSEG0); if (idx < 0) goto finish; tlb_write_indexed(); @@ -184,7 +180,7 @@ void local_flush_tlb_one(unsigned long page) write_c0_entrylo1(0); if (idx >= 0) { /* Make sure all entries differ. */ - write_c0_entryhi(KSEG0+(idx<<(PAGE_SHIFT+1))); + write_c0_entryhi(CKSEG0+(idx<<(PAGE_SHIFT+1))); tlb_write_indexed(); } write_c0_entryhi(oldpid); @@ -257,14 +253,5 @@ void __init tlb_init(void) /* Did I tell you that ARC SUCKS? */ -#ifdef CONFIG_MIPS32 - memcpy((void *)KSEG0, &except_vec0_r4000, 0x80); - memcpy((void *)(KSEG0 + 0x080), &except_vec1_generic, 0x80); - flush_icache_range(KSEG0, KSEG0 + 0x100); -#endif -#ifdef CONFIG_MIPS64 - memcpy((void *)(CKSEG0 + 0x000), &except_vec0_generic, 0x80); - memcpy((void *)(CKSEG0 + 0x080), except_vec1_r10k, 0x80); - flush_icache_range(CKSEG0 + 0x80, CKSEG0 + 0x100); -#endif + build_tlb_refill_handler(); } diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c index 89a0ee3bd..7948e9a5e 100644 --- a/arch/mips/mm/tlb-r3k.c +++ b/arch/mips/mm/tlb-r3k.c @@ -26,7 +26,7 @@ #undef DEBUG_TLB -extern char except_vec0_r2300; +extern void build_tlb_refill_handler(void); /* CP0 hazard avoidance. */ #define BARRIER \ @@ -284,6 +284,6 @@ void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, void __init tlb_init(void) { local_flush_tlb_all(); - memcpy((void *)KSEG0, &except_vec0_r2300, 0x80); - flush_icache_range(KSEG0, KSEG0 + 0x80); + + build_tlb_refill_handler(); } diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 91fee0688..59d38bc05 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -19,12 +19,7 @@ #include #include -extern void except_vec0_generic(void); -extern void except_vec0_nevada(void); -extern void except_vec0_r4000(void); -extern void except_vec0_r4600(void); -extern void except_vec1_generic(void); -extern void except_vec1_r4k(void); +extern void build_tlb_refill_handler(void); /* CP0 hazard avoidance. */ #define BARRIER __asm__ __volatile__(".set noreorder\n\t" \ @@ -255,8 +250,14 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte) idx = read_c0_index(); ptep = pte_offset_map(pmdp, address); - write_c0_entrylo0(pte_val(*ptep++) >> 6); - write_c0_entrylo1(pte_val(*ptep) >> 6); + #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) + write_c0_entrylo0(ptep->pte_high); + ptep++; + write_c0_entrylo1(ptep->pte_high); +#else + write_c0_entrylo0(pte_val(*ptep++) >> 6); + write_c0_entrylo1(pte_val(*ptep) >> 6); +#endif write_c0_entryhi(address | pid); mtc0_tlbw_hazard(); if (idx < 0) @@ -414,19 +415,5 @@ void __init tlb_init(void) temp_tlb_entry = current_cpu_data.tlbsize - 1; local_flush_tlb_all(); -#ifdef CONFIG_MIPS32 - if (current_cpu_data.cputype == CPU_NEVADA) - memcpy((void *)KSEG0, &except_vec0_nevada, 0x80); - else if (current_cpu_data.cputype == CPU_R4600) - memcpy((void *)KSEG0, &except_vec0_r4600, 0x80); - else - memcpy((void *)KSEG0, &except_vec0_r4000, 0x80); - memcpy((void *)(KSEG0 + 0x080), &except_vec1_generic, 0x80); - flush_icache_range(KSEG0, KSEG0 + 0x100); -#endif -#ifdef CONFIG_MIPS64 - memcpy((void *)(CKSEG0 + 0x00), &except_vec0_generic, 0x80); - memcpy((void *)(CKSEG0 + 0x80), except_vec1_r4k, 0x80); - flush_icache_range(CKSEG0 + 0x80, CKSEG0 + 0x100); -#endif + build_tlb_refill_handler(); } diff --git a/arch/mips/mm/tlb-r8k.c b/arch/mips/mm/tlb-r8k.c index daac80ea3..1bfb09198 100644 --- a/arch/mips/mm/tlb-r8k.c +++ b/arch/mips/mm/tlb-r8k.c @@ -19,8 +19,7 @@ #include #include -extern void except_vec0_generic(void); -extern void except_vec1_r8k(void); +extern void build_tlb_refill_handler(void); #define TFP_TLB_SIZE 384 #define TFP_TLB_SET_SHIFT 7 @@ -247,7 +246,5 @@ void __init tlb_init(void) local_flush_tlb_all(); - memcpy((void *)(CKSEG0 + 0x00), &except_vec0_generic, 0x80); - memcpy((void *)(CKSEG0 + 0x80), except_vec1_r8k, 0x80); - flush_icache_range(CKSEG0 + 0x80, CKSEG0 + 0x100); + build_tlb_refill_handler(); } diff --git a/arch/mips/mm/tlb-sb1.c b/arch/mips/mm/tlb-sb1.c index 33c177e65..6256cafcf 100644 --- a/arch/mips/mm/tlb-sb1.c +++ b/arch/mips/mm/tlb-sb1.c @@ -17,22 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include #include -#ifdef CONFIG_MIPS32 -extern void except_vec0_sb1(void); -extern void except_vec1_generic(void); -#endif -#ifdef CONFIG_MIPS64 -extern void except_vec0_generic(void); -extern void except_vec1_sb1(void); -#endif +extern void build_tlb_refill_handler(void); -#define UNIQUE_ENTRYHI(idx) (KSEG0 + ((idx) << (PAGE_SHIFT + 1))) +#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) /* Dump the current entry* and pagemask registers */ static inline void dump_cur_tlb_regs(void) @@ -286,10 +278,17 @@ void local_flush_tlb_one(unsigned long page) these entries, we just bump the asid. */ void local_flush_tlb_mm(struct mm_struct *mm) { - int cpu = smp_processor_id(); + int cpu; + + preempt_disable(); + + cpu = smp_processor_id(); + if (cpu_context(cpu, mm) != 0) { drop_mmu_context(mm, cpu); } + + preempt_enable(); } /* Stolen from mips32 routines */ @@ -373,14 +372,5 @@ void tlb_init(void) */ sb1_sanitize_tlb(); -#ifdef CONFIG_MIPS32 - memcpy((void *)KSEG0, &except_vec0_sb1, 0x80); - memcpy((void *)(KSEG0 + 0x080), &except_vec1_generic, 0x80); - flush_icache_range(KSEG0, KSEG0 + 0x100); -#endif -#ifdef CONFIG_MIPS64 - memcpy((void *)CKSEG0, &except_vec0_generic, 0x80); - memcpy((void *)(CKSEG0 + 0x80), &except_vec1_sb1, 0x80); - flush_icache_range(CKSEG0, CKSEG0 + 0x100); -#endif + build_tlb_refill_handler(); } diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index fc3f5c575..87e229f4d 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -5,7 +5,7 @@ * * Synthesize TLB refill handlers at runtime. * - * Copyright (C) 2004 by Thiemo Seufer + * Copyright (C) 2004,2005 by Thiemo Seufer */ #include @@ -19,11 +19,11 @@ #include #include -#include #include #include #include #include +#include /* #define DEBUG_TLB */ @@ -44,6 +44,11 @@ static __init int __attribute__((unused)) bcm1250_m3_war(void) return BCM1250_M3_WAR; } +static __init int __attribute__((unused)) r10000_llsc_war(void) +{ + return R10000_LLSC_WAR; +} + /* * A little micro-assembler, intended for TLB refill handler * synthesizing. It is intentionally kept simple, does only support @@ -84,13 +89,14 @@ enum fields enum opcode { insn_invalid, insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, - insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, insn_bne, - insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, + insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, + insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, - insn_lui, insn_lw, insn_mfc0, insn_mtc0, insn_ori, insn_rfe, - insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, - insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori + insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, + insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, + insn_sra, insn_srl, insn_subu, insn_sw, insn_tlbp, insn_tlbwi, + insn_tlbwr, insn_xor, insn_xori }; struct insn { @@ -114,6 +120,7 @@ static __initdata struct insn insn_table[] = { { insn_and, M(spec_op,0,0,0,0,and_op), RS | RT | RD }, { insn_andi, M(andi_op,0,0,0,0,0), RS | RT | UIMM }, { insn_beq, M(beq_op,0,0,0,0,0), RS | RT | BIMM }, + { insn_beql, M(beql_op,0,0,0,0,0), RS | RT | BIMM }, { insn_bgez, M(bcond_op,0,bgez_op,0,0,0), RS | BIMM }, { insn_bgezl, M(bcond_op,0,bgezl_op,0,0,0), RS | BIMM }, { insn_bltz, M(bcond_op,0,bltz_op,0,0,0), RS | BIMM }, @@ -134,12 +141,16 @@ static __initdata struct insn insn_table[] = { { insn_jal, M(jal_op,0,0,0,0,0), JIMM }, { insn_jr, M(spec_op,0,0,0,0,jr_op), RS }, { insn_ld, M(ld_op,0,0,0,0,0), RS | RT | SIMM }, + { insn_ll, M(ll_op,0,0,0,0,0), RS | RT | SIMM }, + { insn_lld, M(lld_op,0,0,0,0,0), RS | RT | SIMM }, { insn_lui, M(lui_op,0,0,0,0,0), RT | SIMM }, { insn_lw, M(lw_op,0,0,0,0,0), RS | RT | SIMM }, { insn_mfc0, M(cop0_op,mfc_op,0,0,0,0), RT | RD }, { insn_mtc0, M(cop0_op,mtc_op,0,0,0,0), RT | RD }, { insn_ori, M(ori_op,0,0,0,0,0), RS | RT | UIMM }, { insn_rfe, M(cop0_op,cop_op,0,0,0,rfe_op), 0 }, + { insn_sc, M(sc_op,0,0,0,0,0), RS | RT | SIMM }, + { insn_scd, M(scd_op,0,0,0,0,0), RS | RT | SIMM }, { insn_sd, M(sd_op,0,0,0,0,0), RS | RT | SIMM }, { insn_sll, M(spec_op,0,0,0,0,sll_op), RT | RD | RE }, { insn_sra, M(spec_op,0,0,0,0,sra_op), RT | RD | RE }, @@ -341,6 +352,7 @@ I_u3u1u2(_addu); I_u2u1u3(_andi); I_u3u1u2(_and); I_u1u2s3(_beq); +I_u1u2s3(_beql); I_u1s2(_bgez); I_u1s2(_bgezl); I_u1s2(_bltz); @@ -361,12 +373,16 @@ I_u1(_j); I_u1(_jal); I_u1(_jr); I_u2s3u1(_ld); +I_u2s3u1(_ll); +I_u2s3u1(_lld); I_u1s2(_lui); I_u2s3u1(_lw); I_u1u2(_mfc0); I_u1u2(_mtc0); I_u2u1u3(_ori); I_0(_rfe); +I_u2s3u1(_sc); +I_u2s3u1(_scd); I_u2s3u1(_sd); I_u2u1u3(_sll); I_u2u1u3(_sra); @@ -389,8 +405,14 @@ enum label_id { label_leave, label_vmalloc, label_vmalloc_done, - label_tlbwr_hazard, - label_split + label_tlbw_hazard, + label_split, + label_nopage_tlbl, + label_nopage_tlbs, + label_nopage_tlbm, + label_smp_pgtable_change, + label_r3000_write_probe_fail, + label_r3000_write_probe_ok }; struct label { @@ -416,8 +438,14 @@ L_LA(_second_part) L_LA(_leave) L_LA(_vmalloc) L_LA(_vmalloc_done) -L_LA(_tlbwr_hazard) +L_LA(_tlbw_hazard) L_LA(_split) +L_LA(_nopage_tlbl) +L_LA(_nopage_tlbs) +L_LA(_nopage_tlbm) +L_LA(_smp_pgtable_change) +L_LA(_r3000_write_probe_fail) +L_LA(_r3000_write_probe_ok) /* convenience macros for instructions */ #ifdef CONFIG_MIPS64 @@ -431,6 +459,8 @@ L_LA(_split) # define i_ADDIU(buf, rs, rt, val) i_daddiu(buf, rs, rt, val) # define i_ADDU(buf, rs, rt, rd) i_daddu(buf, rs, rt, rd) # define i_SUBU(buf, rs, rt, rd) i_dsubu(buf, rs, rt, rd) +# define i_LL(buf, rs, rt, off) i_lld(buf, rs, rt, off) +# define i_SC(buf, rs, rt, off) i_scd(buf, rs, rt, off) #else # define i_LW(buf, rs, rt, off) i_lw(buf, rs, rt, off) # define i_SW(buf, rs, rt, off) i_sw(buf, rs, rt, off) @@ -442,28 +472,33 @@ L_LA(_split) # define i_ADDIU(buf, rs, rt, val) i_addiu(buf, rs, rt, val) # define i_ADDU(buf, rs, rt, rd) i_addu(buf, rs, rt, rd) # define i_SUBU(buf, rs, rt, rd) i_subu(buf, rs, rt, rd) +# define i_LL(buf, rs, rt, off) i_ll(buf, rs, rt, off) +# define i_SC(buf, rs, rt, off) i_sc(buf, rs, rt, off) #endif #define i_b(buf, off) i_beq(buf, 0, 0, off) +#define i_beqz(buf, rs, off) i_beq(buf, rs, 0, off) +#define i_beqzl(buf, rs, off) i_beql(buf, rs, 0, off) #define i_bnez(buf, rs, off) i_bne(buf, rs, 0, off) +#define i_bnezl(buf, rs, off) i_bnel(buf, rs, 0, off) #define i_move(buf, a, b) i_ADDU(buf, a, 0, b) #define i_nop(buf) i_sll(buf, 0, 0, 0) #define i_ssnop(buf) i_sll(buf, 0, 0, 1) #define i_ehb(buf) i_sll(buf, 0, 0, 3) -#if CONFIG_MIPS64 -static __init int in_compat_space_p(long addr) +#ifdef CONFIG_MIPS64 +static __init int __attribute__((unused)) in_compat_space_p(long addr) { /* Is this address in 32bit compat space? */ return (((addr) & 0xffffffff00000000) == 0xffffffff00000000); } -static __init int rel_highest(long val) +static __init int __attribute__((unused)) rel_highest(long val) { return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000; } -static __init int rel_higher(long val) +static __init int __attribute__((unused)) rel_higher(long val) { return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000; } @@ -550,22 +585,33 @@ static __init void resolve_relocs(struct reloc *rel, struct label *lab) __resolve_relocs(rel, l); } -static __init void copy_handler(struct reloc *rel, struct label *lab, - u32 *first, u32 *end, u32* target) +static __init void move_relocs(struct reloc *rel, u32 *first, u32 *end, + long off) { - long off = (long)(target - first); - - memcpy(target, first, (end - first) * sizeof(u32)); - for (; rel->lab != label_invalid; rel++) if (rel->addr >= first && rel->addr < end) rel->addr += off; +} +static __init void move_labels(struct label *lab, u32 *first, u32 *end, + long off) +{ for (; lab->lab != label_invalid; lab++) if (lab->addr >= first && lab->addr < end) lab->addr += off; } +static __init void copy_handler(struct reloc *rel, struct label *lab, + u32 *first, u32 *end, u32 *target) +{ + long off = (long)(target - first); + + memcpy(target, first, (end - first) * sizeof(u32)); + + move_relocs(rel, first, end, off); + move_labels(lab, first, end, off); +} + static __init int __attribute__((unused)) insn_has_bdelay(struct reloc *rel, u32 *addr) { @@ -594,6 +640,20 @@ static void __attribute__((unused)) il_b(u32 **p, struct reloc **r, i_b(p, 0); } +static void il_beqz(u32 **p, struct reloc **r, unsigned int reg, + enum label_id l) +{ + r_mips_pc16(r, *p, l); + i_beqz(p, reg, 0); +} + +static void __attribute__((unused)) +il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) +{ + r_mips_pc16(r, *p, l); + i_beqzl(p, reg, 0); +} + static void il_bnez(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) { @@ -608,7 +668,7 @@ static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg, i_bgezl(p, reg, 0); } -/* The only registers allowed in TLB handlers. */ +/* The only general purpose registers allowed in TLB handlers. */ #define K0 26 #define K1 27 @@ -642,7 +702,6 @@ static __initdata u32 tlb_handler[128]; static __initdata struct label labels[128]; static __initdata struct reloc relocs[128]; -#ifdef CONFIG_MIPS32 /* * The R3000 TLB handler is simple. */ @@ -676,10 +735,11 @@ static void __init build_r3000_tlb_refill_handler(void) panic("TLB refill handler space exceeded"); printk("Synthesized TLB handler (%u instructions).\n", - p - tlb_handler); + (unsigned int)(p - tlb_handler)); #ifdef DEBUG_TLB { int i; + for (i = 0; i < (p - tlb_handler); i++) printk("%08x\n", tlb_handler[i]); } @@ -688,7 +748,6 @@ static void __init build_r3000_tlb_refill_handler(void) memcpy((void *)CAC_BASE, tlb_handler, 0x80); flush_icache_range(CAC_BASE, CAC_BASE + 0x80); } -#endif /* CONFIG_MIPS32 */ /* * The R4000 TLB handler is much more complicated. We have two @@ -738,12 +797,22 @@ static __init void __attribute__((unused)) build_tlb_probe_entry(u32 **p) } /* - * Write random TLB entry, and care about the hazards from the - * preceeding mtc0 and for the following eret. + * Write random or indexed TLB entry, and care about the hazards from + * the preceeding mtc0 and for the following eret. */ -static __init void build_tlb_write_random_entry(u32 **p, struct label **l, - struct reloc **r) +enum tlb_write_entry { tlb_random, tlb_indexed }; + +static __init void build_tlb_write_entry(u32 **p, struct label **l, + struct reloc **r, + enum tlb_write_entry wmode) { + void(*tlbw)(u32 **) = NULL; + + switch (wmode) { + case tlb_random: tlbw = i_tlbwr; break; + case tlb_indexed: tlbw = i_tlbwi; break; + } + switch (current_cpu_data.cputype) { case CPU_R4000PC: case CPU_R4000SC: @@ -753,11 +822,11 @@ static __init void build_tlb_write_random_entry(u32 **p, struct label **l, case CPU_R4400MC: /* * This branch uses up a mtc0 hazard nop slot and saves - * two nops after the tlbwr. + * two nops after the tlbw instruction. */ - il_bgezl(p, r, 0, label_tlbwr_hazard); - i_tlbwr(p); - l_tlbwr_hazard(l, *p); + il_bgezl(p, r, 0, label_tlbw_hazard); + tlbw(p); + l_tlbw_hazard(l, *p); i_nop(p); break; @@ -766,12 +835,13 @@ static __init void build_tlb_write_random_entry(u32 **p, struct label **l, case CPU_R5000: case CPU_R5000A: case CPU_5KC: + case CPU_TX49XX: case CPU_AU1000: case CPU_AU1100: case CPU_AU1500: case CPU_AU1550: i_nop(p); - i_tlbwr(p); + tlbw(p); break; case CPU_R10000: @@ -781,24 +851,32 @@ static __init void build_tlb_write_random_entry(u32 **p, struct label **l, case CPU_4KSC: case CPU_20KC: case CPU_25KF: - i_tlbwr(p); + tlbw(p); break; case CPU_NEVADA: i_nop(p); /* QED specifies 2 nops hazard */ /* * This branch uses up a mtc0 hazard nop slot and saves - * a nop after the tlbwr. + * a nop after the tlbw instruction. */ - il_bgezl(p, r, 0, label_tlbwr_hazard); - i_tlbwr(p); - l_tlbwr_hazard(l, *p); + il_bgezl(p, r, 0, label_tlbw_hazard); + tlbw(p); + l_tlbw_hazard(l, *p); + break; + + case CPU_RM7000: + i_nop(p); + i_nop(p); + i_nop(p); + i_nop(p); + tlbw(p); break; case CPU_4KEC: case CPU_24K: i_ehb(p); - i_tlbwr(p); + tlbw(p); break; case CPU_RM9000: @@ -812,13 +890,32 @@ static __init void build_tlb_write_random_entry(u32 **p, struct label **l, i_ssnop(p); i_ssnop(p); i_ssnop(p); - i_tlbwr(p); + tlbw(p); i_ssnop(p); i_ssnop(p); i_ssnop(p); i_ssnop(p); break; + case CPU_VR4111: + case CPU_VR4121: + case CPU_VR4122: + case CPU_VR4181: + case CPU_VR4181A: + i_nop(p); + i_nop(p); + tlbw(p); + i_nop(p); + i_nop(p); + break; + + case CPU_VR4131: + case CPU_VR4133: + i_nop(p); + i_nop(p); + tlbw(p); + break; + default: panic("No TLB refill handler yet (CPU type: %d)", current_cpu_data.cputype); @@ -826,7 +923,7 @@ static __init void build_tlb_write_random_entry(u32 **p, struct label **l, } } -#if CONFIG_MIPS64 +#ifdef CONFIG_MIPS64 /* * TMP and PTR are scratch. * TMP will be clobbered, PTR will hold the pmd entry. @@ -844,7 +941,7 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r, il_bltz(p, r, tmp, label_vmalloc); /* No i_nop needed here, since the next insn doesn't touch TMP. */ -# ifdef CONFIG_SMP +#ifdef CONFIG_SMP /* * 64 bit SMP has the lower part of &pgd_current[smp_processor_id()] * stored in CONTEXT. @@ -852,7 +949,17 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r, if (in_compat_space_p(pgdc)) { i_dmfc0(p, ptr, C0_CONTEXT); i_dsra(p, ptr, ptr, 23); + i_ld(p, ptr, 0, ptr); } else { +#ifdef CONFIG_BUILD_ELF64 + i_dmfc0(p, ptr, C0_CONTEXT); + i_dsrl(p, ptr, ptr, 23); + i_dsll(p, ptr, ptr, 3); + i_LA_mostly(p, tmp, pgdc); + i_daddu(p, ptr, ptr, tmp); + i_dmfc0(p, tmp, C0_BADVADDR); + i_ld(p, ptr, rel_lo(pgdc), ptr); +#else i_dmfc0(p, ptr, C0_CONTEXT); i_lui(p, tmp, rel_highest(pgdc)); i_dsll(p, ptr, ptr, 9); @@ -860,12 +967,13 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r, i_dsrl32(p, ptr, ptr, 0); i_and(p, ptr, ptr, tmp); i_dmfc0(p, tmp, C0_BADVADDR); + i_ld(p, ptr, 0, ptr); +#endif } - i_ld(p, ptr, 0, ptr); -# else +#else i_LA_mostly(p, ptr, pgdc); i_ld(p, ptr, rel_lo(pgdc), ptr); -# endif +#endif l_vmalloc_done(l, *p); i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); /* get pgd offset in bytes */ @@ -902,13 +1010,14 @@ build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r, } } -#else /* CONFIG_MIPS32 */ +#else /* !CONFIG_MIPS64 */ /* * TMP and PTR are scratch. * TMP will be clobbered, PTR will hold the pgd entry. */ -static __init void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) +static __init void __attribute__((unused)) +build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) { long pgdc = (long)pgd_current; @@ -928,17 +1037,13 @@ static __init void build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) i_sll(p, tmp, tmp, PGD_T_LOG2); i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ } -#endif /* CONFIG_MIPS32 */ + +#endif /* !CONFIG_MIPS64 */ static __init void build_adjust_context(u32 **p, unsigned int ctx) { - unsigned int shift = 0; - unsigned int mask = 0xff0; - -#if !defined(CONFIG_MIPS64) && !defined(CONFIG_64BIT_PHYS_ADDR) - shift++; - mask |= 0x008; -#endif + unsigned int shift = 4 - (PTE_T_LOG2 + 1); + unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); switch (current_cpu_data.cputype) { case CPU_VR41XX: @@ -994,7 +1099,7 @@ static __init void build_update_entries(u32 **p, unsigned int tmp, * Kernel is a special case. Only a few CPUs use it. */ #ifdef CONFIG_64BIT_PHYS_ADDR - if (cpu_has_64bit_gp_regs) { + if (cpu_has_64bits) { i_ld(p, tmp, 0, ptep); /* get even pte */ i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ i_dsrl(p, tmp, tmp, 6); /* convert to entrylo0 */ @@ -1049,20 +1154,20 @@ static void __init build_r4000_tlb_refill_handler(void) i_MFC0(&p, K0, C0_BADVADDR); i_MFC0(&p, K1, C0_ENTRYHI); i_xor(&p, K0, K0, K1); - i_SRL(&p, K0, K0, PAGE_SHIFT+1); + i_SRL(&p, K0, K0, PAGE_SHIFT + 1); il_bnez(&p, &r, K0, label_leave); /* No need for i_nop */ } #ifdef CONFIG_MIPS64 - build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd ptr in K1 */ + build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ #else - build_get_pgde32(&p, K0, K1); /* get pgd ptr in K1 */ + build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ #endif build_get_ptep(&p, K0, K1); build_update_entries(&p, K0, K1); - build_tlb_write_random_entry(&p, &l, &r); + build_tlb_write_entry(&p, &l, &r, tlb_random); l_leave(&l, p); i_eret(&p); /* return from trap */ @@ -1121,6 +1226,7 @@ static void __init build_r4000_tlb_refill_handler(void) i_nop(&f); else { copy_handler(relocs, labels, split, split + 1, f); + move_labels(labels, f, f + 1, -1); f++; split++; } @@ -1132,7 +1238,8 @@ static void __init build_r4000_tlb_refill_handler(void) #endif /* CONFIG_MIPS64 */ resolve_relocs(relocs, labels); - printk("Synthesized TLB handler (%u instructions).\n", final_len); + printk("Synthesized TLB refill handler (%u instructions).\n", + final_len); #ifdef DEBUG_TLB { @@ -1147,10 +1254,530 @@ static void __init build_r4000_tlb_refill_handler(void) flush_icache_range(CAC_BASE, CAC_BASE + 0x100); } +/* + * TLB load/store/modify handlers. + * + * Only the fastpath gets synthesized at runtime, the slowpath for + * do_page_fault remains normal asm. + */ +extern void tlb_do_page_fault_0(void); +extern void tlb_do_page_fault_1(void); + +#define __tlb_handler_align \ + __attribute__((__aligned__(1 << CONFIG_MIPS_L1_CACHE_SHIFT))) + +/* + * 128 instructions for the fastpath handler is generous and should + * never be exceeded. + */ +#define FASTPATH_SIZE 128 + +u32 __tlb_handler_align handle_tlbl[FASTPATH_SIZE]; +u32 __tlb_handler_align handle_tlbs[FASTPATH_SIZE]; +u32 __tlb_handler_align handle_tlbm[FASTPATH_SIZE]; + +static void __init +iPTE_LW(u32 **p, struct label **l, unsigned int pte, int offset, + unsigned int ptr) +{ +#ifdef CONFIG_SMP +# ifdef CONFIG_64BIT_PHYS_ADDR + if (cpu_has_64bits) + i_lld(p, pte, offset, ptr); + else +# endif + i_LL(p, pte, offset, ptr); +#else +# ifdef CONFIG_64BIT_PHYS_ADDR + if (cpu_has_64bits) + i_ld(p, pte, offset, ptr); + else +# endif + i_LW(p, pte, offset, ptr); +#endif +} + +static void __init +iPTE_SW(u32 **p, struct reloc **r, unsigned int pte, int offset, + unsigned int ptr) +{ +#ifdef CONFIG_SMP +# ifdef CONFIG_64BIT_PHYS_ADDR + if (cpu_has_64bits) + i_scd(p, pte, offset, ptr); + else +# endif + i_SC(p, pte, offset, ptr); + + if (r10000_llsc_war()) + il_beqzl(p, r, pte, label_smp_pgtable_change); + else + il_beqz(p, r, pte, label_smp_pgtable_change); + +# ifdef CONFIG_64BIT_PHYS_ADDR + if (!cpu_has_64bits) { + /* no i_nop needed */ + i_ll(p, pte, sizeof(pte_t) / 2, ptr); + i_ori(p, pte, pte, _PAGE_VALID); + i_sc(p, pte, sizeof(pte_t) / 2, ptr); + il_beqz(p, r, pte, label_smp_pgtable_change); + /* no i_nop needed */ + i_lw(p, pte, 0, ptr); + } else + i_nop(p); +# else + i_nop(p); +# endif +#else +# ifdef CONFIG_64BIT_PHYS_ADDR + if (cpu_has_64bits) + i_sd(p, pte, offset, ptr); + else +# endif + i_SW(p, pte, offset, ptr); + +# ifdef CONFIG_64BIT_PHYS_ADDR + if (!cpu_has_64bits) { + i_lw(p, pte, sizeof(pte_t) / 2, ptr); + i_ori(p, pte, pte, _PAGE_VALID); + i_sw(p, pte, sizeof(pte_t) / 2, ptr); + i_lw(p, pte, 0, ptr); + } +# endif +#endif +} + +/* + * Check if PTE is present, if not then jump to LABEL. PTR points to + * the page table where this PTE is located, PTE will be re-loaded + * with it's original value. + */ +static void __init +build_pte_present(u32 **p, struct label **l, struct reloc **r, + unsigned int pte, unsigned int ptr, enum label_id lid) +{ + i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); + i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); + il_bnez(p, r, pte, lid); + iPTE_LW(p, l, pte, 0, ptr); +} + +/* Make PTE valid, store result in PTR. */ +static void __init +build_make_valid(u32 **p, struct reloc **r, unsigned int pte, + unsigned int ptr) +{ + i_ori(p, pte, pte, _PAGE_VALID | _PAGE_ACCESSED); + iPTE_SW(p, r, pte, 0, ptr); +} + +/* + * Check if PTE can be written to, if not branch to LABEL. Regardless + * restore PTE with value from PTR when done. + */ +static void __init +build_pte_writable(u32 **p, struct label **l, struct reloc **r, + unsigned int pte, unsigned int ptr, enum label_id lid) +{ + i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); + i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); + il_bnez(p, r, pte, lid); + iPTE_LW(p, l, pte, 0, ptr); +} + +/* Make PTE writable, update software status bits as well, then store + * at PTR. + */ +static void __init +build_make_write(u32 **p, struct reloc **r, unsigned int pte, + unsigned int ptr) +{ + i_ori(p, pte, pte, + _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); + iPTE_SW(p, r, pte, 0, ptr); +} + +/* + * Check if PTE can be modified, if not branch to LABEL. Regardless + * restore PTE with value from PTR when done. + */ +static void __init +build_pte_modifiable(u32 **p, struct label **l, struct reloc **r, + unsigned int pte, unsigned int ptr, enum label_id lid) +{ + i_andi(p, pte, pte, _PAGE_WRITE); + il_beqz(p, r, pte, lid); + iPTE_LW(p, l, pte, 0, ptr); +} + +/* + * R3000 style TLB load/store/modify handlers. + */ + +/* This places the pte in the page table at PTR into ENTRYLO0. */ +static void __init +build_r3000_pte_reload(u32 **p, unsigned int ptr) +{ + i_lw(p, ptr, 0, ptr); + i_nop(p); /* load delay */ + i_mtc0(p, ptr, C0_ENTRYLO0); + i_nop(p); /* cp0 delay */ +} + +/* + * The index register may have the probe fail bit set, + * because we would trap on access kseg2, i.e. without refill. + */ +static void __init +build_r3000_tlb_write(u32 **p, struct label **l, struct reloc **r, + unsigned int tmp) +{ + i_mfc0(p, tmp, C0_INDEX); + i_nop(p); /* cp0 delay */ + il_bltz(p, r, tmp, label_r3000_write_probe_fail); + i_nop(p); /* branch delay */ + i_tlbwi(p); + il_b(p, r, label_r3000_write_probe_ok); + i_nop(p); /* branch delay */ + l_r3000_write_probe_fail(l, *p); + i_tlbwr(p); + l_r3000_write_probe_ok(l, *p); +} + +static void __init +build_r3000_tlbchange_handler_head(u32 **p, unsigned int pte, + unsigned int ptr) +{ + long pgdc = (long)pgd_current; + + i_mfc0(p, pte, C0_BADVADDR); + i_lui(p, ptr, rel_hi(pgdc)); /* cp0 delay */ + i_lw(p, ptr, rel_lo(pgdc), ptr); + i_srl(p, pte, pte, 22); /* load delay */ + i_sll(p, pte, pte, 2); + i_addu(p, ptr, ptr, pte); + i_mfc0(p, pte, C0_CONTEXT); + i_lw(p, ptr, 0, ptr); /* cp0 delay */ + i_andi(p, pte, pte, 0xffc); /* load delay */ + i_addu(p, ptr, ptr, pte); + i_lw(p, pte, 0, ptr); + i_nop(p); /* load delay */ + i_tlbp(p); +} + +static void __init +build_r3000_tlbchange_handler_tail(u32 **p, unsigned int tmp) +{ + i_mfc0(p, tmp, C0_EPC); + i_nop(p); /* cp0 delay */ + i_jr(p, tmp); + i_rfe(p); /* branch delay */ +} + +static void __init build_r3000_tlb_load_handler(void) +{ + u32 *p = handle_tlbl; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbl, 0, sizeof(handle_tlbl)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + build_r3000_tlbchange_handler_head(&p, K0, K1); + build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); + build_make_valid(&p, &r, K0, K1); + build_r3000_pte_reload(&p, K1); + build_r3000_tlb_write(&p, &l, &r, K0); + build_r3000_tlbchange_handler_tail(&p, K0); + + l_nopage_tlbl(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbl) > FASTPATH_SIZE) + panic("TLB load handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB load handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbl)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbl[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbl, + (unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32)); +} + +static void __init build_r3000_tlb_store_handler(void) +{ + u32 *p = handle_tlbs; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbs, 0, sizeof(handle_tlbs)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + build_r3000_tlbchange_handler_head(&p, K0, K1); + build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); + build_make_write(&p, &r, K0, K1); + build_r3000_pte_reload(&p, K1); + build_r3000_tlb_write(&p, &l, &r, K0); + build_r3000_tlbchange_handler_tail(&p, K0); + + l_nopage_tlbs(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbs) > FASTPATH_SIZE) + panic("TLB store handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB store handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbs)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbs[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbs, + (unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32)); +} + +static void __init build_r3000_tlb_modify_handler(void) +{ + u32 *p = handle_tlbm; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbm, 0, sizeof(handle_tlbm)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + build_r3000_tlbchange_handler_head(&p, K0, K1); + build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); + build_make_write(&p, &r, K0, K1); + build_r3000_pte_reload(&p, K1); + i_tlbwi(&p); + build_r3000_tlbchange_handler_tail(&p, K0); + + l_nopage_tlbm(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbm) > FASTPATH_SIZE) + panic("TLB modify handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB modify handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbm)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbm[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbm, + (unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32)); +} + +/* + * R4000 style TLB load/store/modify handlers. + */ +static void __init +build_r4000_tlbchange_handler_head(u32 **p, struct label **l, + struct reloc **r, unsigned int pte, + unsigned int ptr) +{ +#ifdef CONFIG_MIPS64 + build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */ +#else + build_get_pgde32(p, pte, ptr); /* get pgd in ptr */ +#endif + + i_MFC0(p, pte, C0_BADVADDR); + i_LW(p, ptr, 0, ptr); + i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2); + i_andi(p, pte, pte, (PTRS_PER_PTE - 1) << PTE_T_LOG2); + i_ADDU(p, ptr, ptr, pte); + +#ifdef CONFIG_SMP + l_smp_pgtable_change(l, *p); +# endif + iPTE_LW(p, l, pte, 0, ptr); /* get even pte */ + build_tlb_probe_entry(p); +} + +static void __init +build_r4000_tlbchange_handler_tail(u32 **p, struct label **l, + struct reloc **r, unsigned int tmp, + unsigned int ptr) +{ + i_ori(p, ptr, ptr, sizeof(pte_t)); + i_xori(p, ptr, ptr, sizeof(pte_t)); + build_update_entries(p, tmp, ptr); + build_tlb_write_entry(p, l, r, tlb_indexed); + l_leave(l, *p); + i_eret(p); /* return from trap */ + +#ifdef CONFIG_MIPS64 + build_get_pgd_vmalloc64(p, l, r, tmp, ptr); +#endif +} + +static void __init build_r4000_tlb_load_handler(void) +{ + u32 *p = handle_tlbl; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbl, 0, sizeof(handle_tlbl)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + if (bcm1250_m3_war()) { + i_MFC0(&p, K0, C0_BADVADDR); + i_MFC0(&p, K1, C0_ENTRYHI); + i_xor(&p, K0, K0, K1); + i_SRL(&p, K0, K0, PAGE_SHIFT + 1); + il_bnez(&p, &r, K0, label_leave); + /* No need for i_nop */ + } + + build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); + build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); + build_make_valid(&p, &r, K0, K1); + build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); + + l_nopage_tlbl(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbl) > FASTPATH_SIZE) + panic("TLB load handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB load handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbl)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbl[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbl, + (unsigned long)handle_tlbl + FASTPATH_SIZE * sizeof(u32)); +} + +static void __init build_r4000_tlb_store_handler(void) +{ + u32 *p = handle_tlbs; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbs, 0, sizeof(handle_tlbs)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); + build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); + build_make_write(&p, &r, K0, K1); + build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); + + l_nopage_tlbs(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbs) > FASTPATH_SIZE) + panic("TLB store handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB store handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbs)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbs[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbs, + (unsigned long)handle_tlbs + FASTPATH_SIZE * sizeof(u32)); +} + +static void __init build_r4000_tlb_modify_handler(void) +{ + u32 *p = handle_tlbm; + struct label *l = labels; + struct reloc *r = relocs; + + memset(handle_tlbm, 0, sizeof(handle_tlbm)); + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); + build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); + /* Present and writable bits set, set accessed and dirty bits. */ + build_make_write(&p, &r, K0, K1); + build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); + + l_nopage_tlbm(&l, p); + i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); + i_nop(&p); + + if ((p - handle_tlbm) > FASTPATH_SIZE) + panic("TLB modify handler fastpath space exceeded"); + + resolve_relocs(relocs, labels); + printk("Synthesized TLB modify handler fastpath (%u instructions).\n", + (unsigned int)(p - handle_tlbm)); + +#ifdef DEBUG_TLB + { + int i; + + for (i = 0; i < FASTPATH_SIZE; i++) + printk("%08x\n", handle_tlbm[i]); + } +#endif + + flush_icache_range((unsigned long)handle_tlbm, + (unsigned long)handle_tlbm + FASTPATH_SIZE * sizeof(u32)); +} + void __init build_tlb_refill_handler(void) { + /* + * The refill handler is generated per-CPU, multi-node systems + * may have local storage for it. The other handlers are only + * needed once. + */ + static int run_once = 0; + switch (current_cpu_data.cputype) { -#ifdef CONFIG_MIPS32 case CPU_R2000: case CPU_R3000: case CPU_R3000A: @@ -1159,13 +1786,18 @@ void __init build_tlb_refill_handler(void) case CPU_TX3922: case CPU_TX3927: build_r3000_tlb_refill_handler(); + if (!run_once) { + build_r3000_tlb_load_handler(); + build_r3000_tlb_store_handler(); + build_r3000_tlb_modify_handler(); + run_once++; + } break; case CPU_R6000: case CPU_R6000A: panic("No R6000 TLB refill handler yet"); break; -#endif case CPU_R8000: panic("No R8000 TLB refill handler yet"); @@ -1173,5 +1805,11 @@ void __init build_tlb_refill_handler(void) default: build_r4000_tlb_refill_handler(); + if (!run_once) { + build_r4000_tlb_load_handler(); + build_r4000_tlb_store_handler(); + build_r4000_tlb_modify_handler(); + run_once++; + } } } diff --git a/arch/mips/momentum/jaguar_atx/irq.c b/arch/mips/momentum/jaguar_atx/irq.c index cc25cbcb4..15588f91a 100644 --- a/arch/mips/momentum/jaguar_atx/irq.c +++ b/arch/mips/momentum/jaguar_atx/irq.c @@ -45,7 +45,7 @@ static struct irqaction cascade_mv64340 = { no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL }; -void __init init_IRQ(void) +void __init arch_init_irq(void) { /* * Clear all of the interrupts while we change the able around a bit. @@ -55,7 +55,6 @@ void __init init_IRQ(void) /* Sets the first-level interrupt dispatcher. */ set_except_vector(0, jaguar_handle_int); - init_generic_irq(); mips_cpu_irq_init(0); rm7k_cpu_irq_init(8); diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c index a849215b5..30462e715 100644 --- a/arch/mips/momentum/jaguar_atx/setup.c +++ b/arch/mips/momentum/jaguar_atx/setup.c @@ -2,7 +2,7 @@ * BRIEF MODULE DESCRIPTION * Momentum Computer Jaguar-ATX board dependent boot routines * - * Copyright (C) 1996, 1997, 2001 Ralf Baechle + * Copyright (C) 1996, 1997, 2001, 2004 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2000 RidgeRun, Inc. * Copyright (C) 2001 Red Hat, Inc. * Copyright (C) 2002 Momentum Computer @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_3/reset.c b/arch/mips/momentum/ocelot_3/reset.c index cb7e35630..72b4423c0 100644 --- a/arch/mips/momentum/ocelot_3/reset.c +++ b/arch/mips/momentum/ocelot_3/reset.c @@ -4,7 +4,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * - * Copyright (C) 1997, 2001 Ralf Baechle + * Copyright (C) 1997, 01, 05 Ralf Baechle * Copyright 2001 MontaVista Software Inc. * Author: jsun@mvista.com or jsun@junsun.net * @@ -20,7 +20,6 @@ * Copyright (C) 2004 MontaVista Software Inc. * Author: Manish Lachwani, mlachwani@mvista.com */ -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c index 9c7336384..ce2efcbab 100644 --- a/arch/mips/momentum/ocelot_3/setup.c +++ b/arch/mips/momentum/ocelot_3/setup.c @@ -4,7 +4,7 @@ * BRIEF MODULE DESCRIPTION * Momentum Computer Ocelot-3 board dependent boot routines * - * Copyright (C) 1996, 1997, 2001 Ralf Baechle + * Copyright (C) 1996, 1997, 01, 05 Ralf Baechle * Copyright (C) 2000 RidgeRun, Inc. * Copyright (C) 2001 Red Hat, Inc. * Copyright (C) 2002 Momentum Computer @@ -47,7 +47,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include diff --git a/arch/mips/momentum/ocelot_c/dbg_io.c b/arch/mips/momentum/ocelot_c/dbg_io.c index 3ef3584cf..8720bccfd 100644 --- a/arch/mips/momentum/ocelot_c/dbg_io.c +++ b/arch/mips/momentum/ocelot_c/dbg_io.c @@ -1,6 +1,6 @@ #include -#if defined(CONFIG_KGDB) +#ifdef CONFIG_KGDB #include /* For the serial port location and base baud */ diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c index 13dd8bd74..300fe8e4f 100644 --- a/arch/mips/momentum/ocelot_c/irq.c +++ b/arch/mips/momentum/ocelot_c/irq.c @@ -5,7 +5,7 @@ * * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net - * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org) + * Copyright (C) 2000, 01, 05 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -28,7 +28,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ -#include #include #include #include @@ -41,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,7 +60,7 @@ static struct irqaction cascade_mv64340 = { no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL }; -void __init init_IRQ(void) +void __init arch_init_irq(void) { /* * Clear all of the interrupts while we change the able around a bit. @@ -71,7 +70,6 @@ void __init init_IRQ(void) /* Sets the first-level interrupt dispatcher. */ set_except_vector(0, ocelot_handle_int); - init_generic_irq(); mips_cpu_irq_init(0); /* set up the cascading interrupts */ @@ -82,10 +80,4 @@ void __init init_IRQ(void) mv64340_irq_init(16); uart_irq_init(); cpci_irq_init(); - -#ifdef CONFIG_KGDB - printk("start kgdb ...\n"); - set_debug_traps(); - breakpoint(); /* you may move this line to whereever you want :-) */ -#endif } diff --git a/arch/mips/momentum/ocelot_g/dbg_io.c b/arch/mips/momentum/ocelot_g/dbg_io.c index 3ef3584cf..8720bccfd 100644 --- a/arch/mips/momentum/ocelot_g/dbg_io.c +++ b/arch/mips/momentum/ocelot_g/dbg_io.c @@ -1,6 +1,6 @@ #include -#if defined(CONFIG_KGDB) +#ifdef CONFIG_KGDB #include /* For the serial port location and base baud */ diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c index 93708965b..d0b5c9dd0 100644 --- a/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/arch/mips/momentum/ocelot_g/gt-irq.c @@ -11,6 +11,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include @@ -134,6 +135,9 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) /* handle the timer call */ do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } if (irq_src) { @@ -156,7 +160,6 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) */ void gt64240_time_init(void) { - extern irq_desc_t irq_desc[NR_IRQS]; static struct irqaction timer; /* Stop the timer -- we'll use timer #0 */ diff --git a/arch/mips/momentum/ocelot_g/irq.c b/arch/mips/momentum/ocelot_g/irq.c index 7d838c132..5eb85b164 100644 --- a/arch/mips/momentum/ocelot_g/irq.c +++ b/arch/mips/momentum/ocelot_g/irq.c @@ -5,7 +5,7 @@ * * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net - * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org) + * Copyright (C) 2000, 01, 05 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -28,7 +28,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. * */ -#include #include #include #include @@ -41,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,7 +51,7 @@ extern asmlinkage void ocelot_handle_int(void); extern void gt64240_irq_init(void); -void __init init_IRQ(void) +void __init arch_init_irq(void) { /* * Clear all of the interrupts while we change the able around a bit. @@ -63,15 +62,8 @@ void __init init_IRQ(void) /* Sets the first-level interrupt dispatcher. */ set_except_vector(0, ocelot_handle_int); - init_generic_irq(); mips_cpu_irq_init(0); rm7k_cpu_irq_init(8); gt64240_irq_init(); - -#ifdef CONFIG_KGDB - printk("start kgdb ...\n"); - set_debug_traps(); - breakpoint(); /* you may move this line to whereever you want :-) */ -#endif } diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile index 5ed03fa90..c53e4cb35 100644 --- a/arch/mips/pci/Makefile +++ b/arch/mips/pci/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_MIPS_MSC) += ops-msc.o obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o obj-$(CONFIG_MIPS_TX3927) += ops-jmr3927.o obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o +obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o # # These are still pretty much in the old state, watch, go blind. @@ -24,8 +25,7 @@ obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o obj-$(CONFIG_DDB5074) += fixup-ddb5074.o pci-ddb5074.o ops-ddb5074.o obj-$(CONFIG_DDB5476) += ops-ddb5476.o pci-ddb5476.o obj-$(CONFIG_DDB5477) += fixup-ddb5477.o pci-ddb5477.o ops-ddb5477.o -obj-$(CONFIG_HP_LASERJET) += pci-hplj.o -obj-$(CONFIG_LASAT) += pci-lasat.o fixup-lasat.o +obj-$(CONFIG_LASAT) += pci-lasat.o obj-$(CONFIG_MIPS_ATLAS) += fixup-atlas.o obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o obj-$(CONFIG_MIPS_EV96100) += fixup-ev64120.o @@ -37,13 +37,14 @@ obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o obj-$(CONFIG_MOMENCO_JAGUAR_ATX)+= fixup-jaguar.o obj-$(CONFIG_MOMENCO_OCELOT) += fixup-ocelot.o pci-ocelot.o +obj-$(CONFIG_MOMENCO_OCELOT_3) += fixup-ocelot3.o obj-$(CONFIG_MOMENCO_OCELOT_C) += fixup-ocelot-c.o pci-ocelot-c.o obj-$(CONFIG_MOMENCO_OCELOT_G) += fixup-ocelot-g.o pci-ocelot-g.o obj-$(CONFIG_PMC_YOSEMITE) += fixup-yosemite.o ops-titan.o ops-titan-ht.o \ pci-yosemite.o obj-$(CONFIG_SGI_IP27) += pci-ip27.o obj-$(CONFIG_SGI_IP32) += fixup-ip32.o ops-mace.o pci-ip32.o -obj-$(CONFIG_SIBYTE_SB1250) += pci-sb1250.o +obj-$(CONFIG_SIBYTE_SB1250) += fixup-sb1250.o pci-sb1250.o obj-$(CONFIG_SNI_RM200_PCI) += fixup-sni.o ops-sni.o obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o diff --git a/arch/mips/pci/fixup-atlas.c b/arch/mips/pci/fixup-atlas.c index ae1930e67..240683583 100644 --- a/arch/mips/pci/fixup-atlas.c +++ b/arch/mips/pci/fixup-atlas.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -40,11 +41,13 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab[slot][pin]; } -void __init pcibios_fixup_irqs(void) +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) { + return 0; } -#if CONFIG_KGDB +#ifdef CONFIG_KGDB /* * The PCI scan may have moved the saa9730 I/O address, so reread * the address here. @@ -61,6 +64,6 @@ static void atlas_saa9730_base_fixup (struct pci_dev *pdev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9730, - atlas_saa9730_base_fixup); + atlas_saa9730_base_fixup); #endif diff --git a/arch/mips/pci/fixup-au1000.c b/arch/mips/pci/fixup-au1000.c index 2d42f9aa9..39fe2b16f 100644 --- a/arch/mips/pci/fixup-au1000.c +++ b/arch/mips/pci/fixup-au1000.c @@ -98,7 +98,26 @@ static char irq_tab_alchemy[][5] __initdata = { }; #endif +#ifdef CONFIG_MIPS_MTX1 +static char irq_tab_alchemy[][5] __initdata = { + [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */ + [1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */ + [2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */ + [3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */ + [4] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 04 - AdapterC-Slot0 (top) */ + [5] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 05 - AdapterC-Slot1 (bottom) */ + [6] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 06 - AdapterD-Slot0 (top) */ + [7] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 07 - AdapterD-Slot1 (bottom) */ +}; +#endif + int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { -return irq_tab_alchemy[slot][pin]; + return irq_tab_alchemy[slot][pin]; +} + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; } diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c index 458270a02..f2fc82c1c 100644 --- a/arch/mips/pci/fixup-capcella.c +++ b/arch/mips/pci/fixup-capcella.c @@ -42,3 +42,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { return irq_tab_capcella[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c index 84c7e98de..57e1ca211 100644 --- a/arch/mips/pci/fixup-cobalt.c +++ b/arch/mips/pci/fixup-cobalt.c @@ -77,7 +77,7 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_GALILEO, PCI_ANY_ID, - qube_raq_galileo_fixup); + qube_raq_galileo_fixup); static char irq_tab_cobalt[] __initdata = { [COBALT_PCICONF_CPU] = 0, @@ -104,3 +104,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab_cobalt[slot]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ddb5074.c b/arch/mips/pci/fixup-ddb5074.c index 785bc03f8..b345e528a 100644 --- a/arch/mips/pci/fixup-ddb5074.c +++ b/arch/mips/pci/fixup-ddb5074.c @@ -18,4 +18,4 @@ static void ddb5074_fixup(struct pci_dev *dev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, - ddb5074_fixup); + ddb5074_fixup); diff --git a/arch/mips/pci/fixup-ddb5477.c b/arch/mips/pci/fixup-ddb5477.c index 25bf49307..6abdc88ba 100644 --- a/arch/mips/pci/fixup-ddb5477.c +++ b/arch/mips/pci/fixup-ddb5477.c @@ -75,4 +75,4 @@ static void ddb5477_amd_lance_fixup(struct pci_dev *dev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, - ddb5477_amd_lance_fixup); + ddb5477_amd_lance_fixup); diff --git a/arch/mips/pci/fixup-ev96100.c b/arch/mips/pci/fixup-ev96100.c index 413bb5b56..e2bc977b6 100644 --- a/arch/mips/pci/fixup-ev96100.c +++ b/arch/mips/pci/fixup-ev96100.c @@ -40,3 +40,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { return irq_tab_ev96100[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ip32.c b/arch/mips/pci/fixup-ip32.c index f64529b7b..3e66b0aa6 100644 --- a/arch/mips/pci/fixup-ip32.c +++ b/arch/mips/pci/fixup-ip32.c @@ -1,7 +1,6 @@ #include #include #include -#include #include /* * O2 has up to 5 PCI devices connected into the MACE bridge. The device @@ -44,3 +43,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { return irq_tab_mace[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ite8172g.c b/arch/mips/pci/fixup-ite8172g.c index 7b032efba..2290ea422 100644 --- a/arch/mips/pci/fixup-ite8172g.c +++ b/arch/mips/pci/fixup-ite8172g.c @@ -72,3 +72,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab_ite8172g[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ivr.c b/arch/mips/pci/fixup-ivr.c index a796ef14f..0c7c16464 100644 --- a/arch/mips/pci/fixup-ivr.c +++ b/arch/mips/pci/fixup-ivr.c @@ -67,3 +67,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab_ivr[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-jaguar.c b/arch/mips/pci/fixup-jaguar.c index 29b6a4615..6c5e1d471 100644 --- a/arch/mips/pci/fixup-jaguar.c +++ b/arch/mips/pci/fixup-jaguar.c @@ -8,14 +8,13 @@ * Marvell wants an NDA for their docs so this was written without * documentation. You've been warned. * - * Copyright (C) 2004 Ralf Baechle + * Copyright (C) 2004 Ralf Baechle (ralf@linux-mips.org) */ #include #include #include #include -#include /* * WARNING: Example of how _NOT_ to do it. @@ -36,3 +35,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return 0; panic("Whooops in pcibios_map_irq"); } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-jmr3927.c b/arch/mips/pci/fixup-jmr3927.c index 682edfaf0..f8696081c 100644 --- a/arch/mips/pci/fixup-jmr3927.c +++ b/arch/mips/pci/fixup-jmr3927.c @@ -88,6 +88,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { /* SMSC SLC90E66 IDE uses irq 14, 15 (default) */ diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c index bcde09eea..b9296d994 100644 --- a/arch/mips/pci/fixup-malta.c +++ b/arch/mips/pci/fixup-malta.c @@ -43,11 +43,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return pci_irq[virq]; } -void __init pcibios_fixup_irqs(void) +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) { + return 0; } - static void __init malta_piix_func0_fixup(struct pci_dev *pdev) { unsigned char reg_val; @@ -99,4 +100,4 @@ static void __init malta_piix_func1_fixup(struct pci_dev *pdev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB, - malta_piix_func1_fixup); + malta_piix_func1_fixup); diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c index 8e5db12a4..09d6b3647 100644 --- a/arch/mips/pci/fixup-mpc30x.c +++ b/arch/mips/pci/fixup-mpc30x.c @@ -42,3 +42,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab_mpc30x[slot]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ocelot-c.c b/arch/mips/pci/fixup-ocelot-c.c index 9edc05950..d45494807 100644 --- a/arch/mips/pci/fixup-ocelot-c.c +++ b/arch/mips/pci/fixup-ocelot-c.c @@ -33,3 +33,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return 0; panic("Whooops in pcibios_map_irq"); } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-ocelot-g.c b/arch/mips/pci/fixup-ocelot-g.c index a79fc4a08..d7a652e32 100644 --- a/arch/mips/pci/fixup-ocelot-g.c +++ b/arch/mips/pci/fixup-ocelot-g.c @@ -29,3 +29,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return -1; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-rbtx4927.c b/arch/mips/pci/fixup-rbtx4927.c index 2182719c0..de4e443da 100644 --- a/arch/mips/pci/fixup-rbtx4927.c +++ b/arch/mips/pci/fixup-rbtx4927.c @@ -9,6 +9,9 @@ * * Copyright (C) 2000-2001 Toshiba Corporation * + * Copyright (C) 2004 MontaVista Software Inc. + * Author: Manish Lachwani (mlachwani@mvista.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 @@ -116,108 +119,22 @@ int pci_get_irq(struct pci_dev *dev, int pin) return irq; } - -#ifdef TX4927_SUPPORT_PCI_66 -extern int tx4927_pci66; -extern void tx4927_pci66_setup(void); -#endif -extern void tx4927_pci_setup(void); - -#ifdef TX4927_SUPPORT_PCI_66 -int tx4927_pci66_check(void) +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { - struct pci_dev *dev; - unsigned short stat; - int cap66 = 1; - - if (tx4927_pci66 < 0) - return 0; - - /* check 66MHz capability */ - pci_for_each_dev(dev) { - if (cap66) { - pci_read_config_word(dev, PCI_STATUS, &stat); - if (!(stat & PCI_STATUS_66MHZ)) { - printk(KERN_INFO - "PCI: %02x:%02x not 66MHz capable.\n", - dev->bus->number, dev->devfn); - cap66 = 0; - } - } - } - return cap66; -} -#endif - -void __init pcibios_fixup_irqs(void) -{ - unsigned char pin; unsigned char irq; - struct pci_dev *dev; - unsigned int id; - -#ifdef TX4927_SUPPORT_PCI_66 - if (tx4927_pci66_check()) { - tx4927_pci66_setup(); - tx4927_pci_setup(); /* Reinitialize PCIC */ - } -#endif - pci_for_each_dev(dev) { - DBG("FIXUP:\n"); - DBG(" devfn=0x%02x (0x%02x:0x%02x)\n", - dev->devfn, PCI_SLOT(dev->devfn), - PCI_FUNC(dev->devfn)); + printk("PCI Setup for pin %d \n", pin); - pci_read_config_dword(dev, PCI_VENDOR_ID, &id); - DBG(" id=0x%08x\n", id); + if (dev->device == 0x9130) /* IDE */ + irq = 14; + else + irq = pci_get_irq(dev, pin); - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); - DBG(" line=0x%02x/%d\n", irq, irq); - - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); - DBG(" pin=%d\n", pin); - -#ifdef DEBUG - { - unsigned int tmp; - pci_read_config_dword(dev, 0x10, &tmp); - DBG(" bar0:0x10=0x%08x\n", tmp); - pci_read_config_dword(dev, 0x14, &tmp); - DBG(" bar1:0x14=0x%08x\n", tmp); - pci_read_config_dword(dev, 0x1c, &tmp); - DBG(" bar2:0x1c=0x%08x\n", tmp); - pci_read_config_dword(dev, 0x20, &tmp); - DBG(" bar3:0x20=0x%08x\n", tmp); - pci_read_config_dword(dev, 0x24, &tmp); - DBG(" bar4:0x24=0x%08x\n", tmp); - } -#endif - - irq = 0; - - if (id == 0x91301055) { /* ide */ - irq = 14; - } - - if (pin == 0) { - DBG(" auto irq (now=%d) -- skipping pin=0\n", irq); - } else if (irq) { - DBG(" auto irq (now=%d) -- skipping hardcoded irq\n", irq); - } else { - DBG(" auto irq (was=%d)\n", irq); - irq = pci_get_irq(dev, pin); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, - irq); - dev->irq = irq; - DBG(" auto irq (now=%d)\n", irq); - } - - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); - printk(KERN_INFO - "PCI: 0x%02x:0x%02x(0x%02x,0x%02x) IRQ=%d\n", - dev->bus->number, dev->devfn, PCI_SLOT(dev->devfn), - PCI_FUNC(dev->devfn), irq); + return irq; +} - } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; } diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c index 563fb2c89..c8ef01a01 100644 --- a/arch/mips/pci/fixup-sni.c +++ b/arch/mips/pci/fixup-sni.c @@ -5,14 +5,13 @@ * * SNI specific PCI support for RM200/RM300. * - * Copyright (C) 1997 - 2000, 2003 Ralf Baechle + * Copyright (C) 1997 - 2000, 2003, 04 Ralf Baechle (ralf@linux-mips.org) */ #include #include #include #include -#include #include /* @@ -82,3 +81,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_tab_rm200[slot][pin]; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c index 4d62bce5b..850a900f0 100644 --- a/arch/mips/pci/fixup-tb0219.c +++ b/arch/mips/pci/fixup-tb0219.c @@ -58,3 +58,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c index 6643462f7..61513d5d9 100644 --- a/arch/mips/pci/fixup-tb0226.c +++ b/arch/mips/pci/fixup-tb0226.c @@ -77,3 +77,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/fixup-yosemite.c b/arch/mips/pci/fixup-yosemite.c index e39ba2c54..81d77a587 100644 --- a/arch/mips/pci/fixup-yosemite.c +++ b/arch/mips/pci/fixup-yosemite.c @@ -33,3 +33,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return 3; /* Everything goes to one irq bit */ } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c index b921cc6b3..c1c91ca0f 100644 --- a/arch/mips/pci/ops-au1000.c +++ b/arch/mips/pci/ops-au1000.c @@ -288,10 +288,18 @@ static int config_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val) { switch (size) { - case 1: - return read_config_byte(bus, devfn, where, (u8 *) val); - case 2: - return read_config_word(bus, devfn, where, (u16 *) val); + case 1: { + u8 _val; + int rc = read_config_byte(bus, devfn, where, &_val); + *val = _val; + return rc; + } + case 2: { + u16 _val; + int rc = read_config_word(bus, devfn, where, &_val); + *val = _val; + return rc; + } default: return read_config_dword(bus, devfn, where, val); } diff --git a/arch/mips/pci/ops-it8172.c b/arch/mips/pci/ops-it8172.c index 2f40a8c18..b7a8b9a6f 100644 --- a/arch/mips/pci/ops-it8172.c +++ b/arch/mips/pci/ops-it8172.c @@ -7,6 +7,8 @@ * Author: MontaVista Software, Inc. * ppopov@mvista.com or source@mvista.com * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -32,7 +34,6 @@ #include #include -#include #include #include diff --git a/arch/mips/pci/ops-msc.c b/arch/mips/pci/ops-msc.c index 11184fa64..7bc099643 100644 --- a/arch/mips/pci/ops-msc.c +++ b/arch/mips/pci/ops-msc.c @@ -1,6 +1,9 @@ /* - * Carsten Langgaard, carstenl@mips.com - * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. + * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc. + * All rights reserved. + * Authors: Carsten Langgaard + * Maciej W. Rozycki + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * 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 @@ -18,6 +21,7 @@ * MIPS boards specific PCI support. * */ +#include #include #include #include diff --git a/arch/mips/pci/ops-sni.c b/arch/mips/pci/ops-sni.c index 88bfbc425..62bdd19c7 100644 --- a/arch/mips/pci/ops-sni.c +++ b/arch/mips/pci/ops-sni.c @@ -21,9 +21,9 @@ * * ASIC PCI only supports type 1 config cycles. */ -static int set_config_address(unsigned char busno, unsigned int devfn, int reg) +static int set_config_address(unsigned int busno, unsigned int devfn, int reg) { - if ((busno > 255) || (devfn > 255) || (reg > 255)) + if ((devfn > 255) || (reg > 255)) return PCIBIOS_BAD_REGISTER_NUMBER; if (busno == 0 && devfn >= PCI_DEVFN(8, 0)) diff --git a/arch/mips/pci/ops-titan.c b/arch/mips/pci/ops-titan.c index 1ac7880dd..233ec6f20 100644 --- a/arch/mips/pci/ops-titan.c +++ b/arch/mips/pci/ops-titan.c @@ -22,91 +22,69 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include -#include -#include -#include -#include #include -/* - * Titan PCI Config Read Byte - */ static int titan_read_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 * val) { + uint32_t address, tmp; int dev, busno, func; - uint32_t address_reg, data_reg; - uint32_t address; busno = bus->number; dev = PCI_SLOT(devfn); func = PCI_FUNC(devfn); - address_reg = TITAN_PCI_0_CONFIG_ADDRESS; - data_reg = TITAN_PCI_0_CONFIG_DATA; - address = (busno << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 0x80000000; + /* start the configuration cycle */ - TITAN_WRITE(address_reg, address); + TITAN_WRITE(TITAN_PCI_0_CONFIG_ADDRESS, address); + tmp = TITAN_READ(TITAN_PCI_0_CONFIG_DATA) >> ((reg & 3) << 3); switch (size) { case 1: - TITAN_READ_8(data_reg + (reg & 0x3), val); - break; - + tmp &= 0xff; case 2: - TITAN_READ_16(data_reg + (reg & 0x2), val); - break; - - case 4: - TITAN_READ(data_reg, val); - break; + tmp &= 0xffff; } + *val = tmp; return PCIBIOS_SUCCESSFUL; } -/* - * Titan PCI Config Byte Write - */ static int titan_write_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 val) { - uint32_t address_reg, data_reg, address; + uint32_t address; int dev, busno, func; busno = bus->number; dev = PCI_SLOT(devfn); func = PCI_FUNC(devfn); - address_reg = TITAN_PCI_0_CONFIG_ADDRESS; - data_reg = TITAN_PCI_0_CONFIG_DATA; - address = (busno << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 0x80000000; /* start the configuration cycle */ - TITAN_WRITE(address_reg, address); + TITAN_WRITE(TITAN_PCI_0_CONFIG_ADDRESS, address); /* write the data */ switch (size) { case 1: - TITAN_WRITE_8(data_reg + (reg & 0x3), val); + TITAN_WRITE_8(TITAN_PCI_0_CONFIG_DATA + (~reg & 0x3), val); break; case 2: - TITAN_WRITE_16(data_reg + (reg & 0x2), val); + TITAN_WRITE_16(TITAN_PCI_0_CONFIG_DATA + (~reg & 0x2), val); break; case 4: - TITAN_WRITE(data_reg, val); + TITAN_WRITE(TITAN_PCI_0_CONFIG_DATA, val); break; } @@ -120,16 +98,3 @@ struct pci_ops titan_pci_ops = { titan_read_config, titan_write_config, }; - -void __init pcibios_init(void) -{ - /* - * XXX These values below need to change - */ - ioport_resource.start = 0xe0000000; - ioport_resource.end = 0xe0000000 + 0x20000000 - 1; - iomem_resource.start = 0xc0000000; - iomem_resource.end = 0xc0000000 + 0x20000000 - 1; - - pci_scan_bus(0, &titan_pci_ops, NULL); -} diff --git a/arch/mips/pci/ops-tx3927.c b/arch/mips/pci/ops-tx3927.c index 136c449f8..0e0daadc3 100644 --- a/arch/mips/pci/ops-tx3927.c +++ b/arch/mips/pci/ops-tx3927.c @@ -4,6 +4,7 @@ * ahennessy@mvista.com * * Copyright (C) 2000-2001 Toshiba Corporation + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * Based on arch/mips/ddb5xxx/ddb5477/pci_ops.c * @@ -38,7 +39,6 @@ #include #include -#include #include #include diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c index 9044ff976..2a9d7227f 100644 --- a/arch/mips/pci/ops-tx4927.c +++ b/arch/mips/pci/ops-tx4927.c @@ -4,6 +4,7 @@ * ahennessy@mvista.com * * Copyright (C) 2000-2001 Toshiba Corporation + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * Based on arch/mips/ddb5xxx/ddb5477/pci_ops.c * @@ -12,6 +13,9 @@ * Much of the code is derived from the original DDB5074 port by * Geert Uytterhoeven * + * Copyright 2004 MontaVista Software Inc. + * Author: Manish Lachwani (mlachwani@mvista.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 @@ -38,39 +42,26 @@ #include #include -#include +#include #include -#include /* initialize in setup */ struct resource pci_io_resource = { - "pci IO space", - (PCIBIOS_MIN_IO), - ((PCIBIOS_MIN_IO) + (TX4927_PCIIO_SIZE)) - 1, - IORESOURCE_IO + .name = "TX4927 PCI IO SPACE", + .start = 0x1000, + .end = (0x1000 + (TX4927_PCIIO_SIZE)) - 1, + .flags = IORESOURCE_IO }; /* initialize in setup */ struct resource pci_mem_resource = { - "pci memory space", - TX4927_PCIMEM, - TX4927_PCIMEM + TX4927_PCIMEM_SIZE - 1, - IORESOURCE_MEM -}; - -extern struct pci_ops tx4927_pci_ops; - -/* - * h/w only supports devices 0x00 to 0x14 - */ -struct pci_controller tx4927_controller = { - .pci_ops = &tx4927_pci_ops, - .io_resource = &pci_io_resource, - .mem_resource = &pci_mem_resource, + .name = "TX4927 PCI MEM SPACE", + .start = TX4927_PCIMEM, + .end = TX4927_PCIMEM + TX4927_PCIMEM_SIZE - 1, + .flags = IORESOURCE_MEM }; -static int mkaddr(unsigned char bus, unsigned char dev_fn, - unsigned char where, int *flagsp) +static int mkaddr(int bus, int dev_fn, int where, int *flagsp) { if (bus > 0) { /* Type 1 configuration */ @@ -107,107 +98,49 @@ static int check_abort(int flags) return code; } -/* - * We can't address 8 and 16 bit words directly. Instead we have to - * read/write a 32bit word and mask/modify the data we actually want. - */ -static int tx4927_pcibios_read_config_byte(struct pci_dev *dev, - int where, unsigned char *val) +static int tx4927_pcibios_read_config(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 * val) { - int flags, retval; - unsigned char bus, func_num; + int flags, retval, dev, busno, func; - db_assert((where & 3) == 0); - db_assert(where < (1 << 8)); + busno = bus->number; + dev = PCI_SLOT(devfn); + func = PCI_FUNC(devfn); /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); + if (bus->parent != NULL) { + busno = bus->number; } else { - bus = 0; + busno = 0; } - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) + if (mkaddr(busno, devfn, where, &flags)) return -1; -#ifdef __BIG_ENDIAN - *val = - *(volatile u8 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | ((where & 3) ^ 3)); + + switch (size) { + case 1: + *val = *(volatile u8 *) ((ulong) & tx4927_pcicptr-> + g2pcfgdata | +#ifdef __LITTLE_ENDIAN + (where & 3)); #else - *val = - *(volatile u8 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | (where & 3)); + ((where & 0x3) ^ 0x3)); #endif - retval = check_abort(flags); - if (retval == PCIBIOS_DEVICE_NOT_FOUND) - *val = 0xff; - return retval; -} - -static int tx4927_pcibios_read_config_word(struct pci_dev *dev, - int where, unsigned short *val) -{ - int flags, retval; - unsigned char bus, func_num; - - if (where & 1) - return PCIBIOS_BAD_REGISTER_NUMBER; - - db_assert((where & 3) == 0); - db_assert(where < (1 << 8)); - - /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); - } else { - bus = 0; - } - - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) - return -1; -#ifdef __BIG_ENDIAN - *val = - *(volatile u16 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | ((where & 3) ^ 2)); + break; + case 2: + *val = *(volatile u16 *) ((ulong) & tx4927_pcicptr-> + g2pcfgdata | +#ifdef __LITTLE_ENDIAN + (where & 3)); #else - *val = - *(volatile u16 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | (where & 3)); + ((where & 0x3) ^ 0x2)); #endif - retval = check_abort(flags); - if (retval == PCIBIOS_DEVICE_NOT_FOUND) - *val = 0xffff; - return retval; -} - -static int tx4927_pcibios_read_config_dword(struct pci_dev *dev, - int where, unsigned int *val) -{ - int flags, retval; - unsigned char bus, func_num; - - if (where & 3) - return PCIBIOS_BAD_REGISTER_NUMBER; - - db_assert((where & 3) == 0); - db_assert(where < (1 << 8)); - - /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); - } else { - bus = 0; + break; + case 4: + *val = tx4927_pcicptr->g2pcfgdata; + break; } - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) - return -1; - *val = tx4927_pcicptr->g2pcfgdata; retval = check_abort(flags); if (retval == PCIBIOS_DEVICE_NOT_FOUND) *val = 0xffffffff; @@ -215,92 +148,62 @@ static int tx4927_pcibios_read_config_dword(struct pci_dev *dev, return retval; } -static int tx4927_pcibios_write_config_byte(struct pci_dev *dev, - int where, unsigned char val) +static int tx4927_pcibios_write_config(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 val) { - int flags; - unsigned char bus, func_num; + int flags, dev, busno, func; + busno = bus->number; + dev = PCI_SLOT(devfn); + func = PCI_FUNC(devfn); /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); + if (bus->parent != NULL) { + busno = bus->number; } else { - bus = 0; + busno = 0; } - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) + if (mkaddr(busno, devfn, where, &flags)) return -1; -#ifdef __BIG_ENDIAN - *(volatile u8 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | ((where & 3) ^ 3)) = val; + + switch (size) { + case 1: + *(volatile u8 *) ((ulong) & tx4927_pcicptr-> + g2pcfgdata | +#ifdef __LITTLE_ENDIAN + (where & 3)) = val; #else - *(volatile u8 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | (where & 3)) = val; + ((where & 0x3) ^ 0x3)) = val; #endif - return check_abort(flags); -} + break; -static int tx4927_pcibios_write_config_word(struct pci_dev *dev, - int where, unsigned short val) -{ - int flags; - unsigned char bus, func_num; - - if (where & 1) - return PCIBIOS_BAD_REGISTER_NUMBER; - - /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); - } else { - bus = 0; - } - - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) - return -1; -#ifdef __BIG_ENDIAN - *(volatile u16 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | ((where & 3) ^ 2)) = val; + case 2: + *(volatile u16 *) ((ulong) & tx4927_pcicptr-> + g2pcfgdata | +#ifdef __LITTLE_ENDIAN + (where & 3)) = val; #else - *(volatile u16 *) ((ulong) & tx4927_pcicptr-> - g2pcfgdata | (where & 3)) = val; + ((where & 0x3) ^ 0x2)) = val; #endif - return check_abort(flags); -} - -static int tx4927_pcibios_write_config_dword(struct pci_dev *dev, - int where, unsigned int val) -{ - int flags; - unsigned char bus, func_num; - - if (where & 3) - return PCIBIOS_BAD_REGISTER_NUMBER; - - /* check if the bus is top-level */ - if (dev->bus->parent != NULL) { - bus = dev->bus->number; - db_assert(bus != 0); - } else { - bus = 0; + break; + case 4: + tx4927_pcicptr->g2pcfgdata = val; + break; } - func_num = PCI_FUNC(dev->devfn); - if (mkaddr(bus, dev->devfn, where, &flags)) - return -1; - tx4927_pcicptr->g2pcfgdata = val; return check_abort(flags); } struct pci_ops tx4927_pci_ops = { - tx4927_pcibios_read_config_byte, - tx4927_pcibios_read_config_word, - tx4927_pcibios_read_config_dword, - tx4927_pcibios_write_config_byte, - tx4927_pcibios_write_config_word, - tx4927_pcibios_write_config_dword + tx4927_pcibios_read_config, + tx4927_pcibios_write_config +}; + +/* + * h/w only supports devices 0x00 to 0x14 + */ +struct pci_controller tx4927_controller = { + .pci_ops = &tx4927_pci_ops, + .io_resource = &pci_io_resource, + .mem_resource = &pci_mem_resource, }; diff --git a/arch/mips/pci/pci-ddb5074.c b/arch/mips/pci/pci-ddb5074.c index 5bc21b22e..73f9ceeb2 100644 --- a/arch/mips/pci/pci-ddb5074.c +++ b/arch/mips/pci/pci-ddb5074.c @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -54,6 +53,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_map[slot]; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + void __init ddb_pci_reset_bus(void) { u32 temp; diff --git a/arch/mips/pci/pci-ddb5476.c b/arch/mips/pci/pci-ddb5476.c index 945e59bce..90dd49509 100644 --- a/arch/mips/pci/pci-ddb5476.c +++ b/arch/mips/pci/pci-ddb5476.c @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -68,6 +67,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq_map[slot]; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + void __init ddb_pci_reset_bus(void) { u32 temp; diff --git a/arch/mips/pci/pci-ddb5477.c b/arch/mips/pci/pci-ddb5477.c index fd94115e7..4ddd53eaf 100644 --- a/arch/mips/pci/pci-ddb5477.c +++ b/arch/mips/pci/pci-ddb5477.c @@ -4,6 +4,8 @@ * Copyright (C) 2001 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -15,7 +17,6 @@ #include #include -#include #include #include @@ -175,6 +176,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + void ddb_pci_reset_bus(void) { u32 temp; diff --git a/arch/mips/pci/pci-ev96100.c b/arch/mips/pci/pci-ev96100.c index 8f2becbd8..f9457ea00 100644 --- a/arch/mips/pci/pci-ev96100.c +++ b/arch/mips/pci/pci-ev96100.c @@ -6,6 +6,8 @@ * Carsten Langgaard, carstenl@mips.com * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -31,8 +33,6 @@ #include #include -#include - static struct resource pci_io_resource = { .name = "io pci IO space", .start = 0x10000000, diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index b996766a2..068e0e508 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c @@ -4,7 +4,7 @@ * for more details. * * Copyright (C) 2003 Christoph Hellwig (hch@lst.de) - * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org) + * Copyright (C) 1999, 2000, 04 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ #include @@ -12,11 +12,12 @@ #include #include #include -#include #include #include #include +extern unsigned int allocate_irqno(void); + /* * Max #PCI busses we can handle; ie, max #PCI bridges. */ @@ -81,7 +82,7 @@ static int pci_conf0_read_config(struct pci_bus *bus, unsigned int devfn, else res = get_dbe(*value, (u32 *) addr); - return PCIBIOS_SUCCESSFUL; + return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; oh_my_gawd: @@ -110,6 +111,79 @@ oh_my_gawd: return PCIBIOS_SUCCESSFUL; } +static int pci_conf1_read_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 * value) +{ + struct bridge_controller *bc = BRIDGE_CONTROLLER(bus); + bridge_t *bridge = bc->base; + int busno = bus->number; + int slot = PCI_SLOT(devfn); + int fn = PCI_FUNC(devfn); + volatile void *addr; + u32 cf, shift, mask; + int res; + + bridge->b_pci_cfg = (busno << 16) | (slot << 11); + addr = &bridge->b_type1_cfg.c[(fn << 8) | PCI_VENDOR_ID]; + if (get_dbe(cf, (u32 *) addr)) + return PCIBIOS_DEVICE_NOT_FOUND; + + /* + * IOC3 is fucked fucked beyond believe ... Don't even give the + * generic PCI code a chance to look at it for real ... + */ + if (cf == (PCI_VENDOR_ID_SGI | (PCI_DEVICE_ID_SGI_IOC3 << 16))) + goto oh_my_gawd; + + bridge->b_pci_cfg = (busno << 16) | (slot << 11); + addr = &bridge->b_type1_cfg.c[(fn << 8) | (where ^ (4 - size))]; + + if (size == 1) + res = get_dbe(*value, (u8 *) addr); + else if (size == 2) + res = get_dbe(*value, (u16 *) addr); + else + res = get_dbe(*value, (u32 *) addr); + + return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + +oh_my_gawd: + + /* + * IOC3 is fucked fucked beyond believe ... Don't even give the + * generic PCI code a chance to look at the wrong register. + */ + if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) { + *value = 0; + return PCIBIOS_SUCCESSFUL; + } + + /* + * IOC3 is fucked fucked beyond believe ... Don't try to access + * anything but 32-bit words ... + */ + bridge->b_pci_cfg = (busno << 16) | (slot << 11); + addr = &bridge->b_type1_cfg.c[(fn << 8) | where]; + + if (get_dbe(cf, (u32 *) addr)) + return PCIBIOS_DEVICE_NOT_FOUND; + + shift = ((where & 3) << 3); + mask = (0xffffffffU >> ((4 - size) << 3)); + *value = (cf >> shift) & mask; + + return PCIBIOS_SUCCESSFUL; +} + +static int pci_read_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 * value) +{ + if (bus->number > 0) + return pci_conf1_read_config(bus, devfn, where, size, value); + + return pci_conf0_read_config(bus, devfn, where, size, value); +} + static int pci_conf0_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { @@ -176,16 +250,95 @@ oh_my_gawd: return PCIBIOS_SUCCESSFUL; } +static int pci_conf1_write_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 value) +{ + struct bridge_controller *bc = BRIDGE_CONTROLLER(bus); + bridge_t *bridge = bc->base; + int slot = PCI_SLOT(devfn); + int fn = PCI_FUNC(devfn); + int busno = bus->number; + volatile void *addr; + u32 cf, shift, mask, smask; + int res; + + bridge->b_pci_cfg = (busno << 16) | (slot << 11); + addr = &bridge->b_type1_cfg.c[(fn << 8) | PCI_VENDOR_ID]; + if (get_dbe(cf, (u32 *) addr)) + return PCIBIOS_DEVICE_NOT_FOUND; + + /* + * IOC3 is fucked fucked beyond believe ... Don't even give the + * generic PCI code a chance to look at it for real ... + */ + if (cf == (PCI_VENDOR_ID_SGI | (PCI_DEVICE_ID_SGI_IOC3 << 16))) + goto oh_my_gawd; + + addr = &bridge->b_type1_cfg.c[(fn << 8) | (where ^ (4 - size))]; + + if (size == 1) { + res = put_dbe(value, (u8 *) addr); + } else if (size == 2) { + res = put_dbe(value, (u16 *) addr); + } else { + res = put_dbe(value, (u32 *) addr); + } + + if (res) + return PCIBIOS_DEVICE_NOT_FOUND; + + return PCIBIOS_SUCCESSFUL; + +oh_my_gawd: + + /* + * IOC3 is fucked fucked beyond believe ... Don't even give the + * generic PCI code a chance to touch the wrong register. + */ + if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) + return PCIBIOS_SUCCESSFUL; + + /* + * IOC3 is fucked fucked beyond believe ... Don't try to access + * anything but 32-bit words ... + */ + addr = &bridge->b_type0_cfg_dev[slot].f[fn].l[where >> 2]; + + if (get_dbe(cf, (u32 *) addr)) + return PCIBIOS_DEVICE_NOT_FOUND; + + shift = ((where & 3) << 3); + mask = (0xffffffffU >> ((4 - size) << 3)); + smask = mask << shift; + + cf = (cf & ~smask) | ((value & mask) << shift); + if (put_dbe(cf, (u32 *) addr)) + return PCIBIOS_DEVICE_NOT_FOUND; + + return PCIBIOS_SUCCESSFUL; +} + +static int pci_write_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 value) +{ + if (bus->number > 0) + return pci_conf1_write_config(bus, devfn, where, size, value); + + return pci_conf0_write_config(bus, devfn, where, size, value); +} + static struct pci_ops bridge_pci_ops = { - .read = pci_conf0_read_config, - .write = pci_conf0_write_config, + .read = pci_read_config, + .write = pci_write_config, }; int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid) { + unsigned long offset = NODE_OFFSET(nasid); struct bridge_controller *bc; - bridge_t *bridge; static int num_bridges = 0; + bridge_t *bridge; + int slot; printk("a bridge\n"); @@ -193,21 +346,23 @@ int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid) if (!num_bridges) ioport_resource.end = ~0UL; - bc = &bridges[num_bridges++]; + bc = &bridges[num_bridges]; bc->pc.pci_ops = &bridge_pci_ops; bc->pc.mem_resource = &bc->mem; bc->pc.io_resource = &bc->io; + bc->pc.index = num_bridges; + bc->mem.name = "Bridge PCI MEM"; - bc->pc.mem_offset = 0; + bc->pc.mem_offset = offset; bc->mem.start = 0; bc->mem.end = ~0UL; bc->mem.flags = IORESOURCE_MEM; bc->io.name = "Bridge IO MEM"; + bc->pc.io_offset = offset; bc->io.start = 0UL; - bc->pc.io_offset = 0UL; bc->io.end = ~0UL; bc->io.flags = IORESOURCE_IO; @@ -231,7 +386,7 @@ int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid) /* * Until otherwise set up, assume all interrupts are from slot 0 */ - bridge->b_int_device = (u32) 0x0; + bridge->b_int_device = 0x0; /* * swap pio's to pci mem and io space (big windows) @@ -248,11 +403,18 @@ int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid) bridge->b_dir_map = (masterwid << 20); /* DMA */ bridge->b_int_enable = 0; + for (slot = 0; slot < 8; slot ++) { + bridge->b_device[slot].reg |= BRIDGE_DEV_SWAP_DIR; + bc->pci_int[slot] = -1; + } bridge->b_wid_tflush; /* wait until Bridge PIO complete */ bc->base = bridge; register_pci_controller(&bc->pc); + + num_bridges++; + return 0; } @@ -268,17 +430,13 @@ int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid) int __devinit pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); - int irq; + int irq = bc->pci_int[slot]; - irq = allocate_irqno(); - - /* - * Argh... This API doesn't handle with errors at all ... - */ if (irq == -1) { - printk(KERN_ERR "Can't allocate interrupt for PCI device %s\n", - pci_name(dev)); - return -1; + irq = bc->pci_int[slot] = request_bridge_irq(bc); + if (irq < 0) + panic("Can't allocate interrupt for PCI device %s\n", + pci_name(dev)); } irq_to_bridge[irq] = bc; @@ -287,6 +445,12 @@ int __devinit pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return irq; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + /* * Device might live on a subordinate PCI bus. XXX Walk up the chain of buses * to find the slot number in sense of the bridge device register. @@ -294,7 +458,7 @@ int __devinit pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) * settings. */ -static void __init pci_disable_swapping(struct pci_dev *dev) +static inline void pci_disable_swapping(struct pci_dev *dev) { struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); bridge_t *bridge = bc->base; @@ -305,7 +469,7 @@ static void __init pci_disable_swapping(struct pci_dev *dev) bridge->b_widget.w_tflush; /* Flush */ } -static void __init pci_enable_swapping(struct pci_dev *dev) +static inline void pci_enable_swapping(struct pci_dev *dev) { struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); bridge_t *bridge = bc->base; @@ -318,122 +482,8 @@ static void __init pci_enable_swapping(struct pci_dev *dev) static void __init pci_fixup_ioc3(struct pci_dev *d) { - struct bridge_controller *bc = BRIDGE_CONTROLLER(d->bus); - unsigned long offset = NODE_OFFSET(bc->nasid); - - printk("PCI: Fixing base addresses for IOC3 device %s\n", pci_name(d)); - - d->resource[0].start |= offset; - d->resource[0].end |= offset; - pci_disable_swapping(d); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, - pci_fixup_ioc3); - -static void __init pci_fixup_isp1020(struct pci_dev *d) -{ - struct bridge_controller *bc = BRIDGE_CONTROLLER(d->bus); - unsigned short command; - - d->resource[0].start |= (unsigned long) bc->nasid << 32; - printk("PCI: Fixing isp1020 in [bus:slot.fn] %s\n", pci_name(d)); - - /* - * Configure device to allow bus mastering, i/o and memory mapping. - * Older qlogicisp driver expects to have the IO space enable - * bit set. Things stop working if we program the controllers as not - * having PCI_COMMAND_MEMORY, so we have to fudge the mem_flags. - */ - pci_set_master(d); - pci_read_config_word(d, PCI_COMMAND, &command); - command |= PCI_COMMAND_MEMORY; - command |= PCI_COMMAND_IO; - pci_write_config_word(d, PCI_COMMAND, command); - d->resource[1].flags |= 1; - - pci_enable_swapping(d); -} - -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, - pci_fixup_isp1020); - -static void __init pci_fixup_isp2x00(struct pci_dev *d) -{ - struct bridge_controller *bc = BRIDGE_CONTROLLER(d->bus); - bridge_t *bridge = bc->base; - bridgereg_t devreg; - int i; - int slot = PCI_SLOT(d->devfn); - unsigned int start; - unsigned short command; - - printk("PCI: Fixing isp2x00 in [bus:slot.fn] %s\n", pci_name(d)); - - /* set the resource struct for this device */ - start = (u32) (u64) bridge; /* yes, we want to lose the upper 32 bits here */ - start |= BRIDGE_DEVIO(slot); - - d->resource[0].start = start; - d->resource[0].end = d->resource[0].start + 0xff; - d->resource[0].flags = IORESOURCE_IO; - - d->resource[1].start = start; - d->resource[1].end = d->resource[0].start + 0xfff; - d->resource[1].flags = IORESOURCE_MEM; - - /* - * set the bridge device(x) reg for this device - */ - devreg = bridge->b_device[slot].reg; - /* point device(x) to it appropriate small window */ - devreg &= ~BRIDGE_DEV_OFF_MASK; - devreg |= (start >> 20) & BRIDGE_DEV_OFF_MASK; - bridge->b_device[slot].reg = devreg; - - pci_enable_swapping(d); - - /* set card's base addr reg */ - //pci_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x500001); - //pci_write_config_dword(d, PCI_BASE_ADDRESS_1, 0x8b00000); - //pci_write_config_dword(d, PCI_ROM_ADDRESS, 0x8b20000); - - /* I got these from booting irix on system... */ - pci_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x200001); - //pci_write_config_dword(d, PCI_BASE_ADDRESS_1, 0xf800000); - pci_write_config_dword(d, PCI_ROM_ADDRESS, 0x10200000); - - pci_write_config_dword(d, PCI_BASE_ADDRESS_1, start); - //pci_write_config_dword(d, PCI_ROM_ADDRESS, (start | 0x20000)); - - /* set cache line size */ - pci_write_config_dword(d, PCI_CACHE_LINE_SIZE, 0xf080); - - /* set pci bus timeout */ - bridge->b_bus_timeout |= BRIDGE_BUS_PCI_RETRY_HLD(0x3); - bridge->b_wid_tflush; - printk("PCI: bridge bus timeout= 0x%x \n", bridge->b_bus_timeout); - - /* set host error field */ - bridge->b_int_host_err = 0x44; - bridge->b_wid_tflush; - - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - for (i = 0; i < 8; i++) - printk("PCI: device(%d)= 0x%x\n", i, - bridge->b_device[i].reg); - - /* configure device to allow bus mastering, i/o and memory mapping */ - pci_set_master(d); - pci_read_config_word(d, PCI_COMMAND, &command); - command |= PCI_COMMAND_MEMORY; - command |= PCI_COMMAND_IO; - pci_write_config_word(d, PCI_COMMAND, command); - /*d->resource[1].flags |= 1; */ -} - -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100, - pci_fixup_isp2x00); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200, - pci_fixup_isp2x00); + pci_fixup_ioc3); diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c index 3b3e1940e..1faeb034f 100644 --- a/arch/mips/pci/pci-ip32.c +++ b/arch/mips/pci/pci-ip32.c @@ -4,6 +4,7 @@ * for more details. * * Copyright (C) 2000, 2001 Keith M Wesolowski + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) */ #include #include @@ -11,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/arch/mips/pci/pci-jmr3927.c b/arch/mips/pci/pci-jmr3927.c index 24943a23c..95a028769 100644 --- a/arch/mips/pci/pci-jmr3927.c +++ b/arch/mips/pci/pci-jmr3927.c @@ -4,6 +4,7 @@ * ahennessy@mvista.com * * Copyright (C) 2000-2001 Toshiba Corporation + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -30,7 +31,6 @@ #include #include -#include #include #include diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c index d104360a1..ae3cc4b25 100644 --- a/arch/mips/pci/pci-lasat.c +++ b/arch/mips/pci/pci-lasat.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000, 2001 Keith M Wesolowski + * Copyright (C) 2000, 2001, 04 Keith M Wesolowski */ #include #include @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -66,6 +65,7 @@ early_initcall(lasat_pci_setup); #define LASATINT_PCIB 6 #define LASATINT_PCIC 7 #define LASATINT_PCID 8 + int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { switch (slot) { @@ -87,3 +87,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return -1; } + +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} diff --git a/arch/mips/pci/pci-ocelot-c.c b/arch/mips/pci/pci-ocelot-c.c index 8b2227277..1d84d36e0 100644 --- a/arch/mips/pci/pci-ocelot-c.c +++ b/arch/mips/pci/pci-ocelot-c.c @@ -3,13 +3,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2004 by Ralf Baechle + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) */ #include #include #include -#include #include diff --git a/arch/mips/pci/pci-ocelot-g.c b/arch/mips/pci/pci-ocelot-g.c index 239b81fba..1e3430154 100644 --- a/arch/mips/pci/pci-ocelot-g.c +++ b/arch/mips/pci/pci-ocelot-g.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2004 by Ralf Baechle + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * This doesn't really fly - but I don't have a GT64240 system for testing. */ @@ -12,7 +12,6 @@ #include #include #include -#include /* * We assume these address ranges have been programmed into the GT-64240 by diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c index 8c7c385e4..7cca3bde5 100644 --- a/arch/mips/pci/pci-sb1250.c +++ b/arch/mips/pci/pci-sb1250.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2001,2002,2003 Broadcom Corporation + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -36,9 +37,9 @@ #include #include #include +#include #include -#include #include #include @@ -89,6 +90,12 @@ int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) return dev->irq; } +/* Do platform specific device initialization at pci_enable_device() time */ +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + return 0; +} + /* * Some checks before doing config cycles: * In PCI Device Mode, hide everything on bus 0 except the LDT host @@ -175,28 +182,28 @@ static int sb1250_pcibios_write(struct pci_bus *bus, unsigned int devfn, } struct pci_ops sb1250_pci_ops = { - .read = sb1250_pcibios_read, - .write = sb1250_pcibios_write + .read = sb1250_pcibios_read, + .write = sb1250_pcibios_write, }; static struct resource sb1250_mem_resource = { .name = "SB1250 PCI MEM", - .start = 0x14000000UL, - .end = 0x17ffffffUL, + .start = 0x40000000UL, + .end = 0x5fffffffUL, .flags = IORESOURCE_MEM, }; - + static struct resource sb1250_io_resource = { - .name = "SB1250 IO MEM", - .start = 0x14000000UL, - .end = 0x17ffffffUL, + .name = "SB1250 PCI I/O", + .start = 0x00000000UL, + .end = 0x01ffffffUL, .flags = IORESOURCE_IO, }; struct pci_controller sb1250_controller = { .pci_ops = &sb1250_pci_ops, .mem_resource = &sb1250_mem_resource, - .io_resource = &sb1250_io_resource + .io_resource = &sb1250_io_resource, }; static int __init sb1250_pcibios_init(void) @@ -208,9 +215,13 @@ static int __init sb1250_pcibios_init(void) /* CFE will assign PCI resources */ pci_probe_only = 1; - /* set resource limit to avoid errors */ - ioport_resource.end = 0x0000ffff; /* 32MB reserved by sb1250 */ - iomem_resource.end = 0xffffffff; /* no HT support yet */ + /* Avoid ISA compat ranges. */ + PCIBIOS_MIN_IO = 0x00008000UL; + PCIBIOS_MIN_MEM = 0x01000000UL; + + /* Set I/O resource limits. */ + ioport_resource.end = 0x01ffffffUL; /* 32MB accessible by sb1250 */ + iomem_resource.end = 0xffffffffUL; /* no HT support yet */ cfg_space = ioremap(A_PHYS_LDTPCI_CFG_MATCH_BITS, 16 * 1024 * 1024); diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c index a6db6f028..dc9795fe9 100644 --- a/arch/mips/pci/pci-vr41xx.c +++ b/arch/mips/pci/pci-vr41xx.c @@ -4,6 +4,7 @@ * Copyright (C) 2001-2003 MontaVista Software Inc. * Author: Yoichi Yuasa * Copyright (C) 2004 Yoichi Yuasa + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +31,6 @@ #include #include -#include #include #include "pci-vr41xx.h" @@ -270,7 +270,7 @@ static int __init vr41xx_pciu_init(void) /* Clear bus error */ readl(BUSERRADREG); - writel(CONFIG_DONE, PCIENREG); + writel(BLOODY_CONFIG_DONE, PCIENREG); if (setup->mem_resource != NULL) vr41xx_pci_controller.mem_resource = setup->mem_resource; diff --git a/arch/mips/pci/pci-vr41xx.h b/arch/mips/pci/pci-vr41xx.h index 3a5f69bfb..23815c8b9 100644 --- a/arch/mips/pci/pci-vr41xx.h +++ b/arch/mips/pci/pci-vr41xx.h @@ -73,7 +73,7 @@ #define PCIRECONTREG KSEG1ADDR(0x0f000c30) #define RTRYCNT(reg) ((reg) & 0x000000ffU) #define PCIENREG KSEG1ADDR(0x0f000c34) - #define CONFIG_DONE 0x4U + #define BLOODY_CONFIG_DONE 0x4U #define PCICLKSELREG KSEG1ADDR(0x0f000c38) #define EQUAL_VTCLOCK 0x2U #define HALF_VTCLOCK 0x0U diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c index c1151f43c..dac9ed4b0 100644 --- a/arch/mips/pci/pci-yosemite.c +++ b/arch/mips/pci/pci-yosemite.c @@ -3,15 +3,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2004 by Ralf Baechle - * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) */ #include #include #include #include -#include -#include +#include extern struct pci_ops titan_pci_ops; @@ -19,19 +17,44 @@ static struct resource py_mem_resource = { "Titan PCI MEM", 0xe0000000UL, 0xe3ffffffUL, IORESOURCE_MEM }; +/* + * PMON really reserves 16MB of I/O port space but that's stupid, nothing + * needs that much since allocations are limited to 256 bytes per device + * anyway. So we just claim 64kB here. + */ +#define TITAN_IO_SIZE 0x0000ffffUL +#define TITAN_IO_BASE 0xe8000000UL + static struct resource py_io_resource = { - "Titan IO MEM", 0x00000000UL, 0x00ffffffUL, IORESOURCE_IO, + "Titan IO MEM", 0x00001000UL, TITAN_IO_SIZE - 1, IORESOURCE_IO, }; static struct pci_controller py_controller = { .pci_ops = &titan_pci_ops, .mem_resource = &py_mem_resource, - .mem_offset = 0x10000000UL, + .mem_offset = 0x00000000UL, .io_resource = &py_io_resource, .io_offset = 0x00000000UL }; +static char ioremap_failed[] __initdata = "Could not ioremap I/O port range"; + static int __init pmc_yosemite_setup(void) { + unsigned long io_v_base; + + io_v_base = (unsigned long) ioremap(TITAN_IO_BASE, TITAN_IO_SIZE); + if (!io_v_base) + panic(ioremap_failed); + + set_io_port_base(io_v_base); + TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); + + ioport_resource.end = TITAN_IO_SIZE - 1; + register_pci_controller(&py_controller); + + return 0; } + +arch_initcall(pmc_yosemite_setup); diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 9bee1e937..8141dffac 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -4,7 +4,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * - * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) + * Copyright (C) 2003, 04 Ralf Baechle (ralf@linux-mips.org) */ #include #include @@ -14,8 +14,6 @@ #include #include -#include - /* * Indicate whether we respect the PCI setup left by the firmware. * @@ -61,7 +59,7 @@ pcibios_align_resource(void *data, struct resource *res, if (res->flags & IORESOURCE_IO) { /* Make sure we start at our min on all hoses */ - if (start - hose->io_resource->start < PCIBIOS_MIN_IO) + if (start < PCIBIOS_MIN_IO + hose->io_resource->start) start = PCIBIOS_MIN_IO + hose->io_resource->start; /* @@ -71,7 +69,7 @@ pcibios_align_resource(void *data, struct resource *res, start = (start + 0x3ff) & ~0x3ff; } else if (res->flags & IORESOURCE_MEM) { /* Make sure we start at our min on all hoses */ - if (start - hose->mem_resource->start < PCIBIOS_MIN_MEM) + if (start < PCIBIOS_MIN_MEM + hose->mem_resource->start) start = PCIBIOS_MIN_MEM + hose->mem_resource->start; } @@ -223,7 +221,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) if ((err = pcibios_enable_resources(dev, mask)) < 0) return err; - return 0; + return pcibios_plat_dev_init(dev); } static void __init pcibios_fixup_device_resources(struct pci_dev *dev, @@ -296,6 +294,8 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, #ifdef CONFIG_HOTPLUG EXPORT_SYMBOL(pcibios_resource_to_bus); +EXPORT_SYMBOL(PCIBIOS_MIN_IO); +EXPORT_SYMBOL(PCIBIOS_MIN_MEM); #endif char *pcibios_setup(char *str) diff --git a/arch/mips/pmc-sierra/yosemite/Makefile b/arch/mips/pmc-sierra/yosemite/Makefile index bc1758623..ae96a71a3 100644 --- a/arch/mips/pmc-sierra/yosemite/Makefile +++ b/arch/mips/pmc-sierra/yosemite/Makefile @@ -5,3 +5,4 @@ obj-y += irq-handler.o irq.o i2c-yosemite.o prom.o py-console.o setup.o obj-$(CONFIG_KGDB) += dbg_io.o +obj-$(CONFIG_SMP) += smp.o diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h index f2e3fe1e7..d27566d99 100644 --- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h +++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h @@ -3,6 +3,7 @@ * * Copyright (C) 2003 PMC-Sierra Inc. * Author: Manish Lachwani (lachwani@pmc-sierra.com) + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -29,7 +30,6 @@ * Header file for atmel_read_eeprom.c */ -#include #include #include #include diff --git a/arch/mips/pmc-sierra/yosemite/dbg_io.c b/arch/mips/pmc-sierra/yosemite/dbg_io.c index 1ff8d95d0..0f659c910 100644 --- a/arch/mips/pmc-sierra/yosemite/dbg_io.c +++ b/arch/mips/pmc-sierra/yosemite/dbg_io.c @@ -31,9 +31,6 @@ * the interrupt came from channel A or B. */ -#include - -#if defined(CONFIG_KGDB) #include /* @@ -181,4 +178,3 @@ int putDebugChar(unsigned char byte) return 1; } -#endif diff --git a/arch/mips/pmc-sierra/yosemite/irq-handler.S b/arch/mips/pmc-sierra/yosemite/irq-handler.S index ebe2e64e2..33b9c40d4 100644 --- a/arch/mips/pmc-sierra/yosemite/irq-handler.S +++ b/arch/mips/pmc-sierra/yosemite/irq-handler.S @@ -1,6 +1,7 @@ /* - * Copyright 2003 PMC-Sierra Inc. + * Copyright 2003, 04 PMC-Sierra Inc. * Author: Manish Lachwani (lachwani@pmc-sierra.com + * Copyright 2004 Ralf Baechle (ralf@linux-mips.org) * * First-level interrupt router for the PMC-Sierra Titan board * @@ -27,84 +28,66 @@ CLI .set at .set noreorder + la ra, ret_from_irq mfc0 t0, CP0_CAUSE mfc0 t2, CP0_STATUS and t0, t2 + andi t2, t0, STATUSF_IP7 /* INTB5 hardware line */ + bnez t2, ll_timer_irq /* Timer */ andi t1, t0, STATUSF_IP2 /* INTB0 hardware line */ bnez t1, ll_pcia_irq /* 64-bit PCI */ - andi t1, t0, STATUSF_IP3 /* INTB1 hardware line */ - bnez t1, ll_pcib_irq /* second 64-bit PCI slot */ + andi t2, t0, STATUSF_IP3 /* INTB1 hardware line */ + bnez t2, ll_pcib_irq /* second 64-bit PCI slot */ andi t1, t0, STATUSF_IP4 /* INTB2 hardware line */ bnez t1, ll_duart_irq /* UART */ - andi t1, t0, STATUSF_IP5 /* SMP inter-core interrupts */ - bnez t1, ll_smp_irq + andi t2, t0, STATUSF_IP5 /* SMP inter-core interrupts */ + bnez t2, ll_smp_irq andi t1, t0, STATUSF_IP6 bnez t1, ll_ht_irq /* Hypertransport */ - andi t1, t0, STATUSF_IP7 /* INTB5 hardware line */ - bnez t1, ll_timer_irq /* Timer */ - nop - nop - - /* Extended interrupts */ - mfc0 t0, CP0_CAUSE - cfc0 t1, CP0_S1_INTCONTROL - - sll t2, t1, 8 - - and t0, t2 - srl t0, t0, 16 - - .set reorder - - j spurious_interrupt - nop + move a0, sp + j do_extended_irq END(titan_handle_int) + .set reorder .align 5 ll_pcia_irq: li a0, 2 move a1, sp #ifdef CONFIG_HYPERTRANSPORT - jal ll_ht_smp_irq_handler + j ll_ht_smp_irq_handler #else - jal do_IRQ + j do_IRQ #endif - j ret_from_irq ll_pcib_irq: li a0, 3 move a1, sp - jal do_IRQ - j ret_from_irq + j do_IRQ ll_duart_irq: li a0, 4 move a1, sp - jal do_IRQ - j ret_from_irq + j do_IRQ ll_smp_irq: li a0, 5 move a1, sp #ifdef CONFIG_SMP - jal jaguar_mailbox_irq + j titan_mailbox_irq #else - jal do_IRQ + j do_IRQ #endif - j ret_from_irq ll_ht_irq: li a0, 6 move a1, sp - jal ll_ht_smp_irq_handler - j ret_from_irq + j ll_ht_smp_irq_handler ll_timer_irq: li a0, 7 move a1, sp - jal do_IRQ - j ret_from_irq + j do_IRQ diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c index e8b7ed63e..f4e2897d9 100644 --- a/arch/mips/pmc-sierra/yosemite/irq.c +++ b/arch/mips/pmc-sierra/yosemite/irq.c @@ -24,7 +24,7 @@ * * Second level Interrupt handlers for the PMC-Sierra Titan/Yosemite board */ - +#include #include #include #include @@ -34,10 +34,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #include @@ -57,7 +58,7 @@ extern asmlinkage void titan_handle_int(void); extern void jaguar_mailbox_irq(struct pt_regs *); -/* +/* * Handle hypertransport & SMP interrupts. The interrupt lines are scarce. * For interprocessor interrupts, the best thing to do is to use the INTMSG * register. We use the same external interrupt line, i.e. INTB3 and monitor @@ -65,15 +66,15 @@ extern void jaguar_mailbox_irq(struct pt_regs *); */ asmlinkage void ll_ht_smp_irq_handler(int irq, struct pt_regs *regs) { - u32 status = OCD_READ(RM9000x2_OCD_INTP0STATUS4); + u32 status = OCD_READ(RM9000x2_OCD_INTP0STATUS4); /* Ack all the bits that correspond to the interrupt sources */ if (status != 0) - OCD_WRITE(RM9000x2_OCD_INTP0STATUS4, IRQ_ACK_BITS); + OCD_WRITE(RM9000x2_OCD_INTP0STATUS4, IRQ_ACK_BITS); status = OCD_READ(RM9000x2_OCD_INTP1STATUS4); if (status != 0) - OCD_WRITE(RM9000x2_OCD_INTP1STATUS4, IRQ_ACK_BITS); + OCD_WRITE(RM9000x2_OCD_INTP1STATUS4, IRQ_ACK_BITS); #ifdef CONFIG_HT_LEVEL_TRIGGER /* @@ -109,30 +110,40 @@ asmlinkage void ll_ht_smp_irq_handler(int irq, struct pt_regs *regs) do_IRQ(irq, regs); } +asmlinkage void do_extended_irq(struct pt_regs *regs) +{ + unsigned int intcontrol = read_c0_intcontrol(); + unsigned int cause = read_c0_cause(); + unsigned int status = read_c0_status(); + unsigned int pending_sr, pending_ic; + + pending_sr = status & cause & 0xff00; + pending_ic = (cause >> 8) & intcontrol & 0xff00; + + if (pending_ic & (1 << 13)) + do_IRQ(13, regs); + +} + #ifdef CONFIG_KGDB extern void init_second_port(void); -extern void breakpoint(void); -extern void set_debug_traps(void); #endif /* * Initialize the next level interrupt handler */ -void __init init_IRQ(void) +void __init arch_init_irq(void) { clear_c0_status(ST0_IM); set_except_vector(0, titan_handle_int); - init_generic_irq(); mips_cpu_irq_init(0); rm7k_cpu_irq_init(8); + rm9k_cpu_irq_init(12); #ifdef CONFIG_KGDB /* At this point, initialize the second serial port */ init_second_port(); - printk("Start kgdb ... \n"); - set_debug_traps(); - breakpoint(); #endif #ifdef CONFIG_GDB_CONSOLE diff --git a/arch/mips/pmc-sierra/yosemite/prom.c b/arch/mips/pmc-sierra/yosemite/prom.c index 5b4ef33ac..1fb3e6979 100644 --- a/arch/mips/pmc-sierra/yosemite/prom.c +++ b/arch/mips/pmc-sierra/yosemite/prom.c @@ -4,9 +4,11 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * - * Copyright (C) 2003 PMC-Sierra Inc. + * Copyright (C) 2003, 2004 PMC-Sierra Inc. * Author: Manish Lachwani (lachwani@pmc-sierra.com) + * Copyright (C) 2004 Ralf Baechle */ +#include #include #include #include @@ -21,6 +23,12 @@ #include #include +#ifdef CONFIG_SMP +extern void prom_grab_secondary(void); +#else +#define prom_grab_secondary() do { } while (0) +#endif + #include "setup.h" struct callvectors *debug_vectors; @@ -35,7 +43,7 @@ const char *get_system_type(void) static void prom_cpu0_exit(void *arg) { - void *nvram = (void *) YOSEMITE_NVRAM_BASE_ADDR; + void *nvram = (void *) YOSEMITE_RTC_BASE; /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */ writeb(0x84, nvram + 0xff7); @@ -86,8 +94,6 @@ void __init prom_init(void) _machine_halt = prom_halt; _machine_power_off = prom_halt; -#ifdef CONFIG_MIPS32 - debug_vectors = cv; arcs_cmdline[0] = '\0'; @@ -101,6 +107,11 @@ void __init prom_init(void) strcat(arcs_cmdline, " "); } +#ifdef CONFIG_SERIAL_8250_CONSOLE + if ((strstr(arcs_cmdline, "console=ttyS")) == NULL) + strcat(arcs_cmdline, "console=ttyS0,115200"); +#endif + while (*env) { if (strncmp("ocd_base", *env, strlen("ocd_base")) == 0) yosemite_base = @@ -114,16 +125,11 @@ void __init prom_init(void) env++; } -#endif /* CONFIG_MIPS32 */ - -#ifdef CONFIG_MIPS64 - - /* Do nothing for the 64-bit for now. Just implement for the 32-bit */ - -#endif /* CONFIG_MIPS64 */ mips_machgroup = MACH_GROUP_TITAN; mips_machtype = MACH_TITAN_YOSEMITE; + + prom_grab_secondary(); } void __init prom_free_prom_memory(void) diff --git a/arch/mips/pmc-sierra/yosemite/py-console.c b/arch/mips/pmc-sierra/yosemite/py-console.c index 22c336f9a..757e60569 100644 --- a/arch/mips/pmc-sierra/yosemite/py-console.c +++ b/arch/mips/pmc-sierra/yosemite/py-console.c @@ -48,11 +48,12 @@ struct yo_uartregs { #define iu_iir u3.iir #define iu_fcr u3.fcr -extern unsigned long uart_base; +#define ssnop() __asm__ __volatile__("sll $0, $0, 1\n"); +#define ssnop_4() do { ssnop(); ssnop(); ssnop(); ssnop(); } while (0) #define IO_BASE_64 0x9000000000000000ULL -static unsigned char readb_outer_space(unsigned long phys) +static unsigned char readb_outer_space(unsigned long long phys) { unsigned long long vaddr = IO_BASE_64 | phys; unsigned char res; @@ -60,29 +61,23 @@ static unsigned char readb_outer_space(unsigned long phys) sr = read_c0_status(); write_c0_status((sr | ST0_KX) & ~ ST0_IE); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); + ssnop_4(); __asm__ __volatile__ ( " .set mips3 \n" - " ld %0, (%0) \n" + " ld %0, %1 \n" " lbu %0, (%0) \n" " .set mips0 \n" : "=r" (res) - : "0" (&vaddr)); + : "m" (vaddr)); write_c0_status(sr); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); + ssnop_4(); return res; } -static void writeb_outer_space(unsigned long phys, unsigned char c) +static void writeb_outer_space(unsigned long long phys, unsigned char c) { unsigned long long vaddr = IO_BASE_64 | phys; unsigned long tmp; @@ -90,35 +85,24 @@ static void writeb_outer_space(unsigned long phys, unsigned char c) sr = read_c0_status(); write_c0_status((sr | ST0_KX) & ~ ST0_IE); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); + ssnop_4(); __asm__ __volatile__ ( " .set mips3 \n" - " ld %0, (%1) \n" + " ld %0, %1 \n" " sb %2, (%0) \n" " .set mips0 \n" - : "=r" (tmp) - : "r" (&vaddr), "r" (c)); + : "=&r" (tmp) + : "m" (vaddr), "r" (c)); write_c0_status(sr); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); - __asm__("sll $0, $0, 2\n"); -} - -static inline struct yo_uartregs *console_uart(void) -{ - return (struct yo_uartregs *) (uart_base + 8); + ssnop_4(); } void prom_putchar(char c) { - unsigned long lsr = 0xfd000008UL + offsetof(struct yo_uartregs, iu_lsr); - unsigned long thr = 0xfd000008UL + offsetof(struct yo_uartregs, iu_thr); + unsigned long lsr = 0xfd000008ULL + offsetof(struct yo_uartregs, iu_lsr); + unsigned long thr = 0xfd000008ULL + offsetof(struct yo_uartregs, iu_thr); while ((readb_outer_space(lsr) & 0x20) == 0); writeb_outer_space(thr, c); diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c index dfa9cd0ed..7225bbf20 100644 --- a/arch/mips/pmc-sierra/yosemite/setup.c +++ b/arch/mips/pmc-sierra/yosemite/setup.c @@ -2,6 +2,8 @@ * Copyright (C) 2003 PMC-Sierra Inc. * Author: Manish Lachwani (lachwani@pmc-sierra.com) * + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -33,96 +35,94 @@ #include #include #include +#include +#include +#include +#include #include #include #include -#include #include #include #include #include #include -#include #include -#include -#include -#include -#include #include +#include #include "setup.h" unsigned char titan_ge_mac_addr_base[6] = { - 0x00, 0x03, 0xcc, 0x1d, 0x22, 0x00 + // 0x00, 0x03, 0xcc, 0x1d, 0x22, 0x00 + 0x00, 0xe0, 0x04, 0x00, 0x00, 0x21 }; unsigned long cpu_clock; unsigned long yosemite_base; +static struct m48t37_rtc *m48t37_base; + void __init bus_error_init(void) { /* Do nothing */ } + unsigned long m48t37y_get_time(void) { - //unsigned char *rtc_base = (unsigned char *) YOSEMITE_RTC_BASE; - unsigned char *rtc_base = (unsigned char *) 0xfc000000UL; unsigned int year, month, day, hour, min, sec; -return; /* Stop the update to the time */ - rtc_base[0x7ff8] = 0x40; + m48t37_base->control = 0x40; - year = BCD2BIN(rtc_base[0x7fff]); - year += BCD2BIN(rtc_base[0x7fff1]) * 100; + year = BCD2BIN(m48t37_base->year); + year += BCD2BIN(m48t37_base->century) * 100; - month = BCD2BIN(rtc_base[0x7ffe]); - day = BCD2BIN(rtc_base[0x7ffd]); - hour = BCD2BIN(rtc_base[0x7ffb]); - min = BCD2BIN(rtc_base[0x7ffa]); - sec = BCD2BIN(rtc_base[0x7ff9]); + month = BCD2BIN(m48t37_base->month); + day = BCD2BIN(m48t37_base->date); + hour = BCD2BIN(m48t37_base->hour); + min = BCD2BIN(m48t37_base->min); + sec = BCD2BIN(m48t37_base->sec); /* Start the update to the time again */ - rtc_base[0x7ff8] = 0x00; + m48t37_base->control = 0x00; return mktime(year, month, day, hour, min, sec); } int m48t37y_set_time(unsigned long sec) { - unsigned char *rtc_base = (unsigned char *) YOSEMITE_RTC_BASE; struct rtc_time tm; -return; /* convert to a more useful format -- note months count from 0 */ to_tm(sec, &tm); tm.tm_mon += 1; /* enable writing */ - rtc_base[0x7ff8] = 0x80; + m48t37_base->control = 0x80; /* year */ - rtc_base[0x7fff] = BIN2BCD(tm.tm_year % 100); - rtc_base[0x7ff1] = BIN2BCD(tm.tm_year / 100); + m48t37_base->year = BIN2BCD(tm.tm_year % 100); + m48t37_base->century = BIN2BCD(tm.tm_year / 100); /* month */ - rtc_base[0x7ffe] = BIN2BCD(tm.tm_mon); + m48t37_base->month = BIN2BCD(tm.tm_mon); /* day */ - rtc_base[0x7ffd] = BIN2BCD(tm.tm_mday); + m48t37_base->date = BIN2BCD(tm.tm_mday); /* hour/min/sec */ - rtc_base[0x7ffb] = BIN2BCD(tm.tm_hour); - rtc_base[0x7ffa] = BIN2BCD(tm.tm_min); - rtc_base[0x7ff9] = BIN2BCD(tm.tm_sec); + m48t37_base->hour = BIN2BCD(tm.tm_hour); + m48t37_base->min = BIN2BCD(tm.tm_min); + m48t37_base->sec = BIN2BCD(tm.tm_sec); /* day of week -- not really used, but let's keep it up-to-date */ - rtc_base[0x7ffc] = BIN2BCD(tm.tm_wday + 1); + m48t37_base->day = BIN2BCD(tm.tm_wday + 1); /* disable writing */ - rtc_base[0x7ff8] = 0x00; + m48t37_base->control = 0x00; return 0; } @@ -136,13 +136,9 @@ void yosemite_time_init(void) { board_timer_setup = yosemite_timer_setup; mips_hpt_frequency = cpu_clock / 2; - - rtc_get_time = m48t37y_get_time; - rtc_set_time = m48t37y_set_time; +mips_hpt_frequency = 33000000 * 3 * 5; } -unsigned long uart_base = 0xfd000000L; - /* No other usable initialization hook than this ... */ extern void (*late_time_init)(void); @@ -161,16 +157,18 @@ EXPORT_SYMBOL(ocd_base); static void __init py_map_ocd(void) { - struct uart_port up; - - /* - * Not specifically interrupt stuff but in case of SMP core_send_ipi - * needs this first so I'm mapping it here ... - */ ocd_base = (unsigned long) ioremap(OCD_BASE, OCD_SIZE); if (!ocd_base) panic("Mapping OCD failed - game over. Your score is 0."); + /* Kludge for PMON bug ... */ + OCD_WRITE(0x0710, 0x0ffff029); +} + +static void __init py_uart_setup(void) +{ + struct uart_port up; + /* * Register to interrupt zero because we share the interrupt with * the serial driver which we don't properly support yet. @@ -188,12 +186,36 @@ static void __init py_map_ocd(void) printk(KERN_ERR "Early serial init of port 0 failed\n"); } -static int __init pmc_yosemite_setup(void) +static void __init py_rtc_setup(void) { - extern void pmon_smp_bootstrap(void); + m48t37_base = ioremap(YOSEMITE_RTC_BASE, YOSEMITE_RTC_SIZE); + if (!m48t37_base) + printk(KERN_ERR "Mapping the RTC failed\n"); + + rtc_get_time = m48t37y_get_time; + rtc_set_time = m48t37y_set_time; + write_seqlock(&xtime_lock); + xtime.tv_sec = m48t37y_get_time(); + xtime.tv_nsec = 0; + + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); + write_sequnlock(&xtime_lock); +} + +/* Not only time init but that's what the hook it's called through is named */ +static void __init py_late_time_init(void) +{ + py_map_ocd(); + py_uart_setup(); + py_rtc_setup(); +} + +static int __init pmc_yosemite_setup(void) +{ board_time_init = yosemite_time_init; - late_time_init = py_map_ocd; + late_time_init = py_late_time_init; /* Add memory regions */ add_memory_region(0x00000000, 0x10000000, BOOT_MEM_RAM); diff --git a/arch/mips/pmc-sierra/yosemite/setup.h b/arch/mips/pmc-sierra/yosemite/setup.h index b3e24b4e6..1a01abfc7 100644 --- a/arch/mips/pmc-sierra/yosemite/setup.h +++ b/arch/mips/pmc-sierra/yosemite/setup.h @@ -1,6 +1,7 @@ /* - * Copyright 2003 PMC-Sierra + * Copyright 2003, 04 PMC-Sierra * Author: Manish Lachwani (lachwani@pmc-sierra.com) + * Copyright 2004 Ralf Baechle * * Board specific definititions for the PMC-Sierra Yosemite * @@ -12,9 +13,9 @@ #ifndef __SETUP_H__ #define __SETUP_H__ -/* NVRAM Base */ -#define YOSEMITE_NVRAM_BASE_ADDR 0xbb000678 /* XXX Need change */ -#define YOSEMITE_RTC_BASE 0xbb000679 /* XXX Need change */ +/* M48T37 RTC + NVRAM */ +#define YOSEMITE_RTC_BASE 0xfc800000 +#define YOSEMITE_RTC_SIZE 0x00800000 #define HYPERTRANSPORT_BAR0_ADDR 0x00000006 #define HYPERTRANSPORT_SIZE0 0x0fffffff diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index 08064f24b..1d3b0734c 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c @@ -1,178 +1,172 @@ +#include +#include + +#include +#include + +extern unsigned int (*mips_hpt_read)(void); +extern void (*mips_hpt_init)(unsigned int); + +#define LAUNCHSTACK_SIZE 256 + +static spinlock_t launch_lock __initdata; + +static unsigned long secondary_sp __initdata; +static unsigned long secondary_gp __initdata; + +static unsigned char launchstack[LAUNCHSTACK_SIZE] __initdata + __attribute__((aligned(2 * sizeof(long)))); + +static void __init prom_smp_bootstrap(void) +{ + local_irq_disable(); + + while (spin_is_locked(&launch_lock)); + + __asm__ __volatile__( + " move $sp, %0 \n" + " move $gp, %1 \n" + " j smp_bootstrap \n" + : + : "r" (secondary_sp), "r" (secondary_gp)); +} + /* - * 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 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. + * PMON is a fragile beast. It'll blow up once the mappings it's littering + * right into the middle of KSEG3 are blown away so we have to grab the slave + * core early and keep it in a waiting loop. */ +void __init prom_grab_secondary(void) +{ + spin_lock(&launch_lock); -#include -#include -#include -#include + pmon_cpustart(1, &prom_smp_bootstrap, + launchstack + LAUNCHSTACK_SIZE, 0); +} -#include -#include +/* + * Detect available CPUs, populate phys_cpu_present_map before smp_init + * + * We don't want to start the secondary CPU yet nor do we have a nice probing + * feature in PMON so we just assume presence of the secondary core. + */ +static char maxcpus_string[] __initdata = + KERN_WARNING "max_cpus set to 0; using 1 instead\n"; -extern void asmlinkage smp_bootstrap(void); +void __init prom_prepare_cpus(unsigned int max_cpus) +{ + int enabled = 0, i; + + if (max_cpus == 0) { + printk(maxcpus_string); + max_cpus = 1; + } + + cpus_clear(phys_cpu_present_map); + + for (i = 0; i < 2; i++) { + if (i == max_cpus) + break; + + /* + * The boot CPU + */ + cpu_set(i, phys_cpu_present_map); + __cpu_number_map[i] = i; + __cpu_logical_map[i] = i; + enabled++; + } + + /* + * Be paranoid. Enable the IPI only if we're really about to go SMP. + */ + if (enabled > 1) + set_c0_status(STATUSF_IP5); +} /* - * Send inter-processor interrupt + * Firmware CPU startup hook + * Complicated by PMON's weird interface which tries to minimic the UNIX fork. + * It launches the next * available CPU and copies some information on the + * stack so the first thing we do is throw away that stuff and load useful + * values into the registers ... */ -void core_send_ipi(int cpu, unsigned int action) +void prom_boot_secondary(int cpu, struct task_struct *idle) +{ + unsigned long gp = (unsigned long) idle->thread_info; + unsigned long sp = gp + THREAD_SIZE - 32; + + secondary_sp = sp; + secondary_gp = gp; + + spin_unlock(&launch_lock); +} + +/* Hook for after all CPUs are online */ +void prom_cpus_done(void) { - /* - * Generate and INTMSG so that it can be sent over to the destination CPU - * The INTMSG will put the STATUS bits based on the action desired - */ - switch(action) { - case SMP_RESCHEDULE_YOURSELF: - /* Do nothing */ - break; - case SMP_CALL_FUNCTION: - if (cpu == 1) - *(volatile uint32_t *)(0xbb000a00) = 0x00610002; - else - *(volatile uint32_t *)(0xbb000a00) = 0x00610001; - break; - - default: - panic("core_send_ipi \n"); - } } /* - * Mailbox interrupt to handle IPI + * After we've done initial boot, this function is called to allow the + * board code to clean up state, if needed */ -void jaguar_mailbox_irq(struct pt_regs *regs) +void prom_init_secondary(void) { - int cpu = smp_processor_id(); + mips_hpt_init(mips_hpt_read()); - /* SMP_CALL_FUNCTION */ - smp_call_function_interrupt(); + set_c0_status(ST0_CO | ST0_IE | ST0_IM); } -extern atomic_t cpus_booted; +void prom_smp_finish(void) +{ +} -void __init start_secondary(void) +asmlinkage void titan_mailbox_irq(struct pt_regs *regs) { - unsigned int cpu = smp_processor_id(); - extern atomic_t smp_commenced; - - if (current->processor != 1) { - printk("Impossible CPU %d \n", cpu); - current->processor = 1; - current->cpus_runnable = 1 << 1; - cpu = current->processor; - } - - if (current->mm) - current->mm = NULL; - - prom_init_secondary(); - per_cpu_trap_init(); - - /* - * XXX parity protection should be folded in here when it's converted - * to an option instead of something based on .cputype - */ - pgd_current[cpu] = init_mm.pgd; - cpu_data[cpu].udelay_val = loops_per_jiffy; - prom_smp_finish(); - CPUMASK_SETB(cpu_online_map, cpu); - atomic_inc(&cpus_booted); - __flush_cache_all(); - - printk("Slave cpu booted successfully \n"); - *(volatile uint32_t *)(0xbb000a68) = 0x00000000; - *(volatile uint32_t *)(0xbb000a68) = 0x80000000; - - while (*(volatile uint32_t *)(0xbb000a68) != 0x00000000); - - return cpu_idle(); + int cpu = smp_processor_id(); + unsigned long status; + + if (cpu == 0) { + status = OCD_READ(RM9000x2_OCD_INTP0STATUS3); + OCD_WRITE(RM9000x2_OCD_INTP0CLEAR3, status); + } + + if (cpu == 1) { + status = OCD_READ(RM9000x2_OCD_INTP1STATUS3); + OCD_WRITE(RM9000x2_OCD_INTP1CLEAR3, status); + } + + if (status & 0x2) + smp_call_function_interrupt(); } -void __init smp_boot_cpus(void) +/* + * Send inter-processor interrupt + */ +void core_send_ipi(int cpu, unsigned int action) { - int i; - int cur_cpu = 0; - - smp_num_cpus = prom_setup_smp(); - printk("Detected %d available CPUs \n", smp_num_cpus); - - init_new_context(current, &init_mm); - current->processor = 0; - cpu_data[0].udelay_val = loops_per_jiffy; - cpu_data[0].asid_cache = ASID_FIRST_VERSION; - CPUMASK_CLRALL(cpu_online_map); - CPUMASK_SETB(cpu_online_map, 0); - atomic_set(&cpus_booted, 1); /* Master CPU is already booted... */ - init_idle(); - - __cpu_number_map[0] = 0; - __cpu_logical_map[0] = 0; - - /* - * This loop attempts to compensate for "holes" in the CPU - * numbering. It's overkill, but general. - */ - for (i = 1; i < smp_num_cpus; ) { - struct task_struct *p; - struct pt_regs regs; - int retval; - printk("Starting CPU %d... \n", i); - - /* Spawn a new process normally. Grab a pointer to - its task struct so we can mess with it */ - do_fork(CLONE_VM|CLONE_PID, 0, ®s, 0); - - p = init_task.prev_task; - if (!p) - panic("failed fork for CPU %d", i); - - /* This is current for the second processor */ - p->processor = i; - p->cpus_runnable = 1 << i; /* we schedule the first task manually */ - p->thread.reg31 = (unsigned long) start_secondary; - - del_from_runqueue(p); - unhash_process(p); - init_tasks[i] = p; - - __flush_cache_all(); - - do { - /* Iterate until we find a CPU that comes up */ - cur_cpu++; - retval = prom_boot_secondary(cur_cpu, - (unsigned long)p + KERNEL_STACK_SIZE - 32, - (unsigned long)p); - - } while (!retval && (cur_cpu < NR_CPUS)); - if (retval) { - __cpu_number_map[cur_cpu] = i; - __cpu_logical_map[i] = cur_cpu; - i++; - } else { - panic("CPU discovery disaster"); - } - } - - /* Local semaphore to both the CPUs */ - - *(volatile uint32_t *)(0xbb000a68) = 0x80000000; - while (*(volatile uint32_t *)(0xbb000a68) != 0x00000000); - - smp_threads_ready = 1; + /* + * Generate an INTMSG so that it can be sent over to the + * destination CPU. The INTMSG will put the STATUS bits + * based on the action desired. An alternative strategy + * is to write to the Interrupt Set register, read the + * Interrupt Status register and clear the Interrupt + * Clear register. The latter is preffered. + */ + switch (action) { + case SMP_RESCHEDULE_YOURSELF: + if (cpu == 1) + OCD_WRITE(RM9000x2_OCD_INTP1SET3, 4); + else + OCD_WRITE(RM9000x2_OCD_INTP0SET3, 4); + break; + + case SMP_CALL_FUNCTION: + if (cpu == 1) + OCD_WRITE(RM9000x2_OCD_INTP1SET3, 2); + else + OCD_WRITE(RM9000x2_OCD_INTP0SET3, 2); + break; + } } diff --git a/arch/mips/sgi-ip22/ip22-berr.c b/arch/mips/sgi-ip22/ip22-berr.c index 943c942d7..a28dc7800 100644 --- a/arch/mips/sgi-ip22/ip22-berr.c +++ b/arch/mips/sgi-ip22/ip22-berr.c @@ -65,7 +65,7 @@ static void print_buserr(void) cpu_err_stat & SGIMC_CSTAT_BAD_DATA ? "BAD_DATA " : "", cpu_err_addr); if (gio_err_stat & GIO_ERRMASK) - printk(KERN_ERR "GIO error 0x%x:<%s%s%s%s%s%s%s%s> @ 0x08%x\n", + printk(KERN_ERR "GIO error 0x%x:<%s%s%s%s%s%s%s%s> @ 0x%08x\n", gio_err_stat, gio_err_stat & SGIMC_GSTAT_RD ? "RD " : "", gio_err_stat & SGIMC_GSTAT_WR ? "WR " : "", diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c index acb44a18d..ea2844d29 100644 --- a/arch/mips/sgi-ip22/ip22-int.c +++ b/arch/mips/sgi-ip22/ip22-int.c @@ -309,7 +309,7 @@ static struct irqaction map1_cascade = { extern void mips_cpu_irq_init(unsigned int irq_base); -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; @@ -371,7 +371,6 @@ void __init init_IRQ(void) set_except_vector(0, indyIRQ); - init_generic_irq(); /* init CPU irqs */ mips_cpu_irq_init(SGINT_CPU); diff --git a/arch/mips/sgi-ip22/ip22-nvram.c b/arch/mips/sgi-ip22/ip22-nvram.c index caa891e69..de43e86fa 100644 --- a/arch/mips/sgi-ip22/ip22-nvram.c +++ b/arch/mips/sgi-ip22/ip22-nvram.c @@ -26,7 +26,7 @@ #define EEPROM_DATO 0x08 /* Data out */ #define EEPROM_DATI 0x10 /* Data in */ -/* We need to use this functions early... */ +/* We need to use these functions early... */ #define delay() ({ \ int x; \ for (x=0; x<100000; x++) __asm__ __volatile__(""); }) diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c index fe7f546d3..0e96a5d67 100644 --- a/arch/mips/sgi-ip22/ip22-setup.c +++ b/arch/mips/sgi-ip22/ip22-setup.c @@ -29,12 +29,6 @@ #include #include -#ifdef CONFIG_KGDB -extern void rs_kgdb_hook(int); -extern void breakpoint(void); -static int remote_debug = 0; -#endif - unsigned long sgi_gfxaddr; /* @@ -43,7 +37,6 @@ unsigned long sgi_gfxaddr; * * FIXME: provide a mechanism to change the value of stop_a_enabled. */ -int serial_console; int stop_a_enabled; void ip22_do_break(void) @@ -63,9 +56,6 @@ extern void ip22_time_init(void) __init; static int __init ip22_setup(void) { char *ctype; -#ifdef CONFIG_KGDB - char *kgdb_ttyd; -#endif board_be_init = ip22_be_init; ip22_time_init(); @@ -84,9 +74,10 @@ static int __init ip22_setup(void) indy_sc_init(); #endif - /* Set EISA IO port base for Indigo2 */ - set_io_port_base(KSEG1ADDR(0x00080000)); - + /* Set EISA IO port base for Indigo2 + * ioremap cannot fail */ + set_io_port_base((unsigned long)ioremap(0x00080000, + 0x1fffffff - 0x00080000)); /* ARCS console environment variable is set to "g?" for * graphics console, it is set to "d" for the first serial * line and "d2" for the second serial line. @@ -106,7 +97,9 @@ static int __init ip22_setup(void) } #ifdef CONFIG_KGDB - kgdb_ttyd = prom_getcmdline(); + { + char *kgdb_ttyd = prom_getcmdline(); + if ((kgdb_ttyd = strstr(kgdb_ttyd, "kgdb=ttyd")) != NULL) { int line; kgdb_ttyd += strlen("kgdb=ttyd"); @@ -121,14 +114,14 @@ static int __init ip22_setup(void) printk(KERN_INFO "KGDB: Using serial line /dev/ttyd%d for " "session, please connect your debugger\n", line ? 1:2); - remote_debug = 1; + kgdb_enabled = 1; /* Breakpoints and stuff are in sgi_irq_setup() */ } + } #endif -#ifdef CONFIG_VT -#ifdef CONFIG_SGI_NEWPORT_CONSOLE - if (ctype && *ctype == 'g'){ +#if defined(CONFIG_VT) && defined(CONFIG_SGI_NEWPORT_CONSOLE) + { ULONG *gfxinfo; ULONG * (*__vec)(void) = (void *) (long) *((_PULONG *)(long)((PROMBLOCK)->pvector + 0x20)); @@ -143,7 +136,6 @@ static int __init ip22_setup(void) conswitchp = &newport_con; } } -#endif #endif return 0; diff --git a/arch/mips/sgi-ip27/Makefile b/arch/mips/sgi-ip27/Makefile index bea4c405c..4ba340780 100644 --- a/arch/mips/sgi-ip27/Makefile +++ b/arch/mips/sgi-ip27/Makefile @@ -6,6 +6,7 @@ obj-y := ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o ip27-irq-glue.o \ ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-reset.o \ ip27-timer.o ip27-hubio.o ip27-xtalk.o +obj-$(CONFIG_KGDB) += ip27-dbgio.o obj-$(CONFIG_SMP) += ip27-smp.o EXTRA_AFLAGS := $(CFLAGS) diff --git a/arch/mips/sgi-ip27/ip27-hubio.c b/arch/mips/sgi-ip27/ip27-hubio.c index 79e0d6c36..524b371f9 100644 --- a/arch/mips/sgi-ip27/ip27-hubio.c +++ b/arch/mips/sgi-ip27/ip27-hubio.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -44,7 +45,7 @@ unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, xtalk_addr &= ~(BWIN_SIZE-1); for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) { - if (test_and_set_bit(i, HUB_DATA(cnode)->h_bigwin_used)) + if (test_and_set_bit(i, hub_data(cnode)->h_bigwin_used)) continue; /* @@ -177,7 +178,7 @@ void hub_pio_init(cnodeid_t cnode) unsigned i; /* initialize big window piomaps for this hub */ - bitmap_zero(HUB_DATA(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW); + bitmap_zero(hub_data(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW); for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) IIO_ITTE_DISABLE(nasid, i); diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index b8ee02cd0..6dcee5c46 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c @@ -10,8 +10,8 @@ #include #include #include -#include /* for numnodes */ #include +#include #include #include #include @@ -40,50 +40,73 @@ #define CPU_NONE (cpuid_t)-1 static DECLARE_BITMAP(hub_init_mask, MAX_COMPACT_NODES); -static hubreg_t region_mask; -static int fine_mode; -static int router_distance; nasid_t master_nasid = INVALID_NASID; cnodeid_t nasid_to_compact_node[MAX_NASIDS]; nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; cnodeid_t cpuid_to_compact_node[MAXCPUS]; -char node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; -static hubreg_t get_region(cnodeid_t cnode) -{ - if (fine_mode) - return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_FINEREG_SHFT; - else - return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_COARSEREG_SHFT; -} +EXPORT_SYMBOL(nasid_to_compact_node); -static void gen_region_mask(hubreg_t *region_mask, int maxnodes) -{ - cnodeid_t cnode; +extern void pcibr_setup(cnodeid_t); - (*region_mask) = 0; - for (cnode = 0; cnode < maxnodes; cnode++) { - (*region_mask) |= 1ULL << get_region(cnode); - } -} +extern void xtalk_probe_node(cnodeid_t nid); -static int is_fine_dirmode(void) +static void __init per_hub_init(cnodeid_t cnode) { - return (((LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK) - >> NSRI_REGIONSIZE_SHFT) & REGIONSIZE_FINE); -} + struct hub_data *hub = hub_data(cnode); + nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); -extern void pcibr_setup(cnodeid_t); + cpu_set(smp_processor_id(), hub->h_cpus); + + if (test_and_set_bit(cnode, hub_init_mask)) + return; + + /* + * Set CRB timeout at 5ms, (< PI timeout of 10ms) + */ + REMOTE_HUB_S(nasid, IIO_ICTP, 0x800); + REMOTE_HUB_S(nasid, IIO_ICTO, 0xff); + + hub_rtc_init(cnode); + xtalk_probe_node(cnode); -static __init void per_slice_init(cnodeid_t cnode, int slice) +#ifdef CONFIG_REPLICATE_EXHANDLERS + /* + * If this is not a headless node initialization, + * copy over the caliased exception handlers. + */ + if (get_compact_nodeid() == cnode) { + extern char except_vec2_generic, except_vec3_generic; + extern void build_tlb_refill_handler(void); + + memcpy((void *)(CKSEG0 + 0x100), &except_vec2_generic, 0x80); + memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x80); + build_tlb_refill_handler(); + memcpy((void *)(CKSEG0 + 0x100), (void *) CKSEG0, 0x80); + memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x100); + __flush_cache_all(); + } +#endif +} + +void __init per_cpu_init(void) { - struct slice_data *si = hub_data[cnode]->slice + slice; int cpu = smp_processor_id(); + int slice = LOCAL_HUB_L(PI_CPU_NUM); + cnodeid_t cnode = get_compact_nodeid(); + struct hub_data *hub = hub_data(cnode); + struct slice_data *si = hub->slice + slice; int i; + if (test_and_set_bit(slice, &hub->slice_map)) + return; + + clear_c0_status(ST0_IM); + for (i = 0; i < LEVELS_PER_SLICE; i++) si->level_to_irq[i] = -1; + /* * Some interrupts are reserved by hardware or by software convention. * Mark these as reserved right away so they won't be used accidently @@ -109,51 +132,16 @@ static __init void per_slice_init(cnodeid_t cnode, int slice) * possible. */ cpu_data[cpu].data = si; -} - -extern void xtalk_probe_node(cnodeid_t nid); - -void __init per_hub_init(cnodeid_t cnode) -{ - struct hub_data *hub = HUB_DATA(cnode); - nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); - int slice = LOCAL_HUB_L(PI_CPU_NUM); - - cpu_set(smp_processor_id(), hub->h_cpus); - if (!test_and_set_bit(slice, &hub->slice_map)) - per_slice_init(cnode, slice); - - if (test_and_set_bit(cnode, hub_init_mask)) - return; - - /* - * Set CRB timeout at 5ms, (< PI timeout of 10ms) - */ - REMOTE_HUB_S(nasid, IIO_ICTP, 0x800); - REMOTE_HUB_S(nasid, IIO_ICTO, 0xff); + cpu_time_init(); + install_ipi(); - hub_rtc_init(cnode); - xtalk_probe_node(cnode); + /* Install our NMI handler if symmon hasn't installed one. */ + install_cpu_nmi_handler(cputoslice(cpu)); -#ifdef CONFIG_REPLICATE_EXHANDLERS - /* - * If this is not a headless node initialization, - * copy over the caliased exception handlers. - */ - if (get_compact_nodeid() == cnode) { - extern char except_vec0, except_vec1_r10k; - extern char except_vec2_generic, except_vec3_generic; + set_c0_status(SRB_DEV0 | SRB_DEV1); - memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80); - memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80); - memcpy((void *)KSEG0, &except_vec0, 0x80); - memcpy((void *)KSEG0 + 0x080, &except_vec1_r10k, 0x80); - memcpy((void *)(KSEG0 + 0x100), (void *) KSEG0, 0x80); - memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x100); - __flush_cache_all(); - } -#endif + per_hub_init(cnode); } /* @@ -174,244 +162,6 @@ cnodeid_t get_compact_nodeid(void) return NASID_TO_COMPACT_NODEID(get_nasid()); } -#define rou_rflag rou_flags - -static void router_recurse(klrou_t *router_a, klrou_t *router_b, int depth) -{ - klrou_t *router; - lboard_t *brd; - int port; - - if (router_a->rou_rflag == 1) - return; - - if (depth >= router_distance) - return; - - router_a->rou_rflag = 1; - - for (port = 1; port <= MAX_ROUTER_PORTS; port++) { - if (router_a->rou_port[port].port_nasid == INVALID_NASID) - continue; - - brd = (lboard_t *)NODE_OFFSET_TO_K0( - router_a->rou_port[port].port_nasid, - router_a->rou_port[port].port_offset); - - if (brd->brd_type == KLTYPE_ROUTER) { - router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); - if (router == router_b) { - if (depth < router_distance) - router_distance = depth; - } - else - router_recurse(router, router_b, depth + 1); - } - } - - router_a->rou_rflag = 0; -} - -int node_distance(nasid_t nasid_a, nasid_t nasid_b) -{ - klrou_t *router, *router_a = NULL, *router_b = NULL; - lboard_t *brd, *dest_brd; - cnodeid_t cnode; - nasid_t nasid; - int port; - - /* Figure out which routers nodes in question are connected to */ - for (cnode = 0; cnode < numnodes; cnode++) { - nasid = COMPACT_TO_NASID_NODEID(cnode); - - if (nasid == -1) continue; - - brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), - KLTYPE_ROUTER); - - if (!brd) - continue; - - do { - if (brd->brd_flags & DUPLICATE_BOARD) - continue; - - router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); - router->rou_rflag = 0; - - for (port = 1; port <= MAX_ROUTER_PORTS; port++) { - if (router->rou_port[port].port_nasid == INVALID_NASID) - continue; - - dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( - router->rou_port[port].port_nasid, - router->rou_port[port].port_offset); - - if (dest_brd->brd_type == KLTYPE_IP27) { - if (dest_brd->brd_nasid == nasid_a) - router_a = router; - if (dest_brd->brd_nasid == nasid_b) - router_b = router; - } - } - - } while ((brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER))); - } - - if (router_a == NULL) { - printk("node_distance: router_a NULL\n"); - return -1; - } - if (router_b == NULL) { - printk("node_distance: router_b NULL\n"); - return -1; - } - - if (nasid_a == nasid_b) - return 0; - - if (router_a == router_b) - return 1; - - router_distance = 100; - router_recurse(router_a, router_b, 2); - - return router_distance; -} - -static void init_topology_matrix(void) -{ - nasid_t nasid, nasid2; - cnodeid_t row, col; - - for (row = 0; row < MAX_COMPACT_NODES; row++) - for (col = 0; col < MAX_COMPACT_NODES; col++) - node_distances[row][col] = -1; - - for (row = 0; row < numnodes; row++) { - nasid = COMPACT_TO_NASID_NODEID(row); - for (col = 0; col < numnodes; col++) { - nasid2 = COMPACT_TO_NASID_NODEID(col); - node_distances[row][col] = node_distance(nasid, nasid2); - } - } -} - -static void dump_topology(void) -{ - nasid_t nasid; - cnodeid_t cnode; - lboard_t *brd, *dest_brd; - int port; - int router_num = 0; - klrou_t *router; - cnodeid_t row, col; - - printk("************** Topology ********************\n"); - - printk(" "); - for (col = 0; col < numnodes; col++) - printk("%02d ", col); - printk("\n"); - for (row = 0; row < numnodes; row++) { - printk("%02d ", row); - for (col = 0; col < numnodes; col++) - printk("%2d ", node_distances[row][col]); - printk("\n"); - } - - for (cnode = 0; cnode < numnodes; cnode++) { - nasid = COMPACT_TO_NASID_NODEID(cnode); - - if (nasid == -1) continue; - - brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), - KLTYPE_ROUTER); - - if (!brd) - continue; - - do { - if (brd->brd_flags & DUPLICATE_BOARD) - continue; - printk("Router %d:", router_num); - router_num++; - - router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); - - for (port = 1; port <= MAX_ROUTER_PORTS; port++) { - if (router->rou_port[port].port_nasid == INVALID_NASID) - continue; - - dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( - router->rou_port[port].port_nasid, - router->rou_port[port].port_offset); - - if (dest_brd->brd_type == KLTYPE_IP27) - printk(" %d", dest_brd->brd_nasid); - if (dest_brd->brd_type == KLTYPE_ROUTER) - printk(" r"); - } - printk("\n"); - - } while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) ); - } -} - -void mlreset(void) -{ - int i; - - master_nasid = get_nasid(); - fine_mode = is_fine_dirmode(); - - /* - * Probe for all CPUs - this creates the cpumask and sets up the - * mapping tables. We need to do this as early as possible. - */ -#ifdef CONFIG_SMP - cpu_node_probe(); -#endif - - init_topology_matrix(); - dump_topology(); - - gen_region_mask(®ion_mask, numnodes); - - setup_replication_mask(numnodes); - - /* - * Set all nodes' calias sizes to 8k - */ - for (i = 0; i < numnodes; i++) { - nasid_t nasid; - - nasid = COMPACT_TO_NASID_NODEID(i); - - /* - * Always have node 0 in the region mask, otherwise - * CALIAS accesses get exceptions since the hub - * thinks it is a node 0 address. - */ - REMOTE_HUB_S(nasid, PI_REGION_PRESENT, (region_mask | 1)); -#ifdef CONFIG_REPLICATE_EXHANDLERS - REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K); -#else - REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_0); -#endif - -#ifdef LATER - /* - * Set up all hubs to have a big window pointing at - * widget 0. Memory mode, widget 0, offset 0 - */ - REMOTE_HUB_S(nasid, IIO_ITTE(SWIN0_BIGWIN), - ((HUB_PIO_MAP_TO_MEM << IIO_ITTE_IOSP_SHIFT) | - (0 << IIO_ITTE_WIDGET_SHIFT))); -#endif - } -} - /* Extracted from the IOC3 meta driver. FIXME. */ static inline void ioc3_sio_init(void) { @@ -444,20 +194,6 @@ static inline void ioc3_eth_init(void) ioc3->eier = 0; } -void __init per_cpu_init(void) -{ - cnodeid_t cnode = get_compact_nodeid(); - int cpu = smp_processor_id(); - - clear_c0_status(ST0_IM); - per_hub_init(cnode); - cpu_time_init(); - install_ipi(); - /* Install our NMI handler if symmon hasn't installed one. */ - install_cpu_nmi_handler(cputoslice(cpu)); - set_c0_status(SRB_DEV0 | SRB_DEV1); -} - extern void ip27_setup_console(void); extern void ip27_time_init(void); extern void ip27_reboot_setup(void); diff --git a/arch/mips/sgi-ip27/ip27-irq-glue.S b/arch/mips/sgi-ip27/ip27-irq-glue.S index 42b22bb18..c304df715 100644 --- a/arch/mips/sgi-ip27/ip27-irq-glue.S +++ b/arch/mips/sgi-ip27/ip27-irq-glue.S @@ -21,7 +21,7 @@ NESTED(ip27_irq, PT_SIZE, sp) mfc0 t0, CP0_STATUS and s0, t0 move a0, sp - la ra, ret_from_irq + PTR_LA ra, ret_from_irq /* First check for RT interrupt. */ andi t0, s0, CAUSEF_IP4 diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 917c1ee7a..61817a18a 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -14,14 +14,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include -#include #include #include #include @@ -151,9 +152,6 @@ void ip27_do_irq_mask0(struct pt_regs *regs) if (!pend0) return; - /* Prevent any of the picked intrs from recursing */ - LOCAL_HUB_S(pi_int_mask0, mask0 & ~pend0); - swlevel = ms1bit(pend0); #ifdef CONFIG_SMP if (pend0 & (1UL << CPU_RESCHED_A_IRQ)) { @@ -176,11 +174,6 @@ void ip27_do_irq_mask0(struct pt_regs *regs) do_IRQ(irq, regs); } - /* clear bit in pend0 */ - pend0 ^= 1UL << swlevel; - - /* Now allow the set of serviced intrs again */ - LOCAL_HUB_S(pi_int_mask0, mask0); LOCAL_HUB_L(PI_INT_PEND0); } @@ -200,19 +193,12 @@ void ip27_do_irq_mask1(struct pt_regs *regs) if (!pend1) return; - /* Prevent any of the picked intrs from recursing */ - LOCAL_HUB_S(pi_int_mask1, mask1 & ~pend1); - swlevel = ms1bit(pend1); /* "map" swlevel to irq */ irq = si->level_to_irq[swlevel]; LOCAL_HUB_CLR_INTR(swlevel); do_IRQ(irq, regs); - /* clear bit in pend1 */ - pend1 ^= 1UL << swlevel; - /* Now allow the set of serviced intrs again */ - LOCAL_HUB_S(pi_int_mask1, mask1); LOCAL_HUB_L(PI_INT_PEND1); } @@ -233,9 +219,6 @@ static int intr_connect_level(int cpu, int bit) __set_bit(bit, si->irq_enable_mask); - /* Make sure it's not already pending when we connect it. */ - REMOTE_HUB_CLR_INTR(nasid, bit); - if (!cputoslice(cpu)) { REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]); REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]); @@ -272,6 +255,7 @@ static unsigned int startup_bridge_irq(unsigned int irq) bridgereg_t device; bridge_t *bridge; int pin, swlevel; + cpuid_t cpu; pin = SLOT_FROM_PCI_IRQ(irq); bc = IRQ_TO_BRIDGE(irq); @@ -282,13 +266,10 @@ static unsigned int startup_bridge_irq(unsigned int irq) * "map" irq to a swlevel greater than 6 since the first 6 bits * of INT_PEND0 are taken */ - swlevel = alloc_level(bc->irq_cpu, irq); - intr_connect_level(bc->irq_cpu, swlevel); - + swlevel = find_level(&cpu, irq); bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (bc->nasid << 8)); bridge->b_int_enable |= (1 << pin); - /* more stuff in int_enable reg */ - bridge->b_int_enable |= 0x7ffffe00; + bridge->b_int_enable |= 0x7ffffe00; /* more stuff in int_enable */ /* * Enable sending of an interrupt clear packt to the hub on a high to @@ -308,7 +289,7 @@ static unsigned int startup_bridge_irq(unsigned int irq) device |= (pin << (pin*3)); bridge->b_int_device = device; - bridge->b_widget.w_tflush; /* Flush */ + bridge->b_wid_tflush; return 0; /* Never anything pending. */ } @@ -336,26 +317,37 @@ static void shutdown_bridge_irq(unsigned int irq) si->level_to_irq[swlevel] = -1; bridge->b_int_enable &= ~(1 << pin); - bridge->b_widget.w_tflush; /* Flush */ + bridge->b_wid_tflush; } static inline void enable_bridge_irq(unsigned int irq) { - /* All the braindamage happens magically for us in ip27_do_irq */ + cpuid_t cpu; + int swlevel; + + swlevel = find_level(&cpu, irq); /* Criminal offence */ + intr_connect_level(cpu, swlevel); } -static void disable_bridge_irq(unsigned int irq) +static inline void disable_bridge_irq(unsigned int irq) { - /* All the braindamage happens magically for us in ip27_do_irq */ + cpuid_t cpu; + int swlevel; + + swlevel = find_level(&cpu, irq); /* Criminal offence */ + intr_disconnect_level(cpu, swlevel); } static void mask_and_ack_bridge_irq(unsigned int irq) { - /* All the braindamage happens magically for us in ip27_do_irq */ + disable_bridge_irq(irq); } static void end_bridge_irq(unsigned int irq) { + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) && + irq_desc[irq].action) + enable_bridge_irq(irq); } static struct hw_interrupt_type bridge_irq_type = { @@ -370,15 +362,15 @@ static struct hw_interrupt_type bridge_irq_type = { static unsigned long irq_map[NR_IRQS / BITS_PER_LONG]; -unsigned int allocate_irqno(void) +static int allocate_irqno(void) { int irq; again: - irq = find_first_zero_bit(irq_map, LEVELS_PER_SLICE); + irq = find_first_zero_bit(irq_map, NR_IRQS); if (irq >= NR_IRQS) - return -1; + return -ENOSPC; if (test_and_set_bit(irq, irq_map)) goto again; @@ -391,21 +383,49 @@ void free_irqno(unsigned int irq) clear_bit(irq, irq_map); } -void __init init_IRQ(void) +void __devinit register_bridge_irq(unsigned int irq) { - int i; + irq_desc[irq].status = IRQ_DISABLED; + irq_desc[irq].action = 0; + irq_desc[irq].depth = 1; + irq_desc[irq].handler = &bridge_irq_type; +} - set_except_vector(0, ip27_irq); +int __devinit request_bridge_irq(struct bridge_controller *bc) +{ + int irq = allocate_irqno(); + int swlevel, cpu; + nasid_t nasid; + + if (irq < 0) + return irq; /* - * Right now the bridge irq is our kitchen sink interrupt type + * "map" irq to a swlevel greater than 6 since the first 6 bits + * of INT_PEND0 are taken */ - for (i = 0; i <= NR_IRQS; i++) { - irq_desc[i].status = IRQ_DISABLED; - irq_desc[i].action = 0; - irq_desc[i].depth = 1; - irq_desc[i].handler = &bridge_irq_type; + cpu = bc->irq_cpu; + swlevel = alloc_level(cpu, irq); + if (unlikely(swlevel < 0)) { + free_irqno(irq); + + return -EAGAIN; } + + /* Make sure it's not already pending when we connect it. */ + nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu)); + REMOTE_HUB_CLR_INTR(nasid, swlevel); + + intr_connect_level(cpu, swlevel); + + register_bridge_irq(irq); + + return irq; +} + +void __init arch_init_irq(void) +{ + set_except_vector(0, ip27_irq); } void install_ipi(void) diff --git a/arch/mips/sgi-ip27/ip27-klnuma.c b/arch/mips/sgi-ip27/ip27-klnuma.c index b5e86ad98..41c3f405e 100644 --- a/arch/mips/sgi-ip27/ip27-klnuma.c +++ b/arch/mips/sgi-ip27/ip27-klnuma.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include -extern char _end; static cpumask_t ktext_repmask; /* @@ -27,33 +27,25 @@ static cpumask_t ktext_repmask; * kernel. For example, we should never put a copy on a headless node, * and we should respect the topology of the machine. */ -void __init setup_replication_mask(int maxnodes) +void __init setup_replication_mask() { - static int numa_kernel_replication_ratio; cnodeid_t cnode; /* Set only the master cnode's bit. The master cnode is always 0. */ cpus_clear(ktext_repmask); cpu_set(0, ktext_repmask); - numa_kernel_replication_ratio = 0; #ifdef CONFIG_REPLICATE_KTEXT #ifndef CONFIG_MAPPED_KERNEL #error Kernel replication works with mapped kernel support. No calias support. #endif - numa_kernel_replication_ratio = 1; -#endif - - for (cnode = 1; cnode < numnodes; cnode++) { - /* See if this node should get a copy of the kernel */ - if (numa_kernel_replication_ratio && - !(cnode % numa_kernel_replication_ratio)) { - - /* Advertise that we have a copy of the kernel */ - cpu_set(cnode, ktext_repmask); - } + for_each_online_node(cnode) { + if (cnode == 0) + continue; + /* Advertise that we have a copy of the kernel */ + cpu_set(cnode, ktext_repmask); } - +#endif /* Set up a GDA pointer to the replication mask. */ GDA->g_ktext_repmask = &ktext_repmask; } @@ -61,12 +53,12 @@ void __init setup_replication_mask(int maxnodes) static __init void set_ktext_source(nasid_t client_nasid, nasid_t server_nasid) { - kern_vars_t *kvp; cnodeid_t client_cnode; + kern_vars_t *kvp; client_cnode = NASID_TO_COMPACT_NODEID(client_nasid); - kvp = &(HUB_DATA(client_nasid)->kern_vars); + kvp = &hub_data(client_nasid)->kern_vars; KERN_VARS_ADDR(client_nasid) = (unsigned long)kvp; @@ -92,7 +84,7 @@ static __init void copy_kernel(nasid_t dest_nasid) memcpy((void *)dest_kern_start, (void *)source_start, kern_size); } -void __init replicate_kernel_text(int maxnodes) +void __init replicate_kernel_text() { cnodeid_t cnode; nasid_t client_nasid; @@ -103,7 +95,9 @@ void __init replicate_kernel_text(int maxnodes) /* Record where the master node should get its kernel text */ set_ktext_source(master_nasid, master_nasid); - for (cnode = 1; cnode < maxnodes; cnode++) { + for_each_online_node(cnode) { + if (cnode == 0) + continue; client_nasid = COMPACT_TO_NASID_NODEID(cnode); /* Check if this node should get a copy of the kernel */ @@ -124,12 +118,12 @@ void __init replicate_kernel_text(int maxnodes) */ pfn_t node_getfirstfree(cnodeid_t cnode) { - unsigned long loadbase = CKSEG0; + unsigned long loadbase = REP_BASE; nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); unsigned long offset; #ifdef CONFIG_MAPPED_KERNEL - loadbase = CKSSEG + 16777216; + loadbase += 16777216; #endif offset = PAGE_ALIGN((unsigned long)(&_end)) - loadbase; if ((cnode == 0) || (cpu_isset(cnode, ktext_repmask))) diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c index e3cdb9582..0a44a98d7 100644 --- a/arch/mips/sgi-ip27/ip27-memory.c +++ b/arch/mips/sgi-ip27/ip27-memory.c @@ -3,17 +3,20 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 by Ralf Baechle + * Copyright (C) 2000, 05 by Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2000 by Silicon Graphics, Inc. * Copyright (C) 2004 by Christoph Hellwig * * On SGI IP27 the ARC memory configuration data is completly bogus but * alternate easier to use mechanisms are available. */ +#include #include #include #include #include +#include +#include #include #include #include @@ -36,8 +39,226 @@ static short __initdata slot_lastfilled_cache[MAX_COMPACT_NODES]; static unsigned short __initdata slot_psize_cache[MAX_COMPACT_NODES][MAX_MEM_SLOTS]; static struct bootmem_data __initdata plat_node_bdata[MAX_COMPACT_NODES]; -struct pglist_data *node_data[MAX_COMPACT_NODES]; -struct hub_data *hub_data[MAX_COMPACT_NODES]; +struct node_data *__node_data[MAX_COMPACT_NODES]; + +EXPORT_SYMBOL(__node_data); + +static int fine_mode; + +static int is_fine_dirmode(void) +{ + return (((LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK) + >> NSRI_REGIONSIZE_SHFT) & REGIONSIZE_FINE); +} + +static hubreg_t get_region(cnodeid_t cnode) +{ + if (fine_mode) + return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_FINEREG_SHFT; + else + return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_COARSEREG_SHFT; +} + +static hubreg_t region_mask; + +static void gen_region_mask(hubreg_t *region_mask) +{ + cnodeid_t cnode; + + (*region_mask) = 0; + for_each_online_node(cnode) { + (*region_mask) |= 1ULL << get_region(cnode); + } +} + +#define rou_rflag rou_flags + +static int router_distance; + +static void router_recurse(klrou_t *router_a, klrou_t *router_b, int depth) +{ + klrou_t *router; + lboard_t *brd; + int port; + + if (router_a->rou_rflag == 1) + return; + + if (depth >= router_distance) + return; + + router_a->rou_rflag = 1; + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router_a->rou_port[port].port_nasid == INVALID_NASID) + continue; + + brd = (lboard_t *)NODE_OFFSET_TO_K0( + router_a->rou_port[port].port_nasid, + router_a->rou_port[port].port_offset); + + if (brd->brd_type == KLTYPE_ROUTER) { + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + if (router == router_b) { + if (depth < router_distance) + router_distance = depth; + } + else + router_recurse(router, router_b, depth + 1); + } + } + + router_a->rou_rflag = 0; +} + +unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; + +static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b) +{ + klrou_t *router, *router_a = NULL, *router_b = NULL; + lboard_t *brd, *dest_brd; + cnodeid_t cnode; + nasid_t nasid; + int port; + + /* Figure out which routers nodes in question are connected to */ + for_each_online_node(cnode) { + nasid = COMPACT_TO_NASID_NODEID(cnode); + + if (nasid == -1) continue; + + brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), + KLTYPE_ROUTER); + + if (!brd) + continue; + + do { + if (brd->brd_flags & DUPLICATE_BOARD) + continue; + + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + router->rou_rflag = 0; + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router->rou_port[port].port_nasid == INVALID_NASID) + continue; + + dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( + router->rou_port[port].port_nasid, + router->rou_port[port].port_offset); + + if (dest_brd->brd_type == KLTYPE_IP27) { + if (dest_brd->brd_nasid == nasid_a) + router_a = router; + if (dest_brd->brd_nasid == nasid_b) + router_b = router; + } + } + + } while ((brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER))); + } + + if (router_a == NULL) { + printk("node_distance: router_a NULL\n"); + return -1; + } + if (router_b == NULL) { + printk("node_distance: router_b NULL\n"); + return -1; + } + + if (nasid_a == nasid_b) + return 0; + + if (router_a == router_b) + return 1; + + router_distance = 100; + router_recurse(router_a, router_b, 2); + + return router_distance; +} + +static void __init init_topology_matrix(void) +{ + nasid_t nasid, nasid2; + cnodeid_t row, col; + + for (row = 0; row < MAX_COMPACT_NODES; row++) + for (col = 0; col < MAX_COMPACT_NODES; col++) + __node_distances[row][col] = -1; + + for_each_online_node(row) { + nasid = COMPACT_TO_NASID_NODEID(row); + for_each_online_node(col) { + nasid2 = COMPACT_TO_NASID_NODEID(col); + __node_distances[row][col] = + compute_node_distance(nasid, nasid2); + } + } +} + +static void __init dump_topology(void) +{ + nasid_t nasid; + cnodeid_t cnode; + lboard_t *brd, *dest_brd; + int port; + int router_num = 0; + klrou_t *router; + cnodeid_t row, col; + + printk("************** Topology ********************\n"); + + printk(" "); + for_each_online_node(col) + printk("%02d ", col); + printk("\n"); + for_each_online_node(row) { + printk("%02d ", row); + for_each_online_node(col) + printk("%2d ", node_distance(row, col)); + printk("\n"); + } + + for_each_online_node(cnode) { + nasid = COMPACT_TO_NASID_NODEID(cnode); + + if (nasid == -1) continue; + + brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), + KLTYPE_ROUTER); + + if (!brd) + continue; + + do { + if (brd->brd_flags & DUPLICATE_BOARD) + continue; + printk("Router %d:", router_num); + router_num++; + + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router->rou_port[port].port_nasid == INVALID_NASID) + continue; + + dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( + router->rou_port[port].port_nasid, + router->rou_port[port].port_offset); + + if (dest_brd->brd_type == KLTYPE_IP27) + printk(" %d", dest_brd->brd_nasid); + if (dest_brd->brd_type == KLTYPE_ROUTER) + printk(" r"); + } + printk("\n"); + + } while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) ); + } +} static pfn_t __init slot_getbasepfn(cnodeid_t cnode, int slot) { @@ -126,6 +347,60 @@ static pfn_t __init slot_psize_compute(cnodeid_t node, int slot) } } +static void __init mlreset(void) +{ + int i; + + master_nasid = get_nasid(); + fine_mode = is_fine_dirmode(); + + /* + * Probe for all CPUs - this creates the cpumask and sets up the + * mapping tables. We need to do this as early as possible. + */ +#ifdef CONFIG_SMP + cpu_node_probe(); +#endif + + init_topology_matrix(); + dump_topology(); + + gen_region_mask(®ion_mask); + + setup_replication_mask(); + + /* + * Set all nodes' calias sizes to 8k + */ + for_each_online_node(i) { + nasid_t nasid; + + nasid = COMPACT_TO_NASID_NODEID(i); + + /* + * Always have node 0 in the region mask, otherwise + * CALIAS accesses get exceptions since the hub + * thinks it is a node 0 address. + */ + REMOTE_HUB_S(nasid, PI_REGION_PRESENT, (region_mask | 1)); +#ifdef CONFIG_REPLICATE_EXHANDLERS + REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_8K); +#else + REMOTE_HUB_S(nasid, PI_CALIAS_SIZE, PI_CALIAS_SIZE_0); +#endif + +#ifdef LATER + /* + * Set up all hubs to have a big window pointing at + * widget 0. Memory mode, widget 0, offset 0 + */ + REMOTE_HUB_S(nasid, IIO_ITTE(SWIN0_BIGWIN), + ((HUB_PIO_MAP_TO_MEM << IIO_ITTE_IOSP_SHIFT) | + (0 << IIO_ITTE_WIDGET_SHIFT))); +#endif + } +} + static void __init szmem(void) { pfn_t slot_psize, slot0sz = 0, nodebytes; /* Hack to detect problem configs */ @@ -134,7 +409,7 @@ static void __init szmem(void) num_physpages = 0; - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { ignore = nodebytes = 0; for (slot = 0; slot < MAX_MEM_SLOTS; slot++) { slot_psize = slot_psize_compute(node, slot); @@ -164,6 +439,45 @@ static void __init szmem(void) } } +static void __init node_mem_init(cnodeid_t node) +{ + pfn_t slot_firstpfn = slot_getbasepfn(node, 0); + pfn_t slot_lastpfn = slot_firstpfn + slot_getsize(node, 0); + pfn_t slot_freepfn = node_getfirstfree(node); + struct pglist_data *pd; + unsigned long bootmap_size; + + /* + * Allocate the node data structures on the node first. + */ + __node_data[node] = __va(slot_freepfn << PAGE_SHIFT); + + pd = NODE_DATA(node); + pd->bdata = &plat_node_bdata[node]; + + cpus_clear(hub_data(node)->h_cpus); + + slot_freepfn += PFN_UP(sizeof(struct pglist_data) + + sizeof(struct hub_data)); + + bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn, + slot_firstpfn, slot_lastpfn); + free_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, + (slot_lastpfn - slot_firstpfn) << PAGE_SHIFT); + reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, + ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size); +} + +/* + * A node with nothing. We use it to avoid any special casing in + * node_to_cpumask + */ +static struct node_data null_node = { + .hub = { + .h_cpus = CPU_MASK_NONE + } +}; + /* * Currently, the intranode memory hole support assumes that each slot * contains at least 32 MBytes of memory. We assume all bootmem data @@ -176,31 +490,12 @@ void __init prom_meminit(void) mlreset(); szmem(); - for (node = 0; node < numnodes; node++) { - pfn_t slot_firstpfn = slot_getbasepfn(node, 0); - pfn_t slot_lastpfn = slot_firstpfn + slot_getsize(node, 0); - pfn_t slot_freepfn = node_getfirstfree(node); - unsigned long bootmap_size; - - /* - * Allocate the node data structures on the node first. - */ - node_data[node] = __va(slot_freepfn << PAGE_SHIFT); - node_data[node]->bdata = &plat_node_bdata[node]; - - hub_data[node] = (struct hub_data *)(node_data[node] + 1); - - cpus_clear(hub_data[node]->h_cpus); - - slot_freepfn += PFN_UP(sizeof(struct pglist_data) + - sizeof(struct hub_data)); - - bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn, - slot_firstpfn, slot_lastpfn); - free_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, - (slot_lastpfn - slot_firstpfn) << PAGE_SHIFT); - reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, - ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size); + for (node = 0; node < MAX_COMPACT_NODES; node++) { + if (node_online(node)) { + node_mem_init(node); + continue; + } + __node_data[node] = &null_node; } } @@ -220,7 +515,7 @@ void __init paging_init(void) pagetable_init(); - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { pfn_t start_pfn = slot_getbasepfn(node, 0); pfn_t end_pfn = node_getmaxclick(node) + 1; @@ -240,7 +535,7 @@ void __init mem_init(void) high_memory = (void *) __va(num_physpages << PAGE_SHIFT); - for (node = 0; node < numnodes; node++) { + for_each_online_node(node) { unsigned slot, numslots; struct page *end, *p; diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c index da8ed29df..b0a25e1ee 100644 --- a/arch/mips/sgi-ip27/ip27-nmi.c +++ b/arch/mips/sgi-ip27/ip27-nmi.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -21,7 +22,7 @@ typedef unsigned long machreg_t; -spinlock_t nmi_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(nmi_lock); /* * Lets see what else we need to do here. Set up sp, gp? @@ -183,7 +184,7 @@ nmi_eframes_save(void) { cnodeid_t cnode; - for(cnode = 0 ; cnode < numnodes; cnode++) + for_each_online_node(cnode) nmi_node_eframe_save(cnode); } @@ -214,13 +215,13 @@ cont_nmi_dump(void) * send NMIs to all cpus on a 256p system. */ for (i=0; i < 1500; i++) { - for (node=0; node < numnodes; node++) + for_each_online_node(node) if (NODEPDA(node)->dump_count == 0) break; - if (node == numnodes) + if (node == MAX_NUMNODES) break; if (i == 1000) { - for (node=0; node < numnodes; node++) + for_each_online_node(node) if (NODEPDA(node)->dump_count == 0) { cpu = node_to_first_cpu(node); for (n=0; n < CNODE_NUM_CPUS(node); cpu++, n++) { diff --git a/arch/mips/sgi-ip27/ip27-reset.c b/arch/mips/sgi-ip27/ip27-reset.c index aa19dc136..2e16be94c 100644 --- a/arch/mips/sgi-ip27/ip27-reset.c +++ b/arch/mips/sgi-ip27/ip27-reset.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -43,7 +44,7 @@ static void ip27_machine_restart(char *command) smp_send_stop(); #endif #if 0 - for (i = 0; i < numnodes; i++) + for_each_online_node(i) REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG, PROMOP_REBOOT); #else @@ -59,7 +60,7 @@ static void ip27_machine_halt(void) #ifdef CONFIG_SMP smp_send_stop(); #endif - for (i = 0; i < numnodes; i++) + for_each_online_node(i) REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG, PROMOP_RESTART); LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET); diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index 1e5ce4ca2..17f768cba 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c @@ -8,6 +8,7 @@ */ #include #include +#include #include #include #include @@ -108,22 +109,22 @@ void cpu_node_probe(void) for (i = 0; i < MAXCPUS; i++) cpuid_to_compact_node[i] = INVALID_CNODEID; - numnodes = 0; + /* + * MCD - this whole "compact node" stuff can probably be dropped, + * as we can handle sparse numbering now + */ + nodes_clear(node_online_map); for (i = 0; i < MAX_COMPACT_NODES; i++) { nasid_t nasid = gdap->g_nasidtable[i]; if (nasid == INVALID_NASID) break; compact_to_nasid_node[i] = nasid; nasid_to_compact_node[nasid] = i; - numnodes++; + node_set_online(num_online_nodes()); highest = do_cpumask(i, nasid, highest); } - printk("Discovered %d cpus on %d nodes\n", highest + 1, numnodes); -} - -void __init prom_build_cpu_map(void) -{ + printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes()); } static void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend, @@ -155,13 +156,10 @@ void __init prom_prepare_cpus(unsigned int max_cpus) { cnodeid_t cnode; - for (cnode = 0; cnode < numnodes; cnode++) + for_each_online_node(cnode) intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); - /* Master has already done per_cpu_init() */ - install_ipi(); - - replicate_kernel_text(numnodes); + replicate_kernel_text(); /* * Assumption to be fixed: we're always booted on logical / physical diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index cc0419ad7..8c1b96fff 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c @@ -1,9 +1,8 @@ /* - * Copytight (C) 1999, 2000 Ralf Baechle (ralf@gnu.org) + * Copytight (C) 1999, 2000, 05 Ralf Baechle (ralf@linux-mips.org) * Copytight (C) 1999, 2000 Silicon Graphics, Inc. */ #include -#include #include #include #include @@ -112,9 +111,7 @@ again: if (cpu == 0) do_timer(regs); -#ifdef CONFIG_SMP update_process_times(user_mode(regs)); -#endif /* CONFIG_SMP */ /* * If we have an externally synchronized Linux clock, then update diff --git a/arch/mips/sgi-ip32/Makefile b/arch/mips/sgi-ip32/Makefile index 1b6f93d16..470898f4a 100644 --- a/arch/mips/sgi-ip32/Makefile +++ b/arch/mips/sgi-ip32/Makefile @@ -4,6 +4,6 @@ # obj-y += ip32-berr.o ip32-irq.o ip32-irq-glue.o ip32-setup.o ip32-reset.o \ - crime.o + crime.o ip32-memory.o EXTRA_AFLAGS := $(CFLAGS) diff --git a/arch/mips/sgi-ip32/crime.c b/arch/mips/sgi-ip32/crime.c index a8c7a776a..eb3a16a04 100644 --- a/arch/mips/sgi-ip32/crime.c +++ b/arch/mips/sgi-ip32/crime.c @@ -4,33 +4,35 @@ * for more details. * * Copyright (C) 2001, 2003 Keith M Wesolowski + * Copyright (C) 2005 Ilya A. Volynets */ #include #include #include #include #include +#include #include #include #include #include #include -void *sgi_crime; +struct sgi_crime *crime; struct sgi_mace *mace; void __init crime_init(void) { unsigned int id, rev; const int field = 2 * sizeof(unsigned long); - - sgi_crime = ioremap(CRIME_BASE, 1); + + set_io_port_base((unsigned long) ioremap(MACEPCI_LOW_IO, 0x2000000)); + crime = ioremap(CRIME_BASE, sizeof(struct sgi_crime)); mace = ioremap(MACE_BASE, sizeof(struct sgi_mace)); - id = crime_read(CRIME_ID); + id = crime->id; rev = id & CRIME_ID_REV; id = (id & CRIME_ID_IDBITS) >> 4; - printk (KERN_INFO "CRIME id %1x rev %d at 0x%0*lx\n", id, rev, field, (unsigned long) CRIME_BASE); } @@ -41,19 +43,18 @@ crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) unsigned long stat, addr; int fatal = 0; - stat = crime_read(CRIME_MEM_ERROR_STAT) & CRIME_MEM_ERROR_STAT_MASK; - addr = crime_read(CRIME_MEM_ERROR_ADDR) & CRIME_MEM_ERROR_ADDR_MASK; + stat = crime->mem_error_stat & CRIME_MEM_ERROR_STAT_MASK; + addr = crime->mem_error_addr & CRIME_MEM_ERROR_ADDR_MASK; printk("CRIME memory error at 0x%08lx ST 0x%08lx<", addr, stat); if (stat & CRIME_MEM_ERROR_INV) printk("INV,"); if (stat & CRIME_MEM_ERROR_ECC) { - unsigned long ecc_syn = crime_read(CRIME_MEM_ERROR_ECC_SYN) & - CRIME_MEM_ERROR_ECC_SYN_MASK; - unsigned long ecc_gen = crime_read(CRIME_MEM_ERROR_ECC_CHK) & - CRIME_MEM_ERROR_ECC_CHK_MASK; - + unsigned long ecc_syn = + crime->mem_ecc_syn & CRIME_MEM_ERROR_ECC_SYN_MASK; + unsigned long ecc_gen = + crime->mem_ecc_chk & CRIME_MEM_ERROR_ECC_CHK_MASK; printk("ECC,SYN=0x%08lx,GEN=0x%08lx,", ecc_syn, ecc_gen); } if (stat & CRIME_MEM_ERROR_MULTIPLE) { @@ -77,7 +78,7 @@ crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) if (stat & CRIME_MEM_ERROR_MACE_ACCESS) printk("MACE,MACEID=0x%02lx,", stat & CRIME_MEM_ERROR_MACE_ID); - crime_write(0, CRIME_MEM_ERROR_STAT); + crime->mem_error_stat = 0; if (fatal) { printk("FATAL>\n"); @@ -91,15 +92,12 @@ crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) irqreturn_t crime_cpuerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) { - unsigned long stat = crime_read(CRIME_CPU_ERROR_STAT) & - CRIME_CPU_ERROR_MASK; - uint64_t addr = crime_read(CRIME_CPU_ERROR_ADDR) & - CRIME_CPU_ERROR_ADDR_MASK; - addr <<= 2; + unsigned long stat = crime->cpu_error_stat & CRIME_CPU_ERROR_MASK; + unsigned long addr = crime->cpu_error_addr & CRIME_CPU_ERROR_ADDR_MASK; + addr <<= 2; printk ("CRIME CPU error at 0x%09lx status 0x%08lx\n", addr, stat); - - crime_write(0, CRIME_CPU_ERROR_STAT); + crime->cpu_error_stat = 0; return IRQ_HANDLED; } diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c index 75846d6e8..fc3a8e90d 100644 --- a/arch/mips/sgi-ip32/ip32-irq.c +++ b/arch/mips/sgi-ip32/ip32-irq.c @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -30,10 +29,14 @@ #include /* issue a PIO read to make sure no PIO writes are pending */ -#define flush_crime_bus() crime_read(CRIME_CONTROL); +static void inline flush_crime_bus(void) +{ + volatile unsigned long junk = crime->control; +} + static void inline flush_mace_bus(void) { - volatile unsigned long junk = mace_perif_ctrl_read(misc); + volatile unsigned long junk = mace->perif.ctrl.misc; } #undef DEBUG_IRQ @@ -114,7 +117,7 @@ static void inline flush_mace_bus(void) * IRQ spinlock - Ralf says not to disable CPU interrupts, * and I think he knows better. */ -static spinlock_t ip32_irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ip32_irq_lock); /* Some initial interrupts to set up */ extern irqreturn_t crime_memerr_intr (int irq, void *dev_id, @@ -183,7 +186,7 @@ static void enable_crime_irq(unsigned int irq) spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask |= 1 << (irq - 1); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -199,7 +202,7 @@ static void disable_crime_irq(unsigned int irq) spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask &= ~(1 << (irq - 1)); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; flush_crime_bus(); spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -214,9 +217,9 @@ static void mask_and_ack_crime_irq(unsigned int irq) || (irq >= CRIME_SOFT0_IRQ && irq <= CRIME_SOFT2_IRQ)) { uint64_t crime_int; spin_lock_irqsave(&ip32_irq_lock, flags); - crime_int = crime_read(CRIME_HARD_INT); + crime_int = crime->hard_int; crime_int &= ~(1 << (irq - 1)); - crime_write(crime_int, CRIME_HARD_INT); + crime->hard_int = crime_int; spin_unlock_irqrestore(&ip32_irq_lock, flags); } disable_crime_irq(irq); @@ -257,7 +260,7 @@ static void enable_macepci_irq(unsigned int irq) macepci_mask |= MACEPCI_CONTROL_INT(irq - 9); mace->pci.control = macepci_mask; crime_mask |= 1 << (irq - 1); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -273,7 +276,7 @@ static void disable_macepci_irq(unsigned int irq) spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask &= ~(1 << (irq - 1)); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; flush_crime_bus(); macepci_mask &= ~MACEPCI_CONTROL_INT(irq - 9); mace->pci.control = macepci_mask; @@ -361,9 +364,9 @@ static void enable_maceisa_irq (unsigned int irq) DBG ("crime_int %08x enabled\n", crime_int); spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask |= crime_int; - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; maceisa_mask |= 1 << (irq - 33); - mace_perif_ctrl_write(maceisa_mask, imask); + mace->perif.ctrl.imask = maceisa_mask; spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -387,9 +390,9 @@ static void disable_maceisa_irq(unsigned int irq) if(!(maceisa_mask & MACEISA_SUPERIO_INT)) crime_int |= MACE_SUPERIO_INT; crime_mask &= ~crime_int; - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; flush_crime_bus(); - mace_perif_ctrl_write(maceisa_mask, imask); + mace->perif.ctrl.imask = maceisa_mask; flush_mace_bus(); spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -404,9 +407,9 @@ static void mask_and_ack_maceisa_irq(unsigned int irq) case MACEISA_SERIAL2_TDMAPR_IRQ: /* edge triggered */ spin_lock_irqsave(&ip32_irq_lock, flags); - mace_int = mace_perif_ctrl_read(istat); + mace_int = mace->perif.ctrl.istat; mace_int &= ~(1 << (irq - 33)); - mace_perif_ctrl_write(mace_int, istat); + mace->perif.ctrl.istat = mace_int; spin_unlock_irqrestore(&ip32_irq_lock, flags); break; } @@ -442,7 +445,7 @@ static void enable_mace_irq(unsigned int irq) spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask |= 1 << (irq - 1); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -458,7 +461,7 @@ static void disable_mace_irq(unsigned int irq) spin_lock_irqsave(&ip32_irq_lock, flags); crime_mask &= ~(1 << (irq - 1)); - crime_write(crime_mask, CRIME_INT_MASK); + crime->imask = crime_mask; flush_crime_bus(); spin_unlock_irqrestore(&ip32_irq_lock, flags); } @@ -485,19 +488,14 @@ static struct hw_interrupt_type ip32_mace_interrupt = { static void ip32_unknown_interrupt(struct pt_regs *regs) { - uint64_t crime; - printk ("Unknown interrupt occurred!\n"); printk ("cp0_status: %08x\n", read_c0_status()); printk ("cp0_cause: %08x\n", read_c0_cause()); - crime = crime_read(CRIME_INT_MASK); - printk ("CRIME intr mask: %016lx\n", crime); - crime = crime_read(CRIME_INT_STAT); - printk ("CRIME intr status: %016lx\n", crime); - crime = crime_read(CRIME_HARD_INT); - printk ("CRIME hardware intr register: %016lx\n", crime); - printk ("MACE ISA intr mask: %08lx\n", mace_perif_ctrl_read(imask)); - printk ("MACE ISA intr status: %08lx\n", mace_perif_ctrl_read(istat)); + printk ("CRIME intr mask: %016lx\n", crime->imask); + printk ("CRIME intr status: %016lx\n", crime->istat); + printk ("CRIME hardware intr register: %016lx\n", crime->hard_int); + printk ("MACE ISA intr mask: %08lx\n", mace->perif.ctrl.imask); + printk ("MACE ISA intr status: %08lx\n", mace->perif.ctrl.istat); printk ("MACE PCI control register: %08x\n", mace->pci.control); printk("Register dump:\n"); @@ -515,12 +513,12 @@ void ip32_irq0(struct pt_regs *regs) uint64_t crime_int; int irq = 0; - crime_int = crime_read(CRIME_INT_STAT) & crime_mask; + crime_int = crime->istat & crime_mask; irq = ffs(crime_int); crime_int = 1 << (irq - 1); if (crime_int & CRIME_MACEISA_INT_MASK) { - unsigned long mace_int = mace_perif_ctrl_read(istat); + unsigned long mace_int = mace->perif.ctrl.istat; irq = ffs(mace_int & maceisa_mask) + 32; } DBG("*irq %u*\n", irq); @@ -552,18 +550,17 @@ void ip32_irq5(struct pt_regs *regs) ll_timer_interrupt(IP32_R4K_TIMER_IRQ, regs); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { unsigned int irq; - init_generic_irq(); /* Install our interrupt handler, then clear and disable all * CRIME and MACE interrupts. */ - crime_write(0, CRIME_INT_MASK); - crime_write(0, CRIME_HARD_INT); - crime_write(0, CRIME_SOFT_INT); - mace_perif_ctrl_write(0, istat); - mace_perif_ctrl_write(0, imask); + crime->imask = 0; + crime->hard_int = 0; + crime->soft_int = 0; + mace->perif.ctrl.istat = 0; + mace->perif.ctrl.imask = 0; set_except_vector(0, ip32_handle_int); for (irq = 0; irq <= IP32_IRQ_MAX; irq++) { diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c index ac65798bd..281f090e4 100644 --- a/arch/mips/sgi-ip32/ip32-reset.c +++ b/arch/mips/sgi-ip32/ip32-reset.c @@ -41,7 +41,7 @@ static void ip32_machine_power_off(void) __attribute__((noreturn)); static void ip32_machine_restart(char *cmd) { - crime_write(CRIME_CONTROL_HARD_RESET, CRIME_CONTROL); + crime->control = CRIME_CONTROL_HARD_RESET; while (1); } @@ -83,9 +83,9 @@ static void power_timeout(unsigned long data) static void blink_timeout(unsigned long data) { - unsigned long led = mace_perif_ctrl_read(misc) ^ MACEISA_LED_RED; - mace_perif_ctrl_write(led, misc); - mod_timer(&blink_timer, jiffies+data); + unsigned long led = mace->perif.ctrl.misc ^ MACEISA_LED_RED; + mace->perif.ctrl.misc = led; + mod_timer(&blink_timer, jiffies + data); } static void debounce(unsigned long data) @@ -165,8 +165,8 @@ static int panic_event(struct notifier_block *this, unsigned long event, has_paniced = 1; /* turn off the green LED */ - led = mace_perif_ctrl_read(misc) | MACEISA_LED_GREEN; - mace_perif_ctrl_write(led, misc); + led = mace->perif.ctrl.misc | MACEISA_LED_GREEN; + mace->perif.ctrl.misc = led; blink_timer.data = PANIC_FREQ; blink_timeout(PANIC_FREQ); @@ -181,19 +181,21 @@ static struct notifier_block panic_block = { static __init int ip32_reboot_setup(void) { /* turn on the green led only */ - unsigned long led = mace_perif_ctrl_read(misc); + unsigned long led = mace->perif.ctrl.misc; led |= MACEISA_LED_RED; led &= ~MACEISA_LED_GREEN; - mace_perif_ctrl_write(led, misc); + mace->perif.ctrl.misc = led; _machine_restart = ip32_machine_restart; _machine_halt = ip32_machine_halt; _machine_power_off = ip32_machine_power_off; - request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL); + init_timer(&blink_timer); blink_timer.function = blink_timeout; notifier_chain_register(&panic_notifier_list, &panic_block); + request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL); + return 0; } diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c index 51cad2d84..8d270be58 100644 --- a/arch/mips/sgi-ip32/ip32-setup.c +++ b/arch/mips/sgi-ip32/ip32-setup.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 2000 Harald Koerfgen - * Copyright (C) 2002, 03 Ilya A. Volynets + * Copyright (C) 2002, 2003, 2005 Ilya A. Volynets */ #include #include @@ -80,8 +80,8 @@ void __init ip32_time_init(void) { printk(KERN_INFO "Calibrating system timer... "); write_c0_count(0); - crime_write(0, CRIME_TIMER); - while (crime_read(CRIME_TIMER) < CRIME_MASTER_FREQ * WAIT_MS / 1000) ; + crime->timer = 0; + while (crime->timer < CRIME_MASTER_FREQ * WAIT_MS / 1000) ; mips_hpt_frequency = read_c0_count() * 1000 / WAIT_MS; printk("%d MHz CPU detected\n", mips_hpt_frequency * 2 / 1000000); } @@ -94,10 +94,6 @@ void __init ip32_timer_setup(struct irqaction *irq) static int __init ip32_setup(void) { - set_io_port_base((unsigned long) ioremap(MACEPCI_LOW_IO, 0x2000000)); - - crime_init(); - board_be_init = ip32_be_init; rtc_get_time = mc146818_get_cmos_time; @@ -114,7 +110,7 @@ static int __init ip32_setup(void) o2_serial[0].type = PORT_16550A; o2_serial[0].line = 0; o2_serial[0].irq = MACEISA_SERIAL1_IRQ; - o2_serial[0].flags = STD_COM_FLAGS | UPF_RESOURCES; + o2_serial[0].flags = STD_COM_FLAGS; o2_serial[0].uartclk = BASE_BAUD * 16; o2_serial[0].iotype = UPIO_MEM; o2_serial[0].membase = (char *)&mace->isa.serial1; @@ -125,7 +121,7 @@ static int __init ip32_setup(void) o2_serial[1].type = PORT_16550A; o2_serial[1].line = 1; o2_serial[1].irq = MACEISA_SERIAL2_IRQ; - o2_serial[1].flags = STD_COM_FLAGS | UPF_RESOURCES; + o2_serial[1].flags = STD_COM_FLAGS; o2_serial[1].uartclk = BASE_BAUD * 16; o2_serial[1].iotype = UPIO_MEM; o2_serial[1].membase = (char *)&mace->isa.serial2; diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c index 3dd85d5ba..d6d0364fa 100644 --- a/arch/mips/sibyte/cfe/setup.c +++ b/arch/mips/sibyte/cfe/setup.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -55,36 +56,45 @@ int cfe_cons_handle; #ifdef CONFIG_BLK_DEV_INITRD extern unsigned long initrd_start, initrd_end; -extern void * __rd_start, * __rd_end; -#endif - -#ifdef CONFIG_SMP -static int reboot_smp = 0; #endif #ifdef CONFIG_KGDB extern int kgdb_port; #endif -static void cfe_linux_exit(void) +static void ATTRIB_NORET cfe_linux_exit(void *arg) { -#ifdef CONFIG_SMP + int warm = *(int *)arg; + if (smp_processor_id()) { - if (reboot_smp) { - /* Don't repeat the process from another CPU */ - for (;;); - } else { + static int reboot_smp; + + /* Don't repeat the process from another CPU */ + if (!reboot_smp) { /* Get CPU 0 to do the cfe_exit */ reboot_smp = 1; - smp_call_function((void *)_machine_restart, NULL, 1, 0); - for (;;); + smp_call_function(cfe_linux_exit, arg, 1, 0); } + } else { + printk("Passing control back to CFE...\n"); + cfe_exit(warm, 0); + printk("cfe_exit returned??\n"); } -#endif - printk("passing control back to CFE\n"); - cfe_exit(1, 0); - printk("cfe_exit returned??\n"); - while(1); + while (1); +} + +static void ATTRIB_NORET cfe_linux_restart(char *command) +{ + static const int zero; + + cfe_linux_exit((void *)&zero); +} + +static void ATTRIB_NORET cfe_linux_halt(void) +{ + static const int one = 1; + + cfe_linux_exit((void *)&one); } static __init void prom_meminit(void) @@ -97,17 +107,6 @@ static __init void prom_meminit(void) unsigned long initrd_pstart; unsigned long initrd_pend; -#ifdef CONFIG_EMBEDDED_RAMDISK - /* If we're using an embedded ramdisk, then __rd_start and __rd_end - are defined by the linker to be on either side of the ramdisk - area. Otherwise, initrd_start should be defined by kernel command - line arguments */ - if (initrd_start == 0) { - initrd_start = (unsigned long)&__rd_start; - initrd_end = (unsigned long)&__rd_end; - } -#endif - initrd_pstart = CPHYSADDR(initrd_start); initrd_pend = CPHYSADDR(initrd_end); if (initrd_start && @@ -247,9 +246,9 @@ void __init prom_init(void) char *arg; #endif - _machine_restart = (void (*)(char *))cfe_linux_exit; - _machine_halt = cfe_linux_exit; - _machine_power_off = cfe_linux_exit; + _machine_restart = cfe_linux_restart; + _machine_halt = cfe_linux_halt; + _machine_power_off = cfe_linux_halt; /* * Check if a loader was used; if NOT, the 4 arguments are diff --git a/arch/mips/sibyte/cfe/smp.c b/arch/mips/sibyte/cfe/smp.c index fada7042e..73392190d 100644 --- a/arch/mips/sibyte/cfe/smp.c +++ b/arch/mips/sibyte/cfe/smp.c @@ -28,8 +28,10 @@ * Use CFE to find out how many CPUs are available, setting up * phys_cpu_present_map and the logical/physical mappings. * XXXKW will the boot CPU ever not be physical 0? + * + * Common setup before any secondaries are started */ -void __init prom_build_cpu_map(void) +void __init prom_prepare_cpus(unsigned int max_cpus) { int i, num; @@ -48,13 +50,6 @@ void __init prom_build_cpu_map(void) printk("Detected %i available secondary CPU(s)\n", num); } -/* - * Common setup before any secondaries are started - */ -void prom_prepare_cpus(unsigned int max_cpus) -{ -} - /* * Setup the PC, SP, and GP of a secondary processor and start it * running! diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c index d3d593010..7f813ae9e 100644 --- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c +++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c @@ -64,24 +64,24 @@ static void arm_tb(void) u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL; /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to trigger start of trace. XXX vary sampling period */ - __raw_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); - scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); + bus_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); + scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); /* Unfortunately, in Pass 2 we must clear all counters to knock down a previous interrupt request. This means that bus profiling requires ALL of the SCD perf counters. */ - __raw_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | // keep counters 0,2,3 as is + bus_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | // keep counters 0,2,3 as is M_SPC_CFG_ENABLE | // enable counting M_SPC_CFG_CLEAR | // clear all counters V_SPC_CFG_SRC1(1), // counter 1 counts cycles - IOADDR(A_SCD_PERF_CNT_CFG)); - __raw_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); + IOADDR(A_SCD_PERF_CNT_CFG)); + bus_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); /* Reset the trace buffer */ - __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); + bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); #if 0 && defined(M_SCD_TRACE_CFG_FORCECNT) /* XXXKW may want to expose control to the data-collector */ tb_options |= M_SCD_TRACE_CFG_FORCECNT; #endif - __raw_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG)); + bus_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG)); sbp.tb_armed = 1; } @@ -93,22 +93,23 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs) /* XXX should use XKPHYS to make writes bypass L2 */ u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; /* Read out trace */ - __raw_writeq(M_SCD_TRACE_CFG_START_READ, IOADDR(A_SCD_TRACE_CFG)); + bus_writeq(M_SCD_TRACE_CFG_START_READ, IOADDR(A_SCD_TRACE_CFG)); __asm__ __volatile__ ("sync" : : : "memory"); /* Loop runs backwards because bundles are read out in reverse order */ for (i = 256 * 6; i > 0; i -= 6) { // Subscripts decrease to put bundle in the order // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi - p[i-1] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 hi - p[i-2] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 lo - p[i-3] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 hi - p[i-4] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 lo - p[i-5] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 hi - p[i-6] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 lo + p[i-1] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 hi + p[i-2] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 lo + p[i-3] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 hi + p[i-4] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 lo + p[i-5] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 hi + p[i-6] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 lo } if (!sbp.tb_enable) { DBG(printk(DEVNAME ": tb_intr shutdown\n")); - __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); + bus_writeq(M_SCD_TRACE_CFG_RESET, + IOADDR(A_SCD_TRACE_CFG)); sbp.tb_armed = 0; wake_up(&sbp.tb_sync); } else { @@ -117,7 +118,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs) } else { /* No more trace buffer samples */ DBG(printk(DEVNAME ": tb_intr full\n")); - __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); + bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); sbp.tb_armed = 0; if (!sbp.tb_enable) { wake_up(&sbp.tb_sync); @@ -151,13 +152,13 @@ int sbprof_zbprof_start(struct file *filp) return -EBUSY; } /* Make sure there isn't a perf-cnt interrupt waiting */ - scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); + scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); /* Disable and clear counters, override SRC_1 */ - __raw_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) | + bus_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) | M_SPC_CFG_ENABLE | M_SPC_CFG_CLEAR | V_SPC_CFG_SRC1(1), - IOADDR(A_SCD_PERF_CNT_CFG)); + IOADDR(A_SCD_PERF_CNT_CFG)); /* We grab this interrupt to prevent others from trying to use it, even though we don't want to service the interrupts @@ -171,52 +172,55 @@ int sbprof_zbprof_start(struct file *filp) /* I need the core to mask these, but the interrupt mapper to pass them through. I am exploiting my knowledge that cp0_status masks out IP[5]. krw */ - __raw_writeq(K_INT_MAP_I3, - IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + (K_INT_PERF_CNT<<3))); + bus_writeq(K_INT_MAP_I3, + IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + + (K_INT_PERF_CNT << 3))); /* Initialize address traps */ - __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_0)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_1)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_2)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_3)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_0)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_1)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_2)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_3)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2)); - __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2)); + bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); /* Initialize Trace Event 0-7 */ // when interrupt - __raw_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); + bus_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6)); + bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); /* Initialize Trace Sequence 0-7 */ // Start on event 0 (interrupt) - __raw_writeq(V_SCD_TRSEQ_FUNC_START|0x0fff, - IOADDR(A_SCD_TRACE_SEQUENCE_0)); + bus_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff, + IOADDR(A_SCD_TRACE_SEQUENCE_0)); // dsamp when d used | asamp when a used - __raw_writeq(M_SCD_TRSEQ_ASAMPLE|M_SCD_TRSEQ_DSAMPLE|K_SCD_TRSEQ_TRIGGER_ALL, - IOADDR(A_SCD_TRACE_SEQUENCE_1)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6)); - __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7)); + bus_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE | + K_SCD_TRSEQ_TRIGGER_ALL, + IOADDR(A_SCD_TRACE_SEQUENCE_1)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6)); + bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7)); /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */ - __raw_writeq((1ULL << K_INT_PERF_CNT), IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE))); + bus_writeq((1ULL << K_INT_PERF_CNT), + IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE))); arm_tb(); diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c index 828c97bd6..182a16f42 100644 --- a/arch/mips/sibyte/sb1250/bus_watcher.c +++ b/arch/mips/sibyte/sb1250/bus_watcher.c @@ -188,7 +188,8 @@ static irqreturn_t sibyte_bw_int(int irq, void *data, struct pt_regs *regs) csr_out32(M_SCD_TRACE_CFG_START_READ, IOADDR(A_SCD_TRACE_CFG)); for (i=0; i<256*6; i++) - printk("%016llx\n", (unsigned long long)__raw_readq(IOADDR(A_SCD_TRACE_READ))); + printk("%016llx\n", + (unsigned long long)bus_readq(IOADDR(A_SCD_TRACE_READ))); csr_out32(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); csr_out32(M_SCD_TRACE_CFG_START, IOADDR(A_SCD_TRACE_CFG)); diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index ddbe64b2d..2728abbc9 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c @@ -61,19 +61,8 @@ extern unsigned long ldt_eoi_space; #endif #ifdef CONFIG_KGDB -#include -extern void breakpoint(void); static int kgdb_irq; -/* 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_SIBYTE_SB1250_DUART @@ -99,7 +88,7 @@ static struct hw_interrupt_type sb1250_irq_type = { /* Store the CPU id (not the logical number) */ int sb1250_irq_owner[SB1250_NR_IRQS]; -spinlock_t sb1250_imr_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(sb1250_imr_lock); void sb1250_mask_irq(int cpu, int irq) { @@ -107,9 +96,11 @@ void sb1250_mask_irq(int cpu, int irq) u64 cur_ints; spin_lock_irqsave(&sb1250_imr_lock, flags); - cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); cur_ints |= (((u64) 1) << irq); - ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); spin_unlock_irqrestore(&sb1250_imr_lock, flags); } @@ -119,9 +110,11 @@ void sb1250_unmask_irq(int cpu, int irq) u64 cur_ints; spin_lock_irqsave(&sb1250_imr_lock, flags); - cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); cur_ints &= ~(((u64) 1) << irq); - ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); spin_unlock_irqrestore(&sb1250_imr_lock, flags); } @@ -156,19 +149,23 @@ static void sb1250_set_affinity(unsigned int irq, unsigned long mask) /* Swizzle each CPU's IMR (but leave the IP selection alone) */ old_cpu = sb1250_irq_owner[irq]; - cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(old_cpu) + R_IMR_INTERRUPT_MASK)); + cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(old_cpu) + + R_IMR_INTERRUPT_MASK)); int_on = !(cur_ints & (((u64) 1) << irq)); if (int_on) { /* If it was on, mask it */ cur_ints |= (((u64) 1) << irq); - ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) + R_IMR_INTERRUPT_MASK)); + __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) + + R_IMR_INTERRUPT_MASK)); } sb1250_irq_owner[irq] = cpu; if (int_on) { /* unmask for the new CPU */ - cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); cur_ints &= ~(((u64) 1) << irq); - ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK)); + __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + + R_IMR_INTERRUPT_MASK)); } spin_unlock(&sb1250_imr_lock); spin_unlock_irqrestore(&desc->lock, flags); @@ -211,8 +208,8 @@ static void ack_sb1250_irq(unsigned int irq) * deliver the interrupts to all CPUs (which makes affinity * changing easier for us) */ - pending = __raw_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq], - R_IMR_LDT_INTERRUPT))); + pending = bus_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq], + R_IMR_LDT_INTERRUPT))); pending &= ((u64)1 << (irq)); if (pending) { int i; @@ -227,8 +224,9 @@ static void ack_sb1250_irq(unsigned int irq) * Clear for all CPUs so an affinity switch * doesn't find an old status */ - __raw_writeq(pending, - IOADDR(A_IMR_REGISTER(cpu, R_IMR_LDT_INTERRUPT_CLR))); + bus_writeq(pending, + IOADDR(A_IMR_REGISTER(cpu, + R_IMR_LDT_INTERRUPT_CLR))); } /* @@ -307,10 +305,10 @@ int sb1250_steal_irq(int irq) } /* - * init_IRQ is called early in the boot sequence from init/main.c. It - * is responsible for setting up the interrupt mapper and installing the - * handler that will be responsible for dispatching interrupts to the - * "right" place. + * arch_init_irq is called early in the boot sequence from init/main.c via + * init_IRQ. It is responsible for setting up the interrupt mapper and + * installing the handler that will be responsible for dispatching interrupts + * to the "right" place. */ /* * For now, map all interrupts to IP[2]. We could save @@ -332,7 +330,7 @@ int sb1250_steal_irq(int irq) #define IMR_IP5_VAL K_INT_MAP_I3 #define IMR_IP6_VAL K_INT_MAP_I4 -void __init init_IRQ(void) +void __init arch_init_irq(void) { unsigned int i; @@ -342,14 +340,12 @@ void __init init_IRQ(void) /* Default everything to IP2 */ for (i = 0; i < SB1250_NR_IRQS; i++) { /* was I0 */ - __raw_writeq(IMR_IP2_VAL, - IOADDR(A_IMR_REGISTER(0, - R_IMR_INTERRUPT_MAP_BASE) + - (i << 3))); - __raw_writeq(IMR_IP2_VAL, - IOADDR(A_IMR_REGISTER(1, - R_IMR_INTERRUPT_MAP_BASE) + - (i << 3))); + bus_writeq(IMR_IP2_VAL, + IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + + (i << 3))); + bus_writeq(IMR_IP2_VAL, + IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + + (i << 3))); } init_sb1250_irqs(); @@ -359,21 +355,23 @@ void __init init_IRQ(void) * inter-cpu messages */ /* Was I1 */ - __raw_writeq(IMR_IP3_VAL, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + - (K_INT_MBOX_0 << 3))); - __raw_writeq(IMR_IP3_VAL, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + - (K_INT_MBOX_0 << 3))); + bus_writeq(IMR_IP3_VAL, + IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + + (K_INT_MBOX_0 << 3))); + bus_writeq(IMR_IP3_VAL, + IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + + (K_INT_MBOX_0 << 3))); /* Clear the mailboxes. The firmware may leave them dirty */ - __raw_writeq(0xffffffffffffffff, - IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU))); - __raw_writeq(0xffffffffffffffff, - IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU))); + bus_writeq(0xffffffffffffffffULL, + IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU))); + bus_writeq(0xffffffffffffffffULL, + IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU))); /* Mask everything except the mailbox registers for both cpus */ tmp = ~((u64) 0) ^ (((u64) 1) << K_INT_MBOX_0); - __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK))); - __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK))); + bus_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK))); + bus_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK))); sb1250_steal_irq(K_INT_MBOX_0); @@ -398,17 +396,13 @@ void __init init_IRQ(void) sb1250_duart_present[kgdb_port] = 0; #endif /* Setup uart 1 settings, mapper */ - __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); + bus_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); sb1250_steal_irq(kgdb_irq); - __raw_writeq(IMR_IP6_VAL, - IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + - (kgdb_irq<<3))); + bus_writeq(IMR_IP6_VAL, + IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + + (kgdb_irq<<3))); sb1250_unmask_irq(0, kgdb_irq); - - prom_printf("Waiting for GDB on UART port %d\n", kgdb_port); - set_debug_traps(); - breakpoint(); } #endif } diff --git a/arch/mips/sibyte/sb1250/irq_handler.S b/arch/mips/sibyte/sb1250/irq_handler.S index ad6c6b055..60edc8fb3 100644 --- a/arch/mips/sibyte/sb1250/irq_handler.S +++ b/arch/mips/sibyte/sb1250/irq_handler.S @@ -18,8 +18,8 @@ /* * sb1250_handle_int() is the routine that is actually called when an interrupt - * occurs. It is installed as the exception vector handler in init_IRQ() in - * arch/mips/sibyte/sb1250/irq.c + * occurs. It is installed as the exception vector handler in arch_init_irq() + * in arch/mips/sibyte/sb1250/irq.c * * In the handle we figure out which interrupts need handling, and use that to * call the dispatcher, which will take care of actually calling registered @@ -123,7 +123,7 @@ * check the 1250 interrupt registers to figure out what to do * Need to detect which CPU we're on, now that smp_affinity is supported. */ - PTR_LA v0, KSEG1 + A_IMR_CPU0_BASE + PTR_LA v0, CKSEG1 + A_IMR_CPU0_BASE #ifdef CONFIG_SMP lw t1, TI_CPU($28) sll t1, IMR_REGISTER_SPACING_SHIFT diff --git a/arch/mips/sibyte/sb1250/prom.c b/arch/mips/sibyte/sb1250/prom.c index 426fb3014..de62ab0f5 100644 --- a/arch/mips/sibyte/sb1250/prom.c +++ b/arch/mips/sibyte/sb1250/prom.c @@ -23,16 +23,11 @@ #include #include #include +#include #include #include -#ifdef CONFIG_EMBEDDED_RAMDISK -/* These are symbols defined by the ramdisk linker script */ -extern unsigned char __rd_start; -extern unsigned char __rd_end; -#endif - #define MAX_RAM_SIZE ((CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - 1) static __init void prom_meminit(void) @@ -41,17 +36,6 @@ static __init void prom_meminit(void) unsigned long initrd_pstart; unsigned long initrd_pend; -#ifdef CONFIG_EMBEDDED_RAMDISK - /* If we're using an embedded ramdisk, then __rd_start and __rd_end - are defined by the linker to be on either side of the ramdisk - area. Otherwise, initrd_start should be defined by kernel command - line arguments */ - if (initrd_start == 0) { - initrd_start = (unsigned long)&__rd_start; - initrd_end = (unsigned long)&__rd_end; - } -#endif - initrd_pstart = __pa(initrd_start); initrd_pend = __pa(initrd_end); if (initrd_start && diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c index df2e266c7..f8c605be9 100644 --- a/arch/mips/sibyte/sb1250/setup.c +++ b/arch/mips/sibyte/sb1250/setup.c @@ -153,7 +153,7 @@ void sb1250_setup(void) int bad_config = 0; sb1_pass = read_c0_prid() & 0xff; - sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); + sys_rev = bus_readq(IOADDR(A_SCD_SYSTEM_REVISION)); soc_type = SYS_SOC_TYPE(sys_rev); soc_pass = G_SYS_REVISION(sys_rev); @@ -162,7 +162,7 @@ void sb1250_setup(void) machine_restart(NULL); } - plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); + plldiv = G_SYS_PLL_DIV(bus_readq(IOADDR(A_SCD_SYSTEM_CFG))); zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index d510b31c7..be91b3990 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c @@ -73,7 +73,7 @@ void sb1250_smp_finish(void) */ void core_send_ipi(int cpu, unsigned int action) { - __raw_writeq((((u64)action)<< 48), mailbox_set_regs[cpu]); + bus_writeq((((u64)action) << 48), mailbox_set_regs[cpu]); } void sb1250_mailbox_interrupt(struct pt_regs *regs) @@ -83,10 +83,10 @@ void sb1250_mailbox_interrupt(struct pt_regs *regs) kstat_this_cpu.irqs[K_INT_MBOX_0]++; /* Load the mailbox register to figure out what we're supposed to do */ - action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff; + action = (__bus_readq(mailbox_regs[cpu]) >> 48) & 0xffff; /* Clear the mailbox to clear the interrupt */ - ____raw_writeq(((u64)action)<<48, mailbox_clear_regs[cpu]); + __bus_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]); /* * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c index eb8ff64e9..8b4c848c9 100644 --- a/arch/mips/sibyte/sb1250/time.c +++ b/arch/mips/sibyte/sb1250/time.c @@ -67,21 +67,24 @@ void sb1250_time_init(void) sb1250_mask_irq(cpu, irq); /* Map the timer interrupt to ip[4] of this cpu */ - __raw_writeq(IMR_IP4_VAL, IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + - (irq << 3))); + bus_writeq(IMR_IP4_VAL, + IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + + (irq << 3))); /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */ /* Disable the timer and set up the count */ - __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); + bus_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); #ifdef CONFIG_SIMULATION - __raw_writeq(50000 / HZ, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); + bus_writeq(50000 / HZ, + IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); #else - __raw_writeq(1000000/HZ, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); + bus_writeq(1000000/HZ, + IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); #endif /* Set the timer running */ - __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, - IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); + bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, + IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); sb1250_unmask_irq(cpu, irq); sb1250_steal_irq(irq); @@ -102,8 +105,8 @@ void sb1250_timer_interrupt(struct pt_regs *regs) int irq = K_INT_TIMER_0 + cpu; /* Reset the timer */ - ____raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, - IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); + __bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, + IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); /* * CPU 0 handles the global timer interrupt job @@ -127,7 +130,7 @@ void sb1250_timer_interrupt(struct pt_regs *regs) unsigned long sb1250_gettimeoffset(void) { unsigned long count = - __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); + bus_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); return 1000000/HZ - count; } diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c index b615e118f..0e633ee8d 100644 --- a/arch/mips/sibyte/swarm/rtc_m41t81.c +++ b/arch/mips/sibyte/swarm/rtc_m41t81.c @@ -82,57 +82,59 @@ #define M41T81REG_SQW 0x13 /* square wave register */ #define M41T81_CCR_ADDRESS 0x68 -#define SMB_CSR(reg) (IOADDR(A_SMB_REGISTER(1, reg))) +#define SMB_CSR(reg) ((u8 *) (IOADDR(A_SMB_REGISTER(1, reg)))) static int m41t81_read(uint8_t addr) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq(addr & 0xff, SMB_CSR(R_SMB_CMD)); - __raw_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR1BYTE), SMB_CSR(R_SMB_START)); + bus_writeq(addr & 0xff, SMB_CSR(R_SMB_CMD)); + bus_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR1BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), SMB_CSR(R_SMB_START)); + bus_writeq((V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } - return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff); + return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); } static int m41t81_write(uint8_t addr, int b) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((addr & 0xFF), SMB_CSR(R_SMB_CMD)); - __raw_writeq((b & 0xff), SMB_CSR(R_SMB_DATA)); - __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR2BYTE, - SMB_CSR(R_SMB_START)); + bus_writeq((addr & 0xFF), SMB_CSR(R_SMB_CMD)); + bus_writeq((b & 0xff), SMB_CSR(R_SMB_DATA)); + bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_WR2BYTE, + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } /* read the same byte again to make sure it is written */ - __raw_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE, - SMB_CSR(R_SMB_START)); + bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE, + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; return 0; diff --git a/arch/mips/sibyte/swarm/rtc_xicor1241.c b/arch/mips/sibyte/swarm/rtc_xicor1241.c index 52f6030e9..981d21f16 100644 --- a/arch/mips/sibyte/swarm/rtc_xicor1241.c +++ b/arch/mips/sibyte/swarm/rtc_xicor1241.c @@ -57,50 +57,52 @@ #define X1241_CCR_ADDRESS 0x6F -#define SMB_CSR(reg) (IOADDR(A_SMB_REGISTER(1, reg))) +#define SMB_CSR(reg) ((u8 *) (IOADDR(A_SMB_REGISTER(1, reg)))) static int xicor_read(uint8_t addr) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); - __raw_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); - __raw_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), SMB_CSR(R_SMB_START)); + bus_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); + bus_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); + bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), SMB_CSR(R_SMB_START)); + bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } - return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff); + return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); } static int xicor_write(uint8_t addr, int b) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq(addr, SMB_CSR(R_SMB_CMD)); - __raw_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); - __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, - SMB_CSR(R_SMB_START)); + bus_writeq(addr, SMB_CSR(R_SMB_CMD)); + bus_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); + bus_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } else { return 0; diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c index 638da0903..457aeb7be 100644 --- a/arch/mips/sibyte/swarm/setup.c +++ b/arch/mips/sibyte/swarm/setup.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation + * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,6 +27,9 @@ #include #include #include +#include +#include +#include #include #include @@ -34,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -83,8 +86,6 @@ int swarm_be_handler(struct pt_regs *regs, int is_fixup) static int __init swarm_setup(void) { - extern int panic_timeout; - sb1250_setup(); panic_timeout = 5; /* For debug. */ diff --git a/arch/mips/sibyte/swarm/time.c b/arch/mips/sibyte/swarm/time.c index 20f858c5b..c1f1a9def 100644 --- a/arch/mips/sibyte/swarm/time.c +++ b/arch/mips/sibyte/swarm/time.c @@ -79,46 +79,48 @@ static unsigned int usec_bias = 0; static int xicor_read(uint8_t addr) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); - __raw_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); - __raw_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), SMB_CSR(R_SMB_START)); + bus_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD)); + bus_writeq((addr & 0xff), SMB_CSR(R_SMB_DATA)); + bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), SMB_CSR(R_SMB_START)); + bus_writeq((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } - return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff); + return (bus_readq(SMB_CSR(R_SMB_DATA)) & 0xff); } static int xicor_write(uint8_t addr, int b) { - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - __raw_writeq(addr, SMB_CSR(R_SMB_CMD)); - __raw_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); - __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, - SMB_CSR(R_SMB_START)); + bus_writeq(addr, SMB_CSR(R_SMB_CMD)); + bus_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA)); + bus_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE, + SMB_CSR(R_SMB_START)); - while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) + while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) ; - if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { + if (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ - __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); + bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); return -1; } else { return 0; @@ -226,8 +228,8 @@ void __init swarm_time_init(void) /* Establish communication with the Xicor 1241 RTC */ /* XXXKW how do I share the SMBus with the I2C subsystem? */ - __raw_writeq(K_SMB_FREQ_400KHZ, SMB_CSR(R_SMB_FREQ)); - __raw_writeq(0, SMB_CSR(R_SMB_CONTROL)); + bus_writeq(K_SMB_FREQ_400KHZ, SMB_CSR(R_SMB_FREQ)); + bus_writeq(0, SMB_CSR(R_SMB_CONTROL)); if ((status = xicor_read(X1241REG_SR_RTCF)) < 0) { printk("x1241: couldn't detect on SWARM SMBus 1\n"); diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c index caa44d1d9..62c760f14 100644 --- a/arch/mips/sni/irq.c +++ b/arch/mips/sni/irq.c @@ -17,7 +17,7 @@ #include #include -spinlock_t pciasic_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(pciasic_lock); extern asmlinkage void sni_rm200_pci_handle_int(void); @@ -173,13 +173,12 @@ void __init init_pciasic(void) * driver compatibility reasons interrupts 0 - 15 to be the i8295 * interrupts even if the hardware uses a different interrupt numbering. */ -void __init init_IRQ (void) +void __init arch_init_irq(void) { int i; set_except_vector(0, sni_rm200_pci_handle_int); - init_generic_irq(); init_i8259_irqs(); /* Integrated i8259 */ init_pciasic(); diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index d2fa8b1eb..8f67cee43 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -5,7 +5,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004 by Ralf Baechle + * Copyright (C) 1996, 97, 98, 2000, 03, 04 Ralf Baechle (ralf@linux-mips.org) */ #include #include @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/mips/tx4927/common/Makefile b/arch/mips/tx4927/common/Makefile index 573c75309..8fa126b29 100644 --- a/arch/mips/tx4927/common/Makefile +++ b/arch/mips/tx4927/common/Makefile @@ -8,4 +8,5 @@ obj-y += tx4927_prom.o tx4927_setup.o tx4927_irq.o tx4927_irq_handler.o +obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o obj-$(CONFIG_KGDB) += tx4927_dbgio.o diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c index bf59409ee..5ab2e2b76 100644 --- a/arch/mips/tx4927/common/tx4927_irq.c +++ b/arch/mips/tx4927/common/tx4927_irq.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,8 +48,6 @@ /* * DEBUG */ -#define TX4927_IRQ_CHECK_CP0 -#define TX4927_IRQ_CHECK_PIC #undef TX4927_IRQ_DEBUG @@ -145,8 +143,8 @@ static void tx4927_irq_pic_end(unsigned int irq); * Kernel structs for all pic's */ -static spinlock_t tx4927_cp0_lock = SPIN_LOCK_UNLOCKED; -static spinlock_t tx4927_pic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tx4927_cp0_lock); +static DEFINE_SPINLOCK(tx4927_pic_lock); #define TX4927_CP0_NAME "TX4927-CP0" static struct hw_interrupt_type tx4927_irq_cp0_type = { @@ -239,16 +237,6 @@ static unsigned int tx4927_irq_cp0_startup(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_STARTUP, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_cp0_enable(irq); return (0); @@ -258,16 +246,6 @@ static void tx4927_irq_cp0_shutdown(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_SHUTDOWN, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_cp0_disable(irq); return; @@ -279,16 +257,6 @@ static void tx4927_irq_cp0_enable(unsigned int irq) TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - spin_lock_irqsave(&tx4927_cp0_lock, flags); tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq)); @@ -304,16 +272,6 @@ static void tx4927_irq_cp0_disable(unsigned int irq) TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - spin_lock_irqsave(&tx4927_cp0_lock, flags); tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0); @@ -327,16 +285,6 @@ static void tx4927_irq_cp0_mask_and_ack(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_MASK, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_cp0_disable(irq); return; @@ -346,16 +294,6 @@ static void tx4927_irq_cp0_end(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENDIRQ, "irq=%d \n", irq); -#ifdef TX4927_IRQ_CHECK_CP0 - { - if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4927_irq_cp0_enable(irq); } @@ -516,16 +454,6 @@ static unsigned int tx4927_irq_pic_startup(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_pic_enable(irq); return (0); @@ -535,16 +463,6 @@ static void tx4927_irq_pic_shutdown(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_pic_disable(irq); return; @@ -556,16 +474,6 @@ static void tx4927_irq_pic_enable(unsigned int irq) TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENABLE, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - spin_lock_irqsave(&tx4927_pic_lock, flags); tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 0, @@ -582,16 +490,6 @@ static void tx4927_irq_pic_disable(unsigned int irq) TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - spin_lock_irqsave(&tx4927_pic_lock, flags); tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), @@ -606,16 +504,6 @@ static void tx4927_irq_pic_mask_and_ack(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - tx4927_irq_pic_disable(irq); return; @@ -625,16 +513,6 @@ static void tx4927_irq_pic_end(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENDIRQ, "irq=%d\n", irq); -#ifdef TX4927_IRQ_CHECK_PIC - { - if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { - TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, - "bad irq=%d \n", irq); - panic("\n"); - } - } -#endif - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4927_irq_pic_enable(irq); } diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c index 73d188ff6..16bcbdc6d 100644 --- a/arch/mips/tx4927/common/tx4927_setup.c +++ b/arch/mips/tx4927/common/tx4927_setup.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,15 +92,6 @@ void __init tx4927_time_init(void) } #endif -#ifdef CONFIG_KGDB - { - printk("Calling breakpoint() -- start remote kgdb\n"); - set_debug_traps(); - breakpoint(); - printk("Calling breakpoint() -- done\n"); - } -#endif - return; } diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c index 930304585..fd5b433f8 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c @@ -134,10 +134,10 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB #include #include #ifdef CONFIG_RTC_DS1742 -#include +#include #endif #ifdef CONFIG_TOSHIBA_FPCIB0 -#include +#include #endif #include @@ -248,7 +248,7 @@ static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq); static void toshiba_rbtx4927_irq_isa_end(unsigned int irq); #endif -static spinlock_t toshiba_rbtx4927_ioc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(toshiba_rbtx4927_ioc_lock); #define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC" @@ -665,11 +665,11 @@ static void toshiba_rbtx4927_irq_isa_end(unsigned int irq) #endif -void __init init_IRQ(void) +void __init arch_init_irq(void) { extern void tx4927_irq_init(void); - cli(); + local_irq_disable(); tx4927_irq_init(); toshiba_rbtx4927_irq_ioc_init(); @@ -681,13 +681,6 @@ void __init init_IRQ(void) } #endif -#ifdef CONFIG_PCI - { - extern void toshiba_rbtx4927_pci_irq_init(void); - toshiba_rbtx4927_pci_irq_init(); - } -#endif - wbflush(); return; diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c index 3519020b5..e4d095d3e 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c @@ -6,6 +6,9 @@ * * Copyright 2001-2002 MontaVista Software Inc. * + * Copyright (C) 2004 MontaVista Software Inc. + * Author: Manish Lachwani, mlachwani@mvista.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 @@ -86,3 +89,9 @@ const char *get_system_type(void) { return "Toshiba RBTX4927/RBTX4937"; } + +char * __init prom_getcmdline(void) +{ + return &(arcs_cmdline[0]); +} + diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index 77698daa0..8724ea3ae 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c @@ -6,7 +6,7 @@ * * Copyright 2001-2002 MontaVista Software Inc. * - * Copyright (C) 1996, 1997, 2001 Ralf Baechle + * Copyright (C) 1996, 97, 2001, 04 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2000 RidgeRun, Inc. * Author: RidgeRun, Inc. * glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com @@ -17,7 +17,10 @@ * Copyright 2002 MontaVista Software Inc. * Author: Michael Pruznick, michael_pruznick@mvista.com * - * Copyright (C) 2000-2001 Toshiba Corporation + * Copyright (C) 2000-2001 Toshiba Corporation + * + * Copyright (C) 2004 MontaVista Software Inc. + * Author: Manish Lachwani, mlachwani@mvista.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 @@ -61,15 +64,14 @@ #include #include #ifdef CONFIG_RTC_DS1742 -#include +#include #endif #ifdef CONFIG_TOSHIBA_FPCIB0 -#include +#include #endif #include #ifdef CONFIG_PCI #include -#include #endif #ifdef CONFIG_BLK_DEV_IDEPCI #include @@ -146,49 +148,15 @@ static int tx4927_pcic_trdyto = 0; /* default: disabled */ unsigned long tx4927_ce_base[8]; void tx4927_pci_setup(void); void tx4927_reset_pci_pcic(void); -#ifdef TX4927_SUPPORT_PCI_66 -void tx4927_pci66_setup(void); -extern int tx4927_pci66_check(void); -#endif int tx4927_pci66 = 0; /* 0:auto */ #endif char *toshiba_name = ""; #ifdef CONFIG_PCI -void tx4927_dump_pcic_settings(void) -{ - printk("%s pcic settings:",toshiba_name); - { - int i; - unsigned long *preg = (unsigned long *) tx4927_pcicptr; - for (i = 0; i < sizeof(struct tx4927_pcic_reg); i += 4) { - if (i % 32 == 0) - printk("\n%04x:", i); - if (preg == &tx4927_pcicptr->g2pintack - || preg == &tx4927_pcicptr->g2pspc -#ifdef CONFIG_TX4927BUG_WORKAROUND - || preg == &tx4927_pcicptr->g2pcfgadrs - || preg == &tx4927_pcicptr->g2pcfgdata -#endif - ) { - printk(" XXXXXXXX"); - preg++; - continue; - } - printk(" %08lx", *preg++); - if (preg == &tx4927_pcicptr->g2pcfgadrs) - break; - } - printk("\n"); - } -} - static void tx4927_pcierr_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - extern void tx4927_dump_pcic_settings(void); - #ifdef CONFIG_BLK_DEV_IDEPCI /* ignore MasterAbort for ide probing... */ if (irq == TX4927_IRQ_IRC_PCIERR && @@ -203,6 +171,7 @@ static void tx4927_pcierr_interrupt(int irq, void *dev_id, } #endif printk("PCI error interrupt (irq 0x%x).\n", irq); + printk("pcistat:%04x, g2pstatus:%08lx, pcicstatus:%08lx\n", (unsigned short) (tx4927_pcicptr->pcistatus >> 16), tx4927_pcicptr->g2pstatus, tx4927_pcicptr->pcicstatus); @@ -211,23 +180,10 @@ static void tx4927_pcierr_interrupt(int irq, void *dev_id, (unsigned long) (tx4927_ccfgptr->tear >> 32), (unsigned long) tx4927_ccfgptr->tear); show_regs(regs); - //tx4927_dump_pcic_settings(); - panic("PCI error at PC:%08lx.", regs->cp0_epc); } -static struct irqaction pcic_action = { - tx4927_pcierr_interrupt, 0, 0, "PCI-C", NULL, NULL -}; - -static struct irqaction pcierr_action = { - tx4927_pcierr_interrupt, 0, 0, "PCI-ERR", NULL, NULL -}; - - void __init toshiba_rbtx4927_pci_irq_init(void) { - setup_irq(TX4927_IRQ_IRC_PCIC, &pcic_action); - setup_irq(TX4927_IRQ_IRC_PCIERR, &pcierr_action); return; } @@ -245,91 +201,26 @@ void tx4927_reset_pci_pcic(void) #endif /* CONFIG_PCI */ #ifdef CONFIG_PCI -#ifdef TX4927_SUPPORT_PCI_66 -void tx4927_pci66_setup(void) -{ - int pciclk, pciclkin = 1; - - TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI66, - "-\n"); - - if (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) - return; - - tx4927_reset_pci_pcic(); - - /* Assert M66EN */ - tx4927_ccfgptr->ccfg |= TX4927_CCFG_PCI66; - /* set PCICLK 66MHz */ - if (tx4927_ccfgptr->pcfg & TX4927_PCFG_PCICLKEN_ALL) { - unsigned int pcidivmode = 0; - pcidivmode = - (unsigned long) tx4927_ccfgptr-> - ccfg & TX4927_CCFG_PCIDIVMODE_MASK; - if (tx4927_cpu_clock >= 170000000) { - /* CPU 200MHz */ - pcidivmode = TX4927_CCFG_PCIDIVMODE_3; - pciclk = tx4927_cpu_clock / 3; - } else { - /* CPU 166MHz */ - pcidivmode = TX4927_CCFG_PCIDIVMODE_2_5; - pciclk = tx4927_cpu_clock * 2 / 5; - } - tx4927_ccfgptr->ccfg = - (tx4927_ccfgptr->ccfg & ~TX4927_CCFG_PCIDIVMODE_MASK) - | pcidivmode; - TOSHIBA_RBTX4927_SETUP_DPRINTK - (TOSHIBA_RBTX4927_SETUP_PCI66, - ":PCICLK: ccfg:0x%08lx\n", - (unsigned long) tx4927_ccfgptr->ccfg); - } else { - int pciclk_setting = *tx4927_pci_clk_ptr; - pciclkin = 0; - pciclk = 66666666; - pciclk_setting &= ~TX4927_PCI_CLK_MASK; - pciclk_setting |= TX4927_PCI_CLK_66; - *tx4927_pci_clk_ptr = pciclk_setting; - TOSHIBA_RBTX4927_SETUP_DPRINTK - (TOSHIBA_RBTX4927_SETUP_PCI66, - "PCICLK: pci_clk:%02x\n", *tx4927_pci_clk_ptr); - } - - udelay(10000); - - /* clear PCIC reset */ - tx4927_ccfgptr->clkctr &= ~TX4927_CLKCTR_PCIRST; - /* clear PCI reset */ - *tx4927_pcireset_ptr = 0; - - TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI66, - "+\n"); - return; -} -#endif /* TX4927_SUPPORT_PCI_66 */ - void print_pci_status(void) { printk("PCI STATUS %lx\n", tx4927_pcicptr->pcistatus); printk("PCIC STATUS %lx\n", tx4927_pcicptr->pcicstatus); } +extern struct pci_controller tx4927_controller; + static struct pci_dev *fake_pci_dev(struct pci_controller *hose, int top_bus, int busnr, int devfn) { static struct pci_dev dev; static struct pci_bus bus; - dev.bus = &bus; - dev.sysdata = hose; + dev.sysdata = (void *)hose; dev.devfn = devfn; bus.number = busnr; bus.ops = hose->pci_ops; - - if (busnr != top_bus) - /* Fake a parent bus structure. */ - bus.parent = &bus; - else - bus.parent = NULL; + bus.parent = NULL; + dev.bus = &bus; return &dev; } @@ -350,15 +241,19 @@ EARLY_PCI_OP(write, byte, u8) EARLY_PCI_OP(write, word, u16) EARLY_PCI_OP(write, dword, u32) -static int __init tx4927_pcibios_init(int busno, struct pci_controller *hose) +static int __init tx4927_pcibios_init(void) { unsigned int id; u32 pci_devfn; + int devfn_start = 0; + int devfn_stop = 0xff; + int busno = 0; /* One bus on the Toshiba */ + struct pci_controller *hose = &tx4927_controller; TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS, "-\n"); - for (pci_devfn = 0x0; pci_devfn < 0xff; pci_devfn++) { + for (pci_devfn = devfn_start; pci_devfn < devfn_stop; pci_devfn++) { early_read_config_dword(hose, busno, busno, pci_devfn, PCI_VENDOR_ID, &id); @@ -581,12 +476,15 @@ static int __init tx4927_pcibios_init(int busno, struct pci_controller *hose) } + register_pci_controller(&tx4927_controller); TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS, "+\n"); - return busno; + return 0; } +arch_initcall(tx4927_pcibios_init); + extern struct resource pci_io_resource; extern struct resource pci_mem_resource; @@ -597,11 +495,6 @@ void tx4927_pci_setup(void) TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "-\n"); -#ifndef TX4927_SUPPORT_PCI_66 - if (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) - printk("PCI 66 current unsupported\n"); -#endif - mips_memory_upper = tx4927_get_mem_size() << 20; mips_memory_upper += KSEG0; TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, @@ -736,19 +629,6 @@ void tx4927_pci_setup(void) /* PCI->GB mappings (I/O 256B) */ tx4927_pcicptr->p2giopbase = 0; /* 256B */ - -#ifdef TX4927_SUPPORT_COMMAND_IO - tx4927_pcicptr->p2giogbase = 0 | TX4927_PCIC_P2GIOGBASE_TIOEN | -#ifdef __BIG_ENDIAN - TX4927_PCIC_P2GIOGBASE_TECHG -#else - TX4927_PCIC_P2GIOGBASE_TBSDIS -#endif - ; -#else - tx4927_pcicptr->p2giogbase = 0; -#endif - /* PCI->GB mappings (MEM 512MB) M0 gets all of memory */ tx4927_pcicptr->p2gm0plbase = 0; tx4927_pcicptr->p2gm0pubase = 0; @@ -791,8 +671,6 @@ void tx4927_pci_setup(void) if (tx4927_pcic_trdyto >= 0) { tx4927_pcicptr->g2ptocnt &= ~0xff; tx4927_pcicptr->g2ptocnt |= (tx4927_pcic_trdyto & 0xff); - //printk("%s PCIC -- TRDYTO:%02lx\n",toshiba_name, - // tx4927_pcicptr->g2ptocnt & 0xff); } /* Clear All Local Bus Status */ @@ -825,17 +703,10 @@ void tx4927_pci_setup(void) tx4927_pcicptr->pcistatus = PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | -#ifdef TX4927_SUPPORT_COMMAND_IO - PCI_COMMAND_IO | -#endif PCI_COMMAND_PARITY | PCI_COMMAND_SERR; TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, ":pci setup complete:\n"); - //tx4927_dump_pcic_settings(); - - tx4927_pcibios_init(0, &tx4927_controller); - TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "+\n"); } @@ -856,7 +727,7 @@ void toshiba_rbtx4927_restart(char *command) reg_wr08(RBTX4927_SW_RESET_DO, RBTX4927_SW_RESET_DO_SET); /* do something passive while waiting for reset */ - cli(); + local_irq_disable(); while (1) asm_wait(); @@ -867,7 +738,7 @@ void toshiba_rbtx4927_restart(char *command) void toshiba_rbtx4927_halt(void) { printk(KERN_NOTICE "System Halted\n"); - cli(); + local_irq_disable(); while (1) { asm_wait(); } @@ -883,6 +754,7 @@ void toshiba_rbtx4927_power_off(void) void __init toshiba_rbtx4927_setup(void) { vu32 cp0_config; + char *argptr; printk("CPU is %s\n", toshiba_name); @@ -923,21 +795,16 @@ void __init toshiba_rbtx4927_setup(void) TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, "+\n"); - - - mips_io_port_base = KSEG1 + TBTX4927_ISA_IO_OFFSET; + set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET); TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, ":mips_io_port_base=0x%08lx\n", mips_io_port_base); TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, ":Resource\n"); - ioport_resource.start = 0; ioport_resource.end = 0xffffffff; - iomem_resource.start = 0; iomem_resource.end = 0xffffffff; - TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, ":ResetRoutines\n"); _machine_restart = toshiba_rbtx4927_restart; @@ -1000,25 +867,11 @@ void __init toshiba_rbtx4927_setup(void) tx4927_sdramcptr->tr |= 0x02000000; /* RCD:3tck */ #endif -#ifdef TX4927_SUPPORT_PCI_66 - tx4927_pci66_setup(); -#endif - tx4927_pci_setup(); -#endif - - - { - u32 id = 0; - early_read_config_dword(&tx4927_controller, 0, 0, 0x90, - PCI_VENDOR_ID, &id); - if (id == 0x94601055) { - tx4927_using_backplane = 1; - printk("backplane board IS installed\n"); - } else { - printk("backplane board NOT installed\n"); - } - } + if (tx4927_using_backplane == 1) + printk("backplane board IS installed\n"); + else + printk("No Backplane \n"); /* this is on ISA bus behind PCI bus, so need PCI up first */ #ifdef CONFIG_TOSHIBA_FPCIB0 @@ -1065,11 +918,41 @@ void __init toshiba_rbtx4927_setup(void) } #endif +#endif /* CONFIG_PCI */ + +#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"); + } +#endif + TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, - "+\n"); + "+\n"); } +#ifdef CONFIG_RTC_DS1742 +extern unsigned long rtc_ds1742_get_time(void); +extern int rtc_ds1742_set_time(unsigned long); +extern void rtc_ds1742_wait(void); +#endif + void __init toshiba_rbtx4927_time_init(void) { diff --git a/arch/mips/vr4181/common/irq.c b/arch/mips/vr4181/common/irq.c index 4a2458f8b..2cdf77c5c 100644 --- a/arch/mips/vr4181/common/irq.c +++ b/arch/mips/vr4181/common/irq.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2001 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * linux/arch/mips/vr4181/common/irq.c * Completely re-written to use the new irq.c @@ -12,7 +13,6 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ -#include #include #include #include @@ -184,10 +184,9 @@ static struct irqaction cascade = static struct irqaction reserved = { no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade", NULL, NULL }; -void __init init_IRQ(void) +void __init arch_init_irq(void) { int i; - extern irq_desc_t irq_desc[]; set_except_vector(0, vr4181_handle_irq); @@ -237,13 +236,4 @@ void __init init_IRQ(void) */ setup_irq(VR4181_IRQ_RTCL1, &reserved); setup_irq(VR4181_IRQ_RTCL2, &reserved); - -#ifdef CONFIG_KGDB - printk("Setting debug traps - please connect the remote debugger.\n"); - - set_debug_traps(); - - // you may move this line to whereever you want - breakpoint(); -#endif } diff --git a/arch/mips/vr4181/common/time.c b/arch/mips/vr4181/common/time.c index d2a25c28f..17814076b 100644 --- a/arch/mips/vr4181/common/time.c +++ b/arch/mips/vr4181/common/time.c @@ -29,7 +29,7 @@ * RTC ops */ -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); /* per VR41xx docs, bad data can be read if between 2 counts */ static inline unsigned short diff --git a/arch/mips/vr4181/osprey/setup.c b/arch/mips/vr4181/osprey/setup.c index 6be595971..2ff7140e7 100644 --- a/arch/mips/vr4181/osprey/setup.c +++ b/arch/mips/vr4181/osprey/setup.c @@ -8,6 +8,7 @@ * * Copyright 2001 MontaVista Software Inc. * Author: jsun@mvista.com or jsun@junsun.net + * Copyright (C) 2005 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 @@ -15,7 +16,6 @@ * */ -#include #include #include #include diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c index 3613999a1..d14dae150 100644 --- a/arch/mips/vr41xx/common/bcu.c +++ b/arch/mips/vr41xx/common/bcu.c @@ -30,6 +30,7 @@ */ #include #include +#include #include #include diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c index fa93b0331..9c6b21a79 100644 --- a/arch/mips/vr41xx/common/giu.c +++ b/arch/mips/vr41xx/common/giu.c @@ -4,6 +4,7 @@ * Copyright (C) 2002 MontaVista Software Inc. * Author: Yoichi Yuasa * Copyright (C) 2003-2004 Yoichi Yuasa + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,6 @@ * - Added support for NEC VR4133. * - Removed board_irq_init. */ -#include #include #include #include diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c index 19ccb3b56..c84266114 100644 --- a/arch/mips/vr41xx/common/icu.c +++ b/arch/mips/vr41xx/common/icu.c @@ -4,6 +4,7 @@ * Copyright (C) 2001-2002 MontaVista Software Inc. * Author: Yoichi Yuasa * Copyright (C) 2003-2004 Yoichi Yuasa + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,6 @@ * Yoichi Yuasa * - Coped with INTASSIGN of NEC VR4133. */ -#include #include #include #include @@ -747,11 +747,8 @@ static inline void init_vr41xx_icu_irq(void) setup_irq(INT4_CASCADE_IRQ, &icu_cascade); } -void __init init_IRQ(void) +void __init arch_init_irq(void) { - memset(irq_desc, 0, sizeof(irq_desc)); - - init_generic_irq(); mips_cpu_irq_init(MIPS_CPU_IRQ_BASE); init_vr41xx_icu_irq(); init_vr41xx_giuint_irq(); diff --git a/arch/mips/vr41xx/common/ksyms.c b/arch/mips/vr41xx/common/ksyms.c index cfaa0ecd1..a20141063 100644 --- a/arch/mips/vr41xx/common/ksyms.c +++ b/arch/mips/vr41xx/common/ksyms.c @@ -2,6 +2,7 @@ * ksyms.c, Export NEC VR4100 series specific functions needed for loadable modules. * * Copyright (C) 2003 Yoichi Yuasa + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c index 3e1079dfb..c5f1043de 100644 --- a/arch/mips/vr41xx/common/pmu.c +++ b/arch/mips/vr41xx/common/pmu.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c index 0bbad1e8c..5475dd72e 100644 --- a/arch/mips/vr41xx/common/vrc4173.c +++ b/arch/mips/vr41xx/common/vrc4173.c @@ -4,6 +4,7 @@ * Copyright (C) 2001-2003 MontaVista Software Inc. * Author: Yoichi Yuasa * Copyright (C) 2004 Yoichi Yuasa + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -56,6 +56,9 @@ MODULE_LICENSE("GPL"); #define VRC4173_SYSINT1REG 0x060 #define VRC4173_MSYSINT1REG 0x06c +#define VRC4173_MPIUINTREG 0x06e +#define VRC4173_MAIUINTREG 0x070 +#define VRC4173_MKIUINTREG 0x072 #define VRC4173_SELECTREG 0x09e #define SEL3 0x0008 @@ -329,7 +332,7 @@ void vrc4173_enable_piuint(uint16_t mask) spin_unlock_irqrestore(&desc->lock, flags); } -EXPORT_SYMBOL(vrc4173_eanble_piuint); +EXPORT_SYMBOL(vrc4173_enable_piuint); void vrc4173_disable_piuint(uint16_t mask) { diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 093e8046f..d648a48d8 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -32,9 +32,19 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_ISA_DMA bool +config GENERIC_HARDIRQS + def_bool y + +config GENERIC_IRQ_PROBE + def_bool y + # unless you want to implement ACPI on PA-RISC ... ;-) config PM bool diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index b59911f2c..17ecb61c4 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -37,8 +37,10 @@ cflags-y := -pipe # are not in gcc 3.2. cflags-y += -mno-space-regs -mfast-indirect-calls -# No fixed-point multiply -cflags-y += -mdisable-fpregs +# Currently we save and restore fpregs on all kernel entry/interruption paths. +# If that gets optimized, we might need to disable the use of fpregs in the +# kernel. +#cflags-y += -mdisable-fpregs # Without this, "ld -r" results in .text sections that are too big # (> 0x40000) for branches to reach stubs. @@ -52,7 +54,6 @@ cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300 cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000 head-y := arch/parisc/kernel/head.o -head-$(CONFIG_PARISC64) := arch/parisc/kernel/head64.o CFLAGS += $(cflags-y) @@ -86,6 +87,12 @@ oldpalo: vmlinux # Shorthands for known targets not supported by parisc, use palo as default Image zImage bzImage: palo +kernel_install: vmlinux + sh $(src)/arch/parisc/install.sh \ + $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" + +install: kernel_install modules_install + prepare: include/asm-parisc/offsets.h arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ @@ -100,4 +107,8 @@ MRPROPER_FILES += palo.conf define archhelp @echo '* vmlinux - Uncompressed kernel image (./vmlinux)' @echo ' palo - Bootable image (./lifimage)' + @echo ' install - Install kernel using' + @echo ' (your) ~/bin/installkernel or' + @echo ' (distribution) /sbin/installkernel or' + @echo ' copy to $$(INSTALL_PATH)' endef diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig index 071139d4e..872085dea 100644 --- a/arch/parisc/configs/712_defconfig +++ b/arch/parisc/configs/712_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-pa5 +# Wed Jan 5 13:20:32 2005 # CONFIG_PARISC=y CONFIG_MMU=y @@ -9,37 +11,50 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # # Code maturity level options # -# CONFIG_EXPERIMENTAL is not set -CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y +CONFIG_EXPERIMENTAL=y +# CONFIG_CLEAN_COMPILE is not set +CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y -CONFIG_LOG_BUF_SHIFT=15 -# CONFIG_HOTPLUG is not set -# CONFIG_IKCONFIG is not set +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=16 +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y -# CONFIG_MODULE_UNLOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y -# CONFIG_KMOD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y # # Processor type and features @@ -47,10 +62,12 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_PA7000 is not set CONFIG_PA7100LC=y # CONFIG_PA7200 is not set +# CONFIG_PA7300LC is not set # CONFIG_PA8X00 is not set CONFIG_PA11=y # CONFIG_64BIT is not set # CONFIG_SMP is not set +# CONFIG_DISCONTIGMEM is not set # CONFIG_PREEMPT is not set # CONFIG_HPUX is not set @@ -61,17 +78,30 @@ CONFIG_GSC=y # CONFIG_HPPB is not set # CONFIG_IOMMU_CCIO is not set CONFIG_GSC_LASI=y -CONFIG_GSC_WAX=y +# CONFIG_GSC_WAX is not set # CONFIG_EISA is not set # CONFIG_PCI is not set -# CONFIG_CHASSIS_LCD_LED is not set +CONFIG_CHASSIS_LCD_LED=y # CONFIG_PDC_CHASSIS is not set +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# + # # Executable file formats # CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set +CONFIG_BINFMT_MISC=m # # Device Drivers @@ -80,7 +110,10 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # -CONFIG_DEBUG_DRIVER=y +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -91,9 +124,10 @@ CONFIG_DEBUG_DRIVER=y # Parallel port support # CONFIG_PARPORT=y -CONFIG_PARPORT_PC=y -CONFIG_PARPORT_PC_CML1=y -# CONFIG_PARPORT_SERIAL is not set +CONFIG_PARPORT_PC=m +CONFIG_PARPORT_PC_CML1=m +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_SUPERIO is not set CONFIG_PARPORT_GSC=y # CONFIG_PARPORT_OTHER is not set # CONFIG_PARPORT_1284 is not set @@ -110,7 +144,20 @@ CONFIG_PARPORT_GSC=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=y # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=6144 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -137,7 +184,6 @@ CONFIG_CHR_DEV_SG=y # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_REPORT_LUNS is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set @@ -145,31 +191,33 @@ CONFIG_CHR_DEV_SG=y # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y -CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_FC_ATTRS is not set # # SCSI low-level drivers # -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_SATA is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set CONFIG_SCSI_LASI700=y CONFIG_53C700_MEM_MAPPED=y CONFIG_53C700_LE_ON_BE=y # CONFIG_SCSI_ZALON is not set -# CONFIG_SCSI_DEBUG is not set +CONFIG_SCSI_DEBUG=m # # Multi-device support (RAID and LVM) # CONFIG_MD=y -CONFIG_BLK_DEV_MD=y -CONFIG_MD_LINEAR=y -CONFIG_MD_RAID0=y -CONFIG_MD_RAID1=y -CONFIG_MD_RAID5=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +# CONFIG_MD_RAID10 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # @@ -197,49 +245,151 @@ CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y -# CONFIG_NET_KEY is not set +CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y -# CONFIG_IP_PNP_DHCP is not set +CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set +CONFIG_INET_AH=m +CONFIG_INET_ESP=m # CONFIG_INET_IPCOMP is not set -# CONFIG_DECNET is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_LIMIT=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_MAC=m +CONFIG_IP_NF_MATCH_PKTTYPE=m +CONFIG_IP_NF_MATCH_MARK=m +CONFIG_IP_NF_MATCH_MULTIPORT=m +CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_RECENT=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_DSCP=m +CONFIG_IP_NF_MATCH_AH_ESP=m +CONFIG_IP_NF_MATCH_LENGTH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_TCPMSS=m +CONFIG_IP_NF_MATCH_HELPER=m +CONFIG_IP_NF_MATCH_STATE=m +CONFIG_IP_NF_MATCH_CONNTRACK=m +CONFIG_IP_NF_MATCH_OWNER=m +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set +# CONFIG_IP_NF_MATCH_REALM is not set +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +# CONFIG_IP_NF_NAT_LOCAL is not set +CONFIG_IP_NF_NAT_SNMP_BASIC=m +CONFIG_IP_NF_NAT_IRC=m +CONFIG_IP_NF_NAT_FTP=m +CONFIG_IP_NF_NAT_TFTP=m +CONFIG_IP_NF_NAT_AMANDA=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_DSCP=m +CONFIG_IP_NF_TARGET_MARK=m +CONFIG_IP_NF_TARGET_CLASSIFY=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=m + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set # CONFIG_BRIDGE is not set -# CONFIG_NETFILTER is not set # CONFIG_VLAN_8021Q is not set -# CONFIG_LLC2 is not set +# CONFIG_DECNET is not set +CONFIG_LLC=m +CONFIG_LLC2=m # CONFIG_IPX is not set # CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT 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 +# CONFIG_NET_CLS_ROUTE is not set # # Network testing # -# CONFIG_NET_PKTGEN is not set +CONFIG_NET_PKTGEN=m +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set +CONFIG_DUMMY=m +CONFIG_BONDING=m # CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set +CONFIG_TUN=m +# CONFIG_ETHERTAP is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=m CONFIG_LASI_82596=y # @@ -249,14 +399,10 @@ CONFIG_LASI_82596=y # # Ethernet (10000 Mbit) # -# CONFIG_PLIP is not set -CONFIG_PPP=y -# CONFIG_PPP_FILTER is not set -# CONFIG_PPP_ASYNC is not set -# CONFIG_PPP_SYNC_TTY is not set -# CONFIG_PPP_DEFLATE is not set -# CONFIG_PPP_BSDCOMP is not set -# CONFIG_SLIP is not set + +# +# Token Ring devices +# # # Wireless LAN (non-hamradio) @@ -267,32 +413,24 @@ CONFIG_NET_RADIO=y # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set - -# -# Token Ring devices -# +# CONFIG_ATMEL is not set # # Wan interfaces # # CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# -# Bluetooth support -# -# CONFIG_BT is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_PLIP is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # ISDN subsystem @@ -318,7 +456,7 @@ 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_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # @@ -327,33 +465,33 @@ CONFIG_INPUT_EVDEV=y # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_PARKBD is not set CONFIG_SERIO_GSCPS2=y -# CONFIG_HP_SDC is not set +CONFIG_HP_SDC=y +CONFIG_HIL_MLC=y +# CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ATKBD is not set +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y +# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_HIL_OLD is not set # CONFIG_KEYBOARD_HIL is not set CONFIG_INPUT_MOUSE=y -# CONFIG_MOUSE_PS2 is not set -# CONFIG_MOUSE_SERIAL is not set +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_SERIAL=m # CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_HIL is not set +CONFIG_MOUSE_HIL=m # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_PCSPKR is not set -# CONFIG_INPUT_UINPUT is not set -# CONFIG_HP_SDC_RTC is not set +# CONFIG_INPUT_MISC is not set # # Character devices @@ -368,7 +506,7 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_NR_UARTS=8 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y @@ -380,17 +518,16 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y # Non-8250 serial port support # # CONFIG_SERIAL_MUX is not set -# CONFIG_PDC_CONSOLE is not set +CONFIG_PDC_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_PRINTER=y +CONFIG_LEGACY_PTY_COUNT=64 +CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set -# CONFIG_PPDEV is not set +CONFIG_PPDEV=m # CONFIG_TIPAR is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -402,24 +539,28 @@ CONFIG_PRINTER=y # # CONFIG_WATCHDOG is not set CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set +CONFIG_GEN_RTC_X=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set -# CONFIG_RAW_DRIVER is not set +CONFIG_RAW_DRIVER=y +CONFIG_MAX_RAW_DEVS=256 # # I2C support # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -438,46 +579,97 @@ CONFIG_GEN_RTC=y # Graphics support # CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y CONFIG_FB_STI=y # CONFIG_FB_VIRTUAL is not set # # Console display driver support # -# CONFIG_MDA_CONSOLE is not set CONFIG_STI_CONSOLE=y -CONFIG_DUMMY_CONSOLE_COLUMNS=160 -CONFIG_DUMMY_CONSOLE_ROWS=64 +CONFIG_DUMMY_CONSOLE_COLUMNS=128 +CONFIG_DUMMY_CONSOLE_ROWS=48 CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_PCI_CONSOLE=y -# CONFIG_FONTS is not set +CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set # # Logo configuration # CONFIG_LOGO=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +# CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_LOGO_PARISC_CLUT224=y # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_SEQUENCER=y +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +CONFIG_SND_SEQUENCER_OSS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +# 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 + +# +# GSC devices +# +CONFIG_SND_HARMONY=y + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set # # USB support # +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -488,13 +680,22 @@ CONFIG_EXT3_FS=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set # CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +# CONFIG_XFS_RT is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_SECURITY is not set +# CONFIG_XFS_POSIX_ACL is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems @@ -502,12 +703,17 @@ CONFIG_JBD=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y # CONFIG_ZISOFS is not set -# CONFIG_UDF_FS is not set +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -515,38 +721,63 @@ CONFIG_JOLIET=y # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +# CONFIG_TMPFS_SECURITY is not set +# CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y -CONFIG_NFSD=y +CONFIG_NFS_V4=y +CONFIG_NFS_DIRECTIO=y +CONFIG_NFSD=m CONFIG_NFSD_V3=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -CONFIG_EXPORTFS=y +CONFIG_EXPORTFS=m CONFIG_SUNRPC=y -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y +CONFIG_RPCSEC_GSS_SPKM3=m +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set # # Partition Types @@ -559,85 +790,102 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=m # # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_FRAME_POINTER=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # # Security options # -CONFIG_SECURITY=y -# CONFIG_SECURITY_NETWORK is not set -CONFIG_SECURITY_CAPABILITIES=y -# CONFIG_SECURITY_SELINUX is not set +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y +# CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_MD4 is not set -# CONFIG_CRYPTO_MD5 is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_TEST=m # # Library routines # -# CONFIG_CRC32 is not set +CONFIG_CRC_CCITT=m +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig index 276fc0d17..e76acae49 100644 --- a/arch/parisc/configs/a500_defconfig +++ b/arch/parisc/configs/a500_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-pa5 +# Wed Jan 5 13:22:34 2005 # CONFIG_PARISC=y CONFIG_MMU=y @@ -11,13 +13,14 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set -# CONFIG_STANDALONE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -26,18 +29,22 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=16 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -47,7 +54,9 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y # # Processor type and features @@ -61,9 +70,12 @@ CONFIG_PA20=y CONFIG_PREFETCH=y CONFIG_PARISC64=y CONFIG_64BIT=y -# CONFIG_SMP is not set +CONFIG_SMP=y +CONFIG_HOTPLUG_CPU=y +CONFIG_DISCONTIGMEM=y # CONFIG_PREEMPT is not set CONFIG_COMPAT=y +CONFIG_NR_CPUS=8 # # Bus options (PCI, PCMCIA, EISA, GSC, ISA) @@ -80,14 +92,21 @@ CONFIG_IOMMU_SBA=y CONFIG_PDC_CHASSIS=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support # +CONFIG_PCCARD=m +# CONFIG_PCMCIA_DEBUG is not set +# CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=m -CONFIG_PCMCIA_DEBUG=y -CONFIG_YENTA=m CONFIG_CARDBUS=y -# CONFIG_I82092 is not set -# CONFIG_TCIC is not set + +# +# PC-card bridges +# +CONFIG_YENTA=m +CONFIG_PD6729=m +CONFIG_I82092=m +CONFIG_TCIC=m # # PCI Hotplug Support @@ -107,8 +126,10 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # -# CONFIG_FW_LOADER is not set -CONFIG_DEBUG_DRIVER=y +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -135,10 +156,21 @@ CONFIG_BLK_DEV_UMEM=m CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_CARMEL is not set +# CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=6144 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -165,7 +197,6 @@ CONFIG_CHR_DEV_SG=y # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_REPORT_LUNS=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set @@ -179,13 +210,15 @@ CONFIG_SCSI_FC_ATTRS=m # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD 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_ADVANSYS is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set @@ -209,6 +242,7 @@ CONFIG_SCSI_SYM53C8XX_IOMAPPED=y CONFIG_SCSI_QLOGIC_FC=m # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=m +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -223,9 +257,9 @@ CONFIG_SCSI_DEBUG=m # # PCMCIA SCSI adapter support # -# CONFIG_PCMCIA_FDOMAIN is not set -# CONFIG_PCMCIA_QLOGIC is not set -# CONFIG_PCMCIA_SYM53C500 is not set +CONFIG_PCMCIA_FDOMAIN=m +CONFIG_PCMCIA_QLOGIC=m +CONFIG_PCMCIA_SYM53C500=m # # Multi-device support (RAID and LVM) @@ -235,9 +269,11 @@ CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set # CONFIG_MD_RAID5 is not set # CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # @@ -245,7 +281,6 @@ CONFIG_MD_RAID1=y # CONFIG_FUSION=m CONFIG_FUSION_MAX_SGE=40 -CONFIG_FUSION_ISENSE=m CONFIG_FUSION_CTL=m # @@ -286,6 +321,9 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_INET_AH=m CONFIG_INET_ESP=m # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -299,6 +337,9 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -323,15 +364,23 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set +# CONFIG_IP_NF_MATCH_REALM is not set +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -343,16 +392,15 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -373,12 +421,12 @@ CONFIG_LLC2=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -425,7 +473,7 @@ CONFIG_TULIP_MMIO=y # CONFIG_WINBOND_840 is not set # CONFIG_DM9102 is not set CONFIG_PCMCIA_XIRCOM=m -CONFIG_PCMCIA_XIRTULIP=m +# CONFIG_PCMCIA_XIRTULIP is not set CONFIG_HP100=m CONFIG_NET_PCI=y CONFIG_PCNET32=m @@ -466,6 +514,7 @@ CONFIG_E1000_NAPI=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # @@ -490,18 +539,17 @@ CONFIG_NET_RADIO=y # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set -CONFIG_PCMCIA_WAVELAN=m +# CONFIG_PCMCIA_WAVELAN is not set CONFIG_PCMCIA_NETWAVE=m # # Wireless 802.11 Frequency Hopping cards support # -# CONFIG_PCMCIA_RAYCS is not set +CONFIG_PCMCIA_RAYCS=m # # Wireless 802.11b ISA/PCI cards support # -# CONFIG_AIRO is not set CONFIG_HERMES=m CONFIG_PLX_HERMES=m CONFIG_TMD_HERMES=m @@ -513,7 +561,7 @@ CONFIG_PCI_HERMES=m # CONFIG_PCMCIA_HERMES=m CONFIG_AIRO_CS=m -# CONFIG_PCMCIA_WL3501 is not set +CONFIG_PCMCIA_WL3501=m # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support @@ -606,7 +654,7 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set +CONFIG_SERIAL_8250_CS=m CONFIG_SERIAL_8250_NR_UARTS=8 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y @@ -624,7 +672,6 @@ CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -644,7 +691,6 @@ CONFIG_GEN_RTC_X=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set @@ -660,6 +706,11 @@ CONFIG_MAX_RAW_DEVS=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -682,7 +733,6 @@ CONFIG_MAX_RAW_DEVS=256 # # Console display driver support # -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE_COLUMNS=160 CONFIG_DUMMY_CONSOLE_ROWS=64 CONFIG_DUMMY_CONSOLE=y @@ -696,12 +746,23 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -716,6 +777,7 @@ CONFIG_JFS_FS=m # CONFIG_JFS_POSIX_ACL is not set # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set # CONFIG_XFS_QUOTA is not set @@ -724,8 +786,9 @@ CONFIG_XFS_FS=m # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS 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_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems @@ -734,6 +797,7 @@ CONFIG_ISO9660_FS=y CONFIG_JOLIET=y # CONFIG_ZISOFS is not set CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -741,6 +805,8 @@ CONFIG_UDF_FS=m CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -791,10 +857,14 @@ CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_RPCSEC_GSS_SPKM3=m CONFIG_SMB_FS=m CONFIG_SMB_NLS_DEFAULT=y CONFIG_SMB_NLS_REMOTE="cp437" CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -833,6 +903,7 @@ CONFIG_NLS_CODEPAGE_865=m # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m @@ -858,14 +929,19 @@ CONFIG_OPROFILE=m # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y -# CONFIG_FRAME_POINTER is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_RWLOCK is not set # # Security options # +CONFIG_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y # CONFIG_SECURITY is not set # @@ -879,6 +955,7 @@ CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m @@ -886,15 +963,19 @@ CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m -# CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m -# CONFIG_CRYPTO_MICHAEL_MIC is not set +CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_TEST=m # # Library routines # +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=m diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig index b67d80140..1700d7aec 100644 --- a/arch/parisc/configs/b180_defconfig +++ b/arch/parisc/configs/b180_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-pa5 +# Wed Jan 5 13:35:54 2005 # CONFIG_PARISC=y CONFIG_MMU=y @@ -11,19 +13,20 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # # CONFIG_EXPERIMENTAL is not set CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_LOG_BUF_SHIFT=15 +CONFIG_LOG_BUF_SHIFT=16 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -31,11 +34,13 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -43,6 +48,7 @@ CONFIG_IOSCHED_CFQ=y CONFIG_MODULES=y # CONFIG_MODULE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set # @@ -91,8 +97,9 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_DEBUG_DRIVER=y +CONFIG_STANDALONE=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -129,6 +136,19 @@ CONFIG_BLK_DEV_CRYPTOLOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -174,12 +194,15 @@ CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 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_DPT_I2O is not set # CONFIG_SCSI_IN2000 is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set @@ -190,6 +213,7 @@ CONFIG_SCSI_SPI_ATTRS=y # 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_PPA is not set # CONFIG_SCSI_IMM is not set @@ -240,6 +264,7 @@ CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y CONFIG_MD_RAID5=y # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # @@ -284,6 +309,9 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_NETFILTER is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set @@ -446,6 +474,7 @@ CONFIG_SERIO=y CONFIG_SERIO_GSCPS2=y # CONFIG_HP_SDC is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -507,7 +536,6 @@ CONFIG_PRINTER=y # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -527,7 +555,6 @@ CONFIG_GEN_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -560,6 +587,8 @@ CONFIG_GEN_RTC=y # Graphics support # CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set @@ -611,12 +640,23 @@ CONFIG_LOGO_PARISC_CLUT224=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -632,8 +672,9 @@ CONFIG_JBD=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems @@ -658,6 +699,7 @@ CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -665,7 +707,6 @@ CONFIG_RAMFS=y # Miscellaneous filesystems # # CONFIG_HFSPLUS_FS is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set @@ -745,18 +786,21 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set -CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # # Security options # +# CONFIG_KEYS is not set CONFIG_SECURITY=y # CONFIG_SECURITY_NETWORK is not set CONFIG_SECURITY_CAPABILITIES=y +# CONFIG_SECURITY_SECLVL is not set # CONFIG_SECURITY_SELINUX is not set # @@ -770,6 +814,7 @@ CONFIG_CRYPTO=y # 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_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set @@ -779,6 +824,8 @@ CONFIG_CRYPTO=y # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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 diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig index 087dfcd1d..b27980161 100644 --- a/arch/parisc/configs/c3000_defconfig +++ b/arch/parisc/configs/c3000_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-pa5 +# Wed Jan 5 13:26:49 2005 # CONFIG_PARISC=y CONFIG_MMU=y @@ -11,13 +13,13 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set -# CONFIG_STANDALONE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -26,18 +28,22 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=16 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -47,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -62,6 +69,7 @@ CONFIG_PREFETCH=y # CONFIG_PARISC64 is not set # CONFIG_64BIT is not set # CONFIG_SMP is not set +# CONFIG_DISCONTIGMEM is not set # CONFIG_PREEMPT is not set # CONFIG_HPUX is not set @@ -80,14 +88,13 @@ CONFIG_CHASSIS_LCD_LED=y # CONFIG_PDC_CHASSIS is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -CONFIG_PCMCIA=m -CONFIG_PCMCIA_DEBUG=y -CONFIG_YENTA=m -CONFIG_CARDBUS=y -# CONFIG_I82092 is not set -# CONFIG_TCIC is not set # # PCI Hotplug Support @@ -107,8 +114,10 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set CONFIG_FW_LOADER=y -CONFIG_DEBUG_DRIVER=y +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -135,8 +144,20 @@ CONFIG_BLK_DEV_UMEM=m CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_CARMEL is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -147,16 +168,14 @@ CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # +# CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=m # CONFIG_IDEDISK_MULTI_MODE is not set -CONFIG_IDEDISK_STROKE=y -# CONFIG_BLK_DEV_IDECS is not set CONFIG_BLK_DEV_IDECD=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_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -170,7 +189,6 @@ CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set # CONFIG_IDEDMA_PCI_AUTO is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -217,7 +235,6 @@ CONFIG_CHR_DEV_SG=y # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_REPORT_LUNS=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set @@ -231,6 +248,7 @@ CONFIG_SCSI_FC_ATTRS=m # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set @@ -238,14 +256,18 @@ CONFIG_SCSI_FC_ATTRS=m # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y +# CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set CONFIG_SCSI_ATA_PIIX=m +# CONFIG_SCSI_SATA_NV is not set CONFIG_SCSI_SATA_PROMISE=m # CONFIG_SCSI_SATA_SX4 is not set CONFIG_SCSI_SATA_SIL=m # CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set CONFIG_SCSI_SATA_VIA=m # CONFIG_SCSI_SATA_VITESSE is not set # CONFIG_SCSI_BUSLOGIC is not set @@ -270,6 +292,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_SCSI_QLOGIC_FC=m # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=m +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -282,15 +305,6 @@ CONFIG_SCSI_QLA6322=m # CONFIG_SCSI_NSP32 is not set CONFIG_SCSI_DEBUG=m -# -# 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=m -# CONFIG_PCMCIA_SYM53C500 is not set - # # Multi-device support (RAID and LVM) # @@ -299,18 +313,22 @@ CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set # CONFIG_MD_RAID5 is not set # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=y +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=y # CONFIG_DM_CRYPT is not set +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_MIRROR is not set +# CONFIG_DM_ZERO is not set # # Fusion MPT device support # CONFIG_FUSION=m CONFIG_FUSION_MAX_SGE=40 -CONFIG_FUSION_ISENSE=m CONFIG_FUSION_CTL=m # @@ -351,6 +369,9 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_INET_AH=m CONFIG_INET_ESP=m # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -364,6 +385,9 @@ CONFIG_NETFILTER_DEBUG=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -388,15 +412,22 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set +# CONFIG_IP_NF_MATCH_REALM is not set +# CONFIG_IP_NF_MATCH_SCTP is not set +# CONFIG_IP_NF_MATCH_COMMENT is not set +# CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -408,15 +439,12 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +# CONFIG_IP_NF_RAW is not set CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m CONFIG_IP_NF_COMPAT_IPCHAINS=m CONFIG_IP_NF_COMPAT_IPFWADM=m -# CONFIG_IP_NF_RAW is not set CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -437,12 +465,12 @@ CONFIG_LLC2=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -481,13 +509,11 @@ CONFIG_NET_TULIP=y CONFIG_DE2104X=m CONFIG_TULIP=y # CONFIG_TULIP_MWI is not set -# CONFIG_TULIP_MMIO is not set +CONFIG_TULIP_MMIO=y # CONFIG_TULIP_NAPI is not set -CONFIG_DE4X5=m -CONFIG_WINBOND_840=m +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set # CONFIG_DM9102 is not set -CONFIG_PCMCIA_XIRCOM=m -CONFIG_PCMCIA_XIRTULIP=m # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=m @@ -529,6 +555,7 @@ CONFIG_E1000=m # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # @@ -548,19 +575,6 @@ CONFIG_IXGB_NAPI=y # # CONFIG_NET_RADIO is not set -# -# PCMCIA network device support -# -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_3C589=m -CONFIG_PCMCIA_3C574=m -CONFIG_PCMCIA_FMVJ18X=m -CONFIG_PCMCIA_PCNET=m -CONFIG_PCMCIA_NMCLAN=m -CONFIG_PCMCIA_SMC91C92=m -CONFIG_PCMCIA_XIRC2PS=m -CONFIG_PCMCIA_AXNET=m - # # Wan interfaces # @@ -615,6 +629,7 @@ CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=m CONFIG_SERIO_SERPORT=m # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -625,13 +640,10 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_HIL_OLD is not set -# CONFIG_KEYBOARD_HIL is not set CONFIG_INPUT_MOUSE=y # CONFIG_MOUSE_PS2 is not set # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_HIL is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -649,7 +661,6 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_CS=m CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y @@ -668,7 +679,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -688,14 +698,8 @@ CONFIG_GEN_RTC_X=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set - -# -# PCMCIA character devices -# -# CONFIG_SYNCLINK_CS is not set CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=256 @@ -704,6 +708,11 @@ CONFIG_MAX_RAW_DEVS=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -722,6 +731,8 @@ CONFIG_MAX_RAW_DEVS=256 # Graphics support # CONFIG_FB=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set @@ -734,6 +745,7 @@ CONFIG_FB_STI=y # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY 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 @@ -746,13 +758,11 @@ CONFIG_FB_STI=y # # Console display driver support # -# CONFIG_MDA_CONSOLE is not set CONFIG_STI_CONSOLE=y CONFIG_DUMMY_CONSOLE_COLUMNS=160 CONFIG_DUMMY_CONSOLE_ROWS=64 CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_PCI_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -793,6 +803,9 @@ CONFIG_USB_DEBUG=y CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -800,6 +813,7 @@ CONFIG_USB_DEVICEFS=y # CONFIG_USB_EHCI_HCD is not set CONFIG_USB_OHCI_HCD=y # CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -809,8 +823,13 @@ CONFIG_USB_OHCI_HCD=y # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_RW_DETECT is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y # CONFIG_USB_STORAGE_ISD200 is not set @@ -821,7 +840,7 @@ CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -853,7 +872,7 @@ CONFIG_USB_HPUSBSCSI=m # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -882,14 +901,24 @@ CONFIG_USB_LEGOTOWER=m # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -909,8 +938,9 @@ CONFIG_XFS_FS=m # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems @@ -926,6 +956,8 @@ CONFIG_JOLIET=y CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -937,6 +969,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -975,6 +1008,7 @@ CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -1015,6 +1049,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set @@ -1040,14 +1075,17 @@ CONFIG_OPROFILE=m # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y -# CONFIG_FRAME_POINTER is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -1061,6 +1099,7 @@ CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m # CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m @@ -1068,7 +1107,10 @@ CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +# CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set CONFIG_CRYPTO_CRC32C=m @@ -1077,6 +1119,7 @@ CONFIG_CRYPTO_TEST=m # # Library routines # +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=m diff --git a/arch/parisc/configs/n4000_defconfig b/arch/parisc/configs/n4000_defconfig index 8df4bb1cc..6cb334cb5 100644 --- a/arch/parisc/configs/n4000_defconfig +++ b/arch/parisc/configs/n4000_defconfig @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-pa5 +# Wed Jan 5 13:40:36 2005 # CONFIG_PARISC=y CONFIG_MMU=y @@ -11,13 +13,13 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set -# CONFIG_STANDALONE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -26,18 +28,22 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=16 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -47,6 +53,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -81,14 +88,13 @@ CONFIG_CHASSIS_LCD_LED=y # CONFIG_PDC_CHASSIS is not set # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -CONFIG_PCMCIA=m -CONFIG_PCMCIA_DEBUG=y -CONFIG_YENTA=m -CONFIG_CARDBUS=y -# CONFIG_I82092 is not set -# CONFIG_TCIC is not set # # PCI Hotplug Support @@ -108,8 +114,10 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # -# CONFIG_FW_LOADER is not set -CONFIG_DEBUG_DRIVER=y +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -136,10 +144,23 @@ CONFIG_BLK_DEV_UMEM=m CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_CARMEL is not set +# CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=6144 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -179,13 +200,15 @@ CONFIG_SCSI_FC_ATTRS=m # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD 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_ADVANSYS is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set @@ -209,6 +232,7 @@ CONFIG_SCSI_SYM53C8XX_IOMAPPED=y CONFIG_SCSI_QLOGIC_FC=m # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=m +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -220,13 +244,6 @@ CONFIG_SCSI_QLA6322=m # CONFIG_SCSI_DC390T is not set CONFIG_SCSI_DEBUG=m -# -# PCMCIA SCSI adapter support -# -# CONFIG_PCMCIA_FDOMAIN is not set -# CONFIG_PCMCIA_QLOGIC is not set -# CONFIG_PCMCIA_SYM53C500 is not set - # # Multi-device support (RAID and LVM) # @@ -235,9 +252,11 @@ CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y +# CONFIG_MD_RAID10 is not set # CONFIG_MD_RAID5 is not set # CONFIG_MD_RAID6 is not set # CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # @@ -245,7 +264,6 @@ CONFIG_MD_RAID1=y # CONFIG_FUSION=m CONFIG_FUSION_MAX_SGE=40 -CONFIG_FUSION_ISENSE=m CONFIG_FUSION_CTL=m # @@ -286,6 +304,9 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_INET_AH=m CONFIG_INET_ESP=m # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -299,6 +320,9 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -323,15 +347,22 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -343,16 +374,13 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -373,13 +401,12 @@ CONFIG_LLC2=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_FASTROUTE is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +CONFIG_NET_CLS_ROUTE=y # # Network testing @@ -425,8 +452,6 @@ CONFIG_TULIP_MMIO=y # CONFIG_DE4X5 is not set # CONFIG_WINBOND_840 is not set # CONFIG_DM9102 is not set -CONFIG_PCMCIA_XIRCOM=m -CONFIG_PCMCIA_XIRTULIP=m CONFIG_HP100=m CONFIG_NET_PCI=y CONFIG_PCNET32=m @@ -467,6 +492,7 @@ CONFIG_E1000_NAPI=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # @@ -491,50 +517,22 @@ CONFIG_NET_RADIO=y # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set -CONFIG_PCMCIA_WAVELAN=m -CONFIG_PCMCIA_NETWAVE=m - -# -# Wireless 802.11 Frequency Hopping cards support -# -# CONFIG_PCMCIA_RAYCS is not set # # Wireless 802.11b ISA/PCI cards support # -# CONFIG_AIRO is not set CONFIG_HERMES=m CONFIG_PLX_HERMES=m CONFIG_TMD_HERMES=m CONFIG_PCI_HERMES=m # CONFIG_ATMEL is not set -# -# Wireless 802.11b Pcmcia/Cardbus cards support -# -CONFIG_PCMCIA_HERMES=m -CONFIG_AIRO_CS=m -# CONFIG_PCMCIA_WL3501 is not set - # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # # CONFIG_PRISM54 is not set CONFIG_NET_WIRELESS=y -# -# PCMCIA network device support -# -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_3C589=m -CONFIG_PCMCIA_3C574=m -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_NMCLAN is not set -CONFIG_PCMCIA_SMC91C92=m -CONFIG_PCMCIA_XIRC2PS=m -# CONFIG_PCMCIA_AXNET is not set - # # Wan interfaces # @@ -607,7 +605,6 @@ CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set CONFIG_SERIAL_8250_NR_UARTS=8 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y @@ -625,7 +622,6 @@ CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -645,14 +641,8 @@ CONFIG_GEN_RTC_X=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set - -# -# PCMCIA character devices -# -# CONFIG_SYNCLINK_CS is not set CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=256 @@ -661,6 +651,11 @@ CONFIG_MAX_RAW_DEVS=256 # # CONFIG_I2C is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -683,7 +678,6 @@ CONFIG_MAX_RAW_DEVS=256 # # Console display driver support # -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE_COLUMNS=160 CONFIG_DUMMY_CONSOLE_ROWS=64 CONFIG_DUMMY_CONSOLE=y @@ -697,12 +691,23 @@ CONFIG_DUMMY_CONSOLE=y # USB support # # CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + # # File systems # @@ -717,6 +722,7 @@ CONFIG_JFS_FS=m # CONFIG_JFS_POSIX_ACL is not set # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set # CONFIG_XFS_QUOTA is not set @@ -725,8 +731,9 @@ CONFIG_XFS_FS=m # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS 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_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems @@ -735,6 +742,7 @@ CONFIG_ISO9660_FS=y CONFIG_JOLIET=y # CONFIG_ZISOFS is not set CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -742,6 +750,8 @@ CONFIG_UDF_FS=m CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -753,6 +763,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -793,11 +804,14 @@ CONFIG_EXPORTFS=m CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m CONFIG_SMB_NLS_DEFAULT=y CONFIG_SMB_NLS_REMOTE="cp437" CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -836,6 +850,7 @@ CONFIG_NLS_CODEPAGE_865=m # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m @@ -861,15 +876,17 @@ CONFIG_OPROFILE=m # Kernel hacking # CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_FRAME_POINTER is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -883,6 +900,7 @@ CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m @@ -890,7 +908,10 @@ CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m # CONFIG_CRYPTO_ARC4 is not set +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set CONFIG_CRYPTO_CRC32C=m @@ -899,6 +920,7 @@ CONFIG_CRYPTO_TEST=m # # Library routines # +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=m diff --git a/arch/parisc/hpux/entry_hpux.S b/arch/parisc/hpux/entry_hpux.S index 93e6e3665..fa9bf3878 100644 --- a/arch/parisc/hpux/entry_hpux.S +++ b/arch/parisc/hpux/entry_hpux.S @@ -227,7 +227,7 @@ hpux_call_table: ENTRY_NAME(hpux_unimplemented_wrapper) ENTRY_NAME(hpux_unimplemented_wrapper) /* 195 */ ENTRY_NAME(hpux_statfs) - ENTRY_NAME(hpux_unimplemented_wrapper) + ENTRY_NAME(hpux_fstatfs) ENTRY_NAME(hpux_unimplemented_wrapper) ENTRY_NAME(hpux_unimplemented_wrapper) ENTRY_NAME(sys_waitpid) /* 200 */ diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 0800eb3ea..d7c80edf4 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -43,8 +43,11 @@ int hpux_execve(struct pt_regs *regs) error = do_execve(filename, (char **) regs->gr[25], (char **)regs->gr[24], regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 569895c65..a64fd48fb 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c @@ -22,14 +22,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include +#include #include #include #include #include #include -#include #include +#include #include #include @@ -65,7 +67,6 @@ int hpux_wait(int *stat_loc) int hpux_setpgrp(void) { - extern int sys_setpgid(int, int); return sys_setpgid(0,0); } @@ -133,7 +134,7 @@ struct hpux_ustat { * aid in porting forward if and when sys_ustat() is changed from * its form in kernel 2.2.5. */ -static int hpux_ustat(dev_t dev, struct hpux_ustat *ubuf) +static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf) { struct super_block *s; struct hpux_ustat tmp; /* Changed to hpux_ustat */ @@ -148,14 +149,13 @@ static int hpux_ustat(dev_t dev, struct hpux_ustat *ubuf) if (err) goto out; - memset(&tmp,0,sizeof(struct hpux_ustat)); /* Changed to hpux_ustat */ + memset(&tmp,0,sizeof(tmp)); tmp.f_tfree = (int32_t)sbuf.f_bfree; tmp.f_tinode = (u_int32_t)sbuf.f_ffree; tmp.f_blksize = (u_int32_t)sbuf.f_bsize; /* Added this line */ - /* Changed to hpux_ustat: */ - err = copy_to_user(ubuf,&tmp,sizeof(struct hpux_ustat)) ? -EFAULT : 0; + err = copy_to_user(ubuf, &tmp, sizeof(tmp)) ? -EFAULT : 0; out: return err; } @@ -185,37 +185,62 @@ struct hpux_statfs { int16_t f_pad; }; -/* hpux statfs */ -int hpux_statfs(const char *path, struct hpux_statfs *buf) +static int vfs_statfs_hpux(struct super_block *sb, struct hpux_statfs *buf) { - int error; - int len; - char *kpath; - - len = strlen_user((char *)path); - - kpath = (char *) kmalloc(len+1, GFP_KERNEL); - if ( !kpath ) { - printk(KERN_DEBUG "failed to kmalloc kpath\n"); - return 0; - } + struct kstatfs st; + int retval; + + retval = vfs_statfs(sb, &st); + if (retval) + return retval; + + memset(buf, 0, sizeof(*buf)); + buf->f_type = st.f_type; + buf->f_bsize = st.f_bsize; + buf->f_blocks = st.f_blocks; + buf->f_bfree = st.f_bfree; + buf->f_bavail = st.f_bavail; + buf->f_files = st.f_files; + buf->f_ffree = st.f_ffree; + buf->f_fsid[0] = st.f_fsid.val[0]; + buf->f_fsid[1] = st.f_fsid.val[1]; - if ( copy_from_user(kpath, (char *)path, len+1) ) { - printk(KERN_DEBUG "failed to copy_from_user kpath\n"); - kfree(kpath); return 0; - } - - printk(KERN_DEBUG "hpux_statfs(\"%s\",-)\n", kpath); +} - kfree(kpath); +/* hpux statfs */ +asmlinkage long hpux_statfs(const char __user *path, + struct hpux_statfs __user *buf) +{ + struct nameidata nd; + int error; - /* just fake it, beginning of structures match */ - error = sys_statfs(path, (struct statfs *) buf); + error = user_path_walk(path, &nd); + if (!error) { + struct hpux_statfs tmp; + error = vfs_statfs_hpux(nd.dentry->d_inode->i_sb, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + path_release(&nd); + } + return error; +} - /* ignoring rest of statfs struct, but it should be zeros. Need to do - something with f_fsid[1], which is the fstype for sysfs */ +asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf) +{ + struct file *file; + struct hpux_statfs tmp; + int error; + error = -EBADF; + file = fget(fd); + if (!file) + goto out; + error = vfs_statfs_hpux(file->f_dentry->d_inode->i_sb, &tmp); + if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) + error = -EFAULT; + fput(file); + out: return error; } @@ -671,8 +696,8 @@ static const char *syscall_names[] = { "setdomainname", "async_daemon", "getdirentries", /* 195 */ - "statfs", - "fstatfs", + NULL, + NULL, "vfsmount", NULL, "waitpid", /* 200 */ diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile index adffb0504..04cbd5cb6 100644 --- a/arch/parisc/kernel/Makefile +++ b/arch/parisc/kernel/Makefile @@ -2,9 +2,7 @@ # Makefile for arch/parisc/kernel # -head-y := head.o -head-$(CONFIG_PARISC64) := head64.o -extra-y := init_task.o $(head-y) vmlinux.lds +extra-y := init_task.o head.o vmlinux.lds AFLAGS_entry.o := -traditional AFLAGS_pacache.o := -traditional @@ -14,7 +12,8 @@ obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \ pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \ ptrace.o hardware.o inventory.o drivers.o semaphore.o \ signal.o hpmc.o real2.o parisc_ksyms.o unaligned.o \ - process.o processor.o pdc_cons.o pdc_chassis.o unwind.o + process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \ + topology.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_PA11) += pci-dma.o diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index cf8a8583f..1ad44f92d 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -38,6 +38,7 @@ #include #include #include +#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) @@ -291,5 +292,8 @@ int main(void) DEFINE(ASM_PT_INITIAL, PT_INITIAL); DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); BLANK(); + DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); + DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); + DEFINE(EXCDATA_ADDR, offsetof(struct exception_data, fault_addr)); return 0; } diff --git a/arch/parisc/kernel/binfmt_elf32.c b/arch/parisc/kernel/binfmt_elf32.c index 4486a745b..6fd07e90a 100644 --- a/arch/parisc/kernel/binfmt_elf32.c +++ b/arch/parisc/kernel/binfmt_elf32.c @@ -92,10 +92,12 @@ struct elf_prpsinfo32 current->thread.map_base = DEFAULT_MAP_BASE32; \ current->thread.task_size = DEFAULT_TASK_SIZE32 \ -#define jiffies_to_timeval jiffies_to_compat_timeval +#undef cputime_to_timeval +#define cputime_to_timeval cputime_to_compat_timeval static __inline__ void -jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) +cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { + unsigned long jiffies = cputime_to_jiffies(cputime); value->tv_usec = (jiffies % HZ) * (1000000L / HZ); value->tv_sec = jiffies / HZ; } diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 0703ab036..f46a07a79 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -33,6 +33,17 @@ int dcache_stride; int icache_stride; EXPORT_SYMBOL(dcache_stride); + +#if defined(CONFIG_SMP) +/* On some machines (e.g. ones with the Merced bus), there can be + * only a single PxTLB broadcast at a time; this must be guaranteed + * by software. We put a spinlock around all TLB flushes to + * ensure this. + */ +DEFINE_SPINLOCK(pa_tlb_lock); +EXPORT_SYMBOL(pa_tlb_lock); +#endif + struct pdc_cache_info cache_info; #ifndef CONFIG_PA20 static struct pdc_btlb_info btlb_info; @@ -44,6 +55,11 @@ flush_data_cache(void) { on_each_cpu((void (*)(void *))flush_data_cache_local, NULL, 1, 1); } +void +flush_instruction_cache(void) +{ + on_each_cpu((void (*)(void *))flush_instruction_cache_local, NULL, 1, 1); +} #endif void @@ -306,3 +322,45 @@ EXPORT_SYMBOL(flush_kernel_dcache_range_asm); EXPORT_SYMBOL(flush_kernel_dcache_page); EXPORT_SYMBOL(flush_data_cache_local); EXPORT_SYMBOL(flush_kernel_icache_range_asm); + +void clear_user_page_asm(void *page, unsigned long vaddr) +{ + /* This function is implemented in assembly in pacache.S */ + extern void __clear_user_page_asm(void *page, unsigned long vaddr); + + purge_tlb_start(); + __clear_user_page_asm(page, vaddr); + purge_tlb_end(); +} + +#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ +int parisc_cache_flush_threshold = FLUSH_THRESHOLD; + +void parisc_setup_cache_timing(void) +{ + unsigned long rangetime, alltime; + extern char _text; /* start of kernel code, defined by linker */ + extern char _end; /* end of BSS, defined by linker */ + unsigned long size; + + alltime = mfctl(16); + flush_data_cache(); + alltime = mfctl(16) - alltime; + + size = (unsigned long)(&_end - _text); + rangetime = mfctl(16); + flush_kernel_dcache_range((unsigned long)&_text, size); + rangetime = mfctl(16) - rangetime; + + printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n", + alltime, size, rangetime); + + /* Racy, but if we see an intermediate value, it's ok too... */ + parisc_cache_flush_threshold = size * alltime / rangetime; + + parisc_cache_flush_threshold = (parisc_cache_flush_threshold + L1_CACHE_BYTES - 1) &~ (L1_CACHE_BYTES - 1); + if (!parisc_cache_flush_threshold) + parisc_cache_flush_threshold = FLUSH_THRESHOLD; + + printk("Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus()); +} diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 50130b945..1f69914ca 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c @@ -10,9 +10,21 @@ * Copyright (c) 2001 Matthew Wilcox for Hewlett Packard * Copyright (c) 2001 Helge Deller * Copyright (c) 2001,2002 Ryan Bradetich + * Copyright (c) 2004 Thibaut VARENE * * The file handles registering devices and drivers, then matching them. * It's the closest we get to a dating agency. + * + * If you're thinking about modifying this file, here are some gotchas to + * bear in mind: + * - 715/Mirage device paths have a dummy device between Lasi and its children + * - The EISA adapter may show up as a sibling or child of Wax + * - Dino has an optionally functional serial port. If firmware enables it, + * it shows up as a child of Dino. If firmware disables it, the buswalk + * finds it and it shows up as a child of Cujo + * - Dino has both parisc and pci devices as children + * - parisc devices are discovered in a random order, including children + * before parents in some cases. */ #include @@ -30,13 +42,16 @@ struct hppa_dma_ops *hppa_dma_ops; EXPORT_SYMBOL(hppa_dma_ops); -static struct parisc_device root; +static struct device root = { + .bus_id = "parisc", +}; -#define for_each_padev(dev) \ - for (dev = root.child; dev != NULL; dev = next_dev(dev)) +#define for_each_padev(padev) \ + for (padev = next_dev(&root); padev != NULL; \ + padev = next_dev(&padev->dev)) -#define check_dev(dev) \ - (dev->id.hw_type != HPHW_FAULTY) ? dev : next_dev(dev) +#define check_dev(padev) \ + (padev->id.hw_type != HPHW_FAULTY) ? padev : next_dev(&padev->dev) /** * next_dev - enumerates registered devices @@ -45,20 +60,20 @@ static struct parisc_device root; * next_dev does a depth-first search of the tree, returning parents * before children. Returns NULL when there are no more devices. */ -struct parisc_device *next_dev(struct parisc_device *dev) +static struct parisc_device *next_dev(struct device *dev) { - if (dev->child) { - return check_dev(dev->child); - } else if (dev->sibling) { - return dev->sibling; + if (!list_empty(&dev->children)) { + dev = list_to_dev(dev->children.next); + return check_dev(to_parisc_device(dev)); } - /* Exhausted tree at this level, time to go up. */ - do { + while (dev != &root) { + if (dev->node.next != &dev->parent->children) { + dev = list_to_dev(dev->node.next); + return to_parisc_device(dev); + } dev = dev->parent; - if (dev && dev->sibling) - return dev->sibling; - } while (dev != &root); + } return NULL; } @@ -209,24 +224,58 @@ static struct parisc_device *find_device_by_addr(unsigned long hpa) * Walks up the device tree looking for a device of the specified type. * If it finds it, it returns it. If not, it returns NULL. */ -const struct parisc_device *find_pa_parent_type(const struct parisc_device *dev, int type) +const struct parisc_device * +find_pa_parent_type(const struct parisc_device *padev, int type) { + const struct device *dev = &padev->dev; while (dev != &root) { - if (dev->id.hw_type == type) - return dev; + struct parisc_device *candidate = to_parisc_device(dev); + if (candidate->id.hw_type == type) + return candidate; dev = dev->parent; } return NULL; } -static void -get_node_path(struct parisc_device *dev, struct hardware_path *path) +#ifdef CONFIG_PCI +static inline int is_pci_dev(struct device *dev) +{ + return dev->bus == &pci_bus_type; +} +#else +static inline int is_pci_dev(struct device *dev) +{ + return 0; +} +#endif + +/* + * get_node_path fills in @path with the firmware path to the device. + * Note that if @node is a parisc device, we don't fill in the 'mod' field. + * This is because both callers pass the parent and fill in the mod + * themselves. If @node is a PCI device, we do fill it in, even though this + * is inconsistent. + */ +static void get_node_path(struct device *dev, struct hardware_path *path) { int i = 5; memset(&path->bc, -1, 6); + + if (is_pci_dev(dev)) { + unsigned int devfn = to_pci_dev(dev)->devfn; + path->mod = PCI_FUNC(devfn); + path->bc[i--] = PCI_SLOT(devfn); + dev = dev->parent; + } + while (dev != &root) { - path->bc[i--] = dev->hw_path; + if (is_pci_dev(dev)) { + unsigned int devfn = to_pci_dev(dev)->devfn; + path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn)<< 5); + } else if (dev->bus == &parisc_bus_type) { + path->bc[i--] = to_parisc_device(dev)->hw_path; + } dev = dev->parent; } } @@ -256,7 +305,7 @@ char *print_pa_hwpath(struct parisc_device *dev, char *output) { struct hardware_path path; - get_node_path(dev->parent, &path); + get_node_path(dev->dev.parent, &path); path.mod = dev->hw_path; return print_hwpath(&path, output); } @@ -264,33 +313,17 @@ EXPORT_SYMBOL(print_pa_hwpath); #if defined(CONFIG_PCI) || defined(CONFIG_ISA) /** - * get_pci_node_path - Returns hardware path for PCI devices - * dev: The device to return the path for - * output: Pointer to a previously-allocated array to place the path in. + * get_pci_node_path - Determines the hardware path for a PCI device + * @pdev: The device to return the path for + * @path: Pointer to a previously-allocated array to place the path in. * * This function fills in the hardware_path structure with the route to * the specified PCI device. This structure is suitable for passing to * PDC calls. */ -void get_pci_node_path(struct pci_dev *dev, struct hardware_path *path) +void get_pci_node_path(struct pci_dev *pdev, struct hardware_path *path) { - struct pci_bus *bus; - const struct parisc_device *padev; - int i = 5; - - memset(&path->bc, -1, 6); - path->mod = PCI_FUNC(dev->devfn); - path->bc[i--] = PCI_SLOT(dev->devfn); - for (bus = dev->bus; bus->parent; bus = bus->parent) { - unsigned int devfn = bus->self->devfn; - path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn) << 5); - } - - padev = HBA_DATA(bus->bridge->platform_data)->dev; - while (padev != &root) { - path->bc[i--] = padev->hw_path; - padev = padev->parent; - } + get_node_path(&pdev->dev, path); } EXPORT_SYMBOL(get_pci_node_path); @@ -314,19 +347,43 @@ EXPORT_SYMBOL(print_pci_hwpath); #endif /* defined(CONFIG_PCI) || defined(CONFIG_ISA) */ +static void setup_bus_id(struct parisc_device *padev) +{ + struct hardware_path path; + char *output = padev->dev.bus_id; + int i; + + get_node_path(padev->dev.parent, &path); -struct parisc_device * create_tree_node(char id, struct parisc_device *parent, - struct parisc_device **insert) + for (i = 0; i < 6; i++) { + if (path.bc[i] == -1) + continue; + output += sprintf(output, "%u:", (unsigned char) path.bc[i]); + } + sprintf(output, "%u", (unsigned char) padev->hw_path); +} + +struct parisc_device * create_tree_node(char id, struct device *parent) { struct parisc_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL; + memset(dev, 0, sizeof(*dev)); dev->hw_path = id; dev->id.hw_type = HPHW_FAULTY; - dev->parent = parent; - dev->sibling = *insert; - *insert = dev; + + dev->dev.parent = parent; + setup_bus_id(dev); + + dev->dev.bus = &parisc_bus_type; + dev->dma_mask = 0xffffffffUL; /* PARISC devices are 32-bit */ + + /* make the generic dma mask a pointer to the parisc one */ + dev->dev.dma_mask = &dev->dma_mask; + dev->dev.coherent_dma_mask = dev->dma_mask; + device_register(&dev->dev); + return dev; } @@ -338,36 +395,27 @@ struct parisc_device * create_tree_node(char id, struct parisc_device *parent, * Checks all the children of @parent for a matching @id. If none * found, it allocates a new device and returns it. */ -struct parisc_device * -alloc_tree_node(struct parisc_device *parent, char id) +static struct parisc_device * alloc_tree_node(struct device *parent, char id) { - struct parisc_device *prev; - if ((!parent->child) || (parent->child->hw_path > id)) { - return create_tree_node(id, parent, &parent->child); - } + struct device *dev; - prev = parent->child; - if (prev->hw_path == id) - return prev; - - while (prev->sibling && prev->sibling->hw_path < id) { - prev = prev->sibling; + list_for_each_entry(dev, &parent->children, node) { + struct parisc_device *padev = to_parisc_device(dev); + if (padev->hw_path == id) + return padev; } - if ((prev->sibling) && (prev->sibling->hw_path == id)) - return prev->sibling; - - return create_tree_node(id, parent, &prev->sibling); + return create_tree_node(id, parent); } -static struct parisc_device *find_parisc_device(struct hardware_path *modpath) +static struct parisc_device *create_parisc_device(struct hardware_path *modpath) { int i; - struct parisc_device *parent = &root; + struct device *parent = &root; for (i = 0; i < 6; i++) { if (modpath->bc[i] == -1) continue; - parent = alloc_tree_node(parent, modpath->bc[i]); + parent = &alloc_tree_node(parent, modpath->bc[i])->dev; } return alloc_tree_node(parent, modpath->mod); } @@ -389,7 +437,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) if (status != PDC_OK) return NULL; - dev = find_parisc_device(mod_path); + dev = create_parisc_device(mod_path); if (dev->id.hw_type != HPHW_FAULTY) { char p[64]; print_pa_hwpath(dev, p); @@ -414,12 +462,37 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) static int parisc_generic_match(struct device *dev, struct device_driver *drv) { - return match_device(to_parisc_driver(drv), to_parisc_device(dev)); + return match_device(to_parisc_driver(drv), to_parisc_device(dev)); +} + +#define pa_dev_attr(name, field, format_string) \ +static ssize_t name##_show(struct device *dev, char *buf) \ +{ \ + struct parisc_device *padev = to_parisc_device(dev); \ + return sprintf(buf, format_string, padev->field); \ } +#define pa_dev_attr_id(field, format) pa_dev_attr(field, id.field, format) + +pa_dev_attr(irq, irq, "%u\n"); +pa_dev_attr_id(hw_type, "0x%02x\n"); +pa_dev_attr(rev, id.hversion_rev, "0x%x\n"); +pa_dev_attr_id(hversion, "0x%03x\n"); +pa_dev_attr_id(sversion, "0x%05x\n"); + +static struct device_attribute parisc_device_attrs[] = { + __ATTR_RO(irq), + __ATTR_RO(hw_type), + __ATTR_RO(rev), + __ATTR_RO(hversion), + __ATTR_RO(sversion), + __ATTR_NULL, +}; + struct bus_type parisc_bus_type = { .name = "parisc", .match = parisc_generic_match, + .dev_attrs = parisc_device_attrs, }; /** @@ -440,6 +513,104 @@ int register_parisc_device(struct parisc_device *dev) return 0; } +/** + * match_pci_device - Matches a pci device against a given hardware path + * entry. + * @dev: the generic device (known to be contained by a pci_dev). + * @index: the current BC index + * @modpath: the hardware path. + * @return: true if the device matches the hardware path. + */ +static int match_pci_device(struct device *dev, int index, + struct hardware_path *modpath) +{ + struct pci_dev *pdev = to_pci_dev(dev); + int id; + + if (index == 5) { + /* we are at the end of the path, and on the actual device */ + unsigned int devfn = pdev->devfn; + return ((modpath->bc[5] == PCI_SLOT(devfn)) && + (modpath->mod == PCI_FUNC(devfn))); + } + + id = PCI_SLOT(pdev->devfn) | (PCI_FUNC(pdev->devfn) << 5); + return (modpath->bc[index] == id); +} + +/** + * match_parisc_device - Matches a parisc device against a given hardware + * path entry. + * @dev: the generic device (known to be contained by a parisc_device). + * @index: the current BC index + * @modpath: the hardware path. + * @return: true if the device matches the hardware path. + */ +static int match_parisc_device(struct device *dev, int index, + struct hardware_path *modpath) +{ + struct parisc_device *curr = to_parisc_device(dev); + char id = (index == 6) ? modpath->mod : modpath->bc[index]; + + return (curr->hw_path == id); +} + +/** + * parse_tree_node - returns a device entry in the iotree + * @parent: the parent node in the tree + * @index: the current BC index + * @modpath: the hardware_path struct to match a device against + * @return: The corresponding device if found, NULL otherwise. + * + * Checks all the children of @parent for a matching @id. If none + * found, it returns NULL. + */ +static struct device * +parse_tree_node(struct device *parent, int index, struct hardware_path *modpath) +{ + struct device *device; + + list_for_each_entry(device, &parent->children, node) { + if (device->bus == &parisc_bus_type) { + if (match_parisc_device(device, index, modpath)) + return device; + } else if (is_pci_dev(device)) { + if (match_pci_device(device, index, modpath)) + return device; + } else if (device->bus == NULL) { + /* we are on a bus bridge */ + struct device *new = parse_tree_node(device, index, modpath); + if (new) + return new; + } + } + + return NULL; +} + +/** + * hwpath_to_device - Finds the generic device corresponding to a given hardware path. + * @modpath: the hardware path. + * @return: The target device, NULL if not found. + */ +struct device *hwpath_to_device(struct hardware_path *modpath) +{ + int i; + struct device *parent = &root; + for (i = 0; i < 6; i++) { + if (modpath->bc[i] == -1) + continue; + parent = parse_tree_node(parent, i, modpath); + if (!parent) + return NULL; + } + if (is_pci_dev(parent)) /* pci devices already parse MOD */ + return parent; + else + return parse_tree_node(parent, 6, modpath); +} +EXPORT_SYMBOL(hwpath_to_device); + #define BC_PORT_MASK 0x8 #define BC_LOWER_PORT 0x8 @@ -447,7 +618,7 @@ int register_parisc_device(struct parisc_device *dev) ((dev->id.hw_type == HPHW_IOA) || (dev->id.hw_type == HPHW_BCPORT)) #define IS_LOWER_PORT(dev) \ - ((gsc_readl(&((struct bc_module *)dev->hpa)->io_status) \ + ((gsc_readl(dev->hpa + offsetof(struct bc_module, io_status)) \ & BC_PORT_MASK) == BC_LOWER_PORT) #define MAX_NATIVE_DEVICES 64 @@ -456,11 +627,11 @@ int register_parisc_device(struct parisc_device *dev) #define FLEX_MASK F_EXTEND(0xfffc0000) #define IO_IO_LOW offsetof(struct bc_module, io_io_low) #define IO_IO_HIGH offsetof(struct bc_module, io_io_high) -#define READ_IO_IO_LOW(dev) (unsigned long)(signed int)__raw_readl(dev->hpa + IO_IO_LOW) -#define READ_IO_IO_HIGH(dev) (unsigned long)(signed int)__raw_readl(dev->hpa + IO_IO_HIGH) +#define READ_IO_IO_LOW(dev) (unsigned long)(signed int)gsc_readl(dev->hpa + IO_IO_LOW) +#define READ_IO_IO_HIGH(dev) (unsigned long)(signed int)gsc_readl(dev->hpa + IO_IO_HIGH) static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high, - struct parisc_device *parent); + struct device *parent); void walk_lower_bus(struct parisc_device *dev) { @@ -477,7 +648,7 @@ void walk_lower_bus(struct parisc_device *dev) io_io_high = (READ_IO_IO_HIGH(dev)+ ~FLEX_MASK) & FLEX_MASK; } - walk_native_bus(io_io_low, io_io_high, dev); + walk_native_bus(io_io_low, io_io_high, &dev->dev); } /** @@ -493,7 +664,7 @@ void walk_lower_bus(struct parisc_device *dev) * keyboard ports). This problem is not yet solved. */ static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high, - struct parisc_device *parent) + struct device *parent) { int i, devices_found = 0; unsigned long hpa = io_io_low; @@ -535,25 +706,6 @@ void walk_central_bus(void) &root); } -void fixup_child_irqs(struct parisc_device *parent, int base, - int (*choose_irq)(struct parisc_device *)) -{ - struct parisc_device *dev; - - if (!parent->child) - return; - - for (dev = check_dev(parent->child); dev; dev = dev->sibling) { - int irq = choose_irq(dev); - if (irq > 0) { -#ifdef __LP64__ - irq += 32; -#endif - dev->irq = base + irq; - } - } -} - static void print_parisc_device(struct parisc_device *dev) { char hw_path[64]; @@ -573,68 +725,14 @@ static void print_parisc_device(struct parisc_device *dev) printk("\n"); } -void print_subdevices(struct parisc_device *parent) -{ - struct parisc_device *dev; - for (dev = parent->child; dev != parent->sibling; dev = next_dev(dev)) { - print_parisc_device(dev); - } -} - - -/* - * parisc_generic_device_register_recursive() - internal function to recursively - * register all parisc devices - */ -static void parisc_generic_device_register_recursive( struct parisc_device *dev ) -{ - char tmp1[32]; - - /* has this device been registered already ? */ - if (dev->dev.dma_mask != NULL) - return; - - /* register all parents recursively */ - if (dev->parent && dev->parent!=&root) - parisc_generic_device_register_recursive(dev->parent); - - /* set up the generic device tree for this */ - snprintf(tmp1, sizeof(tmp1), "%d", dev->hw_path); - if (dev->parent && dev->parent != &root) { - struct parisc_device *ndev; - char tmp2[32]; - - dev->dev.parent = &dev->parent->dev; - for(ndev = dev->parent; ndev != &root; - ndev = ndev->parent) { - snprintf(tmp2, sizeof(tmp2), "%d:%s", - ndev->hw_path, tmp1); - strlcpy(tmp1, tmp2, sizeof(tmp1)); - } - } - - dev->dev.bus = &parisc_bus_type; - snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), "parisc%s", - tmp1); - /* make the generic dma mask a pointer to the parisc one */ - dev->dev.dma_mask = &dev->dma_mask; - dev->dev.coherent_dma_mask = dev->dma_mask; - pr_debug("device_register(%s)\n", dev->dev.bus_id); - device_register(&dev->dev); -} - -/* - * parisc_generic_device_register() - register all parisc devices +/** + * init_parisc_bus - Some preparation to be done before inventory */ -void parisc_generic_device_register(void) +void init_parisc_bus(void) { - struct parisc_device *dev; - bus_register(&parisc_bus_type); - - for_each_padev(dev) { - parisc_generic_device_register_recursive( dev ); - } + device_register(&root); + get_device(&root); } /** diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index baee63278..b1dd08b03 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -440,8 +440,17 @@ mfctl %cr25,\reg .endm - /* Only allow faults on different spaces from the - * currently active one if we're the kernel */ + /* + space_check(spc,tmp,fault) + + spc - The space we saw the fault with. + tmp - The place to store the current space. + fault - Function to call on failure. + + Only allow faults on different spaces from the + currently active one if we're the kernel + + */ .macro space_check spc,tmp,fault mfsp %sr7,\tmp or,COND(<>) %r0,\spc,%r0 /* user may execute gateway page @@ -774,7 +783,7 @@ __kernel_thread: #ifdef __LP64__ ldo -16(%r30),%r29 /* Reference param save area */ #endif - bl do_fork, %r2 + BL do_fork, %r2 copy %r1, %r24 /* pt_regs */ /* Parent Returns here */ @@ -827,7 +836,7 @@ __execve: #ifdef __LP64__ ldo -16(%r30),%r29 /* Reference param save area */ #endif - bl sys_execve, %r2 + BL sys_execve, %r2 copy %r16, %r26 cmpib,=,n 0,%r28,intr_return /* forward */ @@ -939,6 +948,7 @@ syscall_exit_rfi: STREG %r19,PT_SR7(%r16) intr_return: + /* NOTE: Need to enable interrupts incase we schedule. */ ssm PSW_SM_I, %r0 /* Check for software interrupts */ @@ -982,6 +992,8 @@ intr_restore: ldo PT_FR31(%r29),%r1 rest_fp %r1 rest_general %r29 + + /* Create a "relied upon translation" PA 2.0 Arch. F-5 */ ssm 0,%r0 nop nop @@ -992,8 +1004,15 @@ intr_restore: nop tophys_r1 %r29 rsm (PSW_SM_Q|PSW_SM_P|PSW_SM_D|PSW_SM_I),%r0 + + /* Restore space id's and special cr's from PT_REGS + * structure pointed to by r29 */ rest_specials %r29 + + /* Important: Note that rest_stack restores r29 + * last (we are using it)! It also restores r1 and r30. */ rest_stack + rfi nop nop @@ -1036,7 +1055,14 @@ intr_do_resched: .import do_signal,code intr_do_signal: - /* Only do signals if we are returning to user space */ + /* + This check is critical to having LWS + working. The IASQ is zero on the gateway + page and we cannot deliver any signals until + we get off the gateway page. + + Only do signals if we are returning to user space + */ LDREG PT_IASQ0(%r16), %r20 CMPIB= 0,%r20,intr_restore /* backward */ nop @@ -1050,7 +1076,7 @@ intr_do_signal: ldo -16(%r30),%r29 /* Reference param save area */ #endif - bl do_signal,%r2 + BL do_signal,%r2 copy %r0, %r26 /* sigset_t *oldset = NULL */ b intr_restore @@ -1443,15 +1469,20 @@ nadtlb_emulate: * of the instruction. Since we don't insert a translation * we can get a lot of faults during a flush loop, so it makes * sense to try to do it here with minimum overhead. We only - * emulate fdc,fic & pdc instructions whose base and index - * registers are not shadowed. We defer everything else to the - * "slow" path. + * emulate fdc,fic,pdc,probew,prober instructions whose base + * and index registers are not shadowed. We defer everything + * else to the "slow" path. */ mfctl %cr19,%r9 /* Get iir */ + + /* PA 2.0 Arch Ref. Book pg 382 has a good description of the insn bits. + Checks for fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw */ + + /* Checks for fdc,fdce,pdc,"fic,4f" only */ ldi 0x280,%r16 and %r9,%r16,%r17 - cmpb,<>,n %r16,%r17,nadtlb_fault /* Not fdc,fic,pdc */ + cmpb,<>,n %r16,%r17,nadtlb_probe_check bb,>=,n %r9,26,nadtlb_nullify /* m bit not set, just nullify */ BL get_register,%r25 extrw,u %r9,15,5,%r8 /* Get index register # */ @@ -1472,6 +1503,32 @@ nadtlb_nullify: rfir nop + /* + When there is no translation for the probe address then we + must nullify the insn and return zero in the target regsiter. + This will indicate to the calling code that it does not have + write/read privileges to this address. + + This should technically work for prober and probew in PA 1.1, + and also probe,r and probe,w in PA 2.0 + + WARNING: USE ONLY NON-SHADOW REGISTERS WITH PROBE INSN! + THE SLOW-PATH EMULATION HAS NOT BEEN WRITTEN YET. + + */ +nadtlb_probe_check: + ldi 0x80,%r16 + and %r9,%r16,%r17 + cmpb,<>,n %r16,%r17,nadtlb_fault /* Must be probe,[rw]*/ + BL get_register,%r25 /* Find the target register */ + extrw,u %r9,31,5,%r8 /* Get target register */ + CMPIB=,n -1,%r1,nadtlb_fault /* have to use slow path */ + BL set_register,%r25 + copy %r0,%r1 /* Write zero to target register */ + b nadtlb_nullify /* Nullify return insn */ + nop + + #ifdef __LP64__ itlb_miss_20w: @@ -1762,7 +1819,7 @@ sys_fork_wrapper: LDREG PT_GR30(%r1),%r25 copy %r1,%r24 - bl sys_clone,%r2 + BL sys_clone,%r2 ldi SIGCHLD,%r26 LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 @@ -1782,7 +1839,7 @@ wrapper_exit: /* Set the return value for the child */ child_return: - bl schedule_tail, %r2 + BL schedule_tail, %r2 nop LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE-FRAME_SIZE(%r30), %r1 @@ -1807,7 +1864,7 @@ sys_clone_wrapper: STREG %r2,PT_GR19(%r1) /* save for child */ STREG %r30,PT_GR21(%r1) - bl sys_clone,%r2 + BL sys_clone,%r2 copy %r1,%r24 b wrapper_exit @@ -1830,7 +1887,7 @@ sys_vfork_wrapper: STREG %r2,PT_GR19(%r1) /* save for child */ STREG %r30,PT_GR21(%r1) - bl sys_vfork,%r2 + BL sys_vfork,%r2 copy %r1,%r26 b wrapper_exit @@ -1893,10 +1950,10 @@ sys_rt_sigreturn_wrapper: STREG %r2, -RP_OFFSET(%r30) #ifdef __LP64__ ldo FRAME_SIZE(%r30), %r30 - bl sys_rt_sigreturn,%r2 + BL sys_rt_sigreturn,%r2 ldo -16(%r30),%r29 /* Reference param save area */ #else - bl sys_rt_sigreturn,%r2 + BL sys_rt_sigreturn,%r2 ldo FRAME_SIZE(%r30), %r30 #endif @@ -1924,7 +1981,7 @@ sys_sigaltstack_wrapper: STREG %r2, -RP_OFFSET(%r30) #ifdef __LP64__ ldo FRAME_SIZE(%r30), %r30 - bl do_sigaltstack,%r2 + b,l do_sigaltstack,%r2 ldo -16(%r30),%r29 /* Reference param save area */ #else bl do_sigaltstack,%r2 @@ -1944,7 +2001,7 @@ sys32_sigaltstack_wrapper: LDREG TASK_PT_GR30(%r24),%r24 STREG %r2, -RP_OFFSET(%r30) ldo FRAME_SIZE(%r30), %r30 - bl do_sigaltstack32,%r2 + b,l do_sigaltstack32,%r2 ldo -16(%r30),%r29 /* Reference param save area */ ldo -FRAME_SIZE(%r30), %r30 @@ -1962,7 +2019,7 @@ sys_rt_sigsuspend_wrapper: STREG %r2, -RP_OFFSET(%r30) #ifdef __LP64__ ldo FRAME_SIZE(%r30), %r30 - bl sys_rt_sigsuspend,%r2 + b,l sys_rt_sigsuspend,%r2 ldo -16(%r30),%r29 /* Reference param save area */ #else bl sys_rt_sigsuspend,%r2 @@ -1981,9 +2038,11 @@ sys_rt_sigsuspend_wrapper: .export syscall_exit syscall_exit: + /* NOTE: HP-UX syscalls also come through here - after hpux_syscall_exit fixes up return - values. */ + * after hpux_syscall_exit fixes up return + * values. */ + /* NOTE: Not all syscalls exit this way. rt_sigreturn will exit * via syscall_exit_rfi if the signal was received while the process * was running. @@ -2082,11 +2141,15 @@ syscall_restore: LDREG TASK_PT_GR29(%r1),%r29 LDREG TASK_PT_GR31(%r1),%r31 /* restore syscall rp */ + /* NOTE: We use rsm/ssm pair to make this operation atomic */ rsm PSW_SM_I, %r0 LDREG TASK_PT_GR30(%r1),%r30 /* restore user sp */ mfsp %sr3,%r1 /* Get users space id */ mtsp %r1,%sr7 /* Restore sr7 */ ssm PSW_SM_I, %r0 + + /* Set sr2 to zero for userspace syscalls to work. */ + mtsp %r0,%sr2 mtsp %r1,%sr4 /* Restore sr4 */ mtsp %r1,%sr5 /* Restore sr5 */ mtsp %r1,%sr6 /* Restore sr6 */ @@ -2154,12 +2217,18 @@ syscall_restore_rfi: bb,< %r2,30,pt_regs_ok /* Branch if D set */ ldo TASK_REGS(%r1),%r25 reg_save %r25 /* Save r3 to r18 */ + + /* Save the current sr */ mfsp %sr0,%r2 STREG %r2,TASK_PT_SR0(%r1) + + /* Save the scratch sr */ mfsp %sr1,%r2 STREG %r2,TASK_PT_SR1(%r1) - mfsp %sr2,%r2 - STREG %r2,TASK_PT_SR2(%r1) + + /* sr2 should be set to zero for userspace syscalls */ + STREG %r0,TASK_PT_SR2(%r1) + pt_regs_ok: LDREG TASK_PT_GR31(%r1),%r2 depi 3,31,2,%r2 /* ensure return to user mode. */ @@ -2174,12 +2243,15 @@ pt_regs_ok: syscall_do_softirq: bl do_softirq,%r2 nop + /* NOTE: We enable I-bit incase we schedule later, + * and we might be going back to userspace if we were + * traced. */ b syscall_check_resched ssm PSW_SM_I, %r0 /* do_softirq returns with I bit off */ .import schedule,code syscall_do_resched: - bl schedule,%r2 + BL schedule,%r2 #ifdef __LP64__ ldo -16(%r30),%r29 /* Reference param save area */ #else @@ -2203,7 +2275,7 @@ syscall_do_signal: #ifdef __LP64__ ldo -16(%r30),%r29 /* Reference param save area */ #endif - bl do_signal,%r2 + BL do_signal,%r2 copy %r0, %r26 /* sigset_t *oldset = NULL */ LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index 6ab67aadd..e8b722d25 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -11,6 +11,7 @@ * Copyright 1999 The Puffin Group, (Alex deVries, David Kennedy) * Copyright 2003 Grant Grundler * Copyright 2003,2004 Ryan Bradetich + * Copyright 2004 Thibaut VARENE * * 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 @@ -69,7 +70,7 @@ #include #include /* for boot_cpu_data */ -static spinlock_t pdc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pdc_lock); static unsigned long pdc_result[32] __attribute__ ((aligned (8))); static unsigned long pdc_result2[32] __attribute__ ((aligned (8))); @@ -573,14 +574,118 @@ int pdc_lan_station_id(char *lan_addr, unsigned long hpa) } EXPORT_SYMBOL(pdc_lan_station_id); +/** + * pdc_stable_read - Read data from Stable Storage. + * @staddr: Stable Storage address to access. + * @memaddr: The memory address where Stable Storage data shall be copied. + * @count: number of bytes to transfert. count is multiple of 4. + * + * This PDC call reads from the Stable Storage address supplied in staddr + * and copies count bytes to the memory address memaddr. + * The call will fail if staddr+count > PDC_STABLE size. + */ +int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count) +{ + int retval; + + spin_lock_irq(&pdc_lock); + retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_READ, staddr, + __pa(pdc_result), count); + convert_to_wide(pdc_result); + memcpy(memaddr, pdc_result, count); + spin_unlock_irq(&pdc_lock); + + return retval; +} +EXPORT_SYMBOL(pdc_stable_read); + +/** + * pdc_stable_write - Write data to Stable Storage. + * @staddr: Stable Storage address to access. + * @memaddr: The memory address where Stable Storage data shall be read from. + * @count: number of bytes to transfert. count is multiple of 4. + * + * This PDC call reads count bytes from the supplied memaddr address, + * and copies count bytes to the Stable Storage address staddr. + * The call will fail if staddr+count > PDC_STABLE size. + */ +int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count) +{ + int retval; + + spin_lock_irq(&pdc_lock); + memcpy(pdc_result, memaddr, count); + convert_to_wide(pdc_result); + retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_WRITE, staddr, + __pa(pdc_result), count); + spin_unlock_irq(&pdc_lock); + + return retval; +} +EXPORT_SYMBOL(pdc_stable_write); + +/** + * pdc_stable_get_size - Get Stable Storage size in bytes. + * @size: pointer where the size will be stored. + * + * This PDC call returns the number of bytes in the processor's Stable + * Storage, which is the number of contiguous bytes implemented in Stable + * Storage starting from staddr=0. size in an unsigned 64-bit integer + * which is a multiple of four. + */ +int pdc_stable_get_size(unsigned long *size) +{ + int retval; + + spin_lock_irq(&pdc_lock); + retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_RETURN_SIZE, __pa(pdc_result)); + *size = pdc_result[0]; + spin_unlock_irq(&pdc_lock); + + return retval; +} +EXPORT_SYMBOL(pdc_stable_get_size); + +/** + * pdc_stable_verify_contents - Checks that Stable Storage contents are valid. + * + * This PDC call is meant to be used to check the integrity of the current + * contents of Stable Storage. + */ +int pdc_stable_verify_contents(void) +{ + int retval; + + spin_lock_irq(&pdc_lock); + retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_VERIFY_CONTENTS); + spin_unlock_irq(&pdc_lock); + + return retval; +} +EXPORT_SYMBOL(pdc_stable_verify_contents); + +/** + * pdc_stable_initialize - Sets Stable Storage contents to zero and initialize + * the validity indicator. + * + * This PDC call will erase all contents of Stable Storage. Use with care! + */ +int pdc_stable_initialize(void) +{ + int retval; + + spin_lock_irq(&pdc_lock); + retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_INITIALIZE); + spin_unlock_irq(&pdc_lock); + + return retval; +} +EXPORT_SYMBOL(pdc_stable_initialize); /** * pdc_get_initiator - Get the SCSI Interface Card params (SCSI ID, SDTR, SE or LVD) * @hwpath: fully bc.mod style path to the device. - * @scsi_id: what someone told firmware the ID should be. - * @period: time in cycles - * @width: 8 or 16-bit wide bus - * @mode: 0,1,2 -> SE,HVD,LVD signalling mode + * @initiator: the array to return the result into * * Get the SCSI operational parameters from PDC. * Needed since HPUX never used BIOS or symbios card NVRAM. @@ -591,8 +696,7 @@ EXPORT_SYMBOL(pdc_lan_station_id); * o cable too long (ie SE scsi 10Mhz won't support 6m length), * o bus width exported is less than what the interface chip supports. */ -int pdc_get_initiator(struct hardware_path *hwpath, unsigned char *scsi_id, - unsigned long *period, char *width, char *mode) +int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initiator) { int retval; @@ -604,44 +708,38 @@ int pdc_get_initiator(struct hardware_path *hwpath, unsigned char *scsi_id, retval = mem_pdc_call(PDC_INITIATOR, PDC_GET_INITIATOR, __pa(pdc_result), __pa(hwpath)); - if (retval < PDC_OK) - goto fail; - - *scsi_id = (unsigned char) pdc_result[0]; + goto out; - /* convert Bus speed in Mhz to period (in 1/10 ns) */ - switch (pdc_result[1]) { - /* - * case 0: driver determines rate - * case -1: Settings are uninitialized. - */ - case 5: *period = 2000; break; - case 10: *period = 1000; break; - case 20: *period = 500; break; - case 40: *period = 250; break; - case 80: *period = 125; break; - default: /* Do nothing */ break; + if (pdc_result[0] < 16) { + initiator->host_id = pdc_result[0]; + } else { + initiator->host_id = -1; } - /* - * pdc_result[2] PDC suggested SCSI id - * pdc_result[3] PDC suggested SCSI rate + /* + * Sprockets and Piranha return 20 or 40 (MT/s). Prelude returns + * 1, 2, 5 or 10 for 5, 10, 20 or 40 MT/s, respectively */ + switch (pdc_result[1]) { + case 1: initiator->factor = 50; break; + case 2: initiator->factor = 25; break; + case 5: initiator->factor = 12; break; + case 25: initiator->factor = 10; break; + case 20: initiator->factor = 12; break; + case 40: initiator->factor = 10; break; + default: initiator->factor = -1; break; + } if (IS_SPROCKETS()) { - /* 0 == 8-bit, 1 == 16-bit */ - *width = (char) pdc_result[4]; - - /* ...in case someone needs it in the future. - * sym53c8xx.c comments say it can't autodetect - * for 825/825A/875 chips. - * 0 == SE, 1 == HVD, 2 == LVD - */ - *mode = (char) pdc_result[5]; + initiator->width = pdc_result[4]; + initiator->mode = pdc_result[5]; + } else { + initiator->width = -1; + initiator->mode = -1; } - fail: + out: spin_unlock_irq(&pdc_lock); return (retval >= PDC_OK); } @@ -1276,7 +1374,7 @@ struct wide_stack { long real64_call(unsigned long fn, ...) { va_list args; - extern struct wide_stack real64_stack __attribute__ ((alias ("real_stack"))); + extern struct wide_stack real64_stack; extern unsigned long real64_call_asm(unsigned long *, unsigned long *, unsigned long); diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index a3525f1e5..1fb4c05c3 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S @@ -1,12 +1,13 @@ -/* - * - * This file is subject to the terms and conditions of the GNU General Public +/* This file is subject to 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 Helge Deller * Copyright 1999 SuSE GmbH (Philipp Rumpf) * Copyright 1999 Philipp Rumpf (prumpf@tux.org) + * Copyright 2000 Hewlett Packard (Paul Bame, bame@puffin.external.hp.com) + * Copyright (C) 2001 Grant Grundler (Hewlett Packard) + * Copyright (C) 2004 Kyle McMartin * * Initial Version 04-23-1999 by Helge Deller */ @@ -15,12 +16,12 @@ #include #include - +#include + #include #include - - .level 1.1 + .level LEVEL .data @@ -32,12 +33,13 @@ boot_args: .word 0 /* arg3 */ .text - .align 4 + .align 4 .import init_thread_union,data + .import fault_vector_20,code /* IVA parisc 2.0 32 bit */ +#ifndef __LP64__ + .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ .import $global$ /* forward declaration */ - .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ - .import fault_vector_20,code /* IVA parisc 2.0 32 bit */ - +#endif /*!LP64*/ .export stext .export _stext,data /* Kernel want it this way! */ _stext: @@ -56,72 +58,84 @@ stext: .import __bss_start,data .import __bss_stop,data - ldil L%PA(__bss_start),%r3 - ldo R%PA(__bss_start)(%r3),%r3 - ldil L%PA(__bss_stop),%r4 - ldo R%PA(__bss_stop)(%r4),%r4 + load32 PA(__bss_start),%r3 + load32 PA(__bss_stop),%r4 $bss_loop: cmpb,<<,n %r3,%r4,$bss_loop stw,ma %r0,4(%r3) /* Save away the arguments the boot loader passed in (32 bit args) */ - - ldil L%PA(boot_args),%r1 - ldo R%PA(boot_args)(%r1),%r1 + load32 PA(boot_args),%r1 stw,ma %arg0,4(%r1) stw,ma %arg1,4(%r1) stw,ma %arg2,4(%r1) stw,ma %arg3,4(%r1) /* Initialize startup VM. Just map first 8 MB of memory */ - ldil L%PA(pg0),%r1 - ldo R%PA(pg0)(%r1),%r1 - shr %r1,PxD_VALUE_SHIFT,%r3 - ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 + load32 PA(pg0),%r1 - ldil L%PA(swapper_pg_dir),%r4 - ldo R%PA(swapper_pg_dir)(%r4),%r4 +#ifdef __LP64__ + load32 PA(pmd0),%r5 + shrd %r5,PxD_VALUE_SHIFT,%r3 +#else + shr %r1,PxD_VALUE_SHIFT,%r3 +#endif + ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 + + load32 PA(swapper_pg_dir),%r4 mtctl %r4,%cr24 /* Initialize kernel root pointer */ mtctl %r4,%cr25 /* Initialize user root pointer */ + +#ifdef __LP64__ + stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4) + shrd %r1,PxD_VALUE_SHIFT,%r3 + ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 + ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r5 +#else + ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 +#endif ldi ASM_PT_INITIAL,%r1 - ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 + 1: +#ifdef __LP64__ + stw %r3,0(%r5) +#else stw %r3,0(%r4) +#endif + ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 addib,> -1,%r1,1b + +#ifdef __LP64__ + ldo ASM_PMD_ENTRY_SIZE(%r5),%r5 +#else ldo ASM_PGD_ENTRY_SIZE(%r4),%r4 +#endif ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ - ldil L%PA(pg0),%r1 - ldo R%PA(pg0)(%r1),%r1 + load32 PA(pg0),%r1 + $pgt_fill_loop: - stwm %r3,ASM_PTE_ENTRY_SIZE(%r1) + STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1) ldo ASM_PAGE_SIZE(%r3),%r3 bb,>= %r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop nop - /* Load the return address...er...crash 'n burn */ copy %r0,%r2 /* And the RFI Target address too */ - ldil L%start_kernel,%r11 - ldo R%start_kernel(%r11),%r11 + load32 start_kernel,%r11 /* And the initial task pointer */ - - ldil L%init_thread_union,%r6 - ldo R%init_thread_union(%r6),%r6 + load32 init_thread_union,%r6 mtctl %r6,%cr30 /* And the stack pointer too */ - ldo THREAD_SZ_ALGN(%r6),%sp /* And the interrupt stack */ - - ldil L%interrupt_stack,%r6 - ldo R%interrupt_stack(%r6),%r6 + load32 interrupt_stack,%r6 mtctl %r6,%cr31 #ifdef CONFIG_SMP @@ -130,8 +144,7 @@ $pgt_fill_loop: ** it's just way easier to deal with here because ** of 64-bit function ptrs and the address is local to this file. */ - ldil L%PA(smp_slave_stext),%r10 - ldo R%PA(smp_slave_stext)(%r10),%r10 + load32 PA(smp_slave_stext),%r10 stw %r10,0x10(%r0) /* MEM_RENDEZ */ stw %r0,0x28(%r0) /* MEM_RENDEZ_HI - assume addr < 4GB */ @@ -141,10 +154,16 @@ $pgt_fill_loop: /* ** Code Common to both Monarch and Slave processors. ** Entry: + ** + ** 1.1: ** %r11 must contain RFI target address. ** %r25/%r26 args to pass to target function ** %r2 in case rfi target decides it didn't like something ** + ** 2.0w: + ** %r3 PDCE_PROC address + ** %r11 RFI target address + ** ** Caller must init: SR4-7, %sp, %r10, %cr24/25, */ common_stext: @@ -154,8 +173,50 @@ common_stext: /* Clear PDC entry point - we won't use it */ stw %r0,0x10(%r0) /* MEM_RENDEZ */ stw %r0,0x28(%r0) /* MEM_RENDEZ_HI */ -#endif +#endif /*CONFIG_SMP*/ + +#ifdef __LP64__ + tophys_r1 %sp + /* Save the rfi target address */ + ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10 + tophys_r1 %r10 + std %r11, TASK_PT_GR11(%r10) + /* Switch to wide mode Superdome doesn't support narrow PDC + ** calls. + */ +1: mfia %rp /* clear upper part of pcoq */ + ldo 2f-1b(%rp),%rp + depdi 0,31,32,%rp + bv (%rp) + ssm PSW_SM_W,%r0 + + /* Set Wide mode as the "Default" (eg for traps) + ** First trap occurs *right* after (or part of) rfi for slave CPUs. + ** Someday, palo might not do this for the Monarch either. + */ +2: +#define MEM_PDC_LO 0x388 +#define MEM_PDC_HI 0x35C + ldw MEM_PDC_LO(%r0),%r3 + ldw MEM_PDC_HI(%r0),%r6 + depd %r6, 31, 32, %r3 /* move to upper word */ + + ldo PDC_PSW(%r0),%arg0 /* 21 */ + ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ + ldo PDC_PSW_WIDE_BIT(%r0),%arg2 /* 2 */ + load32 PA(stext_pdc_ret), %rp + bv (%r3) + copy %r0,%arg3 + +stext_pdc_ret: + /* restore rfi target address*/ + ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10 + tophys_r1 %r10 + ldd TASK_PT_GR11(%r10), %r11 + tovirt_r1 %sp +#endif + /* PARANOID: clear user scratch/user space SR's */ mtsp %r0,%sr0 mtsp %r0,%sr1 @@ -168,17 +229,18 @@ common_stext: mtctl %r0,%cr12 mtctl %r0,%cr13 + /* Prepare to RFI! Man all the cannons! */ + /* Initialize the global data pointer */ - ldil L%$global$,%dp - ldo R%$global$(%dp),%dp + loadgp - /* - * Set up our interrupt table. HPMCs might not work after this! + /* Set up our interrupt table. HPMCs might not work after this! * * We need to install the correct iva for PA1.1 or PA2.0. The * following short sequence of instructions can determine this * (without being illegal on a PA1.1 machine). */ +#ifndef __LP64__ ldi 32,%r10 mtctl %r10,%cr11 .level 2.0 @@ -190,14 +252,39 @@ common_stext: ldo R%PA(fault_vector_11)(%r10),%r10 $is_pa20: - ldil L%PA(fault_vector_20),%r10 - ldo R%PA(fault_vector_20)(%r10),%r10 + .level LEVEL /* restore 1.1 || 2.0w */ +#endif /*!LP64*/ + load32 PA(fault_vector_20),%r10 $install_iva: mtctl %r10,%cr14 - /* Disable Q bit so we can load the iia queue */ - rsm PSW_SM_Q,%r0 +#ifdef __LP64__ + b aligned_rfi + nop + + .align 256 +aligned_rfi: + ssm 0,0 + nop /* 1 */ + nop /* 2 */ + nop /* 3 */ + nop /* 4 */ + nop /* 5 */ + nop /* 6 */ + nop /* 7 */ + nop /* 8 */ +#endif + +#ifdef __LP64__ /* move to psw.h? */ +#define PSW_BITS PSW_Q+PSW_I+PSW_D+PSW_P+PSW_R +#else +#define PSW_BITS PSW_SM_Q +#endif + +$rfi: + /* turn off troublesome PSW bits */ + rsm PSW_BITS,%r0 /* kernel PSW: * - no interruptions except HPMC and TOC (which are handled by PDC) @@ -205,8 +292,7 @@ $install_iva: * - big-endian * - virtually mapped */ - ldil L%KERNEL_PSW,%r10 - ldo R%KERNEL_PSW(%r10),%r10 + load32 KERNEL_PSW,%r10 mtctl %r10,%ipsw /* Set the space pointers for the post-RFI world @@ -232,6 +318,7 @@ $install_iva: .import smp_init_current_idle_task,data .import smp_callin,code +#ifndef __LP64__ smp_callin_rtn: .proc .callinfo @@ -239,9 +326,9 @@ smp_callin_rtn: nop nop .procend +#endif /*!LP64*/ /*************************************************************************** -* * smp_slave_stext is executed by all non-monarch Processors when the Monarch * pokes the slave CPUs in smp.c:smp_boot_cpus(). * @@ -249,8 +336,6 @@ smp_callin_rtn: * mode. Once all available/eligible CPUs are in virtual mode, all are * released and start out by executing their own idle task. *****************************************************************************/ - - smp_slave_stext: .proc .callinfo @@ -264,28 +349,28 @@ smp_slave_stext: mtsp %r0,%sr7 /* Initialize the SP - monarch sets up smp_init_current_idle_task */ - ldil L%PA(smp_init_current_idle_task),%sp - ldo R%PA(smp_init_current_idle_task)(%sp),%sp - ldw 0(%sp),%sp /* load task address */ + load32 PA(smp_init_current_idle_task),%sp + LDREG 0(%sp),%sp /* load task address */ tophys_r1 %sp - ldw TASK_THREAD_INFO(%sp), %sp + LDREG TASK_THREAD_INFO(%sp),%sp mtctl %sp,%cr30 /* store in cr30 */ - addil L%THREAD_SZ_ALGN,%sp /* stack is above task */ - ldo R%THREAD_SZ_ALGN(%r1),%sp + ldo THREAD_SZ_ALGN(%sp),%sp /* point CPU to kernel page tables */ - ldil L%PA(swapper_pg_dir),%r4 - ldo R%PA(swapper_pg_dir)(%r4),%r4 + load32 PA(swapper_pg_dir),%r4 mtctl %r4,%cr24 /* Initialize kernel root pointer */ mtctl %r4,%cr25 /* Initialize user root pointer */ +#ifdef __LP64__ + /* Setup PDCE_PROC entry */ + copy %arg0,%r3 +#else /* Load RFI *return* address in case smp_callin bails */ - ldil L%smp_callin_rtn,%r2 - ldo R%smp_callin_rtn(%r2),%r2 - + load32 smp_callin_rtn,%r2 +#endif + /* Load RFI target address. */ - ldil L%smp_callin,%r11 - ldo R%smp_callin(%r11),%r11 + load32 smp_callin,%r11 /* ok...common code can handle the rest */ b common_stext @@ -293,7 +378,7 @@ smp_slave_stext: .procend #endif /* CONFIG_SMP */ - +#ifndef __LP64__ .data .align 4 @@ -303,3 +388,4 @@ smp_slave_stext: .size $global$,4 $global$: .word 0 +#endif /*!LP64*/ diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index 48ba5093e..1a1c66422 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -518,7 +518,7 @@ add_system_map_addresses(struct parisc_device *dev, int num_addrs, } /** - * do_system_map_inventory - Retrieve firmware devices via SYSTEM_MAP. + * system_map_inventory - Retrieve firmware devices via SYSTEM_MAP. * * This function attempts to retrieve and register all the devices firmware * knows about via the SYSTEM_MAP PDC call. @@ -528,16 +528,18 @@ static void __init system_map_inventory(void) int i; long status = PDC_OK; - for (i = 0; status != PDC_BAD_PROC && status != PDC_NE_MOD; i++) { + for (i = 0; i < 256; i++) { struct parisc_device *dev; struct pdc_system_map_mod_info module_result; struct pdc_module_path module_path; status = pdc_system_map_find_mods(&module_result, &module_path, i); + if ((status == PDC_BAD_PROC) || (status == PDC_NE_MOD)) + break; if (status != PDC_OK) continue; - + dev = alloc_pa_dev(module_result.mod_addr, &module_path.path); if (!dev) continue; @@ -584,10 +586,10 @@ void __init do_memory_inventory(void) void __init do_device_inventory(void) { - extern void parisc_generic_device_register(void); - printk(KERN_INFO "Searching for devices...\n"); + init_parisc_bus(); + switch (pdc_type) { case PDC_TYPE_PAT: @@ -605,7 +607,6 @@ void __init do_device_inventory(void) default: panic("Unknown PDC type!\n"); } - parisc_generic_device_register(); printk(KERN_INFO "Found devices:\n"); print_parisc_devices(); } diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 00739749a..6388172ec 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -54,21 +54,19 @@ extern irqreturn_t ipi_interrupt(int, void *, struct pt_regs *); #define DBG_IRQ(irq, x) do { } while (0) #endif /* DEBUG_IRQ */ -#define EIEM_MASK(irq) (1UL<<(MAX_CPU_IRQ-IRQ_OFFSET(irq))) +#define EIEM_MASK(irq) (1UL<<(CPU_IRQ_MAX - irq)) /* Bits in EIEM correlate with cpu_irq_action[]. ** Numbered *Big Endian*! (ie bit 0 is MSB) */ static volatile unsigned long cpu_eiem = 0; -static spinlock_t irq_lock = SPIN_LOCK_UNLOCKED; /* protect IRQ regions */ - static void cpu_set_eiem(void *info) { set_eiem((unsigned long) info); } -static inline void disable_cpu_irq(void *unused, int irq) +static inline void cpu_disable_irq(unsigned int irq) { unsigned long eirr_bit = EIEM_MASK(irq); @@ -76,7 +74,7 @@ static inline void disable_cpu_irq(void *unused, int irq) on_each_cpu(cpu_set_eiem, (void *) cpu_eiem, 1, 1); } -static void enable_cpu_irq(void *unused, int irq) +static void cpu_enable_irq(unsigned int irq) { unsigned long eirr_bit = EIEM_MASK(irq); @@ -85,172 +83,56 @@ static void enable_cpu_irq(void *unused, int irq) on_each_cpu(cpu_set_eiem, (void *) cpu_eiem, 1, 1); } -/* mask and disable are the same at the CPU level -** Difference is enable clears pending interrupts -*/ -#define mask_cpu_irq disable_cpu_irq - -static inline void unmask_cpu_irq(void *unused, int irq) +static unsigned int cpu_startup_irq(unsigned int irq) { - unsigned long eirr_bit = EIEM_MASK(irq); - cpu_eiem |= eirr_bit; - /* NOTE: sending an IPI will cause do_cpu_irq_mask() to - ** handle *any* unmasked pending interrupts. - ** ie We don't need to check for pending interrupts here. - */ - on_each_cpu(cpu_set_eiem, (void *) cpu_eiem, 1, 1); + cpu_enable_irq(irq); + return 0; } -/* - * XXX cpu_irq_actions[] will become 2 dimensional for per CPU EIR support. - * correspond changes needed in: - * processor_probe() initialize additional action arrays - * request_irq() handle CPU IRQ region specially - * do_cpu_irq_mask() index into the matching irq_action array. - */ -struct irqaction cpu_irq_actions[IRQ_PER_REGION] = { - [IRQ_OFFSET(TIMER_IRQ)] = { - .handler = timer_interrupt, - .name = "timer", - }, -#ifdef CONFIG_SMP - [IRQ_OFFSET(IPI_IRQ)] = { - .handler = ipi_interrupt, - .name = "IPI", - }, -#endif -}; - - -struct irq_region cpu0_irq_region = { - .ops = { - .disable_irq = disable_cpu_irq, - .enable_irq = enable_cpu_irq, - .mask_irq = unmask_cpu_irq, - .unmask_irq = unmask_cpu_irq - }, - .data = { - .dev = &cpu_data[0], - .name = "PARISC-CPU", - .irqbase = IRQ_FROM_REGION(CPU_IRQ_REGION), - }, - .action = cpu_irq_actions, -}; - -struct irq_region *irq_region[NR_IRQ_REGS] = { - [ 0 ] = NULL, /* reserved for EISA, else causes data page fault (aka code 15) */ - [ CPU_IRQ_REGION ] = &cpu0_irq_region, +void no_ack_irq(unsigned int irq) { } +void no_end_irq(unsigned int irq) { } + +static struct hw_interrupt_type cpu_interrupt_type = { + .typename = "CPU", + .startup = cpu_startup_irq, + .shutdown = cpu_disable_irq, + .enable = cpu_enable_irq, + .disable = cpu_disable_irq, + .ack = no_ack_irq, + .end = no_end_irq, +// .set_affinity = cpu_set_affinity_irq, }; - -/* -** Generic interfaces that device drivers can use: -** mask_irq() block IRQ -** unmask_irq() re-enable IRQ and trigger if IRQ is pending -** disable_irq() block IRQ -** enable_irq() clear pending and re-enable IRQ -*/ - -void mask_irq(int irq) -{ - struct irq_region *region; - - DBG_IRQ(irq, ("mask_irq(%d) %d+%d eiem 0x%lx\n", irq, - IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem)); - irq = irq_canonicalize(irq); - region = irq_region[IRQ_REGION(irq)]; - if (region->ops.mask_irq) - region->ops.mask_irq(region->data.dev, IRQ_OFFSET(irq)); -} - -void unmask_irq(int irq) -{ - struct irq_region *region; - - DBG_IRQ(irq, ("unmask_irq(%d) %d+%d eiem 0x%lx\n", irq, - IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem)); - irq = irq_canonicalize(irq); - region = irq_region[IRQ_REGION(irq)]; - if (region->ops.unmask_irq) - region->ops.unmask_irq(region->data.dev, IRQ_OFFSET(irq)); -} - -void disable_irq(int irq) -{ - struct irq_region *region; - - DBG_IRQ(irq, ("disable_irq(%d) %d+%d eiem 0x%lx\n", irq, - IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem)); - irq = irq_canonicalize(irq); - region = irq_region[IRQ_REGION(irq)]; - if (region->ops.disable_irq) - region->ops.disable_irq(region->data.dev, IRQ_OFFSET(irq)); - else - BUG(); -} -EXPORT_SYMBOL(disable_irq); - -void enable_irq(int irq) -{ - struct irq_region *region; - - DBG_IRQ(irq, ("enable_irq(%d) %d+%d EIRR 0x%lx EIEM 0x%lx\n", irq, - IRQ_REGION(irq), IRQ_OFFSET(irq), mfctl(23), mfctl(15))); - irq = irq_canonicalize(irq); - region = irq_region[IRQ_REGION(irq)]; - - if (region->ops.enable_irq) - region->ops.enable_irq(region->data.dev, IRQ_OFFSET(irq)); - else - BUG(); -} -EXPORT_SYMBOL(enable_irq); - int show_interrupts(struct seq_file *p, void *v) { -#ifdef CONFIG_PROC_FS - unsigned int regnr = *(loff_t *) v, i = 0; + int i = *(loff_t *) v, j; + unsigned long flags; - if (regnr == 0) { - seq_puts(p, " "); -#ifdef CONFIG_SMP - for (i = 0; i < NR_CPUS; i++) - if (cpu_online(i)) -#endif - seq_printf(p, " CPU%02d ", i); + if (i == 0) { + seq_puts(p, " "); + for_each_online_cpu(j) + seq_printf(p, " CPU%d", j); #ifdef PARISC_IRQ_CR16_COUNTS - seq_printf(p, "[min/avg/max] (CPU cycle counts)"); + seq_printf(p, " [min/avg/max] (CPU cycle counts)"); #endif seq_putc(p, '\n'); } - /* We don't need *irqsave lock variants since this is - ** only allowed to change while in the base context. - */ - spin_lock(&irq_lock); - if (regnr < NR_IRQ_REGS) { - struct irq_region *region = irq_region[regnr]; - - if (!region || !region->action) - goto skip; - - for (i = 0; i <= MAX_CPU_IRQ; i++) { - struct irqaction *action = ®ion->action[i]; - unsigned int irq_no = IRQ_FROM_REGION(regnr) + i; - int j = 0; - if (!action->handler) - continue; - - seq_printf(p, "%3d: ", irq_no); + if (i < NR_IRQS) { + spin_lock_irqsave(&irq_desc[i].lock, flags); + struct irqaction *action = irq_desc[i].action; + if (!action) + goto skip; + seq_printf(p, "%3d: ", i); #ifdef CONFIG_SMP - for (; j < NR_CPUS; j++) - if (cpu_online(j)) + for_each_online_cpu(j) + seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); +#else + seq_printf(p, "%10u ", kstat_irqs(i)); #endif - seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq_no]); - seq_printf(p, " %14s", - region->data.name ? region->data.name : "N/A"); + seq_printf(p, " %14s", irq_desc[i].handler->typename); #ifndef PARISC_IRQ_CR16_COUNTS seq_printf(p, " %s", action->name); @@ -281,12 +163,10 @@ int show_interrupts(struct seq_file *p, void *v) #endif seq_putc(p, '\n'); - } + skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } - skip: - spin_unlock(&irq_lock); -#endif /* CONFIG_PROC_FS */ return 0; } @@ -300,34 +180,42 @@ int show_interrupts(struct seq_file *p, void *v) ** Then use that to get the Transaction address and data. */ -int -txn_alloc_irq(void) +int cpu_claim_irq(unsigned int irq, struct hw_interrupt_type *type, void *data) { - int irq; - - /* never return irq 0 cause that's the interval timer */ - for (irq = 1; irq <= MAX_CPU_IRQ; irq++) { - if (cpu_irq_actions[irq].handler == NULL) { - return (IRQ_FROM_REGION(CPU_IRQ_REGION) + irq); - } + if (irq_desc[irq].action) + return -EBUSY; + if (irq_desc[irq].handler != &cpu_interrupt_type) + return -EBUSY; + + if (type) { + irq_desc[irq].handler = type; + irq_desc[irq].handler_data = data; + cpu_interrupt_type.enable(irq); } + return 0; +} - /* unlikely, but be prepared */ - return -1; +int txn_claim_irq(int irq) +{ + return cpu_claim_irq(irq, NULL, NULL) ? -1 : irq; } -int -txn_claim_irq(int irq) +int txn_alloc_irq(void) { - if (irq_region[IRQ_REGION(irq)]->action[IRQ_OFFSET(irq)].handler ==NULL) + int irq; + + /* never return irq 0 cause that's the interval timer */ + for (irq = CPU_IRQ_BASE + 1; irq <= CPU_IRQ_MAX; irq++) { + if (cpu_claim_irq(irq, NULL, NULL) < 0) + continue; return irq; + } /* unlikely, but be prepared */ return -1; } -unsigned long -txn_alloc_addr(int virt_irq) +unsigned long txn_alloc_addr(int virt_irq) { static int next_cpu = -1; @@ -364,68 +252,20 @@ txn_alloc_addr(int virt_irq) ** I/O subsystem supports more bits than PA2.0 has. The first ** case is the problem. */ -unsigned int -txn_alloc_data(int virt_irq, unsigned int bits_wide) +unsigned int txn_alloc_data(int virt_irq, unsigned int bits_wide) { /* XXX FIXME : bits_wide indicates how wide the transaction ** data is allowed to be...we may need a different virt_irq ** if this one won't work. Another reason to index virtual ** irq's into a table which can manage CPU/IRQ bit separately. */ - if (IRQ_OFFSET(virt_irq) > (1 << (bits_wide -1))) - { + if ((virt_irq - CPU_IRQ_BASE) > (1 << (bits_wide - 1))) { panic("Sorry -- didn't allocate valid IRQ for this device\n"); } - return (IRQ_OFFSET(virt_irq)); -} - -void do_irq(struct irqaction *action, int irq, struct pt_regs * regs) -{ - int cpu = smp_processor_id(); - - irq_enter(); - ++kstat_cpu(cpu).irqs[irq]; - - DBG_IRQ(irq, ("do_irq(%d) %d+%d eiem 0x%lx\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem)); - - for (; action; action = action->next) { -#ifdef PARISC_IRQ_CR16_COUNTS - unsigned long cr_start = mfctl(16); -#endif - - if (action->handler == NULL) { - if (IRQ_REGION(irq) == EISA_IRQ_REGION && irq_region[EISA_IRQ_REGION]) { - /* were we called due to autodetecting (E)ISA irqs ? */ - unsigned int *status; - status = &irq_region[EISA_IRQ_REGION]->data.status[IRQ_OFFSET(irq)]; - if (*status & IRQ_AUTODETECT) { - *status &= ~IRQ_WAITING; - continue; - } - } - printk(KERN_ERR "IRQ: CPU:%d No handler for IRQ %d !\n", cpu, irq); - continue; - } - - action->handler(irq, action->dev_id, regs); - -#ifdef PARISC_IRQ_CR16_COUNTS - { - unsigned long cr_end = mfctl(16); - unsigned long tmp = cr_end - cr_start; - /* check for roll over */ - cr_start = (cr_end < cr_start) ? -(tmp) : (tmp); - } - action->cr16_hist[action->cr16_idx++] = (int) cr_start; - action->cr16_idx &= PARISC_CR16_HIST_SIZE - 1; -#endif - } - - irq_exit(); + return virt_irq - CPU_IRQ_BASE; } - /* ONLY called from entry.S:intr_extint() */ void do_cpu_irq_mask(struct pt_regs *regs) { @@ -449,9 +289,12 @@ void do_cpu_irq_mask(struct pt_regs *regs) * 3) Limit the number of times we loop to make sure other * processing can occur. */ - while ((eirr_val = (mfctl(23) & cpu_eiem)) && --i) { - unsigned long bit = (1UL<>=1, irq++) - { + for (irq = TIMER_IRQ; eirr_val && bit; bit>>=1, irq++) { if (!(bit & eirr_val & cpu_eiem)) continue; /* clear bit in mask - can exit loop sooner */ eirr_val &= ~bit; - do_irq(&cpu_irq_actions[irq], TIMER_IRQ+irq, regs); + __do_IRQ(irq, regs); } } set_eiem(cpu_eiem); } -/* Called from second level IRQ regions: eg dino or iosapic. */ -void do_irq_mask(unsigned long mask, struct irq_region *region, struct pt_regs *regs) -{ - unsigned long bit; - unsigned int irq; - -#ifdef DEBUG_IRQ - if (mask != (1L<>=1, irq++) { - unsigned int irq_num; - if (!(bit&mask)) - continue; - - mask &= ~bit; /* clear bit in mask - can exit loop sooner */ - irq_num = region->data.irqbase + irq; - - mask_irq(irq_num); - do_irq(®ion->action[irq], irq_num, regs); - unmask_irq(irq_num); - } -} - - -static inline int find_free_region(void) -{ - int irqreg; - - for (irqreg=1; irqreg <= (NR_IRQ_REGS); irqreg++) { - if (irq_region[irqreg] == NULL) - return irqreg; - } - - return 0; -} - - -/***** - * alloc_irq_region - allocate/init a new IRQ region - * @count: number of IRQs in this region. - * @ops: function table with request/release/mask/unmask/etc.. entries. - * @name: name of region owner for /proc/interrupts output. - * @dev: private data to associate with the new IRQ region. - * - * Every IRQ must become a MMIO write to the CPU's EIRR in - * order to get CPU service. The IRQ region represents the - * number of unique events the region handler can (or must) - * identify. For PARISC CPU, that's the width of the EIR Register. - * IRQ regions virtualize IRQs (eg EISA or PCI host bus controllers) - * for line based devices. - */ -struct irq_region *alloc_irq_region( int count, struct irq_region_ops *ops, - const char *name, void *dev) -{ - struct irq_region *region; - int index; - - index = find_free_region(); - if (index == 0) { - printk(KERN_ERR "Maximum number of irq regions exceeded. Increase NR_IRQ_REGS!\n"); - return NULL; - } - - if ((IRQ_REGION(count-1))) - return NULL; - - if (count < IRQ_PER_REGION) { - DBG_IRQ(0, ("alloc_irq_region() using minimum of %d irq lines for %s (%d)\n", - IRQ_PER_REGION, name, count)); - count = IRQ_PER_REGION; - } - - /* if either mask *or* unmask is set, both have to be set. */ - if((ops->mask_irq || ops->unmask_irq) && - !(ops->mask_irq && ops->unmask_irq)) - return NULL; - - /* ditto for enable/disable */ - if( (ops->disable_irq || ops->enable_irq) && - !(ops->disable_irq && ops->enable_irq) ) - return NULL; - - region = kmalloc(sizeof(*region), GFP_ATOMIC); - if (!region) - return NULL; - memset(region, 0, sizeof(*region)); - - region->action = kmalloc(count * sizeof(*region->action), GFP_ATOMIC); - if (!region->action) { - kfree(region); - return NULL; - } - memset(region->action, 0, count * sizeof(*region->action)); - - region->ops = *ops; - region->data.irqbase = IRQ_FROM_REGION(index); - region->data.name = name; - region->data.dev = dev; - - irq_region[index] = region; - - return irq_region[index]; -} - -/* FIXME: SMP, flags, bottom halves, rest */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - struct irqaction * action; +static struct irqaction timer_action = { + .handler = timer_interrupt, + .name = "timer", +}; -#if 0 - printk(KERN_INFO "request_irq(%d, %p, 0x%lx, %s, %p)\n",irq, handler, irqflags, devname, dev_id); +#ifdef CONFIG_SMP +static struct irqaction ipi_action = { + .handler = ipi_interrupt, + .name = "IPI", +}; #endif - irq = irq_canonicalize(irq); - /* request_irq()/free_irq() may not be called from interrupt context. */ - if (in_interrupt()) - BUG(); - - if (!handler) { - printk(KERN_ERR "request_irq(%d,...): Augh! No handler for irq!\n", - irq); - return -EINVAL; - } - - if (irq_region[IRQ_REGION(irq)] == NULL) { - /* - ** Bug catcher for drivers which use "char" or u8 for - ** the IRQ number. They lose the region number which - ** is in pcidev->irq (an int). - */ - printk(KERN_ERR "%p (%s?) called request_irq with an invalid irq %d\n", - __builtin_return_address(0), devname, irq); - return -EINVAL; - } - - spin_lock(&irq_lock); - action = &(irq_region[IRQ_REGION(irq)]->action[IRQ_OFFSET(irq)]); - - /* First one is preallocated. */ - if (action->handler) { - /* But it's in use...find the tail and allocate a new one */ - while (action->next) - action = action->next; - - action->next = kmalloc(sizeof(*action), GFP_ATOMIC); - memset(action->next, 0, sizeof(*action)); - - action = action->next; - } - - if (!action) { - spin_unlock(&irq_lock); - printk(KERN_ERR "request_irq(): Augh! No action!\n") ; - return -ENOMEM; - } - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - spin_unlock(&irq_lock); - - enable_irq(irq); - return 0; -} - -EXPORT_SYMBOL(request_irq); - -void free_irq(unsigned int irq, void *dev_id) +static void claim_cpu_irqs(void) { - struct irqaction *action, **p; - - /* See comments in request_irq() about interrupt context */ - irq = irq_canonicalize(irq); - - if (in_interrupt()) BUG(); - - spin_lock(&irq_lock); - action = &irq_region[IRQ_REGION(irq)]->action[IRQ_OFFSET(irq)]; - - if (action->dev_id == dev_id) { - if (action->next == NULL) { - action->handler = NULL; - } else { - memcpy(action, action->next, sizeof(*action)); - } - - spin_unlock(&irq_lock); - return; + int i; + for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) { + irq_desc[i].handler = &cpu_interrupt_type; } - p = &action->next; - action = action->next; - - for (; (action = *p) != NULL; p = &action->next) { - if (action->dev_id != dev_id) - continue; - - /* Found it - now free it */ - *p = action->next; - kfree(action); - - spin_unlock(&irq_lock); - return; - } - - spin_unlock(&irq_lock); - printk(KERN_ERR "Trying to free free IRQ%d\n",irq); -} - -EXPORT_SYMBOL(free_irq); - - + irq_desc[TIMER_IRQ].action = &timer_action; + irq_desc[TIMER_IRQ].status |= IRQ_PER_CPU; #ifdef CONFIG_SMP -void synchronize_irq(unsigned int irqnum) -{ - while (in_irq()) ; -} -EXPORT_SYMBOL(synchronize_irq); + irq_desc[IPI_IRQ].action = &ipi_action; + irq_desc[IPI_IRQ].status = IRQ_PER_CPU; #endif - - -/* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -/* TODO: spin_lock_irq(desc->lock -> irq_lock) */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - unsigned long val; - unsigned long delay; - struct irq_region *region; - - /* support for irq autoprobing is limited to EISA (irq region 0) */ - region = irq_region[EISA_IRQ_REGION]; - if (!EISA_bus || !region) - return 0; - - down(&probe_sem); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = EISA_MAX_IRQS-1; i > 0; i--) { - struct irqaction *action; - - spin_lock_irq(&irq_lock); - action = region->action + i; - if (!action->handler) { - region->data.status[i] |= IRQ_AUTODETECT | IRQ_WAITING; - region->ops.enable_irq(region->data.dev,i); - } - spin_unlock_irq(&irq_lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < EISA_MAX_IRQS; i++) { - unsigned int status; - - spin_lock_irq(&irq_lock); - status = region->data.status[i]; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - region->data.status[i] = status & ~IRQ_AUTODETECT; - region->ops.disable_irq(region->data.dev,i); - } else - if (i < BITS_PER_LONG) - val |= (1 << i); - } - spin_unlock_irq(&irq_lock); - } - - return val; } -EXPORT_SYMBOL(probe_irq_on); - -/* - * Return the one interrupt that triggered (this can - * handle any interrupt source). - */ - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * their is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldnt happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. - */ - -int probe_irq_off(unsigned long val) -{ - struct irq_region *region; - int i, irq_found, nr_irqs; - - /* support for irq autoprobing is limited to EISA (irq region 0) */ - region = irq_region[EISA_IRQ_REGION]; - if (!EISA_bus || !region) - return 0; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < EISA_MAX_IRQS; i++) { - unsigned int status; - - spin_lock_irq(&irq_lock); - status = region->data.status[i]; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - region->ops.disable_irq(region->data.dev,i); - region->data.status[i] = status & ~IRQ_AUTODETECT; - } - spin_unlock_irq(&irq_lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -unsigned int probe_irq_mask(unsigned long irqs) -{ - return 0; -} -EXPORT_SYMBOL(probe_irq_mask); - void __init init_IRQ(void) { local_irq_disable(); /* PARANOID - should already be disabled */ mtctl(~0UL, 23); /* EIRR : clear all pending external intr */ + claim_cpu_irqs(); #ifdef CONFIG_SMP if (!cpu_eiem) cpu_eiem = EIEM_MASK(IPI_IRQ) | EIEM_MASK(TIMER_IRQ); @@ -873,9 +360,14 @@ void __init init_IRQ(void) } -#ifdef CONFIG_PROC_FS -/* called from kernel/sysctl.c:sysctl_init() */ -void __init init_irq_proc(void) +void hw_resend_irq(struct hw_interrupt_type *type, unsigned int irq) { + /* XXX: Needs to be written. We managed without it so far, but + * we really ought to write it. + */ +} + +void ack_bad_irq(unsigned int irq) +{ + printk("unexpected IRQ %d\n", irq); } -#endif diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index bc96fd28e..c028480b8 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S @@ -68,7 +68,7 @@ flush_tlb_all_local: * consolidated. */ - rsm PSW_SM_I,%r19 /* relied upon translation! */ + rsm PSW_SM_I,%r19 /* relied upon translation! PA 2.0 Arch. F-5 */ nop nop nop @@ -475,9 +475,9 @@ copy_user_page_asm: .procend #endif - .export clear_user_page_asm,code + .export __clear_user_page_asm,code -clear_user_page_asm: +__clear_user_page_asm: .proc .callinfo NO_CALLS .entry diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c index dadcf1359..f40a777dd 100644 --- a/arch/parisc/kernel/parisc_ksyms.c +++ b/arch/parisc/kernel/parisc_ksyms.c @@ -32,7 +32,6 @@ #include EXPORT_SYMBOL(memchr); EXPORT_SYMBOL(memcmp); -EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memmove); EXPORT_SYMBOL(memscan); EXPORT_SYMBOL(memset); @@ -65,13 +64,20 @@ EXPORT_SYMBOL(__cmpxchg_u64); #endif #include -EXPORT_SYMBOL(lcopy_to_user); -EXPORT_SYMBOL(lcopy_from_user); -EXPORT_SYMBOL(lcopy_in_user); EXPORT_SYMBOL(lstrncpy_from_user); EXPORT_SYMBOL(lclear_user); EXPORT_SYMBOL(lstrnlen_user); +/* Global fixups */ +extern void fixup_get_user_skip_1(void); +extern void fixup_get_user_skip_2(void); +extern void fixup_put_user_skip_1(void); +extern void fixup_put_user_skip_2(void); +EXPORT_SYMBOL(fixup_get_user_skip_1); +EXPORT_SYMBOL(fixup_get_user_skip_2); +EXPORT_SYMBOL(fixup_put_user_skip_1); +EXPORT_SYMBOL(fixup_put_user_skip_2); + #ifndef __LP64__ /* Needed so insmod can set dp value */ extern int $global$; @@ -81,9 +87,9 @@ EXPORT_SYMBOL($global$); #include EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); -EXPORT_SYMBOL(__memcpy_toio); -EXPORT_SYMBOL(__memcpy_fromio); -EXPORT_SYMBOL(__memset_io); +EXPORT_SYMBOL(memcpy_toio); +EXPORT_SYMBOL(memcpy_fromio); +EXPORT_SYMBOL(memset_io); #include EXPORT_SYMBOL(sys_open); diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index ebbcbf295..07850b6e1 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -104,7 +104,9 @@ static inline int map_pte_uncached(pte_t * pte, if (!pte_none(*pte)) printk(KERN_ERR "map_pte_uncached: page already exists\n"); set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); + purge_tlb_start(); pdtlb_kernel(orig_vaddr); + purge_tlb_end(); vaddr += PAGE_SIZE; orig_vaddr += PAGE_SIZE; (*paddr_ptr) += PAGE_SIZE; @@ -179,7 +181,9 @@ static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr, do { pte_t page = *pte; pte_clear(pte); + purge_tlb_start(); pdtlb_kernel(orig_vaddr); + purge_tlb_end(); vaddr += PAGE_SIZE; orig_vaddr += PAGE_SIZE; pte++; diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 8072e384e..01f676d16 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c @@ -71,6 +71,19 @@ void pdc_outc(unsigned char c) pdc_iodc_outc(c); } +void pdc_printf(const char *fmt, ...) +{ + va_list args; + char buf[1024]; + int i, len; + + va_start(args, fmt); + len = vscnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + + for (i = 0; i < len; i++) + pdc_iodc_outc(buf[i]); +} int pdc_console_poll_key(struct console *co) { diff --git a/arch/parisc/kernel/perf_asm.S b/arch/parisc/kernel/perf_asm.S index 884be8750..87993ae27 100644 --- a/arch/parisc/kernel/perf_asm.S +++ b/arch/parisc/kernel/perf_asm.S @@ -1,18 +1,19 @@ /* low-level asm for "intrigue" (PA8500-8700 CPU perf counters) - * + * * Copyright (C) 2001 Randolph Chung - * + * Copyright (C) 2001 Hewlett-Packard (Grant Grundler) + * * 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 @@ -48,7 +49,7 @@ perf_intrigue_enable_perf_counters: .proc .callinfo frame=0,NO_CALLS .entry - + ldi 0x20,%r25 ; load up perfmon bit mfctl ccr,%r26 ; get coprocessor register or %r25,%r26,%r26 ; set bit @@ -87,35 +88,35 @@ perf_intrigue_disable_perf_counters: .exit .procend -;************************************************************************ -;* * -;* Name: perf_rdr_shift_in_W * -;* * -;* Description: * -;* This routine shifts data in from the RDR in arg0 and returns * -;* the result in ret0. If the RDR is <= 64 bits in length, it * -;* is shifted shifted backup immediately. This is to compensate * -;* for RDR10 which has bits that preclude PDC stack operations * -;* when they are in the wrong state. * -;* * -;* Arguments: * -;* arg0 : rdr to be read * -;* arg1 : bit length of rdr * -;* * -;* Returns: * -;* ret0 = next 64 bits of rdr data from staging register * -;* * -;* Register usage: * -;* arg0 : rdr to be read * -;* arg1 : bit length of rdr * -;* %r24 - original DR2 value * -;* %r1 - scratch * -;* %r29 - scratch * -;* * -;* Returns: * -;* ret0 = RDR data (right justified) * -;* * -;************************************************************************ +;*********************************************************************** +;* +;* Name: perf_rdr_shift_in_W +;* +;* Description: +;* This routine shifts data in from the RDR in arg0 and returns +;* the result in ret0. If the RDR is <= 64 bits in length, it +;* is shifted shifted backup immediately. This is to compensate +;* for RDR10 which has bits that preclude PDC stack operations +;* when they are in the wrong state. +;* +;* Arguments: +;* arg0 : rdr to be read +;* arg1 : bit length of rdr +;* +;* Returns: +;* ret0 = next 64 bits of rdr data from staging register +;* +;* Register usage: +;* arg0 : rdr to be read +;* arg1 : bit length of rdr +;* %r24 - original DR2 value +;* %r1 - scratch +;* %r29 - scratch +;* +;* Returns: +;* ret0 = RDR data (right justified) +;* +;*********************************************************************** .export perf_rdr_shift_in_W,code perf_rdr_shift_in_W: @@ -138,7 +139,7 @@ perf_rdr_shift_in_W: nop nop nop - nop + nop ; ; Cacheline start (32-byte cacheline) @@ -146,11 +147,11 @@ perf_rdr_shift_in_W: nop nop nop - extrd,u arg1,63,6,%r1 ; setup shift amount based on bits to move + extrd,u arg1,63,6,%r1 ; setup shift amount by bits to move mtsar %r1 shladd arg0,2,%r0,%r1 ; %r1 = 4 * RDR number - blr %r1,%r0 ; branch to 8-instruction sequence + blr %r1,%r0 ; branch to 8-instruction sequence nop ; @@ -160,19 +161,19 @@ perf_rdr_shift_in_W: ; ; RDR 0 sequence ; - SFDIAG (0) + SFDIAG (0) ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 - MTDIAG_1 (1) ; mtdiag %dr1, %r1 + MTDIAG_1 (1) ; mtdiag %dr1, %r1 STDIAG (0) ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 1 sequence ; - sync + sync ssm 0,0 SFDIAG (1) ssm 0,0 @@ -180,11 +181,11 @@ perf_rdr_shift_in_W: ssm 0,0 b,n perf_rdr_shift_in_W_leave nop - + ; ; RDR 2 read sequence ; - SFDIAG (2) + SFDIAG (2) ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 @@ -192,7 +193,7 @@ perf_rdr_shift_in_W: STDIAG (2) ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 3 read sequence ; @@ -208,39 +209,39 @@ perf_rdr_shift_in_W: ; ; RDR 4 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (4) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 5 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (5) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 6 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (6) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 7 read sequence ; @@ -281,26 +282,26 @@ perf_rdr_shift_in_W: ; RDR 10 read sequence ; SFDIAG (10) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (10) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 11 read sequence ; SFDIAG (11) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (11) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 12 read sequence ; @@ -317,77 +318,77 @@ perf_rdr_shift_in_W: ; RDR 13 read sequence ; sync - ssm 0,0 + ssm 0,0 SFDIAG (13) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 14 read sequence ; - SFDIAG (14) - ssm 0,0 + SFDIAG (14) + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (14) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 15 read sequence ; - sync ; RDR 15 read sequence - ssm 0,0 + sync + ssm 0,0 SFDIAG (15) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave nop - + ; ; RDR 16 read sequence ; - sync ; RDR 16 read sequence - ssm 0,0 + sync + ssm 0,0 SFDIAG (16) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 17 read sequence ; - SFDIAG (17) - ssm 0,0 + SFDIAG (17) + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (17) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 18 read sequence ; - SFDIAG (18) - ssm 0,0 + SFDIAG (18) + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (18) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - -; -; RDR 19 read sequence -; + + ; + ; RDR 19 read sequence + ; b,n perf_rdr_shift_in_W_leave nop nop @@ -401,144 +402,144 @@ perf_rdr_shift_in_W: ; RDR 20 read sequence ; sync - ssm 0,0 + ssm 0,0 SFDIAG (20) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 21 read sequence ; sync - ssm 0,0 + ssm 0,0 SFDIAG (21) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 22 read sequence ; sync - ssm 0,0 + ssm 0,0 SFDIAG (22) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 23 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (23) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 24 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (24) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 25 read sequence ; sync - ssm 0,0 + ssm 0,0 SFDIAG (25) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 26 read sequence ; - SFDIAG (26) - ssm 0,0 + SFDIAG (26) + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (26) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 27 read sequence ; SFDIAG (27) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (27) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 28 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (28) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 29 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (29) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_W_leave - ssm 0,0 + ssm 0,0 nop - + ; ; RDR 30 read sequence ; SFDIAG (30) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (30) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_W_leave - + ; ; RDR 31 read sequence ; - sync - ssm 0,0 + sync + ssm 0,0 SFDIAG (31) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) nop - ssm 0,0 + ssm 0,0 nop ; @@ -552,28 +553,28 @@ perf_rdr_shift_in_W_leave: .procend -;************************************************************************ -;* * -;* Name: perf_rdr_shift_out_W * -;* * -;* Description: * -;* This routine moves data to the RDR's. The double-word that * -;* arg1 points to is loaded and moved into the staging register. * -;* Then the STDIAG instruction for the RDR # in arg0 is called * -;* to move the data to the RDR. * -;* * -;* Arguments: * -;* arg0 = rdr number * -;* arg1 = 64-bit value to write * -;* %r24 - DR2 | DR2_SLOW_RET * -;* %r23 - original DR2 value * -;* * -;* Returns: * -;* None * -;* * -;* Register usage: * -;* * -;************************************************************************ +;*********************************************************************** +;* +;* Name: perf_rdr_shift_out_W +;* +;* Description: +;* This routine moves data to the RDR's. The double-word that +;* arg1 points to is loaded and moved into the staging register. +;* Then the STDIAG instruction for the RDR # in arg0 is called +;* to move the data to the RDR. +;* +;* Arguments: +;* arg0 = rdr number +;* arg1 = 64-bit value to write +;* %r24 - DR2 | DR2_SLOW_RET +;* %r23 - original DR2 value +;* +;* Returns: +;* None +;* +;* Register usage: +;* +;*********************************************************************** .export perf_rdr_shift_out_W,code perf_rdr_shift_out_W: @@ -587,24 +588,23 @@ perf_rdr_shift_out_W: depdi,z 1,DR2_SLOW_RET,1,%r24 MFDIAG_2 (23) - or %r24,%r23,%r24 - MTDIAG_2 (24) ; set DR2_SLOW_RET - - MTDIAG_1 (25) ; data to the staging register + or %r24,%r23,%r24 + MTDIAG_2 (24) ; set DR2_SLOW_RET + MTDIAG_1 (25) ; data to the staging register shladd arg0,2,%r0,%r1 ; %r1 = 4 * RDR number - blr %r1,%r0 ; branch to 8-instruction sequence + blr %r1,%r0 ; branch to 8-instruction sequence nop ; ; RDR 0 write sequence ; sync ; RDR 0 write sequence - ssm 0,0 + ssm 0,0 STDIAG (0) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_W_leave nop - ssm 0,0 + ssm 0,0 nop ; @@ -718,7 +718,7 @@ perf_rdr_shift_out_W: ; ; RDR 10 write sequence ; - sync + sync ssm 0,0 STDIAG (10) STDIAG (26) @@ -862,7 +862,7 @@ perf_rdr_shift_out_W: ; ; RDR 22 write sequence ; - sync + sync ssm 0,0 STDIAG (22) ssm 0,0 @@ -910,7 +910,7 @@ perf_rdr_shift_out_W: ; ; RDR 26 write sequence ; - sync + sync ssm 0,0 STDIAG (10) STDIAG (26) @@ -958,7 +958,7 @@ perf_rdr_shift_out_W: ; ; RDR 30 write sequence ; - sync + sync ssm 0,0 STDIAG (30) ssm 0,0 @@ -970,7 +970,7 @@ perf_rdr_shift_out_W: ; ; RDR 31 write sequence ; - sync + sync ssm 0,0 STDIAG (31) ssm 0,0 @@ -986,34 +986,32 @@ perf_rdr_shift_out_W_leave: .procend -;**************************** CHRIS *********************************** - -;************************************************************************ -;* * -;* Name: rdr_shift_in_U * -;* * -;* Description: * -;* This routine shifts data in from the RDR in arg0 and returns * -;* the result in ret0. If the RDR is <= 64 bits in length, it * -;* is shifted shifted backup immediately. This is to compensate * -;* for RDR10 which has bits that preclude PDC stack operations * -;* when they are in the wrong state. * -;* * -;* Arguments: * -;* arg0 : rdr to be read * -;* arg1 : bit length of rdr * -;* * -;* Returns: * -;* ret0 = next 64 bits of rdr data from staging register * -;* * -;* Register usage: * -;* arg0 : rdr to be read * -;* arg1 : bit length of rdr * -;* %r24 - original DR2 value * -;* %r23 - DR2 | DR2_SLOW_RET * -;* %r1 - scratch * -;* * -;************************************************************************ +;*********************************************************************** +;* +;* Name: rdr_shift_in_U +;* +;* Description: +;* This routine shifts data in from the RDR in arg0 and returns +;* the result in ret0. If the RDR is <= 64 bits in length, it +;* is shifted shifted backup immediately. This is to compensate +;* for RDR10 which has bits that preclude PDC stack operations +;* when they are in the wrong state. +;* +;* Arguments: +;* arg0 : rdr to be read +;* arg1 : bit length of rdr +;* +;* Returns: +;* ret0 = next 64 bits of rdr data from staging register +;* +;* Register usage: +;* arg0 : rdr to be read +;* arg1 : bit length of rdr +;* %r24 - original DR2 value +;* %r23 - DR2 | DR2_SLOW_RET +;* %r1 - scratch +;* +;*********************************************************************** .export perf_rdr_shift_in_U,code perf_rdr_shift_in_U: @@ -1053,75 +1051,75 @@ perf_rdr_shift_in_U: ; Start of next 32-byte cacheline ; SFDIAG (0) ; RDR 0 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (0) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (1) ; RDR 1 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (1) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + sync ; RDR 2 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (4) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 3 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (3) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop sync ; RDR 4 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (4) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 5 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (5) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 6 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (6) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 7 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (7) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop b,n perf_rdr_shift_in_U_leave @@ -1134,95 +1132,95 @@ perf_rdr_shift_in_U: nop SFDIAG (9) ; RDR 9 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (9) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave SFDIAG (10) ; RDR 10 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (10) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (11) ; RDR 11 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (11) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (12) ; RDR 12 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (12) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave SFDIAG (13) ; RDR 13 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (13) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (14) ; RDR 14 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (14) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (15) ; RDR 15 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (15) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + sync ; RDR 16 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (16) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + SFDIAG (17) ; RDR 17 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (17) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (18) ; RDR 18 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (18) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + b,n perf_rdr_shift_in_U_leave nop nop @@ -1233,86 +1231,86 @@ perf_rdr_shift_in_U: nop sync ; RDR 20 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (20) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 21 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (21) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 22 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (22) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 23 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (23) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 24 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (24) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + sync ; RDR 25 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (25) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + SFDIAG (26) ; RDR 26 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (26) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (27) ; RDR 27 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (27) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + sync ; RDR 28 read sequence - ssm 0,0 + ssm 0,0 SFDIAG (28) - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) b,n perf_rdr_shift_in_U_leave - ssm 0,0 + ssm 0,0 nop - + b,n perf_rdr_shift_in_U_leave nop nop @@ -1321,23 +1319,23 @@ perf_rdr_shift_in_U: nop nop nop - + SFDIAG (30) ; RDR 30 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (30) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave - + SFDIAG (31) ; RDR 31 read sequence - ssm 0,0 + ssm 0,0 MFDIAG_1 (28) shrpd ret0,%r0,%sar,%r1 MTDIAG_1 (1) STDIAG (31) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_in_U_leave nop @@ -1347,30 +1345,30 @@ perf_rdr_shift_in_U_leave: MTDIAG_2 (24) ; restore DR2 .procend -;************************************************************************ -;* * -;* Name: rdr_shift_out_U * -;* * -;* Description: * -;* This routine moves data to the RDR's. The double-word that * -;* arg1 points to is loaded and moved into the staging register. * -;* Then the STDIAG instruction for the RDR # in arg0 is called * -;* to move the data to the RDR. * -;* * -;* Arguments: * -;* arg0 = rdr target * -;* arg1 = buffer pointer * -;* * -;* Returns: * -;* None * -;* * -;* Register usage: * -;* arg0 = rdr target * -;* arg1 = buffer pointer * -;* %r24 - DR2 | DR2_SLOW_RET * -;* %r23 - original DR2 value * -;* * -;************************************************************************ +;*********************************************************************** +;* +;* Name: rdr_shift_out_U +;* +;* Description: +;* This routine moves data to the RDR's. The double-word that +;* arg1 points to is loaded and moved into the staging register. +;* Then the STDIAG instruction for the RDR # in arg0 is called +;* to move the data to the RDR. +;* +;* Arguments: +;* arg0 = rdr target +;* arg1 = buffer pointer +;* +;* Returns: +;* None +;* +;* Register usage: +;* arg0 = rdr target +;* arg1 = buffer pointer +;* %r24 - DR2 | DR2_SLOW_RET +;* %r23 - original DR2 value +;* +;*********************************************************************** .export perf_rdr_shift_out_U,code perf_rdr_shift_out_U: @@ -1386,11 +1384,11 @@ perf_rdr_shift_out_U: depdi,z 1,DR2_SLOW_RET,1,%r24 MFDIAG_2 (23) or %r24,%r23,%r24 - MTDIAG_2 (24) ; set DR2_SLOW_RET + MTDIAG_2 (24) ; set DR2_SLOW_RET - MTDIAG_1 (25) ; data to the staging register - shladd arg0,2,%r0,%r1 ; %r1 = 4 * RDR number - blr %r1,%r0 ; branch to 8-instruction sequence + MTDIAG_1 (25) ; data to the staging register + shladd arg0,2,%r0,%r1 ; %r1 = 4 * RDR number + blr %r1,%r0 ; branch to 8-instruction sequence nop ; @@ -1398,291 +1396,291 @@ perf_rdr_shift_out_U: ; sync ; RDR 0 write sequence - ssm 0,0 + ssm 0,0 STDIAG (0) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 1 write sequence - ssm 0,0 + ssm 0,0 STDIAG (1) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 2 write sequence - ssm 0,0 + ssm 0,0 STDIAG (2) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 3 write sequence - ssm 0,0 + ssm 0,0 STDIAG (3) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 4 write sequence - ssm 0,0 + ssm 0,0 STDIAG (4) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 5 write sequence - ssm 0,0 + ssm 0,0 STDIAG (5) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 6 write sequence - ssm 0,0 + ssm 0,0 STDIAG (6) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 7 write sequence - ssm 0,0 + ssm 0,0 STDIAG (7) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 8 write sequence - ssm 0,0 + ssm 0,0 STDIAG (8) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 9 write sequence - ssm 0,0 + ssm 0,0 STDIAG (9) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 10 write sequence - ssm 0,0 + ssm 0,0 STDIAG (10) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 11 write sequence - ssm 0,0 + ssm 0,0 STDIAG (11) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 12 write sequence - ssm 0,0 + ssm 0,0 STDIAG (12) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 13 write sequence - ssm 0,0 + ssm 0,0 STDIAG (13) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 14 write sequence - ssm 0,0 + ssm 0,0 STDIAG (14) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 15 write sequence - ssm 0,0 + ssm 0,0 STDIAG (15) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 16 write sequence - ssm 0,0 + ssm 0,0 STDIAG (16) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 17 write sequence - ssm 0,0 + ssm 0,0 STDIAG (17) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 18 write sequence - ssm 0,0 + ssm 0,0 STDIAG (18) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 19 write sequence - ssm 0,0 + ssm 0,0 STDIAG (19) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 20 write sequence - ssm 0,0 + ssm 0,0 STDIAG (20) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 21 write sequence - ssm 0,0 + ssm 0,0 STDIAG (21) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 22 write sequence - ssm 0,0 + ssm 0,0 STDIAG (22) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 23 write sequence - ssm 0,0 + ssm 0,0 STDIAG (23) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 24 write sequence - ssm 0,0 + ssm 0,0 STDIAG (24) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 25 write sequence - ssm 0,0 + ssm 0,0 STDIAG (25) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 26 write sequence - ssm 0,0 + ssm 0,0 STDIAG (26) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 27 write sequence - ssm 0,0 + ssm 0,0 STDIAG (27) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 28 write sequence - ssm 0,0 + ssm 0,0 STDIAG (28) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 29 write sequence - ssm 0,0 + ssm 0,0 STDIAG (29) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 30 write sequence - ssm 0,0 + ssm 0,0 STDIAG (30) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop sync ; RDR 31 write sequence - ssm 0,0 + ssm 0,0 STDIAG (31) - ssm 0,0 + ssm 0,0 b,n perf_rdr_shift_out_U_leave nop - ssm 0,0 + ssm 0,0 nop perf_rdr_shift_out_U_leave: diff --git a/arch/parisc/kernel/perf_images.h b/arch/parisc/kernel/perf_images.h index a8ed8d002..d9562fe3f 100644 --- a/arch/parisc/kernel/perf_images.h +++ b/arch/parisc/kernel/perf_images.h @@ -2,6 +2,7 @@ * Imagine for use with the Onyx (PCX-U) CPU interface * * Copyright (C) 2001 Randolph Chung + * Copyright (C) 2001 Hewlett-Packard (Grant Grundler) * * 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 diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index d7365b958..320fca55f 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -363,8 +363,11 @@ asmlinkage int sys_execve(struct pt_regs *regs) goto out; error = do_execve(filename, (char **) regs->gr[25], (char **) regs->gr[24], regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index b4931ade4..13b721cb9 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -153,7 +153,7 @@ static int __init processor_probe(struct parisc_device *dev) p->cpuid = cpuid; /* save CPU id */ p->txn_addr = txn_addr; /* save CPU IRQ address */ #ifdef CONFIG_SMP - p->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&p->lock); /* ** FIXME: review if any other initialization is clobbered diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 871d7857f..0b8debf43 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c @@ -30,9 +30,9 @@ #undef DEBUG_PTRACE #ifdef DEBUG_PTRACE -#define DBG(x) printk x +#define DBG(x...) printk(x) #else -#define DBG(x) +#define DBG(x...) #endif #ifdef __LP64__ @@ -141,9 +141,9 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) if (copied != sizeof(tmp)) goto out_tsk; ret = put_user(tmp,(unsigned int *) data); - DBG(("sys_ptrace(PEEK%s, %d, %lx, %lx) returning %ld, data %x\n", + DBG("sys_ptrace(PEEK%s, %d, %lx, %lx) returning %ld, data %x\n", request == PTRACE_PEEKTEXT ? "TEXT" : "DATA", - pid, oaddr, odata, ret, tmp)); + pid, oaddr, odata, ret, tmp); } else #endif @@ -166,9 +166,9 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) #ifdef __LP64__ if (is_compat_task(child)) { unsigned int tmp = (unsigned int)data; - DBG(("sys_ptrace(POKE%s, %d, %lx, %lx)\n", + DBG("sys_ptrace(POKE%s, %d, %lx, %lx)\n", request == PTRACE_POKETEXT ? "TEXT" : "DATA", - pid, oaddr, odata)); + pid, oaddr, odata); addr &= 0xffffffffL; if (access_process_vm(child, addr, &tmp, sizeof(tmp), 1) == sizeof(tmp)) goto out_tsk; @@ -197,8 +197,8 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) tmp = *(unsigned int *) ((char *) task_regs(child) + addr); ret = put_user(tmp, (unsigned int *) data); - DBG(("sys_ptrace(PEEKUSR, %d, %lx, %lx) returning %ld, addr %lx, data %x\n", - pid, oaddr, odata, ret, addr, tmp)); + DBG("sys_ptrace(PEEKUSR, %d, %lx, %lx) returning %ld, addr %lx, data %x\n", + pid, oaddr, odata, ret, addr, tmp); } else #endif @@ -237,8 +237,8 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) * BEWARE, if you set N, and then single step, it won't * stop on the nullified instruction. */ - DBG(("sys_ptrace(POKEUSR, %d, %lx, %lx)\n", - pid, oaddr, odata)); + DBG("sys_ptrace(POKEUSR, %d, %lx, %lx)\n", + pid, oaddr, odata); data &= USER_PSW_BITS; task_regs(child)->gr[0] &= ~USER_PSW_BITS; task_regs(child)->gr[0] |= data; @@ -251,9 +251,9 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) goto out_tsk; if ((addr = translate_usr_offset(addr)) < 0) goto out_tsk; - DBG(("sys_ptrace(POKEUSR, %d, %lx, %lx) addr %lx\n", - pid, oaddr, odata, addr)); - if (addr >= PT_FR0 && addr <= PT_FR31) { + DBG("sys_ptrace(POKEUSR, %d, %lx, %lx) addr %lx\n", + pid, oaddr, odata, addr); + if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { /* Special case, fp regs are 64 bits anyway */ *(unsigned int *) ((char *) task_regs(child) + addr) = data; ret = 0; @@ -275,7 +275,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) goto out_tsk; if ((addr >= PT_GR1 && addr <= PT_GR31) || addr == PT_IAOQ0 || addr == PT_IAOQ1 || - (addr >= PT_FR0 && addr <= PT_FR31) || + (addr >= PT_FR0 && addr <= PT_FR31 + 4) || addr == PT_SAR) { *(unsigned long *) ((char *) task_regs(child) + addr) = data; ret = 0; @@ -286,8 +286,8 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ case PTRACE_CONT: ret = -EIO; - DBG(("sys_ptrace(%s)\n", - request == PTRACE_SYSCALL ? "SYSCALL" : "CONT")); + DBG("sys_ptrace(%s)\n", + request == PTRACE_SYSCALL ? "SYSCALL" : "CONT"); if ((unsigned long) data > _NSIG) goto out_tsk; child->ptrace &= ~(PT_SINGLESTEP|PT_BLOCKSTEP); @@ -305,14 +305,14 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) * sigkill. perhaps it should be put in the status * that it wants to exit. */ - DBG(("sys_ptrace(KILL)\n")); - if (child->state == TASK_ZOMBIE) /* already dead */ + DBG("sys_ptrace(KILL)\n"); + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ goto out_tsk; child->exit_code = SIGKILL; goto out_wake_notrap; case PTRACE_SINGLEBLOCK: - DBG(("sys_ptrace(SINGLEBLOCK)\n")); + DBG("sys_ptrace(SINGLEBLOCK)\n"); ret = -EIO; if ((unsigned long) data > _NSIG) goto out_tsk; @@ -329,10 +329,11 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) goto out_wake; case PTRACE_SINGLESTEP: - DBG(("sys_ptrace(SINGLESTEP)\n")); + DBG("sys_ptrace(SINGLESTEP)\n"); ret = -EIO; if ((unsigned long) data > _NSIG) goto out_tsk; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->ptrace &= ~PT_BLOCKSTEP; child->ptrace |= PT_SINGLESTEP; @@ -354,7 +355,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) /* Don't wake up the child, but let the parent know something happened. */ si.si_code = TRAP_TRACE; - si.si_addr = (void *) (task_regs(child)->iaoq[0] & ~3); + si.si_addr = (void __user *) (task_regs(child)->iaoq[0] & ~3); si.si_signo = SIGTRAP; si.si_errno = 0; force_sig_info(SIGTRAP, &si, child); @@ -382,6 +383,10 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) ret = ptrace_detach(child, data); goto out_tsk; + case PTRACE_GETEVENTMSG: + ret = put_user(child->ptrace_message, (unsigned int __user *) data); + goto out_tsk; + default: ret = ptrace_request(child, request, addr, data); goto out_tsk; @@ -396,8 +401,8 @@ out_tsk: put_task_struct(child); out: unlock_kernel(); - DBG(("sys_ptrace(%ld, %d, %lx, %lx) returning %ld\n", - request, pid, oaddr, odata, ret)); + DBG("sys_ptrace(%ld, %d, %lx, %lx) returning %ld\n", + request, pid, oaddr, odata, ret); return ret; } diff --git a/arch/parisc/kernel/real2.S b/arch/parisc/kernel/real2.S index 3637b0a98..8b8ee543a 100644 --- a/arch/parisc/kernel/real2.S +++ b/arch/parisc/kernel/real2.S @@ -149,7 +149,7 @@ restore_control_regs: rfi_virt2real: /* switch to real mode... */ ssm 0,0 /* See "relied upon translation" */ - nop /* comment in interruption.S */ + nop /* PA 2.0 Arch. F-5 */ nop nop nop @@ -186,7 +186,7 @@ rfi_v2r_1: .align 128 rfi_real2virt: ssm 0,0 /* See "relied upon translation" */ - nop /* comment in interruption.S */ + nop /* PA 2.0 Arch. F-5 */ nop nop nop diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 37bd6a607..f32675970 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -307,6 +307,8 @@ static int __init parisc_init(void) boot_cpu_data.cpu_hz / 1000000, boot_cpu_data.cpu_hz % 1000000 ); + parisc_setup_cache_timing(); + /* These are in a non-obvious order, will fix when we have an iotree */ #if defined(CONFIG_IOSAPIC) iosapic_init(); diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index b220bb22f..4a0a8adbc 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -494,11 +494,9 @@ give_sigsegv: */ static long -handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, - struct pt_regs *regs, int in_syscall) +handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, + sigset_t *oldset, struct pt_regs *regs, int in_syscall) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - DBG(1,"handle_signal: sig=%ld, ka=%p, info=%p, oldset=%p, regs=%p\n", sig, ka, info, oldset, regs); @@ -506,9 +504,6 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall)) return 0; - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; - if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -535,7 +530,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall) { siginfo_t info; - struct k_sigaction *ka; + struct k_sigaction ka; int signr; DBG(1,"\ndo_signal: oldset=0x%p, regs=0x%p, sr7 %#lx, in_syscall=%d\n", @@ -553,10 +548,15 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall) oldset->sig[0], oldset->sig[1]); - signr = get_signal_to_deliver(&info, regs, NULL); - DBG(3,"do_signal: signr = %d, regs->gr[28] = %ld\n", signr, regs->gr[28]); + /* May need to force signal if handle_signal failed to deliver */ + while (1) { + + signr = get_signal_to_deliver(&info, &ka, regs, NULL); + DBG(3,"do_signal: signr = %d, regs->gr[28] = %ld\n", signr, regs->gr[28]); - if (signr > 0) { + if (signr <= 0) + break; + /* Restart a system call if necessary. */ if (in_syscall) { /* Check the return code */ @@ -569,8 +569,7 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall) break; case -ERESTARTSYS: - ka = ¤t->sighand->action[signr-1]; - if (!(ka->sa.sa_flags & SA_RESTART)) { + if (!(ka.sa.sa_flags & SA_RESTART)) { DBG(1,"ERESTARTSYS: putting -EINTR\n"); regs->gr[28] = -EINTR; break; @@ -578,8 +577,7 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall) /* fallthrough */ case -ERESTARTNOINTR: /* A syscall is just a branch, so all - we have to do is fiddle the return - pointer. */ + we have to do is fiddle the return pointer. */ regs->gr[31] -= 8; /* delayed branching */ /* Preserve original r28. */ regs->gr[28] = regs->orig_r28; @@ -589,12 +587,13 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall) /* Whee! Actually deliver the signal. If the delivery failed, we need to continue to iterate in this loop so we can deliver the SIGSEGV... */ - if (handle_signal(signr, &info, oldset, regs, in_syscall)) { + if (handle_signal(signr, &info, &ka, oldset, regs, in_syscall)) { DBG(1,KERN_DEBUG "do_signal: Exit (success), regs->gr[28] = %ld\n", regs->gr[28]); return 1; } } + /* end of while(1) looping forever if we can't force a signal */ /* Did we come from a system call? */ if (in_syscall) { diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 9def95a43..75894bcd3 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -33,10 +33,10 @@ #include #include #include +#include #include #include -#include #include #include #include /* for flush_tlb_all() proto/macro */ @@ -54,7 +54,7 @@ #define kDEBUG 0 -spinlock_t smp_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(smp_lock); volatile struct task_struct *smp_init_current_idle_task; @@ -277,7 +277,7 @@ ipi_send(int cpu, enum ipi_message_type op) spin_lock_irqsave(&(p->lock),flags); p->pending_ipi |= 1 << op; - __raw_writel(IRQ_OFFSET(IPI_IRQ), cpu_data[cpu].hpa); + gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa); spin_unlock_irqrestore(&(p->lock),flags); } @@ -332,7 +332,8 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait) { struct smp_call_struct data; unsigned long timeout; - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); + int retries = 0; if (num_online_cpus() < 2) return 0; @@ -365,21 +366,22 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait) /* Send a message to all other CPUs and wait for them to respond */ send_IPI_allbutself(IPI_CALL_FUNC); + retry: /* Wait for response */ timeout = jiffies + HZ; while ( (atomic_read (&data.unstarted_count) > 0) && time_before (jiffies, timeout) ) barrier (); + if (atomic_read (&data.unstarted_count) > 0) { + printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d), try %d\n", + smp_processor_id(), ++retries); + goto retry; + } /* We either got one or timed out. Release the lock */ mb(); smp_call_function_data = NULL; - if (atomic_read (&data.unstarted_count) > 0) { - printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d)\n", - smp_processor_id()); - return -ETIMEDOUT; - } while (wait && atomic_read (&data.unfinished_count) > 0) barrier (); @@ -457,7 +459,6 @@ smp_cpu_init(int cpunum) */ void __init smp_callin(void) { - extern void cpu_idle(void); /* arch/parisc/kernel/process.c */ int slave_id = cpu_now_booting; #if 0 void *istack; @@ -532,7 +533,7 @@ int __init smp_boot_one_cpu(int cpuid) ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the ** contents of memory are valid." */ - __raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpuid].hpa); + gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, cpu_data[cpuid].hpa); mb(); /* diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 625a701f0..96ad250ed 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c @@ -234,6 +234,14 @@ asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low, return sys_readahead(fd, (loff_t)high << 32 | low, count); } +asmlinkage long parisc_fadvise64_64(int fd, + unsigned int high_off, unsigned int low_off, + unsigned int high_len, unsigned int low_len, int advice) +{ + return sys_fadvise64_64(fd, (loff_t)high_off << 32 | low_off, + (loff_t)high_len << 32 | low_len, advice); +} + asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag) { return -ENOMEM; diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 74db7f6b8..363b8a687 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -80,8 +80,11 @@ asmlinkage int sys32_execve(struct pt_regs *regs) goto out; error = compat_do_execve(filename, compat_ptr(regs->gr[25]), compat_ptr(regs->gr[24]), regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: @@ -162,12 +165,6 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) return error; } -#else /* CONFIG_SYSCTL */ - -asmlinkage long sys32_sysctl(struct __sysctl_args *args) -{ - return -ENOSYS; -} #endif /* CONFIG_SYSCTL */ asmlinkage long sys32_sched_rr_get_interval(pid_t pid, @@ -203,21 +200,6 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i) return 0; } -asmlinkage long sys32_time(compat_time_t *tloc) -{ - struct timeval tv; - compat_time_t now32; - - do_gettimeofday(&tv); - now32 = tv.tv_sec; - - if (tloc) - if (put_user(now32, tloc)) - now32 = -EFAULT; - - return now32; -} - asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz) { diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 1c34cf70d..32ea701f4 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -16,11 +16,32 @@ #include #include + /* We fill the empty parts of the gateway page with + * something that will kill the kernel or a + * userspace application. + */ +#define KILL_INSN break 0,0 + +#include /* for CONFIG_SMP */ + #ifdef __LP64__ .level 2.0w #else .level 1.1 #endif + +#ifndef __LP64__ + .macro fixup_branch,lbl + b \lbl + .endm +#else + .macro fixup_branch,lbl + ldil L%\lbl, %r1 + ldo R%\lbl(%r1), %r1 + bv,n %r0(%r1) + .endm +#endif + .text .import syscall_exit,code @@ -38,21 +59,41 @@ .align 4096 linux_gateway_page: - .rept 56 - break 0,0 + /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ + .rept 44 + KILL_INSN .endr + /* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */ + /* Light-weight-syscall entry must always be located at 0xb0 */ + /* WARNING: Keep this number updated with table size changes */ +#define __NR_lws_entries (2) + +lws_entry: + /* Unconditional branch to lws_start, located on the + same gateway page */ + b,n lws_start + + /* Fill from 0xb4 to 0xe0 */ + .rept 11 + KILL_INSN + .endr + + /* This function MUST be located at 0xe0 for glibc's threading + mechanism to work. DO NOT MOVE THIS CODE EVER! */ set_thread_pointer: gate .+8, %r0 /* increase privilege */ depi 3, 31, 2, %r31 /* Ensure we return into user mode. */ be 0(%sr7,%r31) /* return to user space */ mtctl %r26, %cr27 /* move arg0 to the control register */ + /* Increase the chance of trapping if random jumps occur to this + address, fill from 0xf0 to 0x100 */ .rept 4 - break 0,0 + KILL_INSN .endr -/* This address must remain fixed, or user binaries go splat. */ +/* This address must remain fixed at 0x100 for glibc's syscalls to work */ .align 256 linux_gateway_entry: gate .+8, %r0 /* become privileged */ @@ -157,6 +198,7 @@ linux_gateway_entry: /* Are we being ptraced? */ mfctl %cr30, %r1 + LDREG TI_TASK(%r1),%r1 LDREG TASK_PTRACE(%r1), %r1 bb,<,n %r1,31,.Ltracesys @@ -177,11 +219,8 @@ linux_gateway_entry: comiclr,>>= __NR_Linux_syscalls, %r20, %r0 b,n .Lsyscall_nosys -#ifdef __LP64__ - ldd,s %r20(%r19), %r19 -#else - ldwx,s %r20(%r19), %r19 -#endif + LDREGX %r20(%r19), %r19 + /* If this is a sys_rt_sigreturn call, and the signal was received * when not in_syscall, then we want to return via syscall_exit_rfi, * not syscall_exit. Signal no. in r20, in_syscall in r25 (see @@ -291,11 +330,8 @@ tracesys_next: comiclr,>>= __NR_Linux_syscalls, %r20, %r0 b,n .Lsyscall_nosys -#ifdef __LP64__ - ldd,s %r20(%r19), %r19 -#else - ldwx,s %r20(%r19), %r19 -#endif + LDREGX %r20(%r19), %r19 + /* If this is a sys_rt_sigreturn call, and the signal was received * when not in_syscall, then we want to return via syscall_exit_rfi, * not syscall_exit. Signal no. in r20, in_syscall in r25 (see @@ -344,12 +380,292 @@ tracesys_sigexit: ldil L%syscall_exit_rfi,%r1 be,n R%syscall_exit_rfi(%sr7,%r1) + + /********************************************************* + Light-weight-syscall code + + r20 - lws number + r26,r25,r24,r23,r22 - Input registers + r28 - Function return register + r21 - Error code. + + Scracth: Any of the above that aren't being + currently used, including r1. + + Return pointer: r31 (Not usable) + + Error codes returned by entry path: + + ENOSYS - r20 was an invalid LWS number. + + *********************************************************/ +lws_start: + /* Gate and ensure we return to userspace */ + gate .+8, %r0 + depi 3, 31, 2, %r31 /* Ensure we return to userspace */ + +#ifdef __LP64__ + /* FIXME: If we are a 64-bit kernel just + * turn this on unconditionally. + */ + ssm PSW_SM_W, %r1 + extrd,u %r1,PSW_W_BIT,1,%r1 + /* sp must be aligned on 4, so deposit the W bit setting into + * the bottom of sp temporarily */ + or,ev %r1,%r30,%r30 + + /* Clip LWS number to a 32-bit value always */ + depdi 0, 31, 32, %r20 +#endif + + /* Is the lws entry number valid? */ + comiclr,>>= __NR_lws_entries, %r20, %r0 + b,n lws_exit_nosys + + /* WARNING: Trashing sr2 and sr3 */ + mfsp %sr7,%r1 /* get userspace into sr3 */ + mtsp %r1,%sr3 + mtsp %r0,%sr2 /* get kernel space into sr2 */ + + /* Load table start */ + ldil L%lws_table, %r1 + ldo R%lws_table(%r1), %r28 /* Scratch use of r28 */ + LDREGX %r20(%sr2,r28), %r21 /* Scratch use of r21 */ + + /* Jump to lws, lws table pointers already relocated */ + be,n 0(%sr2,%r21) + +lws_exit_nosys: + ldo -ENOSYS(%r0),%r21 /* set errno */ + /* Fall through: Return to userspace */ + +lws_exit: +#ifdef __LP64__ + /* decide whether to reset the wide mode bit + * + * For a syscall, the W bit is stored in the lowest bit + * of sp. Extract it and reset W if it is zero */ + extrd,u,*<> %r30,63,1,%r1 + rsm PSW_SM_W, %r0 + /* now reset the lowest bit of sp if it was set */ + xor %r30,%r1,%r30 +#endif + be,n 0(%sr3, %r31) + + + + /*************************************************** + Implementing CAS as an atomic operation: + + %r26 - Address to examine + %r25 - Old value to check (old) + %r24 - New value to set (new) + %r28 - Return prev through this register. + %r21 - Kernel error code + + If debugging is DISabled: + + %r21 has the following meanings: + + EAGAIN - CAS is busy, ldcw failed, try again. + EFAULT - Read or write failed. + + If debugging is enabled: + + EDEADLOCK - CAS called recursively. + EAGAIN && r28 == 1 - CAS is busy. Lock contended. + EAGAIN && r28 == 2 - CAS is busy. ldcw failed. + EFAULT - Read or write failed. + + Scratch: r20, r28, r1 + + ****************************************************/ + + /* Do not enable LWS debugging */ +#define ENABLE_LWS_DEBUG 0 + + /* ELF64 Process entry path */ +lws_compare_and_swap64: +#ifdef __LP64__ + b,n lws_compare_and_swap +#else + /* If we are not a 64-bit kernel, then we don't + * implement having 64-bit input registers + */ + b,n lws_exit_nosys +#endif + + /* ELF32 Process entry path */ +lws_compare_and_swap32: +#ifdef __LP64__ + /* Clip all the input registers */ + depdi 0, 31, 32, %r26 + depdi 0, 31, 32, %r25 + depdi 0, 31, 32, %r24 +#endif + +lws_compare_and_swap: +#ifdef CONFIG_SMP + /* Load start of lock table */ + ldil L%lws_lock_start, %r20 + ldo R%lws_lock_start(%r20), %r28 + + /* Extract four bits from r26 and hash lock (Bits 4-7) */ + extru %r26, 27, 4, %r20 + + /* Find lock to use, the hash is either one of 0 to + 15, multiplied by 16 (keep it 16-byte aligned) + and add to the lock table offset. */ + shlw %r20, 4, %r20 + add %r20, %r28, %r20 + +# ifdef ENABLE_LWS_DEBUG + /* + DEBUG, check for deadlock! + If the thread register values are the same + then we were the one that locked it last and + this is a recurisve call that will deadlock. + We *must* giveup this call and fail. + */ + ldw 4(%sr2,%r20), %r28 /* Load thread register */ + mfctl %cr27, %r21 /* Get current thread register */ + cmpb,<>,n %r21, %r28, cas_lock /* Called recursive? */ + b lws_exit /* Return error! */ + ldo -EDEADLOCK(%r0), %r21 +cas_lock: + cmpb,=,n %r0, %r28, cas_nocontend /* Is nobody using it? */ + ldo 1(%r0), %r28 /* 1st case */ + b lws_exit /* Contended... */ + ldo -EAGAIN(%r0), %r21 /* Spin in userspace */ +cas_nocontend: +# endif +/* ENABLE_LWS_DEBUG */ + + ldcw 0(%sr2,%r20), %r28 /* Try to acquire the lock */ + cmpb,<>,n %r0, %r28, cas_action /* Did we get it? */ +cas_wouldblock: + ldo 2(%r0), %r28 /* 2nd case */ + b lws_exit /* Contended... */ + ldo -EAGAIN(%r0), %r21 /* Spin in userspace */ +#endif +/* CONFIG_SMP */ + + /* + prev = *addr; + if ( prev == old ) + *addr = new; + return prev; + */ + + /* NOTES: + This all works becuse intr_do_signal + and schedule both check the return iasq + and see that we are on the kernel page + so this process is never scheduled off + or is ever sent any signal of any sort, + thus it is wholly atomic from usrspaces + perspective + */ +cas_action: +#if defined CONFIG_SMP && defined ENABLE_LWS_DEBUG + /* DEBUG */ + mfctl %cr27, %r1 + stw %r1, 4(%sr2,%r20) +#endif + /* The load and store could fail */ +1: ldw 0(%sr3,%r26), %r28 + sub,<> %r28, %r25, %r0 +2: stw %r24, 0(%sr3,%r26) +#ifdef CONFIG_SMP + /* Free lock */ + stw %r20, 0(%sr2,%r20) +# ifdef ENABLE_LWS_DEBUG + /* Clear thread register indicator */ + stw %r0, 4(%sr2,%r20) +# endif +#endif + /* Return to userspace, set no error */ + b lws_exit + copy %r0, %r21 + +3: + /* Error occured on load or store */ +#ifdef CONFIG_SMP + /* Free lock */ + stw %r20, 0(%sr2,%r20) +# ifdef ENABLE_LWS_DEBUG + stw %r0, 4(%sr2,%r20) +# endif +#endif + b lws_exit + ldo -EFAULT(%r0),%r21 /* set errno */ + nop + nop + nop + nop + + /* Two exception table entries, one for the load, + the other for the store. Either return -EFAULT. + Each of the entries must be relocated. */ + .section __ex_table,"aw" +#ifdef __LP64__ + /* Pad the address calculation */ + .word 0,(2b - linux_gateway_page) + .word 0,(3b - linux_gateway_page) +#else + .word (2b - linux_gateway_page) + .word (3b - linux_gateway_page) +#endif + .previous + + .section __ex_table,"aw" +#ifdef __LP64__ + /* Pad the address calculation */ + .word 0,(1b - linux_gateway_page) + .word 0,(3b - linux_gateway_page) +#else + .word (1b - linux_gateway_page) + .word (3b - linux_gateway_page) +#endif + .previous + +end_compare_and_swap: + + /* Make sure nothing else is placed on this page */ + .align 4096 + .export end_linux_gateway_page +end_linux_gateway_page: + + /* Relocate symbols assuming linux_gateway_page is mapped + to virtual address 0x0 */ +#ifdef __LP64__ + /* FIXME: The code will always be on the gateay page + and thus it will be on the first 4k, the + assembler seems to think that the final + subtraction result is only a word in + length, so we pad the value. + */ +#define LWS_ENTRY(_name_) .word 0,(lws_##_name_ - linux_gateway_page) +#else +#define LWS_ENTRY(_name_) .word (lws_##_name_ - linux_gateway_page) +#endif + + .align 4096 + /* Light-weight-syscall table */ + /* Start of lws table. */ + .export lws_table +.Llws_table: +lws_table: + LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic compare and swap */ + LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ + /* End of lws table */ + .align 4096 .export sys_call_table .Lsys_call_table: sys_call_table: #include "syscall_table.S" -.end + #ifdef __LP64__ .align 4096 .export sys_call_table64 @@ -359,10 +675,29 @@ sys_call_table64: #include "syscall_table.S" #endif +#ifdef CONFIG_SMP + /* + All light-weight-syscall atomic operations + will use this set of locks + */ + .section .data + .align 4096 + .export lws_lock_start +.Llws_lock_start: +lws_lock_start: + /* lws locks */ + .align 16 + .rept 16 + /* Keep locks aligned at 16-bytes */ + .word 1 + .word 0 + .word 0 + .word 0 + .endr + .previous +#endif +/* CONFIG_SMP for lws_lock_start */ - /* Make sure nothing else is placed on this page */ +.end - .align 4096 - .export end_linux_gateway_page -end_linux_gateway_page: diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 2a3c11955..779b53710 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -1,6 +1,6 @@ /* System Call Table * - * Copyright (C) 1999-2003 Matthew Wilcox + * Copyright (C) 1999-2004 Matthew Wilcox * Copyright (C) 2000-2001 John Marvin * Copyright (C) 2000 Alan Modra * Copyright (C) 2000-2003 Paul Bame @@ -74,7 +74,7 @@ ENTRY_DIFF(execve_wrapper) ENTRY_SAME(chdir) /* See comments in kernel/time.c!!! Maybe we don't need this? */ - ENTRY_DIFF(time) + ENTRY_COMP(time) ENTRY_SAME(mknod) ENTRY_SAME(chmod) /* 15 */ ENTRY_SAME(lchown) @@ -91,7 +91,7 @@ ENTRY_SAME(bind) ENTRY_SAME(setuid) ENTRY_SAME(getuid) - ENTRY_SAME(stime) /* 25 */ + ENTRY_COMP(stime) /* 25 */ ENTRY_SAME(ptrace) ENTRY_SAME(alarm) /* see stat comment */ @@ -275,7 +275,7 @@ ENTRY_DIFF(rt_sigaction) ENTRY_DIFF(rt_sigprocmask) /* 175 */ ENTRY_DIFF(rt_sigpending) - ENTRY_UHOH(rt_sigtimedwait) + ENTRY_COMP(rt_sigtimedwait) /* even though the struct siginfo_t is different, it appears like * all the paths use values which should be same wide and narrow. * Also the struct is padded to 128 bytes which means we don't have @@ -308,19 +308,18 @@ ENTRY_OURS(ftruncate64) /* 200 */ ENTRY_SAME(getdents64) ENTRY_COMP(fcntl64) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) /* 205 */ - ENTRY_SAME(gettid) - ENTRY_OURS(readahead) - ENTRY_SAME(ni_syscall) /* tkill */ - + ENTRY_SAME(ni_syscall) /* attrctl -- dead */ + ENTRY_SAME(ni_syscall) /* acl_get -- dead */ + ENTRY_SAME(ni_syscall) /* 205 (acl_set -- dead) */ + ENTRY_SAME(gettid) + ENTRY_OURS(readahead) + ENTRY_SAME(tkill) ENTRY_SAME(sendfile64) ENTRY_COMP(futex) /* 210 */ ENTRY_COMP(sched_setaffinity) ENTRY_COMP(sched_getaffinity) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) + ENTRY_SAME(ni_syscall) /* set_thread_area */ + ENTRY_SAME(ni_syscall) /* get_thread_area */ ENTRY_SAME(io_setup) /* 215 */ ENTRY_SAME(io_destroy) ENTRY_SAME(io_getevents) @@ -334,12 +333,40 @@ ENTRY_SAME(epoll_ctl) /* 225 */ ENTRY_SAME(epoll_wait) ENTRY_SAME(remap_file_pages) - ENTRY_SAME(semtimedop) - ENTRY_SAME(mq_open) - ENTRY_SAME(mq_unlink) /* 230 */ - ENTRY_SAME(mq_timedsend) - ENTRY_SAME(mq_timedreceive) - ENTRY_SAME(mq_notify) - ENTRY_SAME(mq_getsetattr) - /* Nothing yet */ /* 235 */ + ENTRY_SAME(semtimedop) + ENTRY_SAME(mq_open) + ENTRY_SAME(mq_unlink) /* 230 */ + ENTRY_SAME(mq_timedsend) + ENTRY_SAME(mq_timedreceive) + ENTRY_SAME(mq_notify) + ENTRY_SAME(mq_getsetattr) + ENTRY_COMP(waitid) /* 235 */ + ENTRY_OURS(fadvise64_64) + ENTRY_SAME(set_tid_address) + ENTRY_SAME(setxattr) + ENTRY_SAME(lsetxattr) + ENTRY_SAME(fsetxattr) /* 240 */ + ENTRY_SAME(getxattr) + ENTRY_SAME(lgetxattr) + ENTRY_SAME(fgetxattr) + ENTRY_SAME(listxattr) + ENTRY_SAME(llistxattr) /* 245 */ + ENTRY_SAME(flistxattr) + ENTRY_SAME(removexattr) + ENTRY_SAME(lremovexattr) + ENTRY_SAME(fremovexattr) + ENTRY_COMP(timer_create) /* 250 */ + ENTRY_COMP(timer_settime) + ENTRY_COMP(timer_gettime) + ENTRY_SAME(timer_getoverrun) + ENTRY_SAME(timer_delete) + ENTRY_COMP(clock_settime) /* 255 */ + ENTRY_COMP(clock_gettime) + ENTRY_COMP(clock_getres) + ENTRY_COMP(clock_nanosleep) + ENTRY_SAME(tgkill) + ENTRY_COMP(mbind) /* 260 */ + ENTRY_COMP(get_mempolicy) + ENTRY_COMP(set_mempolicy) + /* Nothing yet */ diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 8f4ad0cf2..6cf740734 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -79,6 +79,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) while (nticks--) { #ifdef CONFIG_SMP smp_do_timer(regs); +#else + update_process_times(user_mode(regs)); #endif if (cpu == 0) { write_seqlock(&xtime_lock); diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index ff80b3c1f..69a253fe2 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -46,7 +46,7 @@ /* dumped to the console via printk) */ #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) -spinlock_t pa_dbit_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(pa_dbit_lock); #endif int printbinary(char *buf, unsigned long x, int nbits) @@ -135,32 +135,19 @@ void dump_stack(void) EXPORT_SYMBOL(dump_stack); -void show_stack(struct task_struct *task, unsigned long *s) +static void do_show_stack(struct unwind_frame_info *info) { int i = 1; - struct unwind_frame_info info; - - if (!task) { - unsigned long sp, ip, rp; - -HERE: - asm volatile ("copy %%r30, %0" : "=r"(sp)); - ip = (unsigned long)&&HERE; - rp = (unsigned long)__builtin_return_address(0); - unwind_frame_init(&info, current, sp, ip, rp); - } else { - unwind_frame_init_from_blocked_task(&info, task); - } printk("Backtrace:\n"); while (i <= 16) { - if (unwind_once(&info) < 0 || info.ip == 0) + if (unwind_once(info) < 0 || info->ip == 0) break; - if (__kernel_text_address(info.ip)) { - printk(" [<" RFMT ">] ", info.ip); + if (__kernel_text_address(info->ip)) { + printk(" [<" RFMT ">] ", info->ip); #ifdef CONFIG_KALLSYMS - print_symbol("%s\n", info.ip); + print_symbol("%s\n", info->ip); #else if ((i & 0x03) == 0) printk("\n"); @@ -171,6 +158,25 @@ HERE: printk("\n"); } +void show_stack(struct task_struct *task, unsigned long *s) +{ + struct unwind_frame_info info; + + if (!task) { + unsigned long sp, ip, rp; + +HERE: + asm volatile ("copy %%r30, %0" : "=r"(sp)); + ip = (unsigned long)&&HERE; + rp = (unsigned long)__builtin_return_address(0); + unwind_frame_init(&info, current, sp, ip, rp); + } else { + unwind_frame_init_from_blocked_task(&info, task); + } + + do_show_stack(&info); +} + void die_if_kernel(char *str, struct pt_regs *regs, long err) { if (user_mode(regs)) { @@ -373,13 +379,13 @@ void transfer_pim_to_trap_frame(struct pt_regs *regs) /* - * This routine handles page faults. It determines the address, - * and the problem, and then passes it off to one of the appropriate - * routines. + * This routine is called as a last resort when everything else + * has gone clearly wrong. We get called for faults in kernel space, + * and HPMC's. */ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset) { - static spinlock_t terminate_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(terminate_lock); oops_in_progress = 1; @@ -407,7 +413,12 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o } - show_stack(NULL, (unsigned long *)regs->gr[30]); + { + /* show_stack(NULL, (unsigned long *)regs->gr[30]); */ + struct unwind_frame_info info; + unwind_frame_init(&info, current, regs->gr[30], regs->iaoq[0], regs->gr[2]); + do_show_stack(&info); + } printk("\n"); printk(KERN_CRIT "%s: Code=%d regs=%p (Addr=" RFMT ")\n", @@ -421,9 +432,16 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o * system will shut down immediately right here. */ pdc_soft_power_button(0); - /* Gutter the processor! */ - for(;;) - ; + /* Call kernel panic() so reboot timeouts work properly + * FIXME: This function should be on the list of + * panic notifiers, and we should call panic + * directly from the location that we wish. + * e.g. We should not call panic from + * parisc_terminate, but rather the oter way around. + * This hack works, prints the panic message twice, + * and it enables reboot timers! + */ + panic(msg); } void handle_interruption(int code, struct pt_regs *regs) @@ -437,6 +455,36 @@ void handle_interruption(int code, struct pt_regs *regs) else local_irq_enable(); + /* Security check: + * If the priority level is still user, and the + * faulting space is not equal to the active space + * then the user is attempting something in a space + * that does not belong to them. Kill the process. + * + * This is normally the situation when the user + * attempts to jump into the kernel space at the + * wrong offset, be it at the gateway page or a + * random location. + * + * We cannot normally signal the process because it + * could *be* on the gateway page, and processes + * executing on the gateway page can't have signals + * delivered. + * + * We merely readjust the address into the users + * space, at a destination address of zero, and + * allow processing to continue. + */ + if (((unsigned long)regs->iaoq[0] & 3) && + ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { + /* Kill the user process later */ + regs->iaoq[0] = 0 | 3; + regs->iaoq[1] = regs->iaoq[0] + 4; + regs->iasq[0] = regs->iasq[0] = regs->sr[7]; + regs->gr[0] &= ~PSW_B; + return; + } + #if 0 printk(KERN_CRIT "Interruption # %d\n", code); #endif @@ -461,7 +509,7 @@ void handle_interruption(int code, struct pt_regs *regs) case 3: /* Recovery counter trap */ regs->gr[0] &= ~PSW_R; - if (regs->iasq[0]) + if (user_space(regs)) handle_gdb_break(regs, TRAP_TRACE); /* else this must be the start of a syscall - just let it run */ return; @@ -542,12 +590,12 @@ void handle_interruption(int code, struct pt_regs *regs) /* Set to zero, and let the userspace app figure it out from the insn pointed to by si_addr */ si.si_code = 0; - si.si_addr = (void *) regs->iaoq[0]; + si.si_addr = (void __user *) regs->iaoq[0]; force_sig_info(SIGFPE, &si, current); return; - } else - /* The kernel doesn't want to handle condition codes */ - break; + } + /* The kernel doesn't want to handle condition codes */ + break; case 14: /* Assist Exception Trap, i.e. floating point exception. */ @@ -565,9 +613,16 @@ void handle_interruption(int code, struct pt_regs *regs) /* Fall through */ case 17: /* Non-access data TLB miss fault/Non-access data page fault */ - /* TODO: Still need to add slow path emulation code here */ - /* TODO: Understand what is meant by the TODO listed - above this one. (Carlos) */ + /* FIXME: + Still need to add slow path emulation code here! + If the insn used a non-shadow register, then the tlb + handlers could not have their side-effect (e.g. probe + writing to a target register) emulated since rfir would + erase the changes to said register. Instead we have to + setup everything, call this function we are in, and emulate + by hand. Technically we need to emulate: + fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw + */ fault_address = regs->ior; fault_space = regs->isr; break; @@ -598,7 +653,7 @@ void handle_interruption(int code, struct pt_regs *regs) case 25: /* Taken branch trap */ regs->gr[0] &= ~PSW_T; - if (regs->iasq[0]) + if (user_space(regs)) handle_gdb_break(regs, TRAP_BRANCH); /* else this must be the start of a syscall - just let it * run. diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 530235c0b..3eda1dadc 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -23,6 +23,7 @@ #include #include #include +#include /* #define DEBUG_UNALIGNED 1 */ @@ -38,6 +39,11 @@ #define RFMT "%08lx" #endif +#define FIXUP_BRANCH(lbl) \ + "\tldil L%%" #lbl ", %%r1\n" \ + "\tldo R%%" #lbl "(%%r1), %%r1\n" \ + "\tbv,n %%r0(%%r1)\n" + /* 1111 1100 0000 0000 0001 0011 1100 0000 */ #define OPCODE1(a,b,c) ((a)<<26|(b)<<12|(c)<<6) #define OPCODE2(a,b) ((a)<<26|(b)<<1) @@ -134,15 +140,19 @@ static int emulate_ldh(struct pt_regs *regs, int toreg) "1: ldbs 0(%%sr1,%3), %%r20\n" "2: ldbs 1(%%sr1,%3), %0\n" " depw %%r20, 23, 24, %0\n" -" cmpclr,= %%r0, %%r0, %1\n" -"3: ldo -2(%%r0), %1\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %1\n" +"3: \n" +" .section .fixup,\"ax\"\n" +"4: ldi -2, %1\n" + FIXUP_BRANCH(3b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(3b-1b)\n" -" .dword 2b,(3b-2b)\n" +" .dword 1b,4b\n" +" .dword 2b,4b\n" #else -" .word 1b,(3b-1b)\n" -" .word 2b,(3b-2b)\n" +" .word 1b,4b\n" +" .word 2b,4b\n" #endif " .previous\n" : "=r" (val), "=r" (ret) @@ -175,15 +185,19 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop) " subi 32,%%r19,%%r19\n" " mtctl %%r19,11\n" " vshd %0,%%r20,%0\n" -" cmpclr,= %%r0, %%r0, %1\n" -"3: ldo -2(%%r0), %1\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %1\n" +"3: \n" +" .section .fixup,\"ax\"\n" +"4: ldi -2, %1\n" + FIXUP_BRANCH(3b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(3b-1b)\n" -" .dword 2b,(3b-2b)\n" +" .dword 1b,4b\n" +" .dword 2b,4b\n" #else -" .word 1b,(3b-1b)\n" -" .word 2b,(3b-2b)\n" +" .word 1b,4b\n" +" .word 2b,4b\n" #endif " .previous\n" : "=r" (val), "=r" (ret) @@ -222,15 +236,19 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) " subi 64,%%r19,%%r19\n" " mtsar %%r19\n" " shrpd %0,%%r20,%%sar,%0\n" -" cmpclr,= %%r0, %%r0, %1\n" -"3: ldo -2(%%r0), %1\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %1\n" +"3: \n" +" .section .fixup,\"ax\"\n" +"4: ldi -2, %1\n" + FIXUP_BRANCH(3b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(3b-1b)\n" -" .dword 2b,(3b-2b)\n" +" .dword 1b,4b\n" +" .dword 2b,4b\n" #else -" .word 1b,(3b-1b)\n" -" .word 2b,(3b-2b)\n" +" .word 1b,4b\n" +" .word 2b,4b\n" #endif " .previous\n" : "=r" (val), "=r" (ret) @@ -250,17 +268,21 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) " mtsar %%r19\n" " vshd %0,%1,%0\n" " vshd %1,%%r20,%1\n" -" cmpclr,= %%r0, %%r0, %2\n" -"4: ldo -2(%%r0), %2\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %2\n" +"4: \n" +" .section .fixup,\"ax\"\n" +"5: ldi -2, %2\n" + FIXUP_BRANCH(4b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(4b-1b)\n" -" .dword 2b,(4b-2b)\n" -" .dword 3b,(4b-3b)\n" +" .dword 1b,5b\n" +" .dword 2b,5b\n" +" .dword 3b,5b\n" #else -" .word 1b,(4b-1b)\n" -" .word 2b,(4b-2b)\n" -" .word 3b,(4b-3b)\n" +" .word 1b,5b\n" +" .word 2b,5b\n" +" .word 3b,5b\n" #endif " .previous\n" : "=r" (valh), "=r" (vall), "=r" (ret) @@ -296,15 +318,19 @@ static int emulate_sth(struct pt_regs *regs, int frreg) " extrw,u %1, 23, 8, %%r19\n" "1: stb %1, 1(%%sr1, %2)\n" "2: stb %%r19, 0(%%sr1, %2)\n" -" cmpclr,= %%r0, %%r0, %0\n" -"3: ldo -2(%%r0), %0\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %0\n" +"3: \n" +" .section .fixup,\"ax\"\n" +"4: ldi -2, %0\n" + FIXUP_BRANCH(3b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(3b-1b)\n" -" .dword 2b,(3b-2b)\n" +" .dword 1b,4b\n" +" .dword 2b,4b\n" #else -" .word 1b,(3b-1b)\n" -" .word 2b,(3b-2b)\n" +" .word 1b,4b\n" +" .word 2b,4b\n" #endif " .previous\n" : "=r" (ret) @@ -346,15 +372,19 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop) " or %%r1, %%r21, %%r21\n" " stw %%r20,0(%%sr1,%2)\n" " stw %%r21,4(%%sr1,%2)\n" -" cmpclr,= %%r0, %%r0, %0\n" -"3: ldo -2(%%r0), %0\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %0\n" +"3: \n" +" .section .fixup,\"ax\"\n" +"4: ldi -2, %0\n" + FIXUP_BRANCH(3b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(3b-1b)\n" -" .dword 2b,(3b-2b)\n" +" .dword 1b,4b\n" +" .dword 2b,4b\n" #else -" .word 1b,(3b-1b)\n" -" .word 2b,(3b-2b)\n" +" .word 1b,4b\n" +" .word 2b,4b\n" #endif " .previous\n" : "=r" (ret) @@ -399,19 +429,23 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop) " or %%r1, %%r21, %%r21\n" "3: std %%r20,0(%%sr1,%2)\n" "4: std %%r21,8(%%sr1,%2)\n" -" cmpclr,= %%r0, %%r0, %0\n" -"5: ldo -2(%%r0), %0\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %0\n" +"5: \n" +" .section .fixup,\"ax\"\n" +"6: ldi -2, %0\n" + FIXUP_BRANCH(5b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(5b-1b)\n" -" .dword 2b,(5b-2b)\n" -" .dword 3b,(5b-3b)\n" -" .dword 4b,(5b-4b)\n" +" .dword 1b,6b\n" +" .dword 2b,6b\n" +" .dword 3b,6b\n" +" .dword 4b,6b\n" #else -" .word 1b,(5b-1b)\n" -" .word 2b,(5b-2b)\n" -" .word 3b,(5b-3b)\n" -" .word 4b,(5b-4b)\n" +" .word 1b,6b\n" +" .word 2b,6b\n" +" .word 3b,6b\n" +" .word 4b,6b\n" #endif " .previous\n" : "=r" (ret) @@ -438,21 +472,25 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop) "3: stw %1,0(%%sr1,%1)\n" "4: stw %%r1,4(%%sr1,%3)\n" "5: stw %2,8(%%sr1,%3)\n" -" cmpclr,= %%r0, %%r0, %0\n" -"6: ldo -2(%%r0), %0\n" -" .section __ex_table,\"a\"\n" +" copy %%r0, %0\n" +"6: \n" +" .section .fixup,\"ax\"\n" +"7: ldi -2, %0\n" + FIXUP_BRANCH(6b) +" .previous\n" +" .section __ex_table,\"aw\"\n" #ifdef __LP64__ -" .dword 1b,(6b-1b)\n" -" .dword 2b,(6b-2b)\n" -" .dword 3b,(6b-3b)\n" -" .dword 4b,(6b-4b)\n" -" .dword 5b,(6b-5b)\n" +" .dword 1b,7b\n" +" .dword 2b,7b\n" +" .dword 3b,7b\n" +" .dword 4b,7b\n" +" .dword 5b,7b\n" #else -" .word 1b,(6b-1b)\n" -" .word 2b,(6b-2b)\n" -" .word 3b,(6b-3b)\n" -" .word 4b,(6b-4b)\n" -" .word 5b,(6b-5b)\n" +" .word 1b,7b\n" +" .word 2b,7b\n" +" .word 3b,7b\n" +" .word 4b,7b\n" +" .word 5b,7b\n" #endif " .previous\n" : "=r" (ret) @@ -492,7 +530,6 @@ void handle_unaligned(struct pt_regs *regs) show_regs(regs); #endif } - if (!unaligned_enabled) goto force_sigbus; } @@ -557,16 +594,6 @@ void handle_unaligned(struct pt_regs *regs) break; } - if (regs->isr != regs->sr[7]) - { - printk(KERN_CRIT "isr verification failed (isr: " RFMT ", sr7: " RFMT "\n", - regs->isr, regs->sr[7]); - - /* don't kill him though, since he has appropriate access to the page, or we - * would never have gotten here. - */ - } - /* TODO: make this cleaner... */ switch (regs->iir & OPCODE1_MASK) { diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index abd749074..5e1e11520 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -12,8 +12,10 @@ #include #include #include +#include #include +#include #include @@ -40,25 +42,27 @@ static struct unwind_table *unwind_tables, *unwind_tables_end; static inline const struct unwind_table_entry * find_unwind_entry_in_table(const struct unwind_table *table, unsigned long addr) { - const struct unwind_table_entry *e = 0; + const struct unwind_table_entry *e = NULL; unsigned long lo, hi, mid; - for (lo = 0, hi = table->length; lo < hi; ) - { - mid = (lo + hi) / 2; + lo = 0; + hi = table->length - 1; + + while (lo <= hi) { + mid = (hi - lo) / 2 + lo; e = &table->table[mid]; if (addr < e->region_start) - hi = mid; + hi = mid - 1; else if (addr > e->region_end) lo = mid + 1; else - break; + return e; } - return e; + return NULL; } -static inline const struct unwind_table_entry * +static const struct unwind_table_entry * find_unwind_entry(unsigned long addr) { struct unwind_table *table = unwind_tables; @@ -68,8 +72,7 @@ find_unwind_entry(unsigned long addr) addr <= kernel_unwind_table.end) e = find_unwind_entry_in_table(&kernel_unwind_table, addr); else - for (; table; table = table->next) - { + for (; table; table = table->next) { if (addr >= table->start && addr <= table->end) e = find_unwind_entry_in_table(table, addr); @@ -99,6 +102,11 @@ unwind_table_init(struct unwind_table *table, const char *name, table->next = NULL; for (; start <= end; start++) { + if (start < end && + start->region_end > (start+1)->region_start) { + printk("WARNING: Out of order unwind entry! %p and %p\n", start, start+1); + } + start->region_start += base_addr; start->region_end += base_addr; } @@ -114,7 +122,7 @@ unwind_table_add(const char *name, unsigned long base_addr, table = kmalloc(sizeof(struct unwind_table), GFP_USER); if (table == NULL) - return 0; + return NULL; unwind_table_init(table, name, base_addr, gp, start, end); spin_lock_irqsave(&unwind_lock, flags); if (unwind_tables) @@ -170,12 +178,40 @@ static void unwind_frame_regs(struct unwind_frame_info *info) int looking_for_rp, rpoffset = 0; e = find_unwind_entry(info->ip); - if (!e) { + if (e == NULL) { unsigned long sp; extern char _stext[], _etext[]; dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip); +#ifdef CONFIG_KALLSYMS + /* Handle some frequent special cases.... */ + { + char symname[KSYM_NAME_LEN+1]; + char *modname; + unsigned long symsize, offset; + + kallsyms_lookup(info->ip, &symsize, &offset, + &modname, symname); + + dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname); + + if (strcmp(symname, "_switch_to_ret") == 0) { + info->prev_sp = info->sp - CALLEE_SAVE_FRAME_SIZE; + info->prev_ip = *(unsigned long *)(info->prev_sp - RP_OFFSET); + dbg("_switch_to_ret @ %lx - setting " + "prev_sp=%lx prev_ip=%lx\n", + info->ip, info->prev_sp, + info->prev_ip); + return; + } else if (strcmp(symname, "ret_from_kernel_thread") == 0 || + strcmp(symname, "syscall_exit") == 0) { + info->prev_ip = info->prev_sp = 0; + return; + } + } +#endif + /* Since we are doing the unwinding blind, we don't know if we are adjusting the stack correctly or extracting the rp correctly. The rp is checked to see if it belongs to the @@ -185,30 +221,33 @@ static void unwind_frame_regs(struct unwind_frame_info *info) modules. */ sp = info->sp & ~63; do { - info->prev_sp = sp - 64; - - /* FIXME: what happens if we unwind too far so that - sp no longer falls in a mapped kernel page? */ -#ifndef __LP64__ - info->prev_ip = *(unsigned long *)(info->prev_sp - 20); -#else - info->prev_ip = *(unsigned long *)(info->prev_sp - 16); -#endif + unsigned long tmp; + info->prev_sp = sp - 64; + info->prev_ip = 0; + if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) + break; + info->prev_ip = tmp; sp = info->prev_sp; } while (info->prev_ip < (unsigned long)_stext || info->prev_ip > (unsigned long)_etext); - dbg("analyzing func @ %lx with no unwind info, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip); - } else { + info->rp = 0; - dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, Save_RP = %d size = %u\n", - e->region_start, e->region_end, e->Save_SP, e->Save_RP, e->Total_frame_size); + dbg("analyzing func @ %lx with no unwind info, setting " + "prev_sp=%lx prev_ip=%lx\n", info->ip, + info->prev_sp, info->prev_ip); + } else { + dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, " + "Save_RP = %d size = %u\n", e->region_start, + e->region_end, e->Save_SP, e->Save_RP, + e->Total_frame_size); looking_for_rp = e->Save_RP; for (npc = e->region_start; - (frame_size < (e->Total_frame_size << 3) || looking_for_rp) && + (frame_size < (e->Total_frame_size << 3) || + looking_for_rp) && npc < info->ip; npc += 4) { @@ -219,22 +258,28 @@ static void unwind_frame_regs(struct unwind_frame_info *info) /* ldo X(sp), sp, or stwm X,D(sp) */ frame_size += (insn & 0x1 ? -1 << 13 : 0) | ((insn & 0x3fff) >> 1); - dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size); - } else if ((insn & 0xffe00008) == 0x7ec00008) { + dbg("analyzing func @ %lx, insn=%08x @ " + "%lx, frame_size = %ld\n", info->ip, + insn, npc, frame_size); + } else if ((insn & 0xffe00008) == 0x73c00008) { /* std,ma X,D(sp) */ frame_size += (insn & 0x1 ? -1 << 13 : 0) | (((insn >> 4) & 0x3ff) << 3); - dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size); + dbg("analyzing func @ %lx, insn=%08x @ " + "%lx, frame_size = %ld\n", info->ip, + insn, npc, frame_size); } else if (insn == 0x6bc23fd9) { /* stw rp,-20(sp) */ rpoffset = 20; looking_for_rp = 0; - dbg("analyzing func @ %lx, insn=stw rp,-20(sp) @ %lx\n", info->ip, npc); + dbg("analyzing func @ %lx, insn=stw rp," + "-20(sp) @ %lx\n", info->ip, npc); } else if (insn == 0x0fc212c1) { /* std rp,-16(sr0,sp) */ rpoffset = 16; looking_for_rp = 0; - dbg("analyzing func @ %lx, insn=std rp,-16(sp) @ %lx\n", info->ip, npc); + dbg("analyzing func @ %lx, insn=std rp," + "-16(sp) @ %lx\n", info->ip, npc); } } @@ -244,7 +289,9 @@ static void unwind_frame_regs(struct unwind_frame_info *info) info->prev_ip = info->rp; info->rp = 0; - dbg("analyzing func @ %lx, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip); + dbg("analyzing func @ %lx, setting prev_sp=%lx " + "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, + info->prev_ip, npc); } } @@ -257,7 +304,8 @@ void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t, info->ip = ip; info->rp = rp; - dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", t ? (int)t->pid : 0, info->sp, info->ip); + dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", + t ? (int)t->pid : -1, info->sp, info->ip); } void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t) @@ -285,7 +333,9 @@ int unwind_once(struct unwind_frame_info *next_frame) next_frame->prev_sp = 0; next_frame->prev_ip = 0; - dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", (int)next_frame->t->pid, next_frame->sp, next_frame->ip); + dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", + next_frame->t ? (int)next_frame->t->pid : -1, + next_frame->sp, next_frame->ip); return 0; } diff --git a/arch/parisc/lib/Makefile b/arch/parisc/lib/Makefile index 7322c7e63..7bf705676 100644 --- a/arch/parisc/lib/Makefile +++ b/arch/parisc/lib/Makefile @@ -2,6 +2,8 @@ # Makefile for parisc-specific library files # -lib-y := lusercopy.o bitops.o checksum.o io.o memset.o +lib-y := lusercopy.o bitops.o checksum.o io.o memset.o fixup.o memcpy.o + +obj-y := iomap.o lib-$(CONFIG_SMP) += debuglocks.o diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c index 4c077fc4c..2de182f6f 100644 --- a/arch/parisc/lib/bitops.c +++ b/arch/parisc/lib/bitops.c @@ -13,8 +13,8 @@ #include #ifdef CONFIG_SMP -atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { - [0 ... (ATOMIC_HASH_SIZE-1)] = (atomic_lock_t) { { 1, 1, 1, 1 } } +spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { + [0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED }; #endif @@ -23,10 +23,10 @@ unsigned long __xchg64(unsigned long x, unsigned long *ptr) { unsigned long temp, flags; - atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags); + _atomic_spin_lock_irqsave(ptr, flags); temp = *ptr; *ptr = x; - atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); + _atomic_spin_unlock_irqrestore(ptr, flags); return temp; } #endif @@ -36,10 +36,10 @@ unsigned long __xchg32(int x, int *ptr) unsigned long flags; long temp; - atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags); + _atomic_spin_lock_irqsave(ptr, flags); temp = (long) *ptr; /* XXX - sign extension wanted? */ *ptr = x; - atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); + _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)temp; } @@ -49,10 +49,10 @@ unsigned long __xchg8(char x, char *ptr) unsigned long flags; long temp; - atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags); + _atomic_spin_lock_irqsave(ptr, flags); temp = (long) *ptr; /* XXX - sign extension wanted? */ *ptr = x; - atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); + _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)temp; } @@ -63,10 +63,10 @@ unsigned long __cmpxchg_u64(volatile unsigned long *ptr, unsigned long old, unsi unsigned long flags; unsigned long prev; - atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags); + _atomic_spin_lock_irqsave(ptr, flags); if ((prev = *ptr) == old) *ptr = new; - atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); + _atomic_spin_unlock_irqrestore(ptr, flags); return prev; } #endif @@ -76,9 +76,9 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign unsigned long flags; unsigned int prev; - atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags); + _atomic_spin_lock_irqsave(ptr, flags); if ((prev = *ptr) == old) *ptr = new; - atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); + _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)prev; } diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c index abd29ac69..9866c93f1 100644 --- a/arch/parisc/lib/checksum.c +++ b/arch/parisc/lib/checksum.c @@ -24,6 +24,13 @@ #include #include +#define addc(_t,_r) \ + __asm__ __volatile__ ( \ +" add %0, %1, %0\n" \ +" addc %0, %%r0, %0\n" \ + : "=r"(_t) \ + : "r"(_r), "0"(_t)); + static inline unsigned short from32to16(unsigned int x) { /* 32 bits --> 16 bits + carry */ @@ -56,16 +63,25 @@ static inline unsigned int do_csum(const unsigned char * buff, int len) } count >>= 1; /* nr of 32-bit words.. */ if (count) { - unsigned int carry = 0; - do { + while (count >= 4) { + unsigned int r1, r2, r3, r4; + r1 = *(unsigned int *)(buff + 0); + r2 = *(unsigned int *)(buff + 4); + r3 = *(unsigned int *)(buff + 8); + r4 = *(unsigned int *)(buff + 12); + addc(result, r1); + addc(result, r2); + addc(result, r3); + addc(result, r4); + count -= 4; + buff += 16; + } + while (count) { unsigned int w = *(unsigned int *) buff; count--; buff += 4; - result += carry; - result += w; - carry = (w > result); - } while (count); - result += carry; + addc(result, w); + } result = (result & 0xffff) + (result >> 16); } if (len & 2) { @@ -77,7 +93,7 @@ static inline unsigned int do_csum(const unsigned char * buff, int len) result += le16_to_cpu(*buff); result = from32to16(result); if (odd) - result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); + result = swab16(result); out: return result; } @@ -88,12 +104,8 @@ out: unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) { unsigned int result = do_csum(buff, len); - - /* add in old sum, and carry.. */ - result += sum; - if(sum > result) - result += 1; - return result; + addc(result, sum); + return from32to16(result); } EXPORT_SYMBOL(csum_partial); @@ -101,7 +113,7 @@ EXPORT_SYMBOL(csum_partial); /* * copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy_nocheck(const char *src, char *dst, +unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { /* @@ -119,7 +131,7 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck); * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user (const char *src, char *dst, +unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { diff --git a/arch/parisc/lib/debuglocks.c b/arch/parisc/lib/debuglocks.c index 5166a9378..5ac3eb047 100644 --- a/arch/parisc/lib/debuglocks.c +++ b/arch/parisc/lib/debuglocks.c @@ -18,6 +18,11 @@ * 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 + * + * We use pdc_printf() throughout the file for all output messages, to avoid + * losing messages because of disabled interrupts. Since we're using these + * messages for debugging purposes, it makes sense not to send them to the + * linux console. */ @@ -27,12 +32,15 @@ #include #include /* in_interrupt() */ #include +#include /* in_interrupt() */ +#include #undef INIT_STUCK #define INIT_STUCK 1L << 30 #ifdef CONFIG_DEBUG_SPINLOCK + void _dbg_spin_lock(spinlock_t * lock, const char *base_file, int line_no) { volatile unsigned int *a; @@ -59,12 +67,14 @@ try_again: * __ldcw() returns 1 if we get the lock; otherwise we * spin until the value of the lock changes, or we time out. */ + mb(); a = __ldcw_align(lock); while (stuck && (__ldcw(a) == 0)) while ((*a == 0) && --stuck); + mb(); if (unlikely(stuck <= 0)) { - printk(KERN_WARNING + pdc_printf( "%s:%d: spin_lock(%s/%p) stuck in %s at %p(%d)" " owned by %s:%d in %s at %p(%d)\n", base_file, line_no, lock->module, lock, @@ -84,7 +94,7 @@ try_again: lock->bline = line_no; if (unlikely(printed)) { - printk(KERN_WARNING + pdc_printf( "%s:%d: spin_lock grabbed in %s at %p(%d) %ld ticks\n", base_file, line_no, current->comm, inline_pc, cpu, jiffies - started); @@ -94,21 +104,28 @@ try_again: void _dbg_spin_unlock(spinlock_t * lock, const char *base_file, int line_no) { CHECK_LOCK(lock); - volatile unsigned int *a = __ldcw_align(lock); + volatile unsigned int *a; + mb(); + a = __ldcw_align(lock); if (unlikely((*a != 0) && lock->babble)) { lock->babble--; - printk(KERN_WARNING + pdc_printf( "%s:%d: spin_unlock(%s:%p) not locked\n", base_file, line_no, lock->module, lock); } *a = 1; + mb(); } int _dbg_spin_trylock(spinlock_t * lock, const char *base_file, int line_no) { int ret; - volatile unsigned int *a = __ldcw_align(lock); - if ((ret = (__ldcw(a) != 0))) { + volatile unsigned int *a; + mb(); + a = __ldcw_align(lock); + ret = (__ldcw(a) != 0); + mb(); + if (ret) { lock->oncpu = smp_processor_id(); lock->previous = __builtin_return_address(0); lock->task = current; @@ -150,7 +167,7 @@ void _dbg_write_lock(rwlock_t *rw, const char *bfile, int bline) int cpu = smp_processor_id(); if(unlikely(in_interrupt())) { /* acquiring write lock in interrupt context, bad idea */ - printk(KERN_WARNING "write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline); + pdc_printf("write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline); BUG(); } @@ -167,7 +184,7 @@ retry: stuck--; if ((unlikely(stuck <= 0)) && (rw->counter < 0)) { - printk(KERN_WARNING + pdc_printf( "%s:%d: write_lock stuck on writer" " in %s at %p(%d) %ld ticks\n", bfile, bline, current->comm, inline_pc, @@ -176,7 +193,7 @@ retry: printed = 1; } else if (unlikely(stuck <= 0)) { - printk(KERN_WARNING + pdc_printf( "%s:%d: write_lock stuck on reader" " in %s at %p(%d) %ld ticks\n", bfile, bline, current->comm, inline_pc, @@ -194,13 +211,47 @@ retry: rw->counter = -1; /* remember we are locked */ if (unlikely(printed)) { - printk(KERN_WARNING + pdc_printf( "%s:%d: write_lock grabbed in %s at %p(%d) %ld ticks\n", bfile, bline, current->comm, inline_pc, cpu, jiffies - started); } } +int _dbg_write_trylock(rwlock_t *rw, const char *bfile, int bline) +{ +#if 0 + void *inline_pc = __builtin_return_address(0); + int cpu = smp_processor_id(); +#endif + + if(unlikely(in_interrupt())) { /* acquiring write lock in interrupt context, bad idea */ + pdc_printf("write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline); + BUG(); + } + + /* Note: if interrupts are disabled (which is most likely), the printk + will never show on the console. We might need a polling method to flush + the dmesg buffer anyhow. */ + + _raw_spin_lock(&rw->lock); + + if(rw->counter != 0) { + /* this basically never happens */ + _raw_spin_unlock(&rw->lock); + + + return 0; + } + + /* got it. now leave without unlocking */ + rw->counter = -1; /* remember we are locked */ +#if 0 + pdc_printf("%s:%d: try write_lock grabbed in %s at %p(%d)\n", + bfile, bline, current->comm, inline_pc, cpu); +#endif +} + void _dbg_read_lock(rwlock_t * rw, const char *bfile, int bline) { #if 0 @@ -215,7 +266,7 @@ void _dbg_read_lock(rwlock_t * rw, const char *bfile, int bline) rw->counter++; #if 0 - printk(KERN_WARNING + pdc_printf( "%s:%d: read_lock grabbed in %s at %p(%d) %ld ticks\n", bfile, bline, current->comm, inline_pc, cpu, jiffies - started); diff --git a/arch/parisc/lib/io.c b/arch/parisc/lib/io.c index 86fb6b017..7c1406ff8 100644 --- a/arch/parisc/lib/io.c +++ b/arch/parisc/lib/io.c @@ -15,24 +15,24 @@ * Assumes the device can cope with 32-bit transfers. If it can't, * don't use this function. */ -void __memcpy_toio(unsigned long dest, unsigned long src, int count) +void memcpy_toio(volatile void __iomem *dst, const void *src, int count) { - if ((dest & 3) != (src & 3)) + if (((unsigned long)dst & 3) != ((unsigned long)src & 3)) goto bytecopy; - while (dest & 3) { - writeb(*(char *)src, dest++); + while ((unsigned long)dst & 3) { + writeb(*(char *)src, dst++); src++; count--; } while (count > 3) { - __raw_writel(*(u32 *)src, dest); + __raw_writel(*(u32 *)src, dst); src += 4; - dest += 4; + dst += 4; count -= 4; } bytecopy: while (count--) { - writeb(*(char *)src, dest++); + writeb(*(char *)src, dst++); src++; } } @@ -50,51 +50,51 @@ void __memcpy_toio(unsigned long dest, unsigned long src, int count) ** Minimize total number of transfers at cost of CPU cycles. ** TODO: only look at src alignment and adjust the stores to dest. */ -void __memcpy_fromio(unsigned long dest, unsigned long src, int count) +void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) { /* first compare alignment of src/dst */ - if ( ((dest ^ src) & 1) || (count < 2) ) + if ( (((unsigned long)dst ^ (unsigned long)src) & 1) || (count < 2) ) goto bytecopy; - if ( ((dest ^ src) & 2) || (count < 4) ) + if ( (((unsigned long)dst ^ (unsigned long)src) & 2) || (count < 4) ) goto shortcopy; /* Then check for misaligned start address */ - if (src & 1) { - *(u8 *)dest = readb(src); + if ((unsigned long)src & 1) { + *(u8 *)dst = readb(src); src++; - dest++; + dst++; count--; if (count < 2) goto bytecopy; } - if (src & 2) { - *(u16 *)dest = __raw_readw(src); + if ((unsigned long)src & 2) { + *(u16 *)dst = __raw_readw(src); src += 2; - dest += 2; + dst += 2; count -= 2; } while (count > 3) { - *(u32 *)dest = __raw_readl(src); - dest += 4; + *(u32 *)dst = __raw_readl(src); + dst += 4; src += 4; count -= 4; } shortcopy: while (count > 1) { - *(u16 *)dest = __raw_readw(src); + *(u16 *)dst = __raw_readw(src); src += 2; - dest += 2; + dst += 2; count -= 2; } bytecopy: while (count--) { - *(char *)dest = readb(src); + *(char *)dst = readb(src); src++; - dest++; + dst++; } } @@ -102,20 +102,20 @@ void __memcpy_fromio(unsigned long dest, unsigned long src, int count) * Assumes the device can cope with 32-bit transfers. If it can't, * don't use this function. */ -void __memset_io(unsigned long dest, char fill, int count) +void memset_io(volatile void __iomem *addr, unsigned char val, int count) { - u32 fill32 = (fill << 24) | (fill << 16) | (fill << 8) | fill; - while (dest & 3) { - writeb(fill, dest++); + u32 val32 = (val << 24) | (val << 16) | (val << 8) | val; + while ((unsigned long)addr & 3) { + writeb(val, addr++); count--; } while (count > 3) { - __raw_writel(fill32, dest); - dest += 4; + __raw_writel(val32, addr); + addr += 4; count -= 4; } while (count--) { - writeb(fill, dest++); + writeb(val, addr++); } } diff --git a/arch/parisc/lib/lusercopy.S b/arch/parisc/lib/lusercopy.S index 72c9615ed..a0509855c 100644 --- a/arch/parisc/lib/lusercopy.S +++ b/arch/parisc/lib/lusercopy.S @@ -53,124 +53,11 @@ mtsp %r1,%sr1 .endm - /* - * unsigned long - * lcopy_to_user(void *to, const void *from, unsigned long n) - * - * Returns 0 for success. - * otherwise, returns number of bytes not transferred. - */ - - .export lcopy_to_user,code -lcopy_to_user: - .proc - .callinfo NO_CALLS - .entry - comib,=,n 0,%r24,$lctu_done - get_sr -$lctu_loop: - ldbs,ma 1(%r25),%r1 - addib,<> -1,%r24,$lctu_loop -1: stbs,ma %r1,1(%sr1,%r26) -$lctu_done: - bv %r0(%r2) - copy %r24,%r28 - .exit - -2: b $lctu_done - ldo 1(%r24),%r24 - - .section __ex_table,"a" -#ifdef __LP64__ - .dword 1b,(2b-1b) -#else - .word 1b,(2b-1b) -#endif - .previous - - .procend - - /* - * unsigned long - * lcopy_from_user(void *to, const void *from, unsigned long n) - * - * Returns 0 for success. - * otherwise, returns number of bytes not transferred. - * - * NOTE: This routine will also zero any bytes in the - * destination that were not copied due to a fault. - * - */ - - .export lcopy_from_user,code -lcopy_from_user: - .proc - .callinfo NO_CALLS - .entry - comib,=,n 0,%r24,$lcfu_done - get_sr -$lcfu_loop: -1: ldbs,ma 1(%sr1,%r25),%r1 - addib,<> -1,%r24,$lcfu_loop - stbs,ma %r1,1(%r26) -$lcfu_done: - bv %r0(%r2) - copy %r24,%r28 - .exit - -2: copy %r24,%r23 -$lcfu_zero_loop: - addib,<> -1,%r23,$lcfu_zero_loop - stbs,ma %r0,1(%r26) - b $lcfu_done - nop - - .section __ex_table,"a" -#ifdef __LP64__ - .dword 1b,(2b-1b) -#else - .word 1b,(2b-1b) -#endif - .previous - - .procend - - /* - * unsigned long - * lcopy_in_user(void *to, const void *from, unsigned long n) - * - * Returns 0 for success. - * otherwise, returns number of bytes not transferred. - */ - - .export lcopy_in_user,code -lcopy_in_user: - .proc - .callinfo NO_CALLS - .entry - comib,=,n 0,%r24,$lciu_done - get_sr -$lciu_loop: - ldbs,ma 1(%sr1,%r25),%r1 - addib,<> -1,%r24,$lciu_loop -1: stbs,ma %r1,1(%sr1,%r26) -$lciu_done: - bv %r0(%r2) - copy %r24,%r28 - .exit - -2: b $lciu_done - ldo 1(%r24),%r24 - - .section __ex_table,"a" -#ifdef __LP64__ - .dword 1b,(2b-1b) -#else - .word 1b,(2b-1b) -#endif - .previous - - .procend + .macro fixup_branch lbl + ldil L%\lbl, %r1 + ldo R%\lbl(%r1), %r1 + bv %r0(%r1) + .endm /* * long lstrncpy_from_user(char *dst, const char *src, long n) @@ -201,16 +88,18 @@ $lsfu_exit: nop .exit -3: b $lsfu_exit + .section .fixup,"ax" +3: fixup_branch $lsfu_exit ldi -EFAULT,%r28 + .previous - .section __ex_table,"a" + .section __ex_table,"aw" #ifdef __LP64__ - .dword 1b,(3b-1b) - .dword 2b,(3b-2b) + .dword 1b,3b + .dword 2b,3b #else - .word 1b,(3b-1b) - .word 2b,(3b-2b) + .word 1b,3b + .word 2b,3b #endif .previous @@ -239,14 +128,16 @@ $lclu_done: copy %r25,%r28 .exit -2: b $lclu_done + .section .fixup,"ax" +2: fixup_branch $lclu_done ldo 1(%r25),%r25 + .previous - .section __ex_table,"a" + .section __ex_table,"aw" #ifdef __LP64__ - .dword 1b,(2b-1b) + .dword 1b,2b #else - .word 1b,(2b-1b) + .word 1b,2b #endif .previous @@ -282,16 +173,18 @@ $lslen_nzero: b $lslen_done ldo 1(%r26),%r26 /* special case for N == 0 */ -3: b $lslen_done + .section .fixup,"ax" +3: fixup_branch $lslen_done copy %r24,%r26 /* reset r26 so 0 is returned on fault */ + .previous - .section __ex_table,"a" + .section __ex_table,"aw" #ifdef __LP64__ - .dword 1b,(3b-1b) - .dword 2b,(3b-2b) + .dword 1b,3b + .dword 2b,3b #else - .word 1b,(3b-1b) - .word 2b,(3b-2b) + .word 1b,3b + .word 2b,3b #endif .previous diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c index e743ca590..20ec35530 100644 --- a/arch/parisc/lib/memcpy.c +++ b/arch/parisc/lib/memcpy.c @@ -515,16 +515,8 @@ void * memcpy(void * dst,const void *src, size_t count) return dst; } -void bcopy(const void * srcp, void * destp, size_t count) -{ - mtsp(get_kernel_space(), 1); - mtsp(get_kernel_space(), 2); - pa_memcpy(destp, srcp, count); -} - EXPORT_SYMBOL(copy_to_user); EXPORT_SYMBOL(copy_from_user); EXPORT_SYMBOL(copy_in_user); EXPORT_SYMBOL(memcpy); -EXPORT_SYMBOL(bcopy); #endif diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index d52b3a06a..fd1c77280 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -36,6 +36,9 @@ #define BITSSET 0x1c0 /* for identifying LDCW */ + +DEFINE_PER_CPU(struct exception_data, exception_data); + /* * parisc_acctyp(unsigned int inst) -- * Given a PA-RISC memory access instruction, determine if the @@ -230,17 +233,17 @@ bad_area: no_context: if (!user_mode(regs)) { - fix = search_exception_tables(regs->iaoq[0]); if (fix) { + struct exception_data *d; - if (fix->skip & 1) - regs->gr[8] = -EFAULT; - if (fix->skip & 2) - regs->gr[9] = 0; + d = &__get_cpu_var(exception_data); + d->fault_ip = regs->iaoq[0]; + d->fault_space = regs->isr; + d->fault_addr = regs->ior; - regs->iaoq[0] += ((fix->skip) & ~3); + regs->iaoq[0] = ((fix->fixup) & ~3); /* * NOTE: In some cases the faulting instruction diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 065da5807..ff0e1eabe 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -20,6 +20,7 @@ #include #include #include +#include /* for node_online_map */ #include #include @@ -268,8 +269,6 @@ static void __init setup_bootmem(void) } memset(pfnnid_map, 0xff, sizeof(pfnnid_map)); - numnodes = npmem_ranges; - for (i = 0; i < npmem_ranges; i++) node_set_online(i); #endif @@ -750,7 +749,7 @@ map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm) #if PTRS_PER_PMD == 1 pmd = (pmd_t *)__pa(pg_dir); #else - pmd = (pmd_t *) (PAGE_MASK & pgd_val(*pg_dir)); + pmd = (pmd_t *) pgd_address(*pg_dir); /* * pmd is physical at this point @@ -761,7 +760,7 @@ map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm) pmd = (pmd_t *) __pa(pmd); } - pgd_val(*pg_dir) = _PAGE_TABLE | (unsigned long) pmd; + __pgd_val_set(*pg_dir, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pmd); #endif /* now change pmd to kernel virtual addresses */ @@ -771,11 +770,11 @@ map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm) * pg_table is physical at this point */ - pg_table = (pte_t *) (PAGE_MASK & pmd_val(*pmd)); + pg_table = (pte_t *) pmd_address(*pmd); if (!pg_table) pg_table = (pte_t *) __pa(get_zeroed_page(GFP_KERNEL)); - pmd_val(*pmd) = _PAGE_TABLE | (unsigned long) pg_table; + __pmd_val_set(*pmd, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pg_table); /* now change pg_table to kernel virtual addresses */ @@ -804,19 +803,21 @@ void __init paging_init(void) ZONE_DMA zone. */ zones_size[ZONE_DMA] = pmem_ranges[i].pages; - free_area_init_node(i, NODE_DATA(i), zones_size, - pmem_ranges[i].start_pfn, 0); - #ifdef CONFIG_DISCONTIGMEM + /* Need to initialize the pfnnid_map before we can initialize + the zone */ { int j; - for (j = (node_start_pfn(i) >> PFNNID_SHIFT); - j <= (node_end_pfn(i) >> PFNNID_SHIFT); + for (j = (pmem_ranges[i].start_pfn >> PFNNID_SHIFT); + j <= ((pmem_ranges[i].start_pfn + pmem_ranges[i].pages) >> PFNNID_SHIFT); j++) { pfnnid_map[j] = i; } } #endif + + free_area_init_node(i, NODE_DATA(i), zones_size, + pmem_ranges[i].start_pfn, NULL); } } @@ -852,7 +853,7 @@ static unsigned long space_id_index; static unsigned long free_space_ids = NR_SPACE_IDS - 1; static unsigned long dirty_space_ids = 0; -static spinlock_t sid_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sid_lock); unsigned long alloc_sid(void) { diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c index b1e31f42f..f2df502cd 100644 --- a/arch/parisc/mm/ioremap.c +++ b/arch/parisc/mm/ioremap.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -94,6 +95,30 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, } #endif /* USE_HPPA_IOREMAP */ +#ifdef CONFIG_DEBUG_IOREMAP +static unsigned long last = 0; + +void gsc_bad_addr(unsigned long addr) +{ + if (time_after(jiffies, last + HZ*10)) { + printk("gsc_foo() called with bad address 0x%lx\n", addr); + dump_stack(); + last = jiffies; + } +} +EXPORT_SYMBOL(gsc_bad_addr); + +void __raw_bad_addr(const volatile void __iomem *addr) +{ + if (time_after(jiffies, last + HZ*10)) { + printk("__raw_foo() called with bad address 0x%p\n", addr); + dump_stack(); + last = jiffies; + } +} +EXPORT_SYMBOL(__raw_bad_addr); +#endif + /* * Generic mapping function (not visible outside): */ @@ -107,7 +132,7 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, * have to convert them into an offset in a page-aligned mapping, but the * caller shouldn't need to know that small detail. */ -void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) +void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { #if !(USE_HPPA_IOREMAP) @@ -118,7 +143,11 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag phys_addr |= 0xfc000000; } - return (void *)phys_addr; +#ifdef CONFIG_DEBUG_IOREMAP + return (void __iomem *)(phys_addr - (0x1UL << NYBBLE_SHIFT)); +#else + return (void __iomem *)phys_addr; +#endif #else void * addr; @@ -163,16 +192,16 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag vfree(addr); return NULL; } - return (void *) (offset + (char *)addr); + return (void __iomem *) (offset + (char *)addr); #endif } -void iounmap(void *addr) +void iounmap(void __iomem *addr) { #if !(USE_HPPA_IOREMAP) return; #else if (addr > high_memory) - return vfree((void *) (PAGE_MASK & (unsigned long) addr)); + return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); #endif } diff --git a/arch/parisc/oprofile/init.c b/arch/parisc/oprofile/init.c index a97b6ba48..a5b898c4d 100644 --- a/arch/parisc/oprofile/init.c +++ b/arch/parisc/oprofile/init.c @@ -12,9 +12,7 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops); - -int __init oprofile_arch_init(struct oprofile_operations ** ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { return -ENODEV; } diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index f0728f3c0..e95c48d57 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c @@ -51,12 +51,12 @@ #include #include #include +#include #include #include #include #include -#include #include @@ -264,6 +264,7 @@ struct SICC_state { unsigned int flags; int count; struct SICC_info *info; + spinlock_t sicc_lock; }; #define SICC_XMIT_SIZE 1024 @@ -385,9 +386,10 @@ static void siccuart_stop(struct tty_struct *tty) struct SICC_info *info = tty->driver_data; unsigned long flags; - save_flags(flags); cli(); + /* disable interrupts while stopping serial port interrupts */ + spin_lock_irqsave(&info->state->sicc_lock,flags); siccuart_disable_tx_interrupt(info); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } static void siccuart_start(struct tty_struct *tty) @@ -395,11 +397,12 @@ static void siccuart_start(struct tty_struct *tty) struct SICC_info *info = tty->driver_data; unsigned long flags; - save_flags(flags); cli(); + /* disable interrupts while starting serial port interrupts */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (info->xmit.head != info->xmit.tail && info->xmit.buf) siccuart_enable_tx_interrupt(info); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } @@ -604,7 +607,8 @@ static int siccuart_startup(struct SICC_info *info) return -ENOMEM; } - save_flags(flags); cli(); + /* lock access to info while doing setup */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (info->xmit.buf) free_page(page); @@ -688,12 +692,12 @@ static int siccuart_startup(struct SICC_info *info) siccuart_enable_rx_interrupt(info); info->flags |= ASYNC_INITIALIZED; - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); return 0; errout: - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); return retval; } @@ -708,7 +712,8 @@ static void siccuart_shutdown(struct SICC_info *info) if (!(info->flags & ASYNC_INITIALIZED)) return; - save_flags(flags); cli(); /* Disable interrupts */ + /* lock while shutting down port */ + spin_lock_irqsave(&info->state->sicc_lock,flags); /* Disable interrupts */ /* * clear delta_msr_wait queue to avoid mem leaks: we may free the irq @@ -746,7 +751,7 @@ static void siccuart_shutdown(struct SICC_info *info) info->flags &= ~ASYNC_INITIALIZED; - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } @@ -868,8 +873,8 @@ static void siccuart_change_speed(struct SICC_info *info, struct termios *old_te info->ignore_status_mask |= _LSR_OE_MASK; } - /* first, disable everything */ - save_flags(flags); cli(); + /* disable interrupts while reading and clearing registers */ + spin_lock_irqsave(&info->state->sicc_lock,flags); old_rcr = readb(info->port->uart_base + BL_SICC_RCR); old_tcr = readb(info->port->uart_base + BL_SICC_TxCR); @@ -881,7 +886,7 @@ static void siccuart_change_speed(struct SICC_info *info, struct termios *old_te /*RLBtrace (&ppc403Chan0, 0x2000000c, 0, 0);*/ - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); /* Set baud rate */ @@ -909,12 +914,13 @@ static void siccuart_put_char(struct tty_struct *tty, u_char ch) if (!tty || !info->xmit.buf) return; - save_flags(flags); cli(); + /* lock info->xmit while adding character to tx buffer */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SICC_XMIT_SIZE) != 0) { info->xmit.buf[info->xmit.head] = ch; info->xmit.head = (info->xmit.head + 1) & (SICC_XMIT_SIZE - 1); } - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } static void siccuart_flush_chars(struct tty_struct *tty) @@ -928,12 +934,13 @@ static void siccuart_flush_chars(struct tty_struct *tty) || !info->xmit.buf) return; - save_flags(flags); cli(); + /* disable interrupts while transmitting characters */ + spin_lock_irqsave(&info->state->sicc_lock,flags); siccuart_enable_tx_interrupt(info); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } -static int siccuart_write(struct tty_struct *tty, int from_user, +static int siccuart_write(struct tty_struct *tty, const u_char * buf, int count) { struct SICC_info *info = tty->driver_data; @@ -943,63 +950,28 @@ static int siccuart_write(struct tty_struct *tty, int from_user, if (!tty || !info->xmit.buf || !tmp_buf) return 0; - save_flags(flags); - if (from_user) { - down(&tmp_buf_sem); - while (1) { - int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SICC_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) - break; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!ret) - ret = -EFAULT; - break; - } - cli(); - c1 = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SICC_XMIT_SIZE); - if (c1 < c) - c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = (info->xmit.head + c) & - (SICC_XMIT_SIZE - 1); - restore_flags(flags); - buf += c; - count -= c; - ret += c; - } - up(&tmp_buf_sem); - } else { - cli(); - while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SICC_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) - break; - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = (info->xmit.head + c) & - (SICC_XMIT_SIZE - 1); - buf += c; - count -= c; - ret += c; - } - restore_flags(flags); + /* lock info->xmit while removing characters from buffer */ + spin_lock_irqsave(&info->state->sicc_lock,flags); + while (1) { + c = CIRC_SPACE_TO_END(info->xmit.head, + info->xmit.tail, + SICC_XMIT_SIZE); + if (count < c) + c = count; + if (c <= 0) + break; + memcpy(info->xmit.buf + info->xmit.head, buf, c); + info->xmit.head = (info->xmit.head + c) & + (SICC_XMIT_SIZE - 1); + buf += c; + count -= c; + ret += c; } if (info->xmit.head != info->xmit.tail && !tty->stopped && !tty->hw_stopped) siccuart_enable_tx_interrupt(info); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); return ret; } @@ -1023,9 +995,10 @@ static void siccuart_flush_buffer(struct tty_struct *tty) unsigned long flags; pr_debug("siccuart_flush_buffer(%d) called\n", tty->index); - save_flags(flags); cli(); + /* lock info->xmit while zeroing buffer counts */ + spin_lock_irqsave(&info->state->sicc_lock,flags); info->xmit.head = info->xmit.tail = 0; - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); wake_up_interruptible(&tty->write_wait); if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) @@ -1054,10 +1027,11 @@ static void siccuart_throttle(struct tty_struct *tty) siccuart_send_xchar(tty, STOP_CHAR(tty)); if (tty->termios->c_cflag & CRTSCTS) { - save_flags(flags); cli(); + /* disable interrupts while setting modem control lines */ + spin_lock_irqsave(&info->state->sicc_lock,flags); info->mctrl &= ~TIOCM_RTS; info->port->set_mctrl(info->port, info->mctrl); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } } @@ -1074,10 +1048,11 @@ static void siccuart_unthrottle(struct tty_struct *tty) } if (tty->termios->c_cflag & CRTSCTS) { - save_flags(flags); cli(); + /* disable interrupts while setting modem control lines */ + spin_lock_irqsave(&info->state->sicc_lock,flags); info->mctrl |= TIOCM_RTS; info->port->set_mctrl(info->port, info->mctrl); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } } @@ -1216,9 +1191,10 @@ static int get_lsr_info(struct SICC_info *info, unsigned int *value) unsigned int result, status; unsigned long flags; - save_flags(flags); cli(); + /* disable interrupts while reading status from port */ + spin_lock_irqsave(&info->state->sicc_lock,flags); status = readb(info->port->uart_base + BL_SICC_LSR); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); result = status & _LSR_TSR_EMPTY ? TIOCSER_TEMT : 0; /* @@ -1269,10 +1245,11 @@ static int set_modem_info(struct SICC_info *info, unsigned int cmd, default: return -EINVAL; } - save_flags(flags); cli(); + /* disable interrupts while setting modem control lines */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (old != info->mctrl) info->port->set_mctrl(info->port, info->mctrl); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); return 0; } @@ -1283,14 +1260,15 @@ static void siccuart_break_ctl(struct tty_struct *tty, int break_state) unsigned int lcr_h; - save_flags(flags); cli(); + /* disable interrupts while setting break state */ + spin_lock_irqsave(&info->state->sicc_lock,flags); lcr_h = readb(info->port + BL_SICC_LSR); if (break_state == -1) lcr_h |= _LSR_LB_MASK; else lcr_h &= ~_LSR_LB_MASK; writeb(lcr_h, info->port + BL_SICC_LSRS); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } static int siccuart_ioctl(struct tty_struct *tty, struct file *file, @@ -1338,9 +1316,10 @@ static int siccuart_ioctl(struct tty_struct *tty, struct file *file, * RI where only 0->1 is counted. */ case TIOCGICOUNT: - save_flags(flags); cli(); + /* disable interrupts while getting interrupt count */ + spin_lock_irqsave(&info->state->sicc_lock,flags); cnow = info->state->icount; - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; @@ -1377,22 +1356,24 @@ static void siccuart_set_termios(struct tty_struct *tty, struct termios *old_ter /* Handle transition to B0 status */ if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) { - save_flags(flags); cli(); + /* disable interrupts while setting break state */ + spin_lock_irqsave(&info->state->sicc_lock,flags); info->mctrl &= ~(TIOCM_RTS | TIOCM_DTR); info->port->set_mctrl(info->port, info->mctrl); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } /* Handle transition away from B0 status */ if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { - save_flags(flags); cli(); + /* disable interrupts while setting break state */ + spin_lock_irqsave(&info->state->sicc_lock,flags); info->mctrl |= TIOCM_DTR; if (!(cflag & CRTSCTS) || !test_bit(TTY_THROTTLED, &tty->flags)) info->mctrl |= TIOCM_RTS; info->port->set_mctrl(info->port, info->mctrl); - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); } /* Handle turning off CRTSCTS */ @@ -1428,11 +1409,11 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp) //pr_debug("siccuart_close() called\n"); - save_flags(flags); cli(); + /* lock tty->driver_data while closing port */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (tty_hung_up_p(filp)) { - restore_flags(flags); - return; + goto quick_close; } if ((tty->count == 1) && (state->count != 1)) { @@ -1451,11 +1432,10 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp) state->count = 0; } if (state->count) { - restore_flags(flags); - return; + goto quick_close; } info->flags |= ASYNC_CLOSING; - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); /* * Now we wait for the transmit buffer to clear; and we notify * the line discipline to only process XON/XOFF characters. @@ -1493,6 +1473,11 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp) } info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); wake_up_interruptible(&info->close_wait); + return; + +quick_close: + spin_unlock_irqrestore(&info->state->sicc_lock,flags); + return; } static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout) @@ -1604,20 +1589,22 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, */ retval = 0; add_wait_queue(&info->open_wait, &wait); - save_flags(flags); cli(); + /* lock while decrementing state->count */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (!tty_hung_up_p(filp)) { extra_count = 1; state->count--; } - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); info->blocked_open++; while (1) { - save_flags(flags); cli(); + /* disable interrupts while setting modem control lines */ + spin_lock_irqsave(&info->state->sicc_lock,flags); if (tty->termios->c_cflag & CBAUD) { info->mctrl = TIOCM_DTR | TIOCM_RTS; info->port->set_mctrl(info->port, info->mctrl); } - restore_flags(flags); + spin_unlock_irqrestore(&info->state->sicc_lock,flags); set_current_state(TASK_INTERRUPTIBLE); if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) { @@ -1788,6 +1775,7 @@ int __init siccuart_init(void) state->line = i; state->close_delay = 5 * HZ / 10; state->closing_wait = 30 * HZ; + spin_lock_init(&state->sicc_lock); } diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c index 3f8aa4197..ac6d55fe2 100644 --- a/arch/ppc/8260_io/enet.c +++ b/arch/ppc/8260_io/enet.c @@ -39,11 +39,11 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c index 41ca12432..a38487b11 100644 --- a/arch/ppc/8260_io/fcc_enet.c +++ b/arch/ppc/8260_io/fcc_enet.c @@ -34,12 +34,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig index bf1361958..9e2227ec3 100644 --- a/arch/ppc/8xx_io/Kconfig +++ b/arch/ppc/8xx_io/Kconfig @@ -10,7 +10,7 @@ config SCC_ENET depends on NET_ETHERNET help Enable Ethernet support via the Motorola MPC8xx serial - commmunications controller. + communications controller. choice prompt "SCC used for Ethernet" @@ -74,37 +74,6 @@ config ENET_BIG_BUFFERS Allocate large buffers for MPC8xx Etherenet. Increases throughput and decreases the likelihood of dropped packets, but costs memory. -config SMC2_UART - bool "Use SMC2 for UART" - help - If you would like to use SMC2 as a serial port, say Y here. - - If in doubt, say Y here. - -config ALTSMC2 - bool "Use Alternate SMC2 I/O (823/850)" - depends on SMC2_UART - help - If you have an MPC823 or MPC850 and would like to use the alternate - SMC2 for I/O, say Y here. - - If in doubt, say N here. - -config CONS_SMC2 - bool "Use SMC2 for Console" - depends on SMC2_UART - help - If you are going to have a serial console on your device and are - using SMC2 for your serial port, say Y here, else say N. - -config USE_SCC_IO - bool "Enable SCC2 and SCC3 for UART" - help - If your MPC8xx board has other SCC ports that you would like to use - for for a serial port, say Y here. - - If in doubt, say N here. - config HTDMSOUND bool "Embedded Planet HIOX Audio" depends on SOUND=y @@ -134,13 +103,36 @@ config 8xx_CPU6 If in doubt, say N here. -config UCODE_PATCH - bool "I2C/SPI Microcode Patch" +choice + prompt "Microcode patch selection" + default NO_UCODE_PATCH + help + Help not implemented yet, coming soon. + +config NO_UCODE_PATCH + bool "None" + +config USB_SOF_UCODE_PATCH + bool "USB SOF patch" + help + Help not implemented yet, coming soon. + +config I2C_SPI_UCODE_PATCH + bool "I2C/SPI relocation patch" help - Motorola releases microcode updates for their 8xx CPM modules. The - microcode update file has updates for IIC, SMC and USB. Currently only - the USB update is available by default, if the MPC8xx USB option is - enabled. If in doubt, say 'N' here. + Help not implemented yet, coming soon. + +config I2C_SPI_SMC1_UCODE_PATCH + bool "I2C/SPI/SMC1 relocation patch" + help + Help not implemented yet, coming soon. + +endchoice + +config UCODE_PATCH + bool + default y + depends on !NO_UCODE_PATCH endmenu diff --git a/arch/ppc/8xx_io/Makefile b/arch/ppc/8xx_io/Makefile index 7e5121912..d8760181f 100644 --- a/arch/ppc/8xx_io/Makefile +++ b/arch/ppc/8xx_io/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux MPC8xx ppc-specific parts of comm processor # -obj-y := commproc.o uart.o +obj-y := commproc.o obj-$(CONFIG_FEC_ENET) += fec.o obj-$(CONFIG_SCC_ENET) += enet.o diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 2688504d6..0cc2e7a9c 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -23,18 +23,20 @@ #include #include #include +#include #include #include #include #include +#include #include -#include #include #include #include #include #include #include +#include #include extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); @@ -51,68 +53,69 @@ struct cpm_action { void *dev_id; }; static struct cpm_action cpm_vecs[CPMVEC_NR]; -static void cpm_interrupt(int irq, void * dev, struct pt_regs * regs); -static void cpm_error_interrupt(void *, struct pt_regs * regs); +static irqreturn_t cpm_interrupt(int irq, void * dev, struct pt_regs * regs); +static irqreturn_t cpm_error_interrupt(int irq, void *dev, struct pt_regs * regs); static void alloc_host_memory(void); +/* Define a table of names to identify CPM interrupt handlers in + * /proc/interrupts. + */ +const char *cpm_int_name[] = + { "error", "PC4", "PC5", "SMC2", + "SMC1", "SPI", "PC6", "Timer 4", + "", "PC7", "PC8", "PC9", + "Timer 3", "", "PC10", "PC11", + "I2C", "RISC Timer", "Timer 2", "", + "IDMA2", "IDMA1", "SDMA error", "PC12", + "PC13", "Timer 1", "PC14", "SCC4", + "SCC3", "SCC2", "SCC1", "PC15" + }; -#if 1 -void -m8xx_cpm_reset(void) +static void +cpm_mask_irq(unsigned int irq) { - volatile immap_t *imp; - volatile cpm8xx_t *commproc; - - imp = (immap_t *)IMAP_ADDR; - commproc = (cpm8xx_t *)&imp->im_cpm; - -#ifdef CONFIG_UCODE_PATCH - /* Perform a reset. - */ - commproc->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); + int cpm_vec = irq - CPM_IRQ_OFFSET; - /* Wait for it. - */ - while (commproc->cp_cpcr & CPM_CR_FLG); - - cpm_load_patch(imp); -#endif + ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << cpm_vec); +} - /* Set SDMA Bus Request priority 5. - * On 860T, this also enables FEC priority 6. I am not sure - * this is what we realy want for some applications, but the - * manual recommends it. - * Bit 25, FAM can also be set to use FEC aggressive mode (860T). - */ - imp->im_siu_conf.sc_sdcr = 1; +static void +cpm_unmask_irq(unsigned int irq) +{ + int cpm_vec = irq - CPM_IRQ_OFFSET; - /* Reclaim the DP memory for our use. */ - m8xx_cpm_dpinit(); + ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr |= (1 << cpm_vec); +} - /* Tell everyone where the comm processor resides. - */ - cpmp = (cpm8xx_t *)commproc; +static void +cpm_ack(unsigned int irq) +{ + /* We do not need to do anything here. */ } -/* We used to do this earlier, but have to postpone as long as possible - * to ensure the kernel VM is now running. - */ static void -alloc_host_memory() +cpm_eoi(unsigned int irq) { - uint physaddr; + int cpm_vec = irq - CPM_IRQ_OFFSET; - /* Set the host page for allocation. - */ - host_buffer = (uint)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &physaddr); - host_end = host_buffer + PAGE_SIZE; + ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr = (1 << cpm_vec); } -#else + +struct hw_interrupt_type cpm_pic = { + .typename = " CPM ", + .enable = cpm_unmask_irq, + .disable = cpm_mask_irq, + .ack = cpm_ack, + .end = cpm_eoi, +}; + +extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); + void -m8xx_cpm_reset(uint host_page_addr) +m8xx_cpm_reset(uint bootpage) { volatile immap_t *imp; volatile cpm8xx_t *commproc; - pte_t *pte; + pte_t *pte; imp = (immap_t *)IMAP_ADDR; commproc = (cpm8xx_t *)&imp->im_cpm; @@ -134,40 +137,61 @@ m8xx_cpm_reset(uint host_page_addr) * this is what we realy want for some applications, but the * manual recommends it. * Bit 25, FAM can also be set to use FEC aggressive mode (860T). - */ + */ imp->im_siu_conf.sc_sdcr = 1; /* Reclaim the DP memory for our use. */ m8xx_cpm_dpinit(); - /* Set the host page for allocation. - */ - host_buffer = host_page_addr; /* Host virtual page address */ - host_end = host_page_addr + PAGE_SIZE; + /* get the PTE for the bootpage */ + if (!get_pteptr(&init_mm, bootpage, &pte)) + panic("get_pteptr failed\n"); + + /* and make it uncachable */ + pte_val(*pte) |= _PAGE_NO_CACHE; + _tlbie(bootpage); - /* We need to get this page early, so I have to do it the - * hard way. - */ - if (get_pteptr(&init_mm, host_page_addr, &pte)) { - pte_val(*pte) |= _PAGE_NO_CACHE; - flush_tlb_page(init_mm.mmap, host_buffer); - } - else { - panic("Huh? No CPM host page?"); - } + host_buffer = bootpage; + host_end = host_buffer + PAGE_SIZE; /* Tell everyone where the comm processor resides. */ cpmp = (cpm8xx_t *)commproc; } -#endif + +/* We used to do this earlier, but have to postpone as long as possible + * to ensure the kernel VM is now running. + */ +static void +alloc_host_memory(void) +{ + dma_addr_t physaddr; + + /* Set the host page for allocation. + */ + host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr, + GFP_KERNEL); + host_end = host_buffer + PAGE_SIZE; +} /* This is called during init_IRQ. We used to do it above, but this * was too early since init_IRQ was not yet called. */ +static struct irqaction cpm_error_irqaction = { + .handler = cpm_error_interrupt, + .mask = CPU_MASK_NONE, +}; +static struct irqaction cpm_interrupt_irqaction = { + .handler = cpm_interrupt, + .mask = CPU_MASK_NONE, + .name = "CPM cascade", +}; + void cpm_interrupt_init(void) { + int i; + /* Initialize the CPM interrupt controller. */ ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr = @@ -175,41 +199,52 @@ cpm_interrupt_init(void) ((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK; ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr = 0; - /* Set our interrupt handler with the core CPU. - */ - if (request_8xxirq(CPM_INTERRUPT, cpm_interrupt, 0, "cpm", NULL) != 0) + /* install the CPM interrupt controller routines for the CPM + * interrupt vectors + */ + for ( i = CPM_IRQ_OFFSET ; i < CPM_IRQ_OFFSET + NR_CPM_INTS ; i++ ) + irq_desc[i].handler = &cpm_pic; + + /* Set our interrupt handler with the core CPU. */ + if (setup_irq(CPM_INTERRUPT, &cpm_interrupt_irqaction)) panic("Could not allocate CPM IRQ!"); - /* Install our own error handler. - */ - cpm_install_handler(CPMVEC_ERROR, cpm_error_interrupt, NULL); + /* Install our own error handler. */ + cpm_error_irqaction.name = cpm_int_name[CPMVEC_ERROR]; + if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction)) + panic("Could not allocate CPM error IRQ!"); + ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr |= CICR_IEN; } -/* CPM interrupt controller interrupt. -*/ -static void -cpm_interrupt(int irq, void * dev, struct pt_regs * regs) +/* + * Get the CPM interrupt vector. + */ +int +cpm_get_irq(struct pt_regs *regs) { - uint vec; + int cpm_vec; /* Get the vector by setting the ACK bit and then reading * the register. */ ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr = 1; - vec = ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr; - vec >>= 11; + cpm_vec = ((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr; + cpm_vec >>= 11; - if (cpm_vecs[vec].handler != 0) - (*cpm_vecs[vec].handler)(cpm_vecs[vec].dev_id, regs); - else - ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << vec); + return cpm_vec; +} - /* After servicing the interrupt, we have to remove the status - * indicator. +/* CPM interrupt controller cascade interrupt. +*/ +static irqreturn_t +cpm_interrupt(int irq, void * dev, struct pt_regs * regs) +{ + /* This interrupt handler never actually gets called. It is + * installed only to unmask the CPM cascade interrupt in the SIU + * and to make the CPM cascade interrupt visible in /proc/interrupts. */ - ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr = (1 << vec); - + return IRQ_HANDLED; } /* The CPM can generate the error interrupt when there is a race condition @@ -217,41 +252,73 @@ cpm_interrupt(int irq, void * dev, struct pt_regs * regs) * and return. This is a no-op function so we don't need any special * tests in the interrupt handler. */ -static void -cpm_error_interrupt(void *dev, struct pt_regs *regs) +static irqreturn_t +cpm_error_interrupt(int irq, void *dev, struct pt_regs *regs) +{ + return IRQ_HANDLED; +} + +/* A helper function to translate the handler prototype required by + * request_irq() to the handler prototype required by cpm_install_handler(). + */ +static irqreturn_t +cpm_handler_helper(int irq, void *dev_id, struct pt_regs *regs) { + int cpm_vec = irq - CPM_IRQ_OFFSET; + + (*cpm_vecs[cpm_vec].handler)(dev_id, regs); + + return IRQ_HANDLED; } /* Install a CPM interrupt handler. -*/ + * This routine accepts a CPM interrupt vector in the range 0 to 31. + * This routine is retained for backward compatibility. Rather than using + * this routine to install a CPM interrupt handler, you can now use + * request_irq() with an IRQ in the range CPM_IRQ_OFFSET to + * CPM_IRQ_OFFSET + NR_CPM_INTS - 1 (16 to 47). + * + * Notice that the prototype of the interrupt handler function must be + * different depending on whether you install the handler with + * request_irq() or cpm_install_handler(). + */ void -cpm_install_handler(int vec, void (*handler)(void *, struct pt_regs *regs), +cpm_install_handler(int cpm_vec, void (*handler)(void *, struct pt_regs *regs), void *dev_id) { + int err; /* If null handler, assume we are trying to free the IRQ. */ if (!handler) { - cpm_free_handler(vec); + free_irq(CPM_IRQ_OFFSET + cpm_vec, dev_id); return; } - if (cpm_vecs[vec].handler != 0) - printk("CPM interrupt %x replacing %x\n", - (uint)handler, (uint)cpm_vecs[vec].handler); - cpm_vecs[vec].handler = handler; - cpm_vecs[vec].dev_id = dev_id; - ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr |= (1 << vec); + if (cpm_vecs[cpm_vec].handler != 0) + printk(KERN_INFO "CPM interrupt %x replacing %x\n", + (uint)handler, (uint)cpm_vecs[cpm_vec].handler); + cpm_vecs[cpm_vec].handler = handler; + cpm_vecs[cpm_vec].dev_id = dev_id; + + if ((err = request_irq(CPM_IRQ_OFFSET + cpm_vec, cpm_handler_helper, + 0, cpm_int_name[cpm_vec], dev_id))) + printk(KERN_ERR "request_irq() returned %d for CPM vector %d\n", + err, cpm_vec); } /* Free a CPM interrupt handler. -*/ + * This routine accepts a CPM interrupt vector in the range 0 to 31. + * This routine is retained for backward compatibility. + */ void -cpm_free_handler(int vec) +cpm_free_handler(int cpm_vec) { - cpm_vecs[vec].handler = NULL; - cpm_vecs[vec].dev_id = NULL; - ((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << vec); + request_irq(CPM_IRQ_OFFSET + cpm_vec, NULL, 0, 0, + cpm_vecs[cpm_vec].dev_id); + + cpm_vecs[cpm_vec].handler = NULL; + cpm_vecs[cpm_vec].dev_id = NULL; } /* We also own one page of host buffer space for the allocation of @@ -262,10 +329,8 @@ m8xx_cpm_hostalloc(uint size) { uint retloc; -#if 1 if (host_buffer == 0) alloc_host_memory(); -#endif if ((host_buffer + size) >= host_end) return(0); diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index 514e7de40..be7cef18d 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c @@ -55,6 +55,8 @@ static int irq_installed = 0; static char **sound_buffers = NULL; static char **sound_read_buffers = NULL; +static spinlock_t cs4218_lock = SPIN_LOCK_UNLOCKED; + /* Local copies of things we put in the control register. Output * volume, like most codecs is really attenuation. */ @@ -1206,7 +1208,8 @@ static void CS_Play(void) volatile cbd_t *bdp; volatile cpm8xx_t *cp; - save_flags(flags); cli(); + /* Protect buffer */ + spin_lock_irqsave(&cs4218_lock, flags); #if 0 if (awacs_beep_state) { /* sound takes precedence over beeps */ @@ -1263,7 +1266,7 @@ static void CS_Play(void) ++sq.active; } - restore_flags(flags); + spin_unlock_irqrestore(&cs4218_lock, flags); } @@ -1275,7 +1278,8 @@ static void CS_Record(void) if (read_sq.active) return; - save_flags(flags); cli(); + /* Protect buffer */ + spin_lock_irqsave(&cs4218_lock, flags); /* This is all we have to do......Just start it up. */ @@ -1284,7 +1288,7 @@ static void CS_Record(void) read_sq.active = 1; - restore_flags(flags); + spin_unlock_irqrestore(&cs4218_lock, flags); } @@ -1365,14 +1369,15 @@ static void cs_nosound(unsigned long xx) { unsigned long flags; - save_flags(flags); cli(); + /* not sure if this is needed, since hardware command is #if 0'd */ + spin_lock_irqsave(&cs4218_lock, flags); if (beep_playing) { #if 0 st_le16(&beep_dbdma_cmd->command, DBDMA_STOP); #endif beep_playing = 0; } - restore_flags(flags); + spin_unlock_irqrestore(&cs4218_lock, flags); } static struct timer_list beep_timer = TIMER_INITIALIZER(cs_nosound, 0, 0); @@ -1401,21 +1406,22 @@ static void cs_mksound(unsigned int hz, unsigned int ticks) return; #endif } - save_flags(flags); cli(); + /* lock while modifying beep_timer */ + spin_lock_irqsave(&cs4218_lock, flags); del_timer(&beep_timer); if (ticks) { beep_timer.expires = jiffies + ticks; add_timer(&beep_timer); } if (beep_playing || sq.active || beep_buf == NULL) { - restore_flags(flags); + spin_unlock_irqrestore(&cs4218_lock, flags); return; /* too hard, sorry :-( */ } beep_playing = 1; #if 0 st_le16(&beep_dbdma_cmd->command, OUTPUT_MORE + BR_ALWAYS); #endif - restore_flags(flags); + spin_unlock_irqrestore(&cs4218_lock, flags); if (hz == beep_hz_cache && beep_volume == beep_volume_cache) { nsamples = beep_nsamples_cache; @@ -1442,7 +1448,7 @@ static void cs_mksound(unsigned int hz, unsigned int ticks) st_le32(&beep_dbdma_cmd->phy_addr, virt_to_bus(beep_buf)); awacs_beep_state = 1; - save_flags(flags); cli(); + spin_lock_irqsave(&cs4218_lock, flags); if (beep_playing) { /* i.e. haven't been terminated already */ out_le32(&awacs_txdma->control, (RUN|WAKE|FLUSH|PAUSE) << 16); out_le32(&awacs->control, @@ -1452,8 +1458,8 @@ static void cs_mksound(unsigned int hz, unsigned int ticks) out_le32(&awacs_txdma->cmdptr, virt_to_bus(beep_dbdma_cmd)); out_le32(&awacs_txdma->control, RUN | (RUN << 16)); } + spin_unlock_irqrestore(&cs4218_lock, flags); #endif - restore_flags(flags); } static MACHINE mach_cs4218 = { diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c index 8ddef1c5c..f720d2a4c 100644 --- a/arch/ppc/8xx_io/enet.c +++ b/arch/ppc/8xx_io/enet.c @@ -38,11 +38,12 @@ #include #include #include +#include +#include #include #include #include -#include #include #include @@ -581,10 +582,10 @@ static void set_multicast_list(struct net_device *dev) /* Log any net taps. */ printk("%s: Promiscuous mode enabled.\n", dev->name); - cep->sccp->scc_pmsr |= SCC_PMSR_PRO; + cep->sccp->scc_psmr |= SCC_PSMR_PRO; } else { - cep->sccp->scc_pmsr &= ~SCC_PMSR_PRO; + cep->sccp->scc_psmr &= ~SCC_PSMR_PRO; if (dev->flags & IFF_ALLMULTI) { /* Catch all multicast addresses, so set the @@ -835,7 +836,8 @@ static int __init scc_enet_init(void) /* Allocate a page. */ - ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); + ba = (unsigned char *)dma_alloc_coherent(NULL, PAGE_SIZE, + &mem_addr, GFP_KERNEL); /* BUG: no check for failure */ /* Initialize the BD for every fragment in the page. @@ -889,7 +891,7 @@ static int __init scc_enet_init(void) /* Set processing mode. Use Ethernet CRC, catch broadcast, and * start frame search 22 bit times after RENA. */ - sccp->scc_pmsr = (SCC_PMSR_ENCRC | SCC_PMSR_NIB22); + sccp->scc_psmr = (SCC_PSMR_ENCRC | SCC_PSMR_NIB22); /* It is now OK to enable the Ethernet transmitter. * Unfortunately, there are board implementation differences here. diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 5c7c914f8..88eb1aa10 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef CONFIG_FEC_PACKETHOOK #include #endif @@ -52,7 +53,6 @@ #include #include #include -#include #include #include @@ -389,6 +389,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) flush_dcache_range((unsigned long)skb->data, (unsigned long)skb->data + skb->len); + /* disable interrupts while triggering transmit */ spin_lock_irq(&fep->lock); /* Send it on its way. Tell FEC its ready, interrupt when done, @@ -539,6 +540,7 @@ fec_enet_tx(struct net_device *dev) struct sk_buff *skb; fep = dev->priv; + /* lock while transmitting */ spin_lock(&fep->lock); bdp = fep->dirty_tx; @@ -799,6 +801,7 @@ fec_enet_mii(struct net_device *dev) if ((mip = mii_head) != NULL) { ep->fec_mii_data = mip->mii_regval; + } } @@ -817,8 +820,8 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi retval = 0; - save_flags(flags); - cli(); + /* lock while modifying mii_list */ + spin_lock_irqsave(&fep->lock, flags); if ((mip = mii_free) != NULL) { mii_free = mip->mii_next; @@ -836,7 +839,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi retval = 1; } - restore_flags(flags); + spin_unlock_irqrestore(&fep->lock, flags); return(retval); } @@ -1684,7 +1687,7 @@ static int __init fec_enet_init(void) /* Install our interrupt handler. */ - if (request_8xxirq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0) + if (request_irq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0) panic("Could not allocate FEC IRQ!"); #ifdef CONFIG_RPXCLASSIC @@ -1705,7 +1708,7 @@ static int __init fec_enet_init(void) ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel |= (0x80000000 >> PHY_INTERRUPT); - if (request_8xxirq(PHY_INTERRUPT, mii_link_interrupt, 0, "mii", dev) != 0) + if (request_irq(PHY_INTERRUPT, mii_link_interrupt, 0, "mii", dev) != 0) panic("Could not allocate MII IRQ!"); #endif diff --git a/arch/ppc/8xx_io/micropatch.c b/arch/ppc/8xx_io/micropatch.c index 68a51ee22..312af0776 100644 --- a/arch/ppc/8xx_io/micropatch.c +++ b/arch/ppc/8xx_io/micropatch.c @@ -19,18 +19,12 @@ #include #include -/* Define this to get SMC patches as well. You need to modify the uart - * driver as well...... -#define USE_SMC_PATCH 1 +/* + * I2C/SPI relocation patch arrays. */ -#ifdef CONFIG_USB_MPC8xx -#define USE_USB_SOF_PATCH -#endif +#ifdef CONFIG_I2C_SPI_UCODE_PATCH -#ifdef USE_IIC_PATCH -#define PATCH_DEFINED - /* IIC/SPI */ uint patch_2000[] = { 0x7FFFEFD9, 0x3FFD0000, @@ -183,11 +177,12 @@ uint patch_2f00[] = { }; #endif -#ifdef USE_SMC_PATCH -#define PATCH_DEFINED -/* SMC2/IIC/SPI Patch */ -/* This is the area from 0x2000 to 0x23ff. -*/ +/* + * I2C/SPI/SMC1 relocation patch arrays. + */ + +#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH + uint patch_2000[] = { 0x3fff0000, 0x3ffd0000, @@ -511,8 +506,6 @@ uint patch_2000[] = { 0x6079e2bb }; - /* This is from 0x2f00 to 0x2fff - */ uint patch_2f00[] = { 0x30303030, 0x3e3e3434, @@ -581,8 +574,6 @@ uint patch_2f00[] = { }; uint patch_2e00[] = { - /* This is from 0x2e00 to 0x2e3c - */ 0x27eeeeee, 0xeeeeeeee, 0xeeeeeeee, @@ -602,8 +593,12 @@ uint patch_2e00[] = { }; #endif -#ifdef USE_USB_SOF_PATCH -#define PATCH_DEFINED +/* + * USB SOF patch arrays. + */ + +#ifdef CONFIG_USB_SOF_UCODE_PATCH + uint patch_2000[] = { 0x7fff0000, 0x7ffd0000, @@ -626,33 +621,21 @@ uint patch_2f00[] = { }; #endif -/* Load the microcode patch. This is called early in the CPM initialization - * with the controller in the reset state. We enable the processor after - * we load the patch. - */ void cpm_load_patch(volatile immap_t *immr) { -#ifdef PATCH_DEFINED - volatile uint *dp; + volatile uint *dp; /* Dual-ported RAM. */ volatile cpm8xx_t *commproc; volatile iic_t *iip; volatile spi_t *spp; + volatile smc_uart_t *smp; int i; commproc = (cpm8xx_t *)&immr->im_cpm; - /* We work closely with commproc.c. We know it only allocates - * from data only space. - * For this particular patch, we only use the bottom 512 bytes - * and the upper 256 byte extension. We will use the space - * starting at 1K for the relocated parameters, as the general - * CPM allocation won't come from that area. - */ +#ifdef CONFIG_USB_SOF_UCODE_PATCH commproc->cp_rccr = 0; - /* Copy the patch into DPRAM. - */ dp = (uint *)(commproc->cp_dpmem); for (i=0; i<(sizeof(patch_2000)/4); i++) *dp++ = patch_2000[i]; @@ -661,29 +644,26 @@ cpm_load_patch(volatile immap_t *immr) for (i=0; i<(sizeof(patch_2f00)/4); i++) *dp++ = patch_2f00[i]; -#ifdef USE_USB_SOF_PATCH -#if 0 /* usb patch should not relocate iic */ - iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC]; -#define RPBASE 0x0030 - iip->iic_rpbase = RPBASE; + commproc->cp_rccr = 0x0009; - /* Put SPI above the IIC, also 32-byte aligned. - */ - i = (RPBASE + sizeof(iic_t) + 31) & ~31; - spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI]; - spp->spi_rpbase = i; -#endif + printk("USB SOF microcode patch installed\n"); +#endif /* CONFIG_USB_SOF_UCODE_PATCH */ - /* Enable uCode fetches from DPRAM. */ - commproc->cp_rccr = 0x0009; +#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \ + defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) + + commproc->cp_rccr = 0; - printk("USB uCode patch installed\n"); -#endif /* USE_USB_SOF_PATCH */ + dp = (uint *)(commproc->cp_dpmem); + for (i=0; i<(sizeof(patch_2000)/4); i++) + *dp++ = patch_2000[i]; -#if defined(USE_SMC_PATCH) || defined(USE_IIC_PATCH) + dp = (uint *)&(commproc->cp_dpmem[0x0f00]); + for (i=0; i<(sizeof(patch_2f00)/4); i++) + *dp++ = patch_2f00[i]; iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC]; -#define RPBASE 0x0400 +# define RPBASE 0x0500 iip->iic_rpbase = RPBASE; /* Put SPI above the IIC, also 32-byte aligned. @@ -692,58 +672,46 @@ cpm_load_patch(volatile immap_t *immr) spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI]; spp->spi_rpbase = i; -#ifdef USE_SMC_PATCH +# if defined(CONFIG_I2C_SPI_UCODE_PATCH) + commproc->cp_cpmcr1 = 0x802a; + commproc->cp_cpmcr2 = 0x8028; + commproc->cp_cpmcr3 = 0x802e; + commproc->cp_cpmcr4 = 0x802c; + commproc->cp_rccr = 1; + + printk("I2C/SPI microcode patch installed.\n"); +# endif /* CONFIG_I2C_SPI_UCODE_PATCH */ + +# if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) + dp = (uint *)&(commproc->cp_dpmem[0x0e00]); for (i=0; i<(sizeof(patch_2e00)/4); i++) *dp++ = patch_2e00[i]; - /* Enable the traps to get to it. - */ commproc->cp_cpmcr1 = 0x8080; commproc->cp_cpmcr2 = 0x808a; commproc->cp_cpmcr3 = 0x8028; commproc->cp_cpmcr4 = 0x802a; - - /* Enable uCode fetches from DPRAM. - */ commproc->cp_rccr = 3; -#endif - -#ifdef USE_IIC_PATCH - /* Enable the traps to get to it. - */ - commproc->cp_cpmcr1 = 0x802a; - commproc->cp_cpmcr2 = 0x8028; - commproc->cp_cpmcr3 = 0x802e; - commproc->cp_cpmcr4 = 0x802c; - /* Enable uCode fetches from DPRAM. - */ - commproc->cp_rccr = 1; - - printk("I2C uCode patch installed\n"); -#endif + smp = (smc_uart_t *)&commproc->cp_dparam[PROFF_SMC1]; + smp->smc_rpbase = 0x1FC0; - /* Relocate the IIC and SPI parameter areas. These have to - * aligned on 32-byte boundaries. - */ - iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC]; - iip->iic_rpbase = RPBASE; - - /* Put SPI above the IIC, also 32-byte aligned. - */ - i = (RPBASE + sizeof(iic_t) + 31) & ~31; - spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI]; - spp->spi_rpbase = i; + printk("I2C/SPI/SMC1 microcode patch installed.\n"); +# endif /* CONFIG_I2C_SPI_SMC1_UCODE_PATCH) */ -#endif /* USE_SMC_PATCH || USE_IIC_PATCH */ -#endif /* PATCH_DEFINED */ +#endif /* some variation of the I2C/SPI patch was selected */ } +/* + * Take this entire routine out, since no one calls it and its + * logic is suspect. + */ + +#if 0 void verify_patch(volatile immap_t *immr) { -#ifdef PATCH_DEFINED volatile uint *dp; volatile cpm8xx_t *commproc; int i; @@ -772,6 +740,5 @@ verify_patch(volatile immap_t *immr) } commproc->cp_rccr = 0x0009; -#endif /* PATCH_DEFINED */ } - +#endif diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 37104324d..5e916b393 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig @@ -11,6 +11,10 @@ config MMU config UID16 bool +config GENERIC_HARDIRQS + bool + default y + config RWSEM_GENERIC_SPINLOCK bool @@ -18,6 +22,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config HAVE_DEC_LOCK bool default y @@ -70,6 +78,7 @@ config POWER4 bool "POWER4 and 970 (G5)" config 8xx + depends on BROKEN bool "8xx" config E500 @@ -92,6 +101,11 @@ config PTE_64BIT depends on 44x default y +config PHYS_64BIT + bool + depends on 44x + default y + config ALTIVEC bool "AltiVec Support" depends on 6xx || POWER4 @@ -184,18 +198,6 @@ config MATH_EMULATION here. Saying Y here will not hurt performance (on any machine) but will increase the size of the kernel. -config CPU_FREQ - bool "CPU Frequency scaling" - help - Clock scaling allows you to change the clock speed of CPUs on the - fly. This is a nice method to save battery power on notebooks, - because the lower the clock speed, the less power the CPU consumes. - - For more information, take a look at or - at - - If in doubt, say N. - source "drivers/cpufreq/Kconfig" config CPU_FREQ_PMAC @@ -324,7 +326,7 @@ config RPXLITE HERMES: Hermes-Pro ISDN/LAN router with integrated 8 x hub - Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik + Manufacturer: Multidata Gesellschaft fur Datentechnik und Informatik Date of Release: 2000 (?) End of life: - @@ -507,21 +509,41 @@ config APUS More information is available at: . +config KATANA + bool "Artesyn-Katana" + help + Select KATANA if configuring an Artesyn KATANA 750i or 3750 + cPCI board. + config WILLOW bool "Cogent-Willow" +config CPCI690 + bool "Force-CPCI690" + help + Select CPCI690 if configuring a Force CPCI690 cPCI board. + config PCORE bool "Force-PowerCore" config POWERPMC250 bool "Force-PowerPMC250" -config EV64260 - bool "Galileo-EV-64260-BP" +config CHESTNUT + bool "IBM 750FX Eval board or 750GX Eval board" + help + Select CHESTNUT if configuring an IBM 750FX Eval Board or a + IBM 750GX Eval board. config SPRUCE bool "IBM-Spruce" +config EV64260 + bool "Marvell-EV64260BP" + help + Select EV64260 if configuring a Marvell (formerly Galileo) + EV64260BP Evaluation platform. + config LOPEC bool "Motorola-LoPEC" @@ -601,6 +623,12 @@ config TQM8260 config ADS8272 bool "ADS8272" +config PQ2FADS + bool "Freescale-PQ2FADS" + help + Select PQ2FADS if you wish to configure for a Freescale + PQ2FADS board (-VR or -ZU). + config LITE5200 bool "Freescale LITE5200 / (IceCube)" select PPC_MPC52xx @@ -633,7 +661,7 @@ config PPC_MPC52xx config 8260 bool "CPM2 Support" if WILLOW depends on 6xx - default y if TQM8260 || RPX8260 || EST8260 || SBS8260 || SBC82xx + default y if TQM8260 || RPX8260 || EST8260 || SBS8260 || SBC82xx || PQ2FADS help The MPC8260 is a typical embedded CPU made by Motorola. Selecting this option means that you wish to build a kernel for a machine with @@ -650,7 +678,7 @@ config 8272 config CPM2 bool - depends on 8260 || MPC8560 + depends on 8260 || MPC8560 || MPC8555 default y help The CPM2 (Communications Processor Module) is a coprocessor on @@ -686,7 +714,8 @@ config PPC_OF config PPC_GEN550 bool depends on SANDPOINT || MCPN765 || SPRUCE || PPLUS || PCORE || \ - PRPMC750 || K2 || PRPMC800 || LOPEC + PRPMC750 || K2 || PRPMC800 || LOPEC || \ + (EV64260 && !SERIAL_MPSC) || CHESTNUT default y config FORCE @@ -696,9 +725,53 @@ config FORCE config GT64260 bool - depends on EV64260 + depends on EV64260 || CPCI690 + default y + +config MV64360 + bool + depends on KATANA + default y + +config MV64360 + bool + depends on CHESTNUT + default y + +config MV64X60 + bool + depends on (GT64260 || MV64360) default y +menu "Set bridge options" + depends on MV64X60 + +config NOT_COHERENT_CACHE + bool "Turn off Cache Coherency" + default n + help + Some 64x60 bridges lock up when trying to enforce cache coherency. + When this option is selected, cache coherency will be turned off. + Note that this can cause other problems (e.g., stale data being + speculatively loaded via a cached mapping). Use at your own risk. + +config MV64X60_BASE + hex "Set bridge base used by firmware" + default "0xf1000000" + help + A firmware can leave the base address of the bridge's registers at + a non-standard location. If so, set this value to reflect the + address of that non-standard location. + +config MV64X60_NEW_BASE + hex "Set bridge base used by kernel" + default "0xf1000000" + help + If the current base address of the bridge's registers is not where + you want it, set this value to the address that you want it moved to. + +endmenu + config NONMONARCH_SUPPORT bool "Enable Non-Monarch Support" depends on PRPMC800 @@ -752,16 +825,6 @@ config PC_KEYBOARD bool "PC PS/2 style Keyboard" depends on 4xx || CPM2 -config SERIAL_CONSOLE - bool - depends on 8xx - default y - -config SERIAL_CONSOLE_BAUD - int - depends on EV64260 - default "115200" - config PPCBUG_NVRAM bool "Enable reading PPCBUG NVRAM during boot" if PPLUS || LOPEC default y if PPC_PREP diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug index 0df281455..d2e1eea8e 100644 --- a/arch/ppc/Kconfig.debug +++ b/arch/ppc/Kconfig.debug @@ -53,18 +53,6 @@ config BDI_SWITCH Unless you are intending to debug the kernel with one of these machines, say N here. -config SCHEDSTATS - bool "Collect scheduler statistics" - depends on DEBUG_KERNEL && PROC_FS - help - If you say Y here, additional code will be inserted into the - scheduler and related routines to collect statistics about - scheduler behavior and provide them in /proc/schedstat. These - stats may be useful for both tuning and debugging the scheduler - If you aren't debugging the scheduler or trying to tune a specific - application, you can say N to avoid the very slight overhead - this adds. - config BOOTX_TEXT bool "Support for early boot text console (BootX or OpenFirmware only)" depends PPC_OF @@ -78,7 +66,7 @@ config SERIAL_TEXT_DEBUG config PPC_OCP bool - depends on IBM_OCP || FSL_OCP + depends on IBM_OCP || FSL_OCP || XILINX_OCP default y endmenu diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 53dd5640d..e8b93926d 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -42,6 +42,9 @@ cpu-as-$(CONFIG_E500) += -Wa,-me500 AFLAGS += $(cpu-as-y) CFLAGS += $(cpu-as-y) +# Default to the common case. +KBUILD_DEFCONFIG := common_defconfig + head-y := arch/ppc/kernel/head.o head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o @@ -68,7 +71,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm .PHONY: $(BOOT_TARGETS) -all: zImage +all: uImage zImage CPPFLAGS_vmlinux.lds := -Upowerpc diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c index 7acd03b31..e79e6b3f2 100644 --- a/arch/ppc/boot/common/misc-common.c +++ b/arch/ppc/boot/common/misc-common.c @@ -52,7 +52,6 @@ extern char _end[]; void puts(const char *); void putc(const char c); void puthex(unsigned long val); -void _bcopy(char *src, char *dst, int len); void gunzip(void *, int, unsigned char *, int *); static int _cvt(unsigned long val, char *buf, long radix, char *digits); @@ -60,7 +59,8 @@ void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap); unsigned char *ISA_io = NULL; #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE) extern unsigned long com_port; extern int serial_tstc(unsigned long com_port); @@ -82,7 +82,8 @@ void exit(void) int tstc(void) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE) if(keyb_present) return (CRT_tstc() || serial_tstc(com_port)); else @@ -96,7 +97,8 @@ int getc(void) { while (1) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE) if (serial_tstc(com_port)) return (serial_getc(com_port)); #endif /* serial console */ @@ -112,7 +114,8 @@ putc(const char c) int x,y; #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); @@ -160,7 +163,8 @@ void puts(const char *s) while ( ( c = *s++ ) != '\0' ) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* serial console */ diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S index 7c4fb8f57..d0161ac4c 100644 --- a/arch/ppc/boot/common/util.S +++ b/arch/ppc/boot/common/util.S @@ -27,6 +27,7 @@ .text +#ifdef CONFIG_6xx .globl disable_6xx_mmu disable_6xx_mmu: /* Establish default MSR value, exception prefix 0xFFF. @@ -94,6 +95,7 @@ disable_6xx_l1cache: sync isync blr +#endif .globl _setup_L2CR _setup_L2CR: diff --git a/arch/ppc/boot/lib/Makefile b/arch/ppc/boot/lib/Makefile index 9d088a566..d4077e690 100644 --- a/arch/ppc/boot/lib/Makefile +++ b/arch/ppc/boot/lib/Makefile @@ -2,9 +2,22 @@ # Makefile for some libs needed by zImage. # -CFLAGS_kbd.o += -Idrivers/char +CFLAGS_kbd.o := -Idrivers/char +CFLAGS_vreset.o := -I$(srctree)/arch/ppc/boot/include -lib-y := $(addprefix ../../../../lib/zlib_inflate/, \ - infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o) -lib-y += div64.o +zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c + +lib-y += $(zlib:.c=.o) div64.o lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o + + +# zlib files needs header from their original place +EXTRA_CFLAGS += -Ilib/zlib_inflate + +quiet_cmd_copy_zlib = COPY $@ + cmd_copy_zlib = cat $< > $@ + +$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/% + $(call cmd,copy_zlib) + +clean-files := $(zlib) diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index 895b55750..a0437d10b 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile @@ -41,12 +41,18 @@ end-y := elf # if present on 'classic' PPC. cacheflag-y := -DCLEAR_CACHES="" # This file will flush / disable the L2, and L3 if present. -clear_L2_L3 := $(boot)/simple/clear.S +clear_L2_L3 := $(srctree)/$(boot)/simple/clear.S # # See arch/ppc/kconfig and arch/ppc/platforms/Kconfig # for definition of what platform each config option refer to. #---------------------------------------------------------------------------- + zimage-$(CONFIG_CPCI690) := zImage-STRIPELF +zimageinitrd-$(CONFIG_CPCI690) := zImage.initrd-STRIPELF + extra.o-$(CONFIG_CPCI690) := misc-cpci690.o mv64x60_stub.o + end-$(CONFIG_CPCI690) := cpci690 + cacheflag-$(CONFIG_CPCI690) := -include $(clear_L2_L3) + zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE end-$(CONFIG_IBM_OPENBIOS) := treeboot @@ -60,16 +66,25 @@ zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE end-$(CONFIG_EBONY) := ebony entrypoint-$(CONFIG_EBONY) := 0x01000000 + zimage-$(CONFIG_LUAN) := zImage-TREE +zimageinitrd-$(CONFIG_LUAN) := zImage.initrd-TREE + end-$(CONFIG_LUAN) := luan + entrypoint-$(CONFIG_LUAN) := 0x01000000 + extra.o-$(CONFIG_LUAN) := pibs.o + zimage-$(CONFIG_OCOTEA) := zImage-TREE zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE end-$(CONFIG_OCOTEA) := ocotea entrypoint-$(CONFIG_OCOTEA) := 0x01000000 extra.o-$(CONFIG_OCOTEA) := pibs.o - extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o + extra.o-$(CONFIG_EV64260) := misc-ev64260.o end-$(CONFIG_EV64260) := ev64260 cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3) + extra.o-$(CONFIG_CHESTNUT) := misc-chestnut.o + end-$(CONFIG_CHESTNUT) := chestnut + zimage-$(CONFIG_GEMINI) := zImage-STRIPELF zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF end-$(CONFIG_GEMINI) := gemini @@ -78,6 +93,10 @@ zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF end-$(CONFIG_K2) := k2 cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3) + extra.o-$(CONFIG_KATANA) := misc-katana.o mv64x60_stub.o + end-$(CONFIG_KATANA) := katana + cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) + # kconfig 'feature', only one of these will ever be 'y' at a time. # The rest will be unset. motorola := $(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750) \ @@ -143,6 +162,7 @@ boot-$(CONFIG_8xx) += embed_config.o boot-$(CONFIG_8260) += embed_config.o boot-$(CONFIG_BSEIP) += iic.o boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o +boot-$(CONFIG_MV64X60) += misc-mv64x60.o boot-$(CONFIG_RPXCLASSIC) += iic.o pci.o qspan_pci.o boot-$(CONFIG_RPXLITE) += iic.o # Different boards need different serial implementations. @@ -150,8 +170,8 @@ ifeq ($(CONFIG_SERIAL_CPM_CONSOLE),y) boot-$(CONFIG_8xx) += m8xx_tty.o boot-$(CONFIG_8260) += m8260_tty.o endif -boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o -boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o +boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o +boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o LIBS := $(common)/lib.a $(bootlib)/lib.a ifeq ($(CONFIG_PPC_PREP),y) diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c index be0b6ca24..a4fbc3900 100644 --- a/arch/ppc/boot/simple/embed_config.c +++ b/arch/ppc/boot/simple/embed_config.c @@ -749,25 +749,25 @@ embed_config(bd_t ** bdp) static const unsigned long line_size = 32; static const unsigned long congruence_classes = 256; unsigned long addr; - u_char *cp; - int i; + unsigned long dccr; bd_t *bd; /* - * At one point, we were getting machine checks. Linux was not - * invalidating the data cache before it was enabled. The - * following code was added to do that. Soon after we had done - * that, we found the real reasons for the machine checks. I've - * run the kernel a few times with the following code - * temporarily removed without any apparent problems. However, - * I objdump'ed the kernel and boot code and found out that - * there were no other dccci's anywhere, so I put the code back - * in and have been reluctant to remove it. It seems safer to - * just leave it here. + * Invalidate the data cache if the data cache is turned off. + * - The 405 core does not invalidate the data cache on power-up + * or reset but does turn off the data cache. We cannot assume + * that the cache contents are valid. + * - If the data cache is turned on this must have been done by + * a bootloader and we assume that the cache contents are + * valid. */ - for (addr = 0; - addr < (congruence_classes * line_size); addr += line_size) { - __asm__("dccci 0,%0": :"b"(addr)); + __asm__("mfdccr %0": "=r" (dccr)); + if (dccr == 0) { + for (addr = 0; + addr < (congruence_classes * line_size); + addr += line_size) { + __asm__("dccci 0,%0": :"b"(addr)); + } } bd = &bdinfo; @@ -775,6 +775,9 @@ embed_config(bd_t ** bdp) bd->bi_memsize = XPAR_DDR_0_SIZE; bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ; bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ; + bd->bi_pci_busfreq = XPAR_PCI_0_CLOCK_FREQ_HZ; + timebase_period_ns = 1000000000 / bd->bi_tbfreq; + /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */ } #endif /* CONFIG_XILINX_ML300 */ diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S index fb58d4e4a..ba4c7b268 100644 --- a/arch/ppc/boot/simple/head.S +++ b/arch/ppc/boot/simple/head.S @@ -135,9 +135,9 @@ haveOF: */ #endif -#ifdef CONFIG_EV64260 - /* Move 64260's base regs & CS window for external UART */ - bl ev64260_init +#ifdef CONFIG_MV64X60 + /* mv64x60 specific hook to do things like moving register base, etc. */ + bl mv64x60_init #endif /* Get the load address. diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c index 8615d5f22..3865f3f8d 100644 --- a/arch/ppc/boot/simple/misc-embedded.c +++ b/arch/ppc/boot/simple/misc-embedded.c @@ -218,7 +218,7 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *b puts("done.\n"); { struct bi_record *rec; - unsigned long initrd_loc; + unsigned long initrd_loc = 0; unsigned long rec_loc = _ALIGN((unsigned long)(zimage_size) + (1 << 20) - 1, (1 << 20)); rec = (struct bi_record *)rec_loc; diff --git a/arch/ppc/boot/simple/misc-ev64260.S b/arch/ppc/boot/simple/misc-ev64260.S index 7ce68158d..2dc3e6c50 100644 --- a/arch/ppc/boot/simple/misc-ev64260.S +++ b/arch/ppc/boot/simple/misc-ev64260.S @@ -6,55 +6,63 @@ * * Author: Mark Greer * - * 2001 (c) MontaVista, Software, Inc. This file is licensed under - * the terms of the GNU General Public License version 2. This program + * 2001 (c) MontaVista Software, Inc. 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 +#include #include -#include - +#include #include - .globl ev64260_init -ev64260_init: - li r20,0 + .globl mv64x60_board_init +mv64x60_board_init: + /* DINK doesn't enable 745x timebase, so enable here (Adrian Cox) */ + mfspr r25,PVR + srwi r25,r25,16 + cmplwi r25,(PVR_7450 >> 16) + bne 1f + mfspr r25,HID0 + oris r25,r25,(HID0_TBEN >> 16) + mtspr HID0,r25 +1: +#if (CONFIG_MV64X60_NEW_BASE != CONFIG_MV64X60_BASE) li r23,20 - /* Relocate galileo's regs */ - addis r25,0,GT64260_INTERNAL_SPACE_DEFAULT_ADDR@h - ori r25,r25,GT64260_INTERNAL_SPACE_DECODE - lwbrx r26,0,(r25) - lis r24,0xffff - and r26,r26,r24 - addis r24,0,EV64260_BRIDGE_REG_BASE@h - srw r24,r24,r23 - or r26,r26,r24 - stwbrx r26,0,(r25) - sync - - /* Wait for write to take effect */ - addis r25,0,EV64260_BRIDGE_REG_BASE@h - ori r25,r25,GT64260_INTERNAL_SPACE_DECODE -1: lwbrx r24,0,(r25) - cmpw r24,r26 - bne 1b - - /* Change CS2 (UARTS on device module) window */ - addis r25,0,EV64260_BRIDGE_REG_BASE@h - ori r25,r25,GT64260_CPU_CS_DECODE_2_BOT + /* + * Change the CS2 window for the UART so that the bootloader + * can do I/O thru the UARTs. + */ + addis r25,0,CONFIG_MV64X60_NEW_BASE@h + ori r25,r25,MV64x60_CPU2DEV_2_BASE addis r26,0,EV64260_UART_BASE@h srw r26,r26,r23 - stwbrx r26,0,(r25) + stwbrx r26,0,(r25) sync - addis r25,0,EV64260_BRIDGE_REG_BASE@h - ori r25,r25,GT64260_CPU_CS_DECODE_2_TOP + addis r25,0,CONFIG_MV64X60_NEW_BASE@h + ori r25,r25,MV64x60_CPU2DEV_2_SIZE addis r26,0,EV64260_UART_END@h srw r26,r26,r23 - stwbrx r26,0,(r25) + stwbrx r26,0,(r25) sync +#endif + blr + +#if defined(CONFIG_SERIAL_MPSC_CONSOLE) +.data + .globl mv64x60_console_baud +mv64x60_console_baud: +.long EV64260_DEFAULT_BAUD + + .globl mv64x60_mpsc_clk_src +mv64x60_mpsc_clk_src: +.long EV64260_MPSC_CLK_SRC - blr + .globl mv64x60_mpsc_clk_freq +mv64x60_mpsc_clk_freq: +.long EV64260_MPSC_CLK_FREQ +#endif diff --git a/arch/ppc/boot/simple/misc-mv64x60.S b/arch/ppc/boot/simple/misc-mv64x60.S index 9c809c84f..0978e42e7 100644 --- a/arch/ppc/boot/simple/misc-mv64x60.S +++ b/arch/ppc/boot/simple/misc-mv64x60.S @@ -1,6 +1,6 @@ /* * arch/ppc/boot/simple/misc-mv64x60.S - * + * * Code to change the base address of the host bridges and call board specific * init routine. * @@ -35,19 +35,19 @@ move_base: li r23,20 /* Relocate bridge's regs */ - addis r25,0,CONFIG_MV64X60_BASE@h - ori r25,r25,MV64x60_INTERNAL_SPACE_DECODE - lwbrx r26,0,(r25) + addis r25,0,CONFIG_MV64X60_BASE@h + ori r25,r25,MV64x60_INTERNAL_SPACE_DECODE + lwbrx r26,0,(r25) lis r24,0xffff and r26,r26,r24 addis r24,0,CONFIG_MV64X60_NEW_BASE@h srw r24,r24,r23 or r26,r26,r24 - stwbrx r26,0,(r25) + stwbrx r26,0,(r25) sync /* Wait for write to take effect */ - addis r25,0,CONFIG_MV64X60_NEW_BASE@h + addis r25,0,CONFIG_MV64X60_NEW_BASE@h ori r25,r25,MV64x60_INTERNAL_SPACE_DECODE 1: lwbrx r24,0,(r25) cmpw r24,r26 diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c index 1b2ae8d77..ab0f9902c 100644 --- a/arch/ppc/boot/simple/misc.c +++ b/arch/ppc/boot/simple/misc.c @@ -50,7 +50,8 @@ */ #if (defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_VGA_CONSOLE) \ - || defined(CONFIG_SERIAL_MPC52xx_CONSOLE)) \ + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ + || defined(CONFIG_SERIAL_MPSC_CONSOLE)) \ && !defined(CONFIG_GEMINI) #define INTERACTIVE_CONSOLE 1 #endif @@ -98,11 +99,11 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) struct bi_record *rec; unsigned long initrd_loc = 0, TotalMemory = 0; -#ifdef CONFIG_SERIAL_8250_CONSOLE +#if defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_SERIAL_MPSC_CONSOLE) com_port = serial_init(0, NULL); #endif -#ifdef CONFIG_44x +#if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0) /* Reset MAL */ mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* Wait for reset */ diff --git a/arch/ppc/boot/simple/mpc52xx_tty.c b/arch/ppc/boot/simple/mpc52xx_tty.c index 8a1c663e7..efde532b4 100644 --- a/arch/ppc/boot/simple/mpc52xx_tty.c +++ b/arch/ppc/boot/simple/mpc52xx_tty.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #if MPC52xx_PF_CONSOLE_PORT == 0 diff --git a/arch/ppc/boot/simple/mv64x60_stub.c b/arch/ppc/boot/simple/mv64x60_stub.c index 46d99245e..43ae96bb1 100644 --- a/arch/ppc/boot/simple/mv64x60_stub.c +++ b/arch/ppc/boot/simple/mv64x60_stub.c @@ -10,11 +10,15 @@ * "as is" without any warranty of any kind, whether express or implied. */ -long mv64x60_console_baud = 9600; /* Default baud: 9600 */ -long mv64x60_mpsc_clk_src = 8; /* Default clk src: TCLK */ -long mv64x60_mpsc_clk_freq = 100000000; /* Default clk freq: 100 MHz */ +#include -void +#if defined(CONFIG_SERIAL_MPSC_CONSOLE) +long __attribute__ ((weak)) mv64x60_console_baud = 9600; +long __attribute__ ((weak)) mv64x60_mpsc_clk_src = 8; /* TCLK */ +long __attribute__ ((weak)) mv64x60_mpsc_clk_freq = 100000000; +#endif + +void __attribute__ ((weak)) mv64x60_board_init(void) { } diff --git a/arch/ppc/boot/simple/mv64x60_tty.c b/arch/ppc/boot/simple/mv64x60_tty.c index b1cb21a16..de260eafd 100644 --- a/arch/ppc/boot/simple/mv64x60_tty.c +++ b/arch/ppc/boot/simple/mv64x60_tty.c @@ -1,17 +1,15 @@ /* * arch/ppc/boot/simple/mv64x60_tty.c - * + * * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60. * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA). * * Author: Mark A. Greer * - * Copyright 2001 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. + * 2001 (c) MontaVista Software, Inc. 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. */ /* This code assumes that the data cache has been disabled (L1, L2, L3). */ @@ -21,7 +19,7 @@ #include #include #include -#include "../../../../drivers/serial/mpsc/mpsc_defs.h" +#include extern void udelay(long); static void stop_dma(int chan); @@ -34,7 +32,7 @@ mv64x60_in_le32(volatile unsigned *addr) unsigned ret; __asm__ __volatile__("lwbrx %0,0,%1; eieio" : "=r" (ret) : - "r" (addr), "m" (*addr)); + "r" (addr), "m" (*addr)); return ret; } @@ -42,16 +40,16 @@ inline void mv64x60_out_le32(volatile unsigned *addr, int val) { __asm__ __volatile__("stwbrx %1,0,%2; eieio" : "=m" (*addr) : - "r" (val), "r" (addr)); + "r" (val), "r" (addr)); } #define MV64x60_REG_READ(offs) \ (mv64x60_in_le32((volatile uint *)(mv64x60_base + (offs)))) #define MV64x60_REG_WRITE(offs, d) \ - (mv64x60_out_le32((volatile uint *)(mv64x60_base + (offs)), (int)(d))) + (mv64x60_out_le32((volatile uint *)(mv64x60_base + (offs)), (int)(d))) -typedef struct { +struct sdma_regs { u32 sdc; u32 sdcm; u32 rx_desc; @@ -60,36 +58,38 @@ typedef struct { u32 tx_desc; u32 sctdp; u32 sftdp; -} sdma_regs_t; +}; -static sdma_regs_t sdma_regs[2]; +static struct sdma_regs sdma_regs[2]; #define SDMA_REGS_INIT(s, reg_base) { \ - (s)->sdc = (reg_base) + SDMA_SDC; \ - (s)->sdcm = (reg_base) + SDMA_SDCM; \ - (s)->rx_desc = (reg_base) + SDMA_RX_DESC; \ + (s)->sdc = (reg_base) + SDMA_SDC; \ + (s)->sdcm = (reg_base) + SDMA_SDCM; \ + (s)->rx_desc = (reg_base) + SDMA_RX_DESC; \ (s)->rx_buf_ptr = (reg_base) + SDMA_RX_BUF_PTR; \ - (s)->scrdp = (reg_base) + SDMA_SCRDP; \ - (s)->tx_desc = (reg_base) + SDMA_TX_DESC; \ - (s)->sctdp = (reg_base) + SDMA_SCTDP; \ - (s)->sftdp = (reg_base) + SDMA_SFTDP; \ + (s)->scrdp = (reg_base) + SDMA_SCRDP; \ + (s)->tx_desc = (reg_base) + SDMA_TX_DESC; \ + (s)->sctdp = (reg_base) + SDMA_SCTDP; \ + (s)->sftdp = (reg_base) + SDMA_SFTDP; \ } -typedef struct { - volatile u16 bufsize; - volatile u16 bytecnt; - volatile u32 cmd_stat; - volatile u32 next_desc_ptr; - volatile u32 buffer; -} mv64x60_rx_desc_t; - -typedef struct { - volatile u16 bytecnt; - volatile u16 shadow; - volatile u32 cmd_stat; - volatile u32 next_desc_ptr; - volatile u32 buffer; -} mv64x60_tx_desc_t; +static u32 mpsc_base[2] = { MV64x60_MPSC_0_OFFSET, MV64x60_MPSC_1_OFFSET }; + +struct mv64x60_rx_desc { + u16 bufsize; + u16 bytecnt; + u32 cmd_stat; + u32 next_desc_ptr; + u32 buffer; +}; + +struct mv64x60_tx_desc { + u16 bytecnt; + u16 shadow; + u32 cmd_stat; + u32 next_desc_ptr; + u32 buffer; +}; #define MAX_RESET_WAIT 10000 #define MAX_TX_WAIT 10000 @@ -97,11 +97,11 @@ typedef struct { #define RX_NUM_DESC 2 #define TX_NUM_DESC 2 -#define RX_BUF_SIZE 16 -#define TX_BUF_SIZE 16 +#define RX_BUF_SIZE 32 +#define TX_BUF_SIZE 32 -static mv64x60_rx_desc_t rd[2][RX_NUM_DESC] __attribute__ ((aligned(32))); -static mv64x60_tx_desc_t td[2][TX_NUM_DESC] __attribute__ ((aligned(32))); +static struct mv64x60_rx_desc rd[2][RX_NUM_DESC] __attribute__ ((aligned(32))); +static struct mv64x60_tx_desc td[2][TX_NUM_DESC] __attribute__ ((aligned(32))); static char rx_buf[2][RX_NUM_DESC * RX_BUF_SIZE] __attribute__ ((aligned(32))); static char tx_buf[2][TX_NUM_DESC * TX_BUF_SIZE] __attribute__ ((aligned(32))); @@ -115,34 +115,50 @@ static char chan_initialized[2] = { 0, 0 }; #define RX_INIT_RDP(rdp) { \ (rdp)->bufsize = 2; \ (rdp)->bytecnt = 0; \ - (rdp)->cmd_stat = SDMA_DESC_CMDSTAT_L | \ - SDMA_DESC_CMDSTAT_F | \ - SDMA_DESC_CMDSTAT_O; \ + (rdp)->cmd_stat = SDMA_DESC_CMDSTAT_L | SDMA_DESC_CMDSTAT_F | \ + SDMA_DESC_CMDSTAT_O; \ } +#ifdef CONFIG_MV64360 +static u32 cpu2mem_tab[MV64x60_CPU2MEM_WINDOWS][2] = { + { MV64x60_CPU2MEM_0_BASE, MV64x60_CPU2MEM_0_SIZE }, + { MV64x60_CPU2MEM_1_BASE, MV64x60_CPU2MEM_1_SIZE }, + { MV64x60_CPU2MEM_2_BASE, MV64x60_CPU2MEM_2_SIZE }, + { MV64x60_CPU2MEM_3_BASE, MV64x60_CPU2MEM_3_SIZE } +}; + +static u32 com2mem_tab[MV64x60_CPU2MEM_WINDOWS][2] = { + { MV64360_MPSC2MEM_0_BASE, MV64360_MPSC2MEM_0_SIZE }, + { MV64360_MPSC2MEM_1_BASE, MV64360_MPSC2MEM_1_SIZE }, + { MV64360_MPSC2MEM_2_BASE, MV64360_MPSC2MEM_2_SIZE }, + { MV64360_MPSC2MEM_3_BASE, MV64360_MPSC2MEM_3_SIZE } +}; + +static u32 dram_selects[MV64x60_CPU2MEM_WINDOWS] = { 0xe, 0xd, 0xb, 0x7 }; +#endif + unsigned long serial_init(int chan, void *ignored) { - u32 mpsc_base, mpsc_routing_base, sdma_base, brg_bcr, cdv; + u32 mpsc_routing_base, sdma_base, brg_bcr, cdv; int i; extern long mv64x60_console_baud; extern long mv64x60_mpsc_clk_src; extern long mv64x60_mpsc_clk_freq; - chan = (chan == 1); /* default to chan 0 if anything but 1 */ + chan = (chan == 1); /* default to chan 0 if anything but 1 */ - if (chan_initialized[chan]) return chan; + if (chan_initialized[chan]) + return chan; chan_initialized[chan] = 1; if (chan == 0) { - mpsc_base = MV64x60_MPSC_0_OFFSET; sdma_base = MV64x60_SDMA_0_OFFSET; brg_bcr = MV64x60_BRG_0_OFFSET + BRG_BCR; SDMA_REGS_INIT(&sdma_regs[0], MV64x60_SDMA_0_OFFSET); } else { - mpsc_base = MV64x60_MPSC_1_OFFSET; sdma_base = MV64x60_SDMA_1_OFFSET; brg_bcr = MV64x60_BRG_1_OFFSET + BRG_BCR; SDMA_REGS_INIT(&sdma_regs[0], MV64x60_SDMA_1_OFFSET); @@ -170,48 +186,79 @@ serial_init(int chan, void *ignored) td[chan][TX_NUM_DESC - 1].next_desc_ptr = (u32)&td[chan][0]; /* Set MPSC Routing */ - MV64x60_REG_WRITE(mpsc_routing_base + MPSC_MRR, 0x3ffffe38); + MV64x60_REG_WRITE(mpsc_routing_base + MPSC_MRR, 0x3ffffe38); + +#ifdef CONFIG_GT64260 + MV64x60_REG_WRITE(GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102); +#else /* Must be MV64360 or MV64460 */ + { + u32 enables, prot_bits, v; + + /* Set up comm unit to memory mapping windows */ + /* Note: Assumes MV64x60_CPU2MEM_WINDOWS == 4 */ + + enables = MV64x60_REG_READ(MV64360_CPU_BAR_ENABLE) & 0xf; + prot_bits = 0; -/* XXXX Not for 64360 XXXX*/ - MV64x60_REG_WRITE(GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102); + for (i=0; i= TX_NUM_DESC) cur_td[com_port] = 0; + if (++cur_td[com_port] >= TX_NUM_DESC) + cur_td[com_port] = 0; *(unchar *)(tdp->buffer ^ 7) = c; tdp->bytecnt = 1; @@ -279,7 +332,7 @@ serial_putc(unsigned long com_port, unsigned char c) unsigned char serial_getc(unsigned long com_port) { - mv64x60_rx_desc_t *rdp; + struct mv64x60_rx_desc *rdp; unchar c = '\0'; rdp = &rd[com_port][cur_rd[com_port]]; @@ -287,7 +340,8 @@ serial_getc(unsigned long com_port) if ((rdp->cmd_stat & (SDMA_DESC_CMDSTAT_O|SDMA_DESC_CMDSTAT_ES)) == 0) { c = *(unchar *)(rdp->buffer ^ 7); RX_INIT_RDP(rdp); - if (++cur_rd[com_port] >= RX_NUM_DESC) cur_rd[com_port] = 0; + if (++cur_rd[com_port] >= RX_NUM_DESC) + cur_rd[com_port] = 0; } return c; @@ -296,7 +350,7 @@ serial_getc(unsigned long com_port) int serial_tstc(unsigned long com_port) { - mv64x60_rx_desc_t *rdp; + struct mv64x60_rx_desc *rdp; int loop_count = 0; int rc = 0; @@ -304,15 +358,14 @@ serial_tstc(unsigned long com_port) /* Go thru rcv desc's until empty looking for one with data (no error)*/ while (((rdp->cmd_stat & SDMA_DESC_CMDSTAT_O) == 0) && - (loop_count++ < RX_NUM_DESC)) { + (loop_count++ < RX_NUM_DESC)) { /* If there was an error, reinit the desc & continue */ if ((rdp->cmd_stat & SDMA_DESC_CMDSTAT_ES) != 0) { RX_INIT_RDP(rdp); - if (++cur_rd[com_port] >= RX_NUM_DESC) { + if (++cur_rd[com_port] >= RX_NUM_DESC) cur_rd[com_port] = 0; - } - rdp = (mv64x60_rx_desc_t *)rdp->next_desc_ptr; + rdp = (struct mv64x60_rx_desc *)rdp->next_desc_ptr; } else { rc = 1; diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c index 9ce8847d2..1348740e5 100644 --- a/arch/ppc/boot/simple/pibs.c +++ b/arch/ppc/boot/simple/pibs.c @@ -1,5 +1,5 @@ /* - * 2004 (c) MontaVista, Software, Inc. This file is licensed under + * 2004-2005 (c) MontaVista, Software, Inc. 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. @@ -10,7 +10,7 @@ #include #include #include -#include +#include extern unsigned long decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum); @@ -89,13 +89,15 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, decompress_kernel(load_addr, num_words, cksum); - mac64 = simple_strtoull((char *)OCOTEA_PIBS_MAC_BASE, 0, 16); + mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); - mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET), 0, 16); +#ifdef CONFIG_440GX + mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); - mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET*2), 0, 16); + mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); - mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET*3), 0, 16); + mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); memcpy(hold_residual->bi_enet3addr, (char *)&mac64+2, 6); +#endif return (void *)hold_residual; } diff --git a/arch/ppc/boot/utils/mkbugboot.c b/arch/ppc/boot/utils/mkbugboot.c index f6629a28e..886122283 100644 --- a/arch/ppc/boot/utils/mkbugboot.c +++ b/arch/ppc/boot/utils/mkbugboot.c @@ -96,7 +96,7 @@ void write_bugboot_header(int32_t out_fd, uint32_t boot_size) uint8_t header_block[HEADER_SIZE]; bug_boot_header_t *bbh = (bug_boot_header_t *)&header_block[0]; - bzero(header_block, HEADER_SIZE); + memset(header_block, 0, HEADER_SIZE); /* Fill in the PPCBUG ROM boot header */ strncpy(bbh->magic_word, "BOOT", 4); /* PPCBUG magic word */ diff --git a/arch/ppc/configs/FADS_defconfig b/arch/ppc/configs/FADS_defconfig index aba7bd86e..c1934f828 100644 --- a/arch/ppc/configs/FADS_defconfig +++ b/arch/ppc/configs/FADS_defconfig @@ -295,25 +295,27 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y +# CONFIG_SERIAL_CPM_ALT_SMC2 is not set CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -478,10 +480,6 @@ CONFIG_SCC1_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -# CONFIG_ALTSMC2 is not set -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/IVMS8_defconfig b/arch/ppc/configs/IVMS8_defconfig index 3f5eb23c5..66bbefe8e 100644 --- a/arch/ppc/configs/IVMS8_defconfig +++ b/arch/ppc/configs/IVMS8_defconfig @@ -319,25 +319,26 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +# CONFIG_SERIAL_CPM_SMC2 is not set CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -507,8 +508,6 @@ CONFIG_FEC_LXT970=y CONFIG_FEC_LXT971=y CONFIG_FEC_QS6612=y CONFIG_ENET_BIG_BUFFERS=y -# CONFIG_SMC2_UART is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/SM850_defconfig b/arch/ppc/configs/SM850_defconfig index 9553f567c..021884b43 100644 --- a/arch/ppc/configs/SM850_defconfig +++ b/arch/ppc/configs/SM850_defconfig @@ -92,7 +92,8 @@ CONFIG_KERNEL_ELF=y # Parallel port support # # CONFIG_PARPORT is not set -# CONFIG_CMDLINE_BOOL is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="console=ttyCPM1" # # Advanced setup @@ -296,25 +297,27 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y +CONFIG_SERIAL_CPM_ALT_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -479,10 +482,6 @@ CONFIG_SCC_ENET=y CONFIG_SCC3_ENET=y # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -CONFIG_ALTSMC2=y -CONFIG_CONS_SMC2=y -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/SPD823TS_defconfig b/arch/ppc/configs/SPD823TS_defconfig index bc3458b7e..ba60fea2b 100644 --- a/arch/ppc/configs/SPD823TS_defconfig +++ b/arch/ppc/configs/SPD823TS_defconfig @@ -295,25 +295,27 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +# CONFIG_SERIAL_CPM_SMC2 is not set +CONFIG_SERIAL_CPM_ALT_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -478,10 +480,6 @@ CONFIG_SCC2_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -CONFIG_ALTSMC2=y -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/TQM823L_defconfig b/arch/ppc/configs/TQM823L_defconfig index 073a99a2c..3b44f3d79 100644 --- a/arch/ppc/configs/TQM823L_defconfig +++ b/arch/ppc/configs/TQM823L_defconfig @@ -296,25 +296,27 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y +CONFIG_SERIAL_CPM_ALT_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -479,10 +481,6 @@ CONFIG_SCC2_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -CONFIG_ALTSMC2=y -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/TQM850L_defconfig b/arch/ppc/configs/TQM850L_defconfig index 5aec1d86f..b02d19630 100644 --- a/arch/ppc/configs/TQM850L_defconfig +++ b/arch/ppc/configs/TQM850L_defconfig @@ -296,25 +296,27 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y +CONFIG_SERIAL_CPM_ALT_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -479,10 +481,6 @@ CONFIG_SCC2_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -CONFIG_ALTSMC2=y -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/TQM860L_defconfig b/arch/ppc/configs/TQM860L_defconfig index 469fcb48b..857e4ab28 100644 --- a/arch/ppc/configs/TQM860L_defconfig +++ b/arch/ppc/configs/TQM860L_defconfig @@ -320,25 +320,26 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -508,10 +509,6 @@ CONFIG_SCC1_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -# CONFIG_ALTSMC2 is not set -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/adir_defconfig b/arch/ppc/configs/adir_defconfig index 3c40aaaec..f20e6533d 100644 --- a/arch/ppc/configs/adir_defconfig +++ b/arch/ppc/configs/adir_defconfig @@ -302,7 +302,6 @@ CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig index 53fb29358..e2245252d 100644 --- a/arch/ppc/configs/apus_defconfig +++ b/arch/ppc/configs/apus_defconfig @@ -354,7 +354,6 @@ CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/bseip_defconfig b/arch/ppc/configs/bseip_defconfig index 227fd153a..ce9f9f77f 100644 --- a/arch/ppc/configs/bseip_defconfig +++ b/arch/ppc/configs/bseip_defconfig @@ -292,25 +292,26 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -476,10 +477,6 @@ CONFIG_SCC2_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set # CONFIG_ENET_BIG_BUFFERS is not set -CONFIG_SMC2_UART=y -# CONFIG_ALTSMC2 is not set -# CONFIG_CONS_SMC2 is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig index 1e331f735..95ead3f1b 100644 --- a/arch/ppc/configs/common_defconfig +++ b/arch/ppc/configs/common_defconfig @@ -1,7 +1,10 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc2 +# Thu Nov 18 08:22:35 2004 # CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_HAVE_DEC_LOCK=y CONFIG_PPC=y @@ -13,12 +16,12 @@ CONFIG_GENERIC_NVRAM=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -# CONFIG_STANDALONE is not set CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -27,17 +30,21 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -46,7 +53,8 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y -# CONFIG_MODVERSIONS is not set +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -58,11 +66,22 @@ CONFIG_6xx=y # CONFIG_POWER3 is not set # CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_E500 is not set CONFIG_ALTIVEC=y CONFIG_TAU=y # CONFIG_TAU_INT is not set # CONFIG_TAU_AVERAGE is not set -# CONFIG_CPU_FREQ is not set +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_PROC_INTF=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_PMAC=y +CONFIG_CPU_FREQ_TABLE=y CONFIG_PPC601_SYNC_FIX=y CONFIG_PM=y CONFIG_PPC_STD_MMU=y @@ -89,9 +108,12 @@ CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PAL4 is not set # CONFIG_GEMINI is not set # CONFIG_EST8260 is not set +# CONFIG_SBC82xx is not set # CONFIG_SBS8260 is not set -# CONFIG_RPX6 is not set +# CONFIG_RPX8260 is not set # CONFIG_TQM8260 is not set +# CONFIG_ADS8272 is not set +# CONFIG_LITE5200 is not set CONFIG_PPC_CHRP=y CONFIG_PPC_PMAC=y CONFIG_PPC_PREP=y @@ -100,11 +122,9 @@ CONFIG_PPCBUG_NVRAM=y # CONFIG_SMP is not set # CONFIG_PREEMPT is not set # CONFIG_HIGHMEM is not set -CONFIG_KERNEL_ELF=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_PROC_DEVICETREE=y -CONFIG_PPC_RTAS=y CONFIG_PREP_RESIDUAL=y CONFIG_PROC_PREPRESIDUAL=y CONFIG_CMDLINE_BOOL=y @@ -121,9 +141,13 @@ CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # -# PCMCIA/CardBus support +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges # -# CONFIG_PCMCIA is not set CONFIG_PCMCIA_PROBE=y # @@ -147,6 +171,8 @@ CONFIG_BOOT_LOAD=0x00800000 # # Generic Driver Options # +# CONFIG_STANDALONE is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # @@ -168,6 +194,7 @@ CONFIG_BOOT_LOAD=0x00800000 # Block devices # CONFIG_BLK_DEV_FD=m +# CONFIG_MAC_FLOPPY is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set @@ -176,11 +203,22 @@ CONFIG_BLK_DEV_FD=m CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_CARMEL is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -191,15 +229,14 @@ CONFIG_BLK_DEV_IDE=y # # Please see Documentation/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_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=y # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -215,7 +252,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set @@ -241,7 +277,7 @@ CONFIG_BLK_DEV_IDE_PMAC=y CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y CONFIG_BLK_DEV_IDEDMA_PMAC=y CONFIG_BLK_DEV_IDE_PMAC_BLINK=y -CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO=y +# CONFIG_IDE_ARM is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set @@ -268,7 +304,6 @@ CONFIG_CHR_DEV_SG=y # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_REPORT_LUNS is not set CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set @@ -282,6 +317,7 @@ CONFIG_SCSI_SPI_ATTRS=y # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set @@ -290,18 +326,17 @@ CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_AIC7XXX=m CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 -# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set CONFIG_AIC7XXX_DEBUG_ENABLE=y CONFIG_AIC7XXX_DEBUG_MASK=0 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y CONFIG_SCSI_AIC7XXX_OLD=m # CONFIG_SCSI_AIC79XX is not set -CONFIG_SCSI_ADVANSYS=m +# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_IN2000 is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set @@ -311,6 +346,7 @@ CONFIG_SCSI_ADVANSYS=m # 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_SYM53C8XX_2=y @@ -325,6 +361,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -378,8 +415,6 @@ CONFIG_ADB_PMU=y CONFIG_PMAC_PBOOK=y CONFIG_PMAC_APM_EMU=y CONFIG_PMAC_BACKLIGHT=y -# CONFIG_MAC_FLOPPY is not set -CONFIG_MAC_SERIAL=m CONFIG_ADB_MACIO=y CONFIG_INPUT_ADBHID=y CONFIG_MAC_EMUMOUSEBTN=y @@ -412,6 +447,9 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -425,6 +463,9 @@ CONFIG_NETFILTER=y # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m @@ -449,29 +490,33 @@ CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set +# CONFIG_IP_NF_MATCH_REALM is not set +# CONFIG_IP_NF_MATCH_SCTP is not set +# CONFIG_IP_NF_MATCH_COMMENT is not set +# CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m +# CONFIG_IP_NF_TARGET_LOG is not set +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m # CONFIG_IP_NF_MANGLE is not set -# CONFIG_IP_NF_TARGET_LOG is not set -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m # CONFIG_IP_NF_ARPTABLES is not set CONFIG_IP_NF_COMPAT_IPCHAINS=m # CONFIG_IP_NF_COMPAT_IPFWADM is not set -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_RAW=m # # SCTP Configuration (EXPERIMENTAL) @@ -489,12 +534,12 @@ CONFIG_IP_NF_RAW=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -524,7 +569,6 @@ CONFIG_MII=y CONFIG_MACE=y # CONFIG_MACE_AAUI_PORT is not set CONFIG_BMAC=y -# CONFIG_OAKNET is not set # CONFIG_HAPPYMEAL is not set CONFIG_SUNGEM=y # CONFIG_NET_VENDOR_3COM is not set @@ -583,6 +627,7 @@ CONFIG_PCNET32=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # @@ -641,7 +686,6 @@ CONFIG_PPP_DEFLATE=y # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set @@ -682,6 +726,7 @@ CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -702,6 +747,7 @@ CONFIG_MOUSE_PS2=y # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y +# CONFIG_INPUT_PCSPKR is not set CONFIG_INPUT_UINPUT=m # @@ -728,7 +774,6 @@ CONFIG_SERIAL_PMACZILOG=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -749,7 +794,6 @@ CONFIG_GEN_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -765,6 +809,7 @@ CONFIG_I2C_CHARDEV=m # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support @@ -789,26 +834,36 @@ CONFIG_I2C_KEYWEST=m # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set @@ -820,11 +875,17 @@ CONFIG_I2C_KEYWEST=m # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + # # Misc devices # @@ -843,6 +904,9 @@ CONFIG_I2C_KEYWEST=m # Graphics support # CONFIG_FB=y +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y @@ -850,8 +914,8 @@ CONFIG_FB_CONTROL=y CONFIG_FB_PLATINUM=y CONFIG_FB_VALKYRIE=y CONFIG_FB_CT65550=y +# CONFIG_FB_ASILIANT is not set CONFIG_FB_IMSTT=y -# CONFIG_FB_S3TRIO is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_RIVA is not set CONFIG_FB_MATROX=y @@ -868,12 +932,15 @@ CONFIG_FB_RADEON_I2C=y CONFIG_FB_ATY128=y CONFIG_FB_ATY=y CONFIG_FB_ATY_CT=y -CONFIG_FB_ATY_GX=y +# CONFIG_FB_ATY_GENERIC_LCD is not set # CONFIG_FB_ATY_XL_INIT is not set +CONFIG_FB_ATY_GX=y +# 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=y +# CONFIG_FB_3DFX_ACCEL is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set @@ -885,7 +952,6 @@ CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_PCI_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -964,6 +1030,7 @@ CONFIG_SND_CS4232=m # # CONFIG_SND_ALI5451 is not set # CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set # CONFIG_SND_AU8810 is not set # CONFIG_SND_AU8820 is not set # CONFIG_SND_AU8830 is not set @@ -1003,9 +1070,10 @@ CONFIG_SND_CS4232=m CONFIG_SND_POWERMAC=m # -# ALSA USB devices +# USB devices # CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_USX2Y is not set # # Open Sound System @@ -1024,6 +1092,10 @@ CONFIG_USB=y CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -1042,6 +1114,7 @@ CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_RW_DETECT is not set # CONFIG_USB_STORAGE_DATAFAB is not set CONFIG_USB_STORAGE_FREECOM=y # CONFIG_USB_STORAGE_ISD200 is not set @@ -1052,7 +1125,7 @@ CONFIG_USB_STORAGE_DPCM=y # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -1063,6 +1136,7 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set +# CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set @@ -1083,7 +1157,7 @@ CONFIG_USB_HIDINPUT=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -1103,6 +1177,7 @@ CONFIG_USB_SERIAL=m # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set # CONFIG_USB_SERIAL_EMPEG is not set # CONFIG_USB_SERIAL_FTDI_SIO is not set CONFIG_USB_SERIAL_VISOR=m @@ -1110,6 +1185,7 @@ CONFIG_USB_SERIAL_VISOR=m # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_IPW is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set CONFIG_USB_SERIAL_KEYSPAN=m # CONFIG_USB_SERIAL_KEYSPAN_MPR is not set @@ -1146,8 +1222,14 @@ CONFIG_USB_EZUSB=y # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set +# CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # @@ -1166,6 +1248,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -1183,6 +1266,8 @@ CONFIG_ISO9660_FS=y CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -1196,6 +1281,7 @@ CONFIG_DEVFS_FS=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -1226,12 +1312,13 @@ CONFIG_NFS_V3=y CONFIG_NFSD=y CONFIG_NFSD_V3=y # CONFIG_NFSD_V4 is not set -# CONFIG_NFSD_TCP is not set +CONFIG_NFSD_TCP=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -1253,7 +1340,6 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set -# CONFIG_NEC98_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set @@ -1287,6 +1373,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set @@ -1305,11 +1392,17 @@ CONFIG_NLS_ISO8859_1=m # # Library routines # +CONFIG_CRC_CCITT=y CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +# +# Profiling support +# +# CONFIG_PROFILING is not set + # # Kernel hacking # @@ -1319,6 +1412,7 @@ CONFIG_BOOTX_TEXT=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/ppc/configs/ev64260_defconfig b/arch/ppc/configs/ev64260_defconfig index aa6b0ca08..84cc142a6 100644 --- a/arch/ppc/configs/ev64260_defconfig +++ b/arch/ppc/configs/ev64260_defconfig @@ -1,26 +1,49 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc2 +# Fri Nov 19 11:17:02 2004 # CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -30,31 +53,38 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # -# Platform support +# Processor # -CONFIG_PPC=y -CONFIG_PPC32=y CONFIG_6xx=y # CONFIG_40x is not set +# CONFIG_44x is not set # CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_E500 is not set +CONFIG_ALTIVEC=y +CONFIG_TAU=y +# CONFIG_TAU_INT is not set +# CONFIG_TAU_AVERAGE is not set +# CONFIG_CPU_FREQ is not set +CONFIG_PPC_GEN550=y +CONFIG_PPC_STD_MMU=y +# CONFIG_NOT_COHERENT_CACHE is not set # -# IBM 4xx options +# Platform options # -# CONFIG_8260 is not set -CONFIG_GENERIC_ISA_DMA=y -CONFIG_PPC_STD_MMU=y # CONFIG_PPC_MULTIPLATFORM is not set # CONFIG_APUS is not set -# CONFIG_WILLOW_2 is not set +# CONFIG_WILLOW is not set # CONFIG_PCORE is not set # CONFIG_POWERPMC250 is not set -CONFIG_EV64260=y # CONFIG_SPRUCE is not set +CONFIG_EV64260=y # CONFIG_LOPEC is not set # CONFIG_MCPN765 is not set # CONFIG_MVME5100 is not set @@ -66,37 +96,37 @@ CONFIG_EV64260=y # CONFIG_K2 is not set # CONFIG_PAL4 is not set # CONFIG_GEMINI is not set +# CONFIG_EST8260 is not set +# CONFIG_SBC82xx is not set +# CONFIG_SBS8260 is not set +# CONFIG_RPX8260 is not set +# CONFIG_TQM8260 is not set +# CONFIG_ADS8272 is not set +# CONFIG_LITE5200 is not set CONFIG_GT64260=y -CONFIG_SERIAL_CONSOLE_BAUD=115200 -# CONFIG_SMP is not set -# CONFIG_PREEMPT is not set -CONFIG_ALTIVEC=y -CONFIG_TAU=y -# CONFIG_TAU_INT is not set -# CONFIG_TAU_AVERAGE is not set -# CONFIG_CPU_FREQ is not set +CONFIG_MV64X60=y # -# General setup +# Set bridge options # +CONFIG_MV64X60_BASE=0xf1000000 +CONFIG_MV64X60_NEW_BASE=0xfbe00000 +# CONFIG_SMP is not set +# CONFIG_PREEMPT is not set # CONFIG_HIGHMEM is not set -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y -CONFIG_KERNEL_ELF=y CONFIG_BINFMT_MISC=y -CONFIG_PCI_LEGACY_PROC=y -CONFIG_PCI_NAMES=y -# CONFIG_HOTPLUG is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="console=ttyS0,115200 ip=on" # -# Parallel port support +# Bus options # -# CONFIG_PARPORT is not set -# CONFIG_PPC601_SYNC_FIX is not set -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="console=ttyS0,115200 ip=on" +CONFIG_GENERIC_ISA_DMA=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +CONFIG_PCI_NAMES=y # # Advanced setup @@ -112,15 +142,29 @@ CONFIG_KERNEL_START=0xc0000000 CONFIG_TASK_SIZE=0x80000000 CONFIG_BOOT_LOAD=0x00800000 +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + # # 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 @@ -131,32 +175,45 @@ CONFIG_BOOT_LOAD=0x00800000 # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set # -# Multi-device support (RAID and LVM) +# IO Schedulers # -# CONFIG_MD is not set +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # -# ATA/IDE/MFM/RLL support +# ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set # -# SCSI support +# SCSI device support # # CONFIG_SCSI is not set +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + # # Fusion MPT device support # # -# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set @@ -165,6 +222,10 @@ CONFIG_BLK_DEV_INITRD=y # # CONFIG_I2O is not set +# +# Macintosh device drivers +# + # # Networking support # @@ -176,8 +237,6 @@ CONFIG_NET=y CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set -CONFIG_NETFILTER=y -# CONFIG_NETFILTER_DEBUG is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y @@ -191,68 +250,81 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set -# CONFIG_IPV6 is not set -# CONFIG_XFRM_USER is not set # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set -# CONFIG_LLC is not set # CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_ETHERTAP is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set -# CONFIG_OAKNET is not set +CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -260,17 +332,26 @@ CONFIG_NET_ETHERNET=y # # Tulip family network device support # -# CONFIG_NET_TULIP is not set +CONFIG_NET_TULIP=y +# CONFIG_DE2104X is not set +CONFIG_TULIP=y +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_DM9102 is not set # CONFIG_HP100 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=y -# CONFIG_EEPRO100_PIO is not set -# CONFIG_E100 is not set +# CONFIG_EEPRO100 is not set +CONFIG_E100=y +# CONFIG_E100_NAPI is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set @@ -293,85 +374,98 @@ CONFIG_EEPRO100=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set +# CONFIG_S2IO is not set # -# Wireless LAN (non-hamradio) +# Token Ring devices # -# CONFIG_NET_RADIO is not set +# CONFIG_TR is not set # -# Token Ring devices (depends on LLC=y) +# Wireless LAN (non-hamradio) # -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set +# CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA 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 # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set +# CONFIG_ISDN is not set # -# Graphics support +# Telephony Support # -# CONFIG_FB is not set - -# -# Old CD-ROM drivers (not SCSI, not IDE) -# -# CONFIG_CD_NO_IDESCSI is not set +# CONFIG_PHONE is not set # # Input device support # -# CONFIG_INPUT is not set +CONFIG_INPUT=y # # Userland interfaces # +CONFIG_INPUT_MOUSEDEV=y +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 # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y -# CONFIG_SERIO is not set +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers # - -# -# Macintosh device drivers -# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set # # Character devices # +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # @@ -379,6 +473,7 @@ CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # @@ -387,68 +482,120 @@ CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +CONFIG_GEN_RTC=y +# CONFIG_GEN_RTC_X is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set # # I2C support # CONFIG_I2C=m +CONFIG_I2C_CHARDEV=m + +# +# I2C Algorithms +# # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set -CONFIG_I2C_CHARDEV=m +# CONFIG_I2C_ALGOPCA is not set # -# I2C Hardware Sensors Mainboard support +# I2C Hardware Bus support # +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_ISA is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set # -# I2C Hardware Sensors Chip support +# Hardware Sensors Chip support # +# CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set -# CONFIG_I2C_SENSOR is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -# CONFIG_QIC02_TAPE is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set # -# IPMI +# Other I2C Chip support # -# CONFIG_IPMI_HANDLER is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set # -# Watchdog Cards +# Dallas's 1-wire bus # -# CONFIG_WATCHDOG is not set -# CONFIG_NVRAM is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set +# CONFIG_W1 is not set # -# Ftape, the floppy tape device driver +# Misc devices # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set -# CONFIG_DRM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_HANGCHECK_TIMER is not set # # Multimedia devices @@ -460,6 +607,34 @@ CONFIG_GEN_RTC=y # # CONFIG_DVB is not set +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +CONFIG_DUMMY_CONSOLE=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + # # File systems # @@ -473,6 +648,7 @@ CONFIG_EXT2_FS=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -485,19 +661,23 @@ CONFIG_EXT2_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_SYSFS=y CONFIG_DEVFS_FS=y # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set -CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # @@ -506,6 +686,7 @@ CONFIG_RAMFS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -522,18 +703,19 @@ CONFIG_RAMFS=y CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y -# CONFIG_SUNRPC_GSS is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set # CONFIG_AFS_FS is not set # @@ -543,36 +725,32 @@ CONFIG_SUNRPC=y CONFIG_MSDOS_PARTITION=y # -# Sound -# -# CONFIG_SOUND is not set - -# -# USB support +# Native Language Support # -# CONFIG_USB is not set -# CONFIG_USB_GADGET is not set +# CONFIG_NLS is not set # -# Bluetooth support +# Library routines # -# CONFIG_BT is not set +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set # -# Library routines +# Profiling support # -# CONFIG_CRC32 is not set +# CONFIG_PROFILING is not set # # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_KALLSYMS is not set # CONFIG_SERIAL_TEXT_DEBUG is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig index a3b6ec0d5..27f3e69c1 100644 --- a/arch/ppc/configs/ibmchrp_defconfig +++ b/arch/ppc/configs/ibmchrp_defconfig @@ -367,7 +367,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/k2_defconfig b/arch/ppc/configs/k2_defconfig index edf52030f..f10f5a6d2 100644 --- a/arch/ppc/configs/k2_defconfig +++ b/arch/ppc/configs/k2_defconfig @@ -319,7 +319,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_FTP=m # CONFIG_IP_NF_MANGLE is not set diff --git a/arch/ppc/configs/mbx_defconfig b/arch/ppc/configs/mbx_defconfig index 213e69d12..52c3799e6 100644 --- a/arch/ppc/configs/mbx_defconfig +++ b/arch/ppc/configs/mbx_defconfig @@ -289,24 +289,26 @@ CONFIG_SOUND_GAMEPORT=y # Macintosh device drivers # -# -# Character devices -# -# CONFIG_SERIAL_NONSTANDARD is not set - # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_UNIX98_PTYS is not set +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +CONFIG_SERIAL_CPM_SCC2=y +CONFIG_SERIAL_CPM_SCC3=y +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set # # I2C support @@ -470,10 +472,6 @@ CONFIG_SCC1_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -# CONFIG_ALTSMC2 is not set -# CONFIG_CONS_SMC2 is not set -CONFIG_USE_SCC_IO=y # # Generic MPC8xx Options diff --git a/arch/ppc/configs/menf1_defconfig b/arch/ppc/configs/menf1_defconfig index e84d06af2..321659b55 100644 --- a/arch/ppc/configs/menf1_defconfig +++ b/arch/ppc/configs/menf1_defconfig @@ -249,7 +249,6 @@ CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/pcore_defconfig b/arch/ppc/configs/pcore_defconfig index ba09d840d..ed34405a7 100644 --- a/arch/ppc/configs/pcore_defconfig +++ b/arch/ppc/configs/pcore_defconfig @@ -332,7 +332,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig index ce480563b..c8e1d5d0c 100644 --- a/arch/ppc/configs/pmac_defconfig +++ b/arch/ppc/configs/pmac_defconfig @@ -479,7 +479,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc/configs/pplus_defconfig b/arch/ppc/configs/pplus_defconfig index f1153f58a..5e459bcbf 100644 --- a/arch/ppc/configs/pplus_defconfig +++ b/arch/ppc/configs/pplus_defconfig @@ -343,7 +343,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_NAT_FTP=m # CONFIG_IP_NF_MANGLE is not set diff --git a/arch/ppc/configs/rpxcllf_defconfig b/arch/ppc/configs/rpxcllf_defconfig index be4538031..cf932f13f 100644 --- a/arch/ppc/configs/rpxcllf_defconfig +++ b/arch/ppc/configs/rpxcllf_defconfig @@ -1,26 +1,49 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc1 +# Mon Nov 1 16:41:04 2004 # CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y +# CONFIG_CLEAN_COMPILE is not set +CONFIG_BROKEN=y +CONFIG_BROKEN_ON_SMP=y # # General setup # -CONFIG_SWAP=y +CONFIG_LOCALVERSION="" +# CONFIG_SWAP is not set CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +# CONFIG_KOBJECT_UEVENT is not set +# CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y -CONFIG_FUTEX=y +# CONFIG_KALLSYMS is not set +# CONFIG_FUTEX is not set # CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +# CONFIG_SHMEM is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support @@ -28,21 +51,23 @@ CONFIG_FUTEX=y # CONFIG_MODULES is not set # -# Platform support +# Processor # -CONFIG_PPC=y -CONFIG_PPC32=y # CONFIG_6xx is not set # CONFIG_40x is not set +# CONFIG_44x is not set # CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set CONFIG_8xx=y +# CONFIG_E500 is not set +CONFIG_MATH_EMULATION=y +# CONFIG_CPU_FREQ is not set +CONFIG_EMBEDDEDBOOT=y +CONFIG_NOT_COHERENT_CACHE=y # -# IBM 4xx options +# Platform options # -CONFIG_EMBEDDEDBOOT=y -CONFIG_SERIAL_CONSOLE=y -CONFIG_NOT_COHERENT_CACHE=y # CONFIG_RPXLITE is not set CONFIG_RPXCLASSIC=y # CONFIG_BSEIP is not set @@ -66,27 +91,17 @@ CONFIG_RPXCLASSIC=y # CONFIG_WINCEPT is not set # CONFIG_SMP is not set # CONFIG_PREEMPT is not set -CONFIG_MATH_EMULATION=y -# CONFIG_CPU_FREQ is not set - -# -# General setup -# # CONFIG_HIGHMEM is not set -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS is not set -# CONFIG_PCI_QSPAN is not set -CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y -CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set -# CONFIG_HOTPLUG is not set +# CONFIG_CMDLINE_BOOL is not set # -# Parallel port support +# Bus options # -# CONFIG_PARPORT is not set -# CONFIG_CMDLINE_BOOL is not set +# CONFIG_PCI is not set +# CONFIG_PCI_DOMAINS is not set +# CONFIG_PCI_QSPAN is not set # # Advanced setup @@ -100,51 +115,88 @@ CONFIG_HIGHMEM_START=0xfe000000 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_KERNEL_START=0xc0000000 CONFIG_TASK_SIZE=0x80000000 +CONFIG_CONSISTENT_START=0xff100000 +CONFIG_CONSISTENT_SIZE=0x00200000 CONFIG_BOOT_LOAD=0x00400000 +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + # # 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_DEV_FD is not set CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set # -# Multi-device support (RAID and LVM) +# IO Schedulers # -# CONFIG_MD is not set +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # -# ATA/IDE/MFM/RLL support +# ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set # -# SCSI support +# SCSI device support # # CONFIG_SCSI is not set +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + # # Fusion MPT device support # +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + # # I2O device support # +# +# Macintosh device drivers +# + # # Networking support # @@ -156,66 +208,70 @@ CONFIG_NET=y CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set -# CONFIG_NETFILTER is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_DHCP is not set CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set # CONFIG_IPV6 is not set -# CONFIG_XFRM_USER is not set +# CONFIG_NETFILTER is not set # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set -# CONFIG_LLC is not set # CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set -# CONFIG_ETHERTAP is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -CONFIG_MII=y +# CONFIG_MII is not set # CONFIG_OAKNET is not set # @@ -225,48 +281,34 @@ CONFIG_MII=y # # Ethernet (10000 Mbit) # -# CONFIG_PPP is not set -# CONFIG_SLIP is not set # -# Wireless LAN (non-hamradio) +# Token Ring devices # -# CONFIG_NET_RADIO is not set # -# Token Ring devices (depends on LLC=y) +# Wireless LAN (non-hamradio) # -# CONFIG_SHAPER is not set +# CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set - -# -# Graphics support -# -# CONFIG_FB is not set +# CONFIG_ISDN is not set # -# Old CD-ROM drivers (not SCSI, not IDE) +# Telephony Support # -# CONFIG_CD_NO_IDESCSI is not set +# CONFIG_PHONE is not set # # Input device support @@ -283,54 +325,38 @@ CONFIG_MII=y # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set # # Input Device Drivers # -# -# Macintosh device drivers -# - # # Character devices # +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +CONFIG_SERIAL_CPM_SCC2=y +CONFIG_SERIAL_CPM_SCC3=y +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +CONFIG_SERIAL_CPM_SMC2=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# I2C Hardware Sensors Mainboard support -# - -# -# I2C Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -# CONFIG_QIC02_TAPE is not set +# CONFIG_LEGACY_PTYS is not set # # IPMI @@ -346,16 +372,27 @@ CONFIG_GEN_RTC=y # CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set -# CONFIG_HANGCHECK_TIMER is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# # # Multimedia devices @@ -367,6 +404,27 @@ CONFIG_GEN_RTC=y # # CONFIG_DVB is not set +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + # # File systems # @@ -385,6 +443,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -397,17 +456,22 @@ CONFIG_FS_MBCACHE=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set -CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # @@ -416,6 +480,7 @@ CONFIG_RAMFS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -432,17 +497,18 @@ CONFIG_RAMFS=y CONFIG_NFS_FS=y # CONFIG_NFS_V3 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_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y -# CONFIG_SUNRPC_GSS is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set # CONFIG_AFS_FS is not set # @@ -456,16 +522,15 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_MAC_PARTITION is not set # CONFIG_MSDOS_PARTITION is not set # CONFIG_LDM_PARTITION is not set -# CONFIG_NEC98_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_EFI_PARTITION is not set # -# Sound +# Native Language Support # -# CONFIG_SOUND is not set +# CONFIG_NLS is not set # # MPC8xx CPM Options @@ -477,42 +542,38 @@ CONFIG_SCC1_ENET=y CONFIG_FEC_ENET=y # CONFIG_USE_MDIO is not set CONFIG_ENET_BIG_BUFFERS=y -CONFIG_SMC2_UART=y -# CONFIG_ALTSMC2 is not set -# CONFIG_CONS_SMC2 is not set -CONFIG_USE_SCC_IO=y # # Generic MPC8xx Options # CONFIG_8xx_COPYBACK=y # CONFIG_8xx_CPU6 is not set -# CONFIG_UCODE_PATCH is not set - -# -# USB support -# -# CONFIG_USB_GADGET is not set +CONFIG_NO_UCODE_PATCH=y +# CONFIG_USB_SOF_UCODE_PATCH is not set +# CONFIG_I2C_SPI_UCODE_PATCH is not set +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set # -# Bluetooth support +# Library routines # -# CONFIG_BT is not set +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC32 is not set +# CONFIG_LIBCRC32C is not set # -# Library routines +# Profiling support # -# CONFIG_CRC32 is not set +# CONFIG_PROFILING is not set # # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_KALLSYMS is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/ppc/configs/rpxlite_defconfig b/arch/ppc/configs/rpxlite_defconfig index 06e818a1f..828dd6eb5 100644 --- a/arch/ppc/configs/rpxlite_defconfig +++ b/arch/ppc/configs/rpxlite_defconfig @@ -1,26 +1,49 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.10-rc1 +# Mon Nov 1 16:41:09 2004 # CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y +# CONFIG_CLEAN_COMPILE is not set +CONFIG_BROKEN=y +CONFIG_BROKEN_ON_SMP=y # # General setup # -CONFIG_SWAP=y +CONFIG_LOCALVERSION="" +# CONFIG_SWAP is not set CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +# CONFIG_KOBJECT_UEVENT is not set +# CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y -CONFIG_FUTEX=y +# CONFIG_KALLSYMS is not set +# CONFIG_FUTEX is not set # CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +# CONFIG_SHMEM is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y # # Loadable module support @@ -28,21 +51,23 @@ CONFIG_FUTEX=y # CONFIG_MODULES is not set # -# Platform support +# Processor # -CONFIG_PPC=y -CONFIG_PPC32=y # CONFIG_6xx is not set # CONFIG_40x is not set +# CONFIG_44x is not set # CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set CONFIG_8xx=y +# CONFIG_E500 is not set +CONFIG_MATH_EMULATION=y +# CONFIG_CPU_FREQ is not set +CONFIG_EMBEDDEDBOOT=y +CONFIG_NOT_COHERENT_CACHE=y # -# IBM 4xx options +# Platform options # -CONFIG_EMBEDDEDBOOT=y -CONFIG_SERIAL_CONSOLE=y -CONFIG_NOT_COHERENT_CACHE=y CONFIG_RPXLITE=y # CONFIG_RPXCLASSIC is not set # CONFIG_BSEIP is not set @@ -66,27 +91,17 @@ CONFIG_RPXLITE=y # CONFIG_WINCEPT is not set # CONFIG_SMP is not set # CONFIG_PREEMPT is not set -CONFIG_MATH_EMULATION=y -# CONFIG_CPU_FREQ is not set - -# -# General setup -# # CONFIG_HIGHMEM is not set -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS is not set -# CONFIG_PCI_QSPAN is not set -CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y -CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set -# CONFIG_HOTPLUG is not set +# CONFIG_CMDLINE_BOOL is not set # -# Parallel port support +# Bus options # -# CONFIG_PARPORT is not set -# CONFIG_CMDLINE_BOOL is not set +# CONFIG_PCI is not set +# CONFIG_PCI_DOMAINS is not set +# CONFIG_PCI_QSPAN is not set # # Advanced setup @@ -100,51 +115,88 @@ CONFIG_HIGHMEM_START=0xfe000000 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_KERNEL_START=0xc0000000 CONFIG_TASK_SIZE=0x80000000 +CONFIG_CONSISTENT_START=0xff100000 +CONFIG_CONSISTENT_SIZE=0x00200000 CONFIG_BOOT_LOAD=0x00400000 +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + # # 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_DEV_FD is not set CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set # -# Multi-device support (RAID and LVM) +# IO Schedulers # -# CONFIG_MD is not set +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # -# ATA/IDE/MFM/RLL support +# ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set # -# SCSI support +# SCSI device support # # CONFIG_SCSI is not set +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + # # Fusion MPT device support # +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + # # I2O device support # +# +# Macintosh device drivers +# + # # Networking support # @@ -156,60 +208,64 @@ CONFIG_NET=y CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set -# CONFIG_NETFILTER is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_DHCP is not set CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set -CONFIG_SYN_COOKIES=y +# CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set # CONFIG_IPV6 is not set -# CONFIG_XFRM_USER is not set +# CONFIG_NETFILTER is not set # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set -# CONFIG_LLC is not set # CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set -# CONFIG_ETHERTAP is not set # # Ethernet (10 or 100Mbit) @@ -225,48 +281,34 @@ CONFIG_NET_ETHERNET=y # # Ethernet (10000 Mbit) # -# CONFIG_PPP is not set -# CONFIG_SLIP is not set # -# Wireless LAN (non-hamradio) +# Token Ring devices # -# CONFIG_NET_RADIO is not set # -# Token Ring devices (depends on LLC=y) +# Wireless LAN (non-hamradio) # -# CONFIG_SHAPER is not set +# CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set - -# -# Graphics support -# -# CONFIG_FB is not set +# CONFIG_ISDN is not set # -# Old CD-ROM drivers (not SCSI, not IDE) +# Telephony Support # -# CONFIG_CD_NO_IDESCSI is not set +# CONFIG_PHONE is not set # # Input device support @@ -283,54 +325,38 @@ CONFIG_NET_ETHERNET=y # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y # CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set # # Input Device Drivers # -# -# Macintosh device drivers -# - # # Character devices # +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +# CONFIG_SERIAL_CPM_SCC1 is not set +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +# CONFIG_SERIAL_CPM_SCC4 is not set +CONFIG_SERIAL_CPM_SMC1=y +# CONFIG_SERIAL_CPM_SMC2 is not set CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# I2C Hardware Sensors Mainboard support -# - -# -# I2C Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -# CONFIG_QIC02_TAPE is not set +# CONFIG_LEGACY_PTYS is not set # # IPMI @@ -346,16 +372,27 @@ CONFIG_GEN_RTC=y # CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # -# CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set -# CONFIG_HANGCHECK_TIMER is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# # # Multimedia devices @@ -367,6 +404,27 @@ CONFIG_GEN_RTC=y # # CONFIG_DVB is not set +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + # # File systems # @@ -385,6 +443,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -397,17 +456,22 @@ CONFIG_FS_MBCACHE=y # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set -CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # @@ -416,6 +480,7 @@ CONFIG_RAMFS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -432,17 +497,18 @@ CONFIG_RAMFS=y CONFIG_NFS_FS=y # CONFIG_NFS_V3 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_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y -# CONFIG_SUNRPC_GSS is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set # CONFIG_AFS_FS is not set # @@ -456,16 +522,15 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_MAC_PARTITION is not set # CONFIG_MSDOS_PARTITION is not set # CONFIG_LDM_PARTITION is not set -# CONFIG_NEC98_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_EFI_PARTITION is not set # -# Sound +# Native Language Support # -# CONFIG_SOUND is not set +# CONFIG_NLS is not set # # MPC8xx CPM Options @@ -476,40 +541,38 @@ CONFIG_SCC2_ENET=y # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set # CONFIG_ENET_BIG_BUFFERS is not set -# CONFIG_SMC2_UART is not set -# CONFIG_USE_SCC_IO is not set # # Generic MPC8xx Options # CONFIG_8xx_COPYBACK=y # CONFIG_8xx_CPU6 is not set -# CONFIG_UCODE_PATCH is not set - -# -# USB support -# -# CONFIG_USB_GADGET is not set +CONFIG_NO_UCODE_PATCH=y +# CONFIG_USB_SOF_UCODE_PATCH is not set +# CONFIG_I2C_SPI_UCODE_PATCH is not set +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set # -# Bluetooth support +# Library routines # -# CONFIG_BT is not set +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC32 is not set +# CONFIG_LIBCRC32C is not set # -# Library routines +# Profiling support # -# CONFIG_CRC32 is not set +# CONFIG_PROFILING is not set # # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -# CONFIG_KALLSYMS is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 94e0b41d6..464f01992 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile @@ -14,7 +14,7 @@ extra-y += vmlinux.lds obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \ semaphore.o syscalls.o setup.o \ - cputable.o ppc_htab.o + cputable.o ppc_htab.o perfmon.o obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o obj-$(CONFIG_POWER4) += cpu_setup_power4.o obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o @@ -24,8 +24,9 @@ obj-$(CONFIG_KGDB) += ppc-stub.o obj-$(CONFIG_SMP) += smp.o smp-tbsync.o obj-$(CONFIG_TAU) += temp.o obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o +obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o -ifdef CONFIG_MATH_EMULATION +ifndef CONFIG_MATH_EMULATION obj-$(CONFIG_8xx) += softemu8xx.o endif diff --git a/arch/ppc/kernel/bitops.c b/arch/ppc/kernel/bitops.c index c00bad67d..7f53d1939 100644 --- a/arch/ppc/kernel/bitops.c +++ b/arch/ppc/kernel/bitops.c @@ -3,7 +3,7 @@ */ #include -#include +#include /* * If the bitops are not inlined in bitops.h, they are defined here. diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S index e42049f3e..9a4ee63fd 100644 --- a/arch/ppc/kernel/cpu_setup_6xx.S +++ b/arch/ppc/kernel/cpu_setup_6xx.S @@ -292,13 +292,15 @@ _GLOBAL(__save_cpu_setup) cmplwi cr2,r3,0x800c /* 7410 */ cmplwi cr3,r3,0x8001 /* 7455 */ cmplwi cr4,r3,0x8002 /* 7457 */ - cmplwi cr5,r3,0x7000 /* 750FX */ + cmplwi cr5,r3,0x8003 /* 7447A */ + cmplwi cr6,r3,0x7000 /* 750FX */ /* cr1 is 7400 || 7410 */ cror 4*cr1+eq,4*cr1+eq,4*cr2+eq /* cr0 is 74xx */ cror 4*cr0+eq,4*cr0+eq,4*cr3+eq cror 4*cr0+eq,4*cr0+eq,4*cr4+eq cror 4*cr0+eq,4*cr0+eq,4*cr1+eq + cror 4*cr0+eq,4*cr0+eq,4*cr5+eq bne 1f /* Backup 74xx specific regs */ mfspr r4,SPRN_MSSCR0 @@ -316,7 +318,7 @@ _GLOBAL(__save_cpu_setup) mfspr r4,SPRN_LDSTDB stw r4,CS_LDSTDB(r5) 1: - bne cr5,1f + bne cr6,1f /* Backup 750FX specific registers */ mfspr r4,SPRN_HID1 stw r4,CS_HID1(r5) @@ -359,13 +361,15 @@ _GLOBAL(__restore_cpu_setup) cmplwi cr2,r3,0x800c /* 7410 */ cmplwi cr3,r3,0x8001 /* 7455 */ cmplwi cr4,r3,0x8002 /* 7457 */ - cmplwi cr5,r3,0x7000 /* 750FX */ + cmplwi cr5,r3,0x8003 /* 7447A */ + cmplwi cr6,r3,0x7000 /* 750FX */ /* cr1 is 7400 || 7410 */ cror 4*cr1+eq,4*cr1+eq,4*cr2+eq /* cr0 is 74xx */ cror 4*cr0+eq,4*cr0+eq,4*cr3+eq cror 4*cr0+eq,4*cr0+eq,4*cr4+eq cror 4*cr0+eq,4*cr0+eq,4*cr1+eq + cror 4*cr0+eq,4*cr0+eq,4*cr5+eq bne 2f /* Restore 74xx specific regs */ lwz r4,CS_MSSCR0(r5) @@ -404,7 +408,7 @@ _GLOBAL(__restore_cpu_setup) mtspr SPRN_LDSTDB,r4 isync sync -2: bne cr5,1f +2: bne cr6,1f /* Restore 750FX specific registers * that is restore HID2 on rev 2.x and PLL config & switch * to PLL 0 on all diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c index 605afa6c6..c86b4b224 100644 --- a/arch/ppc/kernel/cputable.c +++ b/arch/ppc/kernel/cputable.c @@ -30,7 +30,6 @@ extern void __setup_cpu_745x(unsigned long offset, int cpu_nr, struct cpu_spec* extern void __setup_cpu_power3(unsigned long offset, int cpu_nr, struct cpu_spec* spec); extern void __setup_cpu_power4(unsigned long offset, int cpu_nr, struct cpu_spec* spec); extern void __setup_cpu_ppc970(unsigned long offset, int cpu_nr, struct cpu_spec* spec); -extern void __setup_cpu_8xx(unsigned long offset, int cpu_nr, struct cpu_spec* spec); extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec); #define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \ @@ -48,12 +47,21 @@ extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spe */ #ifdef CONFIG_ALTIVEC #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC -#define PPC_FEATURE_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC +#define PPC_FEATURE_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC #else #define CPU_FTR_ALTIVEC_COMP 0 #define PPC_FEATURE_ALTIVEC_COMP 0 #endif +/* We only set the spe features if the kernel was compiled with + * spe support + */ +#ifdef CONFIG_SPE +#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE +#else +#define PPC_FEATURE_SPE_COMP 0 +#endif + /* We need to mark all pages as being coherent if we're SMP or we * have a 74[45]x and an MPC107 host bridge. */ @@ -76,555 +84,827 @@ extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spe struct cpu_spec cpu_specs[] = { #if CLASSIC_PPC - { /* 601 */ - 0xffff0000, 0x00010000, "601", - CPU_FTR_COMMON | - CPU_FTR_601 | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_601_INSTR | PPC_FEATURE_UNIFIED_CACHE, - 32, 32, - __setup_cpu_601 - }, - { /* 603 */ - 0xffff0000, 0x00030000, "603", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_603 - }, - { /* 603e */ - 0xffff0000, 0x00060000, "603e", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_603 - }, - { /* 603ev */ - 0xffff0000, 0x00070000, "603ev", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_603 - }, - { /* 604 */ - 0xffff0000, 0x00040000, "604", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | - CPU_FTR_HPTE_TABLE, - COMMON_PPC, - 32, 32, - __setup_cpu_604 - }, - { /* 604e */ - 0xfffff000, 0x00090000, "604e", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | - CPU_FTR_HPTE_TABLE, - COMMON_PPC, - 32, 32, - __setup_cpu_604 - }, - { /* 604r */ - 0xffff0000, 0x00090000, "604r", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | - CPU_FTR_HPTE_TABLE, - COMMON_PPC, - 32, 32, - __setup_cpu_604 - }, - { /* 604ev */ - 0xffff0000, 0x000a0000, "604ev", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | - CPU_FTR_HPTE_TABLE, - COMMON_PPC, - 32, 32, - __setup_cpu_604 - }, - { /* 740/750 (0x4202, don't support TAU ?) */ - 0xffffffff, 0x00084202, "740/750", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750 - }, - { /* 745/755 */ - 0xfffff000, 0x00083000, "745/755", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750 - }, - { /* 750CX (80100 and 8010x?) */ - 0xfffffff0, 0x00080100, "750CX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750cx - }, - { /* 750CX (82201 and 82202) */ - 0xfffffff0, 0x00082200, "750CX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750cx - }, - { /* 750CXe (82214) */ - 0xfffffff0, 0x00082210, "750CXe", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750cx - }, - { /* 750FX rev 1.x */ - 0xffffff00, 0x70000100, "750FX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, - COMMON_PPC, - 32, 32, - __setup_cpu_750 - }, - { /* 750FX rev 2.0 must disable HID0[DPM] */ - 0xffffffff, 0x70000200, "750FX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_NO_DPM, - COMMON_PPC, - 32, 32, - __setup_cpu_750 - }, - { /* 750FX (All revs except 2.0) */ - 0xffff0000, 0x70000000, "750FX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, - COMMON_PPC, - 32, 32, - __setup_cpu_750fx - }, - { /* 750GX */ - 0xffff0000, 0x70020000, "750GX", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, - COMMON_PPC, - 32, 32, - __setup_cpu_750fx - }, - { /* 740/750 (L2CR bit need fixup for 740) */ - 0xffff0000, 0x00080000, "740/750", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC, - 32, 32, - __setup_cpu_750 - }, - { /* 7400 rev 1.1 ? (no TAU) */ - 0xffffffff, 0x000c1101, "7400 (1.1)", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_7400 - }, - { /* 7400 */ - 0xffff0000, 0x000c0000, "7400", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_7400 - }, - { /* 7410 */ - 0xffff0000, 0x800c0000, "7410", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_7410 - }, - { /* 7450 2.0 - no doze/nap */ - 0xffffffff, 0x80000200, "7450", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7450 2.1 */ - 0xffffffff, 0x80000201, "7450", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7450 2.3 and newer */ - 0xffff0000, 0x80000000, "7450", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7455 rev 1.x */ - 0xffffff00, 0x80010100, "7455", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7455 rev 2.0 */ - 0xffffffff, 0x80010200, "7455", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7455 others */ - 0xffff0000, 0x80010000, "7455", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7447/7457 Rev 1.0 */ - 0xffffffff, 0x80020100, "7447/7457", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7447/7457 Rev 1.1 */ - 0xffffffff, 0x80020101, "7447/7457", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7447/7457 Rev 1.2 and later */ - 0xffff0000, 0x80020000, "7447/7457", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 7447A */ - 0xffff0000, 0x80030000, "7447A", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | - CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, - COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, - 32, 32, - __setup_cpu_745x - }, - { /* 82xx (8240, 8245, 8260 are all 603e cores) */ - 0x7fff0000, 0x00810000, "82xx", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB, - COMMON_PPC, - 32, 32, - __setup_cpu_603 - }, - { /* All G2_LE (603e core, plus some) have the same pvr */ - 0x7fff0000, 0x00820000, "G2_LE", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, - COMMON_PPC, - 32, 32, - __setup_cpu_603 - }, - { /* default match, we assume split I/D cache & TB (non-601)... */ - 0x00000000, 0x00000000, "(generic PPC)", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC, - 32, 32, - __setup_cpu_generic - }, + { /* 601 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00010000, + .cpu_name = "601", + .cpu_features = CPU_FTR_COMMON | CPU_FTR_601 | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_601_INSTR | + PPC_FEATURE_UNIFIED_CACHE, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_601 + }, + { /* 603 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00030000, + .cpu_name = "603", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_603 + }, + { /* 603e */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00060000, + .cpu_name = "603e", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_603 + }, + { /* 603ev */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00070000, + .cpu_name = "603ev", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_603 + }, + { /* 604 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00040000, + .cpu_name = "604", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 2, + .cpu_setup = __setup_cpu_604 + }, + { /* 604e */ + .pvr_mask = 0xfffff000, + .pvr_value = 0x00090000, + .cpu_name = "604e", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_604 + }, + { /* 604r */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00090000, + .cpu_name = "604r", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_604 + }, + { /* 604ev */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x000a0000, + .cpu_name = "604ev", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_604 + }, + { /* 740/750 (0x4202, don't support TAU ?) */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x00084202, + .cpu_name = "740/750", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE | + CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750 + }, + { /* 745/755 */ + .pvr_mask = 0xfffff000, + .pvr_value = 0x00083000, + .cpu_name = "745/755", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750 + }, + { /* 750CX (80100 and 8010x?) */ + .pvr_mask = 0xfffffff0, + .pvr_value = 0x00080100, + .cpu_name = "750CX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750cx + }, + { /* 750CX (82201 and 82202) */ + .pvr_mask = 0xfffffff0, + .pvr_value = 0x00082200, + .cpu_name = "750CX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750cx + }, + { /* 750CXe (82214) */ + .pvr_mask = 0xfffffff0, + .pvr_value = 0x00082210, + .cpu_name = "750CXe", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750cx + }, + { /* 750FX rev 1.x */ + .pvr_mask = 0xffffff00, + .pvr_value = 0x70000100, + .cpu_name = "750FX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750 + }, + { /* 750FX rev 2.0 must disable HID0[DPM] */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x70000200, + .cpu_name = "750FX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | + CPU_FTR_NO_DPM, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750 + }, + { /* 750FX (All revs except 2.0) */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x70000000, + .cpu_name = "750FX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750fx + }, + { /* 750GX */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x70020000, + .cpu_name = "750GX", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_DUAL_PLL_750FX | + CPU_FTR_HAS_HIGH_BATS, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750fx + }, + { /* 740/750 (L2CR bit need fixup for 740) */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00080000, + .cpu_name = "740/750", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_750 + }, + { /* 7400 rev 1.1 ? (no TAU) */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x000c1101, + .cpu_name = "7400 (1.1)", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_7400 + }, + { /* 7400 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x000c0000, + .cpu_name = "7400", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | + CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_7400 + }, + { /* 7410 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x800c0000, + .cpu_name = "7410", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | + CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + .cpu_setup = __setup_cpu_7410 + }, + { /* 7450 2.0 - no doze/nap */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x80000200, + .cpu_name = "7450", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7450 2.1 */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x80000201, + .cpu_name = "7450", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | + CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7450 2.3 and newer */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x80000000, + .cpu_name = "7450", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7455 rev 1.x */ + .pvr_mask = 0xffffff00, + .pvr_value = 0x80010100, + .cpu_name = "7455", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7455 rev 2.0 */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x80010200, + .cpu_name = "7455", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | + CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7455 others */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x80010000, + .cpu_name = "7455", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | + CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7447/7457 Rev 1.0 */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x80020100, + .cpu_name = "7447/7457", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | + CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7447/7457 Rev 1.1 */ + .pvr_mask = 0xffffffff, + .pvr_value = 0x80020101, + .cpu_name = "7447/7457", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | + CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7447/7457 Rev 1.2 and later */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x80020000, + .cpu_name = "7447/7457", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | + CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 7447A */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x80030000, + .cpu_name = "7447A", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | + CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | + CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 6, + .cpu_setup = __setup_cpu_745x + }, + { /* 82xx (8240, 8245, 8260 are all 603e cores) */ + .pvr_mask = 0x7fff0000, + .pvr_value = 0x00810000, + .cpu_name = "82xx", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | + CPU_FTR_USE_TB, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_603 + }, + { /* All G2_LE (603e core, plus some) have the same pvr */ + .pvr_mask = 0x7fff0000, + .pvr_value = 0x00820000, + .cpu_name = "G2_LE", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_603 + }, + { /* default match, we assume split I/D cache & TB (non-601)... */ + .pvr_mask = 0x00000000, + .pvr_value = 0x00000000, + .cpu_name = "(generic PPC)", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC, + .icache_bsize = 32, + .dcache_bsize = 32, + .cpu_setup = __setup_cpu_generic + }, #endif /* CLASSIC_PPC */ #ifdef CONFIG_PPC64BRIDGE - { /* Power3 */ - 0xffff0000, 0x00400000, "Power3 (630)", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power3 - }, - { /* Power3+ */ - 0xffff0000, 0x00410000, "Power3 (630+)", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power3 - }, + { /* Power3 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00400000, + .cpu_name = "Power3 (630)", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_power3 + }, + { /* Power3+ */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00410000, + .cpu_name = "Power3 (630+)", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_power3 + }, { /* I-star */ - 0xffff0000, 0x00360000, "I-star", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power3 + .pvr_mask = 0xffff0000, + .pvr_value = 0x00360000, + .cpu_name = "I-star", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_power3 }, { /* S-star */ - 0xffff0000, 0x00370000, "S-star", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power3 + .pvr_mask = 0xffff0000, + .pvr_value = 0x00370000, + .cpu_name = "S-star", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_power3 }, #endif /* CONFIG_PPC64BRIDGE */ #ifdef CONFIG_POWER4 - { /* Power4 */ - 0xffff0000, 0x00350000, "Power4", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power4 - }, - { /* PPC970 */ - 0xffff0000, 0x00390000, "PPC970", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_ALTIVEC_COMP, - 128, 128, - __setup_cpu_ppc970 - }, - { /* PPC970FX */ - 0xffff0000, 0x003c0000, "PPC970FX", - CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, - COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_ALTIVEC_COMP, - 128, 128, - __setup_cpu_ppc970 - }, + { /* Power4 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00350000, + .cpu_name = "Power4", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_power4 + }, + { /* PPC970 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00390000, + .cpu_name = "PPC970", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64 | + PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_ppc970 + }, + { /* PPC970FX */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x003c0000, + .cpu_name = "PPC970FX", + .cpu_features = CPU_FTR_COMMON | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | + CPU_FTR_HPTE_TABLE | + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, + .cpu_user_features = COMMON_PPC | PPC_FEATURE_64 | + PPC_FEATURE_ALTIVEC_COMP, + .icache_bsize = 128, + .dcache_bsize = 128, + .num_pmcs = 8, + .cpu_setup = __setup_cpu_ppc970 + }, #endif /* CONFIG_POWER4 */ #ifdef CONFIG_8xx - { /* 8xx */ - 0xffff0000, 0x00500000, "8xx", + { /* 8xx */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00500000, + .cpu_name = "8xx", /* CPU_FTR_MAYBE_CAN_DOZE is possible, * if the 8xx code is there.... */ - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 16, 16, - __setup_cpu_8xx /* Empty */ - }, + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 16, + .dcache_bsize = 16, + }, #endif /* CONFIG_8xx */ #ifdef CONFIG_40x - { /* 403GC */ - 0xffffff00, 0x00200200, "403GC", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 16, 16, - 0, /*__setup_cpu_403 */ - }, - { /* 403GCX */ - 0xffffff00, 0x00201400, "403GCX", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 16, 16, - 0, /*__setup_cpu_403 */ - }, - { /* 403G ?? */ - 0xffff0000, 0x00200000, "403G ??", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 16, 16, - 0, /*__setup_cpu_403 */ - }, - { /* 405GP */ - 0xffff0000, 0x40110000, "405GP", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* STB 03xxx */ - 0xffff0000, 0x40130000, "STB03xxx", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* STB 04xxx */ - 0xffff0000, 0x41810000, "STB04xxx", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* NP405L */ - 0xffff0000, 0x41610000, "NP405L", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* NP4GS3 */ - 0xffff0000, 0x40B10000, "NP4GS3", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* NP405H */ - 0xffff0000, 0x41410000, "NP405H", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* 405GPr */ - 0xffff0000, 0x50910000, "405GPr", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* STBx25xx */ - 0xffff0000, 0x51510000, "STBx25xx", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* 405LP */ - 0xffff0000, 0x41F10000, "405LP", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_405 */ - }, - { /* Xilinx Virtex-II Pro */ - 0xffff0000, 0x20010000, "Virtex-II Pro", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - 32, 32, - 0, /*__setup_cpu_405 */ - }, + { /* 403GC */ + .pvr_mask = 0xffffff00, + .pvr_value = 0x00200200, + .cpu_name = "403GC", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 16, + .dcache_bsize = 16, + }, + { /* 403GCX */ + .pvr_mask = 0xffffff00, + .pvr_value = 0x00201400, + .cpu_name = "403GCX", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 16, + .dcache_bsize = 16, + }, + { /* 403G ?? */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00200000, + .cpu_name = "403G ??", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 16, + .dcache_bsize = 16, + }, + { /* 405GP */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x40110000, + .cpu_name = "405GP", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* STB 03xxx */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x40130000, + .cpu_name = "STB03xxx", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* STB 04xxx */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x41810000, + .cpu_name = "STB04xxx", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* NP405L */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x41610000, + .cpu_name = "NP405L", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* NP4GS3 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x40B10000, + .cpu_name = "NP4GS3", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* NP405H */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x41410000, + .cpu_name = "NP405H", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 405GPr */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x50910000, + .cpu_name = "405GPr", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* STBx25xx */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x51510000, + .cpu_name = "STBx25xx", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 405LP */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x41F10000, + .cpu_name = "405LP", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* Xilinx Virtex-II Pro */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x20010000, + .cpu_name = "Virtex-II Pro", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + }, #endif /* CONFIG_40x */ #ifdef CONFIG_44x - { /* 440GP Rev. B */ - 0xf0000fff, 0x40000440, "440GP Rev. B", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_440 */ - }, - { /* 440GP Rev. C */ - 0xf0000fff, 0x40000481, "440GP Rev. C", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_440 */ - }, - { /* 440GX Rev. A */ - 0xf0000fff, 0x50000850, "440GX Rev. A", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_440 */ - }, - { /* 440GX Rev. B */ - 0xf0000fff, 0x50000851, "440GX Rev. B", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_440 */ - }, - { /* 440GX Rev. C */ - 0xf0000fff, 0x50000892, "440GX Rev. C", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_440 */ - }, + { /* 440GP Rev. B */ + .pvr_mask = 0xf0000fff, + .pvr_value = 0x40000440, + .cpu_name = "440GP Rev. B", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 440GP Rev. C */ + .pvr_mask = 0xf0000fff, + .pvr_value = 0x40000481, + .cpu_name = "440GP Rev. C", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 440GX Rev. A */ + .pvr_mask = 0xf0000fff, + .pvr_value = 0x50000850, + .cpu_name = "440GX Rev. A", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 440GX Rev. B */ + .pvr_mask = 0xf0000fff, + .pvr_value = 0x50000851, + .cpu_name = "440GX Rev. B", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 440GX Rev. C */ + .pvr_mask = 0xf0000fff, + .pvr_value = 0x50000892, + .cpu_name = "440GX Rev. C", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, #endif /* CONFIG_44x */ #ifdef CONFIG_E500 - { /* e500 */ - 0xffff0000, 0x80200000, "e500", - /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, - 32, 32, - 0, /*__setup_cpu_e500 */ - }, + { /* e500 */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x80200000, + .cpu_name = "e500", + /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP | + PPC_FEATURE_HAS_EFP_SINGLE, + .icache_bsize = 32, + .dcache_bsize = 32, + .num_pmcs = 4, + }, #endif #if !CLASSIC_PPC - { /* default match */ - 0x00000000, 0x00000000, "(generic PPC)", - CPU_FTR_COMMON, - PPC_FEATURE_32, - 32, 32, - 0, - } + { /* default match */ + .pvr_mask = 0x00000000, + .pvr_value = 0x00000000, + .cpu_name = "(generic PPC)", + .cpu_features = CPU_FTR_COMMON, + .cpu_user_features = PPC_FEATURE_32, + .icache_bsize = 32, + .dcache_bsize = 32, + } #endif /* !CLASSIC_PPC */ }; diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c index 334b8bfdc..59359d89d 100644 --- a/arch/ppc/kernel/dma-mapping.c +++ b/arch/ppc/kernel/dma-mapping.c @@ -71,7 +71,7 @@ int map_page(unsigned long va, phys_addr_t pa, int flags); * This is the page table (2MB) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte; -static spinlock_t consistent_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(consistent_lock); /* * VM region handling support. diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S index 91318c15c..08083be4c 100644 --- a/arch/ppc/kernel/entry.S +++ b/arch/ppc/kernel/entry.S @@ -111,8 +111,10 @@ transfer_to_handler: addi r11,r1,STACK_FRAME_OVERHEAD stw r11,PT_REGS(r12) #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) - lwz r12,PTRACE-THREAD(r12) - andi. r12,r12,PT_PTRACED + /* Check to see if the dbcr0 register is set up to debug. Use the + single-step bit to do this. */ + lwz r12,THREAD_DBCR0(r12) + andis. r12,r12,DBCR0_IC@h beq+ 3f /* From user and task is ptraced - load up global dbcr0 */ li r12,-1 /* clear all pending debug events */ @@ -242,9 +244,10 @@ ret_from_syscall: bne- syscall_exit_work syscall_exit_cont: #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) - /* If the process has its own DBCR0 value, load it up */ - lwz r0,PTRACE(r2) - andi. r0,r0,PT_PTRACED + /* If the process has its own DBCR0 value, load it up. The single + step bit tells us that dbcr0 should be loaded. */ + lwz r0,THREAD+THREAD_DBCR0(r2) + andis. r10,r0,DBCR0_IC@h bnel- load_dbcr0 #endif stwcx. r0,0,r1 /* to clear the reservation */ @@ -599,9 +602,10 @@ user_exc_return: /* r10 contains MSR_KERNEL here */ restore_user: #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) - /* Check whether this process has its own DBCR0 value */ - lwz r0,PTRACE(r2) - andi. r0,r0,PT_PTRACED + /* Check whether this process has its own DBCR0 value. The single + step bit tells us that dbcr0 should be loaded. */ + lwz r0,THREAD+THREAD_DBCR0(r2) + andis. r10,r0,DBCR0_IC@h bnel- load_dbcr0 #endif @@ -620,18 +624,8 @@ resume_kernel: beq+ restore andi. r0,r3,MSR_EE /* interrupts off? */ beq restore /* don't schedule if so */ -1: lis r0,PREEMPT_ACTIVE@h - stw r0,TI_PREEMPT(r9) - ori r10,r10,MSR_EE - SYNC - MTMSRD(r10) /* hard-enable interrupts */ - bl schedule - LOAD_MSR_KERNEL(r10,MSR_KERNEL) - SYNC - MTMSRD(r10) /* disable interrupts */ +1: bl preempt_schedule_irq rlwinm r9,r1,0,0,18 - li r0,0 - stw r0,TI_PREEMPT(r9) lwz r3,TI_FLAGS(r9) andi. r0,r3,_TIF_NEED_RESCHED bne- 1b @@ -876,17 +870,17 @@ ret_from_mcheck_exc: /* * Load the DBCR0 value for a task that is being ptraced, - * having first saved away the global DBCR0. + * having first saved away the global DBCR0. Note that r0 + * has the dbcr0 value to set upon entry to this. */ load_dbcr0: - mfmsr r0 /* first disable debug exceptions */ - rlwinm r0,r0,0,~MSR_DE - mtmsr r0 + mfmsr r10 /* first disable debug exceptions */ + rlwinm r10,r10,0,~MSR_DE + mtmsr r10 isync mfspr r10,SPRN_DBCR0 lis r11,global_dbcr0@ha addi r11,r11,global_dbcr0@l - lwz r0,THREAD+THREAD_DBCR0(r2) stw r10,0(r11) mtspr SPRN_DBCR0,r0 lwz r10,4(r11) diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S index 73fd71105..1dc137969 100644 --- a/arch/ppc/kernel/head_44x.S +++ b/arch/ppc/kernel/head_44x.S @@ -21,7 +21,7 @@ * Author: MontaVista Software, Inc. * frank_rowand@mvista.com or source@mvista.com * debbie_chu@mvista.com - * Copyright 2002-2004 MontaVista Software, Inc. + * Copyright 2002-2005 MontaVista Software, Inc. * PowerPC 44x support, Matt Porter * * This program is free software; you can redistribute it and/or modify it @@ -185,11 +185,11 @@ skpinv: addi r4,r4,1 /* Increment */ * are used for polled operation. */ /* pageid fields */ - lis r3,0xe000 + lis r3,UART0_IO_BASE@h ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M /* xlat fields */ - lis r4,0x4000 /* RPN is 0x40000000 */ + lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ /* attrib fields */ @@ -414,30 +414,16 @@ interrupt_base: b data_access /* Instruction Storage Interrupt */ - START_EXCEPTION(InstructionStorage) - NORMAL_EXCEPTION_PROLOG - mr r4,r12 /* Pass SRR0 as arg2 */ - li r5,0 /* Pass zero as arg3 */ - EXC_XFER_EE_LITE(0x0400, handle_page_fault) + INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) /* Alignment Interrupt */ - START_EXCEPTION(Alignment) - NORMAL_EXCEPTION_PROLOG - mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ - stw r4,_DEAR(r11) - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_EE(0x0600, AlignmentException) + ALIGNMENT_EXCEPTION /* Program Interrupt */ - START_EXCEPTION(Program) - NORMAL_EXCEPTION_PROLOG - mfspr r4,SPRN_ESR /* Grab the ESR and save it */ - stw r4,_ESR(r11) - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_STD(0x700, ProgramCheckException) + PROGRAM_EXCEPTION /* Floating Point Unavailable Interrupt */ EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) @@ -451,12 +437,7 @@ interrupt_base: EXCEPTION(0x2020, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) /* Decrementer Interrupt */ - START_EXCEPTION(Decrementer) - NORMAL_EXCEPTION_PROLOG - lis r0,TSR_DIS@h /* Setup the DEC interrupt mask */ - mtspr SPRN_TSR,r0 /* Clear the DEC interrupt */ - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_LITE(0x1000, timer_interrupt) + DECREMENTER_EXCEPTION /* Fixed Internal Timer Interrupt */ /* TODO: Add FIT support */ @@ -599,64 +580,8 @@ interrupt_base: mfspr r10, SPRG0 b InstructionStorage -/* Check for a single step debug exception while in an exception - * handler before state has been saved. This is to catch the case - * where an instruction that we are trying to single step causes - * an exception (eg ITLB/DTLB miss) and thus the first instruction of - * the exception handler generates a single step debug exception. - * - * If we get a debug trap on the first instruction of an exception handler, - * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is - * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). - * The exception handler was handling a non-critical interrupt, so it will - * save (and later restore) the MSR via SPRN_SRR1, which will still have - * the MSR_DE bit set. - */ /* Debug Interrupt */ - START_EXCEPTION(Debug) - CRITICAL_EXCEPTION_PROLOG - - /* - * If this is a single step or branch-taken exception in an - * exception entry sequence, it was probably meant to apply to - * the code where the exception occurred (since exception entry - * doesn't turn off DE automatically). We simulate the effect - * of turning off DE on entry to an exception handler by turning - * off DE in the CSRR1 value and clearing the debug status. - */ - mfspr r10,SPRN_DBSR /* check single-step/branch taken */ - andis. r10,r10,(DBSR_IC|DBSR_BT)@h - beq+ 1f - andi. r0,r9,MSR_PR /* check supervisor */ - beq 2f /* branch if we need to fix it up... */ - - /* continue normal handling for a critical exception... */ -1: mfspr r4,SPRN_DBSR - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_TEMPLATE(DebugException, 0x2002, \ - (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ - NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) - - /* here it looks like we got an inappropriate debug exception. */ -2: rlwinm r9,r9,0,~MSR_DE /* clear DE in the CSRR1 value */ - mtspr SPRN_DBSR,r10 /* clear the IC/BT debug intr status */ - /* restore state and get out */ - lwz r10,_CCR(r11) - lwz r0,GPR0(r11) - lwz r1,GPR1(r11) - mtcrf 0x80,r10 - mtspr CSRR0,r12 - mtspr CSRR1,r9 - lwz r9,GPR9(r11) - - mtspr SPRG2,r8; /* SPRG2 only used in criticals */ - lis r8,crit_save@ha; - lwz r10,crit_r10@l(r8) - lwz r11,crit_r11@l(r8) - mfspr r8,SPRG2 - - rfci - b . + DEBUG_EXCEPTION /* * Local functions diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S index 5a8933688..f2b0f9f1b 100644 --- a/arch/ppc/kernel/head_4xx.S +++ b/arch/ppc/kernel/head_4xx.S @@ -709,8 +709,20 @@ label: EXCEPTION(0x1E00, Trap_1E, UnknownException, EXC_XFER_EE) EXCEPTION(0x1F00, Trap_1F, UnknownException, EXC_XFER_EE) -/* 0x2000 - Debug Exception -*/ +/* Check for a single step debug exception while in an exception + * handler before state has been saved. This is to catch the case + * where an instruction that we are trying to single step causes + * an exception (eg ITLB/DTLB miss) and thus the first instruction of + * the exception handler generates a single step debug exception. + * + * If we get a debug trap on the first instruction of an exception handler, + * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is + * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). + * The exception handler was handling a non-critical interrupt, so it will + * save (and later restore) the MSR via SPRN_SRR1, which will still have + * the MSR_DE bit set. + */ + /* 0x2000 - Debug Exception */ START_EXCEPTION(0x2000, DebugTrap) CRITICAL_EXCEPTION_PROLOG @@ -723,21 +735,20 @@ label: * off DE in the SRR3 value and clearing the debug status. */ mfspr r10,SPRN_DBSR /* check single-step/branch taken */ - andis. r10,r10,(DBSR_IC|DBSR_BT)@h - beq+ 1f - andi. r0,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */ - beq 2f /* branch if we need to fix it up... */ + andis. r10,r10,DBSR_IC@h + beq+ 2f - /* continue normal handling for a critical exception... */ -1: mfspr r4,SPRN_DBSR - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_TEMPLATE(DebugException, 0x2002, \ - (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ - NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) + andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */ + beq 1f /* branch and fix it up */ + + mfspr r10,SPRN_SRR2 /* Faulting instruction address */ + cmplwi r10,0x2100 + bgt+ 2f /* address above exception vectors */ /* here it looks like we got an inappropriate debug exception. */ -2: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */ - mtspr SPRN_DBSR,r10 /* clear the IC/BT debug intr status */ +1: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */ + lis r10,DBSR_IC@h /* clear the IC event */ + mtspr SPRN_DBSR,r10 /* restore state and get out */ lwz r10,_CCR(r11) lwz r0,GPR0(r11) @@ -753,6 +764,13 @@ label: rfci b . + /* continue normal handling for a critical exception... */ +2: mfspr r4,SPRN_DBSR + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_TEMPLATE(DebugException, 0x2002, \ + (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ + NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) + /* * The other Data TLB exceptions bail out to this point * if they can't resolve the lightweight TLB fault. diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S index cfcd6e122..db3b53094 100644 --- a/arch/ppc/kernel/head_8xx.S +++ b/arch/ppc/kernel/head_8xx.S @@ -32,14 +32,18 @@ #include #include +/* Macro to make the code more readable. */ +#ifdef CONFIG_8xx_CPU6 +#define DO_8xx_CPU6(val, reg) \ + li reg, val; \ + stw reg, 12(r0); \ + lwz reg, 12(r0); +#else +#define DO_8xx_CPU6(val, reg) +#endif .text .globl _stext _stext: - -/* - * _start is defined this way because the XCOFF loader in the OpenFirmware - * on the powermac expects the entry point to be a procedure descriptor. - */ .text .globl _start _start: @@ -77,7 +81,6 @@ _start: * and the CCR at memory location 0.....Someday I'll fix this..... * -- Dan */ - .globl __start __start: mr r31,r3 /* save parameters */ @@ -85,7 +88,6 @@ __start: mr r29,r5 mr r28,r6 mr r27,r7 - li r24,0 /* cpu # */ /* We have to turn on the MMU right away so we get cache modes * set correctly. @@ -113,63 +115,106 @@ turn_on_mmu: * task's thread_struct. */ #define EXCEPTION_PROLOG \ - mtspr SPRG0,r20; \ - mtspr SPRG1,r21; \ - mfcr r20; \ - mfspr r21,SPRG2; /* exception stack to use from */ \ - cmpwi 0,r21,0; /* user mode or RTAS */ \ - bne 1f; \ - tophys(r21,r1); /* use tophys(kernel sp) otherwise */ \ - subi r21,r21,INT_FRAME_SIZE; /* alloc exc. frame */\ -1: stw r20,_CCR(r21); /* save registers */ \ - stw r22,GPR22(r21); \ - stw r23,GPR23(r21); \ - mfspr r20,SPRG0; \ - stw r20,GPR20(r21); \ - mfspr r22,SPRG1; \ - stw r22,GPR21(r21); \ - mflr r20; \ - stw r20,_LINK(r21); \ - mfctr r22; \ - stw r22,_CTR(r21); \ - mfspr r20,XER; \ - stw r20,_XER(r21); \ - mfspr r22,SRR0; \ - mfspr r23,SRR1; \ - stw r0,GPR0(r21); \ - stw r1,GPR1(r21); \ - stw r2,GPR2(r21); \ - stw r1,0(r21); \ - tovirt(r1,r21); /* set new kernel sp */ \ - SAVE_4GPRS(3, r21); \ - SAVE_GPR(7, r21); + mtspr SPRG0,r10; \ + mtspr SPRG1,r11; \ + mfcr r10; \ + EXCEPTION_PROLOG_1; \ + EXCEPTION_PROLOG_2 + +#define EXCEPTION_PROLOG_1 \ + mfspr r11,SRR1; /* check whether user or kernel */ \ + andi. r11,r11,MSR_PR; \ + tophys(r11,r1); /* use tophys(r1) if kernel */ \ + beq 1f; \ + mfspr r11,SPRG3; \ + lwz r11,THREAD_INFO-THREAD(r11); \ + addi r11,r11,THREAD_SIZE; \ + tophys(r11,r11); \ +1: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */ + + +#define EXCEPTION_PROLOG_2 \ + CLR_TOP32(r11); \ + stw r10,_CCR(r11); /* save registers */ \ + stw r12,GPR12(r11); \ + stw r9,GPR9(r11); \ + mfspr r10,SPRG0; \ + stw r10,GPR10(r11); \ + mfspr r12,SPRG1; \ + stw r12,GPR11(r11); \ + mflr r10; \ + stw r10,_LINK(r11); \ + mfspr r12,SRR0; \ + mfspr r9,SRR1; \ + stw r1,GPR1(r11); \ + stw r1,0(r11); \ + tovirt(r1,r11); /* set new kernel sp */ \ + li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \ + MTMSRD(r10); /* (except for mach check in rtas) */ \ + stw r0,GPR0(r11); \ + SAVE_4GPRS(3, r11); \ + SAVE_2GPRS(7, r11) + /* * Note: code which follows this uses cr0.eq (set if from kernel), - * r21, r22 (SRR0), and r23 (SRR1). + * r11, r12 (SRR0), and r9 (SRR1). + * + * Note2: once we have set r1 we are in a position to take exceptions + * again, and we could thus set MSR:RI at that point. */ /* * Exception vectors. */ -#define STD_EXCEPTION(n, label, hdlr) \ +#define EXCEPTION(n, label, hdlr, xfer) \ . = n; \ label: \ EXCEPTION_PROLOG; \ addi r3,r1,STACK_FRAME_OVERHEAD; \ - li r20,MSR_KERNEL; \ - bl transfer_to_handler; \ - .long hdlr; \ - .long ret_from_except + xfer(n, hdlr) + +#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \ + li r10,trap; \ + stw r10,TRAP(r11); \ + li r10,MSR_KERNEL; \ + copyee(r10, r9); \ + bl tfer; \ +i##n: \ + .long hdlr; \ + .long ret + +#define COPY_EE(d, s) rlwimi d,s,0,16,16 +#define NOCOPY(d, s) + +#define EXC_XFER_STD(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \ + ret_from_except_full) + +#define EXC_XFER_LITE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ + ret_from_except) + +#define EXC_XFER_EE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \ + ret_from_except_full) + +#define EXC_XFER_EE_LITE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \ + ret_from_except) /* System reset */ -#ifdef CONFIG_SMP /* MVME/MTX start the secondary here */ - STD_EXCEPTION(0x100, Reset, __secondary_start_psurge) -#else - STD_EXCEPTION(0x100, Reset, UnknownException) -#endif + EXCEPTION(0x100, Reset, UnknownException, EXC_XFER_STD) /* Machine check */ - STD_EXCEPTION(0x200, MachineCheck, MachineCheckException) + . = 0x200 +MachineCheck: + EXCEPTION_PROLOG + mfspr r4,DAR + stw r4,_DAR(r11) + mfspr r5,DSISR + stw r5,_DSISR(r11) + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_STD(0x200, MachineCheckException) /* Data access exception. * This is "never generated" by the MPC8xx. We jump to it for other @@ -178,17 +223,11 @@ label: \ . = 0x300 DataAccess: EXCEPTION_PROLOG - mfspr r20,DSISR - stw r20,_DSISR(r21) - mr r5,r20 + mfspr r10,DSISR + stw r10,_DSISR(r11) + mr r5,r10 mfspr r4,DAR - stw r4,_DAR(r21) - addi r3,r1,STACK_FRAME_OVERHEAD - li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long do_page_fault - .long ret_from_except + EXC_XFER_EE_LITE(0x300, handle_page_fault) /* Instruction access exception. * This is "never generated" by the MPC8xx. We jump to it for other @@ -197,94 +236,52 @@ DataAccess: . = 0x400 InstructionAccess: EXCEPTION_PROLOG - addi r3,r1,STACK_FRAME_OVERHEAD - mr r4,r22 - mr r5,r23 - li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long do_page_fault - .long ret_from_except + mr r4,r12 + mr r5,r9 + EXC_XFER_EE_LITE(0x400, handle_page_fault) /* External interrupt */ - . = 0x500; -HardwareInterrupt: - EXCEPTION_PROLOG; - addi r3,r1,STACK_FRAME_OVERHEAD - li r20,MSR_KERNEL - li r4,0 - bl transfer_to_handler - .globl do_IRQ_intercept -do_IRQ_intercept: - .long do_IRQ; - .long ret_from_intercept - + EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) /* Alignment exception */ . = 0x600 Alignment: EXCEPTION_PROLOG mfspr r4,DAR - stw r4,_DAR(r21) + stw r4,_DAR(r11) mfspr r5,DSISR - stw r5,_DSISR(r21) + stw r5,_DSISR(r11) addi r3,r1,STACK_FRAME_OVERHEAD - li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long AlignmentException - .long ret_from_except + EXC_XFER_EE(0x600, AlignmentException) /* Program check exception */ - . = 0x700 -ProgramCheck: - EXCEPTION_PROLOG - addi r3,r1,STACK_FRAME_OVERHEAD - li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long ProgramCheckException - .long ret_from_except + EXCEPTION(0x700, ProgramCheck, ProgramCheckException, EXC_XFER_STD) /* No FPU on MPC8xx. This exception is not supposed to happen. */ - STD_EXCEPTION(0x800, FPUnavailable, UnknownException) + EXCEPTION(0x800, FPUnavailable, UnknownException, EXC_XFER_STD) - . = 0x900 -Decrementer: - EXCEPTION_PROLOG - addi r3,r1,STACK_FRAME_OVERHEAD - li r20,MSR_KERNEL - bl transfer_to_handler - .globl timer_interrupt_intercept -timer_interrupt_intercept: - .long timer_interrupt - .long ret_from_intercept +/* Decrementer */ + EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) - STD_EXCEPTION(0xa00, Trap_0a, UnknownException) - STD_EXCEPTION(0xb00, Trap_0b, UnknownException) + EXCEPTION(0xa00, Trap_0a, UnknownException, EXC_XFER_EE) + EXCEPTION(0xb00, Trap_0b, UnknownException, EXC_XFER_EE) /* System call */ . = 0xc00 SystemCall: EXCEPTION_PROLOG - stw r3,ORIG_GPR3(r21) - li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long DoSyscall - .long ret_from_except + EXC_XFER_EE_LITE(0xc00, DoSyscall) /* Single step - not used on 601 */ - STD_EXCEPTION(0xd00, SingleStep, SingleStepException) - - STD_EXCEPTION(0xe00, Trap_0e, UnknownException) - STD_EXCEPTION(0xf00, Trap_0f, UnknownException) + EXCEPTION(0xd00, SingleStep, SingleStepException, EXC_XFER_STD) + EXCEPTION(0xe00, Trap_0e, UnknownException, EXC_XFER_EE) + EXCEPTION(0xf00, Trap_0f, UnknownException, EXC_XFER_EE) /* On the MPC8xx, this is a software emulation interrupt. It occurs * for all unimplemented and illegal instructions. */ - STD_EXCEPTION(0x1000, SoftEmu, SoftwareEmulation) + EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD) . = 0x1100 /* @@ -302,58 +299,43 @@ SystemCall: InstructionTLBMiss: #ifdef CONFIG_8xx_CPU6 stw r3, 8(r0) - li r3, 0x3f80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr M_TW, r20 /* Save a couple of working registers */ - mfcr r20 - stw r20, 0(r0) - stw r21, 4(r0) - mfspr r20, SRR0 /* Get effective address of fault */ -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3780 - stw r3, 12(r0) - lwz r3, 12(r0) #endif - mtspr MD_EPN, r20 /* Have to use MD_EPN for walk, MI_EPN can't */ - mfspr r20, M_TWB /* Get level 1 table entry address */ + DO_8xx_CPU6(0x3f80, r3) + mtspr M_TW, r10 /* Save a couple of working registers */ + mfcr r10 + stw r10, 0(r0) + stw r11, 4(r0) + mfspr r10, SRR0 /* Get effective address of fault */ + DO_8xx_CPU6(0x3780, r3) + mtspr MD_EPN, r10 /* Have to use MD_EPN for walk, MI_EPN can't */ + mfspr r10, M_TWB /* Get level 1 table entry address */ /* If we are faulting a kernel address, we have to use the * kernel page tables. */ - andi. r21, r20, 0x0800 /* Address >= 0x80000000 */ + andi. r11, r10, 0x0800 /* Address >= 0x80000000 */ beq 3f - lis r21, swapper_pg_dir@h - ori r21, r21, swapper_pg_dir@l - rlwimi r20, r21, 0, 2, 19 + lis r11, swapper_pg_dir@h + ori r11, r11, swapper_pg_dir@l + rlwimi r10, r11, 0, 2, 19 3: - lwz r21, 0(r20) /* Get the level 1 entry */ - rlwinm. r20, r21,0,0,19 /* Extract page descriptor page address */ + lwz r11, 0(r10) /* Get the level 1 entry */ + rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ beq 2f /* If zero, don't try to find a pte */ /* We have a pte table, so load the MI_TWC with the attributes * for this "segment." */ - tophys(r21,r21) - ori r21,r21,1 /* Set valid bit */ -#ifdef CONFIG_8xx_CPU6 - li r3, 0x2b80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MI_TWC, r21 /* Set segment attributes */ -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3b80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_TWC, r21 /* Load pte table base address */ - mfspr r21, MD_TWC /* ....and get the pte address */ - lwz r20, 0(r21) /* Get the pte */ + ori r11,r11,1 /* Set valid bit */ + DO_8xx_CPU6(0x2b80, r3) + mtspr MI_TWC, r11 /* Set segment attributes */ + DO_8xx_CPU6(0x3b80, r3) + mtspr MD_TWC, r11 /* Load pte table base address */ + mfspr r11, MD_TWC /* ....and get the pte address */ + lwz r10, 0(r11) /* Get the pte */ - ori r20, r20, _PAGE_ACCESSED - stw r20, 0(r21) + ori r10, r10, _PAGE_ACCESSED + stw r10, 0(r11) /* The Linux PTE won't go exactly into the MMU TLB. * Software indicator bits 21, 22 and 28 must be clear. @@ -361,73 +343,52 @@ InstructionTLBMiss: * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x00f0 - rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ - -#ifdef CONFIG_8xx_CPU6 - li r3, 0x2d80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MI_RPN, r20 /* Update TLB entry */ - - mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) +2: li r11, 0x00f0 + rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ + DO_8xx_CPU6(0x2d80, r3) + mtspr MI_RPN, r10 /* Update TLB entry */ + + mfspr r10, M_TW /* Restore registers */ + lwz r11, 0(r0) + mtcr r11 + lwz r11, 4(r0) #ifdef CONFIG_8xx_CPU6 lwz r3, 8(r0) #endif rfi -2: mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) -#ifdef CONFIG_8xx_CPU6 - lwz r3, 8(r0) -#endif - b InstructionAccess - . = 0x1200 DataStoreTLBMiss: #ifdef CONFIG_8xx_CPU6 stw r3, 8(r0) - li r3, 0x3f80 - stw r3, 12(r0) - lwz r3, 12(r0) #endif - mtspr M_TW, r20 /* Save a couple of working registers */ - mfcr r20 - stw r20, 0(r0) - stw r21, 4(r0) - mfspr r20, M_TWB /* Get level 1 table entry address */ + DO_8xx_CPU6(0x3f80, r3) + mtspr M_TW, r10 /* Save a couple of working registers */ + mfcr r10 + stw r10, 0(r0) + stw r11, 4(r0) + mfspr r10, M_TWB /* Get level 1 table entry address */ /* If we are faulting a kernel address, we have to use the * kernel page tables. */ - andi. r21, r20, 0x0800 + andi. r11, r10, 0x0800 beq 3f - lis r21, swapper_pg_dir@h - ori r21, r21, swapper_pg_dir@l - rlwimi r20, r21, 0, 2, 19 + lis r11, swapper_pg_dir@h + ori r11, r11, swapper_pg_dir@l + rlwimi r10, r11, 0, 2, 19 3: - lwz r21, 0(r20) /* Get the level 1 entry */ - rlwinm. r20, r21,0,0,19 /* Extract page descriptor page address */ + lwz r11, 0(r10) /* Get the level 1 entry */ + rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ beq 2f /* If zero, don't try to find a pte */ /* We have a pte table, so load fetch the pte from the table. */ - tophys(r21, r21) - ori r21, r21, 1 /* Set valid bit in physical L2 page */ -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3b80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_TWC, r21 /* Load pte table base address */ - mfspr r20, MD_TWC /* ....and get the pte address */ - lwz r20, 0(r20) /* Get the pte */ + ori r11, r11, 1 /* Set valid bit in physical L2 page */ + DO_8xx_CPU6(0x3b80, r3) + mtspr MD_TWC, r11 /* Load pte table base address */ + mfspr r10, MD_TWC /* ....and get the pte address */ + lwz r10, 0(r10) /* Get the pte */ /* Insert the Guarded flag into the TWC from the Linux PTE. * It is bit 27 of both the Linux PTE and the TWC (at least @@ -435,17 +396,13 @@ DataStoreTLBMiss: * this into the Linux pgd/pmd and load it in the operation * above. */ - rlwimi r21, r20, 0, 27, 27 -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3b80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_TWC, r21 + rlwimi r11, r10, 0, 27, 27 + DO_8xx_CPU6(0x3b80, r3) + mtspr MD_TWC, r11 - mfspr r21, MD_TWC /* get the pte address again */ - ori r20, r20, _PAGE_ACCESSED - stw r20, 0(r21) + mfspr r11, MD_TWC /* get the pte address again */ + ori r10, r10, _PAGE_ACCESSED + stw r10, 0(r11) /* The Linux PTE won't go exactly into the MMU TLB. * Software indicator bits 21, 22 and 28 must be clear. @@ -453,34 +410,20 @@ DataStoreTLBMiss: * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x00f0 - rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ - -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3d80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_RPN, r20 /* Update TLB entry */ - - mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) +2: li r11, 0x00f0 + rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ + DO_8xx_CPU6(0x3d80, r3) + mtspr MD_RPN, r10 /* Update TLB entry */ + + mfspr r10, M_TW /* Restore registers */ + lwz r11, 0(r0) + mtcr r11 + lwz r11, 4(r0) #ifdef CONFIG_8xx_CPU6 lwz r3, 8(r0) #endif rfi -2: mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) -#ifdef CONFIG_8xx_CPU6 - lwz r3, 8(r0) -#endif - b DataAccess - /* This is an instruction TLB error on the MPC8xx. This could be due * to many reasons, such as executing guarded memory or illegal instruction * addresses. There is nothing to do but handle a big time error fault. @@ -501,19 +444,17 @@ InstructionTLBError: DataTLBError: #ifdef CONFIG_8xx_CPU6 stw r3, 8(r0) - li r3, 0x3f80 - stw r3, 12(r0) - lwz r3, 12(r0) #endif - mtspr M_TW, r20 /* Save a couple of working registers */ - mfcr r20 - stw r20, 0(r0) - stw r21, 4(r0) + DO_8xx_CPU6(0x3f80, r3) + mtspr M_TW, r10 /* Save a couple of working registers */ + mfcr r10 + stw r10, 0(r0) + stw r11, 4(r0) /* First, make sure this was a store operation. */ - mfspr r20, DSISR - andis. r21, r20, 0x0200 /* If set, indicates store op */ + mfspr r10, DSISR + andis. r11, r10, 0x0200 /* If set, indicates store op */ beq 2f /* The EA of a data TLB miss is automatically stored in the MD_EPN @@ -532,54 +473,45 @@ DataTLBError: * are initialized in mapin_ram(). This will avoid the problem, * assuming we only use the dcbi instruction on kernel addresses. */ - mfspr r20, DAR - rlwinm r21, r20, 0, 0, 19 - ori r21, r21, MD_EVALID - mfspr r20, M_CASID - rlwimi r21, r20, 0, 28, 31 -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3780 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_EPN, r21 + mfspr r10, DAR + rlwinm r11, r10, 0, 0, 19 + ori r11, r11, MD_EVALID + mfspr r10, M_CASID + rlwimi r11, r10, 0, 28, 31 + DO_8xx_CPU6(0x3780, r3) + mtspr MD_EPN, r11 - mfspr r20, M_TWB /* Get level 1 table entry address */ + mfspr r10, M_TWB /* Get level 1 table entry address */ /* If we are faulting a kernel address, we have to use the * kernel page tables. */ - andi. r21, r20, 0x0800 + andi. r11, r10, 0x0800 beq 3f - lis r21, swapper_pg_dir@h - ori r21, r21, swapper_pg_dir@l - rlwimi r20, r21, 0, 2, 19 + lis r11, swapper_pg_dir@h + ori r11, r11, swapper_pg_dir@l + rlwimi r10, r11, 0, 2, 19 3: - lwz r21, 0(r20) /* Get the level 1 entry */ - rlwinm. r20, r21,0,0,19 /* Extract page descriptor page address */ + lwz r11, 0(r10) /* Get the level 1 entry */ + rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ beq 2f /* If zero, bail */ /* We have a pte table, so fetch the pte from the table. */ - tophys(r21, r21) - ori r21, r21, 1 /* Set valid bit in physical L2 page */ -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3b80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_TWC, r21 /* Load pte table base address */ - mfspr r21, MD_TWC /* ....and get the pte address */ - lwz r20, 0(r21) /* Get the pte */ + ori r11, r11, 1 /* Set valid bit in physical L2 page */ + DO_8xx_CPU6(0x3b80, r3) + mtspr MD_TWC, r11 /* Load pte table base address */ + mfspr r11, MD_TWC /* ....and get the pte address */ + lwz r10, 0(r11) /* Get the pte */ - andi. r21, r20, _PAGE_RW /* Is it writeable? */ + andi. r11, r10, _PAGE_RW /* Is it writeable? */ beq 2f /* Bail out if not */ /* Update 'changed', among others. */ - ori r20, r20, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE - mfspr r21, MD_TWC /* Get pte address again */ - stw r20, 0(r21) /* and update pte in table */ + ori r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE + mfspr r11, MD_TWC /* Get pte address again */ + stw r10, 0(r11) /* and update pte in table */ /* The Linux PTE won't go exactly into the MMU TLB. * Software indicator bits 21, 22 and 28 must be clear. @@ -587,50 +519,45 @@ DataTLBError: * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x00f0 - rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ - -#ifdef CONFIG_8xx_CPU6 - li r3, 0x3d80 - stw r3, 12(r0) - lwz r3, 12(r0) -#endif - mtspr MD_RPN, r20 /* Update TLB entry */ - - mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) + li r11, 0x00f0 + rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ + DO_8xx_CPU6(0x3d80, r3) + mtspr MD_RPN, r10 /* Update TLB entry */ + + mfspr r10, M_TW /* Restore registers */ + lwz r11, 0(r0) + mtcr r11 + lwz r11, 4(r0) #ifdef CONFIG_8xx_CPU6 lwz r3, 8(r0) #endif rfi 2: - mfspr r20, M_TW /* Restore registers */ - lwz r21, 0(r0) - mtcr r21 - lwz r21, 4(r0) + mfspr r10, M_TW /* Restore registers */ + lwz r11, 0(r0) + mtcr r11 + lwz r11, 4(r0) #ifdef CONFIG_8xx_CPU6 lwz r3, 8(r0) #endif b DataAccess - STD_EXCEPTION(0x1500, Trap_15, UnknownException) - STD_EXCEPTION(0x1600, Trap_16, UnknownException) - STD_EXCEPTION(0x1700, Trap_17, TAUException) - STD_EXCEPTION(0x1800, Trap_18, UnknownException) - STD_EXCEPTION(0x1900, Trap_19, UnknownException) - STD_EXCEPTION(0x1a00, Trap_1a, UnknownException) - STD_EXCEPTION(0x1b00, Trap_1b, UnknownException) + EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1600, Trap_16, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1700, Trap_17, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1800, Trap_18, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1900, Trap_19, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1a00, Trap_1a, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1b00, Trap_1b, UnknownException, EXC_XFER_EE) /* On the MPC8xx, these next four traps are used for development * support of breakpoints and such. Someday I will get around to * using them. */ - STD_EXCEPTION(0x1c00, Trap_1c, UnknownException) - STD_EXCEPTION(0x1d00, Trap_1d, UnknownException) - STD_EXCEPTION(0x1e00, Trap_1e, UnknownException) - STD_EXCEPTION(0x1f00, Trap_1f, UnknownException) + EXCEPTION(0x1c00, Trap_1c, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1d00, Trap_1d, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1e00, Trap_1e, UnknownException, EXC_XFER_EE) + EXCEPTION(0x1f00, Trap_1f, UnknownException, EXC_XFER_EE) . = 0x2000 @@ -638,11 +565,6 @@ DataTLBError: giveup_fpu: blr -/* Maybe someday....... -*/ -_GLOBAL(__setup_cpu_8xx) - blr - /* * This is where the main kernel code starts. */ diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h index 6f54039c8..618b469ac 100644 --- a/arch/ppc/kernel/head_booke.h +++ b/arch/ppc/kernel/head_booke.h @@ -237,4 +237,103 @@ label: ret_from_except) +/* Check for a single step debug exception while in an exception + * handler before state has been saved. This is to catch the case + * where an instruction that we are trying to single step causes + * an exception (eg ITLB/DTLB miss) and thus the first instruction of + * the exception handler generates a single step debug exception. + * + * If we get a debug trap on the first instruction of an exception handler, + * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is + * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). + * The exception handler was handling a non-critical interrupt, so it will + * save (and later restore) the MSR via SPRN_CSRR1, which will still have + * the MSR_DE bit set. + */ +#define DEBUG_EXCEPTION \ + START_EXCEPTION(Debug); \ + CRITICAL_EXCEPTION_PROLOG; \ + \ + /* \ + * If there is a single step or branch-taken exception in an \ + * exception entry sequence, it was probably meant to apply to \ + * the code where the exception occurred (since exception entry \ + * doesn't turn off DE automatically). We simulate the effect \ + * of turning off DE on entry to an exception handler by turning \ + * off DE in the CSRR1 value and clearing the debug status. \ + */ \ + mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \ + andis. r10,r10,DBSR_IC@h; \ + beq+ 2f; \ + \ + lis r10,KERNELBASE@h; /* check if exception in vectors */ \ + ori r10,r10,KERNELBASE@l; \ + cmplw r12,r10; \ + blt+ 2f; /* addr below exception vectors */ \ + \ + lis r10,Debug@h; \ + ori r10,r10,Debug@l; \ + cmplw r12,r10; \ + bgt+ 2f; /* addr above exception vectors */ \ + \ + /* here it looks like we got an inappropriate debug exception. */ \ +1: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \ + lis r10,DBSR_IC@h; /* clear the IC event */ \ + mtspr SPRN_DBSR,r10; \ + /* restore state and get out */ \ + lwz r10,_CCR(r11); \ + lwz r0,GPR0(r11); \ + lwz r1,GPR1(r11); \ + mtcrf 0x80,r10; \ + mtspr CSRR0,r12; \ + mtspr CSRR1,r9; \ + lwz r9,GPR9(r11); \ + lwz r12,GPR12(r11); \ + mtspr SPRG2,r8; /* SPRG2 only used in criticals */ \ + lis r8,crit_save@ha; \ + lwz r10,crit_r10@l(r8); \ + lwz r11,crit_r11@l(r8); \ + mfspr r8,SPRG2; \ + \ + rfci; \ + b .; \ + \ + /* continue normal handling for a critical exception... */ \ +2: mfspr r4,SPRN_DBSR; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) + +#define INSTRUCTION_STORAGE_EXCEPTION \ + START_EXCEPTION(InstructionStorage) \ + NORMAL_EXCEPTION_PROLOG; \ + mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \ + stw r5,_ESR(r11); \ + mr r4,r12; /* Pass SRR0 as arg2 */ \ + li r5,0; /* Pass zero as arg3 */ \ + EXC_XFER_EE_LITE(0x0400, handle_page_fault) + +#define ALIGNMENT_EXCEPTION \ + START_EXCEPTION(Alignment) \ + NORMAL_EXCEPTION_PROLOG; \ + mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \ + stw r4,_DEAR(r11); \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_EE(0x0600, AlignmentException) + +#define PROGRAM_EXCEPTION \ + START_EXCEPTION(Program) \ + NORMAL_EXCEPTION_PROLOG; \ + mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \ + stw r4,_ESR(r11); \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_STD(0x0700, ProgramCheckException) + +#define DECREMENTER_EXCEPTION \ + START_EXCEPTION(Decrementer) \ + NORMAL_EXCEPTION_PROLOG; \ + lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \ + mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_LITE(0x0900, timer_interrupt) + #endif /* __HEAD_BOOKE_H__ */ diff --git a/arch/ppc/kernel/head_e500.S b/arch/ppc/kernel/head_e500.S index cf964198e..47a35214f 100644 --- a/arch/ppc/kernel/head_e500.S +++ b/arch/ppc/kernel/head_e500.S @@ -119,7 +119,7 @@ invstr: mflr r6 /* Make it accessible */ tlbsx 0,r6 /* Fall through, we had to match */ match_TLB: mfspr r7,SPRN_MAS0 - rlwinm r3,r7,16,28,31 /* Extract MAS0(Entry) */ + rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ mfspr r7,SPRN_MAS1 /* Insure IPROT set */ oris r7,r7,MAS1_IPROT@h @@ -131,7 +131,7 @@ match_TLB: andi. r9,r9,0xfff li r6,0 /* Set Entry counter to 0 */ 1: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ - rlwimi r7,r6,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */ + rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */ mtspr SPRN_MAS0,r7 tlbre mfspr r7,SPRN_MAS1 @@ -163,13 +163,13 @@ skpinv: addi r6,r6,1 /* Increment */ andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */ addi r5, r5, 0x1 lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ - rlwimi r7,r3,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ + rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ mtspr SPRN_MAS0,r7 tlbre /* Just modify the entry ID and EPN for the temp mapping */ lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ - rlwimi r7,r5,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ + rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ mtspr SPRN_MAS0,r7 xori r6,r4,1 /* Setup TMP mapping in the other Address space */ slwi r6,r6,12 @@ -201,7 +201,7 @@ skpinv: addi r6,r6,1 /* Increment */ /* 5. Invalidate mapping we started in */ lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ - rlwimi r7,r3,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ + rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ mtspr SPRN_MAS0,r7 tlbre li r6,0 @@ -242,7 +242,7 @@ skpinv: addi r6,r6,1 /* Increment */ /* 8. Clear out the temp mapping */ lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ - rlwimi r7,r5,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ + rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ mtspr SPRN_MAS0,r7 tlbre mtspr SPRN_MAS1,r8 @@ -282,7 +282,7 @@ skpinv: addi r6,r6,1 /* Increment */ mtspr SPRN_IVPR,r4 /* Setup the defaults for TLB entries */ - li r2,MAS4_TSIZED(BOOKE_PAGESZ_4K) + li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l mtspr SPRN_MAS4, r2 #if 0 @@ -464,32 +464,16 @@ interrupt_base: b data_access /* Instruction Storage Interrupt */ - START_EXCEPTION(InstructionStorage) - NORMAL_EXCEPTION_PROLOG - mfspr r5,SPRN_ESR /* Grab the ESR and save it */ - stw r5,_ESR(r11) - mr r4,r12 /* Pass SRR0 as arg2 */ - li r5,0 /* Pass zero as arg3 */ - EXC_XFER_EE_LITE(0x0400, handle_page_fault) + INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) /* Alignment Interrupt */ - START_EXCEPTION(Alignment) - NORMAL_EXCEPTION_PROLOG - mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ - stw r4,_DEAR(r11) - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_EE(0x0600, AlignmentException) + ALIGNMENT_EXCEPTION /* Program Interrupt */ - START_EXCEPTION(Program) - NORMAL_EXCEPTION_PROLOG - mfspr r4,SPRN_ESR /* Grab the ESR and save it */ - stw r4,_ESR(r11) - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_STD(0x0700, ProgramCheckException) + PROGRAM_EXCEPTION /* Floating Point Unavailable Interrupt */ EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) @@ -503,12 +487,7 @@ interrupt_base: EXCEPTION(0x2900, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) /* Decrementer Interrupt */ - START_EXCEPTION(Decrementer) - NORMAL_EXCEPTION_PROLOG - lis r0,TSR_DIS@h /* Setup the DEC interrupt mask */ - mtspr SPRN_TSR,r0 /* Clear the DEC interrupt */ - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_LITE(0x0900, timer_interrupt) + DECREMENTER_EXCEPTION /* Fixed Internal Timer Interrupt */ /* TODO: Add FIT support */ @@ -539,8 +518,7 @@ interrupt_base: ori r11, r11, swapper_pg_dir@l mfspr r12,SPRN_MAS1 /* Set TID to 0 */ - li r13,MAS1_TID@l - andc r12,r12,r13 + rlwinm r12,r12,0,16,1 mtspr SPRN_MAS1,r12 b 4f @@ -604,8 +582,7 @@ interrupt_base: ori r11, r11, swapper_pg_dir@l mfspr r12,SPRN_MAS1 /* Set TID to 0 */ - li r13,MAS1_TID@l - andc r12,r12,r13 + rlwinm r12,r12,0,16,1 mtspr SPRN_MAS1,r12 b 4f @@ -666,66 +643,11 @@ interrupt_base: EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE) /* Performance Monitor */ - EXCEPTION(0x2060, PerformanceMonitor, UnknownException, EXC_XFER_EE) + EXCEPTION(0x2060, PerformanceMonitor, PerformanceMonitorException, EXC_XFER_STD) -/* Check for a single step debug exception while in an exception - * handler before state has been saved. This is to catch the case - * where an instruction that we are trying to single step causes - * an exception (eg ITLB/DTLB miss) and thus the first instruction of - * the exception handler generates a single step debug exception. - * - * If we get a debug trap on the first instruction of an exception handler, - * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is - * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). - * The exception handler was handling a non-critical interrupt, so it will - * save (and later restore) the MSR via SPRN_SRR1, which will still have - * the MSR_DE bit set. - */ - /* Debug Interrupt */ - START_EXCEPTION(Debug) - CRITICAL_EXCEPTION_PROLOG - /* - * If this is a single step or branch-taken exception in an - * exception entry sequence, it was probably meant to apply to - * the code where the exception occurred (since exception entry - * doesn't turn off DE automatically). We simulate the effect - * of turning off DE on entry to an exception handler by turning - * off DE in the CSRR1 value and clearing the debug status. - */ - mfspr r10,SPRN_DBSR /* check single-step/branch taken */ - andis. r10,r10,(DBSR_IC|DBSR_BT)@h - beq+ 1f - andi. r0,r9,MSR_PR /* check supervisor */ - beq 2f /* branch if we need to fix it up... */ - - /* continue normal handling for a critical exception... */ -1: mfspr r4,SPRN_DBSR - addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_TEMPLATE(DebugException, 0x2002, \ - (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ - NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) - - /* here it looks like we got an inappropriate debug exception. */ -2: rlwinm r9,r9,0,~MSR_DE /* clear DE in the CSRR1 value */ - mtspr SPRN_DBSR,r10 /* clear the IC/BT debug intr status */ - /* restore state and get out */ - lwz r10,_CCR(r11) - lwz r0,GPR0(r11) - lwz r1,GPR1(r11) - mtcrf 0x80,r10 - mtspr CSRR0,r12 - mtspr CSRR1,r9 - lwz r9,GPR9(r11) - - mtspr SPRG2,r8; /* SPRG2 only used in criticals */ - lis r8,crit_save@ha; - lwz r10,crit_r10@l(r8) - lwz r11,crit_r11@l(r8) - mfspr r8,SPRG2 - - rfci - b . + /* Debug Interrupt */ + DEBUG_EXCEPTION /* * Local functions diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c index 6db80f60c..53547b6de 100644 --- a/arch/ppc/kernel/idle.c +++ b/arch/ppc/kernel/idle.c @@ -57,14 +57,13 @@ void default_idle(void) /* * The body of the idle task. */ -int cpu_idle(void) +void cpu_idle(void) { for (;;) if (ppc_md.idle != NULL) ppc_md.idle(); else default_idle(); - return 0; } #if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx) diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c index d4612e986..8843f3af2 100644 --- a/arch/ppc/kernel/irq.c +++ b/arch/ppc/kernel/irq.c @@ -47,9 +47,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -62,296 +62,20 @@ extern atomic_t ipi_recv; extern atomic_t ipi_sent; -void enable_irq(unsigned int irq_nr); -void disable_irq(unsigned int irq_nr); - -static void register_irq_proc (unsigned int irq); #define MAXCOUNT 10000000 -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .lock = SPIN_LOCK_UNLOCKED - } -}; - int ppc_spurious_interrupts = 0; struct irqaction *ppc_irq_action[NR_IRQS]; unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; atomic_t ppc_n_lost_interrupts; -/* nasty hack for shared irq's since we need to do kmalloc calls but - * can't very early in the boot when we need to do a request irq. - * this needs to be removed. - * -- Cort - */ -#define IRQ_KMALLOC_ENTRIES 8 -static int cache_bitmask = 0; -static struct irqaction malloc_cache[IRQ_KMALLOC_ENTRIES]; -extern int mem_init_done; - -#if defined(CONFIG_TAU_INT) -extern int tau_interrupts(unsigned long cpu); +#ifdef CONFIG_TAU_INT extern int tau_initialized; +extern int tau_interrupts(int); #endif -void *irq_kmalloc(size_t size, int pri) -{ - unsigned int i; - if ( mem_init_done ) - return kmalloc(size,pri); - for ( i = 0; i < IRQ_KMALLOC_ENTRIES ; i++ ) - if ( ! ( cache_bitmask & (1<flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING); - if (desc->handler) { - if (desc->handler->startup) - desc->handler->startup(irq); - else if (desc->handler->enable) - desc->handler->enable(irq); - } - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -void free_irq(unsigned int irq, void* dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - mask_irq(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - synchronize_irq(irq); - irq_kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - break; - } - return; -} - -EXPORT_SYMBOL(free_irq); - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, const char * devname, void *dev_id) -{ - struct irqaction *action; - int retval; - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) { - printk(KERN_ERR "request_irq called with NULL handler!\n"); - dump_stack(); - return 0; - } - - action = (struct irqaction *) - irq_kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if (!action) { - printk(KERN_ERR "irq_kmalloc() failed for irq %d !\n", irq); - return -ENOMEM; - } - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->dev_id = dev_id; - action->next = NULL; - - retval = setup_irq(irq, action); - if (retval) { - kfree(action); - return retval; - } - - return 0; -} - -EXPORT_SYMBOL(request_irq); - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - if (!(desc->status & IRQ_PER_CPU)) - desc->status |= IRQ_DISABLED; - mask_irq(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. That is for two disables you need two enables. This - * function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} - -/** - * enable_irq - enable interrupt handling on an irq - * @irq: Interrupt to enable - * - * Re-enables the processing of interrupts on this IRQ line - * providing no disable_irq calls are now in effect. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - unmask_irq(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced\n", irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - int show_interrupts(struct seq_file *p, void *v) { int i = *(loff_t *) v, j; @@ -411,115 +135,6 @@ skip: return 0; } -static inline void -handle_irq_event(int irq, struct pt_regs *regs, struct irqaction *action) -{ - int status = 0; - int ret; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); -} - -/* - * Eventually, this should take an array of interrupts and an array size - * so it can dispatch multiple interrupts. - */ -void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) -{ - int status; - struct irqaction *action; - irq_desc_t *desc = irq_desc + irq; - - kstat_this_cpu.irqs[irq]++; - spin_lock(&desc->lock); - ack_irq(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - if (!(status & IRQ_PER_CPU)) - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - if (!action || !action->handler) { - ppc_spurious_interrupts++; - printk(KERN_DEBUG "Unhandled interrupt %x, disabled\n", irq); - /* We can't call disable_irq here, it would deadlock */ - ++desc->depth; - desc->status |= IRQ_DISABLED; - mask_irq(irq); - /* This is a real interrupt, we have to eoi it, - so we jump to out */ - goto out; - } - status &= ~IRQ_PENDING; /* we commit to handling */ - if (!(status & IRQ_PER_CPU)) - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (unlikely(!action)) - goto out; - - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - spin_unlock(&desc->lock); - handle_irq_event(irq, regs, action); - spin_lock(&desc->lock); - - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } -out: - desc->status &= ~IRQ_INPROGRESS; - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - if (irq_desc[irq].handler) { - if (irq_desc[irq].handler->end) - irq_desc[irq].handler->end(irq); - else if (irq_desc[irq].handler->enable) - irq_desc[irq].handler->enable(irq); - } - spin_unlock(&desc->lock); -} - void do_IRQ(struct pt_regs *regs) { int irq, first = 1; @@ -534,7 +149,7 @@ void do_IRQ(struct pt_regs *regs) * has already been handled. -- Tom */ while ((irq = ppc_md.get_irq(regs)) >= 0) { - ppc_irq_dispatch_handler(regs, irq); + __do_IRQ(irq, regs); first = 0; } if (irq != -2 && first) @@ -543,143 +158,7 @@ void do_IRQ(struct pt_regs *regs) irq_exit(); } -unsigned long probe_irq_on (void) -{ - return 0; -} - -EXPORT_SYMBOL(probe_irq_on); - -int probe_irq_off (unsigned long irqs) -{ - return 0; -} - -EXPORT_SYMBOL(probe_irq_off); - -unsigned int probe_irq_mask(unsigned long irqs) -{ - return 0; -} - -#ifdef CONFIG_SMP -void synchronize_irq(unsigned int irq) -{ - while (irq_desc[irq].status & IRQ_INPROGRESS) - barrier(); -} -#endif /* CONFIG_SMP */ - -static struct proc_dir_entry *root_irq_dir; -static struct proc_dir_entry *irq_dir[NR_IRQS]; -static struct proc_dir_entry *smp_affinity_entry[NR_IRQS]; - -#ifdef CONFIG_IRQ_ALL_CPUS -#define DEFAULT_CPU_AFFINITY CPU_MASK_ALL -#else -#define DEFAULT_CPU_AFFINITY cpumask_of_cpu(0) -#endif - -cpumask_t irq_affinity [NR_IRQS]; - -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - int irq = (int) data, full_count = count, err; - cpumask_t new_value, tmp; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - * - * We assume a 1-1 logical<->physical cpu mapping here. If - * we assume that the cpu indices in /proc/irq/../smp_affinity - * are actually logical cpu #'s then we have no problem. - * -- Cort - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, new_value); - - return full_count; -} - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - struct proc_dir_entry *entry; - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == NULL) || irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - entry->nlink = 1; - entry->data = (void *)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - - smp_affinity_entry[irq] = entry; -} - -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) { - if (irq_desc[i].handler == NULL) - continue; - register_irq_proc(i); - } -} - -irqreturn_t no_action(int irq, void *dev, struct pt_regs *regs) -{ - return IRQ_NONE; -} - void __init init_IRQ(void) { - int i; - - for (i = 0; i < NR_IRQS; ++i) - irq_affinity[i] = DEFAULT_CPU_AFFINITY; - ppc_md.init_IRQ(); } diff --git a/arch/ppc/kernel/l2cr.S b/arch/ppc/kernel/l2cr.S index b362b1557..8abf2ee7a 100644 --- a/arch/ppc/kernel/l2cr.S +++ b/arch/ppc/kernel/l2cr.S @@ -45,6 +45,7 @@ #include #include #include +#include /* Usage: @@ -284,7 +285,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_L3CR) /* Tweak some bits */ rlwinm r5,r3,0,0,0 /* r5 contains the new enable bit */ rlwinm r3,r3,0,22,20 /* Turn off the invalidate bit */ - rlwinm r3,r3,0,1,31 /* Turn off the enable bit */ + rlwinm r3,r3,0,2,31 /* Turn off the enable & PE bits */ rlwinm r3,r3,0,5,3 /* Turn off the clken bit */ /* Check to see if we need to flush */ rlwinm. r4,r4,0,0,0 @@ -379,7 +380,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_L3CR) /* flush_disable_L1() - Flush and disable L1 cache * * clobbers r0, r3, ctr, cr0 - * + * Must be called with interrupts disabled and MMU enabled. */ _GLOBAL(__flush_disable_L1) /* Stop pending alitvec streams and memory accesses */ @@ -393,7 +394,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) */ li r3,0x4000 /* 512kB / 32B */ mtctr r3 - li r3, 0 + lis r3,KERNELBASE@h 1: lwz r0,0(r3) addi r3,r3,0x0020 /* Go to start of next cache line */ @@ -404,7 +405,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) /* Now flush those cache lines */ li r3,0x4000 /* 512kB / 32B */ mtctr r3 - li r3, 0 + lis r3,KERNELBASE@h 1: dcbf 0,r3 addi r3,r3,0x0020 /* Go to start of next cache line */ diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index 55ca736d1..4b6beee18 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S @@ -1434,7 +1434,7 @@ _GLOBAL(sys_call_table) .long sys_fstatfs64 .long ppc_fadvise64_64 .long sys_ni_syscall /* 255 - rtas (used on ppc64) */ - .long sys_ni_syscall /* 256 reserved for sys_debug_setcontext */ + .long sys_debug_setcontext .long sys_vserver .long sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ .long sys_ni_syscall /* 259 reserved for new sys_mbind */ @@ -1447,3 +1447,6 @@ _GLOBAL(sys_call_table) .long sys_mq_notify .long sys_mq_getsetattr .long sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .long sys_add_key + .long sys_request_key /* 270 */ + .long sys_keyctl diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 08cdddee7..7ed1d755a 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c @@ -231,14 +231,12 @@ EXPORT_SYMBOL(pcibios_align_resource); static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) { - struct list_head *ln; struct pci_bus *bus; int i; struct resource *res, *pr; /* Depth-First Search on bus tree */ - for (ln = bus_list->next; ln != bus_list; ln=ln->next) { - bus = pci_bus_b(ln); + list_for_each_entry(bus, bus_list, node) { for (i = 0; i < 4; ++i) { if ((res = bus->resource[i]) == NULL || !res->flags || res->start > res->end) @@ -381,7 +379,6 @@ probe_resource(struct pci_bus *parent, struct resource *pr, struct pci_bus *bus; struct pci_dev *dev; struct resource *r; - struct list_head *ln; int i; for (r = pr->child; r != NULL; r = r->sibling) { @@ -390,9 +387,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr, return 1; } } - for (ln = parent->children.next; ln != &parent->children; - ln = ln->next) { - bus = pci_bus_b(ln); + list_for_each_entry(bus, &parent->children, node) { for (i = 0; i < 4; ++i) { if ((r = bus->resource[i]) == NULL) continue; @@ -406,8 +401,7 @@ probe_resource(struct pci_bus *parent, struct resource *pr, } } } - for (ln = parent->devices.next; ln != &parent->devices; ln=ln->next) { - dev = pci_dev_b(ln); + list_for_each_entry(dev, &parent->devices, bus_list) { for (i = 0; i < 6; ++i) { r = &dev->resource[i]; if (!r->flags || (r->flags & IORESOURCE_UNSET)) @@ -1102,7 +1096,7 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga) static int __init check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) { - struct list_head *ln; + struct pci_dev *dev; int i; int rc = 0; @@ -1110,8 +1104,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \ } while (0) - for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) { - struct pci_dev *dev = pci_dev_b(ln); + list_for_each_entry(dev, &bus->devices, bus_list) { u16 class = dev->class >> 8; if (class == PCI_CLASS_DISPLAY_VGA || @@ -1152,7 +1145,7 @@ check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga) static void __init do_fixup_p2p_level(struct pci_bus *bus) { - struct list_head *ln; + struct pci_bus *b; int i, parent_io; int has_vga = 0; @@ -1163,8 +1156,7 @@ do_fixup_p2p_level(struct pci_bus *bus) if (parent_io >= 4) return; - for (ln=bus->children.next; ln != &bus->children; ln=ln->next) { - struct pci_bus *b = pci_bus_b(ln); + list_for_each_entry(b, &bus->children, node) { struct pci_dev *d = b->self; struct pci_controller* hose = (struct pci_controller *)d->sysdata; struct resource *res = b->resource[0]; @@ -1237,12 +1229,10 @@ do_fixup_p2p_level(struct pci_bus *bus) static void pcibios_fixup_p2p_bridges(void) { - struct list_head *ln; + struct pci_bus *b; - for(ln=pci_root_buses.next; ln != &pci_root_buses; ln=ln->next) { - struct pci_bus *b = pci_bus_b(ln); + list_for_each_entry(b, &pci_root_buses, node) do_fixup_p2p_level(b); - } } #endif /* CONFIG_PPC_PMAC */ @@ -1601,7 +1591,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, __pci_mmap_set_flags(dev, vma, mmap_state); __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); - ret = remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT, + ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot); return ret; @@ -1722,7 +1712,11 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) if (flags & IORESOURCE_IO) return ioport_map(start, len); if (flags & IORESOURCE_MEM) - return (void __iomem *) start; + /* Not checking IORESOURCE_CACHEABLE because PPC does + * not currently distinguish between ioremap and + * ioremap_nocache. + */ + return ioremap(start, len); /* What? */ return NULL; } diff --git a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c index a86975032..d61889c24 100644 --- a/arch/ppc/kernel/ppc-stub.c +++ b/arch/ppc/kernel/ppc-stub.c @@ -498,7 +498,7 @@ static struct hard_trap_info unsigned int tt; /* Trap type code for powerpc */ unsigned char signo; /* Signal that we map this trap into */ } hard_trap_info[] = { -#if defined(CONFIG_40x) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) { 0x100, SIGINT }, /* critical input interrupt */ { 0x200, SIGSEGV }, /* machine check */ { 0x300, SIGSEGV }, /* data storage */ @@ -521,7 +521,7 @@ static struct hard_trap_info ** 0x1100 data TLB miss ** 0x1200 instruction TLB miss */ - { 0x2000, SIGTRAP}, /* debug */ + { 0x2002, SIGTRAP}, /* debug */ #else { 0x200, SIGSEGV }, /* machine check */ { 0x300, SIGSEGV }, /* address error (store) */ @@ -602,11 +602,6 @@ handle_exception (struct pt_regs *regs) sigval = computeSignal(regs->trap); ptr = remcomOutBuffer; -#if defined(CONFIG_40x) - *ptr++ = 'S'; - *ptr++ = hexchars[sigval >> 4]; - *ptr++ = hexchars[sigval & 0xf]; -#else *ptr++ = 'T'; *ptr++ = hexchars[sigval >> 4]; *ptr++ = hexchars[sigval & 0xf]; @@ -620,8 +615,6 @@ handle_exception (struct pt_regs *regs) *ptr++ = ':'; ptr = mem2hex(((char *)regs) + SP_REGNUM*4, ptr, 4); *ptr++ = ';'; -#endif - *ptr++ = 0; putpacket(remcomOutBuffer); @@ -774,10 +767,6 @@ handle_exception (struct pt_regs *regs) * some location may have changed something that is in the instruction cache. */ kgdb_flush_cache_all(); -#if defined(CONFIG_40x) - strcpy(remcomOutBuffer, "OK"); - putpacket(remcomOutBuffer); -#endif mtmsr(msr); kgdb_interruptible(1); @@ -791,10 +780,9 @@ handle_exception (struct pt_regs *regs) case 's': kgdb_flush_cache_all(); -#if defined(CONFIG_40x) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC); regs->msr |= MSR_DE; - regs->dbcr0 |= (DBCR0_IDM | DBCR0_IC); - mtmsr(msr); #else regs->msr |= MSR_SE; #endif diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c index d8e027fd4..b5cd7e411 100644 --- a/arch/ppc/kernel/ppc_htab.c +++ b/arch/ppc/kernel/ppc_htab.c @@ -21,9 +21,9 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 965a874a4..1ee8c12ba 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -84,10 +84,6 @@ EXPORT_SYMBOL(SingleStepException); EXPORT_SYMBOL(sys_sigreturn); EXPORT_SYMBOL(ppc_n_lost_interrupts); EXPORT_SYMBOL(ppc_lost_interrupts); -EXPORT_SYMBOL(enable_irq); -EXPORT_SYMBOL(disable_irq); -EXPORT_SYMBOL(disable_irq_nosync); -EXPORT_SYMBOL(probe_irq_mask); EXPORT_SYMBOL(ISA_DMA_THRESHOLD); EXPORT_SYMBOL(DMA_MODE_READ); @@ -194,6 +190,7 @@ EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_dcache_page); EXPORT_SYMBOL(flush_tlb_kernel_range); EXPORT_SYMBOL(flush_tlb_page); +EXPORT_SYMBOL(_tlbie); #ifdef CONFIG_ALTIVEC EXPORT_SYMBOL(last_task_used_altivec); EXPORT_SYMBOL(giveup_altivec); @@ -205,7 +202,6 @@ EXPORT_SYMBOL(giveup_spe); #ifdef CONFIG_SMP EXPORT_SYMBOL(smp_call_function); EXPORT_SYMBOL(smp_hw_index); -EXPORT_SYMBOL(synchronize_irq); #endif EXPORT_SYMBOL(ppc_md); @@ -292,8 +288,6 @@ EXPORT_SYMBOL(local_irq_restore_end); #endif EXPORT_SYMBOL(timer_interrupt); EXPORT_SYMBOL(irq_desc); -void ppc_irq_dispatch_handler(struct pt_regs *, int); -EXPORT_SYMBOL(ppc_irq_dispatch_handler); EXPORT_SYMBOL(tb_ticks_per_jiffy); EXPORT_SYMBOL(get_wchan); EXPORT_SYMBOL(console_drivers); @@ -328,9 +322,6 @@ EXPORT_SYMBOL(cpm_free_handler); #if defined(CONFIG_8xx) || defined(CONFIG_40x) || defined(CONFIG_85xx) EXPORT_SYMBOL(__res); #endif -#if defined(CONFIG_8xx) -EXPORT_SYMBOL(request_8xxirq); -#endif EXPORT_SYMBOL(next_mmu_context); EXPORT_SYMBOL(set_context); diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c index d9ab6a7de..82de66e4d 100644 --- a/arch/ppc/kernel/process.c +++ b/arch/ppc/kernel/process.c @@ -321,21 +321,10 @@ void show_regs(struct pt_regs * regs) trap = TRAP(regs); if (trap == 0x300 || trap == 0x600) printk("DAR: %08lX, DSISR: %08lX\n", regs->dar, regs->dsisr); - printk("TASK = %p[%d] '%s' THREAD: %p", + printk("TASK = %p[%d] '%s' THREAD: %p\n", current, current->pid, current->comm, current->thread_info); printk("Last syscall: %ld ", current->thread.last_syscall); -#if defined(CONFIG_4xx) && defined(DCRN_PLB0_BEAR) - printk("\nPLB0: bear= 0x%8.8x acr= 0x%8.8x besr= 0x%8.8x\n", - mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_PLB0_ACR), - mfdcr(DCRN_PLB0_BESR)); -#endif -#if defined(CONFIG_4xx) && defined(DCRN_POB0_BEAR) - printk("PLB0 to OPB: bear= 0x%8.8x besr0= 0x%8.8x besr1= 0x%8.8x\n", - mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_POB0_BESR0), - mfdcr(DCRN_POB0_BESR1)); -#endif - #ifdef CONFIG_SMP printk(" CPU: %d", smp_processor_id()); #endif /* CONFIG_SMP */ @@ -370,6 +359,10 @@ void exit_thread(void) last_task_used_math = NULL; if (last_task_used_altivec == current) last_task_used_altivec = NULL; +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif } void flush_thread(void) @@ -378,6 +371,10 @@ void flush_thread(void) last_task_used_math = NULL; if (last_task_used_altivec == current) last_task_used_altivec = NULL; +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif } void @@ -422,8 +419,6 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp, unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE; unsigned long childframe; - p->set_child_tid = p->clear_child_tid = NULL; - CHECK_FULL_REGS(regs); /* Copy registers */ sp -= sizeof(struct pt_regs); @@ -482,6 +477,10 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp) last_task_used_math = NULL; if (last_task_used_altivec == current) last_task_used_altivec = NULL; +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); current->thread.fpscr = 0; #ifdef CONFIG_ALTIVEC @@ -598,8 +597,11 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, preempt_enable(); error = do_execve(filename, (char __user *__user *) a1, (char __user *__user *) a2, regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: return error; diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c index c24367432..1f370cb2e 100644 --- a/arch/ppc/kernel/ptrace.c +++ b/arch/ppc/kernel/ptrace.c @@ -35,7 +35,7 @@ /* * Set of msr bits that gdb can change on behalf of a process. */ -#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) #define MSR_DEBUGCHANGE 0 #else #define MSR_DEBUGCHANGE (MSR_SE | MSR_BE) @@ -201,9 +201,9 @@ set_single_step(struct task_struct *task) struct pt_regs *regs = task->thread.regs; if (regs != NULL) { -#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC; - /* MSR.DE should already be set */ + regs->msr |= MSR_DE; #else regs->msr |= MSR_SE; #endif @@ -216,8 +216,9 @@ clear_single_step(struct task_struct *task) struct pt_regs *regs = task->thread.regs; if (regs != NULL) { -#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) task->thread.dbcr0 = 0; + regs->msr &= ~MSR_DE; #else regs->msr &= ~MSR_SE; #endif @@ -379,7 +380,7 @@ int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 57b70aec7..5e7ce4b8f 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -226,6 +227,10 @@ int show_cpuinfo(struct seq_file *m, void *v) maj = ((pvr >> 8) & 0xFF) - 1; min = pvr & 0xFF; break; + case 0x8020: /* e500 */ + maj = PVR_MAJ(pvr); + min = PVR_MIN(pvr); + break; default: maj = (pvr >> 8) & 0xFF; min = pvr & 0xFF; @@ -677,7 +682,6 @@ arch_initcall(ppc_init); /* Warning, IO base is not yet inited */ void __init setup_arch(char **cmdline_p) { - extern int panic_timeout; extern char *klimit; extern void do_init_bootmem(void); diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c index 260716af5..4b8b96d8a 100644 --- a/arch/ppc/kernel/signal.c +++ b/arch/ppc/kernel/signal.c @@ -290,7 +290,7 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) /* force the process to reload the FP registers from current->thread when it next does FP instructions */ - regs->msr &= ~MSR_FP; + regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); if (__copy_from_user(current->thread.fpr, &sr->mc_fregs, sizeof(sr->mc_fregs))) return 1; @@ -319,7 +319,7 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_SPE) != 0) { /* restore spe registers from the stack */ if (__copy_from_user(current->thread.evr, &sr->mc_vregs, - sizeof(sr->mc_vregs))) + ELF_NEVRREG * sizeof(u32))) return 1; } else if (current->thread.used_spe) memset(¤t->thread.evr, 0, ELF_NEVRREG * sizeof(u32)); @@ -329,6 +329,16 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) return 1; #endif /* CONFIG_SPE */ +#ifndef CONFIG_SMP + preempt_disable(); + if (last_task_used_math == current) + last_task_used_math = NULL; + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; + if (last_task_used_spe == current) + last_task_used_spe = NULL; + preempt_enable(); +#endif return 0; } @@ -499,6 +509,96 @@ int sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, return 0; } +int sys_debug_setcontext(struct ucontext __user *ctx, + int ndbg, struct sig_dbg_op *dbg, + int r6, int r7, int r8, + struct pt_regs *regs) +{ + struct sig_dbg_op op; + int i; + unsigned long new_msr = regs->msr; +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) + unsigned long new_dbcr0 = current->thread.dbcr0; +#endif + + for (i=0; imsr = new_msr; +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) + current->thread.dbcr0 = new_dbcr0; +#endif + + /* + * If we get a fault copying the context into the kernel's + * image of the user's registers, we can't just return -EFAULT + * because the user's registers will be corrupted. For instance + * the NIP value may have been updated but not some of the + * other registers. Given that we have done the verify_area + * and successfully read the first and last bytes of the region + * above, this should only happen in an out-of-memory situation + * or if another thread unmaps the region containing the context. + * We kill the task with a SIGSEGV in this situation. + */ + if (do_setcontext(ctx, regs, 1)) { + force_sig(SIGSEGV, current); + goto out; + } + + /* + * It's not clear whether or why it is desirable to save the + * sigaltstack setting on signal delivery and restore it on + * signal return. But other architectures do this and we have + * always done it up until now so it is probably better not to + * change it. -- paulus + */ + do_sigaltstack(&ctx->uc_stack, NULL, regs->gpr[1]); + + sigreturn_exit(regs); + /* doesn't actually return back to here */ + + out: + return 0; +} + /* * OK, we're invoking a handler */ diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index dae491743..7ed8a3bb8 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -42,8 +42,6 @@ struct cpuinfo_PPC cpu_data[NR_CPUS]; struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 }; atomic_t ipi_recv; atomic_t ipi_sent; -DEFINE_PER_CPU(unsigned int, prof_multiplier); -DEFINE_PER_CPU(unsigned int, prof_counter); unsigned long cache_decay_ticks = HZ/100; cpumask_t cpu_online_map; cpumask_t cpu_possible_map; @@ -60,7 +58,6 @@ static struct smp_ops_t *smp_ops; volatile unsigned long cpu_callin_map[NR_CPUS]; int start_secondary(void *); -extern int cpu_idle(void *unused); void smp_call_function_interrupt(void); static int __smp_call_function(void (*func) (void *info), void *info, int wait, int target); @@ -89,16 +86,6 @@ smp_message_pass(int target, int msg, unsigned long data, int wait) /* * Common functions */ -void smp_local_timer_interrupt(struct pt_regs * regs) -{ - int cpu = smp_processor_id(); - - if (!--per_cpu(prof_counter, cpu)) { - update_process_times(user_mode(regs)); - per_cpu(prof_counter, cpu) = per_cpu(prof_multiplier, cpu); - } -} - void smp_message_recv(int msg, struct pt_regs *regs) { atomic_inc(&ipi_recv); @@ -176,7 +163,7 @@ void smp_send_stop(void) * static memory requirements. It also looks cleaner. * Stolen from the i386 version. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); static struct call_data_struct { void (*func) (void *info); @@ -297,8 +284,6 @@ static void __devinit smp_store_cpu_info(int id) /* assume bogomips are same for everything */ c->loops_per_jiffy = loops_per_jiffy; c->pvr = mfspr(PVR); - per_cpu(prof_counter, id) = 1; - per_cpu(prof_multiplier, id) = 1; } void __init smp_prepare_cpus(unsigned int max_cpus) @@ -358,7 +343,8 @@ int __devinit start_secondary(void *unused) smp_ops->take_timebase(); printk("CPU %i done timebase take...\n", cpu); - return cpu_idle(NULL); + cpu_idle(); + return 0; } int __cpu_up(unsigned int cpu) diff --git a/arch/ppc/kernel/softemu8xx.c b/arch/ppc/kernel/softemu8xx.c index e44d9a06e..9bbb6bf7b 100644 --- a/arch/ppc/kernel/softemu8xx.c +++ b/arch/ppc/kernel/softemu8xx.c @@ -133,7 +133,7 @@ Soft_emulate_8xx(struct pt_regs *regs) print_8xx_pte(current->mm,regs->nip); pa = get_8xx_pte(current->mm,regs->nip) & PAGE_MASK; pa |= (regs->nip & ~PAGE_MASK); - pa = __va(pa); + pa = (unsigned long)__va(pa); printk("Kernel VA for NIP %x ", pa); print_8xx_pte(current->mm,pa); } diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 60e7ef5ad..507241394 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -91,7 +91,7 @@ extern unsigned long wall_jiffies; static long time_offset; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); EXPORT_SYMBOL(rtc_lock); @@ -142,6 +142,7 @@ void timer_interrupt(struct pt_regs * regs) jiffy_stamp += tb_ticks_per_jiffy; profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(regs)); if (smp_processor_id()) continue; @@ -183,10 +184,6 @@ void timer_interrupt(struct pt_regs * regs) set_dec(next_dec); last_jiffy_stamp(cpu) = jiffy_stamp; -#ifdef CONFIG_SMP - smp_local_timer_interrupt(regs); -#endif /* CONFIG_SMP */ - if (ppc_md.heartbeat && !ppc_md.heartbeat_count--) ppc_md.heartbeat(); diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c index 7870bb680..0d7eb748d 100644 --- a/arch/ppc/kernel/traps.c +++ b/arch/ppc/kernel/traps.c @@ -41,6 +41,7 @@ #ifdef CONFIG_PMAC_BACKLIGHT #include #endif +#include #ifdef CONFIG_XMON void (*debugger)(struct pt_regs *regs) = xmon; @@ -71,8 +72,7 @@ void (*debugger_fault_handler)(struct pt_regs *regs); * Trap & Exception support */ - -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); void die(const char * str, struct pt_regs * fp, long err) { @@ -199,6 +199,15 @@ static inline int check_io_access(struct pt_regs *regs) #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) #endif +/* + * This is "fall-back" implementation for configurations + * which don't provide platform-specific machine check info + */ +void __attribute__ ((weak)) +platform_machine_check(struct pt_regs *regs) +{ +} + void MachineCheckException(struct pt_regs *regs) { unsigned long reason = get_mc_reason(regs); @@ -323,6 +332,12 @@ void MachineCheckException(struct pt_regs *regs) } #endif /* CONFIG_4xx */ + /* + * Optional platform-provided routine to print out + * additional info, e.g. bus error registers. + */ + platform_machine_check(regs); + debugger(regs); die("machine check", regs, SIGBUS); } @@ -566,7 +581,7 @@ void ProgramCheckException(struct pt_regs *regs) void SingleStepException(struct pt_regs *regs) { - regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ + regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */ if (debugger_sstep(regs)) return; _exception(SIGTRAP, regs, TRAP_TRACE, 0); @@ -647,22 +662,22 @@ void SoftwareEmulation(struct pt_regs *regs) } #endif /* CONFIG_8xx */ -#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) void DebugException(struct pt_regs *regs, unsigned long debug_status) { -#if 0 - if (debug_status & DBSR_TIE) { /* trap instruction*/ - if (!user_mode(regs) && debugger_bpt(regs)) - return; - _exception(SIGTRAP, regs, 0, 0); - - } -#endif if (debug_status & DBSR_IC) { /* instruction completion */ - if (!user_mode(regs) && debugger_sstep(regs)) - return; - current->thread.dbcr0 &= ~DBCR0_IC; + regs->msr &= ~MSR_DE; + if (user_mode(regs)) { + current->thread.dbcr0 &= ~DBCR0_IC; + } else { + /* Disable instruction completion */ + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC); + /* Clear the instruction completion event */ + mtspr(SPRN_DBSR, DBSR_IC); + if (debugger_sstep(regs)) + return; + } _exception(SIGTRAP, regs, TRAP_TRACE, 0); } } @@ -726,6 +741,11 @@ void AltivecAssistException(struct pt_regs *regs) } #endif /* CONFIG_ALTIVEC */ +void PerformanceMonitorException(struct pt_regs *regs) +{ + perf_irq(regs); +} + #ifdef CONFIG_FSL_BOOKE void CacheLockingException(struct pt_regs *regs, unsigned long address, unsigned long error_code) diff --git a/arch/ppc/lib/dec_and_lock.c b/arch/ppc/lib/dec_and_lock.c index 252beec63..4ee888070 100644 --- a/arch/ppc/lib/dec_and_lock.c +++ b/arch/ppc/lib/dec_and_lock.c @@ -19,7 +19,7 @@ */ #ifndef ATOMIC_DEC_AND_LOCK -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) { int counter; int newcount; @@ -42,5 +42,5 @@ int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) return 0; } -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif /* ATOMIC_DEC_AND_LOCK */ diff --git a/arch/ppc/lib/locks.c b/arch/ppc/lib/locks.c index 0eaffa9b5..694163d69 100644 --- a/arch/ppc/lib/locks.c +++ b/arch/ppc/lib/locks.c @@ -91,44 +91,57 @@ void _raw_spin_unlock(spinlock_t *lp) } EXPORT_SYMBOL(_raw_spin_unlock); - /* - * Just like x86, implement read-write locks as a 32-bit counter - * with the high bit (sign) being the "write" bit. - * -- Cort + * For rwlocks, zero is unlocked, -1 is write-locked, + * positive is read-locked. */ -void _raw_read_lock(rwlock_t *rw) +static __inline__ int __read_trylock(rwlock_t *rw) { - unsigned long stuck = INIT_STUCK; - int cpu = smp_processor_id(); + signed int tmp; + + __asm__ __volatile__( +"2: lwarx %0,0,%1 # __read_trylock\n\ + addic. %0,%0,1\n\ + ble- 1f\n" + PPC405_ERR77(0,%1) +" stwcx. %0,0,%1\n\ + bne- 2b\n\ + isync\n\ +1:" + : "=&r"(tmp) + : "r"(&rw->lock) + : "cr0", "memory"); -again: - /* get our read lock in there */ - atomic_inc((atomic_t *) &(rw)->lock); - if ( (signed long)((rw)->lock) < 0) /* someone has a write lock */ - { - /* turn off our read lock */ - atomic_dec((atomic_t *) &(rw)->lock); - /* wait for the write lock to go away */ - while ((signed long)((rw)->lock) < 0) - { - if(!--stuck) - { - printk("_read_lock(%p) CPU#%d\n", rw, cpu); + return tmp; +} + +int _raw_read_trylock(rwlock_t *rw) +{ + return __read_trylock(rw) > 0; +} +EXPORT_SYMBOL(_raw_read_trylock); + +void _raw_read_lock(rwlock_t *rw) +{ + unsigned int stuck; + + while (__read_trylock(rw) <= 0) { + stuck = INIT_STUCK; + while (!read_can_lock(rw)) { + if (--stuck == 0) { + printk("_read_lock(%p) CPU#%d lock %d\n", + rw, _smp_processor_id(), rw->lock); stuck = INIT_STUCK; } } - /* try to get the read lock again */ - goto again; } - wmb(); } EXPORT_SYMBOL(_raw_read_lock); void _raw_read_unlock(rwlock_t *rw) { if ( rw->lock == 0 ) - printk("_read_unlock(): %s/%d (nip %08lX) lock %lx\n", + printk("_read_unlock(): %s/%d (nip %08lX) lock %d\n", current->comm,current->pid,current->thread.regs->nip, rw->lock); wmb(); @@ -138,40 +151,17 @@ EXPORT_SYMBOL(_raw_read_unlock); void _raw_write_lock(rwlock_t *rw) { - unsigned long stuck = INIT_STUCK; - int cpu = smp_processor_id(); - -again: - if ( test_and_set_bit(31,&(rw)->lock) ) /* someone has a write lock */ - { - while ( (rw)->lock & (1<<31) ) /* wait for write lock */ - { - if(!--stuck) - { - printk("write_lock(%p) CPU#%d lock %lx)\n", - rw, cpu,rw->lock); - stuck = INIT_STUCK; - } - barrier(); - } - goto again; - } - - if ( (rw)->lock & ~(1<<31)) /* someone has a read lock */ - { - /* clear our write lock and wait for reads to go away */ - clear_bit(31,&(rw)->lock); - while ( (rw)->lock & ~(1<<31) ) - { - if(!--stuck) - { - printk("write_lock(%p) 2 CPU#%d lock %lx)\n", - rw, cpu,rw->lock); + unsigned int stuck; + + while (cmpxchg(&rw->lock, 0, -1) != 0) { + stuck = INIT_STUCK; + while (!write_can_lock(rw)) { + if (--stuck == 0) { + printk("write_lock(%p) CPU#%d lock %d)\n", + rw, _smp_processor_id(), rw->lock); stuck = INIT_STUCK; } - barrier(); } - goto again; } wmb(); } @@ -179,14 +169,8 @@ EXPORT_SYMBOL(_raw_write_lock); int _raw_write_trylock(rwlock_t *rw) { - if (test_and_set_bit(31, &(rw)->lock)) /* someone has a write lock */ + if (cmpxchg(&rw->lock, 0, -1) != 0) return 0; - - if ((rw)->lock & ~(1<<31)) { /* someone has a read lock */ - /* clear our write lock and wait for reads to go away */ - clear_bit(31,&(rw)->lock); - return 0; - } wmb(); return 1; } @@ -194,12 +178,12 @@ EXPORT_SYMBOL(_raw_write_trylock); void _raw_write_unlock(rwlock_t *rw) { - if ( !(rw->lock & (1<<31)) ) - printk("_write_lock(): %s/%d (nip %08lX) lock %lx\n", + if (rw->lock >= 0) + printk("_write_lock(): %s/%d (nip %08lX) lock %d\n", current->comm,current->pid,current->thread.regs->nip, rw->lock); wmb(); - clear_bit(31,&(rw)->lock); + rw->lock = 0; } EXPORT_SYMBOL(_raw_write_unlock); diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c index 9991c48f9..42c5de2c8 100644 --- a/arch/ppc/lib/rheap.c +++ b/arch/ppc/lib/rheap.c @@ -645,6 +645,7 @@ int rh_set_owner(rh_info_t * info, void *start, const char *owner) return -EINVAL; blk->owner = owner; + size = blk->size; return size; } diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S index 2b6091027..8d08a2eb2 100644 --- a/arch/ppc/lib/string.S +++ b/arch/ppc/lib/string.S @@ -216,12 +216,6 @@ _GLOBAL(memset) bdnz 8b blr -_GLOBAL(bcopy) - mr r6,r3 - mr r3,r4 - mr r4,r6 - b memcpy - /* * This version uses dcbz on the complete cache lines in the * destination area to reduce memory traffic. This requires that diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c index a2ab8b053..72f7c0d1c 100644 --- a/arch/ppc/mm/44x_mmu.c +++ b/arch/ppc/mm/44x_mmu.c @@ -55,10 +55,8 @@ #include #include "mmu_decl.h" -#include "mem_pieces.h" extern char etext[], _stext[]; -extern struct mem_pieces phys_avail; /* Used by the 44x TLB replacement exception handler. * Just needed it declared someplace. @@ -105,16 +103,6 @@ unsigned long __init mmu_mapin_ram(void) unsigned int pinned_tlbs = 1; int i; - /* - * If lowmem is not on a pin tlb entry size boundary, - * then reserve the last page of system memory. This - * eliminates the possibility of a speculative dcache - * fetch past the end of system memory that would - * result in a machine check exception. - */ - if (total_lowmem | (PPC44x_PIN_SIZE - 1)) - mem_pieces_remove(&phys_avail, total_lowmem - PAGE_SIZE, PAGE_SIZE, 1); - /* Determine number of entries necessary to cover lowmem */ pinned_tlbs = (unsigned int) (_ALIGN(total_lowmem, PPC44x_PIN_SIZE) >> PPC44x_PIN_SHIFT); diff --git a/arch/ppc/mm/fsl_booke_mmu.c b/arch/ppc/mm/fsl_booke_mmu.c index baed25b9f..36233bdcd 100644 --- a/arch/ppc/mm/fsl_booke_mmu.c +++ b/arch/ppc/mm/fsl_booke_mmu.c @@ -124,8 +124,8 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys, flags |= _PAGE_COHERENT; #endif - TLBCAM[index].MAS0 = MAS0_TLBSEL | (index << 16); - TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | ((pid << 16) & MAS1_TID); + TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index); + TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | MAS1_TID(pid); TLBCAM[index].MAS2 = virt & PAGE_MASK; TLBCAM[index].MAS2 |= (flags & _PAGE_WRITETHRU) ? MAS2_W : 0; @@ -156,7 +156,7 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys, void invalidate_tlbcam_entry(int index) { - TLBCAM[index].MAS0 = MAS0_TLBSEL | (index << 16); + TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index); TLBCAM[index].MAS1 = ~MAS1_VALID; loadcam_entry(index); diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c index cbed55208..6e31db0fe 100644 --- a/arch/ppc/mm/init.c +++ b/arch/ppc/mm/init.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -411,7 +412,6 @@ void __init mem_init(void) unsigned long highmem_mapnr; highmem_mapnr = total_lowmem >> PAGE_SHIFT; - highmem_start_page = mem_map + highmem_mapnr; #endif /* CONFIG_HIGHMEM */ max_mapnr = total_memory >> PAGE_SHIFT; diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c index 30482852c..b5316b479 100644 --- a/arch/ppc/mm/pgtable.c +++ b/arch/ppc/mm/pgtable.c @@ -85,8 +85,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) { pgd_t *ret; - if ((ret = (pgd_t *)__get_free_pages(GFP_KERNEL, PGDIR_ORDER)) != NULL) - clear_pages(ret, PGDIR_ORDER); + ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGDIR_ORDER); return ret; } @@ -102,16 +101,17 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) extern void *early_get_page(void); if (mem_init_done) { - pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); if (pte) { struct page *ptepage = virt_to_page(pte); ptepage->mapping = (void *) mm; ptepage->index = address & PMD_MASK; } - } else + } else { pte = (pte_t *)early_get_page(); - if (pte) - clear_page(pte); + if (pte) + clear_page(pte); + } return pte; } @@ -153,19 +153,19 @@ void pte_free(struct page *ptepage) } #ifndef CONFIG_44x -void * +void __iomem * ioremap(phys_addr_t addr, unsigned long size) { return __ioremap(addr, size, _PAGE_NO_CACHE); } #else /* CONFIG_44x */ -void * +void __iomem * ioremap64(unsigned long long addr, unsigned long size) { return __ioremap(addr, size, _PAGE_NO_CACHE); } -void * +void __iomem * ioremap(phys_addr_t addr, unsigned long size) { phys_addr_t addr64 = fixup_bigphys_addr(addr, size); @@ -174,7 +174,7 @@ ioremap(phys_addr_t addr, unsigned long size) } #endif /* CONFIG_44x */ -void * +void __iomem * __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) { unsigned long v, i; @@ -257,10 +257,10 @@ __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) } out: - return (void *) (v + ((unsigned long)addr & ~PAGE_MASK)); + return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK)); } -void iounmap(void *addr) +void iounmap(volatile void __iomem *addr) { /* * If mapped by BATs then there is nothing to do. diff --git a/arch/ppc/mm/tlb.c b/arch/ppc/mm/tlb.c index 34605ba4a..bedc1048e 100644 --- a/arch/ppc/mm/tlb.c +++ b/arch/ppc/mm/tlb.c @@ -62,7 +62,7 @@ void flush_hash_one_pte(pte_t *ptep) ptepage = virt_to_page(ptep); mm = (struct mm_struct *) ptepage->mapping; ptephys = __pa(ptep) & PAGE_MASK; - addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 9); + addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 10); flush_hash_pages(mm->context, addr, ptephys, 1); } diff --git a/arch/ppc/oprofile/Makefile b/arch/ppc/oprofile/Makefile index 06e7c81ea..e2218d32a 100644 --- a/arch/ppc/oprofile/Makefile +++ b/arch/ppc/oprofile/Makefile @@ -6,4 +6,9 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \ oprofilefs.o oprofile_stats.o \ timer_int.o ) -oprofile-y := $(DRIVER_OBJS) init.o +oprofile-y := $(DRIVER_OBJS) common.o + +ifeq ($(CONFIG_FSL_BOOKE),y) + oprofile-y += op_model_fsl_booke.o +endif + diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig index 578b0ac9c..a0612a864 100644 --- a/arch/ppc/platforms/4xx/Kconfig +++ b/arch/ppc/platforms/4xx/Kconfig @@ -56,6 +56,11 @@ config WALNUT help This option enables support for the IBM PPC405GP evaluation board. +config XILINX_ML300 + bool "Xilinx-ML300" + help + This option enables support for the Xilinx ML300 evaluation board. + endchoice choice @@ -68,6 +73,11 @@ config EBONY help This option enables support for the IBM PPC440GP evaluation board. +config LUAN + bool "Luan" + help + This option enables support for the IBM PPC440SP evaluation board. + config OCOTEA bool "Ocotea" help @@ -98,9 +108,14 @@ config 440GX depends on OCOTEA default y +config 440SP + bool + depends on LUAN + default y + config 440 bool - depends on 440GP + depends on 440GP || 440SP default y config 440A @@ -127,12 +142,17 @@ config BOOKE config IBM_OCP bool - depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT + depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT + default y + +config XILINX_OCP + bool + depends on XILINX_ML300 default y config IBM_EMAC4 bool - depends on 440GX + depends on 440GX || 440SP default y config BIOS_FIXUP @@ -160,6 +180,11 @@ config 405GPR depends on SYCAMORE default y +config VIRTEX_II_PRO + bool + depends on XILINX_ML300 + default y + config STB03xxx bool depends on REDWOOD_5 || REDWOOD_6 @@ -167,7 +192,7 @@ config STB03xxx config EMBEDDEDBOOT bool - depends on EP405 + depends on EP405 || XILINX_ML300 default y config IBM_OPENBIOS @@ -184,6 +209,11 @@ config PPC4xx_EDMA depends on !STB03xxx && PPC4xx_DMA default y +config PPC_GEN550 + bool + depends on 4xx + default y + config PM bool "Power Management support (EXPERIMENTAL)" depends on 4xx && EXPERIMENTAL diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile index 82064c35d..ea470c6ad 100644 --- a/arch/ppc/platforms/4xx/Makefile +++ b/arch/ppc/platforms/4xx/Makefile @@ -6,12 +6,14 @@ obj-$(CONFIG_CPCI405) += cpci405.o obj-$(CONFIG_EBONY) += ebony.o obj-$(CONFIG_EP405) += ep405.o obj-$(CONFIG_BUBINGA) += bubinga.o +obj-$(CONFIG_LUAN) += luan.o obj-$(CONFIG_OAK) += oak.o obj-$(CONFIG_OCOTEA) += ocotea.o obj-$(CONFIG_REDWOOD_5) += redwood5.o obj-$(CONFIG_REDWOOD_6) += redwood6.o obj-$(CONFIG_SYCAMORE) += sycamore.o obj-$(CONFIG_WALNUT) += walnut.o +obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o obj-$(CONFIG_405GP) += ibm405gp.o obj-$(CONFIG_REDWOOD_5) += ibmstb4.o @@ -19,5 +21,7 @@ obj-$(CONFIG_NP405H) += ibmnp405h.o obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o obj-$(CONFIG_440GP) += ibm440gp.o obj-$(CONFIG_440GX) += ibm440gx.o +obj-$(CONFIG_440SP) += ibm440sp.o obj-$(CONFIG_405EP) += ibm405ep.o obj-$(CONFIG_405GPR) += ibm405gpr.o +obj-$(CONFIG_VIRTEX_II_PRO) += virtex-ii_pro.o diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index 118d8520e..86ef9bba2 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c @@ -1,10 +1,10 @@ /* - * arch/ppc/platforms/ebony.c + * arch/ppc/platforms/4xx/ebony.c * * Ebony board specific routines * - * Matt Porter - * Copyright 2002 MontaVista Software Inc. + * Matt Porter + * Copyright 2002-2005 MontaVista Software Inc. * * Eugene Surovegin or * Copyright (c) 2003, 2004 Zultys Technologies @@ -50,78 +50,29 @@ #include #include +#include + +static struct ibm44x_clocks clocks __initdata; + /* - * Ebony IRQ triggering/polarity settings + * Ebony external IRQ triggering/polarity settings */ -static u_char ebony_IRQ_initsenses[] __initdata = { - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 0: UART 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 1: UART 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 2: IIC 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 3: IIC 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 4: PCI Inb Mess */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 5: PCI Cmd Wrt */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 6: PCI PM */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 7: PCI MSI 0 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 8: PCI MSI 1 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 9: PCI MSI 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 10: MAL TX EOB */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 11: MAL RX EOB */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 12: DMA Chan 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 13: DMA Chan 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 14: DMA Chan 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 15: DMA Chan 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 16: Reserved */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 17: Reserved */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 18: GPT Timer 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 19: GPT Timer 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 20: GPT Timer 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 21: GPT Timer 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 22: GPT Timer 4 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 23: Ext Int 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 24: Ext Int 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 25: Ext Int 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 26: Ext Int 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 27: Ext Int 4 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* 28: Ext Int 5 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 29: Ext Int 6 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 30: UIC1 NC Int */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 31: UIC1 Crit Int */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 32: MAL SERR */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 33: MAL TXDE */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 34: MAL RXDE */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 35: ECC Unc Err */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 36: ECC Corr Err */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 37: Ext Bus Ctrl */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 38: Ext Bus Mstr */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 39: OPB->PLB */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 40: PCI MSI 3 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 41: PCI MSI 4 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 42: PCI MSI 5 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 43: PCI MSI 6 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 44: PCI MSI 7 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 45: PCI MSI 8 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 46: PCI MSI 9 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 47: PCI MSI 10 */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 48: PCI MSI 11 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 49: PLB Perf Mon */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 50: Ext Int 7 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 51: Ext Int 8 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 52: Ext Int 9 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 53: Ext Int 10 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 54: Ext Int 11 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 55: Ext Int 12 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 56: Ser ROM Err */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 57: Reserved */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 58: Reserved */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 59: PCI Async Err */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 60: EMAC 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 61: EMAC 0 WOL */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 62: EMAC 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 63: EMAC 1 WOL */ +unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: PCI slot 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ1: PCI slot 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ4: IRDA */ + (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ5: SMI pushbutton */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ6: PHYs */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ7: AUX */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ10: EXT */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ11: EXT */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ12: EXT */ }; -static struct ibm44x_clocks clocks __initdata; - static void __init ebony_calibrate_decr(void) { @@ -177,7 +128,7 @@ ebony_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) } #define PCIX_WRITEL(value, offset) \ - (writel(value, (u32)pcix_reg_base+offset)) + (writel(value, pcix_reg_base + offset)) /* * FIXME: This is only here to "make it work". This will move @@ -189,7 +140,7 @@ ebony_setup_pcix(void) { void *pcix_reg_base; - pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX0_REG_SIZE); + pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX_REG_SIZE); /* Disable all windows */ PCIX_WRITEL(0, PCIX0_POM0SA); @@ -284,13 +235,24 @@ ebony_early_serial_map(void) printk("Early serial init of port 0 failed\n"); } +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(0, &port); +#endif + port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); port.irq = 1; + port.uartclk = clocks.uart1; port.line = 1; if (early_serial_setup(&port) != 0) { printk("Early serial init of port 1 failed\n"); } + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(1, &port); +#endif } static void __init @@ -300,14 +262,6 @@ ebony_setup_arch(void) struct ocp_def *def; struct ocp_func_emac_data *emacdata; -#if !defined(CONFIG_BDI_SWITCH) - /* - * The Abatron BDI JTAG debugger does not tolerate others - * mucking with the debug registers. - */ - mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM)); -#endif - /* Set mac_addr for each EMAC */ vpd_base = ioremap64(EBONY_VPD_BASE, EBONY_VPD_SIZE); def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0); @@ -353,9 +307,6 @@ ebony_setup_arch(void) ebony_early_serial_map(); - ibm4xxPIC_InitSenses = ebony_IRQ_initsenses; - ibm4xxPIC_NumInitSenses = sizeof(ebony_IRQ_initsenses); - /* Identify the system */ printk("IBM Ebony port (MontaVista Software, Inc. (source@mvista.com))\n"); } @@ -378,7 +329,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; - #ifdef CONFIG_KGDB ppc_md.early_serial_map = ebony_early_serial_map; #endif diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h index f90ddf309..d8f0e1ddd 100755 --- a/arch/ppc/platforms/4xx/ebony.h +++ b/arch/ppc/platforms/4xx/ebony.h @@ -61,8 +61,8 @@ */ /* OpenBIOS defined UART mappings, used before early_serial_setup */ -#define UART0_IO_BASE (u8 *) 0xE0000200 -#define UART1_IO_BASE (u8 *) 0xE0000300 +#define UART0_IO_BASE 0xE0000200 +#define UART1_IO_BASE 0xE0000300 /* external Epson SG-615P */ #define BASE_BAUD 691200 diff --git a/arch/ppc/platforms/4xx/ibm405ep.c b/arch/ppc/platforms/4xx/ibm405ep.c index fb48e8254..6d44567f4 100644 --- a/arch/ppc/platforms/4xx/ibm405ep.c +++ b/arch/ppc/platforms/4xx/ibm405ep.c @@ -21,6 +21,7 @@ #include #include +#include #include @@ -132,3 +133,11 @@ struct ocp_def core_ocp[] = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xffff7f80, + .triggering = 0x00000000, + .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */ + } +}; diff --git a/arch/ppc/platforms/4xx/ibm405gp.c b/arch/ppc/platforms/4xx/ibm405gp.c index 70a262a01..dfd7ef3ba 100644 --- a/arch/ppc/platforms/4xx/ibm405gp.c +++ b/arch/ppc/platforms/4xx/ibm405gp.c @@ -22,6 +22,7 @@ #include #include #include +#include static struct ocp_func_emac_data ibm405gp_emac0_def = { .rgmii_idx = -1, /* No RGMII */ @@ -109,3 +110,11 @@ struct ocp_def core_ocp[] = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xffffff80, + .triggering = 0x10000000, + .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */ + } +}; diff --git a/arch/ppc/platforms/4xx/ibm405gpr.c b/arch/ppc/platforms/4xx/ibm405gpr.c index 3bd7ff5fb..01c8ccbc7 100644 --- a/arch/ppc/platforms/4xx/ibm405gpr.c +++ b/arch/ppc/platforms/4xx/ibm405gpr.c @@ -18,6 +18,7 @@ #include #include #include +#include static struct ocp_func_emac_data ibm405gpr_emac0_def = { .rgmii_idx = -1, /* No RGMII */ @@ -106,3 +107,11 @@ struct ocp_def core_ocp[] = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xffffe000, + .triggering = 0x10000000, + .ext_irq_mask = 0x00001fff, /* IRQ7 - IRQ12, IRQ0 - IRQ6 */ + } +}; diff --git a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c index 965953086..27615ef83 100644 --- a/arch/ppc/platforms/4xx/ibm440gp.c +++ b/arch/ppc/platforms/4xx/ibm440gp.c @@ -19,6 +19,7 @@ #include #include #include +#include static struct ocp_func_emac_data ibm440gp_emac0_def = { .rgmii_idx = -1, /* No RGMII */ @@ -149,3 +150,15 @@ struct ocp_def core_ocp[] = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xfffffe03, + .triggering = 0x01c00000, + .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */ + }, + { .polarity = 0xffffc0ff, + .triggering = 0x00ff8000, + .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */ + }, +}; diff --git a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c index c23db3d72..1f38f4283 100644 --- a/arch/ppc/platforms/4xx/ibm440gx.c +++ b/arch/ppc/platforms/4xx/ibm440gx.c @@ -19,6 +19,7 @@ #include #include #include +#include static struct ocp_func_emac_data ibm440gx_emac0_def = { .rgmii_idx = -1, /* No RGMII */ @@ -215,3 +216,19 @@ struct ocp_def core_ocp[] = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xfffffe03, + .triggering = 0x01c00000, + .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */ + }, + { .polarity = 0xffffc0ff, + .triggering = 0x00ff8000, + .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */ + }, + { .polarity = 0xffff83ff, + .triggering = 0x000f83c0, + .ext_irq_mask = 0x00007c00, /* IRQ13 - IRQ17 */ + }, +}; diff --git a/arch/ppc/platforms/4xx/ibmnp405h.h b/arch/ppc/platforms/4xx/ibmnp405h.h index 07a48aa82..e2c2b0612 100644 --- a/arch/ppc/platforms/4xx/ibmnp405h.h +++ b/arch/ppc/platforms/4xx/ibmnp405h.h @@ -132,8 +132,7 @@ #define DCRN_UIC1_BASE 0x0D0 #define DCRN_CPC0_EPRCSR 0x0F3 -#define UIC0_UIC1NC 30 /* UIC1 non-critical interrupt */ -#define UIC0_UIC1CR 31 /* UIC1 critical interrupt */ +#define UIC0_UIC1NC 0x00000002 #define CHR1_CETE 0x00000004 /* CPU external timer enable */ #define UIC0 DCRN_UIC0_BASE @@ -141,7 +140,6 @@ #undef NR_UICS #define NR_UICS 2 -#define UIC_CASCADE_MASK 0x0003 /* bits 30 & 31 */ /* EMAC DCRN's FIXME: armin */ #define DCRN_MALRXCTP2R(base) ((base) + 0x42) /* Channel Rx 2 Channel Table Pointer */ diff --git a/arch/ppc/platforms/4xx/ibmstbx25.c b/arch/ppc/platforms/4xx/ibmstbx25.c index eb17f025f..b895b9cca 100644 --- a/arch/ppc/platforms/4xx/ibmstbx25.c +++ b/arch/ppc/platforms/4xx/ibmstbx25.c @@ -12,6 +12,7 @@ #include #include #include +#include static struct ocp_func_iic_data ibmstbx25_iic0_def = { .fast_mode = 0, /* Use standad mode (100Khz) */ @@ -57,3 +58,11 @@ struct ocp_def core_ocp[] __initdata = { { .vendor = OCP_VENDOR_INVALID } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0xffff8f80, + .triggering = 0x00000000, + .ext_irq_mask = 0x0000707f, /* IRQ7 - IRQ9, IRQ0 - IRQ6 */ + } +}; diff --git a/arch/ppc/platforms/4xx/oak.c b/arch/ppc/platforms/4xx/oak.c index a27a7071c..fa25ee1fa 100644 --- a/arch/ppc/platforms/4xx/oak.c +++ b/arch/ppc/platforms/4xx/oak.c @@ -101,8 +101,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.setup_arch = oak_setup_arch; ppc_md.show_percpuinfo = oak_show_percpuinfo; ppc_md.irq_canonicalize = NULL; - ppc_md.init_IRQ = oak_init_IRQ; - ppc_md.get_irq = oak_get_irq; + ppc_md.init_IRQ = ppc4xx_pic_init; + ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */ ppc_md.init = NULL; ppc_md.restart = oak_restart; @@ -155,32 +155,6 @@ oak_show_percpuinfo(struct seq_file *m, int i) return 0; } -/* - * Document me. - */ -void __init -oak_init_IRQ(void) -{ - int i; - - ppc4xx_pic_init(); - - for (i = 0; i < NR_IRQS; i++) { - irq_desc[i].handler = ppc4xx_pic; - } - - return; -} - -/* - * Document me. - */ -int -oak_get_irq(struct pt_regs *regs) -{ - return (ppc4xx_pic_get_irq(regs)); -} - /* * Document me. */ diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c index c981f70aa..28de70743 100644 --- a/arch/ppc/platforms/4xx/ocotea.c +++ b/arch/ppc/platforms/4xx/ocotea.c @@ -1,11 +1,11 @@ /* - * arch/ppc/platforms/ocotea.c + * arch/ppc/platforms/4xx/ocotea.c * * Ocotea board specific routines * - * Matt Porter + * Matt Porter * - * Copyright 2003 MontaVista Software Inc. + * Copyright 2003-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 @@ -49,6 +49,7 @@ #include #include +#include #include /* @@ -80,7 +81,7 @@ ocotea_show_cpuinfo(struct seq_file *m) { seq_printf(m, "vendor\t\t: IBM\n"); seq_printf(m, "machine\t\t: PPC440GX EVB (Ocotea)\n"); - + ibm440gx_show_cpuinfo(m); return 0; } @@ -144,13 +145,13 @@ static void __init ocotea_set_emacdata(void) } #define PCIX_READW(offset) \ - (readw((u32)pcix_reg_base+offset)) + (readw(pcix_reg_base+offset)) #define PCIX_WRITEW(value, offset) \ - (writew(value, (u32)pcix_reg_base+offset)) + (writew(value, pcix_reg_base+offset)) #define PCIX_WRITEL(value, offset) \ - (writel(value, (u32)pcix_reg_base+offset)) + (writel(value, pcix_reg_base+offset)) /* * FIXME: This is only here to "make it work". This will move @@ -162,7 +163,7 @@ ocotea_setup_pcix(void) { void *pcix_reg_base; - pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX0_REG_SIZE); + pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX_REG_SIZE); /* Enable PCIX0 I/O, Mem, and Busmaster cycles */ PCIX_WRITEW(PCIX_READW(PCIX0_COMMAND) | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, PCIX0_COMMAND); @@ -263,6 +264,11 @@ ocotea_early_serial_map(void) printk("Early serial init of port 0 failed\n"); } +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(0, &port); +#endif + port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); port.irq = UART1_INT; port.uartclk = clocks.uart1; @@ -271,6 +277,11 @@ ocotea_early_serial_map(void) if (early_serial_setup(&port) != 0) { printk("Early serial init of port 1 failed\n"); } + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(1, &port); +#endif } static void __init @@ -280,23 +291,6 @@ ocotea_setup_arch(void) ibm440gx_tah_enable(); -#if !defined(CONFIG_BDI_SWITCH) - /* - * The Abatron BDI JTAG debugger does not tolerate others - * mucking with the debug registers. - */ - mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM)); -#endif - - /* - * Determine various clocks. - * To be completely correct we should get SysClk - * from FPGA, because it can be changed by on-board switches - * --ebs - */ - ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200); - ocp_sys_info.opb_bus_freq = clocks.opb; - /* Setup TODC access */ TODC_INIT(TODC_TYPE_DS1743, 0, @@ -327,6 +321,11 @@ ocotea_setup_arch(void) printk("IBM Ocotea port (MontaVista Software, Inc. )\n"); } +static void __init ocotea_init(void) +{ + ibm440gx_l2c_setup(&clocks); +} + void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { @@ -339,8 +338,14 @@ void __init platform_init(unsigned long r3, unsigned long r4, if (r3) __res = *(bd_t *)(r3 + KERNELBASE); - /* Disable L2-Cache due to hardware issues */ - ibm440gx_l2c_disable(); + /* + * Determine various clocks. + * To be completely correct we should get SysClk + * from FPGA, because it can be changed by on-board switches + * --ebs + */ + ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200); + ocp_sys_info.opb_bus_freq = clocks.opb; ibm44x_platform_init(); @@ -355,8 +360,8 @@ void __init platform_init(unsigned long r3, unsigned long r4, ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; - #ifdef CONFIG_KGDB ppc_md.early_serial_map = ocotea_early_serial_map; #endif + ppc_md.init = ocotea_init; } diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h index 90cd0afa1..202dc8251 100644 --- a/arch/ppc/platforms/4xx/ocotea.h +++ b/arch/ppc/platforms/4xx/ocotea.h @@ -3,9 +3,9 @@ * * Ocotea board definitions * - * Matt Porter + * Matt Porter * - * Copyright 2003 MontaVista Software Inc. + * Copyright 2003-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 @@ -22,13 +22,13 @@ #include /* F/W TLB mapping used in bootloader glue to reset EMAC */ -#define PPC44x_EMAC0_MR0 0xE0000800 +#define PPC44x_EMAC0_MR0 0xe0000800 /* Location of MAC addresses in PIBS image */ -#define OCOTEA_PIBS_FLASH 0xfff00000 -#define OCOTEA_PIBS_MAC_BASE (OCOTEA_PIBS_FLASH+0xb0500) -#define OCOTEA_PIBS_MAC_SIZE 0x200 -#define OCOTEA_PIBS_MAC_OFFSET 0x100 +#define PIBS_FLASH_BASE 0xfff00000 +#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xb0500) +#define PIBS_MAC_SIZE 0x200 +#define PIBS_MAC_OFFSET 0x100 /* External timer clock frequency */ #define OCOTEA_TMR_CLK 25000000 @@ -56,8 +56,8 @@ #define RS_TABLE_SIZE 2 /* OpenBIOS defined UART mappings, used before early_serial_setup */ -#define UART0_IO_BASE (u8 *) 0xE0000200 -#define UART1_IO_BASE (u8 *) 0xE0000300 +#define UART0_IO_BASE 0xE0000200 +#define UART1_IO_BASE 0xE0000300 #define BASE_BAUD 11059200/16 #define STD_UART_OP(num) \ diff --git a/arch/ppc/platforms/4xx/redwood6.c b/arch/ppc/platforms/4xx/redwood6.c index b8a5d541f..8b1012994 100644 --- a/arch/ppc/platforms/4xx/redwood6.c +++ b/arch/ppc/platforms/4xx/redwood6.c @@ -19,44 +19,20 @@ #include #include - /* - * Define all of the IRQ senses and polarities. + * Define external IRQ senses and polarities. */ - -static u_char redwood6_IRQ_initsenses[] __initdata = { - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 0: RTC/FPC */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 1: Transport */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 2: Audio Dec */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 3: Video Dec */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 4: DMA Chan 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 5: DMA Chan 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 6: DMA Chan 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 7: DMA Chan 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 8: SmartCard 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 9: IIC0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 10: IRR */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 11: Cap Timers */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 12: Cmp Timers */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 13: Serial Port */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 14: Soft Modem */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 15: Down Ctrs */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 16: SmartCard 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 17: Ext Int 7 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 18: Ext Int 8 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 19: Ext Int 9 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 20: Serial 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 21: Serial 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 22: Serial 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 23: XPT_DMA */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 24: DCR timeout */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 25: Ext Int 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 26: Ext Int 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 27: Ext Int 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 28: Ext Int 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 29: Ext Int 4 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 30: Ext Int 5 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 31: Ext Int 6 */ +unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 7 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 8 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 9 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 6 */ }; static struct resource smc91x_resources[] = { @@ -144,8 +120,6 @@ redwood6_setup_arch(void) printk("\n"); #endif - ibm4xxPIC_InitSenses = redwood6_IRQ_initsenses; - ibm4xxPIC_NumInitSenses = sizeof(redwood6_IRQ_initsenses); /* Identify the system */ printk(KERN_INFO "IBM Redwood6 (STBx25XX) Platform\n"); diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c index d5e5077cf..d8019eec4 100644 --- a/arch/ppc/platforms/4xx/sycamore.c +++ b/arch/ppc/platforms/4xx/sycamore.c @@ -44,42 +44,22 @@ void *kb_data; void *sycamore_rtc_base; /* - * Define all of the IRQ senses and polarities. + * Define external IRQ senses and polarities. */ - -static u_char Sycamore_IRQ_initsenses[] __initdata = { - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 0: Uart 0*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 1: Uart 1*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 2: IIC */ - (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 3: External Master */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 4: PCI ext cmd write*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 5: DMA Chan 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 6: DMA Chan 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 7: DMA Chan 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 8: DMA Chan 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 9: Ethernet wakeup (WOL)*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 10: Mal (SEER) */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 11: Mal TXEOB */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 12: Mal RXEOB */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 13: Mal TXDE*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 14: Mal RXDE*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 15: Ethernet */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 16: Ext PCI SERR */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 17: ECC */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 18: PCI PM*/ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 19: Ext Int 7 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 20: Ext Int 8 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 21: Ext Int 9 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 22: Ext Int 10 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 23: Ext Int 11 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 24: Ext Int 12 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 25: Ext Int 0 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 26: Ext Int 1 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 27: Ext Int 2 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 28: Ext Int 3 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 29: Ext Int 4 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 30: Ext Int 5 */ - (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 31: Ext Int 6 */ +unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 7 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 8 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 9 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 10 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 11 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 12 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 6 */ }; @@ -158,8 +138,6 @@ sycamore_setup_arch(void) sycamore_rtc_base = (void *) SYCAMORE_RTC_VADDR; TODC_INIT(TODC_TYPE_DS1743, sycamore_rtc_base, sycamore_rtc_base, sycamore_rtc_base, 8); - ibm4xxPIC_InitSenses = Sycamore_IRQ_initsenses; - ibm4xxPIC_NumInitSenses = sizeof(Sycamore_IRQ_initsenses); /* Identify the system */ printk(KERN_INFO "IBM Sycamore (IBM405GPr) Platform\n"); diff --git a/arch/ppc/platforms/85xx/Kconfig b/arch/ppc/platforms/85xx/Kconfig index e4666df37..ff92e38e7 100644 --- a/arch/ppc/platforms/85xx/Kconfig +++ b/arch/ppc/platforms/85xx/Kconfig @@ -37,6 +37,12 @@ config SBC8560 This option enables support for the WindRiver PowerQUICC III SBC8560 board. +config STX_GP3 + bool "Silicon Turnkey Express GP3" + help + This option enables support for the Silicon Turnkey Express GP3 + board. + endchoice # It's often necessary to know the specific 85xx processor type. @@ -54,7 +60,7 @@ config MPC8555 config MPC8560 bool - depends on SBC8560 || MPC8560_ADS + depends on SBC8560 || MPC8560_ADS || STX_GP3 default y config 85xx_PCI2 @@ -62,11 +68,6 @@ config 85xx_PCI2 depends on MPC8555_CDS default y -config FSL_OCP - bool - depends on 85xx - default y - config PPC_GEN550 bool depends on MPC8540 || SBC8560 || MPC8555 diff --git a/arch/ppc/platforms/85xx/Makefile b/arch/ppc/platforms/85xx/Makefile index 673b970f1..b5161e386 100644 --- a/arch/ppc/platforms/85xx/Makefile +++ b/arch/ppc/platforms/85xx/Makefile @@ -1,12 +1,10 @@ # # Makefile for the PowerPC 85xx linux kernel. # +obj-$(CONFIG_85xx) += mpc85xx_sys.o mpc85xx_devices.o obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o obj-$(CONFIG_MPC8555_CDS) += mpc85xx_cds_common.o obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads_common.o mpc8560_ads.o obj-$(CONFIG_SBC8560) += sbc85xx.o sbc8560.o - -obj-$(CONFIG_MPC8540) += mpc8540.o -obj-$(CONFIG_MPC8555) += mpc8555.o -obj-$(CONFIG_MPC8560) += mpc8560.o +obj-$(CONFIG_STX_GP3) += stx_gp3.o diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c index 686dd6d9a..fca01e6bc 100644 --- a/arch/ppc/platforms/85xx/mpc8540_ads.c +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,50 +49,11 @@ #include #include #include -#include +#include #include -#include #include -struct ocp_gfar_data mpc85xx_tsec1_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC1_TX, - .interruptError = MPC85xx_IRQ_TSEC1_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC1_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR - | GFAR_HAS_RMON - | GFAR_HAS_PHY_INTR | GFAR_HAS_COALESCE), - .phyid = 0, - .phyregidx = 0, -}; - -struct ocp_gfar_data mpc85xx_tsec2_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC2_TX, - .interruptError = MPC85xx_IRQ_TSEC2_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC2_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR - | GFAR_HAS_RMON - | GFAR_HAS_PHY_INTR | GFAR_HAS_COALESCE), - .phyid = 1, - .phyregidx = 0, -}; - -struct ocp_gfar_data mpc85xx_fec_def = { - .interruptTransmit = MPC85xx_IRQ_FEC, - .interruptError = MPC85xx_IRQ_FEC, - .interruptReceive = MPC85xx_IRQ_FEC, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = 0, - .phyid = 3, - .phyregidx = 0, -}; - -struct ocp_fs_i2c_data mpc85xx_i2c1_def = { - .flags = FS_I2C_SEPARATE_DFSRR, -}; - /* ************************************************************************ * * Setup the architecture @@ -100,10 +62,9 @@ struct ocp_fs_i2c_data mpc85xx_i2c1_def = { static void __init mpc8540ads_setup_arch(void) { - struct ocp_def *def; - struct ocp_gfar_data *einfo; bd_t *binfo = (bd_t *) __res; unsigned int freq; + struct gianfar_platform_data *pdata; /* get the core frequency */ freq = binfo->bi_intfreq; @@ -130,23 +91,30 @@ mpc8540ads_setup_arch(void) invalidate_tlbcam_entry(NUM_TLBCAMS - 1); #endif - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 0); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enetaddr, 6); - } - - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 1); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enet1addr, 6); - } - - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 2); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enet2addr, 6); - } + /* setup the board related information for the enet controllers */ + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 0; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); + + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 1; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); + + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 3; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) @@ -158,8 +126,6 @@ mpc8540ads_setup_arch(void) #else ROOT_DEV = Root_HDA1; #endif - - ocp_for_each_device(mpc85xx_update_paddr_ocp, &(binfo->bi_immr_base)); } /* ************************************************************************ */ @@ -181,10 +147,25 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, #ifdef CONFIG_SERIAL_TEXT_DEBUG { bd_t *binfo = (bd_t *) __res; + struct uart_port p; /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); + + memset(&p, 0, sizeof (p)); + p.iotype = SERIAL_IO_MEM; + p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART0_OFFSET; + p.uartclk = binfo->bi_busfreq; + + gen550_init(0, &p); + + memset(&p, 0, sizeof (p)); + p.iotype = SERIAL_IO_MEM; + p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART1_OFFSET; + p.uartclk = binfo->bi_busfreq; + + gen550_init(1, &p); } #endif @@ -206,6 +187,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, strcpy(cmd_line, (char *) (r6 + KERNELBASE)); } + identify_ppc_sys_by_id(mfspr(SVR)); + /* setup the PowerPC module struct */ ppc_md.setup_arch = mpc8540ads_setup_arch; ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo; diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.h b/arch/ppc/platforms/85xx/mpc8540_ads.h index 0d602fc1f..3d05d7c4a 100644 --- a/arch/ppc/platforms/85xx/mpc8540_ads.h +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h @@ -22,8 +22,4 @@ #include #include -#define SERIAL_PORT_DFNS \ - STD_UART_OP(0) \ - STD_UART_OP(1) - #endif /* __MACH_MPC8540ADS_H__ */ diff --git a/arch/ppc/platforms/85xx/mpc8555_cds.h b/arch/ppc/platforms/85xx/mpc8555_cds.h index 566e0e1aa..e0e75568b 100644 --- a/arch/ppc/platforms/85xx/mpc8555_cds.h +++ b/arch/ppc/platforms/85xx/mpc8555_cds.h @@ -18,7 +18,7 @@ #define __MACH_MPC8555CDS_H__ #include -#include +#include #include #define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c index 0cb2c3458..16c8c7b5d 100644 --- a/arch/ppc/platforms/85xx/mpc8560_ads.c +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,7 +49,7 @@ #include #include #include -#include +#include #include #include @@ -58,34 +59,6 @@ extern void cpm2_reset(void); -struct ocp_gfar_data mpc85xx_tsec1_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC1_TX, - .interruptError = MPC85xx_IRQ_TSEC1_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC1_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR - | GFAR_HAS_RMON | GFAR_HAS_COALESCE - | GFAR_HAS_PHY_INTR), - .phyid = 0, - .phyregidx = 0, -}; - -struct ocp_gfar_data mpc85xx_tsec2_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC2_TX, - .interruptError = MPC85xx_IRQ_TSEC2_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC2_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR - | GFAR_HAS_RMON | GFAR_HAS_COALESCE - | GFAR_HAS_PHY_INTR), - .phyid = 1, - .phyregidx = 0, -}; - -struct ocp_fs_i2c_data mpc85xx_i2c1_def = { - .flags = FS_I2C_SEPARATE_DFSRR, -}; - /* ************************************************************************ * * Setup the architecture @@ -95,10 +68,9 @@ struct ocp_fs_i2c_data mpc85xx_i2c1_def = { static void __init mpc8560ads_setup_arch(void) { - struct ocp_def *def; - struct ocp_gfar_data *einfo; bd_t *binfo = (bd_t *) __res; unsigned int freq; + struct gianfar_platform_data *pdata; cpm2_reset(); @@ -117,17 +89,22 @@ mpc8560ads_setup_arch(void) mpc85xx_setup_hose(); #endif - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 0); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enetaddr, 6); - } - - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 1); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enet1addr, 6); - } + /* setup the board related information for the enet controllers */ + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 0; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); + + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 1; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) @@ -139,18 +116,22 @@ mpc8560ads_setup_arch(void) #else ROOT_DEV = Root_HDA1; #endif - - ocp_for_each_device(mpc85xx_update_paddr_ocp, &(binfo->bi_immr_base)); } static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) { - while ((irq = cpm2_get_irq(regs)) >= 0) { - ppc_irq_dispatch_handler(regs, irq); - } + while ((irq = cpm2_get_irq(regs)) >= 0) + __do_IRQ(irq, regs); return IRQ_HANDLED; } +static struct irqaction cpm2_irqaction = { + .handler = cpm2_cascade, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "cpm2_cascade", +}; + static void __init mpc8560_ads_init_IRQ(void) { @@ -174,7 +155,7 @@ mpc8560_ads_init_IRQ(void) immap->im_intctl.ic_scprrh = 0x05309770; immap->im_intctl.ic_scprrl = 0x05309770; - request_irq(MPC85xx_IRQ_CPM, cpm2_cascade, SA_INTERRUPT, "cpm2_cascade", NULL); + setup_irq(MPC85xx_IRQ_CPM, &cpm2_irqaction); return; } @@ -216,6 +197,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, strcpy(cmd_line, (char *) (r6 + KERNELBASE)); } + identify_ppc_sys_by_id(mfspr(SVR)); + /* setup the PowerPC module struct */ ppc_md.setup_arch = mpc8560ads_setup_arch; ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo; diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c index 7f0fabc5d..cf5bcd94d 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c @@ -43,7 +43,6 @@ #include #include #include -#include #include @@ -142,8 +141,7 @@ mpc85xx_ads_show_cpuinfo(struct seq_file *m) seq_printf(m, "Machine\t\t: unknown\n"); break; } - seq_printf(m, "bus freq\t: %u.%.6u MHz\n", freq / 1000000, - freq % 1000000); + seq_printf(m, "clock\t\t: %dMHz\n", freq / 1000000); seq_printf(m, "PVR\t\t: 0x%x\n", pvid); seq_printf(m, "SVR\t\t: 0x%x\n", svid); diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 5eb6e4218..a65eb0225 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,7 +49,7 @@ #include #include #include -#include +#include #include #include @@ -129,32 +130,6 @@ static u_char mpc85xx_cds_openpic_initsenses[] __initdata = { #endif }; -struct ocp_gfar_data mpc85xx_tsec1_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC1_TX, - .interruptError = MPC85xx_IRQ_TSEC1_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC1_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR | - GFAR_HAS_PHY_INTR), - .phyid = 0, - .phyregidx = 0, -}; - -struct ocp_gfar_data mpc85xx_tsec2_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC2_TX, - .interruptError = MPC85xx_IRQ_TSEC2_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC2_RX, - .interruptPHY = MPC85xx_IRQ_EXT5, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR | - GFAR_HAS_PHY_INTR), - .phyid = 1, - .phyregidx = 0, -}; - -struct ocp_fs_i2c_data mpc85xx_i2c1_def = { - .flags = FS_I2C_SEPARATE_DFSRR, -}; - /* ************************************************************************ */ int mpc85xx_cds_show_cpuinfo(struct seq_file *m) @@ -172,8 +147,7 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m) seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n"); seq_printf(m, "Machine\t\t: CDS (%x)\n", cadmus[CM_VER]); - seq_printf(m, "bus freq\t: %u.%.6u MHz\n", freq / 1000000, - freq % 1000000); + seq_printf(m, "clock\t\t: %dMHz\n", freq / 1000000); seq_printf(m, "PVR\t\t: 0x%x\n", pvid); seq_printf(m, "SVR\t\t: 0x%x\n", svid); @@ -191,10 +165,15 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m) static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) { while((irq = cpm2_get_irq(regs)) >= 0) - { - ppc_irq_dispatch_handler(regs,irq); - } + __do_IRQ(irq, regs); } + +static struct irqaction cpm2_irqaction = { + .handler = cpm2_cascade, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "cpm2_cascade", +}; #endif /* CONFIG_CPM2 */ void __init @@ -237,7 +216,7 @@ mpc85xx_cds_init_IRQ(void) immap->im_intctl.ic_scprrh = 0x05309770; immap->im_intctl.ic_scprrl = 0x05309770; - request_irq(MPC85xx_IRQ_CPM, cpm2_cascade, SA_INTERRUPT, "cpm2_cascade", NULL); + setup_irq(MPC85xx_IRQ_CPM, &cpm2_irqaction); #endif return; @@ -302,16 +281,17 @@ mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) #define ARCADIA_HOST_BRIDGE_IDSEL 17 #define ARCADIA_2ND_BRIDGE_IDSEL 3 +extern int mpc85xx_pci1_last_busno; + int mpc85xx_exclude_device(u_char bus, u_char devfn) { if (bus == 0 && PCI_SLOT(devfn) == 0) return PCIBIOS_DEVICE_NOT_FOUND; #ifdef CONFIG_85xx_PCI2 - /* With the current code we know PCI2 will be bus 2, however this may - * not be guarnteed */ - if (bus == 2 && PCI_SLOT(devfn) == 0) - return PCIBIOS_DEVICE_NOT_FOUND; + if (mpc85xx_pci1_last_busno) + if (bus == (mpc85xx_pci1_last_busno + 1) && PCI_SLOT(devfn) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; #endif /* We explicitly do not go past the Tundra 320 Bridge */ if (bus == 1) @@ -331,10 +311,9 @@ mpc85xx_exclude_device(u_char bus, u_char devfn) static void __init mpc85xx_cds_setup_arch(void) { - struct ocp_def *def; - struct ocp_gfar_data *einfo; bd_t *binfo = (bd_t *) __res; unsigned int freq; + struct gianfar_platform_data *pdata; /* get the core frequency */ freq = binfo->bi_intfreq; @@ -368,17 +347,23 @@ mpc85xx_cds_setup_arch(void) invalidate_tlbcam_entry(NUM_TLBCAMS - 1); #endif - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 0); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enetaddr, 6); - } + /* setup the board related information for the enet controllers */ + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 0; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); + + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT5; + pdata->phyid = 1; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 1); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enet1addr, 6); - } #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) @@ -390,8 +375,6 @@ mpc85xx_cds_setup_arch(void) #else ROOT_DEV = Root_HDA1; #endif - - ocp_for_each_device(mpc85xx_update_paddr_ocp, &(binfo->bi_immr_base)); } /* ************************************************************************ */ @@ -414,11 +397,25 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, #ifdef CONFIG_SERIAL_TEXT_DEBUG { bd_t *binfo = (bd_t *) __res; + struct uart_port p; /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, - binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); + binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); + + memset(&p, 0, sizeof (p)); + p.iotype = SERIAL_IO_MEM; + p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART0_OFFSET; + p.uartclk = binfo->bi_busfreq; + + gen550_init(0, &p); + memset(&p, 0, sizeof (p)); + p.iotype = SERIAL_IO_MEM; + p.membase = (void *) binfo->bi_immr_base + MPC85xx_UART1_OFFSET; + p.uartclk = binfo->bi_busfreq; + + gen550_init(1, &p); } #endif @@ -440,6 +437,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, strcpy(cmd_line, (char *) (r6 + KERNELBASE)); } + identify_ppc_sys_by_id(mfspr(SVR)); + /* setup the PowerPC module struct */ ppc_md.setup_arch = mpc85xx_cds_setup_arch; ppc_md.show_cpuinfo = mpc85xx_cds_show_cpuinfo; diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h index a7290ed83..4d49a9791 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h @@ -60,8 +60,10 @@ #define MPC85XX_PCI1_IO_SIZE 0x01000000 /* PCI 2 memory map */ -#define MPC85XX_PCI2_LOWER_IO 0x01000000 -#define MPC85XX_PCI2_UPPER_IO 0x01ffffff +/* Note: the standard PPC fixups will cause IO space to get bumped by + * hose->io_base_virt - isa_io_base => MPC85XX_PCI1_IO_SIZE */ +#define MPC85XX_PCI2_LOWER_IO 0x00000000 +#define MPC85XX_PCI2_UPPER_IO 0x00ffffff #define MPC85XX_PCI2_LOWER_MEM 0xa0000000 #define MPC85XX_PCI2_UPPER_MEM 0xbfffffff @@ -71,8 +73,4 @@ #define MPC85XX_PCI2_IO_SIZE 0x01000000 -#define SERIAL_PORT_DFNS \ - STD_UART_OP(0) \ - STD_UART_OP(1) - #endif /* __MACH_MPC85XX_CDS_H__ */ diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c index 50cc50a0c..6a857b747 100644 --- a/arch/ppc/platforms/85xx/sbc8560.c +++ b/arch/ppc/platforms/85xx/sbc8560.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -48,37 +49,12 @@ #include #include #include -#include +#include #include #include #include -struct ocp_gfar_data mpc85xx_tsec1_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC1_TX, - .interruptError = MPC85xx_IRQ_TSEC1_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC1_RX, - .interruptPHY = MPC85xx_IRQ_EXT6, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR | GFAR_HAS_PHY_INTR), - .phyid = 25, - .phyregidx = 0, -}; - -struct ocp_gfar_data mpc85xx_tsec2_def = { - .interruptTransmit = MPC85xx_IRQ_TSEC2_TX, - .interruptError = MPC85xx_IRQ_TSEC2_ERROR, - .interruptReceive = MPC85xx_IRQ_TSEC2_RX, - .interruptPHY = MPC85xx_IRQ_EXT7, - .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR | GFAR_HAS_PHY_INTR), - .phyid = 26, - .phyregidx = 0, -}; - -struct ocp_fs_i2c_data mpc85xx_i2c1_def = { - .flags = FS_I2C_SEPARATE_DFSRR, -}; - - #ifdef CONFIG_SERIAL_8250 static void __init sbc8560_early_serial_map(void) @@ -125,10 +101,9 @@ sbc8560_early_serial_map(void) static void __init sbc8560_setup_arch(void) { - struct ocp_def *def; - struct ocp_gfar_data *einfo; bd_t *binfo = (bd_t *) __res; unsigned int freq; + struct gianfar_platform_data *pdata; /* get the core frequency */ freq = binfo->bi_intfreq; @@ -153,18 +128,22 @@ sbc8560_setup_arch(void) invalidate_tlbcam_entry(NUM_TLBCAMS - 1); #endif - /* Set up MAC addresses for the Ethernet devices */ - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 0); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enetaddr, 6); - } - - def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 1); - if (def) { - einfo = (struct ocp_gfar_data *) def->additions; - memcpy(einfo->mac_addr, binfo->bi_enet1addr, 6); - } + /* setup the board related information for the enet controllers */ + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT6; + pdata->phyid = 25; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); + + pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); + pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; + pdata->interruptPHY = MPC85xx_IRQ_EXT7; + pdata->phyid = 26; + /* fixup phy address */ + pdata->phy_reg_addr += binfo->bi_immr_base; + memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) @@ -176,8 +155,6 @@ sbc8560_setup_arch(void) #else ROOT_DEV = Root_HDA1; #endif - - ocp_for_each_device(mpc85xx_update_paddr_ocp, &(binfo->bi_immr_base)); } /* ************************************************************************ */ @@ -221,6 +198,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, strcpy(cmd_line, (char *) (r6 + KERNELBASE)); } + identify_ppc_sys_by_id(mfspr(SVR)); + /* setup the PowerPC module struct */ ppc_md.setup_arch = sbc8560_setup_arch; ppc_md.show_cpuinfo = sbc8560_show_cpuinfo; diff --git a/arch/ppc/platforms/85xx/sbc85xx.c b/arch/ppc/platforms/85xx/sbc85xx.c index 8cc3323a6..ddcca0d27 100644 --- a/arch/ppc/platforms/85xx/sbc85xx.c +++ b/arch/ppc/platforms/85xx/sbc85xx.c @@ -42,7 +42,6 @@ #include #include #include -#include #include @@ -142,8 +141,7 @@ sbc8560_show_cpuinfo(struct seq_file *m) seq_printf(m, "Machine\t\t: unknown\n"); break; } - seq_printf(m, "bus freq\t: %u.%.6u MHz\n", freq / 1000000, - freq % 1000000); + seq_printf(m, "clock\t\t: %dMHz\n", freq / 1000000); seq_printf(m, "PVR\t\t: 0x%x\n", pvid); seq_printf(m, "SVR\t\t: 0x%x\n", svid); diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile index c393f58e5..6ec8fe0b8 100644 --- a/arch/ppc/platforms/Makefile +++ b/arch/ppc/platforms/Makefile @@ -11,7 +11,7 @@ obj-$(CONFIG_PCI) += apus_pci.o endif obj-$(CONFIG_PPC_PMAC) += pmac_pic.o pmac_setup.o pmac_time.o \ pmac_feature.o pmac_pci.o pmac_sleep.o \ - pmac_low_i2c.o + pmac_low_i2c.o pmac_cache.o obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o ifeq ($(CONFIG_PPC_PMAC),y) @@ -23,10 +23,13 @@ obj-$(CONFIG_PREP_RESIDUAL) += residual.o obj-$(CONFIG_ADIR) += adir_setup.o adir_pic.o adir_pci.o obj-$(CONFIG_PQ2ADS) += pq2ads.o obj-$(CONFIG_TQM8260) += tqm8260_setup.o -obj-$(CONFIG_EV64260) += ev64260_setup.o +obj-$(CONFIG_CPCI690) += cpci690.o +obj-$(CONFIG_EV64260) += ev64260.o +obj-$(CONFIG_CHESTNUT) += chestnut.o obj-$(CONFIG_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o obj-$(CONFIG_K2) += k2.o obj-$(CONFIG_LOPEC) += lopec.o +obj-$(CONFIG_KATANA) += katana.o obj-$(CONFIG_MCPN765) += mcpn765.o obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o obj-$(CONFIG_MVME5100) += mvme5100.o diff --git a/arch/ppc/platforms/adir_pic.c b/arch/ppc/platforms/adir_pic.c index ecdf1237b..9947cba52 100644 --- a/arch/ppc/platforms/adir_pic.c +++ b/arch/ppc/platforms/adir_pic.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -20,11 +20,6 @@ static void adir_onboard_pic_enable(unsigned int irq); static void adir_onboard_pic_disable(unsigned int irq); -static void -no_action(int cpl, void *dev_id, struct pt_regs *regs) -{ -} - __init static void adir_onboard_pic_init(void) { @@ -88,6 +83,13 @@ static struct hw_interrupt_type adir_onboard_pic = { NULL }; +static struct irqaction noop_action = { + .handler = no_action, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "82c59 primary cascade", +}; + /* * Linux interrupt values are assigned as follows: * @@ -110,11 +112,7 @@ adir_init_IRQ(void) adir_onboard_pic_init(); /* Enable 8259 interrupt cascade */ - request_irq(ADIR_IRQ_VT82C686_INTR, - no_action, - SA_INTERRUPT, - "82c59 primary cascade", - NULL); + setup_irq(ADIR_IRQ_VT82C686_INTR, &noop_action); } int diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c index 8a4969ac7..2f74fde98 100644 --- a/arch/ppc/platforms/apus_setup.c +++ b/arch/ppc/platforms/apus_setup.c @@ -480,7 +480,7 @@ void cache_clear(__u32 addr, int length) void apus_restart(char *cmd) { - cli(); + local_irq_disable(); APUS_WRITE(APUS_REG_LOCK, REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2); diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c index e4ace971a..5bb6492ec 100644 --- a/arch/ppc/platforms/chrp_pci.c +++ b/arch/ppc/platforms/chrp_pci.c @@ -23,7 +23,7 @@ #include /* LongTrail */ -unsigned long gg2_pci_config_base; +void __iomem *gg2_pci_config_base; /* * The VLSI Golden Gate II has only 512K of PCI configuration space, so we @@ -33,7 +33,7 @@ unsigned long gg2_pci_config_base; int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 *val) { - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; struct pci_controller *hose = bus->sysdata; if (bus->number > 7) @@ -45,13 +45,13 @@ int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off); switch (len) { case 1: - *val = in_8((u8 *)cfg_data); + *val = in_8(cfg_data); break; case 2: - *val = in_le16((u16 *)cfg_data); + *val = in_le16(cfg_data); break; default: - *val = in_le32((u32 *)cfg_data); + *val = in_le32(cfg_data); break; } return PCIBIOS_SUCCESSFUL; @@ -60,7 +60,7 @@ int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, int __chrp gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 val) { - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; struct pci_controller *hose = bus->sysdata; if (bus->number > 7) @@ -72,13 +72,13 @@ int __chrp gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off); switch (len) { case 1: - out_8((u8 *)cfg_data, val); + out_8(cfg_data, val); break; case 2: - out_le16((u16 *)cfg_data, val); + out_le16(cfg_data, val); break; default: - out_le32((u32 *)cfg_data, val); + out_le32(cfg_data, val); break; } return PCIBIOS_SUCCESSFUL; @@ -97,8 +97,10 @@ int __chrp rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { + struct pci_controller *hose = bus->sysdata; unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) - | ((bus->number & 0xff) << 16); + | (((bus->number - hose->first_busno) & 0xff) << 16) + | (hose->index << 24); unsigned long ret = ~0UL; int rval; @@ -111,8 +113,10 @@ int __chrp rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { + struct pci_controller *hose = bus->sysdata; unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) - | ((bus->number & 0xff) << 16); + | (((bus->number - hose->first_busno) & 0xff) << 16) + | (hose->index << 24); int rval; rval = call_rtas("write-pci-config", 3, 1, NULL, addr, len, val); @@ -158,7 +162,7 @@ chrp_pcibios_fixup(void) struct device_node *np; /* PCI interrupts are controlled by the OpenPIC */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { np = pci_device_to_OF_node(dev); if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0)) dev->irq = np->intrs[0].line; @@ -186,6 +190,22 @@ setup_python(struct pci_controller *hose, struct device_node *dev) iounmap(reg); } +/* Marvell Discovery II based Pegasos 2 */ +static void __init setup_peg2(struct pci_controller *hose, struct device_node *dev) +{ + struct device_node *root = find_path_device("/"); + struct device_node *rtas; + + rtas = of_find_node_by_name (root, "rtas"); + if (rtas) { + hose->ops = &rtas_pci_ops; + } else { + printk ("RTAS supporting Pegasos OF not found, please upgrade" + " your firmware\n"); + } + pci_assign_all_busses = 1; +} + void __init chrp_find_bridges(void) { @@ -195,7 +215,7 @@ chrp_find_bridges(void) struct pci_controller *hose; unsigned int *dma; char *model, *machine; - int is_longtrail = 0, is_mot = 0; + int is_longtrail = 0, is_mot = 0, is_pegasos = 0; struct device_node *root = find_path_device("/"); /* @@ -207,6 +227,10 @@ chrp_find_bridges(void) if (machine != NULL) { is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0; is_mot = strncmp(machine, "MOT", 3) == 0; + if (strncmp(machine, "Pegasos2", 8) == 0) + is_pegasos = 2; + else if (strncmp(machine, "Pegasos", 7) == 0) + is_pegasos = 1; } for (dev = root->child; dev != NULL; dev = dev->sibling) { if (dev->type == NULL || strcmp(dev->type, "pci") != 0) @@ -253,10 +277,14 @@ chrp_find_bridges(void) || strncmp(model, "Motorola, Grackle", 17) == 0) { setup_grackle(hose); } else if (is_longtrail) { + void __iomem *p = ioremap(GG2_PCI_CONFIG_BASE, 0x80000); hose->ops = &gg2_pci_ops; - hose->cfg_data = (unsigned char *) - ioremap(GG2_PCI_CONFIG_BASE, 0x80000); - gg2_pci_config_base = (unsigned long) hose->cfg_data; + hose->cfg_data = p; + gg2_pci_config_base = p; + } else if (is_pegasos == 1) { + setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc); + } else if (is_pegasos == 2) { + setup_peg2(hose, dev); } else { printk("No methods for %s (model %s), using RTAS\n", dev->full_name, model); @@ -275,5 +303,7 @@ chrp_find_bridges(void) } } - ppc_md.pcibios_fixup = chrp_pcibios_fixup; + /* Do not fixup interrupts from OF tree on pegasos */ + if (is_pegasos == 0) + ppc_md.pcibios_fixup = chrp_pcibios_fixup; } diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c index 3514bb9ed..163df2adf 100644 --- a/arch/ppc/platforms/chrp_setup.c +++ b/arch/ppc/platforms/chrp_setup.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -68,6 +69,9 @@ void btext_progress(char *, unsigned short); extern unsigned long pmac_find_end_of_memory(void); extern int of_show_percpuinfo(struct seq_file *, int); +int _chrp_type; +EXPORT_SYMBOL(_chrp_type); + /* * XXX this should be in xmon.h, but putting it there means xmon.h * has to include (to get irqreturn_t), which @@ -118,13 +122,12 @@ chrp_show_cpuinfo(struct seq_file *m) if (!strncmp(model, "IBM,LongTrail", 13)) { /* VLSI VAS96011/12 `Golden Gate 2' */ /* Memory banks */ - sdramen = (in_le32((unsigned *)(gg2_pci_config_base+ - GG2_PCI_DRAM_CTRL)) + sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL) >>31) & 1; for (i = 0; i < (sdramen ? 4 : 6); i++) { - t = in_le32((unsigned *)(gg2_pci_config_base+ + t = in_le32(gg2_pci_config_base+ GG2_PCI_DRAM_BANK0+ - i*4)); + i*4); if (!(t & 1)) continue; switch ((t>>8) & 0x1f) { @@ -154,7 +157,7 @@ chrp_show_cpuinfo(struct seq_file *m) gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]); } /* L2 cache */ - t = in_le32((unsigned *)(gg2_pci_config_base+GG2_PCI_CC_CTRL)); + t = in_le32(gg2_pci_config_base+GG2_PCI_CC_CTRL); seq_printf(m, "board l2\t: %s %s (%s)\n", gg2_cachesizes[(t>>7) & 3], gg2_cachetypes[(t>>2) & 3], @@ -215,8 +218,33 @@ static void __init sio_init(void) } -void __init -chrp_setup_arch(void) +static void __init pegasos_set_l2cr(void) +{ + struct device_node *np; + + /* On Pegasos, enable the l2 cache if needed, as the OF forgets it */ + if (_chrp_type != _CHRP_Pegasos) + return; + + /* Enable L2 cache if needed */ + np = find_type_devices("cpu"); + if (np != NULL) { + unsigned int *l2cr = (unsigned int *) + get_property (np, "l2cr", NULL); + if (l2cr == NULL) { + printk ("Pegasos l2cr : no cpu l2cr property found\n"); + return; + } + if (!((*l2cr) & 0x80000000)) { + printk ("Pegasos l2cr : L2 cache was not active, " + "activating\n"); + _set_L2CR(0); + _set_L2CR((*l2cr) | 0x80000000); + } + } +} + +void __init chrp_setup_arch(void) { struct device_node *device; @@ -233,6 +261,9 @@ chrp_setup_arch(void) #endif ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */ + /* On pegasos, enable the L2 cache if not already done by OF */ + pegasos_set_l2cr(); + /* Lookup PCI host bridges */ chrp_find_bridges(); @@ -371,6 +402,14 @@ static void __init chrp_find_openpic(void) } } +#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) +static struct irqaction xmon_irqaction = { + .handler = xmon_irq, + .mask = CPU_MASK_NONE, + .name = "XMON break", +}; +#endif + void __init chrp_init_IRQ(void) { struct device_node *np; @@ -395,15 +434,17 @@ void __init chrp_init_IRQ(void) chrp_find_openpic(); - prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS); - OpenPIC_InitSenses = init_senses; - OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; + if (OpenPIC_Addr) { + prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS); + OpenPIC_InitSenses = init_senses; + OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; - openpic_init(NUM_8259_INTERRUPTS); - /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ - openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", - i8259_irq); + openpic_init(NUM_8259_INTERRUPTS); + /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ + openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", + i8259_irq); + } for (i = 0; i < NUM_8259_INTERRUPTS; i++) irq_desc[i].handler = &i8259_pic; i8259_init(chrp_int_ack); @@ -416,7 +457,7 @@ void __init chrp_init_IRQ(void) && strcmp(kbd->parent->type, "adb") == 0) break; if (kbd) - request_irq(HYDRA_INT_ADB_NMI, xmon_irq, 0, "XMON break", 0); + setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction); #endif } @@ -443,6 +484,9 @@ void __init chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { + struct device_node *root = find_path_device ("/"); + char *machine = NULL; + #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ if ( r6 ) @@ -457,12 +501,29 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, DMA_MODE_WRITE = 0x48; isa_io_base = CHRP_ISA_IO_BASE; /* default value */ + if (root) + machine = get_property(root, "model", NULL); + if (machine && strncmp(machine, "Pegasos", 7) == 0) { + _chrp_type = _CHRP_Pegasos; + } else if (machine && strncmp(machine, "IBM", 3) == 0) { + _chrp_type = _CHRP_IBM; + } else if (machine && strncmp(machine, "MOT", 3) == 0) { + _chrp_type = _CHRP_Motorola; + } else { + /* Let's assume it is an IBM chrp if all else fails */ + _chrp_type = _CHRP_IBM; + } + ppc_md.setup_arch = chrp_setup_arch; ppc_md.show_percpuinfo = of_show_percpuinfo; ppc_md.show_cpuinfo = chrp_show_cpuinfo; + ppc_md.irq_canonicalize = chrp_irq_canonicalize; ppc_md.init_IRQ = chrp_init_IRQ; - ppc_md.get_irq = openpic_get_irq; + if (_chrp_type == _CHRP_Pegasos) + ppc_md.get_irq = i8259_irq; + else + ppc_md.get_irq = openpic_get_irq; ppc_md.init = chrp_init2; diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c index 863d1e325..0ea1f7d9e 100644 --- a/arch/ppc/platforms/chrp_smp.c +++ b/arch/ppc/platforms/chrp_smp.c @@ -57,7 +57,7 @@ smp_chrp_setup_cpu(int cpu_nr) do_openpic_setup_cpu(); } -static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(timebase_lock); static unsigned int timebase_upper = 0, timebase_lower = 0; void __devinit diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c index 8421e55e9..e2be0c838 100644 --- a/arch/ppc/platforms/chrp_time.c +++ b/arch/ppc/platforms/chrp_time.c @@ -41,6 +41,8 @@ long __init chrp_time_init(void) int base; rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); + if (rtcs == NULL) + rtcs = find_compatible_devices("rtc", "ds1385-rtc"); if (rtcs == NULL || rtcs->addrs == NULL) return 0; base = rtcs->addrs[0].address; diff --git a/arch/ppc/platforms/ev64260.c b/arch/ppc/platforms/ev64260.c index 127588904..29d494dce 100644 --- a/arch/ppc/platforms/ev64260.c +++ b/arch/ppc/platforms/ev64260.c @@ -37,34 +37,25 @@ #include #include #include +#else +#include #endif #include #include #include -#include #include #include -#include #include #define BOARD_VENDOR "Marvell/Galileo" #define BOARD_MACHINE "EV-64260-BP" -/* Set IDE controllers into Native mode? */ -/* XXXX -#define SET_PCI_IDE_NATIVE -*/ - -ulong ev64260_mem_size = 0; -bd_t ppcboot_bd; -int ppcboot_bd_valid=0; - -static mv64x60_handle_t bh; +static struct mv64x60_handle bh; #if !defined(CONFIG_SERIAL_MPSC_CONSOLE) extern void gen550_progress(char *, unsigned short); -extern void gen550_init(int, struct serial_struct *); +extern void gen550_init(int, struct uart_port *); #endif static const unsigned int cpu_7xx[16] = { /* 7xx & 74xx (but not 745x) */ @@ -81,16 +72,7 @@ TODC_ALLOC(); static int ev64260_get_bus_speed(void) { - int speed; - - if (ppcboot_bd_valid) { - speed = ppcboot_bd.bi_busfreq; - } - else { - speed = 100000000; /* Only 100MHz is stable */ - } - - return speed; + return 100000000; } static int @@ -114,53 +96,10 @@ ev64260_get_cpu_speed(void) unsigned long __init ev64260_find_end_of_memory(void) { - if(!ppcboot_bd_valid) { - return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE, - MV64x60_TYPE_GT64260A); - } - return ppcboot_bd.bi_memsize; + return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE, + MV64x60_TYPE_GT64260A); } -#if 0 /* XXXX */ -#ifdef SET_PCI_IDE_NATIVE -static void __init -set_pci_native_mode(void) -{ - struct pci_dev *dev; - - /* Better way of doing this ??? */ - pci_for_each_dev(dev) { - int class = dev->class >> 8; - - /* enable pci native mode */ - if (class == PCI_CLASS_STORAGE_IDE) { - u8 reg; - - pci_read_config_byte(dev, 0x9, ®); - if (reg == 0x8a) { - printk("PCI: Enabling PCI IDE native mode on %s\n", dev->slot_name); - pci_write_config_byte(dev, 0x9, 0x8f); - - /* let the pci code set this device up after we change it */ - pci_setup_device(dev); - } else if (reg != 0x8f) { - printk("PCI: IDE chip in unknown mode 0x%02x on %s", reg, dev->slot_name); - } - } - } -} -#endif -#endif - -static void __init -ev64260_pci_fixups(void) -{ -#ifdef SET_PCI_IDE_NATIVE - set_pci_native_mode(); -#endif -} - - /* * Marvell/Galileo EV-64260-BP Evaluation Board PCI interrupt routing. * Note: By playing with J8 and JP1-4, you can get 2 IRQ's from the first @@ -175,7 +114,7 @@ ev64260_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) if (hose->index == 0) { static char pci_irq_table[][4] = /* - * PCI IDSEL/INTPIN->INTLINE + * PCI IDSEL/INTPIN->INTLINE * A B C D */ { @@ -189,7 +128,7 @@ ev64260_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) else { static char pci_irq_table[][4] = /* - * PCI IDSEL/INTPIN->INTLINE + * PCI IDSEL/INTPIN->INTLINE * A B C D */ { @@ -207,27 +146,31 @@ ev64260_setup_peripherals(void) { mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN, EV64260_EMB_FLASH_BASE, EV64260_EMB_FLASH_SIZE, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, EV64260_EXT_SRAM_BASE, EV64260_EXT_SRAM_SIZE, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, EV64260_TODC_BASE, EV64260_TODC_SIZE, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN, EV64260_UART_BASE, EV64260_UART_SIZE, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN, EV64260_EXT_FLASH_BASE, EV64260_EXT_FLASH_SIZE, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN); TODC_INIT(TODC_TYPE_DS1501, 0, 0, ioremap(EV64260_TODC_BASE, EV64260_TODC_SIZE), 8); - mv64x60_clr_bits(&bh, MV64x60_CPU_CONFIG, ((1<<28) | (1<<29))); + mv64x60_clr_bits(&bh, MV64x60_CPU_CONFIG,((1<<12) | (1<<28) | (1<<29))); mv64x60_set_bits(&bh, MV64x60_CPU_CONFIG, (1<<27)); - if (ev64260_get_bus_speed() > 100000000) { + if (ev64260_get_bus_speed() > 100000000) mv64x60_set_bits(&bh, MV64x60_CPU_CONFIG, (1<<23)); - } - mv64x60_set_bits(&bh, MV64x60_PCI0_PCI_DECODE_CNTL,((1<<0) | (1<<3))); - mv64x60_set_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL,((1<<0) | (1<<3))); + mv64x60_set_bits(&bh, MV64x60_PCI0_PCI_DECODE_CNTL, ((1<<0) | (1<<3))); + mv64x60_set_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, ((1<<0) | (1<<3))); /* * Enabling of PCI internal-vs-external arbitration @@ -240,6 +183,22 @@ ev64260_setup_peripherals(void) mv64x60_set_bits(&bh, MV64x60_CPU_MASTER_CNTL, (1<<9)); /* Only 1 cpu */ + /* + * Turn off timer/counters. Not turning off watchdog timer because + * can't read its reg on the 64260A so don't know if we'll be enabling + * or disabling. + */ + mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL, + ((1<<0) | (1<<8) | (1<<16) | (1<<24))); + mv64x60_clr_bits(&bh, GT64260_TIMR_CNTR_4_7_CNTL, + ((1<<0) | (1<<8) | (1<<16) | (1<<24))); + + /* + * Set MPSC Multiplex RMII + * NOTE: ethernet driver modifies bit 0 and 1 + */ + mv64x60_write(&bh, GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102); + /* * The EV-64260-BP uses several Multi-Purpose Pins (MPP) on the 64260 * bridge as interrupt inputs (via the General Purpose Ports (GPP) @@ -258,8 +217,7 @@ ev64260_setup_peripherals(void) * MPP 27 -> GPP 27 (PCI 0 INTA) bits 12-15 -> 0 * MPP 29 -> GPP 29 (PCI 1 INTA) bits 20-23 -> 0 */ - mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_3, - (0xf<<8) | (0xf<<12) | (0xf<<20)); + mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_3, (0xf<<8)|(0xf<<12)|(0xf<<20)); #define GPP_EXTERNAL_INTERRUPTS \ ((1<<21) | (1<<22) | (1<<26) | (1<<27) | (1<<29)) @@ -272,75 +230,44 @@ ev64260_setup_peripherals(void) mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~GPP_EXTERNAL_INTERRUPTS); mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, GPP_EXTERNAL_INTERRUPTS); - /* - * Set MPSC Multiplex RMII - * NOTE: ethernet driver modifies bit 0 and 1 - */ - mv64x60_write(&bh, GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102); return; } - static void __init ev64260_setup_bridge(void) { - mv64x60_setup_info_t si; - int i; + struct mv64x60_setup_info si; + int i; memset(&si, 0, sizeof(si)); si.phys_reg_base = CONFIG_MV64X60_NEW_BASE; - si.map_irq = ev64260_map_irq; si.pci_0.enable_bus = 1; - si.pci_0.enumerate_bus = 1; - si.pci_0.pci_io.cpu_base = 0xa0000000; + si.pci_0.pci_io.cpu_base = EV64260_PCI0_IO_CPU_BASE; si.pci_0.pci_io.pci_base_hi = 0; - si.pci_0.pci_io.pci_base_lo = 0; - si.pci_0.pci_io.size = 0x01000000; - si.pci_0.pci_io.swap = 0x01000000; /* XXXX No swapping */ - si.pci_0.pci_mem[0].cpu_base = 0x80000000; + si.pci_0.pci_io.pci_base_lo = EV64260_PCI0_IO_PCI_BASE; + si.pci_0.pci_io.size = EV64260_PCI0_IO_SIZE; + si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE; + si.pci_0.pci_mem[0].cpu_base = EV64260_PCI0_MEM_CPU_BASE; si.pci_0.pci_mem[0].pci_base_hi = 0; - si.pci_0.pci_mem[0].pci_base_lo = 0x80000000; - si.pci_0.pci_mem[0].size = 0x10000000; - si.pci_0.pci_mem[0].swap = 0x01000000; /* XXXX No swapping */ - si.pci_0.pci_mem[1].cpu_base = 0; - si.pci_0.pci_mem[1].pci_base_hi = 0; - si.pci_0.pci_mem[1].pci_base_lo = 0; - si.pci_0.pci_mem[1].size = 0; /* Don't use this window */ - si.pci_0.pci_mem[1].swap = 0; - si.pci_0.pci_mem[2].cpu_base = 0; - si.pci_0.pci_mem[2].pci_base_hi = 0; - si.pci_0.pci_mem[2].pci_base_lo = 0; - si.pci_0.pci_mem[2].size = 0; /* Don't use this window */ - si.pci_0.pci_mem[1].swap = 0; + si.pci_0.pci_mem[0].pci_base_lo = EV64260_PCI0_MEM_PCI_BASE; + si.pci_0.pci_mem[0].size = EV64260_PCI0_MEM_SIZE; + si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE; si.pci_0.pci_cmd_bits = 0; si.pci_0.latency_timer = 0x8; si.pci_1.enable_bus = 1; - si.pci_1.enumerate_bus = 1; - si.pci_1.pci_io.cpu_base = 0xa1000000; + si.pci_1.pci_io.cpu_base = EV64260_PCI1_IO_CPU_BASE; si.pci_1.pci_io.pci_base_hi = 0; - si.pci_1.pci_io.pci_base_lo = 0x01000000; - si.pci_1.pci_io.size = 0x01000000; - si.pci_1.pci_io.swap = 0x01000000; /* XXXX No swapping */ - si.pci_1.pci_mem[0].cpu_base = 0x90000000; + si.pci_1.pci_io.pci_base_lo = EV64260_PCI1_IO_PCI_BASE; + si.pci_1.pci_io.size = EV64260_PCI1_IO_SIZE; + si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE; + si.pci_1.pci_mem[0].cpu_base = EV64260_PCI1_MEM_CPU_BASE; si.pci_1.pci_mem[0].pci_base_hi = 0; - si.pci_1.pci_mem[0].pci_base_lo = 0x90000000; - si.pci_1.pci_mem[0].size = 0x10000000; - si.pci_1.pci_mem[0].swap = 0x01000000; /* XXXX No swapping */ - si.pci_1.pci_mem[1].cpu_base = 0; - si.pci_1.pci_mem[1].pci_base_hi = 0; - si.pci_1.pci_mem[1].pci_base_lo = 0; - si.pci_1.pci_mem[1].size = 0; /* Don't use this window */ - si.pci_1.pci_mem[1].swap = 0; - si.pci_1.pci_mem[2].cpu_base = 0; - si.pci_1.pci_mem[2].pci_base_hi = 0; - si.pci_1.pci_mem[2].pci_base_lo = 0; - si.pci_1.pci_mem[2].size = 0; /* Don't use this window */ - si.pci_1.pci_mem[1].swap = 0; - si.pci_1.pci_cmd_bits = 0; - si.pci_1.latency_timer = 0x8; + si.pci_1.pci_mem[0].pci_base_lo = EV64260_PCI1_MEM_PCI_BASE; + si.pci_1.pci_mem[0].size = EV64260_PCI1_MEM_SIZE; + si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE; si.pci_1.pci_cmd_bits = 0; si.pci_1.latency_timer = 0x8; @@ -348,9 +275,6 @@ ev64260_setup_bridge(void) si.cpu_prot_options[i] = 0; si.cpu_snoop_options[i] = GT64260_CPU_SNOOP_WB; si.pci_0.acc_cntl_options[i] = - /* Breaks PCI (especially slot 4) - GT64260_PCI_ACC_CNTL_PREFETCHEN | - */ GT64260_PCI_ACC_CNTL_DREADEN | GT64260_PCI_ACC_CNTL_RDPREFETCH | GT64260_PCI_ACC_CNTL_RDLINEPREFETCH | @@ -359,9 +283,6 @@ ev64260_setup_bridge(void) GT64260_PCI_ACC_CNTL_MBURST_32_BTYES; si.pci_0.snoop_options[i] = GT64260_PCI_SNOOP_WB; si.pci_1.acc_cntl_options[i] = - /* Breaks PCI (especially slot 4) - GT64260_PCI_ACC_CNTL_PREFETCHEN | - */ GT64260_PCI_ACC_CNTL_DREADEN | GT64260_PCI_ACC_CNTL_RDPREFETCH | GT64260_PCI_ACC_CNTL_RDLINEPREFETCH | @@ -372,9 +293,24 @@ ev64260_setup_bridge(void) } /* Lookup PCI host bridges */ - if (mv64x60_init(&bh, &si)) { - printk("Bridge initialization failed.\n"); - } + if (mv64x60_init(&bh, &si)) + printk(KERN_ERR "Bridge initialization failed.\n"); + + pci_dram_offset = 0; /* System mem at same addr on PCI & cpu bus */ + ppc_md.pci_swizzle = common_swizzle; + ppc_md.pci_map_irq = ev64260_map_irq; + ppc_md.pci_exclude_device = mv64x60_pci_exclude_device; + + mv64x60_set_bus(&bh, 0, 0); + bh.hose_a->first_busno = 0; + bh.hose_a->last_busno = 0xff; + bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0); + + bh.hose_b->first_busno = bh.hose_a->last_busno + 1; + mv64x60_set_bus(&bh, 1, bh.hose_b->first_busno); + bh.hose_b->last_busno = 0xff; + bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b, + bh.hose_b->first_busno); return; } @@ -400,23 +336,9 @@ ev64260_early_serial_map(void) gen550_init(0, &port); #endif - if (early_serial_setup(&port) != 0) { - printk("Early serial init of port 0 failed\n"); - } - -#if 0 /* XXXX */ - /* Assume early_serial_setup() doesn't modify port */ - port.membase = ioremap(EV64260_SERIAL_1, EV64260_UART_SIZE); - port.irq = EV64260_UART_1_IRQ; - -#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) - gen550_init(1, &port); -#endif - - if (early_serial_setup(&port) != 0) { - printk("Early serial init of port 1 failed\n"); - } -#endif + if (early_serial_setup(&port) != 0) + printk(KERN_WARNING "Early serial init of port 0" + "failed\n"); first_time = 0; } @@ -427,63 +349,13 @@ ev64260_early_serial_map(void) static void __init ev64260_early_serial_map(void) { -#ifdef CONFIG_KGDB - static char first_time = 1; - - -#if defined(CONFIG_KGDB_TTYS0) -#define KGDB_PORT 0 -#elif defined(CONFIG_KGDB_TTYS1) -#define KGDB_PORT 1 -#else -#error "Invalid kgdb_tty port" -#endif - - if (first_time) { - gt_early_mpsc_init(KGDB_PORT, B9600|CS8|CREAD|HUPCL|CLOCAL); - first_time = 0; - } - - return; -#endif } #endif -static void __init -ev64260_fixup_ocp(void) -{ -#if defined(CONFIG_SERIAL_MPSC) - struct ocp_device *dev; - mv64x60_ocp_mpsc_data_t *dp; - - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 0)) - != NULL) { - dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - - dp->max_idle = 40; /* XXXX what should this be? */ - dp->default_baud = EV64260_DEFAULT_BAUD; - dp->brg_clk_src = EV64260_MPSC_CLK_SRC; - dp->brg_clk_freq = EV64260_MPSC_CLK_FREQ; - } - - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 1)) - != NULL) { - dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - - dp->max_idle = 40; /* XXXX what should this be? */ - dp->default_baud = 9600; /* XXXX */ - dp->brg_clk_src = EV64260_MPSC_CLK_SRC; - dp->brg_clk_freq = EV64260_MPSC_CLK_FREQ; - } -#endif - - return; -} - static void __init ev64260_setup_arch(void) { - if ( ppc_md.progress ) + if (ppc_md.progress) ppc_md.progress("ev64260_setup_arch: enter", 0); #ifdef CONFIG_BLK_DEV_INITRD @@ -497,41 +369,79 @@ ev64260_setup_arch(void) ROOT_DEV = Root_SDA2; #endif - if ( ppc_md.progress ) + if (ppc_md.progress) ppc_md.progress("ev64260_setup_arch: Enabling L2 cache", 0); /* Enable L2 and L3 caches (if 745x) */ _set_L2CR(_get_L2CR() | L2CR_L2E); _set_L3CR(_get_L3CR() | L3CR_L3E); - if ( ppc_md.progress ) + if (ppc_md.progress) ppc_md.progress("ev64260_setup_arch: Initializing bridge", 0); ev64260_setup_bridge(); /* set up PCI bridge(s) */ ev64260_setup_peripherals(); /* set up chip selects/GPP/MPP etc */ - if ( ppc_md.progress ) + if (ppc_md.progress) ppc_md.progress("ev64260_setup_arch: bridge init complete", 0); - /* Set OCP values to reflect this board's setup */ - ev64260_fixup_ocp(); - -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_MPSC_CONSOLE) ev64260_early_serial_map(); #endif - printk(BOARD_VENDOR " " BOARD_MACHINE "\n"); - printk("EV-64260-BP port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n"); + printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc." + "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE); - if ( ppc_md.progress ) + if (ppc_md.progress) ppc_md.progress("ev64260_setup_arch: exit", 0); return; } +/* Platform device data fixup routines. */ +#if defined(CONFIG_SERIAL_MPSC) +static void __init +ev64260_fixup_mpsc_pdata(struct platform_device *pdev) +{ + struct mpsc_pdata *pdata; + + pdata = (struct mpsc_pdata *)pdev->dev.platform_data; + + pdata->max_idle = 40; + pdata->default_baud = EV64260_DEFAULT_BAUD; + pdata->brg_clk_src = EV64260_MPSC_CLK_SRC; + pdata->brg_clk_freq = EV64260_MPSC_CLK_FREQ; + + return; +} + +static int __init +ev64260_platform_notify(struct device *dev) +{ + static struct { + char *bus_id; + void ((*rtn)(struct platform_device *pdev)); + } dev_map[] = { + { MPSC_CTLR_NAME "0", ev64260_fixup_mpsc_pdata }, + { MPSC_CTLR_NAME "1", ev64260_fixup_mpsc_pdata }, + }; + struct platform_device *pdev; + int i; + + if (dev && dev->bus_id) + for (i=0; ibus_id, dev_map[i].bus_id, + BUS_ID_SIZE)) { + + pdev = container_of(dev, + struct platform_device, dev); + dev_map[i].rtn(pdev); + } + + return 0; +} +#endif + static void ev64260_reset_board(void *addr) { @@ -557,28 +467,25 @@ ev64260_reset_board(void *addr) /* unmap any other random cs's that might overlap with bootcs */ mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, 0, 0, 0); + bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, 0, 0, 0); + bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN, 0, 0, 0); + bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN); mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN, 0, 0, 0); + bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN); /* map bootrom back in to gt @ reset defaults */ mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN, 0xff800000, 8*1024*1024, 0); + bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN); - /* move gt reg base back to default, setup default pci0 swapping - * config... */ + /* move reg base back to default, setup default pci0 */ mv64x60_write(&bh, MV64x60_INTERNAL_SPACE_DECODE, - (1<<24) | MV64x60_INTERNAL_SPACE_DEFAULT_ADDR>>20); + (1<<24) | CONFIG_MV64X60_BASE >> 20); /* NOTE: FROM NOW ON no more GT_REGS accesses.. 0x1 is not mapped * via BAT or MMU, and MSR IR/DR is ON */ -#if 0 - /* BROKEN... IR/DR is still on !! won't work!! */ - /* Set exception prefix high - to the firmware */ - _nmask_and_or_msr(0, MSR_IP); - - out_8((u_char *)EV64260_BOARD_MODRST_REG, 0x01); -#else /* SRR0 has system reset vector, SRR1 has default MSR value */ /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */ /* NOTE: assumes reset vector is at 0xfff00100 */ @@ -588,7 +495,7 @@ ev64260_reset_board(void *addr) "mtspr 27,4\n\t" "rfi\n\t" :: "r" (addr):"r4"); -#endif + return; } @@ -640,7 +547,7 @@ ev64260_calibrate_decr(void) freq = ev64260_get_bus_speed()/4; - printk("time_init: decrementer frequency = %lu.%.6lu MHz\n", + printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n", freq/1000000, freq%1000000); tb_ticks_per_jiffy = freq / HZ; @@ -649,142 +556,6 @@ ev64260_calibrate_decr(void) return; } -#if 0 /* XXXX */ -#ifdef CONFIG_USE_PPCBOOT -static void parse_ppcbootinfo(unsigned long r3, - unsigned long r4, unsigned long r5, - unsigned long r6, unsigned long r7) -{ - bd_t *bd=NULL; - char *cmdline_start=NULL; - int cmdline_len=0; - - if(r3) { - if((r3 & 0xf0000000) == 0) r3 += KERNELBASE; - if((r3 & 0xf0000000) == KERNELBASE) { - bd=(void *)r3; - - /* hack for ppcboot loaders that report freqs in Mhz */ - if(bd->bi_intfreq<1000000) bd->bi_intfreq*=1000000; - if(bd->bi_busfreq<1000000) bd->bi_busfreq*=1000000; - - memcpy(&ppcboot_bd,bd,sizeof(ppcboot_bd)); - ppcboot_bd_valid=1; - } - } - -#ifdef CONFIG_BLK_DEV_INITRD - if(r4 && r5 && r5>r4) { - if((r4 & 0xf0000000) == 0) r4 += KERNELBASE; - if((r5 & 0xf0000000) == 0) r5 += KERNELBASE; - if((r4 & 0xf0000000) == KERNELBASE) { - initrd_start=r4; - initrd_end=r5; - initrd_below_start_ok = 1; - } - } -#endif /* CONFIG_BLK_DEV_INITRD */ - - if(r6 && r7 && r7>r6) { - if((r6 & 0xf0000000) == 0) r6 += KERNELBASE; - if((r7 & 0xf0000000) == 0) r7 += KERNELBASE; - if((r6 & 0xf0000000) == KERNELBASE) { - cmdline_start=(void *)r6; - cmdline_len=(r7-r6); - strncpy(cmd_line,cmdline_start,cmdline_len); - } - } - - if(ppcboot_bd_valid) { - printk("found bd_t @%p\n", bd); - printk("memstart=%08lx\n", bd->bi_memstart); - printk("memsize=%08lx\n", bd->bi_memsize); - printk("enetaddr=%02x%02x%02x%02x%02x%02x\n", - bd->bi_enetaddr[0], - bd->bi_enetaddr[1], - bd->bi_enetaddr[2], - bd->bi_enetaddr[3], - bd->bi_enetaddr[4], - bd->bi_enetaddr[5] - ); - printk("intfreq=%ld\n", bd->bi_intfreq); - printk("busfreq=%ld\n", bd->bi_busfreq); - printk("baudrate=%ld\n", bd->bi_baudrate); - } - -#ifdef CONFIG_BLK_DEV_INITRD - if(initrd_start) { - printk("found initrd @%lx-%lx\n", initrd_start, initrd_end); - } -#endif /* CONFIG_BLK_DEV_INITRD */ - - if(cmdline_start && cmdline_len) { - printk("found cmdline: '%s'\n", cmd_line); - } -} -#endif /* USE PPC_BOOT */ -#endif - -#if 0 /* XXXX */ -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -static int -ev64260_ide_check_region(ide_ioreg_t from, unsigned int extent) -{ - return check_region(from, extent); -} - -static void -ev64260_ide_request_region(ide_ioreg_t from, - unsigned int extent, - const char *name) -{ - request_region(from, extent, name); - return; -} - -static void -ev64260_ide_release_region(ide_ioreg_t from, - unsigned int extent) -{ - release_region(from, extent); - return; -} - -static void __init -ev64260_ide_pci_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, - ide_ioreg_t ctrl_port, int *irq) -{ - struct pci_dev *dev; -#if 1 /* NTL */ - int i; - - //printk("regs %d to %d @ 0x%x\n", IDE_DATA_OFFSET, IDE_STATUS_OFFSET, data_port); - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = data_port; - data_port++; - } - - //printk("ctrl %d @ 0x%x\n", IDE_CONTROL_OFFSET, ctrl_port); - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; -#endif - - pci_for_each_dev(dev) { - if (((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) || - ((dev->class >> 8) == PCI_CLASS_STORAGE_RAID)) { - hw->irq = dev->irq; - - if (irq != NULL) { - *irq = dev->irq; - } - } - } - - return; -} -#endif -#endif - -#if !defined(CONFIG_USE_PPCBOOT) /* * Set BAT 3 to map 0xfb000000 to 0xfc000000 of physical memory space. */ @@ -798,7 +569,6 @@ ev64260_set_bat(void) return; } -#endif #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) static void __init @@ -819,18 +589,11 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, initrd_below_start_ok=0; #endif /* CONFIG_BLK_DEV_INITRD */ - ppcboot_bd_valid=0; - memset(&ppcboot_bd,0,sizeof(ppcboot_bd)); - -#ifdef CONFIG_USE_PPCBOOT - parse_ppcbootinfo(r3, r4, r5, r6, r7); -#else parse_bootinfo(find_bootinfo()); -#endif isa_mem_base = 0; - isa_io_base = 0xa0000000; /* XXXX */ - pci_dram_offset = 0x80000000; /* XXXX */ + isa_io_base = EV64260_PCI0_IO_CPU_BASE; + pci_dram_offset = EV64260_PCI0_MEM_CPU_BASE; loops_per_jiffy = ev64260_get_cpu_speed() / HZ; @@ -839,8 +602,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.init_IRQ = gt64260_init_irq; ppc_md.get_irq = gt64260_get_irq; - ppc_md.pcibios_fixup = ev64260_pci_fixups; - ppc_md.restart = ev64260_restart; ppc_md.power_off = ev64260_power_off; ppc_md.halt = ev64260_halt; @@ -852,21 +613,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.time_init = todc_time_init; ppc_md.set_rtc_time = todc_set_rtc_time; ppc_md.get_rtc_time = todc_get_rtc_time; - ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; - ppc_md.calibrate_decr = ev64260_calibrate_decr; -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) - ppc_ide_md.ide_init_hwif = ev64260_ide_pci_init_hwif_ports; -#endif - bh.p_base = CONFIG_MV64X60_NEW_BASE; -#if !defined(CONFIG_USE_PPCBOOT) ev64260_set_bat(); -#endif #ifdef CONFIG_SERIAL_8250 #if defined(CONFIG_SERIAL_TEXT_DEBUG) @@ -880,13 +633,18 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, #elif defined(CONFIG_SERIAL_MPSC_CONSOLE) #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.setup_io_mappings = ev64260_map_io; - ppc_md.progress = gt64260_mpsc_progress; + ppc_md.progress = mv64x60_mpsc_progress; + mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE); #endif /* CONFIG_SERIAL_TEXT_DEBUG */ #ifdef CONFIG_KGDB ppc_md.setup_io_mappings = ev64260_map_io; ppc_md.early_serial_map = ev64260_early_serial_map; #endif /* CONFIG_KGDB */ +#endif + +#if defined(CONFIG_SERIAL_MPSC) + platform_notify = ev64260_platform_notify; #endif return; diff --git a/arch/ppc/platforms/ev64260.h b/arch/ppc/platforms/ev64260.h index bc826d62e..bedffced3 100644 --- a/arch/ppc/platforms/ev64260.h +++ b/arch/ppc/platforms/ev64260.h @@ -5,38 +5,103 @@ * * Author: Mark A. Greer * - * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * 2001-2002 (c) MontaVista, Software, Inc. 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. */ /* - * The GT64260 has 2 PCI buses each with 1 window from the CPU bus to + * The MV64x60 has 2 PCI buses each with 1 window from the CPU bus to * PCI I/O space and 4 windows from the CPU bus to PCI MEM space. * We'll only use one PCI MEM window on each PCI bus. + * + * This is the CPU physical memory map (windows must be at least 1MB and start + * on a boundary that is a multiple of the window size): + * + * 0xfc000000-0xffffffff - External FLASH on device module + * 0xfbf00000-0xfbffffff - Embedded (on board) FLASH + * 0xfbe00000-0xfbefffff - GT64260 Registers (preferably) + * but really a config option + * 0xfbd00000-0xfbdfffff - External SRAM on device module + * 0xfbc00000-0xfbcfffff - TODC chip on device module + * 0xfbb00000-0xfbbfffff - External UART on device module + * 0xa2000000-0xfbafffff - + * 0xa1000000-0xa1ffffff - PCI 1 I/O (defined in gt64260.h) + * 0xa0000000-0xa0ffffff - PCI 0 I/O (defined in gt64260.h) + * 0x90000000-0x9fffffff - PCI 1 MEM (defined in gt64260.h) + * 0x80000000-0x8fffffff - PCI 0 MEM (defined in gt64260.h) */ #ifndef __PPC_PLATFORMS_EV64260_H #define __PPC_PLATFORMS_EV64260_H -#define EV64260_BRIDGE_REG_BASE 0xf8000000 -#define EV64260_BRIDGE_REG_BASE_TO_TOP 0x08000000U +/* PCI mappings */ +#define EV64260_PCI0_IO_CPU_BASE 0xa0000000 +#define EV64260_PCI0_IO_PCI_BASE 0x00000000 +#define EV64260_PCI0_IO_SIZE 0x01000000 + +#define EV64260_PCI0_MEM_CPU_BASE 0x80000000 +#define EV64260_PCI0_MEM_PCI_BASE 0x80000000 +#define EV64260_PCI0_MEM_SIZE 0x10000000 + +#define EV64260_PCI1_IO_CPU_BASE (EV64260_PCI0_IO_CPU_BASE + \ + EV64260_PCI0_IO_SIZE) +#define EV64260_PCI1_IO_PCI_BASE (EV64260_PCI0_IO_PCI_BASE + \ + EV64260_PCI0_IO_SIZE) +#define EV64260_PCI1_IO_SIZE 0x01000000 + +#define EV64260_PCI1_MEM_CPU_BASE (EV64260_PCI0_MEM_CPU_BASE + \ + EV64260_PCI0_MEM_SIZE) +#define EV64260_PCI1_MEM_PCI_BASE (EV64260_PCI0_MEM_PCI_BASE + \ + EV64260_PCI0_MEM_SIZE) +#define EV64260_PCI1_MEM_SIZE 0x10000000 + +/* CPU Physical Memory Map setup (other than PCI) */ +#define EV64260_EXT_FLASH_BASE 0xfc000000 +#define EV64260_EMB_FLASH_BASE 0xfbf00000 +#define EV64260_EXT_SRAM_BASE 0xfbd00000 +#define EV64260_TODC_BASE 0xfbc00000 +#define EV64260_UART_BASE 0xfbb00000 + +#define EV64260_EXT_FLASH_SIZE_ACTUAL 0x04000000 /* <= 64MB Extern FLASH */ +#define EV64260_EMB_FLASH_SIZE_ACTUAL 0x00080000 /* 512KB of Embed FLASH */ +#define EV64260_EXT_SRAM_SIZE_ACTUAL 0x00100000 /* 1MB SDRAM */ +#define EV64260_TODC_SIZE_ACTUAL 0x00000020 /* 32 bytes for TODC */ +#define EV64260_UART_SIZE_ACTUAL 0x00000040 /* 64 bytes for DUART */ + +#define EV64260_EXT_FLASH_SIZE max(GT64260_WINDOW_SIZE_MIN, \ + EV64260_EXT_FLASH_SIZE_ACTUAL) +#define EV64260_EMB_FLASH_SIZE max(GT64260_WINDOW_SIZE_MIN, \ + EV64260_EMB_FLASH_SIZE_ACTUAL) +#define EV64260_EXT_SRAM_SIZE max(GT64260_WINDOW_SIZE_MIN, \ + EV64260_EXT_SRAM_SIZE_ACTUAL) +#define EV64260_TODC_SIZE max(GT64260_WINDOW_SIZE_MIN, \ + EV64260_TODC_SIZE_ACTUAL) +/* Assembler in bootwrapper blows up if 'max' is used */ +#define EV64260_UART_SIZE GT64260_WINDOW_SIZE_MIN +#define EV64260_UART_END ((EV64260_UART_BASE + \ + EV64260_UART_SIZE - 1) & 0xfff00000) -#define EV64260_TODC_BASE 0xfc800000 -#define EV64260_TODC_LEN 0x00800000 -#define EV64260_TODC_END (EV64260_TODC_BASE + \ - EV64260_TODC_LEN - 1) +/* Board-specific IRQ info */ +#define EV64260_UART_0_IRQ 85 +#define EV64260_UART_1_IRQ 86 +#define EV64260_PCI_0_IRQ 91 +#define EV64260_PCI_1_IRQ 93 -#define EV64260_UART_BASE 0xfd000000 -#define EV64260_UART_LEN 0x00800000 -#define EV64260_UART_END (EV64260_UART_BASE + \ - EV64260_UART_LEN - 1) -/* Serial driver setup. */ +/* Serial port setup */ +#define EV64260_DEFAULT_BAUD 115200 + +#if defined(CONFIG_SERIAL_MPSC_CONSOLE) +#define SERIAL_PORT_DFNS + +#define EV64260_MPSC_CLK_SRC 8 /* TCLK */ +#define EV64260_MPSC_CLK_FREQ 100000000 /* 100MHz clk */ +#else #define EV64260_SERIAL_0 (EV64260_UART_BASE + 0x20) #define EV64260_SERIAL_1 EV64260_UART_BASE -#define BASE_BAUD ( 3686400 / 16 ) +#define BASE_BAUD (EV64260_DEFAULT_BAUD * 2) #ifdef CONFIG_SERIAL_MANY_PORTS #define RS_TABLE_SIZE 64 @@ -50,18 +115,14 @@ #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) #endif -#if !defined(CONFIG_GT64260_CONSOLE) /* Required for bootloader's ns16550.c code */ #define STD_SERIAL_PORT_DFNS \ - { 0, BASE_BAUD, EV64260_SERIAL_0, 85, STD_COM_FLAGS, /* ttyS0 */\ - iomem_base: (u8 *)EV64260_SERIAL_0, \ + { 0, BASE_BAUD, EV64260_SERIAL_0, EV64260_UART_0_IRQ, STD_COM_FLAGS, \ + iomem_base: (u8 *)EV64260_SERIAL_0, /* ttyS0 */ \ iomem_reg_shift: 2, \ io_type: SERIAL_IO_MEM }, #define SERIAL_PORT_DFNS \ STD_SERIAL_PORT_DFNS -#else -#define SERIAL_PORT_DFNS #endif - #endif /* __PPC_PLATFORMS_EV64260_H */ diff --git a/arch/ppc/platforms/gemini_pci.c b/arch/ppc/platforms/gemini_pci.c index 17b251c44..95656091b 100644 --- a/arch/ppc/platforms/gemini_pci.c +++ b/arch/ppc/platforms/gemini_pci.c @@ -15,7 +15,7 @@ void __init gemini_pcibios_fixup(void) int i; struct pci_dev *dev = NULL; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { for(i = 0; i < 6; i++) { if (dev->resource[i].flags & IORESOURCE_IO) { dev->resource[i].start |= (0xfe << 24); diff --git a/arch/ppc/platforms/k2.c b/arch/ppc/platforms/k2.c index 8a602039f..be5c0511f 100644 --- a/arch/ppc/platforms/k2.c +++ b/arch/ppc/platforms/k2.c @@ -116,7 +116,7 @@ void k2_pcibios_fixup(void) /* * Enable DMA support on hdc */ - ide_dev = pci_find_device(PCI_VENDOR_ID_AL, + ide_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, NULL); if (ide_dev) { @@ -126,6 +126,7 @@ void k2_pcibios_fixup(void) ide_dma_base = pci_resource_start(ide_dev, 4); outb(0x00, ide_dma_base + 0x2); outb(0x20, ide_dma_base + 0xa); + pci_dev_put(ide_dev); } #endif } diff --git a/arch/ppc/platforms/lopec.c b/arch/ppc/platforms/lopec.c index 0037f5ca4..f0c203085 100644 --- a/arch/ppc/platforms/lopec.c +++ b/arch/ppc/platforms/lopec.c @@ -189,7 +189,7 @@ static unsigned long lopec_idedma_regbase; static void lopec_ide_probe(void) { - struct pci_dev *dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + struct pci_dev *dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL); lopec_ide_ports_known = 1; @@ -200,6 +200,7 @@ lopec_ide_probe(void) lopec_ide_ctl_regbase[0] = dev->resource[1].start; lopec_ide_ctl_regbase[1] = dev->resource[3].start; lopec_idedma_regbase = dev->resource[4].start; + pci_dev_put(dev); } } diff --git a/arch/ppc/platforms/mcpn765.c b/arch/ppc/platforms/mcpn765.c index 348118b75..83dcc8fae 100644 --- a/arch/ppc/platforms/mcpn765.c +++ b/arch/ppc/platforms/mcpn765.c @@ -185,7 +185,7 @@ mcpn765_setup_via_82c586b(void) struct pci_dev *dev; u_char c; - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, NULL)) == NULL) { printk("No VIA ISA bridge found\n"); @@ -209,8 +209,8 @@ mcpn765_setup_via_82c586b(void) pci_write_config_dword(dev, 0x54, 0); pci_write_config_byte(dev, 0x58, 0); - - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + pci_dev_put(dev); + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, NULL)) == NULL) { printk("No VIA ISA bridge found\n"); @@ -225,6 +225,7 @@ mcpn765_setup_via_82c586b(void) pci_read_config_byte(dev, 0x40, &c); c |= 0x03; pci_write_config_byte(dev, 0x40, c); + pci_dev_put(dev); return; } diff --git a/arch/ppc/platforms/mvme5100.c b/arch/ppc/platforms/mvme5100.c index b08be2458..0ecea917d 100644 --- a/arch/ppc/platforms/mvme5100.c +++ b/arch/ppc/platforms/mvme5100.c @@ -228,7 +228,7 @@ mvme5100_init_IRQ(void) for (i = 0; i < NUM_8259_INTERRUPTS; i++) irq_desc[i].handler = &i8259_pic; - i8259_init(NULL); + i8259_init(0); #else openpic_init(0); #endif diff --git a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c index 74dea797e..12446b93e 100644 --- a/arch/ppc/platforms/pal4_setup.c +++ b/arch/ppc/platforms/pal4_setup.c @@ -81,7 +81,7 @@ pal4_show_cpuinfo(struct seq_file *m) static void pal4_restart(char *cmd) { - __cli(); + local_irq_disable(); __asm__ __volatile__("lis 3,0xfff0\n \ ori 3,3,0x100\n \ mtspr 26,3\n \ @@ -95,7 +95,7 @@ pal4_restart(char *cmd) static void pal4_power_off(void) { - __cli(); + local_irq_disable(); for(;;); } diff --git a/arch/ppc/platforms/pcore.c b/arch/ppc/platforms/pcore.c index da022ecd8..af8b51d87 100644 --- a/arch/ppc/platforms/pcore.c +++ b/arch/ppc/platforms/pcore.c @@ -89,7 +89,7 @@ pcore_pcibios_fixup(void) { struct pci_dev *dev; - if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, 0))) { @@ -108,6 +108,7 @@ pcore_pcibios_fixup(void) */ outb(0x00, PCORE_WINBOND_PRI_EDG_LVL); outb(0x1e, PCORE_WINBOND_SEC_EDG_LVL); + pci_dev_put(dev); } } diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c index b51b37d16..73843408c 100644 --- a/arch/ppc/platforms/pmac_cpufreq.c +++ b/arch/ppc/platforms/pmac_cpufreq.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include /* WARNING !!! This will cause calibrate_delay() to be called, * but this is an __init function ! So you MUST go edit @@ -51,10 +53,6 @@ extern void low_choose_7447a_dfs(int dfs); extern void low_choose_750fx_pll(int pll); extern void low_sleep_handler(void); -extern void openpic_suspend(struct sys_device *sysdev, u32 state); -extern void openpic_resume(struct sys_device *sysdev); -extern void enable_kernel_altivec(void); -extern void enable_kernel_fp(void); /* * Currently, PowerMac cpufreq supports only high & low frequencies @@ -140,11 +138,8 @@ static int __pmac dfs_set_cpu_speed(int low_speed) if (low_speed == 0) { /* ramping up, set voltage first */ pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/1000); - } else { - /* ramping down, enable aack delay first */ - pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 1, 0); + /* Make sure we sleep for at least 1ms */ + msleep(1); } /* set frequency */ @@ -153,16 +148,20 @@ static int __pmac dfs_set_cpu_speed(int low_speed) if (low_speed == 1) { /* ramping down, set voltage last */ pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/1000); - } else { - /* ramping up, disable aack delay last */ - pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 0, 0); + msleep(1); } return 0; } +static unsigned int __pmac dfs_get_cpu_speed(unsigned int cpu) +{ + if (mfspr(HID1) & HID1_DFS) + return low_freq; + else + return hi_freq; +} + /* Switch CPU speed using slewing GPIOs */ @@ -174,8 +173,7 @@ static int __pmac gpios_set_cpu_speed(int low_speed) if (low_speed == 0) { pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05); /* Delay is way too big but it's ok, we schedule */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/100); + msleep(10); } /* Set frequency */ @@ -192,8 +190,7 @@ static int __pmac gpios_set_cpu_speed(int low_speed) if (low_speed == 1) { pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04); /* Delay is way too big but it's ok, we schedule */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/100); + msleep(10); } #ifdef DEBUG_FREQ @@ -217,7 +214,7 @@ static int __pmac pmu_set_cpu_speed(int low_speed) printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); #endif /* Disable all interrupt sources on openpic */ - openpic_suspend(NULL, 1); + openpic_set_priority(0xf); /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); @@ -240,10 +237,6 @@ static int __pmac pmu_set_cpu_speed(int low_speed) /* Save & disable L2 and L3 caches */ save_l3cr = _get_L3CR(); /* (returns -1 if not available) */ save_l2cr = _get_L2CR(); /* (returns -1 if not available) */ - if (save_l3cr != 0xffffffff && (save_l3cr & L3CR_L3E) != 0) - _set_L3CR(save_l3cr & 0x7fffffff); - if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0) - _set_L2CR(save_l2cr & 0x7fffffff); /* Send the new speed command. My assumption is that this command * will cause PLL_CFG[0..3] to be changed next time CPU goes to sleep @@ -284,7 +277,7 @@ static int __pmac pmu_set_cpu_speed(int low_speed) wakeup_decrementer(); /* Restore interrupts */ - openpic_resume(NULL); + openpic_set_priority(0); /* Let interrupts flow again ... */ local_irq_enable(); @@ -469,14 +462,13 @@ static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode) { struct device_node *volt_gpio_np; u32 *reg; + struct cpufreq_driver *driver = &pmac_cpufreq_driver; /* OF only reports the high frequency */ hi_freq = cur_freq; low_freq = cur_freq/2; - if (mfspr(HID1) & HID1_DFS) - cur_freq = low_freq; - else - cur_freq = hi_freq; + driver->get = dfs_get_cpu_speed; + cur_freq = driver->get(0); volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); if (!volt_gpio_np){ diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c index 24b221450..886971339 100644 --- a/arch/ppc/platforms/pmac_feature.c +++ b/arch/ppc/platforms/pmac_feature.c @@ -56,14 +56,14 @@ extern int powersave_lowspeed; #endif extern int powersave_nap; -extern struct pci_dev *k2_skiplist[2]; +extern struct device_node *k2_skiplist[2]; /* * We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -static spinlock_t feature_lock __pmacdata = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(feature_lock __pmacdata); #define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); @@ -117,10 +117,10 @@ static const char* macio_names[] __pmacdata = #define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) static struct device_node* uninorth_node __pmacdata; -static u32* uninorth_base __pmacdata; +static u32 __iomem * uninorth_base __pmacdata; static u32 uninorth_rev __pmacdata; static int uninorth_u3 __pmacdata; -static void *u3_ht; +static void __iomem *u3_ht; /* * For each motherboard family, we have a table of functions pointers @@ -517,7 +517,7 @@ dbdma_save(struct macio_chip* macio, struct dbdma_regs* save) /* Save state & config of DBDMA channels */ for (i=0; i<13; i++) { - volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*) + volatile struct dbdma_regs __iomem * chan = (void __iomem *) (macio->base + ((0x8000+i*0x100)>>2)); save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi); save[i].cmdptr = in_le32(&chan->cmdptr); @@ -534,7 +534,7 @@ dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save) /* Save state & config of DBDMA channels */ for (i=0; i<13; i++) { - volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*) + volatile struct dbdma_regs __iomem * chan = (void __iomem *) (macio->base + ((0x8000+i*0x100)>>2)); out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16); while (in_le32(&chan->status) & ACTIVE) @@ -1177,6 +1177,39 @@ core99_usb_enable(struct device_node* node, long param, long value) (void)MACIO_IN32(KEYLARGO_FCR3); udelay(10); } + if (macio->type == macio_intrepid) { + /* wait for clock stopped bits to clear */ + u32 test0 = 0, test1 = 0; + u32 status0, status1; + int timeout = 1000; + + UNLOCK(flags); + switch (number) { + case 0: + test0 = UNI_N_CLOCK_STOPPED_USB0; + test1 = UNI_N_CLOCK_STOPPED_USB0PCI; + break; + case 2: + test0 = UNI_N_CLOCK_STOPPED_USB1; + test1 = UNI_N_CLOCK_STOPPED_USB1PCI; + break; + case 4: + test0 = UNI_N_CLOCK_STOPPED_USB2; + test1 = UNI_N_CLOCK_STOPPED_USB2PCI; + break; + } + do { + if (--timeout <= 0) { + printk(KERN_ERR "core99_usb_enable: " + "Timeout waiting for clocks\n"); + break; + } + mdelay(1); + status0 = UN_IN(UNI_N_CLOCK_STOP_STATUS0); + status1 = UN_IN(UNI_N_CLOCK_STOP_STATUS1); + } while ((status0 & test0) | (status1 & test1)); + LOCK(flags); + } } else { /* Turn OFF */ if (number < 4) { @@ -1199,20 +1232,20 @@ core99_usb_enable(struct device_node* node, long param, long value) udelay(1); } if (number == 0) { - MACIO_BIC(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE); + if (macio->type != macio_intrepid) + MACIO_BIC(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE); (void)MACIO_IN32(KEYLARGO_FCR0); udelay(1); MACIO_BIS(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1)); (void)MACIO_IN32(KEYLARGO_FCR0); } else if (number == 2) { - MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE); + if (macio->type != macio_intrepid) + MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE); (void)MACIO_IN32(KEYLARGO_FCR0); udelay(1); MACIO_BIS(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1)); (void)MACIO_IN32(KEYLARGO_FCR0); } else if (number == 4) { - MACIO_BIC(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE); - (void)MACIO_IN32(KEYLARGO_FCR1); udelay(1); MACIO_BIS(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1)); (void)MACIO_IN32(KEYLARGO_FCR1); @@ -1328,24 +1361,15 @@ g5_gmac_enable(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; - struct pci_dev *pdev; u8 pbus, pid; - /* XXX FIXME: We should fix pci_device_from_OF_node here, and - * get to a real pci_dev or we'll get into trouble with PCI - * domains the day we get overlapping numbers (like if we ever - * decide to show the HT root - */ - if (pci_device_from_OF_node(node, &pbus, &pid) == 0) - pdev = pci_find_slot(pbus, pid); - LOCK(flags); if (value) { MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE); mb(); k2_skiplist[0] = NULL; } else { - k2_skiplist[0] = pdev; + k2_skiplist[0] = node; mb(); MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE); } @@ -1361,16 +1385,6 @@ g5_fw_enable(struct device_node* node, long param, long value) { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; - struct pci_dev *pdev; - u8 pbus, pid; - - /* XXX FIXME: We should fix pci_device_from_OF_node here, and - * get to a real pci_dev or we'll get into trouble with PCI - * domains the day we get overlapping numbers (like if we ever - * decide to show the HT root - */ - if (pci_device_from_OF_node(node, &pbus, &pid) == 0) - pdev = pci_find_slot(pbus, pid); LOCK(flags); if (value) { @@ -1378,7 +1392,7 @@ g5_fw_enable(struct device_node* node, long param, long value) mb(); k2_skiplist[1] = NULL; } else { - k2_skiplist[1] = pdev; + k2_skiplist[1] = node; mb(); MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE); } @@ -1554,22 +1568,17 @@ intrepid_shutdown(struct macio_chip* macio, int sleep_mode) u32 temp; MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE | - KL0_SCC_CELL_ENABLE | - KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE); + KL0_SCC_CELL_ENABLE); MACIO_BIC(KEYLARGO_FCR1, - KL1_USB2_CELL_ENABLE | + /*KL1_USB2_CELL_ENABLE |*/ KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT | KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE | KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE); if (pmac_mb.board_flags & PMAC_MB_MOBILE) MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N); - MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT); - temp = MACIO_IN32(KEYLARGO_FCR3); - temp |= KL3_IT_SHUTDOWN_PLL1 | KL3_IT_SHUTDOWN_PLL2 | - KL3_IT_SHUTDOWN_PLL3; temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE | KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE); if (sleep_mode) @@ -1577,7 +1586,8 @@ intrepid_shutdown(struct macio_chip* macio, int sleep_mode) MACIO_OUT32(KEYLARGO_FCR3, temp); /* Flush posted writes & wait a bit */ - (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); + (void)MACIO_IN32(KEYLARGO_FCR0); + mdelay(10); } static int __pmac @@ -1591,6 +1601,12 @@ core99_sleep(void) macio->type != macio_intrepid) return -ENODEV; + /* The device-tree contains that in the hwclock node */ + if (macio->type == macio_intrepid) { + UN_OUT(UNI_N_CLOCK_SPREADING, 0); + mdelay(40); + } + /* We power off the wireless slot in case it was not done * by the driver. We don't power it on automatically however */ @@ -1653,11 +1669,15 @@ core99_sleep(void) */ save_unin_clock_ctl = UN_IN(UNI_N_CLOCK_CNTL); + /* Note: do not switch GMAC off, driver does it when necessary, WOL must keep it + * enabled ! + */ UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl & - ~(UNI_N_CLOCK_CNTL_GMAC|UNI_N_CLOCK_CNTL_FW/*|UNI_N_CLOCK_CNTL_PCI*/)); + ~(/*UNI_N_CLOCK_CNTL_GMAC|*/UNI_N_CLOCK_CNTL_FW/*|UNI_N_CLOCK_CNTL_PCI*/)); udelay(100); UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING); UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_SLEEP); + mdelay(10); /* * FIXME: A bit of black magic with OpenPIC (don't ask me why) @@ -1729,6 +1749,12 @@ core99_wake_up(void) UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl); udelay(100); + /* Restore clock spreading */ + if (macio->type == macio_intrepid) { + UN_OUT(UNI_N_CLOCK_SPREADING, 2); + mdelay(40); + } + return 0; } @@ -1752,6 +1778,33 @@ core99_sleep_state(struct device_node* node, long param, long value) } if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) return -EPERM; + +#ifdef CONFIG_CPU_FREQ_PMAC + /* XXX should be elsewhere */ + if (machine_is_compatible("PowerBook6,5") || + machine_is_compatible("PowerBook6,4") || + machine_is_compatible("PowerBook5,5") || + machine_is_compatible("PowerBook5,4")) { + struct device_node *volt_gpio_np; + u32 *reg = NULL; + + volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); + if (volt_gpio_np != NULL) + reg = (u32 *)get_property(volt_gpio_np, "reg", NULL); + if (reg != NULL) { + /* Set the CPU voltage high if sleeping */ + if (value == 1) { + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, + *reg, 0x05); + } else if (value == 0 && (mfspr(HID1) & HID1_DFS)) { + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, + *reg, 0x04); + } + mdelay(2); + } + } +#endif /* CONFIG_CPU_FREQ_PMAC */ + if (value == 1) return core99_sleep(); else if (value == 0) @@ -1761,6 +1814,18 @@ core99_sleep_state(struct device_node* node, long param, long value) #endif /* CONFIG_POWER4 */ +static long __pmac +generic_dev_can_wake(struct device_node* node, long param, long value) +{ + /* Todo: eventually check we are really dealing with on-board + * video device ... + */ + + if (pmac_mb.board_flags & PMAC_MB_MAY_SLEEP) + pmac_mb.board_flags |= PMAC_MB_CAN_SLEEP; + return 0; +} + static long __pmac generic_get_mb_info(struct device_node* node, long param, long value) { @@ -1786,6 +1851,7 @@ generic_get_mb_info(struct device_node* node, long param, long value) */ static struct feature_table_entry any_features[] __pmacdata = { { PMAC_FTR_GET_MB_INFO, generic_get_mb_info }, + { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake }, { 0, NULL } }; @@ -2014,7 +2080,7 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { }, { "PowerBook1,1", "PowerBook 101 (Lombard)", PMAC_TYPE_101_PBOOK, paddington_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_MOBILE }, { "iMac,1", "iMac (first generation)", PMAC_TYPE_ORIG_IMAC, paddington_features, @@ -2022,23 +2088,23 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { }, { "PowerMac4,1", "iMac \"Flower Power\"", PMAC_TYPE_PANGEA_IMAC, pangea_features, - PMAC_MB_CAN_SLEEP + PMAC_MB_MAY_SLEEP }, { "PowerBook4,3", "iBook 2 rev. 2", PMAC_TYPE_IBOOK2, pangea_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerBook4,2", "iBook 2", PMAC_TYPE_IBOOK2, pangea_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerBook4,1", "iBook 2", PMAC_TYPE_IBOOK2, pangea_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerMac4,4", "eMac", PMAC_TYPE_EMAC, core99_features, - PMAC_MB_CAN_SLEEP + PMAC_MB_MAY_SLEEP }, { "PowerMac4,2", "Flat panel iMac", PMAC_TYPE_FLAT_PANEL_IMAC, pangea_features, @@ -2062,55 +2128,57 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { }, { "PowerMac3,2", "PowerMac G4 AGP Graphics", PMAC_TYPE_SAWTOOTH, core99_features, - PMAC_MB_OLD_CORE99 + PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99 }, { "PowerMac3,3", "PowerMac G4 AGP Graphics", PMAC_TYPE_SAWTOOTH, core99_features, - PMAC_MB_OLD_CORE99 + PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99 }, { "PowerMac2,1", "iMac FireWire", PMAC_TYPE_FW_IMAC, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99 + PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99 }, { "PowerMac2,2", "iMac FireWire", PMAC_TYPE_FW_IMAC, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99 + PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99 }, { "PowerBook2,2", "iBook FireWire", PMAC_TYPE_FW_IBOOK, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | + PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE }, { "PowerMac5,1", "PowerMac G4 Cube", PMAC_TYPE_CUBE, core99_features, - PMAC_MB_OLD_CORE99 + PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99 }, { "PowerMac3,4", "PowerMac G4 Silver", PMAC_TYPE_QUICKSILVER, core99_features, - 0 + PMAC_MB_MAY_SLEEP }, { "PowerMac3,5", "PowerMac G4 Silver", PMAC_TYPE_QUICKSILVER, core99_features, - 0 + PMAC_MB_MAY_SLEEP }, { "PowerBook3,1", "PowerBook Pismo", PMAC_TYPE_PISMO, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | + PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE }, { "PowerBook3,2", "PowerBook Titanium", PMAC_TYPE_TITANIUM, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerBook3,3", "PowerBook Titanium II", PMAC_TYPE_TITANIUM2, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerBook3,4", "PowerBook Titanium III", PMAC_TYPE_TITANIUM3, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "PowerBook3,5", "PowerBook Titanium IV", PMAC_TYPE_TITANIUM4, core99_features, - PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE }, { "RackMac1,1", "XServe", PMAC_TYPE_RACKMAC, rackmac_features, @@ -2122,7 +2190,7 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { }, { "PowerMac3,6", "PowerMac G4 Windtunnel", PMAC_TYPE_WINDTUNNEL, core99_features, - 0, + PMAC_MB_MAY_SLEEP, }, { "PowerBook5,1", "PowerBook G4 17\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, @@ -2130,39 +2198,39 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = { }, { "PowerBook5,2", "PowerBook G4 15\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook5,3", "PowerBook G4 17\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook5,4", "PowerBook G4 15\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook5,5", "PowerBook G4 17\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,1", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,2", "PowerBook G4", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,3", "iBook G4", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,4", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,5", "iBook G4", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, #else /* CONFIG_POWER4 */ { "PowerMac7,2", "PowerMac G5", @@ -2286,14 +2354,14 @@ found: #ifndef CONFIG_POWER4 /* Fixup Hooper vs. Comet */ if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { - u32* mach_id_ptr = (u32*)ioremap(0xf3000034, 4); + u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4); if (!mach_id_ptr) return -ENODEV; /* Here, I used to disable the media-bay on comet. It * appears this is wrong, the floppy connector is actually * a kind of media-bay and works with the current driver. */ - if ((*mach_id_ptr) & 0x20000000UL) + if (__raw_readl(mach_id_ptr) & 0x20000000UL) pmac_mb.model_id = PMAC_TYPE_COMET; iounmap(mach_id_ptr); } @@ -2394,7 +2462,7 @@ probe_one_macio(const char* name, const char* compat, int type) { struct device_node* node; int i; - volatile u32* base; + volatile u32 __iomem * base; u32* revp; node = find_devices(name); @@ -2419,7 +2487,7 @@ probe_one_macio(const char* name, const char* compat, int type) printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name); return; } - base = (volatile u32*)ioremap(node->addrs[0].address, node->addrs[0].size); + base = ioremap(node->addrs[0].address, node->addrs[0].size); if (!base) { printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n"); return; @@ -2839,3 +2907,27 @@ void __init pmac_check_ht_link(void) } #endif /* CONFIG_POWER4 */ + +/* + * Early video resume hook + */ + +static void (*pmac_early_vresume_proc)(void *data) __pmacdata; +static void *pmac_early_vresume_data __pmacdata; + +void pmac_set_early_video_resume(void (*proc)(void *data), void *data) +{ + if (_machine != _MACH_Pmac) + return; + preempt_disable(); + pmac_early_vresume_proc = proc; + pmac_early_vresume_data = data; + preempt_enable(); +} +EXPORT_SYMBOL(pmac_set_early_video_resume); + +void __pmac pmac_call_early_video_resume(void) +{ + if (pmac_early_vresume_proc) + pmac_early_vresume_proc(pmac_early_vresume_data); +} diff --git a/arch/ppc/platforms/pmac_nvram.c b/arch/ppc/platforms/pmac_nvram.c index 3b3f984fb..c9de64205 100644 --- a/arch/ppc/platforms/pmac_nvram.c +++ b/arch/ppc/platforms/pmac_nvram.c @@ -80,7 +80,7 @@ static volatile unsigned char *nvram_data; static int nvram_mult, is_core_99; static int core99_bank = 0; static int nvram_partitions[3]; -static spinlock_t nv_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(nv_lock); extern int pmac_newworld; extern int system_running; diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c index 4e53bea90..f6ff51924 100644 --- a/arch/ppc/platforms/pmac_pci.c +++ b/arch/ppc/platforms/pmac_pci.c @@ -52,7 +52,7 @@ static struct pci_controller *u3_agp; extern u8 pci_cache_line_size; extern int pcibios_assign_bus_offset; -struct pci_dev *k2_skiplist[2]; +struct device_node *k2_skiplist[2]; /* * Magic constants for enabling cache coherency in the bandit/PSX bridge. @@ -142,14 +142,14 @@ fixup_bus_range(struct device_node *bridge) |(((unsigned long)(off)) & 0xFCUL) \ |1UL) -static unsigned int __pmac +static void volatile __iomem * __pmac macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset) { unsigned int caddr; if (bus == hose->first_busno) { if (dev_fn < (11 << 3)) - return 0; + return NULL; caddr = MACRISC_CFA0(dev_fn, offset); } else caddr = MACRISC_CFA1(bus, dev_fn, offset); @@ -160,7 +160,7 @@ macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset) } while (in_le32(hose->cfg_addr) != caddr); offset &= has_uninorth ? 0x07 : 0x03; - return (unsigned int)(hose->cfg_data) + (unsigned int)offset; + return hose->cfg_data + offset; } static int __pmac @@ -168,7 +168,7 @@ macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose = bus->sysdata; - unsigned int addr; + void volatile __iomem *addr; addr = macrisc_cfg_access(hose, bus->number, devfn, offset); if (!addr) @@ -179,13 +179,13 @@ macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset, */ switch (len) { case 1: - *val = in_8((u8 *)addr); + *val = in_8(addr); break; case 2: - *val = in_le16((u16 *)addr); + *val = in_le16(addr); break; default: - *val = in_le32((u32 *)addr); + *val = in_le32(addr); break; } return PCIBIOS_SUCCESSFUL; @@ -196,7 +196,7 @@ macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose = bus->sysdata; - unsigned int addr; + void volatile __iomem *addr; addr = macrisc_cfg_access(hose, bus->number, devfn, offset); if (!addr) @@ -207,16 +207,16 @@ macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset, */ switch (len) { case 1: - out_8((u8 *)addr, val); - (void) in_8((u8 *)addr); + out_8(addr, val); + (void) in_8(addr); break; case 2: - out_le16((u16 *)addr, val); - (void) in_le16((u16 *)addr); + out_le16(addr, val); + (void) in_le16(addr); break; default: - out_le32((u32 *)addr, val); - (void) in_le32((u32 *)addr); + out_le32(addr, val); + (void) in_le32(addr); break; } return PCIBIOS_SUCCESSFUL; @@ -295,7 +295,7 @@ static struct pci_ops chaos_pci_ops = + (((unsigned long)bus) << 16) \ + 0x01000000UL) -static unsigned long __pmac +static void volatile __iomem * __pmac u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset) { if (bus == hose->first_busno) { @@ -303,9 +303,9 @@ u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset) if (PCI_FUNC(devfn) != 0 || PCI_SLOT(devfn) > 7 || PCI_SLOT(devfn) < 1) return 0; - return ((unsigned long)hose->cfg_data) + U3_HT_CFA0(devfn, offset); + return hose->cfg_data + U3_HT_CFA0(devfn, offset); } else - return ((unsigned long)hose->cfg_data) + U3_HT_CFA1(bus, devfn, offset); + return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset); } static int __pmac @@ -313,7 +313,7 @@ u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose = bus->sysdata; - unsigned int addr; + void volatile __iomem *addr; int i; struct device_node *np = pci_busdev_to_OF_node(bus, devfn); @@ -325,8 +325,7 @@ u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset, * cycle accesses. Fix that here. */ for (i=0; i<2; i++) - if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && - k2_skiplist[i]->devfn == devfn) { + if (k2_skiplist[i] == np) { switch (len) { case 1: *val = 0xff; break; @@ -347,13 +346,13 @@ u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset, */ switch (len) { case 1: - *val = in_8((u8 *)addr); + *val = in_8(addr); break; case 2: - *val = in_le16((u16 *)addr); + *val = in_le16(addr); break; default: - *val = in_le32((u32 *)addr); + *val = in_le32(addr); break; } return PCIBIOS_SUCCESSFUL; @@ -364,7 +363,7 @@ u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose = bus->sysdata; - unsigned int addr; + void volatile __iomem *addr; int i; struct device_node *np = pci_busdev_to_OF_node(bus, devfn); @@ -375,8 +374,7 @@ u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset, * cycle accesses. Fix that here. */ for (i=0; i<2; i++) - if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && - k2_skiplist[i]->devfn == devfn) + if (k2_skiplist[i] == np) return PCIBIOS_SUCCESSFUL; addr = u3_ht_cfg_access(hose, bus->number, devfn, offset); @@ -388,16 +386,16 @@ u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset, */ switch (len) { case 1: - out_8((u8 *)addr, val); - (void) in_8((u8 *)addr); + out_8(addr, val); + (void) in_8(addr); break; case 2: - out_le16((u16 *)addr, val); - (void) in_le16((u16 *)addr); + out_le16(addr, val); + (void) in_le16(addr); break; default: - out_le32((u32 *)addr, val); - (void) in_le32((u32 *)addr); + out_le32(addr, val); + (void) in_le32(addr); break; } return PCIBIOS_SUCCESSFUL; @@ -424,7 +422,7 @@ init_bandit(struct pci_controller *bp) /* read the word at offset 0 in config space for device 11 */ out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + PCI_VENDOR_ID); udelay(2); - vendev = in_le32((volatile unsigned int *)bp->cfg_data); + vendev = in_le32(bp->cfg_data); if (vendev == (PCI_DEVICE_ID_APPLE_BANDIT << 16) + PCI_VENDOR_ID_APPLE) { /* read the revision id */ @@ -443,12 +441,12 @@ init_bandit(struct pci_controller *bp) /* read the word at offset 0x50 */ out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + BANDIT_MAGIC); udelay(2); - magic = in_le32((volatile unsigned int *)bp->cfg_data); + magic = in_le32(bp->cfg_data); if ((magic & BANDIT_COHERENT) != 0) return; magic |= BANDIT_COHERENT; udelay(2); - out_le32((volatile unsigned int *)bp->cfg_data, magic); + out_le32(bp->cfg_data, magic); printk(KERN_INFO "Cache coherency enabled for bandit/PSX\n"); } @@ -622,12 +620,12 @@ static inline void grackle_set_stg(struct pci_controller* bp, int enable) unsigned int val; out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8)); - val = in_le32((volatile unsigned int *)bp->cfg_data); + val = in_le32(bp->cfg_data); val = enable? (val | GRACKLE_PICR1_STG) : (val & ~GRACKLE_PICR1_STG); out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8)); - out_le32((volatile unsigned int *)bp->cfg_data, val); - (void)in_le32((volatile unsigned int *)bp->cfg_data); + out_le32(bp->cfg_data, val); + (void)in_le32(bp->cfg_data); } static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable) @@ -635,12 +633,12 @@ static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable) unsigned int val; out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8)); - val = in_le32((volatile unsigned int *)bp->cfg_data); + val = in_le32(bp->cfg_data); val = enable? (val | GRACKLE_PICR1_LOOPSNOOP) : (val & ~GRACKLE_PICR1_LOOPSNOOP); out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8)); - out_le32((volatile unsigned int *)bp->cfg_data, val); - (void)in_le32((volatile unsigned int *)bp->cfg_data); + out_le32(bp->cfg_data, val); + (void)in_le32(bp->cfg_data); } static int __init @@ -659,10 +657,8 @@ static void __init setup_bandit(struct pci_controller* hose, struct reg_property* addr) { hose->ops = ¯isc_pci_ops; - hose->cfg_addr = (volatile unsigned int *) - ioremap(addr->address + 0x800000, 0x1000); - hose->cfg_data = (volatile unsigned char *) - ioremap(addr->address + 0xc00000, 0x1000); + hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000); + hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000); init_bandit(hose); } @@ -671,10 +667,8 @@ setup_chaos(struct pci_controller* hose, struct reg_property* addr) { /* assume a `chaos' bridge */ hose->ops = &chaos_pci_ops; - hose->cfg_addr = (volatile unsigned int *) - ioremap(addr->address + 0x800000, 0x1000); - hose->cfg_data = (volatile unsigned char *) - ioremap(addr->address + 0xc00000, 0x1000); + hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000); + hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000); } #ifdef CONFIG_POWER4 @@ -713,7 +707,7 @@ setup_u3_ht(struct pci_controller* hose, struct reg_property *addr) * the reg address cell, we shall fix that by killing struct * reg_property and using some accessor functions instead */ - hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000); + hose->cfg_data = ioremap(0xf2000000, 0x02000000); /* * /ht node doesn't expose a "ranges" property, so we "remove" regions that @@ -889,7 +883,7 @@ pcibios_fixup_OF_interrupts(void) * should find the device node and apply the interrupt * obtained from the OF device-tree */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { struct device_node *node; node = pci_device_to_OF_node(dev); /* this is the node, see if it has interrupts */ @@ -919,8 +913,12 @@ pmac_pci_enable_device_hook(struct pci_dev *dev, int initial) * (iBook second controller) */ if (dev->vendor == PCI_VENDOR_ID_APPLE - && dev->device == PCI_DEVICE_ID_APPLE_KL_USB && !node) + && (dev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) + && !node) { + printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n", + pci_name(dev)); return -EINVAL; + } if (!node) return 0; @@ -989,7 +987,7 @@ pmac_pcibios_after_init(void) * * -- BenH */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE) pci_enable_device(dev); } diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c index bebba8793..9f92e1bb7 100644 --- a/arch/ppc/platforms/pmac_pic.c +++ b/arch/ppc/platforms/pmac_pic.c @@ -68,7 +68,7 @@ static int max_irqs __pmacdata; static int max_real_irqs __pmacdata; static u32 level_mask[4] __pmacdata; -static spinlock_t pmac_pic_lock __pmacdata = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pmac_pic_lock __pmacdata); #define GATWICK_IRQ_POOL_SIZE 10 @@ -214,7 +214,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) if (bits == 0) continue; irq += __ilog2(bits); - ppc_irq_dispatch_handler(regs, irq); + __do_IRQ(irq, regs); return IRQ_HANDLED; } printk("gatwick irq not from gatwick pic\n"); @@ -383,11 +383,34 @@ static irqreturn_t k2u3_action(int cpl, void *dev_id, struct pt_regs *regs) irq = openpic2_get_irq(regs); if (irq != -1) - ppc_irq_dispatch_handler(regs, irq); + __do_IRQ(irq, regs); return IRQ_HANDLED; } + +static struct irqaction k2u3_cascade_action = { + .handler = k2u3_action, + .flags = 0, + .mask = CPU_MASK_NONE, + .name = "U3->K2 Cascade", +}; #endif /* CONFIG_POWER4 */ +#ifdef CONFIG_XMON +static struct irqaction xmon_action = { + .handler = xmon_irq, + .flags = 0, + .mask = CPU_MASK_NONE, + .name = "NMI - XMON" +}; +#endif + +static struct irqaction gatwick_cascade_action = { + .handler = gatwick_action, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "cascade", +}; + void __init pmac_pic_init(void) { int i; @@ -440,8 +463,9 @@ void __init pmac_pic_init(void) OpenPIC_InitSenses = senses; OpenPIC_NumInitSenses = 128; openpic2_init(PMAC_OPENPIC2_OFFSET); - if (request_irq(irqctrler2->intrs[0].line, k2u3_action, 0, - "U3->K2 Cascade", NULL)) + + if (setup_irq(irqctrler2->intrs[0].line, + &k2u3_cascade_action)) printk("Unable to get OpenPIC IRQ for cascade\n"); } #endif /* CONFIG_POWER4 */ @@ -455,8 +479,7 @@ void __init pmac_pic_init(void) if (pswitch && pswitch->n_intrs) { nmi_irq = pswitch->intrs[0].line; openpic_init_nmi_irq(nmi_irq); - request_irq(nmi_irq, xmon_irq, 0, - "NMI - XMON", NULL); + setup_irq(nmi_irq, &xmon_action); } } #endif /* CONFIG_XMON */ @@ -553,8 +576,7 @@ void __init pmac_pic_init(void) (int)irq_cascade); for ( i = max_real_irqs ; i < max_irqs ; i++ ) irq_desc[i].handler = &gatwick_pic; - request_irq( irq_cascade, gatwick_action, SA_INTERRUPT, - "cascade", NULL ); + setup_irq(irq_cascade, &gatwick_cascade_action); } printk("System has %d possible interrupts\n", max_irqs); if (max_irqs != max_real_irqs) @@ -562,7 +584,7 @@ void __init pmac_pic_init(void) max_real_irqs); #ifdef CONFIG_XMON - request_irq(20, xmon_irq, 0, "NMI - XMON", NULL); + setup_irq(20, &xmon_action); #endif /* CONFIG_XMON */ } diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c index 79fc29514..513952331 100644 --- a/arch/ppc/platforms/pmac_setup.c +++ b/arch/ppc/platforms/pmac_setup.c @@ -51,13 +51,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S index 76bf8cc34..cc69636f1 100644 --- a/arch/ppc/platforms/pmac_sleep.S +++ b/arch/ppc/platforms/pmac_sleep.S @@ -161,12 +161,8 @@ _GLOBAL(low_sleep_handler) addi r3,r3,sleep_storage@l stw r5,0(r3) - /* Disable DPM during cache flush */ - mfspr r3, SPRN_HID0 - rlwinm r3,r3,0,12,10 - sync - mtspr SPRN_HID0,r3 - sync + /* Flush & disable all caches */ + bl flush_disable_caches /* Turn off data relocation. */ mfmsr r3 /* Save MSR in r7 */ @@ -175,8 +171,13 @@ _GLOBAL(low_sleep_handler) mtmsr r3 isync - /* Flush & disable L1 cache */ - bl __flush_disable_L1 +BEGIN_FTR_SECTION + /* Flush any pending L2 data prefetches to work around HW bug */ + sync + lis r3,0xfff0 + lwz r0,0(r3) /* perform cache-inhibited load to ROM */ + sync /* (caches are disabled at this point) */ +END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450) /* * Set the HID0 and MSR for sleep. @@ -212,17 +213,16 @@ _GLOBAL(low_sleep_handler) * r4 has the physical address of SL_PC(sp) (unused) */ _GLOBAL(core99_wake_up) - /* Make sure HID0 no longer contains any sleep bit */ + /* Make sure HID0 no longer contains any sleep bit and that data cache + * is disabled + */ mfspr r3,HID0 rlwinm r3,r3,0,11,7 /* clear SLEEP, NAP, DOZE bits */ + rlwinm 3,r3,0,18,15 /* clear DCE, ICE */ mtspr HID0,r3 sync isync - /* Won't that cause problems on CPU that doesn't support it ? */ - lis r3, 0 - mtspr SPRN_MMCR0, r3 - /* sanitize MSR */ mfmsr r3 ori r3,r3,MSR_EE|MSR_IP @@ -246,10 +246,6 @@ _GLOBAL(core99_wake_up) */ grackle_wake_up: - /* Invalidate & enable L1 cache, we don't care about - * whatever the ROM may have tried to write to memory - */ - bl __inval_enable_L1 /* Restore the kernel's segment registers before * we do any r1 memory access as we are not sure they @@ -271,6 +267,11 @@ grackle_wake_up: /* Restore various CPU config stuffs */ bl __restore_cpu_setup + /* Invalidate & enable L1 cache, we don't care about + * whatever the ROM may have tried to write to memory + */ + bl __inval_enable_L1 + /* Restore the BATs, and SDR1. Then we can turn on the MMU. */ lwz r4,SL_SDR1(r1) mtsdr1 r4 diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c index 1a300ff40..d6624b018 100644 --- a/arch/ppc/platforms/pmac_smp.c +++ b/arch/ppc/platforms/pmac_smp.c @@ -405,6 +405,13 @@ static void __init psurge_dual_sync_tb(int cpu_nr) smp_tb_synchronized = 1; } +static struct irqaction psurge_irqaction = { + .handler = psurge_primary_intr, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "primary IPI", +}; + static void __init smp_psurge_setup_cpu(int cpu_nr) { @@ -421,7 +428,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr) /* reset the entry point so if we get another intr we won't * try to startup again */ out_be32(psurge_start, 0x100); - if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", NULL)) + if (setup_irq(30, &psurge_irqaction)) printk(KERN_ERR "Couldn't get primary IPI interrupt"); } diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c index 7922346f1..1688f3695 100644 --- a/arch/ppc/platforms/pplus.c +++ b/arch/ppc/platforms/pplus.c @@ -359,7 +359,7 @@ void __init pplus_pib_init(void) * Perform specific configuration for the Via Tech or * or Winbond PCI-ISA-Bridge part. */ - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, dev))) { /* * PPCBUG does not set the enable bits @@ -371,7 +371,7 @@ void __init pplus_pib_init(void) pci_write_config_byte(dev, 0x40, reg); } - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, dev)) && (dev->devfn = 0x5a)) { /* Force correct USB interrupt */ @@ -379,7 +379,7 @@ void __init pplus_pib_init(void) pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); } - if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, dev))) { /* Clear PCI Interrupt Routing Control Register. */ short_reg = 0x0000; @@ -389,7 +389,7 @@ void __init pplus_pib_init(void) pci_write_config_byte(dev, 0x43, reg); } - if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, dev))) { /* * Disable LEGIRQ mode so PCI INTS are routed @@ -401,6 +401,7 @@ void __init pplus_pib_init(void) dev->irq = 14; pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); } + pci_dev_put(dev); } void __init pplus_set_VIA_IDE_legacy(void) diff --git a/arch/ppc/platforms/pq2ads.c b/arch/ppc/platforms/pq2ads.c index cecaba630..6a1475c1e 100644 --- a/arch/ppc/platforms/pq2ads.c +++ b/arch/ppc/platforms/pq2ads.c @@ -19,8 +19,8 @@ #include void __init -m82xx_board_init(void) +m82xx_board_setup(void) { /* Enable the 2nd UART port */ - *(volatile uint *)(BCSR_ADDR + 4) &= ~BCSR1_RS232_EN2; + *(volatile uint *)(BCSR_ADDR + 4) &= ~BCSR1_RS232_EN2; } diff --git a/arch/ppc/platforms/pq2ads.h b/arch/ppc/platforms/pq2ads.h index 0c17a0cda..cf5e5dd06 100644 --- a/arch/ppc/platforms/pq2ads.h +++ b/arch/ppc/platforms/pq2ads.h @@ -40,6 +40,8 @@ #define BCSR1_FETH_RST ((uint)0x04000000) /* 0 == reset */ #define BCSR1_RS232_EN1 ((uint)0x02000000) /* 0 == enable */ #define BCSR1_RS232_EN2 ((uint)0x01000000) /* 0 == enable */ +#define BCSR3_FETHIEN2 ((uint)0x10000000) /* 0 == enable */ +#define BCSR3_FETH2_RST ((uint)0x80000000) /* 0 == reset */ #define PHY_INTERRUPT SIU_INT_IRQ7 diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c index a528562cc..8cd80eb44 100644 --- a/arch/ppc/platforms/prep_pci.c +++ b/arch/ppc/platforms/prep_pci.c @@ -49,10 +49,10 @@ static char Utah_pci_IRQ_map[23] __prepdata = 0, /* Slot 1 - unused */ 5, /* Slot 2 - SCSI - NCR825A */ 0, /* Slot 3 - unused */ - 1, /* Slot 4 - Ethernet - DEC2114x */ + 3, /* Slot 4 - Ethernet - DEC2114x */ 0, /* Slot 5 - unused */ - 3, /* Slot 6 - PCI Card slot #1 */ - 4, /* Slot 7 - PCI Card slot #2 */ + 2, /* Slot 6 - PCI Card slot #1 */ + 3, /* Slot 7 - PCI Card slot #2 */ 5, /* Slot 8 - PCI Card slot #3 */ 5, /* Slot 9 - PCI Bridge */ /* added here in case we ever support PCI bridges */ @@ -627,7 +627,7 @@ prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose = bus->sysdata; - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; if (bus->number != 0 || DEVNO(devfn) < MIN_DEVNR || DEVNO(devfn) > MAX_DEVNR) @@ -640,13 +640,13 @@ prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset, cfg_data = hose->cfg_data + CFGADDR(devfn) + offset; switch (len) { case 1: - *val = in_8((u8 *)cfg_data); + *val = in_8(cfg_data); break; case 2: - *val = in_le16((u16 *)cfg_data); + *val = in_le16(cfg_data); break; default: - *val = in_le32((u32 *)cfg_data); + *val = in_le32(cfg_data); break; } return PCIBIOS_SUCCESSFUL; @@ -657,7 +657,7 @@ prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose = bus->sysdata; - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; if (bus->number != 0 || DEVNO(devfn) < MIN_DEVNR || DEVNO(devfn) > MAX_DEVNR) @@ -670,13 +670,13 @@ prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset, cfg_data = hose->cfg_data + CFGADDR(devfn) + offset; switch (len) { case 1: - out_8((u8 *)cfg_data, val); + out_8(cfg_data, val); break; case 2: - out_le16((u16 *)cfg_data, val); + out_le16(cfg_data, val); break; default: - out_le32((u32 *)cfg_data, val); + out_le32(cfg_data, val); break; } return PCIBIOS_SUCCESSFUL; @@ -1069,7 +1069,7 @@ prep_pib_init(void) * Perform specific configuration for the Via Tech or * or Winbond PCI-ISA-Bridge part. */ - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, dev))) { /* * PPCBUG does not set the enable bits @@ -1080,7 +1080,7 @@ prep_pib_init(void) reg |= 0x03; /* IDE: Chip Enable Bits */ pci_write_config_byte(dev, 0x40, reg); } - if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, + if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, dev)) && (dev->devfn = 0x5a)) { /* Force correct USB interrupt */ @@ -1089,7 +1089,7 @@ prep_pib_init(void) PCI_INTERRUPT_LINE, dev->irq); } - if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, dev))) { /* Clear PCI Interrupt Routing Control Register. */ short_reg = 0x0000; @@ -1100,9 +1100,10 @@ prep_pib_init(void) pci_write_config_byte(dev, 0x43, reg); } } + pci_dev_put(dev); } - if ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, + if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, dev))){ if (OpenPIC_Addr){ /* @@ -1121,6 +1122,7 @@ prep_pib_init(void) pci_write_config_dword(dev, 0x40, 0x10ff08a1); } } + pci_dev_put(dev); } static void __init @@ -1207,7 +1209,7 @@ prep_pcibios_fixup(void) printk("Setting PCI interrupts for a \"%s\"\n", Motherboard_map_name); /* Iterate through all the PCI devices, setting the IRQ */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { /* * If we have residual data, then this is easy: query the * residual data for the IRQ line allocated to the device. @@ -1260,12 +1262,13 @@ prep_pcibios_after_init(void) * instead of 0xc0000. vgacon.c (for example) is completely unaware of * this little quirk. */ - dev = pci_find_device(PCI_VENDOR_ID_WD, PCI_DEVICE_ID_WD_90C, NULL); + dev = pci_get_device(PCI_VENDOR_ID_WD, PCI_DEVICE_ID_WD_90C, NULL); if (dev) { dev->resource[1].end -= dev->resource[1].start; dev->resource[1].start = 0; /* tell the hardware */ pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, 0x0); + pci_dev_put(dev); } #endif } diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c index 8051df176..c6bd7b86b 100644 --- a/arch/ppc/platforms/prep_setup.c +++ b/arch/ppc/platforms/prep_setup.c @@ -645,7 +645,7 @@ static void __init prep_init_sound(void) static void __init prep_init_vesa(void) { -#if (defined(CONFIG_FB_VGA16) || defined(CONFIG_FB_VGA_16_MODULE) || \ +#if (defined(CONFIG_FB_VGA16) || defined(CONFIG_FB_VGA16_MODULE) || \ defined(CONFIG_FB_VESA)) PPC_DEVICE *vgadev = NULL; @@ -1126,7 +1126,7 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5, _prep_type = _PREP_Motorola; } -#ifdef CONFIG_PREP_PRESIDUAL +#ifdef CONFIG_PREP_RESIDUAL /* Switch off all residual data processing if the user requests it */ if (strstr(cmd_line, "noresidual") != NULL) res = NULL; diff --git a/arch/ppc/platforms/prpmc750.c b/arch/ppc/platforms/prpmc750.c index a75553c9a..b89d144c8 100644 --- a/arch/ppc/platforms/prpmc750.c +++ b/arch/ppc/platforms/prpmc750.c @@ -109,7 +109,7 @@ static void __init prpmc750_pcibios_fixup(void) * resource subsystem doesn't fixup the * PCI mem resources on the CL5446. */ - if ((dev = pci_find_device(PCI_VENDOR_ID_CIRRUS, + if ((dev = pci_get_device(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0))) { dev->resource[0].start += PRPMC750_PCI_PHY_MEM_OFFSET; dev->resource[0].end += PRPMC750_PCI_PHY_MEM_OFFSET; @@ -121,6 +121,7 @@ static void __init prpmc750_pcibios_fixup(void) outb(0x0f, 0x3c4); /* Set proper DRAM config */ outb(0xdf, 0x3c5); + pci_dev_put(dev); } } diff --git a/arch/ppc/platforms/rpxclassic.h b/arch/ppc/platforms/rpxclassic.h index d1d81b8b5..6daa10949 100644 --- a/arch/ppc/platforms/rpxclassic.h +++ b/arch/ppc/platforms/rpxclassic.h @@ -82,7 +82,6 @@ extern bd_t m8xx_board_info; /* for pcmcia sandisk */ #ifdef CONFIG_IDE # define MAX_HWIFS 1 -# define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id)) #endif #endif diff --git a/arch/ppc/platforms/rpxlite.h b/arch/ppc/platforms/rpxlite.h index 69646bf36..deee5bd36 100644 --- a/arch/ppc/platforms/rpxlite.h +++ b/arch/ppc/platforms/rpxlite.h @@ -68,7 +68,6 @@ extern bd_t m8xx_board_info; #ifdef CONFIG_IDE # define MAX_HWIFS 1 -# define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id)) #endif /* CPM Ethernet through SCCx. diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c index d9307a261..b07f416cc 100644 --- a/arch/ppc/platforms/sandpoint.c +++ b/arch/ppc/platforms/sandpoint.c @@ -60,11 +60,6 @@ * of the amount of memory in the system. Once a method of determining * what version of DINK initializes the system for us, if applicable, is * found, we can hopefully stop hardcoding 32MB of RAM. - * - * It is important to note that this code only supports the Sandpoint X3 - * (all flavors) platform, and it does not support the X2 anymore. Code - * that at one time worked on the X2 can be found at: - * ftp://source.mvista.com/pub/linuxppc/obsolete/sandpoint/ */ #include @@ -107,9 +102,13 @@ #include "sandpoint.h" +/* Set non-zero if an X2 Sandpoint detected. */ +static int sandpoint_is_x2; + unsigned char __res[sizeof(bd_t)]; static void sandpoint_halt(void); +static void sandpoint_probe_type(void); /* * Define all of the IRQ senses and polarities. Taken from the @@ -129,7 +128,7 @@ static u_char sandpoint_openpic_initsenses[] __initdata = { * Motorola SPS Sandpoint interrupt routing. */ static inline int -sandpoint_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) +x3_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) { static char pci_irq_table[][4] = /* @@ -149,6 +148,27 @@ sandpoint_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) return PCI_IRQ_TABLE_LOOKUP; } +static inline int +x2_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) +{ + static char pci_irq_table[][4] = + /* + * PCI IDSEL/INTPIN->INTLINE + * A B C D + */ + { + { 18, 0, 0, 0 }, /* IDSEL 11 - i8259 on Windbond */ + { 0, 0, 0, 0 }, /* IDSEL 12 - unused */ + { 16, 17, 18, 19 }, /* IDSEL 13 - PCI slot 1 */ + { 17, 18, 19, 16 }, /* IDSEL 14 - PCI slot 2 */ + { 18, 19, 16, 17 }, /* IDSEL 15 - PCI slot 3 */ + { 19, 16, 17, 18 }, /* IDSEL 16 - PCI slot 4 */ + }; + + const long min_idsel = 11, max_idsel = 16, irqs_per_slot = 4; + return PCI_IRQ_TABLE_LOOKUP; +} + static void __init sandpoint_setup_winbond_83553(struct pci_controller *hose) { @@ -216,6 +236,18 @@ sandpoint_setup_winbond_83553(struct pci_controller *hose) return; } +/* On the sandpoint X2, we must avoid sending configuration cycles to + * device #12 (IDSEL addr = AD12). + */ +static int +x2_exclude_device(u_char bus, u_char devfn) +{ + if ((bus == 0) && (PCI_SLOT(devfn) == SANDPOINT_HOST_BRIDGE_IDSEL)) + return PCIBIOS_DEVICE_NOT_FOUND; + else + return PCIBIOS_SUCCESSFUL; +} + static void __init sandpoint_find_bridges(void) { @@ -241,7 +273,11 @@ sandpoint_find_bridges(void) ppc_md.pcibios_fixup = NULL; ppc_md.pcibios_fixup_bus = NULL; ppc_md.pci_swizzle = common_swizzle; - ppc_md.pci_map_irq = sandpoint_map_irq; + if (sandpoint_is_x2) { + ppc_md.pci_map_irq = x2_map_irq; + ppc_md.pci_exclude_device = x2_exclude_device; + } else + ppc_md.pci_map_irq = x3_map_irq; } else { if (ppc_md.progress) @@ -252,41 +288,14 @@ sandpoint_find_bridges(void) return; } -#if defined(CONFIG_SERIAL_8250) && \ - (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) -static void __init -sandpoint_early_serial_map(void) -{ - struct uart_port serial_req; - - /* Setup serial port access */ - memset(&serial_req, 0, sizeof(serial_req)); - serial_req.uartclk = UART_CLK; - serial_req.irq = 4; - serial_req.flags = STD_COM_FLAGS; - serial_req.iotype = SERIAL_IO_MEM; - serial_req.membase = (u_char *)SANDPOINT_SERIAL_0; - - gen550_init(0, &serial_req); - - if (early_serial_setup(&serial_req) != 0) - printk(KERN_ERR "Early serial init of port 0 failed\n"); - - /* Assume early_serial_setup() doesn't modify serial_req */ - serial_req.line = 1; - serial_req.irq = 3; /* XXXX */ - serial_req.membase = (u_char *)SANDPOINT_SERIAL_1; - - gen550_init(1, &serial_req); - - if (early_serial_setup(&serial_req) != 0) - printk(KERN_ERR "Early serial init of port 1 failed\n"); -} -#endif - static void __init sandpoint_setup_arch(void) { + /* Probe for Sandpoint model */ + sandpoint_probe_type(); + if (sandpoint_is_x2) + epic_serial_mode = 0; + loops_per_jiffy = 100000000 / HZ; #ifdef CONFIG_BLK_DEV_INITRD @@ -350,14 +359,49 @@ sandpoint_setup_arch(void) SANDPOINT_87308_CFG_OUTB(0x30, 0x01); \ } +/* + * To probe the Sandpoint type, we need to check for a connection between GPIO + * pins 6 and 7 on the NS87308 SuperIO. + */ +static void __init sandpoint_probe_type(void) +{ + u8 x; + /* First, ensure that the GPIO pins are enabled. */ + SANDPOINT_87308_SELECT_DEV(0x07); /* Select GPIO logical device */ + SANDPOINT_87308_CFG_OUTB(0x60, 0x07); /* Base address 0x700 */ + SANDPOINT_87308_CFG_OUTB(0x61, 0x00); + SANDPOINT_87308_CFG_OUTB(0x30, 0x01); /* Enable */ + + /* Now, set pin 7 to output and pin 6 to input. */ + outb((inb(0x701) | 0x80) & 0xbf, 0x701); + /* Set push-pull output */ + outb(inb(0x702) | 0x80, 0x702); + /* Set pull-up on input */ + outb(inb(0x703) | 0x40, 0x703); + /* Set output high and check */ + x = inb(0x700); + outb(x | 0x80, 0x700); + x = inb(0x700); + sandpoint_is_x2 = ! (x & 0x40); + if (ppc_md.progress && sandpoint_is_x2) + ppc_md.progress("High output says X2", 0); + /* Set output low and check */ + outb(x & 0x7f, 0x700); + sandpoint_is_x2 |= inb(0x700) & 0x40; + if (ppc_md.progress && sandpoint_is_x2) + ppc_md.progress("Low output says X2", 0); + if (ppc_md.progress && ! sandpoint_is_x2) + ppc_md.progress("Sandpoint is X3", 0); +} + /* * Fix IDE interrupts. */ static int __init sandpoint_fix_winbond_83553(void) { - /* Make all 8259 interrupt level sensitive */ - outb(0xf8, 0x4d0); + /* Make some 8259 interrupt level sensitive */ + outb(0xe0, 0x4d0); outb(0xde, 0x4d1); return 0; @@ -430,7 +474,7 @@ sandpoint_init_IRQ(void) OpenPIC_NumInitSenses = sizeof(sandpoint_openpic_initsenses); mpc10x_set_openpic(); - openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", + openpic_hookup_cascade(sandpoint_is_x2 ? 17 : NUM_8259_INTERRUPTS, "82c59 cascade", i8259_irq); /* @@ -531,7 +575,7 @@ static unsigned long sandpoint_idedma_regbase; static void sandpoint_ide_probe(void) { - struct pci_dev *pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, + struct pci_dev *pdev = pci_get_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL); if (pdev) { @@ -540,6 +584,7 @@ sandpoint_ide_probe(void) sandpoint_ide_ctl_regbase[0]=pdev->resource[1].start; sandpoint_ide_ctl_regbase[1]=pdev->resource[3].start; sandpoint_idedma_regbase=pdev->resource[4].start; + pci_dev_put(pdev); } sandpoint_ide_ports_known = 1; @@ -689,16 +734,12 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.nvram_read_val = todc_mc146818_read_val; ppc_md.nvram_write_val = todc_mc146818_write_val; -#if defined(CONFIG_SERIAL_8250) && \ - (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) - sandpoint_early_serial_map(); #ifdef CONFIG_KGDB ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; #endif #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress; #endif -#endif #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) ppc_ide_md.default_irq = sandpoint_ide_default_irq; diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c index 3a404a88c..74c9ff72c 100644 --- a/arch/ppc/platforms/sbc82xx.c +++ b/arch/ppc/platforms/sbc82xx.c @@ -68,7 +68,7 @@ static void sbc82xx_time_init(void) static volatile char *sbc82xx_i8259_map; static char sbc82xx_i8259_mask = 0xff; -static spinlock_t sbc82xx_i8259_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sbc82xx_i8259_lock); static void sbc82xx_i8259_mask_and_ack_irq(unsigned int irq_nr) { @@ -142,10 +142,17 @@ static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } } - ppc_irq_dispatch_handler(regs, NR_SIU_INTS + irq); + __do_IRQ(NR_SIU_INTS + irq, regs); return IRQ_HANDLED; } +static struct irqaction sbc82xx_i8259_irqaction = { + .handler = sbc82xx_i8259_demux, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "i8259 demux", +}; + void __init sbc82xx_init_IRQ(void) { volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl; @@ -186,8 +193,7 @@ void __init sbc82xx_init_IRQ(void) sbc82xx_i8259_map[1] = sbc82xx_i8259_mask; /* Set interrupt mask */ /* Request cascade IRQ */ - if (request_irq(SIU_INT_IRQ6, sbc82xx_i8259_demux, SA_INTERRUPT, - "i8259 demux", 0)) { + if (setup_irq(SIU_INT_IRQ6, &sbc82xx_i8259_irqaction)) { printk("Installation of i8259 IRQ demultiplexer failed.\n"); } } diff --git a/arch/ppc/platforms/tqm8xx.h b/arch/ppc/platforms/tqm8xx.h index f69b306cb..2150dc87b 100644 --- a/arch/ppc/platforms/tqm8xx.h +++ b/arch/ppc/platforms/tqm8xx.h @@ -72,8 +72,6 @@ static __inline__ void ide_led(int on) #define IDE0_INTERRUPT 13 #ifdef CONFIG_IDE -#define ide_request_irq(irq,hand,flg,dev,id) \ - request_8xxirq((irq),(hand),(flg),(dev),(id)) #endif /*----------------------------------------------------------------------- diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile index fe15101b2..ff344fb01 100644 --- a/arch/ppc/syslib/Makefile +++ b/arch/ppc/syslib/Makefile @@ -13,14 +13,23 @@ obj-$(CONFIG_IBM_OCP) += ibm_ocp.o obj-$(CONFIG_44x) += ibm44x_common.o obj-$(CONFIG_440GP) += ibm440gp_common.o obj-$(CONFIG_440GX) += ibm440gx_common.o +obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o ifeq ($(CONFIG_4xx),y) -obj-$(CONFIG_4xx) += ppc4xx_pic.o +ifeq ($(CONFIG_VIRTEX_II_PRO),y) +obj-$(CONFIG_40x) += xilinx_pic.o +else +ifeq ($(CONFIG_403),y) +obj-$(CONFIG_40x) += ppc403_pic.o +else +obj-$(CONFIG_40x) += ppc4xx_pic.o +endif +endif +obj-$(CONFIG_44x) += ppc4xx_pic.o obj-$(CONFIG_40x) += ppc4xx_setup.o obj-$(CONFIG_GEN_RTC) += todc_time.o obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o ifeq ($(CONFIG_40x),y) -obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o endif endif @@ -35,19 +44,26 @@ obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ todc_time.o +obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o -obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \ - indirect_pci.o todc_time.o pci_auto.o +obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o +obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o obj-$(CONFIG_GEMINI) += open_pic.o indirect_pci.o +obj-$(CONFIG_GT64260) += gt64260_pic.o obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \ pci_auto.o obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o +obj-$(CONFIG_LUAN) += indirect_pci.o pci_auto.o todc_time.o +obj-$(CONFIG_KATANA) += pci_auto.o obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \ open_pic.o i8259.o hawk_common.o obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \ pci_auto.o indirect_pci.o +obj-$(CONFIG_MV64360) += mv64360_pic.o +obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \ - i8259.o pci_auto.o hawk_common.o + pci_auto.o hawk_common.o +obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o obj-$(CONFIG_OCOTEA) += indirect_pci.o pci_auto.o todc_time.o obj-$(CONFIG_PAL4) += cpc700_pic.o obj-$(CONFIG_PCORE) += todc_time.o i8259.o pci_auto.o @@ -70,12 +86,16 @@ ifeq ($(CONFIG_PPC_GEN550),y) obj-$(CONFIG_KGDB) += gen550_kgdb.o gen550_dbg.o obj-$(CONFIG_SERIAL_TEXT_DEBUG) += gen550_dbg.o endif +ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y) +obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o +endif obj-$(CONFIG_BOOTX_TEXT) += btext.o obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o obj-$(CONFIG_40x) += dcr.o obj-$(CONFIG_BOOKE) += dcr.o -obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o +obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \ + ppc_sys.o ifeq ($(CONFIG_85xx),y) obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o endif diff --git a/arch/ppc/syslib/gen550_dbg.c b/arch/ppc/syslib/gen550_dbg.c index 4692ba719..9ef0113c8 100644 --- a/arch/ppc/syslib/gen550_dbg.c +++ b/arch/ppc/syslib/gen550_dbg.c @@ -29,6 +29,11 @@ #define SERIAL_BAUD 9600 +/* SERIAL_PORT_DFNS is defined in */ +#ifndef SERIAL_PORT_DFNS +#define SERIAL_PORT_DFNS +#endif + static struct serial_state rs_table[RS_TABLE_SIZE] = { SERIAL_PORT_DFNS /* defined in */ }; @@ -40,12 +45,12 @@ static int shift; unsigned long direct_inb(unsigned long addr) { - return readb(addr); + return readb((void __iomem *)addr); } void direct_outb(unsigned long addr, unsigned char val) { - writeb(val, addr); + writeb(val, (void __iomem *)addr); } unsigned long io_inb(unsigned long port) @@ -154,6 +159,7 @@ gen550_init(int i, struct uart_port *serial_req) rs_table[i].port = serial_req->iobase; rs_table[i].iomem_base = serial_req->membase; rs_table[i].iomem_reg_shift = serial_req->regshift; + rs_table[i].baud_base = serial_req->uartclk ? serial_req->uartclk / 16 : BASE_BAUD; } #ifdef CONFIG_SERIAL_TEXT_DEBUG diff --git a/arch/ppc/syslib/gen550_kgdb.c b/arch/ppc/syslib/gen550_kgdb.c index 232044cdb..7239d5d7d 100644 --- a/arch/ppc/syslib/gen550_kgdb.c +++ b/arch/ppc/syslib/gen550_kgdb.c @@ -9,9 +9,9 @@ * * Adapted from ppc4xx_kgdb.c. * - * Author: Matt Porter + * Author: Matt Porter * - * 2002-2003 (c) MontaVista Software, Inc. This file is licensed under + * 2002-2004 (c) MontaVista Software, Inc. 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. @@ -80,5 +80,7 @@ void gen550_kgdb_map_scc(void) { printk(KERN_DEBUG "kgdb init\n"); + if (ppc_md.early_serial_map) + ppc_md.early_serial_map(); kgdb_debugport = serial_init(KGDB_PORT, NULL); } diff --git a/arch/ppc/syslib/gt64260_pic.c b/arch/ppc/syslib/gt64260_pic.c index 70cb5772d..44aa87385 100644 --- a/arch/ppc/syslib/gt64260_pic.c +++ b/arch/ppc/syslib/gt64260_pic.c @@ -3,7 +3,7 @@ * * Interrupt controller support for Galileo's GT64260. * - * Author: Chris Zankel + * Author: Chris Zankel * Modified by: Mark A. Greer * * Based on sources from Rabeeh Khoury / Galileo Technology @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -43,8 +44,11 @@ #include #include #include -#include +#include +#define CPU_INTR_STR "gt64260 cpu interface error" +#define PCI0_INTR_STR "gt64260 pci 0 error" +#define PCI1_INTR_STR "gt64260 pci 1 error" /* ========================== forward declaration ========================== */ @@ -54,63 +58,55 @@ static void gt64260_mask_irq(unsigned int); /* ========================== local declarations =========================== */ struct hw_interrupt_type gt64260_pic = { - " GT64260_PIC ", /* typename */ - NULL, /* startup */ - NULL, /* shutdown */ - gt64260_unmask_irq, /* enable */ - gt64260_mask_irq, /* disable */ - gt64260_mask_irq, /* ack */ - NULL, /* end */ - NULL /* set_affinity */ + .typename = " gt64260_pic ", + .enable = gt64260_unmask_irq, + .disable = gt64260_mask_irq, + .ack = gt64260_mask_irq, + .end = gt64260_unmask_irq, }; -u32 gt64260_irq_base = 0; /* GT64260 handles the next 96 IRQs from here */ +u32 gt64260_irq_base = 0; /* GT64260 handles the next 96 IRQs from here */ + +static struct mv64x60_handle bh; /* gt64260_init_irq() * * This function initializes the interrupt controller. It assigns * all interrupts from IRQ0 to IRQ95 to the gt64260 interrupt controller. * - * Input Variable(s): - * None. - * - * Outpu. Variable(s): - * None. - * - * Returns: - * void - * * Note: * We register all GPP inputs as interrupt source, but disable them. */ - -__init void +void __init gt64260_init_irq(void) { int i; - if ( ppc_md.progress ) ppc_md.progress("gt64260_init_irq: enter", 0x0); + if (ppc_md.progress) + ppc_md.progress("gt64260_init_irq: enter", 0x0); + + bh.v_base = mv64x60_get_bridge_vbase(); ppc_cached_irq_mask[0] = 0; - ppc_cached_irq_mask[1] = 0x0f000000; /* Enable GPP intrs */ + ppc_cached_irq_mask[1] = 0x0f000000; /* Enable GPP intrs */ ppc_cached_irq_mask[2] = 0; /* disable all interrupts and clear current interrupts */ - gt_write(GT64260_GPP_INTR_MASK, ppc_cached_irq_mask[2]); - gt_write(GT64260_GPP_INTR_CAUSE,0); - gt_write(GT64260_IC_CPU_INTR_MASK_LO, ppc_cached_irq_mask[0]); - gt_write(GT64260_IC_CPU_INTR_MASK_HI, ppc_cached_irq_mask[1]); + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2]); + mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, 0); + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO, ppc_cached_irq_mask[0]); + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI, ppc_cached_irq_mask[1]); /* use the gt64260 for all (possible) interrupt sources */ - for( i = gt64260_irq_base; i < (gt64260_irq_base + 96); i++ ) { + for (i = gt64260_irq_base; i < (gt64260_irq_base + 96); i++) irq_desc[i].handler = >64260_pic; - } - if ( ppc_md.progress ) ppc_md.progress("gt64260_init_irq: exit", 0x0); + if (ppc_md.progress) + ppc_md.progress("gt64260_init_irq: exit", 0x0); } - -/* gt64260_get_irq() +/* + * gt64260_get_irq() * * This function returns the lowest interrupt number of all interrupts that * are currently asserted. @@ -123,7 +119,6 @@ gt64260_init_irq(void) * * Returns: * int or -2 (bogus interrupt) - * */ int gt64260_get_irq(struct pt_regs *regs) @@ -131,38 +126,41 @@ gt64260_get_irq(struct pt_regs *regs) int irq; int irq_gpp; - irq = gt_read(GT64260_IC_MAIN_CAUSE_LO); + irq = mv64x60_read(&bh, GT64260_IC_MAIN_CAUSE_LO); irq = __ilog2((irq & 0x3dfffffe) & ppc_cached_irq_mask[0]); if (irq == -1) { - irq = gt_read(GT64260_IC_MAIN_CAUSE_HI); + irq = mv64x60_read(&bh, GT64260_IC_MAIN_CAUSE_HI); irq = __ilog2((irq & 0x0f000db7) & ppc_cached_irq_mask[1]); - if (irq == -1) { - irq = -2; /* bogus interrupt, should never happen */ - } else { + if (irq == -1) + irq = -2; /* bogus interrupt, should never happen */ + else { if (irq >= 24) { - irq_gpp = gt_read(GT64260_GPP_INTR_CAUSE); + irq_gpp = mv64x60_read(&bh, + MV64x60_GPP_INTR_CAUSE); irq_gpp = __ilog2(irq_gpp & - ppc_cached_irq_mask[2]); + ppc_cached_irq_mask[2]); - if (irq_gpp == -1) { + if (irq_gpp == -1) irq = -2; - } else { + else { irq = irq_gpp + 64; - gt_write(GT64260_GPP_INTR_CAUSE, ~(1<<(irq-64))); + mv64x60_write(&bh, + MV64x60_GPP_INTR_CAUSE, + ~(1 << (irq - 64))); } - } else { + } else irq += 32; - } } } - if( irq < 0 ) { - return( irq ); - } else { - return( gt64260_irq_base + irq ); - } + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE); + + if (irq < 0) + return (irq); + else + return (gt64260_irq_base + irq); } /* gt64260_unmask_irq() @@ -178,32 +176,29 @@ gt64260_get_irq(struct pt_regs *regs) * Returns: * void */ - static void gt64260_unmask_irq(unsigned int irq) { irq -= gt64260_irq_base; - if (irq > 31) { - if (irq > 63) { - /* unmask GPP irq */ - gt_write(GT64260_GPP_INTR_MASK, - ppc_cached_irq_mask[2] |= (1<<(irq-64))); - } else { - /* mask high interrupt register */ - gt_write(GT64260_IC_CPU_INTR_MASK_HI, - ppc_cached_irq_mask[1] |= (1<<(irq-32))); - } - } else { - /* mask low interrupt register */ - gt_write(GT64260_IC_CPU_INTR_MASK_LO, - ppc_cached_irq_mask[0] |= (1< 31) + if (irq > 63) /* unmask GPP irq */ + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, + ppc_cached_irq_mask[2] |= (1 << (irq - 64))); + else /* mask high interrupt register */ + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI, + ppc_cached_irq_mask[1] |= (1 << (irq - 32))); + else /* mask low interrupt register */ + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO, + ppc_cached_irq_mask[0] |= (1 << irq)); + + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK); + return; +} /* gt64260_mask_irq() * - * This funktion disables the requested interrupt. + * This function disables the requested interrupt. * * Input Variable(s): * unsigned int interrupt number (IRQ0...IRQ95). @@ -214,28 +209,120 @@ gt64260_unmask_irq(unsigned int irq) * Returns: * void */ - static void gt64260_mask_irq(unsigned int irq) { irq -= gt64260_irq_base; - if (irq > 31) { - if (irq > 63) { - /* mask GPP irq */ - gt_write(GT64260_GPP_INTR_MASK, - ppc_cached_irq_mask[2] &= ~(1<<(irq-64))); - } else { - /* mask high interrupt register */ - gt_write(GT64260_IC_CPU_INTR_MASK_HI, - ppc_cached_irq_mask[1] &= ~(1<<(irq-32))); - } - } else { - /* mask low interrupt register */ - gt_write(GT64260_IC_CPU_INTR_MASK_LO, - ppc_cached_irq_mask[0] &= ~(1< 31) + if (irq > 63) /* mask GPP irq */ + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, + ppc_cached_irq_mask[2] &= ~(1 << (irq - 64))); + else /* mask high interrupt register */ + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI, + ppc_cached_irq_mask[1] &= ~(1 << (irq - 32))); + else /* mask low interrupt register */ + mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO, + ppc_cached_irq_mask[0] &= ~(1 << irq)); + + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK); + return; +} + +static irqreturn_t +gt64260_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + printk(KERN_ERR "gt64260_cpu_error_int_handler: %s 0x%08x\n", + "Error on CPU interface - Cause regiser", + mv64x60_read(&bh, MV64x60_CPU_ERR_CAUSE)); + printk(KERN_ERR "\tCPU error register dump:\n"); + printk(KERN_ERR "\tAddress low 0x%08x\n", + mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_LO)); + printk(KERN_ERR "\tAddress high 0x%08x\n", + mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_HI)); + printk(KERN_ERR "\tData low 0x%08x\n", + mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_LO)); + printk(KERN_ERR "\tData high 0x%08x\n", + mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_HI)); + printk(KERN_ERR "\tParity 0x%08x\n", + mv64x60_read(&bh, MV64x60_CPU_ERR_PARITY)); + mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0); + return IRQ_HANDLED; +} + +static irqreturn_t +gt64260_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + u32 val; + unsigned int pci_bus = (unsigned int)dev_id; + + if (pci_bus == 0) { /* Error on PCI 0 */ + val = mv64x60_read(&bh, MV64x60_PCI0_ERR_CAUSE); + printk(KERN_ERR "%s: Error in PCI %d Interface\n", + "gt64260_pci_error_int_handler", pci_bus); + printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus); + printk(KERN_ERR "\tCause register 0x%08x\n", val); + printk(KERN_ERR "\tAddress Low 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_LO)); + printk(KERN_ERR "\tAddress High 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_HI)); + printk(KERN_ERR "\tAttribute 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI0_ERR_DATA_LO)); + printk(KERN_ERR "\tCommand 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI0_ERR_CMD)); + mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, ~val); + } + if (pci_bus == 1) { /* Error on PCI 1 */ + val = mv64x60_read(&bh, MV64x60_PCI1_ERR_CAUSE); + printk(KERN_ERR "%s: Error in PCI %d Interface\n", + "gt64260_pci_error_int_handler", pci_bus); + printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus); + printk(KERN_ERR "\tCause register 0x%08x\n", val); + printk(KERN_ERR "\tAddress Low 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_LO)); + printk(KERN_ERR "\tAddress High 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_HI)); + printk(KERN_ERR "\tAttribute 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI1_ERR_DATA_LO)); + printk(KERN_ERR "\tCommand 0x%08x\n", + mv64x60_read(&bh, MV64x60_PCI1_ERR_CMD)); + mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, ~val); } + return IRQ_HANDLED; } + +static int __init +gt64260_register_hdlrs(void) +{ + int rc; + + /* Register CPU interface error interrupt handler */ + if ((rc = request_irq(MV64x60_IRQ_CPU_ERR, + gt64260_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0))) + printk(KERN_WARNING "Can't register cpu error handler: %d", rc); + + mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0x000000fe); + + /* Register PCI 0 error interrupt handler */ + if ((rc = request_irq(MV64360_IRQ_PCI0, gt64260_pci_error_int_handler, + SA_INTERRUPT, PCI0_INTR_STR, (void *)0))) + printk(KERN_WARNING "Can't register pci 0 error handler: %d", + rc); + + mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0x003c0c24); + + /* Register PCI 1 error interrupt handler */ + if ((rc = request_irq(MV64360_IRQ_PCI1, gt64260_pci_error_int_handler, + SA_INTERRUPT, PCI1_INTR_STR, (void *)1))) + printk(KERN_WARNING "Can't register pci 1 error handler: %d", + rc); + + mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0x003c0c24); + + return 0; +} + +arch_initcall(gt64260_register_hdlrs); diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c index c6c361b99..b9391e650 100644 --- a/arch/ppc/syslib/i8259.c +++ b/arch/ppc/syslib/i8259.c @@ -10,7 +10,7 @@ unsigned char cached_8259[2] = { 0xff, 0xff }; #define cached_A1 (cached_8259[0]) #define cached_21 (cached_8259[1]) -static spinlock_t i8259_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(i8259_lock); int i8259_pic_irq_offset; @@ -140,15 +140,31 @@ struct hw_interrupt_type i8259_pic = { }; static struct resource pic1_iores = { - "8259 (master)", 0x20, 0x21, IORESOURCE_BUSY + .name = "8259 (master)", + .start = 0x20, + .end = 0x21, + .flags = IORESOURCE_BUSY, }; static struct resource pic2_iores = { - "8259 (slave)", 0xa0, 0xa1, IORESOURCE_BUSY + .name = "8259 (slave)", + .start = 0xa0, + .end = 0xa1, + .flags = IORESOURCE_BUSY, }; static struct resource pic_edgectrl_iores = { - "8259 edge control", 0x4d0, 0x4d1, IORESOURCE_BUSY + .name = "8259 edge control", + .start = 0x4d0, + .end = 0x4d1, + .flags = IORESOURCE_BUSY, +}; + +static struct irqaction i8259_irqaction = { + .handler = no_action, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, + .name = "82c59 secondary cascade", }; /* @@ -185,8 +201,7 @@ i8259_init(long intack_addr) spin_unlock_irqrestore(&i8259_lock, flags); /* reserve our resources */ - request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT, - "82c59 secondary cascade", NULL ); + setup_irq( i8259_pic_irq_offset + 2, &i8259_irqaction); request_resource(&ioport_resource, &pic1_iores); request_resource(&ioport_resource, &pic2_iores); request_resource(&ioport_resource, &pic_edgectrl_iores); diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c index 5da7bca6b..5e2ce6bf5 100644 --- a/arch/ppc/syslib/ibm440gx_common.c +++ b/arch/ppc/syslib/ibm440gx_common.c @@ -4,7 +4,7 @@ * PPC440GX system library * * Eugene Surovegin or - * Copyright (c) 2003 Zultys Technologies + * Copyright (c) 2003, 2004 Zultys Technologies * * 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 @@ -14,6 +14,7 @@ */ #include #include +#include #include #include #include @@ -97,10 +98,51 @@ bypass: p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256); } -/* Enable L2 cache (call with IRQs disabled) */ +/* Issue L2C diagnostic command */ +static inline u32 l2c_diag(u32 addr) +{ + mtdcr(DCRN_L2C0_ADDR, addr); + mtdcr(DCRN_L2C0_CMD, L2C_CMD_DIAG); + while (!(mfdcr(DCRN_L2C0_SR) & L2C_SR_CC)) ; + return mfdcr(DCRN_L2C0_DATA); +} + +static irqreturn_t l2c_error_handler(int irq, void* dev, struct pt_regs* regs) +{ + u32 sr = mfdcr(DCRN_L2C0_SR); + if (sr & L2C_SR_CPE){ + /* Read cache trapped address */ + u32 addr = l2c_diag(0x42000000); + printk(KERN_EMERG "L2C: Cache Parity Error, addr[16:26] = 0x%08x\n", addr); + } + if (sr & L2C_SR_TPE){ + /* Read tag trapped address */ + u32 addr = l2c_diag(0x82000000) >> 16; + printk(KERN_EMERG "L2C: Tag Parity Error, addr[16:26] = 0x%08x\n", addr); + } + + /* Clear parity errors */ + if (sr & (L2C_SR_CPE | L2C_SR_TPE)){ + mtdcr(DCRN_L2C0_ADDR, 0); + mtdcr(DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE); + } else + printk(KERN_EMERG "L2C: LRU error\n"); + + return IRQ_HANDLED; +} + +/* Enable L2 cache */ void __init ibm440gx_l2c_enable(void){ u32 r; + unsigned long flags; + + /* Install error handler */ + if (request_irq(87, l2c_error_handler, SA_INTERRUPT, "L2C", 0) < 0){ + printk(KERN_ERR "Cannot install L2C error handler, cache is not enabled\n"); + return; + } + local_irq_save(flags); asm volatile ("sync" ::: "memory"); /* Disable SRAM */ @@ -137,20 +179,22 @@ void __init ibm440gx_l2c_enable(void){ /* Enable ICU/DCU ports */ r = mfdcr(DCRN_L2C0_CFG); - r &= ~(L2C_CFG_DCW_MASK | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM - | L2C_CFG_PMUX_MASK | L2C_CFG_PMIM | L2C_CFG_TPEI | L2C_CFG_CPEI - | L2C_CFG_NAM | L2C_CFG_NBRM); + r &= ~(L2C_CFG_DCW_MASK | L2C_CFG_PMUX_MASK | L2C_CFG_PMIM | L2C_CFG_TPEI + | L2C_CFG_CPEI | L2C_CFG_NAM | L2C_CFG_NBRM); r |= L2C_CFG_ICU | L2C_CFG_DCU | L2C_CFG_TPC | L2C_CFG_CPC | L2C_CFG_FRAN - | L2C_CFG_SMCM; + | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM | L2C_CFG_SMCM; mtdcr(DCRN_L2C0_CFG, r); asm volatile ("sync; isync" ::: "memory"); + local_irq_restore(flags); } -/* Disable L2 cache (call with IRQs disabled) */ +/* Disable L2 cache */ void __init ibm440gx_l2c_disable(void){ u32 r; + unsigned long flags; + local_irq_save(flags); asm volatile ("sync" ::: "memory"); /* Disable L2C mode */ @@ -169,6 +213,20 @@ void __init ibm440gx_l2c_disable(void){ SRAM_SBCR_BAS3 | SRAM_SBCR_BS_64KB | SRAM_SBCR_BU_RW); asm volatile ("sync; isync" ::: "memory"); + local_irq_restore(flags); +} + +void __init ibm440gx_l2c_setup(struct ibm44x_clocks* p) +{ + /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C, + enable it on all other revisions + */ + u32 pvr = mfspr(PVR); + if (pvr == PVR_440GX_RA || pvr == PVR_440GX_RB || + (pvr == PVR_440GX_RC && p->cpu > 667000000)) + ibm440gx_l2c_disable(); + else + ibm440gx_l2c_enable(); } int __init ibm440gx_get_eth_grp(void) diff --git a/arch/ppc/syslib/ibm440gx_common.h b/arch/ppc/syslib/ibm440gx_common.h index 5dbca9896..e73aa0411 100644 --- a/arch/ppc/syslib/ibm440gx_common.h +++ b/arch/ppc/syslib/ibm440gx_common.h @@ -4,7 +4,7 @@ * PPC440GX system library * * Eugene Surovegin or - * Copyright (c) 2003 Zultys Technologies + * Copyright (c) 2003, 2004 Zultys Technologies * * 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 @@ -37,6 +37,9 @@ void ibm440gx_l2c_enable(void) __init; /* Disable L2 cache */ void ibm440gx_l2c_disable(void) __init; +/* Enable/disable L2 cache for a particular chip revision */ +void ibm440gx_l2c_setup(struct ibm44x_clocks*) __init; + /* Get Ethernet Group */ int ibm440gx_get_eth_grp(void) __init; diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c index 76d18d337..7612e0623 100644 --- a/arch/ppc/syslib/ibm44x_common.c +++ b/arch/ppc/syslib/ibm44x_common.c @@ -3,8 +3,8 @@ * * PPC44x system library * - * Matt Porter - * Copyright 2002-2003 MontaVista Software Inc. + * Matt Porter + * Copyright 2002-2005 MontaVista Software Inc. * * Eugene Surovegin or * Copyright (c) 2003, 2004 Zultys Technologies @@ -16,15 +16,19 @@ * */ #include +#include #include #include +#include -#include #include #include #include #include #include +#include + +#include phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) { @@ -35,15 +39,22 @@ phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) * address in the 440's 36-bit address space. Fix * them up with the appropriate ERPN */ - if ((addr >= PPC44x_IO_LO) && (addr < PPC44x_IO_HI)) + if ((addr >= PPC44x_IO_LO) && (addr <= PPC44x_IO_HI)) page_4gb = PPC44x_IO_PAGE; - else if ((addr >= PPC44x_PCICFG_LO) && (addr < PPC44x_PCICFG_HI)) + else if ((addr >= PPC44x_PCI0CFG_LO) && (addr <= PPC44x_PCI0CFG_HI)) + page_4gb = PPC44x_PCICFG_PAGE; +#ifdef CONFIG_440SP + else if ((addr >= PPC44x_PCI1CFG_LO) && (addr <= PPC44x_PCI1CFG_HI)) page_4gb = PPC44x_PCICFG_PAGE; - else if ((addr >= PPC44x_PCIMEM_LO) && (addr < PPC44x_PCIMEM_HI)) + else if ((addr >= PPC44x_PCI2CFG_LO) && (addr <= PPC44x_PCI2CFG_HI)) + page_4gb = PPC44x_PCICFG_PAGE; +#endif + else if ((addr >= PPC44x_PCIMEM_LO) && (addr <= PPC44x_PCIMEM_HI)) page_4gb = PPC44x_PCIMEM_PAGE; return (page_4gb | addr); }; +EXPORT_SYMBOL(fixup_bigphys_addr); void __init ibm44x_calibrate_decr(unsigned int freq) { @@ -139,64 +150,44 @@ static unsigned long __init ibm44x_find_end_of_memory(void) return mem_size; } -static void __init ibm44x_init_irq(void) -{ - int i; - - ppc4xx_pic_init(); - - for (i = 0; i < NR_IRQS; i++) - irq_desc[i].handler = ppc4xx_pic; -} - -#ifdef CONFIG_SERIAL_TEXT_DEBUG -#include -#include -#include - -static struct serial_state rs_table[RS_TABLE_SIZE] = { - SERIAL_PORT_DFNS /* Defined in */ -}; - -static void ibm44x_progress(char *s, unsigned short hex) -{ - volatile char c; - volatile unsigned long com_port; - u16 shift; - - com_port = (unsigned long)rs_table[0].iomem_base; - shift = rs_table[0].iomem_reg_shift; - - while ((c = *s++) != 0) { - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = c; - - } - - /* Send LF/CR to pretty up output */ - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = '\r'; - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = '\n'; -} -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ - void __init ibm44x_platform_init(void) { - ppc_md.init_IRQ = ibm44x_init_irq; + ppc_md.init_IRQ = ppc4xx_pic_init; ppc_md.find_end_of_memory = ibm44x_find_end_of_memory; ppc_md.restart = ibm44x_restart; ppc_md.power_off = ibm44x_power_off; ppc_md.halt = ibm44x_halt; #ifdef CONFIG_SERIAL_TEXT_DEBUG - ppc_md.progress = ibm44x_progress; + ppc_md.progress = gen550_progress; #endif /* CONFIG_SERIAL_TEXT_DEBUG */ +#ifdef CONFIG_KGDB + ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; +#endif + + /* + * The Abatron BDI JTAG debugger does not tolerate others + * mucking with the debug registers. + */ +#if !defined(CONFIG_BDI_SWITCH) + /* Enable internal debug mode */ + mtspr(SPRN_DBCR0, (DBCR0_IDM)); + + /* Clear any residual debug events */ + mtspr(SPRN_DBSR, 0xffffffff); +#endif } +/* Called from MachineCheckException */ +void platform_machine_check(struct pt_regs *regs) +{ + printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n", + mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL), + mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESR)); + printk("POB0: BEAR=0x%08x%08x BESR0=0x%08x BESR1=0x%08x\n", + mfdcr(DCRN_POB0_BEARH), mfdcr(DCRN_POB0_BEARL), + mfdcr(DCRN_POB0_BESR0), mfdcr(DCRN_POB0_BESR1)); + printk("OPB0: BEAR=0x%08x%08x BSTAT=0x%08x\n", + mfdcr(DCRN_OPB0_BEARH), mfdcr(DCRN_OPB0_BEARL), + mfdcr(DCRN_OPB0_BSTAT)); +} diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/ppc/syslib/indirect_pci.c index 4bc90eb2c..a5a752609 100644 --- a/arch/ppc/syslib/indirect_pci.c +++ b/arch/ppc/syslib/indirect_pci.c @@ -32,7 +32,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose = bus->sysdata; - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; u8 cfg_type = 0; if (ppc_md.pci_exclude_device) @@ -54,13 +54,13 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, cfg_data = hose->cfg_data + (offset & 3); switch (len) { case 1: - *val = in_8((u8 *)cfg_data); + *val = in_8(cfg_data); break; case 2: - *val = in_le16((u16 *)cfg_data); + *val = in_le16(cfg_data); break; default: - *val = in_le32((u32 *)cfg_data); + *val = in_le32(cfg_data); break; } return PCIBIOS_SUCCESSFUL; @@ -71,7 +71,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose = bus->sysdata; - volatile unsigned char *cfg_data; + volatile void __iomem *cfg_data; u8 cfg_type = 0; if (ppc_md.pci_exclude_device) @@ -93,13 +93,13 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, cfg_data = hose->cfg_data + (offset & 3); switch (len) { case 1: - out_8((u8 *)cfg_data, val); + out_8(cfg_data, val); break; case 2: - out_le16((u16 *)cfg_data, val); + out_le16(cfg_data, val); break; default: - out_le32((u32 *)cfg_data, val); + out_le32(cfg_data, val); break; } return PCIBIOS_SUCCESSFUL; @@ -111,16 +111,25 @@ static struct pci_ops indirect_pci_ops = indirect_write_config }; +void __init +setup_indirect_pci_nomap(struct pci_controller* hose, void __iomem * cfg_addr, + void __iomem * cfg_data) +{ + hose->cfg_addr = cfg_addr; + hose->cfg_data = cfg_data; + hose->ops = &indirect_pci_ops; +} + void __init setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data) { unsigned long base = cfg_addr & PAGE_MASK; - char *mbase; + void __iomem *mbase, *addr, *data; mbase = ioremap(base, PAGE_SIZE); - hose->cfg_addr = (unsigned int *)(mbase + (cfg_addr & ~PAGE_MASK)); + addr = mbase + (cfg_addr & ~PAGE_MASK); if ((cfg_data & PAGE_MASK) != base) mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE); - hose->cfg_data = (unsigned char *)(mbase + (cfg_data & ~PAGE_MASK)); - hose->ops = &indirect_pci_ops; + data = mbase + (cfg_data & ~PAGE_MASK); + setup_indirect_pci_nomap(hose, addr, data); } diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c index bfa66a235..f3c12a51b 100644 --- a/arch/ppc/syslib/m8260_setup.c +++ b/arch/ppc/syslib/m8260_setup.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,12 @@ extern void cpm2_reset(void); extern void m8260_find_bridges(void); extern void idma_pci9_init(void); +/* Place-holder for board-specific init */ +void __attribute__ ((weak)) __init +m82xx_board_setup(void) +{ +} + static void __init m8260_setup_arch(void) { @@ -55,6 +62,7 @@ m8260_setup_arch(void) if (initrd_start) ROOT_DEV = Root_RAM0; #endif + m82xx_board_setup(); } /* The decrementer counts at the system (internal) clock frequency @@ -202,7 +210,7 @@ m8260_map_io(void) io_block_mapping(IO_VIRT_ADDR, IO_PHYS_ADDR, 0x10000000, _PAGE_IO); } -/* Place-holder for board-specific init */ +/* Place-holder for board-specific ppc_md hooking */ void __attribute__ ((weak)) __init m82xx_board_init(void) { @@ -241,9 +249,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, strcpy(cmd_line, (char *)(r6+KERNELBASE)); } - /* Call back for board-specific settings. */ - m82xx_board_init(); - ppc_md.setup_arch = m8260_setup_arch; ppc_md.show_cpuinfo = m8260_show_cpuinfo; ppc_md.init_IRQ = m8260_init_IRQ; @@ -259,4 +264,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.find_end_of_memory = m8260_find_end_of_memory; ppc_md.setup_io_mappings = m8260_map_io; + + /* Call back for board-specific settings and overrides. */ + m82xx_board_init(); } diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index 0dc7889a8..c1db2ab1d 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c @@ -57,8 +57,10 @@ unsigned char __res[sizeof(bd_t)]; extern void m8xx_ide_init(void); extern unsigned long find_available_memory(void); -extern void m8xx_cpm_reset(uint); +extern void m8xx_cpm_reset(uint cpm_page); +extern void m8xx_wdt_handler_install(bd_t *bp); extern void rpxfb_alloc_pages(void); +extern void cpm_interrupt_init(void); void __attribute__ ((weak)) board_init(void) @@ -123,11 +125,19 @@ abort(void) } /* A place holder for time base interrupts, if they are ever enabled. */ -void timebase_interrupt(int irq, void * dev, struct pt_regs * regs) +irqreturn_t timebase_interrupt(int irq, void * dev, struct pt_regs * regs) { printk ("timebase_interrupt()\n"); + + return IRQ_HANDLED; } +static struct irqaction tbint_irqaction = { + .handler = timebase_interrupt, + .mask = CPU_MASK_NONE, + .name = "tbint", +}; + /* The decrementer counts at the system (internal) clock frequency divided by * sixteen, or external oscillator divided by four. We force the processor * to use system clock divided by sixteen. @@ -192,8 +202,15 @@ void __init m8xx_calibrate_decr(void) ((mk_int_int_mask(DEC_INTERRUPT) << 8) | (TBSCR_TBF | TBSCR_TBE)); - if (request_8xxirq(DEC_INTERRUPT, timebase_interrupt, 0, "tbint", NULL) != 0) + if (setup_irq(DEC_INTERRUPT, &tbint_irqaction)) panic("Could not allocate timer IRQ!"); + +#ifdef CONFIG_8xx_WDT + /* Install watchdog timer handler early because it might be + * already enabled by the bootloader + */ + m8xx_wdt_handler_install(binfo); +#endif } /* The RTC on the MPC8xx is an internal register. @@ -221,7 +238,7 @@ m8xx_restart(char *cmd) { __volatile__ unsigned char dummy; - cli(); + local_irq_disable(); ((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr |= 0x00000080; /* Clear the ME bit in MSR to cause checkstop on machine check @@ -261,6 +278,14 @@ m8xx_show_percpuinfo(struct seq_file *m, int i) return 0; } +#ifdef CONFIG_PCI +static struct irqaction mbx_i8259_irqaction = { + .handler = mbx_i8259_action, + .mask = CPU_MASK_NONE, + .name = "i8259 cascade", +}; +#endif + /* Initialize the internal interrupt controller. The number of * interrupts supported can vary with the processor type, and the * 82xx family can have up to 64. @@ -271,25 +296,26 @@ static void __init m8xx_init_IRQ(void) { int i; - void cpm_interrupt_init(void); - for ( i = 0 ; i < NR_SIU_INTS ; i++ ) - irq_desc[i].handler = &ppc8xx_pic; + for (i = SIU_IRQ_OFFSET ; i < SIU_IRQ_OFFSET + NR_SIU_INTS ; i++) + irq_desc[i].handler = &ppc8xx_pic; - /* We could probably incorporate the CPM into the multilevel - * interrupt structure. - */ cpm_interrupt_init(); - unmask_irq(CPM_INTERRUPT); #if defined(CONFIG_PCI) - for ( i = NR_SIU_INTS ; i < (NR_SIU_INTS + NR_8259_INTS) ; i++ ) - irq_desc[i].handler = &i8259_pic; - i8259_pic.irq_offset = NR_SIU_INTS; - i8259_init(); - request_8xxirq(ISA_BRIDGE_INT, mbx_i8259_action, 0, "8259 cascade", NULL); - enable_irq(ISA_BRIDGE_INT); -#endif + for (i = I8259_IRQ_OFFSET ; i < I8259_IRQ_OFFSET + NR_8259_INTS ; i++) + irq_desc[i].handler = &i8259_pic; + + i8259_pic_irq_offset = I8259_IRQ_OFFSET; + i8259_init(0); + + /* The i8259 cascade interrupt must be level sensitive. */ + ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel &= + ~(0x80000000 >> ISA_BRIDGE_INT); + + if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) + enable_irq(ISA_BRIDGE_INT); +#endif /* CONFIG_PCI */ } /* -------------------------------------------------------------------- */ @@ -340,7 +366,7 @@ m8xx_map_io(void) io_block_mapping(_IO_BASE,_IO_BASE,_IO_BASE_SIZE, _PAGE_IO); #endif #endif -#ifdef CONFIG_HTDMSOUND +#if defined(CONFIG_HTDMSOUND) || defined(CONFIG_RPXTOUCH) || defined(CONFIG_FB_RPX) io_block_mapping(HIOX_CSR_ADDR, HIOX_CSR_ADDR, HIOX_CSR_SIZE, _PAGE_IO); #endif #ifdef CONFIG_FADS @@ -349,6 +375,9 @@ m8xx_map_io(void) #ifdef CONFIG_PCI io_block_mapping(PCI_CSR_ADDR, PCI_CSR_ADDR, PCI_CSR_SIZE, _PAGE_IO); #endif +#if defined(CONFIG_NETTA) + io_block_mapping(_IO_BASE,_IO_BASE,_IO_BASE_SIZE, _PAGE_IO); +#endif } void __init diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c index 153c811b1..fd93adfd4 100644 --- a/arch/ppc/syslib/mpc10x_common.c +++ b/arch/ppc/syslib/mpc10x_common.c @@ -43,7 +43,7 @@ #ifdef CONFIG_MPC10X_OPENPIC #ifdef CONFIG_EPIC_SERIAL_MODE -#define EPIC_IRQ_BASE 16 +#define EPIC_IRQ_BASE (epic_serial_mode ? 16 : 5) #else #define EPIC_IRQ_BASE 5 #endif @@ -69,20 +69,16 @@ static struct ocp_def mpc10x_i2c_ocp = { .vendor = OCP_VENDOR_MOTOROLA, .function = OCP_FUNC_IIC, .index = 0, - .irq = MPC10X_I2C_IRQ, .additions = &mpc10x_i2c_data }; static struct ocp_def mpc10x_dma_ocp[2] = { { .vendor = OCP_VENDOR_MOTOROLA, .function = OCP_FUNC_DMA, - .index = 0, - .irq = MPC10X_DMA0_IRQ -}, + .index = 0 }, { .vendor = OCP_VENDOR_MOTOROLA, .function = OCP_FUNC_DMA, - .index = 1, - .irq = MPC10X_DMA1_IRQ } + .index = 1 } }; /* Set resources to match bridge memory map */ @@ -292,12 +288,15 @@ mpc10x_bridge_init(struct pci_controller *hose, MPC10X_EUMB_EPIC_SIZE); #endif mpc10x_i2c_ocp.paddr = phys_eumb_base + MPC10X_EUMB_I2C_OFFSET; + mpc10x_i2c_ocp.irq = MPC10X_I2C_IRQ; ocp_add_one_device(&mpc10x_i2c_ocp); mpc10x_dma_ocp[0].paddr = phys_eumb_base + MPC10X_EUMB_DMA_OFFSET + 0x100; + mpc10x_dma_ocp[0].irq = MPC10X_DMA0_IRQ; ocp_add_one_device(&mpc10x_dma_ocp[0]); mpc10x_dma_ocp[1].paddr = phys_eumb_base + MPC10X_EUMB_DMA_OFFSET + 0x200; + mpc10x_dma_ocp[1].irq = MPC10X_DMA1_IRQ; ocp_add_one_device(&mpc10x_dma_ocp[1]); } @@ -307,6 +306,41 @@ mpc10x_bridge_init(struct pci_controller *hose, mpc10x_disable_store_gathering(hose); #endif + /* + * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative + * PCI reads may return stale data so turn off. + */ + if ((host_bridge == MPC10X_BRIDGE_8240) + || (host_bridge == MPC10X_BRIDGE_8245) + || (host_bridge == MPC10X_BRIDGE_107)) { + + early_read_config_dword(hose, 0, PCI_DEVFN(0,0), + MPC10X_CFG_PICR1_REG, &picr1); + + picr1 &= ~MPC10X_CFG_PICR1_SPEC_PCI_RD; + + early_write_config_dword(hose, 0, PCI_DEVFN(0,0), + MPC10X_CFG_PICR1_REG, picr1); + } + + /* + * 8241/8245 erratum 28: PCI reads from local memory may return + * stale data. Workaround by setting PICR2[0] to disable copyback + * optimization. Oddly, the latest available user manual for the + * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd. + */ + if (host_bridge == MPC10X_BRIDGE_8245) { + ulong picr2; + + early_read_config_dword(hose, 0, PCI_DEVFN(0,0), + MPC10X_CFG_PICR2_REG, &picr2); + + picr2 |= MPC10X_CFG_PICR2_COPYBACK_OPT; + + early_write_config_dword(hose, 0, PCI_DEVFN(0,0), + MPC10X_CFG_PICR2_REG, picr2); + } + if (ppc_md.progress) ppc_md.progress("mpc10x:exit", 0x100); return 0; } diff --git a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c index d73e6fea5..6bd014d7c 100644 --- a/arch/ppc/syslib/mpc52xx_setup.c +++ b/arch/ppc/syslib/mpc52xx_setup.c @@ -19,6 +19,7 @@ #include +#include #include #include #include diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c index ef0762955..7a8d7085d 100644 --- a/arch/ppc/syslib/mv64360_pic.c +++ b/arch/ppc/syslib/mv64360_pic.c @@ -1,6 +1,6 @@ /* * arch/ppc/kernel/mv64360_pic.c - * + * * Interrupt controller support for Marvell's MV64360. * * Author: Rabeeh Khoury @@ -24,13 +24,13 @@ * summarizes the interrupts generated by the units of the MV64360. * Each bit is assigned to an interrupt number, where the low register * are assigned from IRQ0 to IRQ31 and the high cause register - * from IRQ32 to IRQ63 - * The GPP (General Purpose Pins) interrupts are assigned from IRQ64 (GPP0) - * to IRQ95 (GPP31). + * from IRQ32 to IRQ63 + * The GPP (General Purpose Pins) interrupts are assigned from IRQ64 (GPP0) + * to IRQ95 (GPP31). * get_irq() returns the lowest interrupt number that is currently asserted. * - * Note: - * - This driver does not initialize the GPP when used as an interrupt + * Note: + * - This driver does not initialize the GPP when used as an interrupt * input. */ @@ -47,42 +47,43 @@ #include #include #include -#include #include #ifdef CONFIG_IRQ_ALL_CPUS -#error "The mv64360 does not support yet distribution of IRQs on all CPUs" +#error "The mv64360 does not support distribution of IRQs on all CPUs" #endif /* ========================== forward declaration ========================== */ static void mv64360_unmask_irq(unsigned int); static void mv64360_mask_irq(unsigned int); static irqreturn_t mv64360_cpu_error_int_handler(int, void *, struct pt_regs *); -static irqreturn_t mv64360_sram_error_int_handler(int, void *, struct pt_regs *); +static irqreturn_t mv64360_sram_error_int_handler(int, void *, + struct pt_regs *); static irqreturn_t mv64360_pci_error_int_handler(int, void *, struct pt_regs *); /* ========================== local declarations =========================== */ struct hw_interrupt_type mv64360_pic = { - .typename = " MV64360_PIC ", /* typename */ - .enable = mv64360_unmask_irq, /* enable */ - .disable = mv64360_mask_irq, /* disable */ - .ack = mv64360_mask_irq, /* ack */ + .typename = " mv64360_pic ", + .enable = mv64360_unmask_irq, + .disable = mv64360_mask_irq, + .ack = mv64360_mask_irq, + .end = mv64360_unmask_irq, }; -#define CPU_INTR_STR "MV64360 CPU interface error" -#define SRAM_INTR_STR "MV64360 internal sram error" -#define PCI0_INTR_STR "MV64360 PCI 0 error" -#define PCI1_INTR_STR "MV64360 PCI 1 error" +#define CPU_INTR_STR "mv64360 cpu interface error" +#define SRAM_INTR_STR "mv64360 internal sram error" +#define PCI0_INTR_STR "mv64360 pci 0 error" +#define PCI1_INTR_STR "mv64360 pci 1 error" -static mv64x60_handle_t base_bh; +static struct mv64x60_handle bh; u32 mv64360_irq_base = 0; /* MV64360 handles the next 96 IRQs from here */ /* mv64360_init_irq() * - * This function initializes the interrupt controller. It assigns - * all interrupts from IRQ0 to IRQ95 to the mv64360 interrupt controller. + * This function initializes the interrupt controller. It assigns + * all interrupts from IRQ0 to IRQ95 to the mv64360 interrupt controller. * * Input Variable(s): * None. @@ -96,73 +97,40 @@ u32 mv64360_irq_base = 0; /* MV64360 handles the next 96 IRQs from here */ * Note: * We register all GPP inputs as interrupt source, but disable them. */ - -__init void +void __init mv64360_init_irq(void) { - struct ocp_def *def; int i; if (ppc_md.progress) ppc_md.progress("mv64360_init_irq: enter", 0x0); - if ( ppc_md.progress ) ppc_md.progress("mv64360_init_irq: enter", 0x0); - - if ((def = ocp_get_one_device(OCP_VENDOR_MARVELL, OCP_FUNC_HB, - OCP_ANY_INDEX)) == NULL) { - /* XXXX SCREAM */ - return; - } - base_bh.v_base = (unsigned long)ioremap(def->paddr, 0x1000); + bh.v_base = mv64x60_get_bridge_vbase(); ppc_cached_irq_mask[0] = 0; ppc_cached_irq_mask[1] = 0x0f000000; /* Enable GPP intrs */ ppc_cached_irq_mask[2] = 0; /* disable all interrupts and clear current interrupts */ - mv64x60_write(&base_bh, MV64x60_GPP_INTR_CAUSE, 0); - mv64x60_write(&base_bh, MV64x60_GPP_INTR_MASK, - ppc_cached_irq_mask[2]); - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_LO, - ppc_cached_irq_mask[0]); - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_HI, - ppc_cached_irq_mask[1]); - - /* use the mv64360 for all (possible) interrupt sources */ + mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, 0); + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2]); + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO,ppc_cached_irq_mask[0]); + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI,ppc_cached_irq_mask[1]); + + /* All interrupts are level interrupts */ for (i = mv64360_irq_base; i < (mv64360_irq_base + 96); i++) { - /* All interrupts are level interrupts */ irq_desc[i].status |= IRQ_LEVEL; irq_desc[i].handler = &mv64360_pic; } - /* Register CPU interface error interrupt handler */ - request_irq(MV64x60_IRQ_CPU_ERR, mv64360_cpu_error_int_handler, - SA_INTERRUPT, CPU_INTR_STR, 0); - mv64x60_write(&base_bh, MV64x60_CPU_ERR_MASK, 0x000000ff); - - /* Register internal SRAM error interrupt handler */ - request_irq(MV64360_IRQ_SRAM_PAR_ERR, mv64360_sram_error_int_handler, - SA_INTERRUPT, SRAM_INTR_STR, 0); - - /* Register PCI 0 error interrupt handler */ - request_irq(MV64360_IRQ_PCI0, mv64360_pci_error_int_handler, - SA_INTERRUPT, PCI0_INTR_STR, (void *) 0); - mv64x60_write(&base_bh, MV64x60_PCI0_ERR_MASK, 0x00a50c25); - - /* Register PCI 1 error interrupt handler */ - request_irq(MV64360_IRQ_PCI1, mv64360_pci_error_int_handler, - SA_INTERRUPT, PCI1_INTR_STR, (void *) 1); - mv64x60_write(&base_bh, MV64x60_PCI1_ERR_MASK, 0x00a50c25); - if (ppc_md.progress) ppc_md.progress("mv64360_init_irq: exit", 0x0); } - /* mv64360_get_irq() * - * This function returns the lowest interrupt number of all interrupts that - * are currently asserted. + * This function returns the lowest interrupt number of all interrupts that + * are currently asserted. * * Input Variable(s): * struct pt_regs* not used @@ -172,7 +140,7 @@ mv64360_init_irq(void) * * Returns: * int or -2 (bogus interrupt) - * + * */ int mv64360_get_irq(struct pt_regs *regs) @@ -181,60 +149,59 @@ mv64360_get_irq(struct pt_regs *regs) int irq_gpp; #ifdef CONFIG_SMP -#define BIT28 (1<<28) - /* + /* * Second CPU gets only doorbell (message) interrupts. * The doorbell interrupt is BIT28 in the main interrupt low cause reg. */ int cpu_nr = smp_processor_id(); if (cpu_nr == 1) { - irq = mv64x60_read(&base_bh, MV64360_IC_MAIN_CAUSE_LO); - if (!(irq & BIT28)) + if (!(mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_LO) & (1 << 28))) return -1; return 28; } #endif - irq = mv64x60_read(&base_bh, MV64360_IC_MAIN_CAUSE_LO); + irq = mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_LO); irq = __ilog2((irq & 0x3dfffffe) & ppc_cached_irq_mask[0]); + if (irq == -1) { - irq = mv64x60_read(&base_bh, MV64360_IC_MAIN_CAUSE_HI); + irq = mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_HI); irq = __ilog2((irq & 0x1f0003f7) & ppc_cached_irq_mask[1]); - if (irq == -1) { - irq = -2; /* bogus interrupt, should never happen */ - } else { + + if (irq == -1) + irq = -2; /* bogus interrupt, should never happen */ + else { if ((irq >= 24) && (irq < 28)) { - irq_gpp = - mv64x60_read(&base_bh, - MV64x60_GPP_INTR_CAUSE); - irq_gpp = - __ilog2(irq_gpp & + irq_gpp = mv64x60_read(&bh, + MV64x60_GPP_INTR_CAUSE); + irq_gpp = __ilog2(irq_gpp & ppc_cached_irq_mask[2]); - if (irq_gpp == -1) { + if (irq_gpp == -1) irq = -2; - } else { + else { irq = irq_gpp + 64; - mv64x60_write(&base_bh, + mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~(1 << (irq - 64))); } - } else { - irq += 32; } + else + irq += 32; } } - if (irq < 0) { + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE); + + if (irq < 0) return (irq); - } else { + else return (mv64360_irq_base + irq); - } } /* mv64360_unmask_irq() * - * This function enables an interrupt. + * This function enables an interrupt. * * Input Variable(s): * unsigned int interrupt number (IRQ0...IRQ95). @@ -245,39 +212,37 @@ mv64360_get_irq(struct pt_regs *regs) * Returns: * void */ - static void mv64360_unmask_irq(unsigned int irq) { #ifdef CONFIG_SMP /* second CPU gets only doorbell interrupts */ if ((irq - mv64360_irq_base) == 28) { - mv64x60_set_bits(&base_bh, MV64360_IC_CPU1_INTR_MASK_LO, BIT28); + mv64x60_set_bits(&bh, MV64360_IC_CPU1_INTR_MASK_LO, (1 << 28)); return; } #endif irq -= mv64360_irq_base; + if (irq > 31) { - if (irq > 63) { - /* unmask GPP irq */ - mv64x60_write(&base_bh, MV64x60_GPP_INTR_MASK, + if (irq > 63) /* unmask GPP irq */ + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2] |= (1 << (irq - 64))); - } else { - /* mask high interrupt register */ - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_HI, + else /* mask high interrupt register */ + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI, ppc_cached_irq_mask[1] |= (1 << (irq - 32))); - } - } else { - /* mask low interrupt register */ - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_LO, - ppc_cached_irq_mask[0] |= (1 << irq)); } -} + else /* mask low interrupt register */ + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO, + ppc_cached_irq_mask[0] |= (1 << irq)); + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK); + return; +} /* mv64360_mask_irq() * - * This function disables the requested interrupt. + * This function disables the requested interrupt. * * Input Variable(s): * unsigned int interrupt number (IRQ0...IRQ95). @@ -288,76 +253,72 @@ mv64360_unmask_irq(unsigned int irq) * Returns: * void */ - static void mv64360_mask_irq(unsigned int irq) { #ifdef CONFIG_SMP if ((irq - mv64360_irq_base) == 28) { - mv64x60_clr_bits(&base_bh, MV64360_IC_CPU1_INTR_MASK_LO, BIT28); + mv64x60_clr_bits(&bh, MV64360_IC_CPU1_INTR_MASK_LO, (1 << 28)); return; } #endif irq -= mv64360_irq_base; + if (irq > 31) { - if (irq > 63) { - /* mask GPP irq */ - mv64x60_write(&base_bh, MV64x60_GPP_INTR_MASK, + if (irq > 63) /* mask GPP irq */ + mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2] &= ~(1 << (irq - 64))); - } else { - /* mask high interrupt register */ - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_HI, + else /* mask high interrupt register */ + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI, ppc_cached_irq_mask[1] &= ~(1 << (irq - 32))); - } - } else { - /* mask low interrupt register */ - mv64x60_write(&base_bh, MV64360_IC_CPU0_INTR_MASK_LO, - ppc_cached_irq_mask[0] &= ~(1 << irq)); } + else /* mask low interrupt register */ + mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO, + ppc_cached_irq_mask[0] &= ~(1 << irq)); + (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK); + return; } static irqreturn_t mv64360_cpu_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) { - u32 val; - val = mv64x60_read(&base_bh, MV64x60_CPU_ERR_CAUSE); - printk(KERN_ERR - "mv64360_cpu_error_int_handler: Error on CPU interface - Cause regiser 0x%08x\n", - val); + printk(KERN_ERR "mv64360_cpu_error_int_handler: %s 0x%08x\n", + "Error on CPU interface - Cause regiser", + mv64x60_read(&bh, MV64x60_CPU_ERR_CAUSE)); printk(KERN_ERR "\tCPU error register dump:\n"); printk(KERN_ERR "\tAddress low 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_CPU_ERR_ADDR_LO)); + mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_LO)); printk(KERN_ERR "\tAddress high 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_CPU_ERR_ADDR_HI)); + mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_HI)); printk(KERN_ERR "\tData low 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_CPU_ERR_DATA_LO)); + mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_LO)); printk(KERN_ERR "\tData high 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_CPU_ERR_DATA_HI)); + mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_HI)); printk(KERN_ERR "\tParity 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_CPU_ERR_PARITY)); - mv64x60_write(&base_bh, MV64x60_CPU_ERR_CAUSE, 0); + mv64x60_read(&bh, MV64x60_CPU_ERR_PARITY)); + mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0); return IRQ_HANDLED; } static irqreturn_t mv64360_sram_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) { - printk(KERN_ERR - "mv64360_sram_error_int_handler: Error in internal SRAM - Cause register 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_CAUSE)); + printk(KERN_ERR "mv64360_sram_error_int_handler: %s 0x%08x\n", + "Error in internal SRAM - Cause register", + mv64x60_read(&bh, MV64360_SRAM_ERR_CAUSE)); printk(KERN_ERR "\tSRAM error register dump:\n"); printk(KERN_ERR "\tAddress Low 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_ADDR_LO)); + mv64x60_read(&bh, MV64360_SRAM_ERR_ADDR_LO)); printk(KERN_ERR "\tAddress High 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_ADDR_HI)); + mv64x60_read(&bh, MV64360_SRAM_ERR_ADDR_HI)); printk(KERN_ERR "\tData Low 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_DATA_LO)); + mv64x60_read(&bh, MV64360_SRAM_ERR_DATA_LO)); printk(KERN_ERR "\tData High 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_DATA_HI)); + mv64x60_read(&bh, MV64360_SRAM_ERR_DATA_HI)); printk(KERN_ERR "\tParity 0x%08x\n", - mv64x60_read(&base_bh, MV64360_SRAM_ERR_PARITY)); - mv64x60_write(&base_bh, MV64360_SRAM_ERR_CAUSE, 0); + mv64x60_read(&bh, MV64360_SRAM_ERR_PARITY)); + mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0); return IRQ_HANDLED; } @@ -365,40 +326,96 @@ static irqreturn_t mv64360_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs) { u32 val; - unsigned int pci_bus = (unsigned int) dev_id; + unsigned int pci_bus = (unsigned int)dev_id; + if (pci_bus == 0) { /* Error on PCI 0 */ - val = mv64x60_read(&base_bh, MV64x60_PCI0_ERR_CAUSE); - printk(KERN_ERR - "mv64360_pci_error_int_handler: Error in PCI %d Interface\n", - pci_bus); + val = mv64x60_read(&bh, MV64x60_PCI0_ERR_CAUSE); + printk(KERN_ERR "%s: Error in PCI %d Interface\n", + "mv64360_pci_error_int_handler", pci_bus); printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus); printk(KERN_ERR "\tCause register 0x%08x\n", val); printk(KERN_ERR "\tAddress Low 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI0_ERR_ADDR_LO)); + mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_LO)); printk(KERN_ERR "\tAddress High 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI0_ERR_ADDR_HI)); + mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_HI)); printk(KERN_ERR "\tAttribute 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI0_ERR_DATA_LO)); + mv64x60_read(&bh, MV64x60_PCI0_ERR_DATA_LO)); printk(KERN_ERR "\tCommand 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI0_ERR_CMD)); - mv64x60_write(&base_bh, MV64x60_PCI0_ERR_CAUSE, ~val); + mv64x60_read(&bh, MV64x60_PCI0_ERR_CMD)); + mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, ~val); } if (pci_bus == 1) { /* Error on PCI 1 */ - val = mv64x60_read(&base_bh, MV64x60_PCI1_ERR_CAUSE); - printk(KERN_ERR - "mv64360_pci_error_int_handler: Error in PCI %d Interface\n", - pci_bus); + val = mv64x60_read(&bh, MV64x60_PCI1_ERR_CAUSE); + printk(KERN_ERR "%s: Error in PCI %d Interface\n", + "mv64360_pci_error_int_handler", pci_bus); printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus); printk(KERN_ERR "\tCause register 0x%08x\n", val); printk(KERN_ERR "\tAddress Low 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI1_ERR_ADDR_LO)); + mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_LO)); printk(KERN_ERR "\tAddress High 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI1_ERR_ADDR_HI)); + mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_HI)); printk(KERN_ERR "\tAttribute 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI1_ERR_DATA_LO)); + mv64x60_read(&bh, MV64x60_PCI1_ERR_DATA_LO)); printk(KERN_ERR "\tCommand 0x%08x\n", - mv64x60_read(&base_bh, MV64x60_PCI1_ERR_CMD)); - mv64x60_write(&base_bh, MV64x60_PCI1_ERR_CAUSE, ~val); + mv64x60_read(&bh, MV64x60_PCI1_ERR_CMD)); + mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, ~val); } return IRQ_HANDLED; } + +static int __init +mv64360_register_hdlrs(void) +{ + u32 mask; + int rc; + + /* Clear old errors and register CPU interface error intr handler */ + mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0); + if ((rc = request_irq(MV64x60_IRQ_CPU_ERR, + mv64360_cpu_error_int_handler, SA_INTERRUPT, CPU_INTR_STR, 0))) + printk(KERN_WARNING "Can't register cpu error handler: %d", rc); + + mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0x000000ff); + + /* Clear old errors and register internal SRAM error intr handler */ + mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0); + if ((rc = request_irq(MV64360_IRQ_SRAM_PAR_ERR, + mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0))) + printk(KERN_WARNING "Can't register SRAM error handler: %d",rc); + + /* + * Bit 0 reserved on 64360 and erratum FEr PCI-#11 (PCI internal + * data parity error set incorrectly) on rev 0 & 1 of 64460 requires + * bit 0 to be cleared. + */ + mask = 0x00a50c24; + + if ((mv64x60_get_bridge_type() == MV64x60_TYPE_MV64460) && + (mv64x60_get_bridge_rev() > 1)) + mask |= 0x1; /* enable DPErr on 64460 */ + + /* Clear old errors and register PCI 0 error intr handler */ + mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0); + if ((rc = request_irq(MV64360_IRQ_PCI0, mv64360_pci_error_int_handler, + SA_INTERRUPT, PCI0_INTR_STR, (void *)0))) + printk(KERN_WARNING "Can't register pci 0 error handler: %d", + rc); + + mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, mask); + + /* Clear old errors and register PCI 1 error intr handler */ + mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0); + if ((rc = request_irq(MV64360_IRQ_PCI1, mv64360_pci_error_int_handler, + SA_INTERRUPT, PCI1_INTR_STR, (void *)1))) + printk(KERN_WARNING "Can't register pci 1 error handler: %d", + rc); + + mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0); + mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, mask); + + return 0; +} + +arch_initcall(mv64360_register_hdlrs); diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index c31fe5330..b06c8c762 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -1,13 +1,12 @@ /* * arch/ppc/syslib/mv64x60.c - * + * * Common routines for the Marvell/Galileo Discovery line of host bridges - * (e.g, gt64260 and mv64360). + * (gt64260, mv64360, mv64460, ...). * * Author: Mark A. Greer - * Rabeeh Khoury * - * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under + * 2004 (c) MontaVista, Software, Inc. 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. @@ -18,6 +17,9 @@ #include #include #include +#include +#include +#include #include #include @@ -25,627 +27,68 @@ #include #include #include -#include #include -#include - +#include -#undef DEBUG -#ifdef DEBUG -#define DBG(x...) printk(x) -#else -#define DBG(x...) -#endif /* DEBUG */ +u8 mv64x60_pci_exclude_bridge = 1; +spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; - -static u32 mv64x60_mask(u32 val, u32 num_bits); -static u32 mv64x60_shift_left(u32 val, u32 num_bits); -static u32 mv64x60_shift_right(u32 val, u32 num_bits); -static void mv64x60_early_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si); -static int mv64x60_get_type(mv64x60_handle_t *bh); -static int mv64x60_setup_for_chip(mv64x60_handle_t *bh); -static void mv64x60_get_mem_windows(mv64x60_handle_t *bh, - u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]); -static u32 mv64x60_calc_mem_size(mv64x60_handle_t *bh, - u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]); -static void mv64x60_config_cpu2mem_windows(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]); -static void mv64x60_config_cpu2pci_windows(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static void mv64x60_set_cpu2pci_window(mv64x60_handle_t *bh, - mv64x60_pci_info_t *pi, u32 *win_tab, u32 *remap_tab); -static void mv64x60_config_pci2mem_windows(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]); -static void mv64x60_alloc_hoses(mv64x60_handle_t *bh, mv64x60_setup_info_t *si); -static void mv64x60_init_hoses(mv64x60_handle_t *bh, mv64x60_setup_info_t *si); -static void mv64x60_init_resources(struct pci_controller *hose, - mv64x60_pci_info_t *pi, u32 io_base); -static void mv64x60_set_pci_params(struct pci_controller *hose, - mv64x60_pci_info_t *pi); -static void mv64x60_enumerate_buses(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static int mv64x60_pci_exclude_device(u8 bus, u8 devfn); -static void mv64x60_fixup_ocp(struct ocp_device *, void *arg); +static phys_addr_t mv64x60_bridge_pbase = 0; +static void *mv64x60_bridge_vbase = 0; +static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID; +static u32 mv64x60_bridge_rev = 0; static u32 gt64260_translate_size(u32 base, u32 size, u32 num_bits); static u32 gt64260_untranslate_size(u32 base, u32 size, u32 num_bits); -static void gt64260_set_pci2mem_window(struct pci_controller *hose, +static void gt64260_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window, u32 base); -static u32 gt64260_is_enabled_32bit(mv64x60_handle_t *bh, u32 window); -static void gt64260_enable_window_32bit(mv64x60_handle_t *bh, u32 window); -static void gt64260_disable_window_32bit(mv64x60_handle_t *bh, u32 window); -static void gt64260_enable_window_64bit(mv64x60_handle_t *bh, u32 window); -static void gt64260_disable_window_64bit(mv64x60_handle_t *bh, u32 window); -static void gt64260_disable_all_windows(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static void gt64260a_chip_specific_init(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static void gt64260b_chip_specific_init(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); - -static u32 mv64360_translate_size(u32 base_addr, u32 size, u32 num_bits); -static u32 mv64360_untranslate_size(u32 base_addr, u32 size, u32 num_bits); -static void mv64360_set_pci2mem_window(struct pci_controller *hose, +static void gt64260_set_pci2regs_window(struct mv64x60_handle *bh, + struct pci_controller *hose, u32 bus, u32 base); +static u32 gt64260_is_enabled_32bit(struct mv64x60_handle *bh, u32 window); +static void gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window); +static void gt64260_disable_window_32bit(struct mv64x60_handle *bh, u32 window); +static void gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window); +static void gt64260_disable_window_64bit(struct mv64x60_handle *bh, u32 window); +static void gt64260_disable_all_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); +static void gt64260a_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); +static void gt64260b_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); + +static u32 mv64360_translate_size(u32 base, u32 size, u32 num_bits); +static u32 mv64360_untranslate_size(u32 base, u32 size, u32 num_bits); +static void mv64360_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window, u32 base); -static u32 mv64360_is_enabled_32bit(mv64x60_handle_t *bh, u32 window); -static void mv64360_enable_window_32bit(mv64x60_handle_t *bh, u32 window); -static void mv64360_disable_window_32bit(mv64x60_handle_t *bh, u32 window); -static void mv64360_enable_window_64bit(mv64x60_handle_t *bh, u32 window); -static void mv64360_disable_window_64bit(mv64x60_handle_t *bh, u32 window); -static void mv64360_disable_all_windows(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static void mv64360_chip_specific_init(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); -static void mv64460_chip_specific_init(mv64x60_handle_t *bh, - mv64x60_setup_info_t *si); - - -u8 mv64x60_pci_exclude_bridge = TRUE; - -spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; -spinlock_t mv64x60_rmw_lock = SPIN_LOCK_UNLOCKED; - -static mv64x60_32bit_window_t gt64260_32bit_windows[] __initdata = { - /* CPU->MEM Windows */ - [MV64x60_CPU2MEM_0_WIN] = { - .base_reg = MV64x60_CPU2MEM_0_BASE, - .size_reg = MV64x60_CPU2MEM_0_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2MEM_1_WIN] = { - .base_reg = MV64x60_CPU2MEM_1_BASE, - .size_reg = MV64x60_CPU2MEM_1_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2MEM_2_WIN] = { - .base_reg = MV64x60_CPU2MEM_2_BASE, - .size_reg = MV64x60_CPU2MEM_2_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2MEM_3_WIN] = { - .base_reg = MV64x60_CPU2MEM_3_BASE, - .size_reg = MV64x60_CPU2MEM_3_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->Device Windows */ - [MV64x60_CPU2DEV_0_WIN] = { - .base_reg = MV64x60_CPU2DEV_0_BASE, - .size_reg = MV64x60_CPU2DEV_0_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2DEV_1_WIN] = { - .base_reg = MV64x60_CPU2DEV_1_BASE, - .size_reg = MV64x60_CPU2DEV_1_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2DEV_2_WIN] = { - .base_reg = MV64x60_CPU2DEV_2_BASE, - .size_reg = MV64x60_CPU2DEV_2_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2DEV_3_WIN] = { - .base_reg = MV64x60_CPU2DEV_3_BASE, - .size_reg = MV64x60_CPU2DEV_3_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->Boot Window */ - [MV64x60_CPU2BOOT_WIN] = { - .base_reg = MV64x60_CPU2BOOT_0_BASE, - .size_reg = MV64x60_CPU2BOOT_0_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 0 Windows */ - [MV64x60_CPU2PCI0_IO_WIN] = { - .base_reg = MV64x60_CPU2PCI0_IO_BASE, - .size_reg = MV64x60_CPU2PCI0_IO_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_0_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_0_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_0_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_1_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_1_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_1_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_2_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_2_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_2_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_3_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_3_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_3_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 1 Windows */ - [MV64x60_CPU2PCI1_IO_WIN] = { - .base_reg = MV64x60_CPU2PCI1_IO_BASE, - .size_reg = MV64x60_CPU2PCI1_IO_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_0_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_0_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_0_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_1_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_1_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_1_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_2_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_2_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_2_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_3_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_3_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_3_SIZE, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->SRAM Window (64260 has no integrated SRAM) */ - /* CPU->PCI 0 Remap I/O Window */ - [MV64x60_CPU2PCI0_IO_REMAP_WIN] = { - .base_reg = MV64x60_CPU2PCI0_IO_REMAP, - .size_reg = 0, - .base_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 1 Remap I/O Window */ - [MV64x60_CPU2PCI1_IO_REMAP_WIN] = { - .base_reg = MV64x60_CPU2PCI1_IO_REMAP, - .size_reg = 0, - .base_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU Memory Protection Windows */ - [MV64x60_CPU_PROT_0_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_0, - .size_reg = MV64x60_CPU_PROT_SIZE_0, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_PROT_1_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_1, - .size_reg = MV64x60_CPU_PROT_SIZE_1, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_PROT_2_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_2, - .size_reg = MV64x60_CPU_PROT_SIZE_2, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_PROT_3_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_3, - .size_reg = MV64x60_CPU_PROT_SIZE_3, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU Snoop Windows */ - [MV64x60_CPU_SNOOP_0_WIN] = { - .base_reg = GT64260_CPU_SNOOP_BASE_0, - .size_reg = GT64260_CPU_SNOOP_SIZE_0, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_SNOOP_1_WIN] = { - .base_reg = GT64260_CPU_SNOOP_BASE_1, - .size_reg = GT64260_CPU_SNOOP_SIZE_1, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_SNOOP_2_WIN] = { - .base_reg = GT64260_CPU_SNOOP_BASE_2, - .size_reg = GT64260_CPU_SNOOP_SIZE_2, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU_SNOOP_3_WIN] = { - .base_reg = GT64260_CPU_SNOOP_BASE_3, - .size_reg = GT64260_CPU_SNOOP_SIZE_3, - .base_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 0->System Memory Remap Windows */ - [MV64x60_PCI02MEM_REMAP_0_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_0_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_1_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_2_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_3_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - /* PCI 1->System Memory Remap Windows */ - [MV64x60_PCI12MEM_REMAP_0_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_0_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_1_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_2_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_3_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 20, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, -}; +static void mv64360_set_pci2regs_window(struct mv64x60_handle *bh, + struct pci_controller *hose, u32 bus, u32 base); +static u32 mv64360_is_enabled_32bit(struct mv64x60_handle *bh, u32 window); +static void mv64360_enable_window_32bit(struct mv64x60_handle *bh, u32 window); +static void mv64360_disable_window_32bit(struct mv64x60_handle *bh, u32 window); +static void mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window); +static void mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window); +static void mv64360_disable_all_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); +static void mv64360_config_io2mem_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si, + u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]); +static void mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base); +static void mv64360_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); +static void mv64460_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si); -static mv64x60_64bit_window_t gt64260_64bit_windows[] __initdata = { - /* CPU->PCI 0 MEM Remap Windows */ - [MV64x60_CPU2PCI0_MEM_0_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_1_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_2_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_3_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 1 MEM Remap Windows */ - [MV64x60_CPU2PCI1_MEM_0_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_1_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_2_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_3_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 12, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 0->MEM Access Control Windows */ - [MV64x60_PCI02MEM_ACC_CNTL_0_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_0_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_1_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_1_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_2_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_2_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_3_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_3_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 1->MEM Access Control Windows */ - [MV64x60_PCI12MEM_ACC_CNTL_0_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_0_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_1_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_1_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_2_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_2_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_3_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_3_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 0->MEM Snoop Windows */ - [MV64x60_PCI02MEM_SNOOP_0_WIN] = { - .base_hi_reg = GT64260_PCI0_SNOOP_0_BASE_HI, - .base_lo_reg = GT64260_PCI0_SNOOP_0_BASE_LO, - .size_reg = GT64260_PCI0_SNOOP_0_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_SNOOP_1_WIN] = { - .base_hi_reg = GT64260_PCI0_SNOOP_1_BASE_HI, - .base_lo_reg = GT64260_PCI0_SNOOP_1_BASE_LO, - .size_reg = GT64260_PCI0_SNOOP_1_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_SNOOP_2_WIN] = { - .base_hi_reg = GT64260_PCI0_SNOOP_2_BASE_HI, - .base_lo_reg = GT64260_PCI0_SNOOP_2_BASE_LO, - .size_reg = GT64260_PCI0_SNOOP_2_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI02MEM_SNOOP_3_WIN] = { - .base_hi_reg = GT64260_PCI0_SNOOP_3_BASE_HI, - .base_lo_reg = GT64260_PCI0_SNOOP_3_BASE_LO, - .size_reg = GT64260_PCI0_SNOOP_3_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 1->MEM Snoop Windows */ - [MV64x60_PCI12MEM_SNOOP_0_WIN] = { - .base_hi_reg = GT64260_PCI1_SNOOP_0_BASE_HI, - .base_lo_reg = GT64260_PCI1_SNOOP_0_BASE_LO, - .size_reg = GT64260_PCI1_SNOOP_0_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_SNOOP_1_WIN] = { - .base_hi_reg = GT64260_PCI1_SNOOP_1_BASE_HI, - .base_lo_reg = GT64260_PCI1_SNOOP_1_BASE_LO, - .size_reg = GT64260_PCI1_SNOOP_1_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_SNOOP_2_WIN] = { - .base_hi_reg = GT64260_PCI1_SNOOP_2_BASE_HI, - .base_lo_reg = GT64260_PCI1_SNOOP_2_BASE_LO, - .size_reg = GT64260_PCI1_SNOOP_2_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_PCI12MEM_SNOOP_3_WIN] = { - .base_hi_reg = GT64260_PCI1_SNOOP_3_BASE_HI, - .base_lo_reg = GT64260_PCI1_SNOOP_3_BASE_LO, - .size_reg = GT64260_PCI1_SNOOP_3_SIZE, - .base_lo_bits = 12, - .size_bits = 12, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, -}; -static mv64x60_chip_info_t gt64260a_ci __initdata = { +/* + * Define tables that have the chip-specific info for each type of + * Marvell bridge chip. + */ +static struct mv64x60_chip_info gt64260a_ci __initdata = { /* GT64260A */ .translate_size = gt64260_translate_size, .untranslate_size = gt64260_untranslate_size, .set_pci2mem_window = gt64260_set_pci2mem_window, + .set_pci2regs_window = gt64260_set_pci2regs_window, .is_enabled_32bit = gt64260_is_enabled_32bit, .enable_window_32bit = gt64260_enable_window_32bit, .disable_window_32bit = gt64260_disable_window_32bit, @@ -657,10 +100,11 @@ static mv64x60_chip_info_t gt64260a_ci __initdata = { .window_tab_64bit = gt64260_64bit_windows, }; -static mv64x60_chip_info_t gt64260b_ci __initdata = { +static struct mv64x60_chip_info gt64260b_ci __initdata = { /* GT64260B */ .translate_size = gt64260_translate_size, .untranslate_size = gt64260_untranslate_size, .set_pci2mem_window = gt64260_set_pci2mem_window, + .set_pci2regs_window = gt64260_set_pci2regs_window, .is_enabled_32bit = gt64260_is_enabled_32bit, .enable_window_32bit = gt64260_enable_window_32bit, .disable_window_32bit = gt64260_disable_window_32bit, @@ -672,478 +116,345 @@ static mv64x60_chip_info_t gt64260b_ci __initdata = { .window_tab_64bit = gt64260_64bit_windows, }; - -static mv64x60_32bit_window_t mv64360_32bit_windows[] __initdata = { - /* CPU->MEM Windows */ - [MV64x60_CPU2MEM_0_WIN] = { - .base_reg = MV64x60_CPU2MEM_0_BASE, - .size_reg = MV64x60_CPU2MEM_0_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2MEM_1_WIN] = { - .base_reg = MV64x60_CPU2MEM_1_BASE, - .size_reg = MV64x60_CPU2MEM_1_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 1 }, - [MV64x60_CPU2MEM_2_WIN] = { - .base_reg = MV64x60_CPU2MEM_2_BASE, - .size_reg = MV64x60_CPU2MEM_2_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 2 }, - [MV64x60_CPU2MEM_3_WIN] = { - .base_reg = MV64x60_CPU2MEM_3_BASE, - .size_reg = MV64x60_CPU2MEM_3_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 3 }, - /* CPU->Device Windows */ - [MV64x60_CPU2DEV_0_WIN] = { - .base_reg = MV64x60_CPU2DEV_0_BASE, - .size_reg = MV64x60_CPU2DEV_0_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 4 }, - [MV64x60_CPU2DEV_1_WIN] = { - .base_reg = MV64x60_CPU2DEV_1_BASE, - .size_reg = MV64x60_CPU2DEV_1_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 5 }, - [MV64x60_CPU2DEV_2_WIN] = { - .base_reg = MV64x60_CPU2DEV_2_BASE, - .size_reg = MV64x60_CPU2DEV_2_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 6 }, - [MV64x60_CPU2DEV_3_WIN] = { - .base_reg = MV64x60_CPU2DEV_3_BASE, - .size_reg = MV64x60_CPU2DEV_3_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 7 }, - /* CPU->Boot Window */ - [MV64x60_CPU2BOOT_WIN] = { - .base_reg = MV64x60_CPU2BOOT_0_BASE, - .size_reg = MV64x60_CPU2BOOT_0_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 8 }, - /* CPU->PCI 0 Windows */ - [MV64x60_CPU2PCI0_IO_WIN] = { - .base_reg = MV64x60_CPU2PCI0_IO_BASE, - .size_reg = MV64x60_CPU2PCI0_IO_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 9 }, - [MV64x60_CPU2PCI0_MEM_0_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_0_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_0_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 10 }, - [MV64x60_CPU2PCI0_MEM_1_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_1_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_1_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 11 }, - [MV64x60_CPU2PCI0_MEM_2_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_2_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_2_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 12 }, - [MV64x60_CPU2PCI0_MEM_3_WIN] = { - .base_reg = MV64x60_CPU2PCI0_MEM_3_BASE, - .size_reg = MV64x60_CPU2PCI0_MEM_3_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 13 }, - /* CPU->PCI 1 Windows */ - [MV64x60_CPU2PCI1_IO_WIN] = { - .base_reg = MV64x60_CPU2PCI1_IO_BASE, - .size_reg = MV64x60_CPU2PCI1_IO_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 14 }, - [MV64x60_CPU2PCI1_MEM_0_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_0_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_0_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 15 }, - [MV64x60_CPU2PCI1_MEM_1_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_1_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_1_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 16 }, - [MV64x60_CPU2PCI1_MEM_2_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_2_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_2_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 17 }, - [MV64x60_CPU2PCI1_MEM_3_WIN] = { - .base_reg = MV64x60_CPU2PCI1_MEM_3_BASE, - .size_reg = MV64x60_CPU2PCI1_MEM_3_SIZE, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 18 }, - /* CPU->SRAM Window */ - [MV64x60_CPU2SRAM_WIN] = { - .base_reg = MV64360_CPU2SRAM_BASE, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 19 }, - /* CPU->PCI 0 Remap I/O Window */ - [MV64x60_CPU2PCI0_IO_REMAP_WIN] = { - .base_reg = MV64x60_CPU2PCI0_IO_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 1 Remap I/O Window */ - [MV64x60_CPU2PCI1_IO_REMAP_WIN] = { - .base_reg = MV64x60_CPU2PCI1_IO_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU Memory Protection Windows */ - [MV64x60_CPU_PROT_0_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_0, - .size_reg = MV64x60_CPU_PROT_SIZE_0, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0x80000000 | 31 }, - [MV64x60_CPU_PROT_1_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_1, - .size_reg = MV64x60_CPU_PROT_SIZE_1, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0x80000000 | 31 }, - [MV64x60_CPU_PROT_2_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_2, - .size_reg = MV64x60_CPU_PROT_SIZE_2, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0x80000000 | 31 }, - [MV64x60_CPU_PROT_3_WIN] = { - .base_reg = MV64x60_CPU_PROT_BASE_3, - .size_reg = MV64x60_CPU_PROT_SIZE_3, - .base_bits = 16, - .size_bits = 16, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0x80000000 | 31 }, - /* CPU Snoop Windows -- don't exist on 64360 */ - /* PCI 0->System Memory Remap Windows */ - [MV64x60_PCI02MEM_REMAP_0_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_0_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_1_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_2_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI02MEM_REMAP_3_WIN] = { - .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - /* PCI 1->System Memory Remap Windows */ - [MV64x60_PCI12MEM_REMAP_0_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_0_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_1_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_2_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, - [MV64x60_PCI12MEM_REMAP_3_WIN] = { - .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP, - .size_reg = 0, - .base_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0 }, -}; - -static mv64x60_64bit_window_t mv64360_64bit_windows[MV64x60_64BIT_WIN_COUNT] - __initdata = { - /* CPU->PCI 0 MEM Remap Windows */ - [MV64x60_CPU2PCI0_MEM_0_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_1_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_2_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI0_MEM_3_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* CPU->PCI 1 MEM Remap Windows */ - [MV64x60_CPU2PCI1_MEM_0_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_1_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_2_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - [MV64x60_CPU2PCI1_MEM_3_REMAP_WIN] = { - .base_hi_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_HI, - .base_lo_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_LO, - .size_reg = 0, - .base_lo_bits = 16, - .size_bits = 0, - .get_from_field = mv64x60_shift_left, - .map_to_field = mv64x60_shift_right, - .extra = 0 }, - /* PCI 0->MEM Access Control Windows */ - [MV64x60_PCI02MEM_ACC_CNTL_0_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_0_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_1_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_1_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_2_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_2_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI02MEM_ACC_CNTL_3_WIN] = { - .base_hi_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_HI, - .base_lo_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_LO, - .size_reg = MV64x60_PCI0_ACC_CNTL_3_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - /* PCI 1->MEM Access Control Windows */ - [MV64x60_PCI12MEM_ACC_CNTL_0_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_0_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_1_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_1_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_2_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_2_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - [MV64x60_PCI12MEM_ACC_CNTL_3_WIN] = { - .base_hi_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_HI, - .base_lo_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_LO, - .size_reg = MV64x60_PCI1_ACC_CNTL_3_SIZE, - .base_lo_bits = 20, - .size_bits = 20, - .get_from_field = mv64x60_mask, - .map_to_field = mv64x60_mask, - .extra = 0x80000000 | 0 }, - /* PCI 0->MEM Snoop Windows -- don't exist on 64360 */ - /* PCI 1->MEM Snoop Windows -- don't exist on 64360 */ -}; - -static mv64x60_chip_info_t mv64360_ci __initdata = { +static struct mv64x60_chip_info mv64360_ci __initdata = { /* MV64360 */ .translate_size = mv64360_translate_size, .untranslate_size = mv64360_untranslate_size, .set_pci2mem_window = mv64360_set_pci2mem_window, + .set_pci2regs_window = mv64360_set_pci2regs_window, .is_enabled_32bit = mv64360_is_enabled_32bit, .enable_window_32bit = mv64360_enable_window_32bit, .disable_window_32bit = mv64360_disable_window_32bit, .enable_window_64bit = mv64360_enable_window_64bit, .disable_window_64bit = mv64360_disable_window_64bit, .disable_all_windows = mv64360_disable_all_windows, + .config_io2mem_windows = mv64360_config_io2mem_windows, + .set_mpsc2regs_window = mv64360_set_mpsc2regs_window, .chip_specific_init = mv64360_chip_specific_init, .window_tab_32bit = mv64360_32bit_windows, .window_tab_64bit = mv64360_64bit_windows, }; -static mv64x60_chip_info_t mv64460_ci __initdata = { +static struct mv64x60_chip_info mv64460_ci __initdata = { /* MV64460 */ .translate_size = mv64360_translate_size, .untranslate_size = mv64360_untranslate_size, .set_pci2mem_window = mv64360_set_pci2mem_window, + .set_pci2regs_window = mv64360_set_pci2regs_window, .is_enabled_32bit = mv64360_is_enabled_32bit, .enable_window_32bit = mv64360_enable_window_32bit, .disable_window_32bit = mv64360_disable_window_32bit, .enable_window_64bit = mv64360_enable_window_64bit, .disable_window_64bit = mv64360_disable_window_64bit, .disable_all_windows = mv64360_disable_all_windows, + .config_io2mem_windows = mv64360_config_io2mem_windows, + .set_mpsc2regs_window = mv64360_set_mpsc2regs_window, .chip_specific_init = mv64460_chip_specific_init, .window_tab_32bit = mv64360_32bit_windows, .window_tab_64bit = mv64360_64bit_windows, }; +/* + ***************************************************************************** + * + * Platform Device Definitions + * + ***************************************************************************** + */ +#ifdef CONFIG_SERIAL_MPSC +static struct mpsc_shared_pdata mv64x60_mpsc_shared_pdata = { + .mrr_val = 0x3ffffe38, + .rcrr_val = 0, + .tcrr_val = 0, + .intr_cause_val = 0, + .intr_mask_val = 0, +}; + +static struct resource mv64x60_mpsc_shared_resources[] = { + /* Do not change the order of the IORESOURCE_MEM resources */ + [0] = { + .name = "mpsc routing base", + .start = MV64x60_MPSC_ROUTING_OFFSET, + .end = MV64x60_MPSC_ROUTING_OFFSET + + MPSC_ROUTING_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .name = "sdma intr base", + .start = MV64x60_SDMA_INTR_OFFSET, + .end = MV64x60_SDMA_INTR_OFFSET + + MPSC_SDMA_INTR_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device mpsc_shared_device = { /* Shared device */ + .name = MPSC_SHARED_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64x60_mpsc_shared_resources), + .resource = mv64x60_mpsc_shared_resources, + .dev = { + .platform_data = &mv64x60_mpsc_shared_pdata, + }, +}; + +static struct mpsc_pdata mv64x60_mpsc0_pdata = { + .mirror_regs = 0, + .cache_mgmt = 0, + .max_idle = 0, + .default_baud = 9600, + .default_bits = 8, + .default_parity = 'n', + .default_flow = 'n', + .chr_1_val = 0x00000000, + .chr_2_val = 0x00000000, + .chr_10_val = 0x00000003, + .mpcr_val = 0, + .bcr_val = 0, + .brg_can_tune = 0, + .brg_clk_src = 8, /* Default to TCLK */ + .brg_clk_freq = 100000000, /* Default to 100 MHz */ +}; + +static struct resource mv64x60_mpsc0_resources[] = { + /* Do not change the order of the IORESOURCE_MEM resources */ + [0] = { + .name = "mpsc 0 base", + .start = MV64x60_MPSC_0_OFFSET, + .end = MV64x60_MPSC_0_OFFSET + MPSC_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .name = "sdma 0 base", + .start = MV64x60_SDMA_0_OFFSET, + .end = MV64x60_SDMA_0_OFFSET + MPSC_SDMA_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [2] = { + .name = "brg 0 base", + .start = MV64x60_BRG_0_OFFSET, + .end = MV64x60_BRG_0_OFFSET + MPSC_BRG_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [3] = { + .name = "sdma 0 irq", + .start = MV64x60_IRQ_SDMA_0, + .end = MV64x60_IRQ_SDMA_0, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device mpsc0_device = { + .name = MPSC_CTLR_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64x60_mpsc0_resources), + .resource = mv64x60_mpsc0_resources, + .dev = { + .platform_data = &mv64x60_mpsc0_pdata, + }, +}; + +static struct mpsc_pdata mv64x60_mpsc1_pdata = { + .mirror_regs = 0, + .cache_mgmt = 0, + .max_idle = 0, + .default_baud = 9600, + .default_bits = 8, + .default_parity = 'n', + .default_flow = 'n', + .chr_1_val = 0x00000000, + .chr_1_val = 0x00000000, + .chr_2_val = 0x00000000, + .chr_10_val = 0x00000003, + .mpcr_val = 0, + .bcr_val = 0, + .brg_can_tune = 0, + .brg_clk_src = 8, /* Default to TCLK */ + .brg_clk_freq = 100000000, /* Default to 100 MHz */ +}; + +static struct resource mv64x60_mpsc1_resources[] = { + /* Do not change the order of the IORESOURCE_MEM resources */ + [0] = { + .name = "mpsc 1 base", + .start = MV64x60_MPSC_1_OFFSET, + .end = MV64x60_MPSC_1_OFFSET + MPSC_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .name = "sdma 1 base", + .start = MV64x60_SDMA_1_OFFSET, + .end = MV64x60_SDMA_1_OFFSET + MPSC_SDMA_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [2] = { + .name = "brg 1 base", + .start = MV64x60_BRG_1_OFFSET, + .end = MV64x60_BRG_1_OFFSET + MPSC_BRG_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [3] = { + .name = "sdma 1 irq", + .start = MV64360_IRQ_SDMA_1, + .end = MV64360_IRQ_SDMA_1, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device mpsc1_device = { + .name = MPSC_CTLR_NAME, + .id = 1, + .num_resources = ARRAY_SIZE(mv64x60_mpsc1_resources), + .resource = mv64x60_mpsc1_resources, + .dev = { + .platform_data = &mv64x60_mpsc1_pdata, + }, +}; +#endif + +#ifdef CONFIG_MV643XX_ETH +static struct resource mv64x60_eth_shared_resources[] = { + [0] = { + .name = "ethernet shared base", + .start = MV64340_ETH_SHARED_REGS, + .end = MV64340_ETH_SHARED_REGS + + MV64340_ETH_SHARED_REGS_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device mv64x60_eth_shared_device = { + .name = MV64XXX_ETH_SHARED_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64x60_eth_shared_resources), + .resource = mv64x60_eth_shared_resources, +}; + +#ifdef CONFIG_MV643XX_ETH_0 +static struct resource mv64x60_eth0_resources[] = { + [0] = { + .name = "eth0 irq", + .start = MV64x60_IRQ_ETH_0, + .end = MV64x60_IRQ_ETH_0, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct mv64xxx_eth_platform_data eth0_pd; + +static struct platform_device eth0_device = { + .name = MV64XXX_ETH_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64x60_eth0_resources), + .resource = mv64x60_eth0_resources, + .dev = { + .platform_data = ð0_pd, + }, +}; +#endif + +#ifdef CONFIG_MV643XX_ETH_1 +static struct resource mv64x60_eth1_resources[] = { + [0] = { + .name = "eth1 irq", + .start = MV64x60_IRQ_ETH_1, + .end = MV64x60_IRQ_ETH_1, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct mv64xxx_eth_platform_data eth1_pd; + +static struct platform_device eth1_device = { + .name = MV64XXX_ETH_NAME, + .id = 1, + .num_resources = ARRAY_SIZE(mv64x60_eth1_resources), + .resource = mv64x60_eth1_resources, + .dev = { + .platform_data = ð1_pd, + }, +}; +#endif + +#ifdef CONFIG_MV643XX_ETH_2 +static struct resource mv64x60_eth2_resources[] = { + [0] = { + .name = "eth2 irq", + .start = MV64x60_IRQ_ETH_2, + .end = MV64x60_IRQ_ETH_2, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct mv64xxx_eth_platform_data eth2_pd; + +static struct platform_device eth2_device = { + .name = MV64XXX_ETH_NAME, + .id = 2, + .num_resources = ARRAY_SIZE(mv64x60_eth2_resources), + .resource = mv64x60_eth2_resources, + .dev = { + .platform_data = ð2_pd, + }, +}; +#endif +#endif + +#ifdef CONFIG_I2C_MV64XXX +static struct mv64xxx_i2c_pdata mv64xxx_i2c_pdata = { + .freq_m = 8, + .freq_n = 3, + .timeout = 1000, /* Default timeout of 1 second */ + .retries = 1, +}; + +static struct resource mv64xxx_i2c_resources[] = { + /* Do not change the order of the IORESOURCE_MEM resources */ + [0] = { + .name = "mv64xxx i2c base", + .start = MV64XXX_I2C_OFFSET, + .end = MV64XXX_I2C_OFFSET + MV64XXX_I2C_REG_BLOCK_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .name = "mv64xxx i2c irq", + .start = MV64x60_IRQ_I2C, + .end = MV64x60_IRQ_I2C, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device i2c_device = { + .name = MV64XXX_I2C_CTLR_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64xxx_i2c_resources), + .resource = mv64xxx_i2c_resources, + .dev = { + .platform_data = &mv64xxx_i2c_pdata, + }, +}; +#endif + +static struct platform_device *mv64x60_pd_devs[] __initdata = { +#ifdef CONFIG_SERIAL_MPSC + &mpsc_shared_device, + &mpsc0_device, + &mpsc1_device, +#endif +#ifdef CONFIG_MV643XX_ETH + &mv64x60_eth_shared_device, +#endif +#ifdef CONFIG_MV643XX_ETH_0 + ð0_device, +#endif +#ifdef CONFIG_MV643XX_ETH_1 + ð1_device, +#endif +#ifdef CONFIG_MV643XX_ETH_2 + ð2_device, +#endif +#ifdef CONFIG_I2C_MV64XXX + &i2c_device, +#endif +}; /* ***************************************************************************** @@ -1160,78 +471,134 @@ static mv64x60_chip_info_t mv64460_ci __initdata = { * calls to routines in this file. */ int __init -mv64x60_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si) { u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]; - int rc = 0; if (ppc_md.progress) - ppc_md.progress("mv64x60_init: Enter", 0x0); + ppc_md.progress("mv64x60 initialization", 0x0); + spin_lock_init(&mv64x60_lock); mv64x60_early_init(bh, si); - mv64x60_alloc_hoses(bh, si); /* Allocate pci hose structures */ - if (mv64x60_get_type(bh)) - return -1; - - if (mv64x60_setup_for_chip(bh) != 0) { - iounmap((void *)bh->v_base); + if (mv64x60_get_type(bh) || mv64x60_setup_for_chip(bh)) { + iounmap(bh->v_base); + bh->v_base = 0; if (ppc_md.progress) - ppc_md.progress("mv64x60_init: Exit--error", 0x0); + ppc_md.progress("mv64x60_init: Can't determine chip",0); return -1; } - bh->ci->disable_all_windows(bh, si); /* Disable windows except mem ctlr */ - mv64x60_config_cpu2pci_windows(bh, si); /* Init CPU->PCI windows */ - mv64x60_get_mem_windows(bh, mem_windows); /* Read mem ctlr regs */ - mv64x60_config_cpu2mem_windows(bh, si, mem_windows); /* CPU->MEM setup*/ - mv64x60_config_pci2mem_windows(bh, si, mem_windows); /* PCI->Sys MEM */ - mv64x60_init_hoses(bh, si); /* Init hose structs & PCI params */ - bh->ci->chip_specific_init(bh, si); - mv64x60_enumerate_buses(bh, si); /* Enumerate PCI buses */ - ocp_for_each_device(mv64x60_fixup_ocp, (void *)bh); + bh->ci->disable_all_windows(bh, si); + mv64x60_get_mem_windows(bh, mem_windows); + mv64x60_config_cpu2mem_windows(bh, si, mem_windows); - if (ppc_md.progress) - ppc_md.progress("mv64x60_init: Exit", 0x0); + if (bh->ci->config_io2mem_windows) + bh->ci->config_io2mem_windows(bh, si, mem_windows); + if (bh->ci->set_mpsc2regs_window) + bh->ci->set_mpsc2regs_window(bh, si->phys_reg_base); - return rc; -} /* mv64x60_init() */ + if (si->pci_1.enable_bus) { + bh->io_base_b = (u32)ioremap(si->pci_1.pci_io.cpu_base, + si->pci_1.pci_io.size); + isa_io_base = bh->io_base_b; + } + + if (si->pci_0.enable_bus) { + bh->io_base_a = (u32)ioremap(si->pci_0.pci_io.cpu_base, + si->pci_0.pci_io.size); + isa_io_base = bh->io_base_a; + + mv64x60_alloc_hose(bh, MV64x60_PCI0_CONFIG_ADDR, + MV64x60_PCI0_CONFIG_DATA, &bh->hose_a); + mv64x60_config_resources(bh->hose_a, &si->pci_0, bh->io_base_a); + mv64x60_config_pci_params(bh->hose_a, &si->pci_0); + + mv64x60_config_cpu2pci_windows(bh, &si->pci_0, 0); + mv64x60_config_pci2mem_windows(bh, bh->hose_a, &si->pci_0, 0, + mem_windows); + bh->ci->set_pci2regs_window(bh, bh->hose_a, 0, + si->phys_reg_base); + } + + if (si->pci_1.enable_bus) { + mv64x60_alloc_hose(bh, MV64x60_PCI1_CONFIG_ADDR, + MV64x60_PCI1_CONFIG_DATA, &bh->hose_b); + mv64x60_config_resources(bh->hose_b, &si->pci_1, bh->io_base_b); + mv64x60_config_pci_params(bh->hose_b, &si->pci_1); + + mv64x60_config_cpu2pci_windows(bh, &si->pci_1, 1); + mv64x60_config_pci2mem_windows(bh, bh->hose_b, &si->pci_1, 1, + mem_windows); + bh->ci->set_pci2regs_window(bh, bh->hose_b, 1, + si->phys_reg_base); + } + + bh->ci->chip_specific_init(bh, si); + mv64x60_pd_fixup(bh, mv64x60_pd_devs, ARRAY_SIZE(mv64x60_pd_devs)); + + return 0; +} /* - ***************************************************************************** - * - * Pre-Bridge-Init Routines (Externally Visible) - * - ***************************************************************************** - */ -/* - * mv64x60_get_mem_size() + * mv64x60_early_init() * - * Calculate the amount of memory that the memory controller is set up for. - * This should only be used by board-specific code if there is no other - * way to determine the amount of memory in the system. + * Do some bridge work that must take place before we start messing with + * the bridge for real. */ -u32 __init -mv64x60_get_mem_size(u32 bridge_base, u32 chip_type) +void __init +mv64x60_early_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si) { - mv64x60_handle_t bh; - u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]; + struct pci_controller hose_a, hose_b; - memset(&bh, 0, sizeof(bh)); + memset(bh, 0, sizeof(*bh)); - bh.type = chip_type; - bh.p_base = bridge_base; - bh.v_base = bridge_base; + bh->p_base = si->phys_reg_base; + bh->v_base = ioremap(bh->p_base, MV64x60_INTERNAL_SPACE_SIZE); + + mv64x60_bridge_pbase = bh->p_base; + mv64x60_bridge_vbase = bh->v_base; + + /* Assuming pci mode [reserved] bits 4:5 on 64260 are 0 */ + bh->pci_mode_a = mv64x60_read(bh, MV64x60_PCI0_MODE) & + MV64x60_PCIMODE_MASK; + bh->pci_mode_b = mv64x60_read(bh, MV64x60_PCI1_MODE) & + MV64x60_PCIMODE_MASK; + + /* Need temporary hose structs to call mv64x60_set_bus() */ + memset(&hose_a, 0, sizeof(hose_a)); + memset(&hose_b, 0, sizeof(hose_b)); + setup_indirect_pci_nomap(&hose_a, bh->v_base + MV64x60_PCI0_CONFIG_ADDR, + bh->v_base + MV64x60_PCI0_CONFIG_DATA); + setup_indirect_pci_nomap(&hose_b, bh->v_base + MV64x60_PCI1_CONFIG_ADDR, + bh->v_base + MV64x60_PCI1_CONFIG_DATA); + bh->hose_a = &hose_a; + bh->hose_b = &hose_b; - (void)mv64x60_setup_for_chip(&bh); - mv64x60_get_mem_windows(&bh, mem_windows); - return mv64x60_calc_mem_size(&bh, mem_windows); + mv64x60_set_bus(bh, 0, 0); + mv64x60_set_bus(bh, 1, 0); + + bh->hose_a = NULL; + bh->hose_b = NULL; + + /* Clear bit 0 of PCI addr decode control so PCI->CPU remap 1:1 */ + mv64x60_clr_bits(bh, MV64x60_PCI0_PCI_DECODE_CNTL, 0x00000001); + mv64x60_clr_bits(bh, MV64x60_PCI1_PCI_DECODE_CNTL, 0x00000001); + + /* Bit 12 MUST be 0; set bit 27--don't auto-update cpu remap regs */ + mv64x60_clr_bits(bh, MV64x60_CPU_CONFIG, (1<<12)); + mv64x60_set_bits(bh, MV64x60_CPU_CONFIG, (1<<27)); + + mv64x60_set_bits(bh, MV64x60_PCI0_TO_RETRY, 0xffff); + mv64x60_set_bits(bh, MV64x60_PCI1_TO_RETRY, 0xffff); + + return; } /* ***************************************************************************** * - * Window Config Routines (Externally Visible) + * Window Config Routines * ***************************************************************************** */ @@ -1241,12 +608,13 @@ mv64x60_get_mem_size(u32 bridge_base, u32 chip_type) * Determine the base address and size of a 32-bit window on the bridge. */ void __init -mv64x60_get_32bit_window(mv64x60_handle_t *bh, u32 window, u32 *base, u32 *size) +mv64x60_get_32bit_window(struct mv64x60_handle *bh, u32 window, + u32 *base, u32 *size) { u32 val, base_reg, size_reg, base_bits, size_bits; u32 (*get_from_field)(u32 val, u32 num_bits); - base_reg = bh->ci->window_tab_32bit[window].base_reg; + base_reg = bh->ci->window_tab_32bit[window].base_reg; if (base_reg != 0) { size_reg = bh->ci->window_tab_32bit[window].size_reg; @@ -1262,16 +630,15 @@ mv64x60_get_32bit_window(mv64x60_handle_t *bh, u32 window, u32 *base, u32 *size) val = get_from_field(val, size_bits); *size = bh->ci->untranslate_size(*base, val, size_bits); } - else { + else *size = 0; - } } else { *base = 0; *size = 0; } - DBG("get 32bit window: %d, base: 0x%x, size: 0x%x\n", + pr_debug("get 32bit window: %d, base: 0x%x, size: 0x%x\n", window, *base, *size); return; @@ -1283,16 +650,16 @@ mv64x60_get_32bit_window(mv64x60_handle_t *bh, u32 window, u32 *base, u32 *size) * Set the base address and size of a 32-bit window on the bridge. */ void __init -mv64x60_set_32bit_window(mv64x60_handle_t *bh, u32 window, u32 base, u32 size, - u32 other_bits) +mv64x60_set_32bit_window(struct mv64x60_handle *bh, u32 window, + u32 base, u32 size, u32 other_bits) { u32 val, base_reg, size_reg, base_bits, size_bits; u32 (*map_to_field)(u32 val, u32 num_bits); - DBG("set 32bit window: %d, base: 0x%x, size: 0x%x, other: 0x%x\n", + pr_debug("set 32bit window: %d, base: 0x%x, size: 0x%x, other: 0x%x\n", window, base, size, other_bits); - base_reg = bh->ci->window_tab_32bit[window].base_reg; + base_reg = bh->ci->window_tab_32bit[window].base_reg; if (base_reg != 0) { size_reg = bh->ci->window_tab_32bit[window].size_reg; @@ -1308,6 +675,7 @@ mv64x60_set_32bit_window(mv64x60_handle_t *bh, u32 window, u32 base, u32 size, val = map_to_field(val, size_bits); mv64x60_write(bh, size_reg, val); } + (void)mv64x60_read(bh, base_reg); /* Flush FIFO */ } @@ -1320,8 +688,8 @@ mv64x60_set_32bit_window(mv64x60_handle_t *bh, u32 window, u32 base, u32 size, * Determine the base address and size of a 64-bit window on the bridge. */ void __init -mv64x60_get_64bit_window(mv64x60_handle_t *bh, u32 window, u32 *base_hi, - u32 *base_lo, u32 *size) +mv64x60_get_64bit_window(struct mv64x60_handle *bh, u32 window, + u32 *base_hi, u32 *base_lo, u32 *size) { u32 val, base_lo_reg, size_reg, base_lo_bits, size_bits; u32 (*get_from_field)(u32 val, u32 num_bits); @@ -1334,7 +702,7 @@ mv64x60_get_64bit_window(mv64x60_handle_t *bh, u32 window, u32 *base_hi, size_bits = bh->ci->window_tab_64bit[window].size_bits; get_from_field= bh->ci->window_tab_64bit[window].get_from_field; - *base_hi = mv64x60_read(bh, + *base_hi = mv64x60_read(bh, bh->ci->window_tab_64bit[window].base_hi_reg); val = mv64x60_read(bh, base_lo_reg); @@ -1346,9 +714,8 @@ mv64x60_get_64bit_window(mv64x60_handle_t *bh, u32 window, u32 *base_hi, *size = bh->ci->untranslate_size(*base_lo, val, size_bits); } - else { + else *size = 0; - } } else { *base_hi = 0; @@ -1356,8 +723,8 @@ mv64x60_get_64bit_window(mv64x60_handle_t *bh, u32 window, u32 *base_hi, *size = 0; } - DBG("get 64bit window: %d, base hi: 0x%x, base lo: 0x%x, size: 0x%x\n", - window, *base_hi, *base_lo, *size); + pr_debug("get 64bit window: %d, base hi: 0x%x, base lo: 0x%x, " + "size: 0x%x\n", window, *base_hi, *base_lo, *size); return; } @@ -1368,13 +735,13 @@ mv64x60_get_64bit_window(mv64x60_handle_t *bh, u32 window, u32 *base_hi, * Set the base address and size of a 64-bit window on the bridge. */ void __init -mv64x60_set_64bit_window(mv64x60_handle_t *bh, u32 window, - u32 base_hi, u32 base_lo, u32 size, u32 other_bits) +mv64x60_set_64bit_window(struct mv64x60_handle *bh, u32 window, + u32 base_hi, u32 base_lo, u32 size, u32 other_bits) { u32 val, base_lo_reg, size_reg, base_lo_bits, size_bits; u32 (*map_to_field)(u32 val, u32 num_bits); - DBG("set 64bit window: %d, base hi: 0x%x, base lo: 0x%x, " \ + pr_debug("set 64bit window: %d, base hi: 0x%x, base lo: 0x%x, " "size: 0x%x, other: 0x%x\n", window, base_hi, base_lo, size, other_bits); @@ -1409,26 +776,20 @@ mv64x60_set_64bit_window(mv64x60_handle_t *bh, u32 window, * * Take the high-order 'num_bits' of 'val' & mask off low bits. */ -static u32 __init +u32 __init mv64x60_mask(u32 val, u32 num_bits) { - DBG("mask val: 0x%x, num_bits: %d == 0x%x\n", val, - num_bits, val & (0xffffffff << (32 - num_bits))); - return val & (0xffffffff << (32 - num_bits)); } /* - * mv64x60_mask_shift_left() + * mv64x60_shift_left() * * Take the low-order 'num_bits' of 'val', shift left to align at bit 31 (MSB). */ -static u32 __init +u32 __init mv64x60_shift_left(u32 val, u32 num_bits) { - DBG("shift left val: 0x%x, num_bits: %d == 0x%x\n", val, - num_bits, val << (32 - num_bits)); - return val << (32 - num_bits); } @@ -1437,61 +798,12 @@ mv64x60_shift_left(u32 val, u32 num_bits) * * Take the high-order 'num_bits' of 'val', shift right to align at bit 0 (LSB). */ -static u32 __init +u32 __init mv64x60_shift_right(u32 val, u32 num_bits) { - DBG("shift right val: 0x%x, num_bits: %d == 0x%x\n", val, num_bits, - val >> (32 - num_bits)); - return val >> (32 - num_bits); } -/* - ***************************************************************************** - * - * Early Init Routines - * - ***************************************************************************** - */ -/* - * mv64x60_early_init() - * - * Do some bridge work that must take place before we start messing with - * the bridge for real. - */ -static void __init -mv64x60_early_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) -{ - memset(bh, 0, sizeof(*bh)); - - bh->p_base = si->phys_reg_base; - bh->v_base = (u32)ioremap(bh->p_base, MV64x60_INTERNAL_SPACE_SIZE); - bh->base_irq = si->base_irq; - - /* Bit 12 MUST be 0; set bit 27--don't auto-update cpu remap regs */ - mv64x60_clr_bits(bh, MV64x60_CPU_CONFIG, (1<<12)); - mv64x60_set_bits(bh, MV64x60_CPU_CONFIG, (1<<27)); - - /* - * Turn off timer/counters. Not turning off watchdog timer because - * can't read its reg on the 64260A so don't know if we'll be enabling - * or disabling. - */ - mv64x60_clr_bits(bh, MV64x60_TIMR_CNTR_0_3_CNTL, - ((1<<0) | (1<<8) | (1<<16) | (1<<24))); - -#ifdef CONFIG_GT64260 - mv64x60_clr_bits(bh, GT64260_TIMR_CNTR_4_7_CNTL, - ((1<<0) | (1<<8) | (1<<16) | (1<<24))); -#endif - -#if 0 -XXXX Put in PCI_x_RETRY adjustment XXXX -#endif - - return; -} - /* ***************************************************************************** * @@ -1504,38 +816,47 @@ XXXX Put in PCI_x_RETRY adjustment XXXX * * Determine the type of bridge chip we have. */ -static int __init mv64x60_get_type(struct mv64x60_handle *bh) +int __init +mv64x60_get_type(struct mv64x60_handle *bh) { - struct pci_controller *hose = bh->hose_a; - int pcidev; - int devfn; - u16 val; - u8 save_exclude; + struct pci_controller hose; + u16 val; + u8 save_exclude; - pcidev = (mv64x60_read(bh, MV64x60_PCI0_P2P_CONFIG) >> 24) & 0xf; - devfn = PCI_DEVFN(pcidev, 0); + memset(&hose, 0, sizeof(hose)); + setup_indirect_pci_nomap(&hose, bh->v_base + MV64x60_PCI0_CONFIG_ADDR, + bh->v_base + MV64x60_PCI0_CONFIG_DATA); save_exclude = mv64x60_pci_exclude_bridge; - mv64x60_pci_exclude_bridge = FALSE; - + mv64x60_pci_exclude_bridge = 0; /* Sanity check of bridge's Vendor ID */ - early_read_config_word(hose, 0, devfn, PCI_VENDOR_ID, &val); + early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID, &val); - if (val != PCI_VENDOR_ID_MARVELL) + if (val != PCI_VENDOR_ID_MARVELL) { + mv64x60_pci_exclude_bridge = save_exclude; return -1; + } + + /* Get the revision of the chip */ + early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_CLASS_REVISION, + &val); + bh->rev = (u32)(val & 0xff); /* Figure out the type of Marvell bridge it is */ - early_read_config_word(hose, 0, devfn, PCI_DEVICE_ID, &val); + early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_DEVICE_ID, &val); + mv64x60_pci_exclude_bridge = save_exclude; switch (val) { case PCI_DEVICE_ID_MARVELL_GT64260: - early_read_config_word(hose, 0, devfn, - PCI_CLASS_REVISION, &val); - - switch (val & 0xff) { + switch (bh->rev) { case GT64260_REV_A: bh->type = MV64x60_TYPE_GT64260A; break; + + default: + printk(KERN_WARNING "Unsupported GT64260 rev %04x\n", + bh->rev); + /* Assume its similar to a 'B' rev and fallthru */ case GT64260_REV_B: bh->type = MV64x60_TYPE_GT64260B; break; @@ -1552,11 +873,14 @@ static int __init mv64x60_get_type(struct mv64x60_handle *bh) break; default: - printk(KERN_CRIT "Unknown Marvell bridge type %04x\n", val); + printk(KERN_ERR "Unknown Marvell bridge type %04x\n", val); return -1; } - mv64x60_pci_exclude_bridge = save_exclude; + /* Hang onto bridge type & rev for PIC code */ + mv64x60_bridge_type = bh->type; + mv64x60_bridge_rev = bh->rev; + return 0; } @@ -1565,45 +889,73 @@ static int __init mv64x60_get_type(struct mv64x60_handle *bh) * * Set 'bh' to use the proper set of routine for the bridge chip that we have. */ -static int __init -mv64x60_setup_for_chip(mv64x60_handle_t *bh) +int __init +mv64x60_setup_for_chip(struct mv64x60_handle *bh) { int rc = 0; /* Set up chip-specific info based on the chip/bridge type */ switch(bh->type) { - case MV64x60_TYPE_GT64260A: - bh->ci = >64260a_ci; - break; + case MV64x60_TYPE_GT64260A: + bh->ci = >64260a_ci; + break; - case MV64x60_TYPE_GT64260B: - bh->ci = >64260b_ci; - break; + case MV64x60_TYPE_GT64260B: + bh->ci = >64260b_ci; + break; - case MV64x60_TYPE_MV64360: - bh->ci = &mv64360_ci; - break; + case MV64x60_TYPE_MV64360: + bh->ci = &mv64360_ci; + break; -#if 0 /* Marvell won't tell me how to distinguish--MAG */ - case MV64x60_TYPE_MV64361: - case MV64x60_TYPE_MV64362: -#endif - case MV64x60_TYPE_MV64460: - bh->ci = &mv64460_ci; - break; + case MV64x60_TYPE_MV64460: + bh->ci = &mv64460_ci; + break; - case MV64x60_TYPE_INVALID: - default: - if (ppc_md.progress) - ppc_md.progress("mv64x60: Unsupported bridge", - 0x0); - printk("mv64x60: Unsupported bridge\n"); - rc = -1; + case MV64x60_TYPE_INVALID: + default: + if (ppc_md.progress) + ppc_md.progress("mv64x60: Unsupported bridge", 0x0); + printk(KERN_ERR "mv64x60: Unsupported bridge\n"); + rc = -1; } return rc; } +/* + * mv64x60_get_bridge_vbase() + * + * Return the virtual address of the bridge's registers. + */ +void * +mv64x60_get_bridge_vbase(void) +{ + return mv64x60_bridge_vbase; +} + +/* + * mv64x60_get_bridge_type() + * + * Return the type of bridge on the platform. + */ +u32 +mv64x60_get_bridge_type(void) +{ + return mv64x60_bridge_type; +} + +/* + * mv64x60_get_bridge_rev() + * + * Return the revision of the bridge on the platform. + */ +u32 +mv64x60_get_bridge_rev(void) +{ + return mv64x60_bridge_rev; +} + /* ***************************************************************************** * @@ -1611,29 +963,52 @@ mv64x60_setup_for_chip(mv64x60_handle_t *bh) * ***************************************************************************** */ +/* + * mv64x60_get_mem_size() + * + * Calculate the amount of memory that the memory controller is set up for. + * This should only be used by board-specific code if there is no other + * way to determine the amount of memory in the system. + */ +u32 __init +mv64x60_get_mem_size(u32 bridge_base, u32 chip_type) +{ + struct mv64x60_handle bh; + u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]; + u32 rc = 0; + + memset(&bh, 0, sizeof(bh)); + + bh.type = chip_type; + bh.v_base = (void *)bridge_base; + + if (!mv64x60_setup_for_chip(&bh)) { + mv64x60_get_mem_windows(&bh, mem_windows); + rc = mv64x60_calc_mem_size(&bh, mem_windows); + } + + return rc; +} + /* * mv64x60_get_mem_windows() * * Get the values in the memory controller & return in the 'mem_windows' array. */ -static void __init -mv64x60_get_mem_windows(mv64x60_handle_t *bh, +void __init +mv64x60_get_mem_windows(struct mv64x60_handle *bh, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) { - u32 i; - u32 windows[] = { MV64x60_CPU2MEM_0_WIN, MV64x60_CPU2MEM_1_WIN, - MV64x60_CPU2MEM_2_WIN, MV64x60_CPU2MEM_3_WIN }; + u32 i, win; - for (i=0; ici->is_enabled_32bit(bh, i)) { - mv64x60_get_32bit_window(bh, windows[i], + for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++) + if (bh->ci->is_enabled_32bit(bh, win)) + mv64x60_get_32bit_window(bh, win, &mem_windows[i][0], &mem_windows[i][1]); - } else { mem_windows[i][0] = 0; mem_windows[i][1] = 0; } - } return; } @@ -1644,15 +1019,14 @@ mv64x60_get_mem_windows(mv64x60_handle_t *bh, * Using the memory controller register values in 'mem_windows', determine * how much memory it is set up for. */ -static u32 __init -mv64x60_calc_mem_size(mv64x60_handle_t *bh, +u32 __init +mv64x60_calc_mem_size(struct mv64x60_handle *bh, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) { u32 i, total = 0; - for (i=0; iSystem MEM Config Routines + * CPU->System MEM, PCI Config Routines * ***************************************************************************** */ @@ -1669,131 +1043,92 @@ mv64x60_calc_mem_size(mv64x60_handle_t *bh, * * Configure CPU->Memory windows on the bridge. */ -static void __init -mv64x60_config_cpu2mem_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si, +static u32 prot_tab[] __initdata = { + MV64x60_CPU_PROT_0_WIN, MV64x60_CPU_PROT_1_WIN, + MV64x60_CPU_PROT_2_WIN, MV64x60_CPU_PROT_3_WIN +}; + +static u32 cpu_snoop_tab[] __initdata = { + MV64x60_CPU_SNOOP_0_WIN, MV64x60_CPU_SNOOP_1_WIN, + MV64x60_CPU_SNOOP_2_WIN, MV64x60_CPU_SNOOP_3_WIN +}; + +void __init +mv64x60_config_cpu2mem_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) { - u32 i; - u32 prot_windows[] = { - MV64x60_CPU_PROT_0_WIN, MV64x60_CPU_PROT_1_WIN, - MV64x60_CPU_PROT_2_WIN, MV64x60_CPU_PROT_3_WIN }; - u32 cpu_snoop_windows[] = { - MV64x60_CPU_SNOOP_0_WIN, MV64x60_CPU_SNOOP_1_WIN, - MV64x60_CPU_SNOOP_2_WIN, MV64x60_CPU_SNOOP_3_WIN }; + u32 i, win; /* Set CPU protection & snoop windows */ - for (i=0; ici->is_enabled_32bit(bh, i)) { - mv64x60_set_32bit_window(bh, prot_windows[i], + for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++) + if (bh->ci->is_enabled_32bit(bh, win)) { + mv64x60_set_32bit_window(bh, prot_tab[i], mem_windows[i][0], mem_windows[i][1], si->cpu_prot_options[i]); - bh->ci->enable_window_32bit(bh, prot_windows[i]); + bh->ci->enable_window_32bit(bh, prot_tab[i]); - if (bh->ci->window_tab_32bit[cpu_snoop_windows[i]]. + if (bh->ci->window_tab_32bit[cpu_snoop_tab[i]]. base_reg != 0) { - mv64x60_set_32bit_window(bh, - cpu_snoop_windows[i], mem_windows[i][0], - mem_windows[i][1], + mv64x60_set_32bit_window(bh, cpu_snoop_tab[i], + mem_windows[i][0], mem_windows[i][1], si->cpu_snoop_options[i]); bh->ci->enable_window_32bit(bh, - cpu_snoop_windows[i]); + cpu_snoop_tab[i]); } } - } return; } -/* - ***************************************************************************** - * - * CPU->PCI Config Routines - * - ***************************************************************************** - */ - /* * mv64x60_config_cpu2pci_windows() * - * Configure the CPU->PCI windows on the bridge. + * Configure the CPU->PCI windows for one of the PCI buses. */ -static void __init -mv64x60_config_cpu2pci_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) -{ - if (ppc_md.progress) - ppc_md.progress("mv64x60_config_bridge: Enter", 0x0); - - /* - * Set up various parts of the bridge including CPU->PCI windows. - * Depending on the board, there may be only one hose that needs to - * be set up. - */ - if (si->pci_0.enable_bus) { - u32 win_tab[] = { MV64x60_CPU2PCI0_IO_WIN, - MV64x60_CPU2PCI0_MEM_0_WIN, - MV64x60_CPU2PCI0_MEM_1_WIN, - MV64x60_CPU2PCI0_MEM_2_WIN }; - u32 remap_tab[] = { MV64x60_CPU2PCI0_IO_REMAP_WIN, - MV64x60_CPU2PCI0_MEM_0_REMAP_WIN, - MV64x60_CPU2PCI0_MEM_1_REMAP_WIN, - MV64x60_CPU2PCI0_MEM_2_REMAP_WIN }; - - mv64x60_set_cpu2pci_window(bh, &si->pci_0, win_tab, remap_tab); - } - - if (si->pci_1.enable_bus) { - u32 win_tab[] = { MV64x60_CPU2PCI1_IO_WIN, - MV64x60_CPU2PCI1_MEM_0_WIN, - MV64x60_CPU2PCI1_MEM_1_WIN, - MV64x60_CPU2PCI1_MEM_2_WIN }; - u32 remap_tab[] = { MV64x60_CPU2PCI1_IO_REMAP_WIN, - MV64x60_CPU2PCI1_MEM_0_REMAP_WIN, - MV64x60_CPU2PCI1_MEM_1_REMAP_WIN, - MV64x60_CPU2PCI1_MEM_2_REMAP_WIN }; - - mv64x60_set_cpu2pci_window(bh, &si->pci_1, win_tab, remap_tab); - } +static u32 win_tab[2][4] __initdata = { + { MV64x60_CPU2PCI0_IO_WIN, MV64x60_CPU2PCI0_MEM_0_WIN, + MV64x60_CPU2PCI0_MEM_1_WIN, MV64x60_CPU2PCI0_MEM_2_WIN }, + { MV64x60_CPU2PCI1_IO_WIN, MV64x60_CPU2PCI1_MEM_0_WIN, + MV64x60_CPU2PCI1_MEM_1_WIN, MV64x60_CPU2PCI1_MEM_2_WIN }, +}; - return; -} /* mv64x60_config_bridge() */ +static u32 remap_tab[2][4] __initdata = { + { MV64x60_CPU2PCI0_IO_REMAP_WIN, MV64x60_CPU2PCI0_MEM_0_REMAP_WIN, + MV64x60_CPU2PCI0_MEM_1_REMAP_WIN, MV64x60_CPU2PCI0_MEM_2_REMAP_WIN }, + { MV64x60_CPU2PCI1_IO_REMAP_WIN, MV64x60_CPU2PCI1_MEM_0_REMAP_WIN, + MV64x60_CPU2PCI1_MEM_1_REMAP_WIN, MV64x60_CPU2PCI1_MEM_2_REMAP_WIN } +}; -/* - * mv64x60_set_cpu2pci_window() - * - * Configure the CPU->PCI windows for one of the PCI buses. - */ -static void __init -mv64x60_set_cpu2pci_window(mv64x60_handle_t *bh, mv64x60_pci_info_t *pi, - u32 *win_tab, u32 *remap_tab) +void __init +mv64x60_config_cpu2pci_windows(struct mv64x60_handle *bh, + struct mv64x60_pci_info *pi, u32 bus) { int i; if (pi->pci_io.size > 0) { - mv64x60_set_32bit_window(bh, win_tab[0], pi->pci_io.cpu_base, - pi->pci_io.size, pi->pci_io.swap); - mv64x60_set_32bit_window(bh, remap_tab[0], - pi->pci_io.pci_base_lo, 0, 0); - bh->ci->enable_window_32bit(bh, win_tab[0]); - } - else { /* Actually, the window should already be disabled */ - bh->ci->disable_window_32bit(bh, win_tab[0]); + mv64x60_set_32bit_window(bh, win_tab[bus][0], + pi->pci_io.cpu_base, pi->pci_io.size, pi->pci_io.swap); + mv64x60_set_32bit_window(bh, remap_tab[bus][0], + pi->pci_io.pci_base_lo, 0, 0); + bh->ci->enable_window_32bit(bh, win_tab[bus][0]); } + else /* Actually, the window should already be disabled */ + bh->ci->disable_window_32bit(bh, win_tab[bus][0]); - for (i=0; i<3; i++) { + for (i=0; i<3; i++) if (pi->pci_mem[i].size > 0) { - mv64x60_set_32bit_window(bh, win_tab[i+1], + mv64x60_set_32bit_window(bh, win_tab[bus][i+1], pi->pci_mem[i].cpu_base, pi->pci_mem[i].size, pi->pci_mem[i].swap); - mv64x60_set_64bit_window(bh, remap_tab[i+1], + mv64x60_set_64bit_window(bh, remap_tab[bus][i+1], pi->pci_mem[i].pci_base_hi, pi->pci_mem[i].pci_base_lo, 0, 0); - bh->ci->enable_window_32bit(bh, win_tab[i+1]); - } - else { /* Actually, the window should already be disabled */ - bh->ci->disable_window_32bit(bh, win_tab[i+1]); + bh->ci->enable_window_32bit(bh, win_tab[bus][i+1]); } - } + else /* Actually, the window should already be disabled */ + bh->ci->disable_window_32bit(bh, win_tab[bus][i+1]); return; } @@ -1810,109 +1145,68 @@ mv64x60_set_cpu2pci_window(mv64x60_handle_t *bh, mv64x60_pci_info_t *pi, * * Configure the PCI->Memory windows on the bridge. */ -static void __init -mv64x60_config_pci2mem_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si, - u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) -{ - u32 i; - u32 pci_0_acc_windows[] = { - MV64x60_PCI02MEM_ACC_CNTL_0_WIN, - MV64x60_PCI02MEM_ACC_CNTL_1_WIN, - MV64x60_PCI02MEM_ACC_CNTL_2_WIN, - MV64x60_PCI02MEM_ACC_CNTL_3_WIN }; - u32 pci_1_acc_windows[] = { - MV64x60_PCI12MEM_ACC_CNTL_0_WIN, - MV64x60_PCI12MEM_ACC_CNTL_1_WIN, - MV64x60_PCI12MEM_ACC_CNTL_2_WIN, - MV64x60_PCI12MEM_ACC_CNTL_3_WIN }; - u32 pci_0_snoop_windows[] = { - MV64x60_PCI02MEM_SNOOP_0_WIN, - MV64x60_PCI02MEM_SNOOP_1_WIN, - MV64x60_PCI02MEM_SNOOP_2_WIN, - MV64x60_PCI02MEM_SNOOP_3_WIN }; - u32 pci_1_snoop_windows[] = { - MV64x60_PCI12MEM_SNOOP_0_WIN, - MV64x60_PCI12MEM_SNOOP_1_WIN, - MV64x60_PCI12MEM_SNOOP_2_WIN, - MV64x60_PCI12MEM_SNOOP_3_WIN }; - u32 pci_0_size[] = { - MV64x60_PCI0_MEM_0_SIZE, MV64x60_PCI0_MEM_1_SIZE, - MV64x60_PCI0_MEM_2_SIZE, MV64x60_PCI0_MEM_3_SIZE }; - u32 pci_1_size[] = { - MV64x60_PCI1_MEM_0_SIZE, MV64x60_PCI1_MEM_1_SIZE, - MV64x60_PCI1_MEM_2_SIZE, MV64x60_PCI1_MEM_3_SIZE }; +static u32 pci_acc_tab[2][4] __initdata = { + { MV64x60_PCI02MEM_ACC_CNTL_0_WIN, MV64x60_PCI02MEM_ACC_CNTL_1_WIN, + MV64x60_PCI02MEM_ACC_CNTL_2_WIN, MV64x60_PCI02MEM_ACC_CNTL_3_WIN }, + { MV64x60_PCI12MEM_ACC_CNTL_0_WIN, MV64x60_PCI12MEM_ACC_CNTL_1_WIN, + MV64x60_PCI12MEM_ACC_CNTL_2_WIN, MV64x60_PCI12MEM_ACC_CNTL_3_WIN } +}; - /* Clear bit 0 of PCI addr decode control so PCI->CPU remap 1:1 */ - mv64x60_clr_bits(bh, MV64x60_PCI0_PCI_DECODE_CNTL, 0x00000001); - mv64x60_clr_bits(bh, MV64x60_PCI1_PCI_DECODE_CNTL, 0x00000001); +static u32 pci_snoop_tab[2][4] __initdata = { + { MV64x60_PCI02MEM_SNOOP_0_WIN, MV64x60_PCI02MEM_SNOOP_1_WIN, + MV64x60_PCI02MEM_SNOOP_2_WIN, MV64x60_PCI02MEM_SNOOP_3_WIN }, + { MV64x60_PCI12MEM_SNOOP_0_WIN, MV64x60_PCI12MEM_SNOOP_1_WIN, + MV64x60_PCI12MEM_SNOOP_2_WIN, MV64x60_PCI12MEM_SNOOP_3_WIN } +}; + +static u32 pci_size_tab[2][4] __initdata = { + { MV64x60_PCI0_MEM_0_SIZE, MV64x60_PCI0_MEM_1_SIZE, + MV64x60_PCI0_MEM_2_SIZE, MV64x60_PCI0_MEM_3_SIZE }, + { MV64x60_PCI1_MEM_0_SIZE, MV64x60_PCI1_MEM_1_SIZE, + MV64x60_PCI1_MEM_2_SIZE, MV64x60_PCI1_MEM_3_SIZE } +}; + +void __init +mv64x60_config_pci2mem_windows(struct mv64x60_handle *bh, + struct pci_controller *hose, struct mv64x60_pci_info *pi, + u32 bus, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) +{ + u32 i, win; /* * Set the access control, snoop, BAR size, and window base addresses. * PCI->MEM windows base addresses will match exactly what the * CPU->MEM windows are. */ - for (i=0; ici->is_enabled_32bit(bh, i)) { - if (si->pci_0.enable_bus) { - mv64x60_set_64bit_window(bh, - pci_0_acc_windows[i], 0, - mem_windows[i][0], mem_windows[i][1], - si->pci_0.acc_cntl_options[i]); - bh->ci->enable_window_64bit(bh, - pci_0_acc_windows[i]); - - if (bh->ci->window_tab_64bit[ - pci_0_snoop_windows[i]].base_lo_reg - != 0) { - mv64x60_set_64bit_window(bh, - pci_0_snoop_windows[i], 0, - mem_windows[i][0], - mem_windows[i][1], - si->pci_0.snoop_options[i]); - bh->ci->enable_window_64bit(bh, - pci_0_snoop_windows[i]); - } - - bh->ci->set_pci2mem_window(bh->hose_a, i, - mem_windows[i][0]); - mv64x60_write(bh, pci_0_size[i], - mv64x60_mask(mem_windows[i][1] -1, 20)); - - /* Enable the window */ - mv64x60_clr_bits(bh, MV64x60_PCI0_BAR_ENABLE, - 1 << i); - } - if (si->pci_1.enable_bus) { + for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++) + if (bh->ci->is_enabled_32bit(bh, win)) { + mv64x60_set_64bit_window(bh, + pci_acc_tab[bus][i], 0, + mem_windows[i][0], mem_windows[i][1], + pi->acc_cntl_options[i]); + bh->ci->enable_window_64bit(bh, pci_acc_tab[bus][i]); + + if (bh->ci->window_tab_64bit[ + pci_snoop_tab[bus][i]].base_lo_reg != 0) { + mv64x60_set_64bit_window(bh, - pci_1_acc_windows[i], 0, + pci_snoop_tab[bus][i], 0, mem_windows[i][0], mem_windows[i][1], - si->pci_1.acc_cntl_options[i]); + pi->snoop_options[i]); bh->ci->enable_window_64bit(bh, - pci_1_acc_windows[i]); - - if (bh->ci->window_tab_64bit[ - pci_1_snoop_windows[i]].base_lo_reg - != 0) { - mv64x60_set_64bit_window(bh, - pci_1_snoop_windows[i], 0, - mem_windows[i][0], - mem_windows[i][1], - si->pci_1.snoop_options[i]); - bh->ci->enable_window_64bit(bh, - pci_1_snoop_windows[i]); - } - - bh->ci->set_pci2mem_window(bh->hose_b, i, - mem_windows[i][0]); - mv64x60_write(bh, pci_1_size[i], - mv64x60_mask(mem_windows[i][1] -1, 20)); - - /* Enable the window */ - mv64x60_clr_bits(bh, MV64x60_PCI1_BAR_ENABLE, - 1 << i); + pci_snoop_tab[bus][i]); } + + bh->ci->set_pci2mem_window(hose, bus, i, + mem_windows[i][0]); + mv64x60_write(bh, pci_size_tab[bus][i], + mv64x60_mask(mem_windows[i][1] - 1, 20)); + + /* Enable the window */ + mv64x60_clr_bits(bh, ((bus == 0) ? + MV64x60_PCI0_BAR_ENABLE : + MV64x60_PCI1_BAR_ENABLE), (1 << i)); } - } return; } @@ -1929,72 +1223,28 @@ mv64x60_config_pci2mem_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si, * * Allocate the PCI hose structures for the bridge's PCI buses. */ -static void __init -mv64x60_alloc_hoses(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) -{ - /* - * Alloc first hose struct even when its not to be configured b/c the - * chip identification routines need to use it. - */ - bh->hose_a = pcibios_alloc_controller(); - setup_indirect_pci(bh->hose_a, - bh->p_base + MV64x60_PCI0_CONFIG_ADDR, - bh->p_base + MV64x60_PCI0_CONFIG_DATA); - - if (si->pci_1.enable_bus) { - bh->hose_b = pcibios_alloc_controller(); - setup_indirect_pci(bh->hose_b, - bh->p_base + MV64x60_PCI1_CONFIG_ADDR, - bh->p_base + MV64x60_PCI1_CONFIG_DATA); - } - - return; -} - -/* - * mv64x60_init_hoses() - * - * Initialize the PCI hose structures for the bridge's PCI hoses. - */ -static void __init -mv64x60_init_hoses(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +void __init +mv64x60_alloc_hose(struct mv64x60_handle *bh, u32 cfg_addr, u32 cfg_data, + struct pci_controller **hose) { - if (si->pci_1.enable_bus) { - bh->io_base_b = (u32)ioremap(si->pci_1.pci_io.cpu_base, - si->pci_1.pci_io.size); - isa_io_base = bh->io_base_b; - } - - if (si->pci_0.enable_bus) { - bh->io_base_a = (u32)ioremap(si->pci_0.pci_io.cpu_base, - si->pci_0.pci_io.size); - isa_io_base = bh->io_base_a; - - mv64x60_init_resources(bh->hose_a, &si->pci_0, bh->io_base_a); - mv64x60_set_pci_params(bh->hose_a, &si->pci_0); - } - - /* Must do here so proper isa_io_base is used in calculations */ - if (si->pci_1.enable_bus) { - mv64x60_init_resources(bh->hose_b, &si->pci_1, bh->io_base_b); - mv64x60_set_pci_params(bh->hose_b, &si->pci_1); - } - + *hose = pcibios_alloc_controller(); + setup_indirect_pci_nomap(*hose, bh->v_base + cfg_addr, + bh->v_base + cfg_data); return; } /* - * mv64x60_init_resources() + * mv64x60_config_resources() * * Calculate the offsets, etc. for the hose structures to reflect all of * the address remapping that happens as you go from CPU->PCI and PCI->MEM. */ -static void __init -mv64x60_init_resources(struct pci_controller *hose, mv64x60_pci_info_t *pi, - u32 io_base) +void __init +mv64x60_config_resources(struct pci_controller *hose, + struct mv64x60_pci_info *pi, u32 io_base) { int i; - /* 2 hoses; 4 resources/hose; sting <= 64 bytes; not work if > 1 chip */ + /* 2 hoses; 4 resources/hose; string <= 64 bytes */ static char s[2][4][64]; if (pi->pci_io.size != 0) { @@ -2005,10 +1255,11 @@ mv64x60_init_resources(struct pci_controller *hose, mv64x60_pci_info_t *pi, IORESOURCE_IO, s[hose->index][0]); hose->io_space.start = pi->pci_io.pci_base_lo; hose->io_space.end = pi->pci_io.pci_base_lo + pi->pci_io.size-1; + hose->io_base_phys = pi->pci_io.cpu_base; hose->io_base_virt = (void *)isa_io_base; } - for (i=0; i<3; i++) { + for (i=0; i<3; i++) if (pi->pci_mem[i].size != 0) { sprintf(s[hose->index][i+1], "PCI hose %d MEM Space %d", hose->index, i); @@ -2017,23 +1268,22 @@ mv64x60_init_resources(struct pci_controller *hose, mv64x60_pci_info_t *pi, pi->pci_mem[i].cpu_base + pi->pci_mem[i].size-1, IORESOURCE_MEM, s[hose->index][i+1]); } - } - + hose->mem_space.end = pi->pci_mem[0].pci_base_lo + pi->pci_mem[0].size - 1; hose->pci_mem_offset = pi->pci_mem[0].cpu_base - pi->pci_mem[0].pci_base_lo; - return; -} /* mv64x60_init_resources() */ +} /* - * mv64x60_set_pci_params() + * mv64x60_config_pci_params() * * Configure a hose's PCI config space parameters. */ -static void __init -mv64x60_set_pci_params(struct pci_controller *hose, mv64x60_pci_info_t *pi) +void __init +mv64x60_config_pci_params(struct pci_controller *hose, + struct mv64x60_pci_info *pi) { u32 devfn; u16 u16_val; @@ -2042,13 +1292,13 @@ mv64x60_set_pci_params(struct pci_controller *hose, mv64x60_pci_info_t *pi) devfn = PCI_DEVFN(0,0); save_exclude = mv64x60_pci_exclude_bridge; - mv64x60_pci_exclude_bridge = FALSE; + mv64x60_pci_exclude_bridge = 0; /* Set class code to indicate host bridge */ u16_val = PCI_CLASS_BRIDGE_HOST; /* 0x0600 (host bridge) */ early_write_config_word(hose, 0, devfn, PCI_CLASS_DEVICE, u16_val); - /* Enable 64260 to be PCI master & respond to PCI MEM cycles */ + /* Enable bridge to be PCI master & respond to PCI MEM cycles */ early_read_config_word(hose, 0, devfn, PCI_COMMAND, &u16_val); u16_val &= ~(PCI_COMMAND_IO | PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR | PCI_COMMAND_FAST_BACK); @@ -2071,99 +1321,62 @@ mv64x60_set_pci_params(struct pci_controller *hose, mv64x60_pci_info_t *pi) ***************************************************************************** */ /* - * mv64x60_enumerate_buses() + * mv64x60_set_bus() * - * If requested, enumerate the PCI buses and set the appropriate - * info in the hose structures. + * Set the bus number for the hose directly under the bridge. */ -static void __init -mv64x60_enumerate_buses(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +void __init +mv64x60_set_bus(struct mv64x60_handle *bh, u32 bus, u32 child_bus) { - u32 val; - - pci_dram_offset = 0; /* System mem at same addr on PCI & cpu bus */ - - ppc_md.pci_exclude_device = mv64x60_pci_exclude_device; - ppc_md.pci_swizzle = common_swizzle; - ppc_md.pci_map_irq = si->map_irq; - - /* Now that the bridge is set up, its safe to scan the PCI buses */ - if (si->pci_0.enable_bus) { - if (si->pci_0.enumerate_bus) { - /* Set bus number for PCI 0 to 0 */ - val = mv64x60_read(bh, MV64x60_PCI0_P2P_CONFIG); - val &= 0xe0000000; - val |= 0x000000ff; - mv64x60_write(bh, MV64x60_PCI0_P2P_CONFIG, val); - /* Flush FIFO*/ - (void)mv64x60_read(bh, MV64x60_PCI0_P2P_CONFIG); - -#if 0 -XXXX Different if in PCI-X mode (look at mv64360_find_bridges()) XXXX -#endif - - bh->hose_a->first_busno = 0; - bh->hose_a->last_busno = 0xff; + struct pci_controller *hose; + u32 pci_mode, p2p_cfg, pci_cfg_offset, val; + u8 save_exclude; - bh->hose_a->last_busno = pciauto_bus_scan(bh->hose_a, - bh->hose_a->first_busno); - } - else { - /* Assume bridge set up correctly by someone else */ - val = mv64x60_read(bh, MV64x60_PCI0_P2P_CONFIG); - bh->hose_a->first_busno = (val & 0x00ff0000) >> 16; - } + if (bus == 0) { + pci_mode = bh->pci_mode_a; + p2p_cfg = MV64x60_PCI0_P2P_CONFIG; + pci_cfg_offset = 0x64; + hose = bh->hose_a; + } + else { + pci_mode = bh->pci_mode_b; + p2p_cfg = MV64x60_PCI1_P2P_CONFIG; + pci_cfg_offset = 0xe4; + hose = bh->hose_b; } - if (si->pci_1.enable_bus) { - if (si->pci_1.enumerate_bus) { - if (si->pci_0.enable_bus) { - bh->hose_b->first_busno = - bh->hose_a->last_busno + 1; - - /* Set bus number for PCI 1 hose */ - val = mv64x60_read(bh, MV64x60_PCI1_P2P_CONFIG); - val &= 0xe0000000; - val |= (bh->hose_b->first_busno << 16) | 0xff; - mv64x60_write(bh, MV64x60_PCI1_P2P_CONFIG, val); - /* Flush FIFO */ - (void)mv64x60_read(bh, MV64x60_PCI1_P2P_CONFIG); - } - else { - bh->hose_b->first_busno = 0; - } + child_bus &= 0xff; + val = mv64x60_read(bh, p2p_cfg); - bh->hose_b->last_busno = 0xff; - bh->hose_b->last_busno = pciauto_bus_scan(bh->hose_b, - bh->hose_b->first_busno); - } - else { - /* Assume bridge set up correctly by someone else */ - val = mv64x60_read(bh, MV64x60_PCI1_P2P_CONFIG); - bh->hose_b->first_busno = (val & 0x00ff0000) >> 16; - bh->hose_b->last_busno = 0xff; /* No way to know */ - } + if (pci_mode == MV64x60_PCIMODE_CONVENTIONAL) { + val &= 0xe0000000; /* Force dev num to 0, turn off P2P bridge */ + val |= (child_bus << 16) | 0xff; + mv64x60_write(bh, p2p_cfg, val); + (void)mv64x60_read(bh, p2p_cfg); /* Flush FIFO */ } - - if (si->pci_0.enable_bus && !si->pci_0.enumerate_bus) { - if (si->pci_1.enable_bus) { - bh->hose_a->last_busno = bh->hose_b->first_busno - 1; - } - else { - bh->hose_a->last_busno = 0xff; /* No way to know */ - } + else { /* PCI-X */ + /* + * Need to use the current bus/dev number (that's in the + * P2P CONFIG reg) to access the bridge's pci config space. + */ + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + early_write_config_dword(hose, (val & 0x00ff0000) >> 16, + PCI_DEVFN(((val & 0x1f000000) >> 24), 0), + pci_cfg_offset, child_bus << 8); + mv64x60_pci_exclude_bridge = save_exclude; } return; } /* - * mv64x60_exclude_pci_device() + * mv64x60_pci_exclude_device() * * This routine is used to make the bridge not appear when the * PCI subsystem is accessing PCI devices (in PCI config space). */ -static int +int mv64x60_pci_exclude_device(u8 bus, u8 devfn) { struct pci_controller *hose; @@ -2171,41 +1384,63 @@ mv64x60_pci_exclude_device(u8 bus, u8 devfn) hose = pci_bus_to_hose(bus); /* Skip slot 0 on both hoses */ - if ((mv64x60_pci_exclude_bridge == TRUE) && - (PCI_SLOT(devfn) == 0) && - (hose->first_busno == bus)) { + if ((mv64x60_pci_exclude_bridge == 1) && (PCI_SLOT(devfn) == 0) && + (hose->first_busno == bus)) + return PCIBIOS_DEVICE_NOT_FOUND; - } - else { + else return PCIBIOS_SUCCESSFUL; - } } /* mv64x60_pci_exclude_device() */ /* ***************************************************************************** * - * OCP Fixup Routines + * Platform Device Routines * ***************************************************************************** */ + /* - * mv64x60_fixup_ocp() + * mv64x60_pd_fixup() * - * Adjust the 'paddr' field in the bridge's OCP entries to reflect where they - * really are in the physical address space. + * Need to add the base addr of where the bridge's regs are mapped in the + * physical addr space so drivers can ioremap() them. */ -static void __init -mv64x60_fixup_ocp(struct ocp_device *dev, void *arg) +void __init +mv64x60_pd_fixup(struct mv64x60_handle *bh, struct platform_device *pd_devs[], + u32 entries) { - mv64x60_handle_t *bh = (mv64x60_handle_t *)arg; + struct resource *r; + u32 i, j; + + for (i=0; idef->vendor == OCP_VENDOR_MARVELL) { - dev->def->paddr += bh->p_base; + while ((r = platform_get_resource(pd_devs[i],IORESOURCE_MEM,j)) + != NULL) { + + r->start += bh->p_base; + r->end += bh->p_base; + j++; + } } return; } +/* + * mv64x60_add_pds() + * + * Add the mv64x60 platform devices to the list of platform devices. + */ +static int __init +mv64x60_add_pds(void) +{ + return platform_add_devices(mv64x60_pd_devs, + ARRAY_SIZE(mv64x60_pd_devs)); +} +arch_initcall(mv64x60_add_pds); + /* ***************************************************************************** * @@ -2232,12 +1467,10 @@ gt64260_translate_size(u32 base, u32 size, u32 num_bits) static u32 __init gt64260_untranslate_size(u32 base, u32 size, u32 num_bits) { - if (size >= base) { + if (size >= base) size = size - base + (1 << (32 - num_bits)); - } - else { + else size = 0; - } return size; } @@ -2248,17 +1481,50 @@ gt64260_untranslate_size(u32 base, u32 size, u32 num_bits) * The PCI->MEM window registers are actually in PCI config space so need * to set them by setting the correct config space BARs. */ +static u32 gt64260_reg_addrs[2][4] __initdata = { + { 0x10, 0x14, 0x18, 0x1c }, { 0x90, 0x94, 0x98, 0x9c } +}; + static void __init -gt64260_set_pci2mem_window(struct pci_controller *hose, u32 window, u32 base) +gt64260_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window, + u32 base) { - u32 reg_addrs[] = { 0x10, 0x14, 0x18, 0x1c }; + u8 save_exclude; - DBG("set pci->mem window: %d, hose: %d, base: 0x%x\n", window, + pr_debug("set pci->mem window: %d, hose: %d, base: 0x%x\n", window, hose->index, base); - early_write_config_dword(hose, hose->first_busno, - PCI_DEVFN(0, 0), reg_addrs[window], - mv64x60_mask(base, 20) | 0x8); + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + early_write_config_dword(hose, 0, PCI_DEVFN(0, 0), + gt64260_reg_addrs[bus][window], mv64x60_mask(base, 20) | 0x8); + mv64x60_pci_exclude_bridge = save_exclude; + + return; +} + +/* + * gt64260_set_pci2regs_window() + * + * Set where the bridge's registers appear in PCI MEM space. + */ +static u32 gt64260_offset[2] __initdata = {0x20, 0xa0}; + +static void __init +gt64260_set_pci2regs_window(struct mv64x60_handle *bh, + struct pci_controller *hose, u32 bus, u32 base) +{ + u8 save_exclude; + + pr_debug("set pci->internal regs hose: %d, base: 0x%x\n", hose->index, + base); + + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + early_write_config_dword(hose, 0, PCI_DEVFN(0,0), gt64260_offset[bus], + (base << 16)); + mv64x60_pci_exclude_bridge = save_exclude; + return; } @@ -2269,7 +1535,7 @@ gt64260_set_pci2mem_window(struct pci_controller *hose, u32 window, u32 base) * address. */ static u32 __init -gt64260_is_enabled_32bit(mv64x60_handle_t *bh, u32 window) +gt64260_is_enabled_32bit(struct mv64x60_handle *bh, u32 window) { u32 rc = 0; @@ -2278,17 +1544,9 @@ gt64260_is_enabled_32bit(mv64x60_handle_t *bh, u32 window) ((mv64x60_read(bh, gt64260_32bit_windows[window].size_reg) & ((1 << gt64260_32bit_windows[window].size_bits) - 1)) >= (mv64x60_read(bh, gt64260_32bit_windows[window].base_reg) & - ((1 << gt64260_32bit_windows[window].base_bits) - 1)))){ + ((1 << gt64260_32bit_windows[window].base_bits) - 1)))) rc = 1; - } - - if (rc) { - DBG("32bit window %d is enabled\n", window); - } - else { - DBG("32bit window %d is disabled\n", window); - } return rc; } @@ -2301,9 +1559,9 @@ gt64260_is_enabled_32bit(mv64x60_handle_t *bh, u32 window) * the time this routine is called, we have nothing to do here. */ static void __init -gt64260_enable_window_32bit(mv64x60_handle_t *bh, u32 window) +gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window) { - DBG("enable 32bit window: %d\n", window); + pr_debug("enable 32bit window: %d\n", window); return; } @@ -2314,9 +1572,9 @@ gt64260_enable_window_32bit(mv64x60_handle_t *bh, u32 window) * than its base address. */ static void __init -gt64260_disable_window_32bit(mv64x60_handle_t *bh, u32 window) +gt64260_disable_window_32bit(struct mv64x60_handle *bh, u32 window) { - DBG("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", + pr_debug("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", window, gt64260_32bit_windows[window].base_reg, gt64260_32bit_windows[window].size_reg); @@ -2339,9 +1597,9 @@ gt64260_disable_window_32bit(mv64x60_handle_t *bh, u32 window) * the time this routine is called, we have nothing to do here. */ static void __init -gt64260_enable_window_64bit(mv64x60_handle_t *bh, u32 window) +gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window) { - DBG("enable 64bit window: %d\n", window); + pr_debug("enable 64bit window: %d\n", window); return; /* Enabled when window configured (i.e., when top >= base) */ } @@ -2352,9 +1610,9 @@ gt64260_enable_window_64bit(mv64x60_handle_t *bh, u32 window) * than its base address. */ static void __init -gt64260_disable_window_64bit(mv64x60_handle_t *bh, u32 window) +gt64260_disable_window_64bit(struct mv64x60_handle *bh, u32 window) { - DBG("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", + pr_debug("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", window, gt64260_64bit_windows[window].base_lo_reg, gt64260_64bit_windows[window].size_reg); @@ -2379,21 +1637,26 @@ gt64260_disable_window_64bit(mv64x60_handle_t *bh, u32 window) * except for the memory controller windows, of course. */ static void __init -gt64260_disable_all_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +gt64260_disable_all_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) { - u32 i; + u32 i, preserve; /* Disable 32bit windows (don't disable cpu->mem windows) */ for (i=MV64x60_CPU2DEV_0_WIN; iwindow_preserve_mask_32 & (1<window_preserve_mask_32_lo & (1 << i); + else + preserve = si->window_preserve_mask_32_hi & (1<<(i-32)); + + if (!preserve) gt64260_disable_window_32bit(bh, i); } /* Disable 64bit windows */ - for (i=0; iwindow_preserve_mask_64 & (1< windows */ - mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x07ffffff); - mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x07ffffff); + mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x07fffdff); + mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x07fffdff); + + /* + * Some firmwares enable a bunch of intr sources + * for the PCI INT output pins. + */ + mv64x60_write(bh, GT64260_IC_CPU_INTR_MASK_LO, 0); + mv64x60_write(bh, GT64260_IC_CPU_INTR_MASK_HI, 0); + mv64x60_write(bh, GT64260_IC_PCI0_INTR_MASK_LO, 0); + mv64x60_write(bh, GT64260_IC_PCI0_INTR_MASK_HI, 0); + mv64x60_write(bh, GT64260_IC_PCI1_INTR_MASK_LO, 0); + mv64x60_write(bh, GT64260_IC_PCI1_INTR_MASK_HI, 0); + mv64x60_write(bh, GT64260_IC_CPU_INT_0_MASK, 0); + mv64x60_write(bh, GT64260_IC_CPU_INT_1_MASK, 0); + mv64x60_write(bh, GT64260_IC_CPU_INT_2_MASK, 0); + mv64x60_write(bh, GT64260_IC_CPU_INT_3_MASK, 0); return; } @@ -2444,84 +1722,72 @@ gt64260_disable_all_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) * * Implement errata work arounds for the GT64260A. */ -static void -gt64260a_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +static void __init +gt64260a_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) { - struct ocp_device *dev; - mv64x60_ocp_mpsc_data_t *mpsc_dp; - u8 save_exclude; - u32 val; - - /* R#18 */ - /* cpu read buffer to buffer 1 (reg 0x0448) */ - mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26)); - - /* No longer errata so turn on */ - /* Enable pci read/write combine, master write trigger, - * disable slave sync barrier - * readmultiple (reg 0x0c00 and 0x0c80) - */ - if (si->pci_0.enable_bus) { +#ifdef CONFIG_SERIAL_MPSC + struct resource *r; +#endif +#if !defined(CONFIG_NOT_COHERENT_CACHE) + u32 val; + u8 save_exclude; +#endif + + if (si->pci_0.enable_bus) mv64x60_set_bits(bh, MV64x60_PCI0_CMD, ((1<<4) | (1<<5) | (1<<9) | (1<<13))); - } - if (si->pci_1.enable_bus) { + if (si->pci_1.enable_bus) mv64x60_set_bits(bh, MV64x60_PCI1_CMD, ((1<<4) | (1<<5) | (1<<9) | (1<<13))); - } -#if 1 /* XXXX */ /* * Dave Wilhardt found that bit 4 in the PCI Command registers must * be set if you are using cache coherency. - * - * Note: he also said that bit 4 must be on in all PCI devices but - * that has not been implemented yet. */ +#if !defined(CONFIG_NOT_COHERENT_CACHE) + /* Res #MEM-4 -- cpu read buffer to buffer 1 */ + if ((mv64x60_read(bh, MV64x60_CPU_MODE) & 0xf0) == 0x40) + mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26)); + save_exclude = mv64x60_pci_exclude_bridge; - mv64x60_pci_exclude_bridge = FALSE; - - early_read_config_dword(bh->hose_a, - bh->hose_a->first_busno, - PCI_DEVFN(0,0), - PCI_COMMAND, - &val); - val |= PCI_COMMAND_INVALIDATE; - early_write_config_dword(bh->hose_a, - bh->hose_a->first_busno, - PCI_DEVFN(0,0), - PCI_COMMAND, - val); - - early_read_config_dword(bh->hose_b, - bh->hose_b->first_busno, - PCI_DEVFN(0,0), - PCI_COMMAND, - &val); - val |= PCI_COMMAND_INVALIDATE; - early_write_config_dword(bh->hose_b, - bh->hose_b->first_busno, - PCI_DEVFN(0,0), - PCI_COMMAND, - val); + mv64x60_pci_exclude_bridge = 0; + if (si->pci_0.enable_bus) { + early_read_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0), + PCI_COMMAND, &val); + val |= PCI_COMMAND_INVALIDATE; + early_write_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0), + PCI_COMMAND, val); + } + if (si->pci_1.enable_bus) { + early_read_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0), + PCI_COMMAND, &val); + val |= PCI_COMMAND_INVALIDATE; + early_write_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0), + PCI_COMMAND, val); + } mv64x60_pci_exclude_bridge = save_exclude; #endif - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 0)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->mirror_regs = 1; - mpsc_dp->cache_mgmt = 1; - } + /* Disable buffer/descriptor snooping */ + mv64x60_clr_bits(bh, 0xf280, (1<< 6) | (1<<14) | (1<<22) | (1<<30)); + mv64x60_clr_bits(bh, 0xf2c0, (1<< 6) | (1<<14) | (1<<22) | (1<<30)); + +#ifdef CONFIG_SERIAL_MPSC + mv64x60_mpsc0_pdata.mirror_regs = 1; + mv64x60_mpsc0_pdata.cache_mgmt = 1; + mv64x60_mpsc1_pdata.mirror_regs = 1; + mv64x60_mpsc1_pdata.cache_mgmt = 1; - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 1)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->mirror_regs = 1; - mpsc_dp->cache_mgmt = 1; + if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0)) + != NULL) { + + r->start = MV64x60_IRQ_SDMA_0; + r->end = MV64x60_IRQ_SDMA_0; } +#endif return; } @@ -2531,49 +1797,77 @@ gt64260a_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) * * Implement errata work arounds for the GT64260B. */ -static void -gt64260b_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +static void __init +gt64260b_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) { - struct ocp_device *dev; - mv64x60_ocp_mpsc_data_t *mpsc_dp; - - /* R#18 */ - /* cpu read buffer to buffer 1 (reg 0x0448) */ - mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26)); - - /* No longer errata so turn on */ - /* Enable pci read/write combine, master write trigger, - * disable slave sync barrier - * readmultiple (reg 0x0c00 and 0x0c80) - */ - if (si->pci_0.enable_bus) { +#ifdef CONFIG_SERIAL_MPSC + struct resource *r; +#endif +#if !defined(CONFIG_NOT_COHERENT_CACHE) + u32 val; + u8 save_exclude; +#endif + + if (si->pci_0.enable_bus) mv64x60_set_bits(bh, MV64x60_PCI0_CMD, ((1<<4) | (1<<5) | (1<<9) | (1<<13))); - } - if (si->pci_1.enable_bus) { + if (si->pci_1.enable_bus) mv64x60_set_bits(bh, MV64x60_PCI1_CMD, ((1<<4) | (1<<5) | (1<<9) | (1<<13))); - } + /* + * Dave Wilhardt found that bit 4 in the PCI Command registers must + * be set if you are using cache coherency. + */ +#if !defined(CONFIG_NOT_COHERENT_CACHE) mv64x60_set_bits(bh, GT64260_CPU_WB_PRIORITY_BUFFER_DEPTH, 0xf); + /* Res #MEM-4 -- cpu read buffer to buffer 1 */ + if ((mv64x60_read(bh, MV64x60_CPU_MODE) & 0xf0) == 0x40) + mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26)); + + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + if (si->pci_0.enable_bus) { + early_read_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0), + PCI_COMMAND, &val); + val |= PCI_COMMAND_INVALIDATE; + early_write_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0), + PCI_COMMAND, val); + } + + if (si->pci_1.enable_bus) { + early_read_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0), + PCI_COMMAND, &val); + val |= PCI_COMMAND_INVALIDATE; + early_write_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0), + PCI_COMMAND, val); + } + mv64x60_pci_exclude_bridge = save_exclude; +#endif + + /* Disable buffer/descriptor snooping */ + mv64x60_clr_bits(bh, 0xf280, (1<< 6) | (1<<14) | (1<<22) | (1<<30)); + mv64x60_clr_bits(bh, 0xf2c0, (1<< 6) | (1<<14) | (1<<22) | (1<<30)); + +#ifdef CONFIG_SERIAL_MPSC /* * The 64260B is not supposed to have the bug where the MPSC & ENET * can't access cache coherent regions. However, testing has shown * that the MPSC, at least, still has this bug. */ - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 0)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->cache_mgmt = 1; - } + mv64x60_mpsc0_pdata.cache_mgmt = 1; + mv64x60_mpsc1_pdata.cache_mgmt = 1; - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 1)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->cache_mgmt = 1; + if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0)) + != NULL) { + + r->start = MV64x60_IRQ_SDMA_0; + r->end = MV64x60_IRQ_SDMA_0; } +#endif return; } @@ -2622,26 +1916,64 @@ mv64360_untranslate_size(u32 base_addr, u32 size, u32 num_bits) * The PCI->MEM window registers are actually in PCI config space so need * to set them by setting the correct config space BARs. */ +struct { + u32 fcn; + u32 base_hi_bar; + u32 base_lo_bar; +} static mv64360_reg_addrs[2][4] __initdata = { + {{ 0, 0x14, 0x10 }, { 0, 0x1c, 0x18 }, + { 1, 0x14, 0x10 }, { 1, 0x1c, 0x18 }}, + {{ 0, 0x94, 0x90 }, { 0, 0x9c, 0x98 }, + { 1, 0x94, 0x90 }, { 1, 0x9c, 0x98 }} +}; + static void __init -mv64360_set_pci2mem_window(struct pci_controller *hose, u32 window, u32 base) +mv64360_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window, + u32 base) { - struct { - u32 fcn; - u32 base_hi_bar; - u32 base_lo_bar; - } reg_addrs[] = {{ 0, 0x14, 0x10 }, { 0, 0x1c, 0x18 }, - { 1, 0x14, 0x10 }, { 1, 0x1c, 0x18 }}; - - DBG("set pci->mem window: %d, hose: %d, base: 0x%x\n", window, + u8 save_exclude; + + pr_debug("set pci->mem window: %d, hose: %d, base: 0x%x\n", window, hose->index, base); - early_write_config_dword(hose, hose->first_busno, - PCI_DEVFN(0, reg_addrs[window].fcn), - reg_addrs[window].base_hi_bar, 0); - early_write_config_dword(hose, hose->first_busno, - PCI_DEVFN(0, reg_addrs[window].fcn), - reg_addrs[window].base_lo_bar, - mv64x60_mask(base, 20) | 0xc); + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + early_write_config_dword(hose, 0, + PCI_DEVFN(0, mv64360_reg_addrs[bus][window].fcn), + mv64360_reg_addrs[bus][window].base_hi_bar, 0); + early_write_config_dword(hose, 0, + PCI_DEVFN(0, mv64360_reg_addrs[bus][window].fcn), + mv64360_reg_addrs[bus][window].base_lo_bar, + mv64x60_mask(base,20) | 0xc); + mv64x60_pci_exclude_bridge = save_exclude; + + return; +} + +/* + * mv64360_set_pci2regs_window() + * + * Set where the bridge's registers appear in PCI MEM space. + */ +static u32 mv64360_offset[2][2] __initdata = {{0x20, 0x24}, {0xa0, 0xa4}}; + +static void __init +mv64360_set_pci2regs_window(struct mv64x60_handle *bh, + struct pci_controller *hose, u32 bus, u32 base) +{ + u8 save_exclude; + + pr_debug("set pci->internal regs hose: %d, base: 0x%x\n", hose->index, + base); + + save_exclude = mv64x60_pci_exclude_bridge; + mv64x60_pci_exclude_bridge = 0; + early_write_config_dword(hose, 0, PCI_DEVFN(0,0), + mv64360_offset[bus][0], (base << 16)); + early_write_config_dword(hose, 0, PCI_DEVFN(0,0), + mv64360_offset[bus][1], 0); + mv64x60_pci_exclude_bridge = save_exclude; + return; } @@ -2654,30 +1986,47 @@ mv64360_set_pci2mem_window(struct pci_controller *hose, u32 window, u32 base) * check those so its okay. */ static u32 __init -mv64360_is_enabled_32bit(mv64x60_handle_t *bh, u32 window) +mv64360_is_enabled_32bit(struct mv64x60_handle *bh, u32 window) { - u32 rc = 0; + u32 extra, rc = 0; + + if (((mv64360_32bit_windows[window].base_reg != 0) && + (mv64360_32bit_windows[window].size_reg != 0)) || + (window == MV64x60_CPU2SRAM_WIN)) { - if ((mv64360_32bit_windows[window].base_reg != 0) && - (mv64360_32bit_windows[window].size_reg != 0)) { + extra = mv64360_32bit_windows[window].extra; - if (mv64360_32bit_windows[window].extra & 0x80000000) { + switch (extra & MV64x60_EXTRA_MASK) { + case MV64x60_EXTRA_CPUWIN_ENAB: + rc = (mv64x60_read(bh, MV64360_CPU_BAR_ENABLE) & + (1 << (extra & 0x1f))) == 0; + break; + + case MV64x60_EXTRA_CPUPROT_ENAB: rc = (mv64x60_read(bh, - mv64360_32bit_windows[window].base_reg) & - (1 << (mv64360_32bit_windows[window].extra & - 0xff))) != 0; - } - else { - rc = (mv64x60_read(bh, MV64360_CPU_BAR_ENABLE) & - (1 << mv64360_32bit_windows[window].extra)) ==0; - } - } + mv64360_32bit_windows[window].base_reg) & + (1 << (extra & 0x1f))) != 0; + break; - if (rc) { - DBG("32bit window %d is enabled\n", window); - } - else { - DBG("32bit window %d is disabled\n", window); + case MV64x60_EXTRA_ENET_ENAB: + rc = (mv64x60_read(bh, MV64360_ENET2MEM_BAR_ENABLE) & + (1 << (extra & 0x7))) == 0; + break; + + case MV64x60_EXTRA_MPSC_ENAB: + rc = (mv64x60_read(bh, MV64360_MPSC2MEM_BAR_ENABLE) & + (1 << (extra & 0x3))) == 0; + break; + + case MV64x60_EXTRA_IDMA_ENAB: + rc = (mv64x60_read(bh, MV64360_IDMA2MEM_BAR_ENABLE) & + (1 << (extra & 0x7))) == 0; + break; + + default: + printk(KERN_ERR "mv64360_is_enabled: %s\n", + "32bit table corrupted"); + } } return rc; @@ -2690,22 +2039,48 @@ mv64360_is_enabled_32bit(mv64x60_handle_t *bh, u32 window) * CPU BAR Enable reg or setting a bit in the window's base reg. */ static void __init -mv64360_enable_window_32bit(mv64x60_handle_t *bh, u32 window) +mv64360_enable_window_32bit(struct mv64x60_handle *bh, u32 window) { - DBG("enable 32bit window: %d\n", window); + u32 extra; + + pr_debug("enable 32bit window: %d\n", window); + + if (((mv64360_32bit_windows[window].base_reg != 0) && + (mv64360_32bit_windows[window].size_reg != 0)) || + (window == MV64x60_CPU2SRAM_WIN)) { + + extra = mv64360_32bit_windows[window].extra; - if ((mv64360_32bit_windows[window].base_reg != 0) && - (mv64360_32bit_windows[window].size_reg != 0)) { + switch (extra & MV64x60_EXTRA_MASK) { + case MV64x60_EXTRA_CPUWIN_ENAB: + mv64x60_clr_bits(bh, MV64360_CPU_BAR_ENABLE, + (1 << (extra & 0x1f))); + break; - if (mv64360_32bit_windows[window].extra & 0x80000000) { + case MV64x60_EXTRA_CPUPROT_ENAB: mv64x60_set_bits(bh, mv64360_32bit_windows[window].base_reg, - (1 << (mv64360_32bit_windows[window].extra & - 0xff))); - } - else { - mv64x60_clr_bits(bh, MV64360_CPU_BAR_ENABLE, - (1 << mv64360_32bit_windows[window].extra)); + (1 << (extra & 0x1f))); + break; + + case MV64x60_EXTRA_ENET_ENAB: + mv64x60_clr_bits(bh, MV64360_ENET2MEM_BAR_ENABLE, + (1 << (extra & 0x7))); + break; + + case MV64x60_EXTRA_MPSC_ENAB: + mv64x60_clr_bits(bh, MV64360_MPSC2MEM_BAR_ENABLE, + (1 << (extra & 0x3))); + break; + + case MV64x60_EXTRA_IDMA_ENAB: + mv64x60_clr_bits(bh, MV64360_IDMA2MEM_BAR_ENABLE, + (1 << (extra & 0x7))); + break; + + default: + printk(KERN_ERR "mv64360_enable: %s\n", + "32bit table corrupted"); } } @@ -2719,24 +2094,50 @@ mv64360_enable_window_32bit(mv64x60_handle_t *bh, u32 window) * CPU BAR Enable reg or clearing a bit in the window's base reg. */ static void __init -mv64360_disable_window_32bit(mv64x60_handle_t *bh, u32 window) +mv64360_disable_window_32bit(struct mv64x60_handle *bh, u32 window) { - DBG("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", + u32 extra; + + pr_debug("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", window, mv64360_32bit_windows[window].base_reg, mv64360_32bit_windows[window].size_reg); - if ((mv64360_32bit_windows[window].base_reg != 0) && - (mv64360_32bit_windows[window].size_reg != 0)) { + if (((mv64360_32bit_windows[window].base_reg != 0) && + (mv64360_32bit_windows[window].size_reg != 0)) || + (window == MV64x60_CPU2SRAM_WIN)) { + + extra = mv64360_32bit_windows[window].extra; - if (mv64360_32bit_windows[window].extra & 0x80000000) { + switch (extra & MV64x60_EXTRA_MASK) { + case MV64x60_EXTRA_CPUWIN_ENAB: + mv64x60_set_bits(bh, MV64360_CPU_BAR_ENABLE, + (1 << (extra & 0x1f))); + break; + + case MV64x60_EXTRA_CPUPROT_ENAB: mv64x60_clr_bits(bh, mv64360_32bit_windows[window].base_reg, - (1 << (mv64360_32bit_windows[window].extra & - 0xff))); - } - else { - mv64x60_set_bits(bh, MV64360_CPU_BAR_ENABLE, - (1 << mv64360_32bit_windows[window].extra)); + (1 << (extra & 0x1f))); + break; + + case MV64x60_EXTRA_ENET_ENAB: + mv64x60_set_bits(bh, MV64360_ENET2MEM_BAR_ENABLE, + (1 << (extra & 0x7))); + break; + + case MV64x60_EXTRA_MPSC_ENAB: + mv64x60_set_bits(bh, MV64360_MPSC2MEM_BAR_ENABLE, + (1 << (extra & 0x3))); + break; + + case MV64x60_EXTRA_IDMA_ENAB: + mv64x60_set_bits(bh, MV64360_IDMA2MEM_BAR_ENABLE, + (1 << (extra & 0x7))); + break; + + default: + printk(KERN_ERR "mv64360_disable: %s\n", + "32bit table corrupted"); } } @@ -2746,24 +2147,27 @@ mv64360_disable_window_32bit(mv64x60_handle_t *bh, u32 window) /* * mv64360_enable_window_64bit() * - * On the MV64360, a 64-bit window is enabled by setting a bit in the window's + * On the MV64360, a 64-bit window is enabled by setting a bit in the window's * base reg. */ static void __init -mv64360_enable_window_64bit(mv64x60_handle_t *bh, u32 window) +mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window) { - DBG("enable 64bit window: %d\n", window); + pr_debug("enable 64bit window: %d\n", window); - /* For 64360, 'extra' field holds bit that enables the window */ if ((mv64360_64bit_windows[window].base_lo_reg!= 0) && (mv64360_64bit_windows[window].size_reg != 0)) { - if (mv64360_64bit_windows[window].extra & 0x80000000) { + if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK) + == MV64x60_EXTRA_PCIACC_ENAB) + mv64x60_set_bits(bh, mv64360_64bit_windows[window].base_lo_reg, (1 << (mv64360_64bit_windows[window].extra & - 0xff))); - } /* Should be no 'else' ones */ + 0x1f))); + else + printk(KERN_ERR "mv64360_enable: %s\n", + "64bit table corrupted"); } return; @@ -2776,21 +2180,25 @@ mv64360_enable_window_64bit(mv64x60_handle_t *bh, u32 window) * base reg. */ static void __init -mv64360_disable_window_64bit(mv64x60_handle_t *bh, u32 window) +mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window) { - DBG("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", + pr_debug("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n", window, mv64360_64bit_windows[window].base_lo_reg, mv64360_64bit_windows[window].size_reg); if ((mv64360_64bit_windows[window].base_lo_reg != 0) && (mv64360_64bit_windows[window].size_reg != 0)) { - if (mv64360_64bit_windows[window].extra & 0x80000000) { + if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK) + == MV64x60_EXTRA_PCIACC_ENAB) + mv64x60_clr_bits(bh, mv64360_64bit_windows[window].base_lo_reg, (1 << (mv64360_64bit_windows[window].extra & - 0xff))); - } /* Should be no 'else' ones */ + 0x1f))); + else + printk(KERN_ERR "mv64360_disable: %s\n", + "64bit table corrupted"); } return; @@ -2804,21 +2212,26 @@ mv64360_disable_window_64bit(mv64x60_handle_t *bh, u32 window) * except for the memory controller windows, of course. */ static void __init -mv64360_disable_all_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +mv64360_disable_all_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) { - u32 i; + u32 preserve, i; /* Disable 32bit windows (don't disable cpu->mem windows) */ for (i=MV64x60_CPU2DEV_0_WIN; iwindow_preserve_mask_32 & (1<window_preserve_mask_32_lo & (1 << i); + else + preserve = si->window_preserve_mask_32_hi & (1<<(i-32)); + + if (!preserve) mv64360_disable_window_32bit(bh, i); } /* Disable 64bit windows */ - for (i=0; iwindow_preserve_mask_64 & (1<MEM access cntl wins not in mv64360_64bit_windows[] */ mv64x60_clr_bits(bh, MV64x60_PCI0_ACC_CNTL_4_BASE_LO, 0); @@ -2834,27 +2247,130 @@ mv64360_disable_all_windows(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) } /* - * mv64360_chip_specific_init() + * mv64360_config_io2mem_windows() * - * No errata work arounds for the MV64360 implemented at this point. + * ENET, MPSC, and IDMA ctlrs on the MV64[34]60 have separate windows that + * must be set up so that the respective ctlr can access system memory. */ -static void -mv64360_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +static u32 enet_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = { + MV64x60_ENET2MEM_0_WIN, MV64x60_ENET2MEM_1_WIN, + MV64x60_ENET2MEM_2_WIN, MV64x60_ENET2MEM_3_WIN, +}; + +static u32 mpsc_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = { + MV64x60_MPSC2MEM_0_WIN, MV64x60_MPSC2MEM_1_WIN, + MV64x60_MPSC2MEM_2_WIN, MV64x60_MPSC2MEM_3_WIN, +}; + +static u32 idma_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = { + MV64x60_IDMA2MEM_0_WIN, MV64x60_IDMA2MEM_1_WIN, + MV64x60_IDMA2MEM_2_WIN, MV64x60_IDMA2MEM_3_WIN, +}; + +static u32 dram_selects[MV64x60_CPU2MEM_WINDOWS] __initdata = + { 0xe, 0xd, 0xb, 0x7 }; + +static void __init +mv64360_config_io2mem_windows(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si, + u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]) { - struct ocp_device *dev; - mv64x60_ocp_mpsc_data_t *mpsc_dp; + u32 i, win; - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 0)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->brg_can_tune = 1; - } + pr_debug("config_io2regs_windows: enet, mpsc, idma -> bridge regs\n"); - if ((dev = ocp_find_device(OCP_VENDOR_MARVELL, OCP_FUNC_MPSC, 1)) - != NULL) { - mpsc_dp = (mv64x60_ocp_mpsc_data_t *)dev->def->additions; - mpsc_dp->brg_can_tune = 1; - } + mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_0, 0); + mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_1, 0); + mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_2, 0); + + mv64x60_write(bh, MV64360_MPSC2MEM_ACC_PROT_0, 0); + mv64x60_write(bh, MV64360_MPSC2MEM_ACC_PROT_1, 0); + + mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_0, 0); + mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_1, 0); + mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_2, 0); + mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_3, 0); + + /* Assume that mem ctlr has no more windows than embedded I/O ctlr */ + for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++) + if (bh->ci->is_enabled_32bit(bh, win)) { + mv64x60_set_32bit_window(bh, enet_tab[i], + mem_windows[i][0], mem_windows[i][1], + (dram_selects[i] << 8) | + (si->enet_options[i] & 0x3000)); + bh->ci->enable_window_32bit(bh, enet_tab[i]); + + /* Give enet r/w access to memory region */ + mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_0, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_1, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_2, + (0x3 << (i << 1))); + + mv64x60_set_32bit_window(bh, mpsc_tab[i], + mem_windows[i][0], mem_windows[i][1], + (dram_selects[i] << 8) | + (si->mpsc_options[i] & 0x3000)); + bh->ci->enable_window_32bit(bh, mpsc_tab[i]); + + /* Give mpsc r/w access to memory region */ + mv64x60_set_bits(bh, MV64360_MPSC2MEM_ACC_PROT_0, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_MPSC2MEM_ACC_PROT_1, + (0x3 << (i << 1))); + + mv64x60_set_32bit_window(bh, idma_tab[i], + mem_windows[i][0], mem_windows[i][1], + (dram_selects[i] << 8) | + (si->idma_options[i] & 0x3000)); + bh->ci->enable_window_32bit(bh, idma_tab[i]); + + /* Give idma r/w access to memory region */ + mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_0, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_1, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_2, + (0x3 << (i << 1))); + mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_3, + (0x3 << (i << 1))); + } + + return; +} + +/* + * mv64360_set_mpsc2regs_window() + * + * MPSC has a window to the bridge's internal registers. Call this routine + * to change that window so it doesn't conflict with the windows mapping the + * mpsc to system memory. + */ +static void __init +mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base) +{ + pr_debug("set mpsc->internal regs, base: 0x%x\n", base); + + mv64x60_write(bh, MV64360_MPSC2REGS_BASE, base & 0xffff0000); + return; +} + +/* + * mv64360_chip_specific_init() + * + * No errata work arounds for the MV64360 implemented at this point. + */ +static void __init +mv64360_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) +{ +#ifdef CONFIG_SERIAL_MPSC + mv64x60_mpsc0_pdata.brg_can_tune = 1; + mv64x60_mpsc0_pdata.cache_mgmt = 1; + mv64x60_mpsc1_pdata.brg_can_tune = 1; + mv64x60_mpsc1_pdata.cache_mgmt = 1; +#endif return; } @@ -2864,9 +2380,13 @@ mv64360_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) * * No errata work arounds for the MV64460 implemented at this point. */ -static void -mv64460_chip_specific_init(mv64x60_handle_t *bh, mv64x60_setup_info_t *si) +static void __init +mv64460_chip_specific_init(struct mv64x60_handle *bh, + struct mv64x60_setup_info *si) { - mv64360_chip_specific_init(bh, si); /* XXXX check errata */ +#ifdef CONFIG_SERIAL_MPSC + mv64x60_mpsc0_pdata.brg_can_tune = 1; + mv64x60_mpsc1_pdata.brg_can_tune = 1; +#endif return; } diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c index 133797ab3..406f36a8a 100644 --- a/arch/ppc/syslib/open_pic.c +++ b/arch/ppc/syslib/open_pic.c @@ -32,8 +32,8 @@ #define OPENPIC_BIG_ENDIAN #endif -void* OpenPIC_Addr; -static volatile struct OpenPIC *OpenPIC = NULL; +void __iomem *OpenPIC_Addr; +static volatile struct OpenPIC __iomem *OpenPIC = NULL; /* * We define OpenPIC_InitSenses table thusly: @@ -47,13 +47,12 @@ extern int use_of_interrupt_tree; static u_int NumProcessors; static u_int NumSources; static int open_pic_irq_offset; -static volatile OpenPIC_Source *ISR[NR_IRQS]; +static volatile OpenPIC_Source __iomem *ISR[NR_IRQS]; static int openpic_cascade_irq = -1; static int (*openpic_cascade_fn)(struct pt_regs *); /* Global Operations */ static void openpic_disable_8259_pass_through(void); -static void openpic_set_priority(u_int pri); static void openpic_set_spurious(u_int vector); #ifdef CONFIG_SMP @@ -164,7 +163,7 @@ struct hw_interrupt_type open_pic_ipi = { #define check_arg_cpu(cpu) do {} while (0) #endif -u_int openpic_read(volatile u_int *addr) +u_int openpic_read(volatile u_int __iomem *addr) { u_int val; @@ -176,7 +175,7 @@ u_int openpic_read(volatile u_int *addr) return val; } -static inline void openpic_write(volatile u_int *addr, u_int val) +static inline void openpic_write(volatile u_int __iomem *addr, u_int val) { #ifdef OPENPIC_BIG_ENDIAN out_be32(addr, val); @@ -185,30 +184,30 @@ static inline void openpic_write(volatile u_int *addr, u_int val) #endif } -static inline u_int openpic_readfield(volatile u_int *addr, u_int mask) +static inline u_int openpic_readfield(volatile u_int __iomem *addr, u_int mask) { u_int val = openpic_read(addr); return val & mask; } -inline void openpic_writefield(volatile u_int *addr, u_int mask, +inline void openpic_writefield(volatile u_int __iomem *addr, u_int mask, u_int field) { u_int val = openpic_read(addr); openpic_write(addr, (val & ~mask) | (field & mask)); } -static inline void openpic_clearfield(volatile u_int *addr, u_int mask) +static inline void openpic_clearfield(volatile u_int __iomem *addr, u_int mask) { openpic_writefield(addr, mask, 0); } -static inline void openpic_setfield(volatile u_int *addr, u_int mask) +static inline void openpic_setfield(volatile u_int __iomem *addr, u_int mask) { openpic_writefield(addr, mask, mask); } -static void openpic_safe_writefield(volatile u_int *addr, u_int mask, +static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask, u_int field) { openpic_setfield(addr, OPENPIC_MASK); @@ -218,7 +217,7 @@ static void openpic_safe_writefield(volatile u_int *addr, u_int mask, #ifdef CONFIG_SMP /* yes this is right ... bug, feature, you decide! -- tgall */ -u_int openpic_read_IPI(volatile u_int* addr) +u_int openpic_read_IPI(volatile u_int __iomem * addr) { u_int val = 0; #if defined(OPENPIC_BIG_ENDIAN) || defined(CONFIG_POWER3) @@ -230,23 +229,23 @@ u_int openpic_read_IPI(volatile u_int* addr) } /* because of the power3 be / le above, this is needed */ -inline void openpic_writefield_IPI(volatile u_int* addr, u_int mask, u_int field) +inline void openpic_writefield_IPI(volatile u_int __iomem * addr, u_int mask, u_int field) { u_int val = openpic_read_IPI(addr); openpic_write(addr, (val & ~mask) | (field & mask)); } -static inline void openpic_clearfield_IPI(volatile u_int *addr, u_int mask) +static inline void openpic_clearfield_IPI(volatile u_int __iomem *addr, u_int mask) { openpic_writefield_IPI(addr, mask, 0); } -static inline void openpic_setfield_IPI(volatile u_int *addr, u_int mask) +static inline void openpic_setfield_IPI(volatile u_int __iomem *addr, u_int mask) { openpic_writefield_IPI(addr, mask, mask); } -static void openpic_safe_writefield_IPI(volatile u_int *addr, u_int mask, u_int field) +static void openpic_safe_writefield_IPI(volatile u_int __iomem *addr, u_int mask, u_int field) { openpic_setfield_IPI(addr, OPENPIC_MASK); @@ -261,6 +260,9 @@ static void openpic_safe_writefield_IPI(volatile u_int *addr, u_int mask, u_int #endif /* CONFIG_SMP */ #ifdef CONFIG_EPIC_SERIAL_MODE +/* On platforms that may use EPIC serial mode, the default is enabled. */ +int epic_serial_mode = 1; + static void __init openpic_eicr_set_clk(u_int clkval) { openpic_writefield(&OpenPIC->Global.Global_Configuration1, @@ -285,16 +287,16 @@ static void openpic_reset(void) } #endif -void __init openpic_set_sources(int first_irq, int num_irqs, void *first_ISR) +void __init openpic_set_sources(int first_irq, int num_irqs, void __iomem *first_ISR) { - volatile OpenPIC_Source *src = first_ISR; + volatile OpenPIC_Source __iomem *src = first_ISR; int i, last_irq; last_irq = first_irq + num_irqs; if (last_irq > NumSources) NumSources = last_irq; if (src == 0) - src = &((struct OpenPIC *)OpenPIC_Addr)->Source[first_irq]; + src = &((struct OpenPIC __iomem *)OpenPIC_Addr)->Source[first_irq]; for (i = first_irq; i < last_irq; ++i, ++src) ISR[i] = src; } @@ -316,7 +318,7 @@ void __init openpic_init(int offset) printk("No OpenPIC found !\n"); return; } - OpenPIC = (volatile struct OpenPIC *)OpenPIC_Addr; + OpenPIC = (volatile struct OpenPIC __iomem *)OpenPIC_Addr; #ifdef CONFIG_EPIC_SERIAL_MODE /* Have to start from ground zero. @@ -415,8 +417,10 @@ void __init openpic_init(int offset) openpic_set_spurious(OPENPIC_VEC_SPURIOUS); openpic_disable_8259_pass_through(); #ifdef CONFIG_EPIC_SERIAL_MODE - openpic_eicr_set_clk(7); /* Slowest value until we know better */ - openpic_enable_sie(); + if (epic_serial_mode) { + openpic_eicr_set_clk(7); /* Slowest value until we know better */ + openpic_enable_sie(); + } #endif openpic_set_priority(0); @@ -472,7 +476,7 @@ static u_int openpic_get_priority(void) } #endif /* notused */ -static void __init openpic_set_priority(u_int pri) +void openpic_set_priority(u_int pri) { DECL_THIS_CPU; @@ -527,7 +531,7 @@ void openpic_reset_processor_phys(u_int mask) } #if defined(CONFIG_SMP) || defined(CONFIG_PM) -static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(openpic_setup_lock); #endif #ifdef CONFIG_SMP @@ -681,13 +685,21 @@ openpic_init_nmi_irq(u_int irq) /* * Hookup a cascade to the OpenPIC. */ + +static struct irqaction openpic_cascade_irqaction = { + .handler = no_action, + .flags = SA_INTERRUPT, + .mask = CPU_MASK_NONE, +}; + void __init openpic_hookup_cascade(u_int irq, char *name, int (*cascade_fn)(struct pt_regs *)) { openpic_cascade_irq = irq; openpic_cascade_fn = cascade_fn; - if (request_irq(irq, no_action, SA_INTERRUPT, name, NULL)) + + if (setup_irq(irq, &openpic_cascade_irqaction)) printk("Unable to get OpenPIC IRQ %d for cascade\n", irq - open_pic_irq_offset); } @@ -699,7 +711,7 @@ openpic_hookup_cascade(u_int irq, char *name, */ static void openpic_enable_irq(u_int irq) { - volatile u_int *vpp; + volatile u_int __iomem *vpp; check_arg_irq(irq); vpp = &ISR[irq - open_pic_irq_offset]->Vector_Priority; @@ -712,7 +724,7 @@ static void openpic_enable_irq(u_int irq) static void openpic_disable_irq(u_int irq) { - volatile u_int *vpp; + volatile u_int __iomem *vpp; u32 vp; check_arg_irq(irq); @@ -942,6 +954,8 @@ int openpic_suspend(struct sys_device *sysdev, u32 state) return 0; } + openpic_set_priority(0xf); + open_pic.enable = openpic_cached_enable_irq; open_pic.disable = openpic_cached_disable_irq; @@ -1015,6 +1029,8 @@ int openpic_resume(struct sys_device *sysdev) open_pic.enable = openpic_enable_irq; open_pic.disable = openpic_disable_irq; + openpic_set_priority(0); + spin_unlock_irqrestore(&openpic_setup_lock, flags); return 0; diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c index 191e5af0e..ea26da0d8 100644 --- a/arch/ppc/syslib/open_pic2.c +++ b/arch/ppc/syslib/open_pic2.c @@ -386,7 +386,7 @@ static void openpic2_set_spurious(u_int vec) vec); } -static spinlock_t openpic2_setup_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(openpic2_setup_lock); /* * Initialize a timer interrupt (and disable it) diff --git a/arch/ppc/syslib/open_pic_defs.h b/arch/ppc/syslib/open_pic_defs.h index e4cc2707b..4f05624b2 100644 --- a/arch/ppc/syslib/open_pic_defs.h +++ b/arch/ppc/syslib/open_pic_defs.h @@ -172,7 +172,7 @@ struct OpenPIC { OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS]; }; -extern volatile struct OpenPIC *OpenPIC; +extern volatile struct OpenPIC __iomem *OpenPIC; /* diff --git a/arch/ppc/syslib/ppc405_pci.c b/arch/ppc/syslib/ppc405_pci.c index 7f94bdf39..81c83bf98 100644 --- a/arch/ppc/syslib/ppc405_pci.c +++ b/arch/ppc/syslib/ppc405_pci.c @@ -82,8 +82,8 @@ ppc4xx_find_bridges(void) unsigned int tmp_addr; unsigned int tmp_size; unsigned int reg_index; - unsigned int new_pmm_max; - unsigned int new_pmm_min; + unsigned int new_pmm_max = 0; + unsigned int new_pmm_min = 0; isa_io_base = 0; isa_mem_base = 0; diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c index b2f3d8505..5015ab99a 100644 --- a/arch/ppc/syslib/ppc4xx_dma.c +++ b/arch/ppc/syslib/ppc4xx_dma.c @@ -48,7 +48,7 @@ ppc4xx_set_src_addr(int dmanr, phys_addr_t src_addr) return; } -#ifdef PPC4xx_DMA64BIT +#ifdef PPC4xx_DMA_64BIT mtdcr(DCRN_DMASAH0 + dmanr*2, (u32)(src_addr >> 32)); #else mtdcr(DCRN_DMASA0 + dmanr*2, (u32)src_addr); @@ -63,7 +63,7 @@ ppc4xx_set_dst_addr(int dmanr, phys_addr_t dst_addr) return; } -#ifdef PPC4xx_DMA64BIT +#ifdef PPC4xx_DMA_64BIT mtdcr(DCRN_DMADAH0 + dmanr*2, (u32)(dst_addr >> 32)); #else mtdcr(DCRN_DMADA0 + dmanr*2, (u32)dst_addr); @@ -466,7 +466,7 @@ ppc4xx_init_dma_channel(unsigned int dmanr, ppc_dma_ch_t * p_init) /* clear all polarity signals and then "or" in new signal levels */ polarity &= ~GET_DMA_POLARITY(dmanr); - polarity |= p_dma_ch->polarity; + polarity |= p_init->polarity; #if DCRN_POL > 0 mtdcr(DCRN_POL, polarity); #endif @@ -512,6 +512,8 @@ ppc4xx_get_channel_config(unsigned int dmanr, ppc_dma_ch_t * p_dma_ch) return DMA_STATUS_BAD_CHANNEL; } + memcpy(p_dma_ch, &dma_channels[dmanr], sizeof (ppc_dma_ch_t)); + #if DCRN_POL > 0 polarity = mfdcr(DCRN_POL); #else @@ -604,6 +606,84 @@ ppc4xx_get_peripheral_width(unsigned int dmanr) return (GET_DMA_PW(control)); } +/* + * Clears the channel status bits + */ +int +ppc4xx_clr_dma_status(unsigned int dmanr) +{ + if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) { + printk(KERN_ERR "ppc4xx_clr_dma_status: bad channel: %d\n", dmanr); + return DMA_STATUS_BAD_CHANNEL; + } + mtdcr(DCRN_DMASR, ((u32)DMA_CH0_ERR | (u32)DMA_CS0 | (u32)DMA_TS0) >> dmanr); + return DMA_STATUS_GOOD; +} + +/* + * Enables the burst on the channel (BTEN bit in the control/count register) + * Note: + * For scatter/gather dma, this function MUST be called before the + * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the + * sgl list and used as each sgl element is added. + */ +int +ppc4xx_enable_burst(unsigned int dmanr) +{ + unsigned int ctc; + if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) { + printk(KERN_ERR "ppc4xx_enable_burst: bad channel: %d\n", dmanr); + return DMA_STATUS_BAD_CHANNEL; + } + ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) | DMA_CTC_BTEN; + mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc); + return DMA_STATUS_GOOD; +} +/* + * Disables the burst on the channel (BTEN bit in the control/count register) + * Note: + * For scatter/gather dma, this function MUST be called before the + * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the + * sgl list and used as each sgl element is added. + */ +int +ppc4xx_disable_burst(unsigned int dmanr) +{ + unsigned int ctc; + if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) { + printk(KERN_ERR "ppc4xx_disable_burst: bad channel: %d\n", dmanr); + return DMA_STATUS_BAD_CHANNEL; + } + ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) &~ DMA_CTC_BTEN; + mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc); + return DMA_STATUS_GOOD; +} +/* + * Sets the burst size (number of peripheral widths) for the channel + * (BSIZ bits in the control/count register)) + * must be one of: + * DMA_CTC_BSIZ_2 + * DMA_CTC_BSIZ_4 + * DMA_CTC_BSIZ_8 + * DMA_CTC_BSIZ_16 + * Note: + * For scatter/gather dma, this function MUST be called before the + * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the + * sgl list and used as each sgl element is added. + */ +int +ppc4xx_set_burst_size(unsigned int dmanr, unsigned int bsize) +{ + unsigned int ctc; + if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) { + printk(KERN_ERR "ppc4xx_set_burst_size: bad channel: %d\n", dmanr); + return DMA_STATUS_BAD_CHANNEL; + } + ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) &~ DMA_CTC_BSIZ_MSK; + ctc |= (bsize & DMA_CTC_BSIZ_MSK); + mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc); + return DMA_STATUS_GOOD; +} EXPORT_SYMBOL(ppc4xx_init_dma_channel); EXPORT_SYMBOL(ppc4xx_get_channel_config); @@ -622,3 +702,7 @@ EXPORT_SYMBOL(ppc4xx_get_dma_residue); EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt); EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); EXPORT_SYMBOL(ppc4xx_get_dma_status); +EXPORT_SYMBOL(ppc4xx_clr_dma_status); +EXPORT_SYMBOL(ppc4xx_enable_burst); +EXPORT_SYMBOL(ppc4xx_disable_burst); +EXPORT_SYMBOL(ppc4xx_set_burst_size); diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c index 2dc63a58c..4ac2de28c 100644 --- a/arch/ppc/syslib/ppc4xx_pic.c +++ b/arch/ppc/syslib/ppc4xx_pic.c @@ -1,31 +1,21 @@ /* + * arch/ppc/syslib/ppc4xx_pic.c * - * Copyright (c) 1999 Grant Erickson - * - * Module name: ppc4xx_pic.c - * - * Description: - * Interrupt controller driver for PowerPC 4xx-based processors. - */ - -/* - * The PowerPC 403 cores' Asynchronous Interrupt Controller (AIC) has - * 32 possible interrupts, a majority of which are not implemented on - * all cores. There are six configurable, external interrupt pins and - * there are eight internal interrupts for the on-chip serial port - * (SPU), DMA controller, and JTAG controller. + * Interrupt controller driver for PowerPC 4xx-based processors. * - * The PowerPC 405/440 cores' Universal Interrupt Controller (UIC) has - * 32 possible interrupts as well. Depending on the core and SoC - * implementation, a portion of the interrrupts are used for on-chip - * peripherals and a portion of the interrupts are available to be - * configured for external devices generating interrupts. + * Eugene Surovegin or + * Copyright (c) 2004 Zultys Technologies * - * The PowerNP and 440GP (and most likely future implementations) have - * cascaded UICs. + * Based on original code by + * Copyright (c) 1999 Grant Erickson + * Armin Custer * - */ - + * 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 #include #include #include @@ -36,493 +26,212 @@ #include #include -/* Global Variables */ -struct hw_interrupt_type *ppc4xx_pic; -/* - * We define 4xxIRQ_InitSenses table thusly: - * bit 0x1: sense, 1 for edge and 0 for level. - * bit 0x2: polarity, 0 for negative, 1 for positive. - */ -unsigned int ibm4xxPIC_NumInitSenses __initdata = 0; -unsigned char *ibm4xxPIC_InitSenses __initdata = NULL; - -/* Six of one, half dozen of the other....#ifdefs, separate files, - * other tricks..... - * - * There are basically two types of interrupt controllers, the 403 AIC - * and the "others" with UIC. I just kept them both here separated - * with #ifdefs, but it seems to change depending upon how supporting - * files (like ppc4xx.h) change. -- Dan. +/* See comment in include/arch-ppc/ppc4xx_pic.h + * for more info about these two variables */ - -#ifdef CONFIG_403 - -/* Function Prototypes */ - -static void ppc403_aic_enable(unsigned int irq); -static void ppc403_aic_disable(unsigned int irq); -static void ppc403_aic_disable_and_ack(unsigned int irq); - -static struct hw_interrupt_type ppc403_aic = { - "403GC AIC", - NULL, - NULL, - ppc403_aic_enable, - ppc403_aic_disable, - ppc403_aic_disable_and_ack, - 0 -}; - -int -ppc403_pic_get_irq(struct pt_regs *regs) -{ - int irq; - unsigned long bits; - - /* - * Only report the status of those interrupts that are actually - * enabled. - */ - - bits = mfdcr(DCRN_EXISR) & mfdcr(DCRN_EXIER); - - /* - * Walk through the interrupts from highest priority to lowest, and - * report the first pending interrupt found. - * We want PPC, not C bit numbering, so just subtract the ffs() - * result from 32. - */ - irq = 32 - ffs(bits); - - if (irq == NR_AIC_IRQS) - irq = -1; - - return (irq); +extern struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[NR_UICS] __attribute__((weak)); +extern unsigned char ppc4xx_uic_ext_irq_cfg[] __attribute__((weak)); + +#define IRQ_MASK_UIC0(irq) (1 << (31 - (irq))) +#define IRQ_MASK_UICx(irq) (1 << (31 - ((irq) & 0x1f))) +#define IRQ_MASK_UIC1(irq) IRQ_MASK_UICx(irq) +#define IRQ_MASK_UIC2(irq) IRQ_MASK_UICx(irq) + +#define UIC_HANDLERS(n) \ +static void ppc4xx_uic##n##_enable(unsigned int irq) \ +{ \ + ppc_cached_irq_mask[n] |= IRQ_MASK_UIC##n(irq); \ + mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \ +} \ + \ +static void ppc4xx_uic##n##_disable(unsigned int irq) \ +{ \ + ppc_cached_irq_mask[n] &= ~IRQ_MASK_UIC##n(irq); \ + mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \ +} \ + \ +static void ppc4xx_uic##n##_ack(unsigned int irq) \ +{ \ + u32 mask = IRQ_MASK_UIC##n(irq); \ + ppc_cached_irq_mask[n] &= ~mask; \ + mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \ + mtdcr(DCRN_UIC_SR(UIC##n), mask); \ + ACK_UIC##n##_PARENT \ +} \ + \ +static void ppc4xx_uic##n##_end(unsigned int irq) \ +{ \ + unsigned int status = irq_desc[irq].status; \ + u32 mask = IRQ_MASK_UIC##n(irq); \ + if (status & IRQ_LEVEL){ \ + mtdcr(DCRN_UIC_SR(UIC##n), mask); \ + ACK_UIC##n##_PARENT \ + } \ + if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))){ \ + ppc_cached_irq_mask[n] |= mask; \ + mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \ + } \ } -static void -ppc403_aic_enable(unsigned int irq) +#define DECLARE_UIC(n) \ +{ \ + .typename = "UIC"#n, \ + .enable = ppc4xx_uic##n##_enable, \ + .disable = ppc4xx_uic##n##_disable, \ + .ack = ppc4xx_uic##n##_ack, \ + .end = ppc4xx_uic##n##_end, \ +} \ + +#if NR_UICS == 3 +#define ACK_UIC0_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC); +#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC); +#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC); +UIC_HANDLERS(0); UIC_HANDLERS(1); UIC_HANDLERS(2); + +static int ppc4xx_pic_get_irq(struct pt_regs *regs) { - int bit, word; - - bit = irq & 0x1f; - word = irq >> 5; - - ppc_cached_irq_mask[word] |= (1 << (31 - bit)); - mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]); + u32 uicb = mfdcr(DCRN_UIC_MSR(UICB)); + if (uicb & UICB_UIC0NC) + return 32 - ffs(mfdcr(DCRN_UIC_MSR(UIC0))); + else if (uicb & UICB_UIC1NC) + return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1))); + else if (uicb & UICB_UIC2NC) + return 96 - ffs(mfdcr(DCRN_UIC_MSR(UIC2))); + else + return -1; } -static void -ppc403_aic_disable(unsigned int irq) +static void __init ppc4xx_pic_impl_init(void) { - int bit, word; - - bit = irq & 0x1f; - word = irq >> 5; - - ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); - mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]); -} - -static void -ppc403_aic_disable_and_ack(unsigned int irq) -{ - int bit, word; - - bit = irq & 0x1f; - word = irq >> 5; - - ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); - mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]); - mtdcr(DCRN_EXISR, (1 << (31 - bit))); + /* Configure Base UIC */ + mtdcr(DCRN_UIC_CR(UICB), 0); + mtdcr(DCRN_UIC_TR(UICB), 0); + mtdcr(DCRN_UIC_PR(UICB), 0xffffffff); + mtdcr(DCRN_UIC_SR(UICB), 0xffffffff); + mtdcr(DCRN_UIC_ER(UICB), UICB_UIC0NC | UICB_UIC1NC | UICB_UIC2NC); } -#else +#elif NR_UICS == 2 +#define ACK_UIC0_PARENT +#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC); +UIC_HANDLERS(0); UIC_HANDLERS(1); -#ifndef UIC1 -#define UIC1 UIC0 -#endif -#ifndef UIC2 -#define UIC2 UIC1 -#endif - -static void -ppc4xx_uic_enable(unsigned int irq) +static int ppc4xx_pic_get_irq(struct pt_regs *regs) { - int bit, word; - irq_desc_t *desc = irq_desc + irq; - - bit = irq & 0x1f; - word = irq >> 5; - -#ifdef UIC_DEBUG - printk("ppc4xx_uic_enable - irq %d word %d bit 0x%x\n", irq, word, bit); -#endif - ppc_cached_irq_mask[word] |= 1 << (31 - bit); - switch (word) { - case 0: - mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); - if ((mfdcr(DCRN_UIC_TR(UIC0)) & (1 << (31 - bit))) == 0) - desc->status |= IRQ_LEVEL; - else - desc->status = desc->status & ~IRQ_LEVEL; - break; - case 1: - mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); - if ((mfdcr(DCRN_UIC_TR(UIC1)) & (1 << (31 - bit))) == 0) - desc->status |= IRQ_LEVEL; - else - desc->status = desc->status & ~IRQ_LEVEL; - break; - case 2: - mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]); - if ((mfdcr(DCRN_UIC_TR(UIC2)) & (1 << (31 - bit))) == 0) - desc->status |= IRQ_LEVEL; - else - desc->status = desc->status & ~IRQ_LEVEL; - break; - } - + u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0)); + if (uic0 & UIC0_UIC1NC) + return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1))); + else + return uic0 ? 32 - ffs(uic0) : -1; } -static void -ppc4xx_uic_disable(unsigned int irq) +static void __init ppc4xx_pic_impl_init(void) { - int bit, word; - - bit = irq & 0x1f; - word = irq >> 5; -#ifdef UIC_DEBUG - printk("ppc4xx_uic_disable - irq %d word %d bit 0x%x\n", irq, word, - bit); -#endif - ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); - switch (word) { - case 0: - mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); - break; - case 1: - mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); - break; - case 2: - mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]); - break; - } + /* Enable cascade interrupt in UIC0 */ + ppc_cached_irq_mask[0] |= UIC0_UIC1NC; + mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC); + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]); } -static void -ppc4xx_uic_disable_and_ack(unsigned int irq) -{ - int bit, word; - - bit = irq & 0x1f; - word = irq >> 5; +#elif NR_UICS == 1 +#define ACK_UIC0_PARENT +UIC_HANDLERS(0); -#ifdef UIC_DEBUG - printk("ppc4xx_uic_disable_and_ack - irq %d word %d bit 0x%x\n", irq, - word, bit); -#endif - ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); - switch (word) { - case 0: - mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); - mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - bit))); -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC); -#endif - break; - case 1: - mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); - mtdcr(DCRN_UIC_SR(UIC1), (1 << (31 - bit))); -#if (NR_UICS == 2) - mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - UIC0_UIC1NC))); -#endif -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC); -#endif - break; - case 2: - mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]); - mtdcr(DCRN_UIC_SR(UIC2), (1 << (31 - bit))); -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC); -#endif - break; - } - -} - -static void -ppc4xx_uic_end(unsigned int irq) +static int ppc4xx_pic_get_irq(struct pt_regs *regs) { - int bit, word; - unsigned int tr_bits = 0; - - bit = irq & 0x1f; - word = irq >> 5; + u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0)); + return uic0 ? 32 - ffs(uic0) : -1; +} -#ifdef UIC_DEBUG - printk("ppc4xx_uic_end - irq %d word %d bit 0x%x\n", irq, word, bit); +static inline void ppc4xx_pic_impl_init(void){} #endif - switch (word) { - case 0: - tr_bits = mfdcr(DCRN_UIC_TR(UIC0)); - break; - case 1: - tr_bits = mfdcr(DCRN_UIC_TR(UIC1)); - break; - case 2: - tr_bits = mfdcr(DCRN_UIC_TR(UIC2)); - break; - } - - if ((tr_bits & (1 << (31 - bit))) == 0) { - /* level trigger */ - switch (word) { - case 0: - mtdcr(DCRN_UIC_SR(UIC0), 1 << (31 - bit)); -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC); -#endif - break; - case 1: - mtdcr(DCRN_UIC_SR(UIC1), 1 << (31 - bit)); -#if (NR_UICS == 2) - mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - UIC0_UIC1NC))); -#endif -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC); -#endif - break; - case 2: - mtdcr(DCRN_UIC_SR(UIC2), 1 << (31 - bit)); -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC); +static struct ppc4xx_uic_impl { + struct hw_interrupt_type decl; + int base; /* Base DCR number */ +} __uic[] = { + { .decl = DECLARE_UIC(0), .base = UIC0 }, +#if NR_UICS > 1 + { .decl = DECLARE_UIC(1), .base = UIC1 }, +#if NR_UICS > 2 + { .decl = DECLARE_UIC(2), .base = UIC2 }, #endif - break; - } - } - - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { - ppc_cached_irq_mask[word] |= 1 << (31 - bit); - switch (word) { - case 0: - mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); - break; - case 1: - mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); - break; - case 2: - mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]); - break; - } - } -} - -static struct hw_interrupt_type ppc4xx_uic = { -#if (NR_UICS == 1) - "IBM UIC", -#else - "IBM UIC Cascade", #endif - NULL, - NULL, - ppc4xx_uic_enable, - ppc4xx_uic_disable, - ppc4xx_uic_disable_and_ack, - ppc4xx_uic_end, - 0 }; -int -ppc4xx_pic_get_irq(struct pt_regs *regs) +static inline int is_level_sensitive(int irq) { - int irq, cas_irq; - unsigned long bits; - cas_irq = 0; - /* - * Only report the status of those interrupts that are actually - * enabled. - */ - -#if (NR_UICS > 2) - bits = mfdcr(DCRN_UIC_MSR(UICB)); -#else - bits = mfdcr(DCRN_UIC_MSR(UIC0)); -#endif -#if (NR_UICS > 2) - if (bits & UICB_UIC0NC) { - bits = mfdcr(DCRN_UIC_MSR(UIC0)); - irq = 32 - ffs(bits); - } else if (bits & UICB_UIC1NC) { - bits = mfdcr(DCRN_UIC_MSR(UIC1)); - irq = 64 - ffs(bits); - } else if (bits & UICB_UIC2NC) { - bits = mfdcr(DCRN_UIC_MSR(UIC2)); - irq = 96 - ffs(bits); - } else { - irq = -1; - } -#elif (NR_UICS > 1) - if (bits & UIC_CASCADE_MASK) { - bits = mfdcr(DCRN_UIC_MSR(UIC1)); - cas_irq = 32 - ffs(bits); - irq = 32 + cas_irq; - } else { - irq = 32 - ffs(bits); - if (irq == 32) - irq = -1; - } -#else - /* - * Walk through the interrupts from highest priority to lowest, and - * report the first pending interrupt found. - * We want PPC, not C bit numbering, so just subtract the ffs() - * result from 32. - */ - irq = 32 - ffs(bits); -#endif - if (irq == (NR_UIC_IRQS * NR_UICS)) - irq = -1; - -#ifdef UIC_DEBUG - printk("ppc4xx_pic_get_irq - irq %d bit 0x%x\n", irq, bits); -#endif - - return (irq); + u32 tr = mfdcr(DCRN_UIC_TR(__uic[irq >> 5].base)); + return (tr & IRQ_MASK_UICx(irq)) == 0; } -#endif -void __init -ppc4xx_extpic_init(void) +void __init ppc4xx_pic_init(void) { - /* set polarity - * 1 = default/pos/rising , 0= neg/falling internal - * 1 = neg/falling , 0= pos/rising external - * Sense - * 0 = default level internal - * 0 = level, 1 = edge external - */ - - unsigned int sense, irq; - int bit, word; - unsigned long ppc_cached_sense_mask[NR_MASK_WORDS]; - unsigned long ppc_cached_pol_mask[NR_MASK_WORDS]; - ppc_cached_sense_mask[0] = 0; - ppc_cached_sense_mask[1] = 0; - ppc_cached_sense_mask[2] = 0; - ppc_cached_pol_mask[0] = 0; - ppc_cached_pol_mask[1] = 0; - ppc_cached_pol_mask[2] = 0; - - for (irq = 0; irq < NR_IRQS; irq++) { - - bit = irq & 0x1f; - word = irq >> 5; - - sense = - (irq < - ibm4xxPIC_NumInitSenses) ? ibm4xxPIC_InitSenses[irq] : 3; -#ifdef PPC4xx_PIC_DEBUG - printk("PPC4xx_picext %d word:%x bit:%x sense:%x", irq, word, - bit, sense); -#endif - ppc_cached_sense_mask[word] |= - (~sense & IRQ_SENSE_MASK) << (31 - bit); - ppc_cached_pol_mask[word] |= - ((sense & IRQ_POLARITY_MASK) >> 1) << (31 - bit); - switch (word) { - case 0: -#ifdef PPC4xx_PIC_DEBUG - printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC0))); - printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC0))); -#endif - /* polarity setting */ - mtdcr(DCRN_UIC_PR(UIC0), ppc_cached_pol_mask[word]); - - /* Level setting */ - mtdcr(DCRN_UIC_TR(UIC0), ppc_cached_sense_mask[word]); - - break; - case 1: -#ifdef PPC4xx_PIC_DEBUG - printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC1))); - printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC1))); -#endif - /* polarity setting */ - mtdcr(DCRN_UIC_PR(UIC1), ppc_cached_pol_mask[word]); - - /* Level setting */ - mtdcr(DCRN_UIC_TR(UIC1), ppc_cached_sense_mask[word]); - - break; - case 2: -#ifdef PPC4xx_PIC_DEBUG - printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC2))); - printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC2))); -#endif - /* polarity setting */ - mtdcr(DCRN_UIC_PR(UIC2), ppc_cached_pol_mask[word]); - - /* Level setting */ - mtdcr(DCRN_UIC_TR(UIC2), ppc_cached_sense_mask[word]); - - break; + int i; + unsigned char* eirqs = ppc4xx_uic_ext_irq_cfg; + + for (i = 0; i < NR_UICS; ++i){ + int base = __uic[i].base; + + /* Disable everything by default */ + ppc_cached_irq_mask[i] = 0; + mtdcr(DCRN_UIC_ER(base), 0); + + /* We don't use critical interrupts */ + mtdcr(DCRN_UIC_CR(base), 0); + + /* Configure polarity and triggering */ + if (ppc4xx_core_uic_cfg){ + struct ppc4xx_uic_settings* p = ppc4xx_core_uic_cfg + i; + u32 mask = p->ext_irq_mask; + u32 pr = mfdcr(DCRN_UIC_PR(base)) & mask; + u32 tr = mfdcr(DCRN_UIC_TR(base)) & mask; + + /* "Fixed" interrupts (on-chip devices) */ + pr |= p->polarity & ~mask; + tr |= p->triggering & ~mask; + + /* Merge external IRQs settings if board port + * provided them + */ + if (eirqs && mask){ + pr &= ~mask; + tr &= ~mask; + while (mask){ + /* Extract current external IRQ mask */ + u32 eirq_mask = 1 << __ilog2(mask); + + if (!(*eirqs & IRQ_SENSE_LEVEL)) + tr |= eirq_mask; + + if (*eirqs & IRQ_POLARITY_POSITIVE) + pr |= eirq_mask; + + mask &= ~eirq_mask; + ++eirqs; + } + } + mtdcr(DCRN_UIC_PR(base), pr); + mtdcr(DCRN_UIC_TR(base), tr); } + + /* ACK any pending interrupts to prevent false + * triggering after first enable + */ + mtdcr(DCRN_UIC_SR(base), 0xffffffff); } -} -void __init -ppc4xx_pic_init(void) -{ - /* - * Disable all external interrupts until they are - * explicity requested. + /* Perform optional implementation specific setup + * (e.g. enable cascade interrupts for multi-UIC configurations) */ - ppc_cached_irq_mask[0] = 0; - ppc_cached_irq_mask[1] = 0; - ppc_cached_irq_mask[2] = 0; - -#if defined CONFIG_403 - mtdcr(DCRN_EXIER, ppc_cached_irq_mask[0]); + ppc4xx_pic_impl_init(); - ppc4xx_pic = &ppc403_aic; - ppc_md.get_irq = ppc403_pic_get_irq; -#else -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_ER(UICB), UICB_UIC0NC | UICB_UIC1NC | UICB_UIC2NC); - mtdcr(DCRN_UIC_CR(UICB), 0); - - mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[2]); - mtdcr(DCRN_UIC_CR(UIC2), 0); - -#endif -#if (NR_UICS > 1) -#if (NR_UICS == 2) - /* enable cascading interrupt */ - ppc_cached_irq_mask[0] |= 1 << (31 - UIC0_UIC1NC); -#endif - mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[1]); - mtdcr(DCRN_UIC_CR(UIC1), 0); -#endif - mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]); - mtdcr(DCRN_UIC_CR(UIC0), 0); - - if (ibm4xxPIC_InitSenses != NULL) - ppc4xx_extpic_init(); - - /* Clear any pending interrupts */ -#if (NR_UICS > 2) - mtdcr(DCRN_UIC_SR(UICB), 0xffffffff); - mtdcr(DCRN_UIC_SR(UIC2), 0xffffffff); -#endif -#if (NR_UICS > 1) - mtdcr(DCRN_UIC_SR(UIC1), 0xffffffff); -#endif - mtdcr(DCRN_UIC_SR(UIC0), 0xffffffff); + /* Attach low-level handlers */ + for (i = 0; i < (NR_UICS << 5); ++i){ + irq_desc[i].handler = &__uic[i >> 5].decl; + if (is_level_sensitive(i)) + irq_desc[i].status |= IRQ_LEVEL; + } - ppc4xx_pic = &ppc4xx_uic; ppc_md.get_irq = ppc4xx_pic_get_irq; -#endif } diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c index 735f3aec8..e170aebeb 100644 --- a/arch/ppc/syslib/ppc4xx_setup.c +++ b/arch/ppc/syslib/ppc4xx_setup.c @@ -42,6 +42,8 @@ #include #include +#include + /* Function Prototypes */ extern void abort(void); extern void ppc4xx_find_bridges(void); @@ -56,8 +58,16 @@ bd_t __res; void __init ppc4xx_setup_arch(void) { - /* Setup PCI host bridges */ +#if !defined(CONFIG_BDI_SWITCH) + /* + * The Abatron BDI JTAG debugger does not tolerate others + * mucking with the debug registers. + */ + mtspr(SPRN_DBCR0, (DBCR0_IDM)); + mtspr(SPRN_DBSR, 0xffffffff); +#endif + /* Setup PCI host bridges */ #ifdef CONFIG_PCI ppc4xx_find_bridges(); #endif @@ -123,12 +133,7 @@ ppc4xx_map_io(void) void __init ppc4xx_init_IRQ(void) { - int i; - ppc4xx_pic_init(); - - for (i = 0; i < NR_IRQS; i++) - irq_desc[i].handler = ppc4xx_pic; } static void @@ -189,34 +194,6 @@ ppc4xx_calibrate_decr(void) /* Set the PIT reload value and just let it run. */ mtspr(SPRN_PIT, tb_ticks_per_jiffy); } -#ifdef CONFIG_SERIAL_TEXT_DEBUG - -/* We assume that the UART has already been initialized by the - firmware or the boot loader */ -static void -serial_putc(u8 * com_port, unsigned char c) -{ - while ((readb(com_port + (UART_LSR)) & UART_LSR_THRE) == 0) ; - writeb(c, com_port); -} - -static void -ppc4xx_progress(char *s, unsigned short hex) -{ - char c; -#ifdef SERIAL_DEBUG_IO_BASE - u8 *com_port = (u8 *) SERIAL_DEBUG_IO_BASE; - - while ((c = *s++) != '\0') { - serial_putc(com_port, c); - } - serial_putc(com_port, '\r'); - serial_putc(com_port, '\n'); -#else - printk("%s\r\n"); -#endif -} -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ /* * IDE stuff. @@ -319,14 +296,26 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.setup_io_mappings = ppc4xx_map_io; #ifdef CONFIG_SERIAL_TEXT_DEBUG - ppc_md.progress = ppc4xx_progress; + ppc_md.progress = gen550_progress; #endif -/* -** m8xx_setup.c, prep_setup.c use -** defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -*/ #if defined(CONFIG_PCI) && defined(CONFIG_IDE) ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports; #endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ } + +/* Called from MachineCheckException */ +void platform_machine_check(struct pt_regs *regs) +{ +#if defined(DCRN_PLB0_BEAR) + printk("PLB0: BEAR= 0x%08x ACR= 0x%08x BESR= 0x%08x\n", + mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_PLB0_ACR), + mfdcr(DCRN_PLB0_BESR)); +#endif +#if defined(DCRN_POB0_BEAR) + printk("PLB0 to OPB: BEAR= 0x%08x BESR0= 0x%08x BESR1= 0x%08x\n", + mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_POB0_BESR0), + mfdcr(DCRN_POB0_BESR1)); +#endif + +} diff --git a/arch/ppc/syslib/ppc4xx_sgdma.c b/arch/ppc/syslib/ppc4xx_sgdma.c index 49c6e9c61..9f76e8ee3 100644 --- a/arch/ppc/syslib/ppc4xx_sgdma.c +++ b/arch/ppc/syslib/ppc4xx_sgdma.c @@ -120,6 +120,12 @@ ppc4xx_add_dma_sgl(sgl_handle_t handle, phys_addr_t src_addr, phys_addr_t dst_ad psgl->ptail = psgl->phead; psgl->ptail_dma = psgl->phead_dma; } else { + if(p_dma_ch->int_on_final_sg) { + /* mask out all dma interrupts, except error, on tail + before adding new tail. */ + psgl->ptail->control_count &= + ~(SG_TCI_ENABLE | SG_ETI_ENABLE); + } psgl->ptail->next = psgl->ptail_dma + sizeof(ppc_sgl_t); psgl->ptail++; psgl->ptail_dma += sizeof(ppc_sgl_t); @@ -217,7 +223,7 @@ ppc4xx_get_dma_sgl_residue(sgl_handle_t handle, phys_addr_t * src_addr, } sgl_addr = (ppc_sgl_t *) __va(mfdcr(DCRN_ASG0 + (psgl->dmanr * 0x8))); - count_left = mfdcr(DCRN_DMACT0 + (psgl->dmanr * 0x8)); + count_left = mfdcr(DCRN_DMACT0 + (psgl->dmanr * 0x8)) & SG_COUNT_MASK; if (!sgl_addr) { printk("ppc4xx_get_dma_sgl_residue: sgl addr register is null\n"); @@ -351,10 +357,11 @@ ppc4xx_delete_dma_sgl_element(sgl_handle_t handle, phys_addr_t * src_dma_addr, int ppc4xx_alloc_dma_handle(sgl_handle_t * phandle, unsigned int mode, unsigned int dmanr) { - sgl_list_info_t *psgl; + sgl_list_info_t *psgl=NULL; dma_addr_t dma_addr; ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr]; uint32_t sg_command; + uint32_t ctc_settings; void *ret; if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) { @@ -412,6 +419,11 @@ ppc4xx_alloc_dma_handle(sgl_handle_t * phandle, unsigned int mode, unsigned int mtdcr(DCRN_ASGC, sg_command); psgl->sgl_control = SG_ERI_ENABLE | SG_LINK; + /* keep control count register settings */ + ctc_settings = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) + & (DMA_CTC_BSIZ_MSK | DMA_CTC_BTEN); /*burst mode settings*/ + psgl->sgl_control |= ctc_settings; + if (p_dma_ch->int_enable) { if (p_dma_ch->tce_enable) psgl->sgl_control |= SG_TCI_ENABLE; diff --git a/arch/ppc/syslib/ppc85xx_common.c b/arch/ppc/syslib/ppc85xx_common.c index 7de3e4560..e83f2f868 100644 --- a/arch/ppc/syslib/ppc85xx_common.c +++ b/arch/ppc/syslib/ppc85xx_common.c @@ -20,7 +20,6 @@ #include #include -#include /* ************************************************************************ */ /* Return the value of CCSRBAR for the current board */ @@ -31,16 +30,4 @@ get_ccsrbar(void) return BOARD_CCSRBAR; } -/* ************************************************************************ */ -/* Update the 85xx OCP tables paddr field */ -void -mpc85xx_update_paddr_ocp(struct ocp_device *dev, void *arg) -{ - phys_addr_t ccsrbar; - if (arg) { - ccsrbar = *(phys_addr_t *)arg; - dev->def->paddr += ccsrbar; - } -} - EXPORT_SYMBOL(get_ccsrbar); diff --git a/arch/ppc/syslib/ppc85xx_common.h b/arch/ppc/syslib/ppc85xx_common.h index 741e2a955..2c8f30444 100644 --- a/arch/ppc/syslib/ppc85xx_common.h +++ b/arch/ppc/syslib/ppc85xx_common.h @@ -18,12 +18,8 @@ #include #include -#include /* Provide access to ccsrbar for any modules, etc */ phys_addr_t get_ccsrbar(void); -/* Update the 85xx OCP tables paddr field */ -void mpc85xx_update_paddr_ocp(struct ocp_device *dev, void *ccsrbar); - #endif /* __PPC_SYSLIB_PPC85XX_COMMON_H */ diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c index d4e651534..81f1968c3 100644 --- a/arch/ppc/syslib/ppc85xx_setup.c +++ b/arch/ppc/syslib/ppc85xx_setup.c @@ -21,13 +21,14 @@ #include #include /* for linux/serial_core.h */ #include +#include #include #include #include #include #include -#include +#include #include #include @@ -73,40 +74,39 @@ mpc85xx_calibrate_decr(void) void __init mpc85xx_early_serial_map(void) { +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) struct uart_port serial_req; +#endif + struct plat_serial8250_port *pdata; bd_t *binfo = (bd_t *) __res; - phys_addr_t duart_paddr = binfo->bi_immr_base + MPC85xx_UART0_OFFSET; + pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC85xx_DUART); /* Setup serial port access */ + pdata[0].uartclk = binfo->bi_busfreq; + pdata[0].mapbase += binfo->bi_immr_base; + pdata[0].membase = ioremap(pdata[0].mapbase, MPC85xx_UART0_SIZE); + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) memset(&serial_req, 0, sizeof (serial_req)); - serial_req.uartclk = binfo->bi_busfreq; - serial_req.line = 0; - serial_req.irq = MPC85xx_IRQ_DUART; - serial_req.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; serial_req.iotype = SERIAL_IO_MEM; - serial_req.membase = ioremap(duart_paddr, MPC85xx_UART0_SIZE); - serial_req.mapbase = duart_paddr; + serial_req.mapbase = pdata[0].mapbase; + serial_req.membase = pdata[0].membase; serial_req.regshift = 0; -#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) gen550_init(0, &serial_req); #endif - if (early_serial_setup(&serial_req) != 0) - printk("Early serial init of port 0 failed\n"); - - /* Assume early_serial_setup() doesn't modify serial_req */ - duart_paddr = binfo->bi_immr_base + MPC85xx_UART1_OFFSET; - serial_req.line = 1; - serial_req.mapbase = duart_paddr; - serial_req.membase = ioremap(duart_paddr, MPC85xx_UART1_SIZE); + pdata[1].uartclk = binfo->bi_busfreq; + pdata[1].mapbase += binfo->bi_immr_base; + pdata[1].membase = ioremap(pdata[1].mapbase, MPC85xx_UART0_SIZE); #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Assume gen550_init() doesn't modify serial_req */ + serial_req.mapbase = pdata[1].mapbase; + serial_req.membase = pdata[1].membase; + gen550_init(1, &serial_req); #endif - - if (early_serial_setup(&serial_req) != 0) - printk("Early serial init of port 1 failed\n"); } #endif @@ -243,6 +243,8 @@ mpc85xx_setup_pci2(struct pci_controller *hose) } #endif /* CONFIG_85xx_PCI2 */ +int mpc85xx_pci1_last_busno = 0; + void __init mpc85xx_setup_hose(void) { @@ -341,6 +343,9 @@ mpc85xx_setup_hose(void) IORESOURCE_IO, "PCI2 host bridge"); hose_b->last_busno = pciauto_bus_scan(hose_b, hose_b->first_busno); + + /* let board code know what the last bus number was on PCI1 */ + mpc85xx_pci1_last_busno = hose_a->last_busno; #endif return; } diff --git a/arch/ppc/syslib/ppc85xx_setup.h b/arch/ppc/syslib/ppc85xx_setup.h index 678325989..6e6cfe162 100644 --- a/arch/ppc/syslib/ppc85xx_setup.h +++ b/arch/ppc/syslib/ppc85xx_setup.h @@ -43,9 +43,6 @@ extern void mpc85xx_setup_hose(void) __init; #define PCIX_STATUS 0x64 /* Serial Config */ -#define MPC85XX_0_SERIAL (CCSRBAR + 0x4500) -#define MPC85XX_1_SERIAL (CCSRBAR + 0x4600) - #ifdef CONFIG_SERIAL_MANY_PORTS #define RS_TABLE_SIZE 64 #else @@ -56,12 +53,6 @@ extern void mpc85xx_setup_hose(void) __init; #define BASE_BAUD 115200 #endif -#define STD_UART_OP(num) \ - { 0, BASE_BAUD, num, MPC85xx_IRQ_DUART, \ - (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ - iomem_base: (u8 *)MPC85XX_##num##_SERIAL, \ - io_type: SERIAL_IO_MEM}, - /* Offset of CPM register space */ #define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c index 8481a415a..d3b01c6c9 100644 --- a/arch/ppc/syslib/ppc8xx_pic.c +++ b/arch/ppc/syslib/ppc8xx_pic.c @@ -4,11 +4,14 @@ #include #include #include +#include #include #include #include #include "ppc8xx_pic.h" +extern int cpm_get_irq(struct pt_regs *regs); + /* The 8xx internal interrupt controller. It is usually * the only interrupt controller. Some boards, like the MBX and * Sandpoint have the 8259 as a secondary controller. Depending @@ -72,46 +75,13 @@ static void m8xx_mask_and_ack(unsigned int irq_nr) } struct hw_interrupt_type ppc8xx_pic = { - " 8xx SIU ", - NULL, - NULL, - m8xx_unmask_irq, - m8xx_mask_irq, - m8xx_mask_and_ack, - m8xx_end_irq, - 0 + .typename = " 8xx SIU ", + .enable = m8xx_unmask_irq, + .disable = m8xx_mask_irq, + .ack = m8xx_mask_and_ack, + .end = m8xx_end_irq, }; -#if 0 -void -m8xx_do_IRQ(struct pt_regs *regs, - int cpu) -{ - int irq; - unsigned long bits = 0; - - /* For MPC8xx, read the SIVEC register and shift the bits down - * to get the irq number. */ - bits = ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec; - irq = bits >> 26; -#if 0 - irq += ppc8xx_pic.irq_offset; -#endif - bits = 1UL << irq; - - if (irq < 0) { - printk(KERN_DEBUG "Bogus interrupt %d from PC = %lx\n", - irq, regs->nip); - ppc_spurious_interrupts++; - } - else { - ppc_irq_dispatch_handler( regs, irq ); - } - -} -#endif - - /* * We either return a valid interrupt or -1 if there is nothing pending */ @@ -129,73 +99,32 @@ m8xx_get_irq(struct pt_regs *regs) * When we read the sivec without an interrupt to process, we will * get back SIU_LEVEL7. In this case, return -1 */ - if (irq == SIU_LEVEL7) - return -1; + if (irq == CPM_INTERRUPT) + irq = CPM_IRQ_OFFSET + cpm_get_irq(regs); +#if defined(CONFIG_PCI) + else if (irq == ISA_BRIDGE_INT) { + int isa_irq; + + if ((isa_irq = i8259_poll(regs)) >= 0) + irq = I8259_IRQ_OFFSET + isa_irq; + } +#endif /* CONFIG_PCI */ + else if (irq == SIU_LEVEL7) + irq = -1; return irq; } -/* The MBX is the only 8xx board that uses the 8259. -*/ #if defined(CONFIG_MBX) && defined(CONFIG_PCI) -void mbx_i8259_action(int cpl, void *dev_id, struct pt_regs *regs) -{ - int bits, irq; - - /* A bug in the QSpan chip causes it to give us 0xff always - * when doing a character read. So read 32 bits and shift. - * This doesn't seem to return useful values anyway, but - * read it to make sure things are acked. - * -- Cort - */ - irq = (inl(0x508) >> 24)&0xff; - if ( irq != 0xff ) printk("iack %d\n", irq); - - outb(0x0C, 0x20); - irq = inb(0x20) & 7; - if (irq == 2) - { - outb(0x0C, 0xA0); - irq = inb(0xA0); - irq = (irq&7) + 8; - } - bits = 1UL << irq; - irq += i8259_pic.irq_offset; - ppc_irq_dispatch_handler( regs, irq ); -} -#endif - /* Only the MBX uses the external 8259. This allows us to catch standard * drivers that may mess up the internal interrupt controllers, and also * allow them to run without modification on the MBX. */ -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, const char * devname, void *dev_id) +void mbx_i8259_action(int irq, void *dev_id, struct pt_regs *regs) { - -#if defined(CONFIG_MBX) && defined(CONFIG_PCI) - irq += i8259_pic.irq_offset; - return (request_8xxirq(irq, handler, irqflags, devname, dev_id)); -#else - /* - * Handle other "well-known" interrupts, but panic on unknown ones. + /* This interrupt handler never actually gets called. It is + * installed only to unmask the 8259 cascade interrupt in the SIU + * and to make the 8259 cascade interrupt visible in /proc/interrupts. */ - switch (irq) { -#ifdef IDE0_INTERRUPT - case IDE0_INTERRUPT: /* IDE0 */ - return (request_8xxirq(irq, handler, irqflags, devname, - dev_id)); -#endif -#ifdef IDE1_INTERRUPT - case IDE1_INTERRUPT: /* IDE1 */ - return (request_8xxirq(irq, handler, irqflags, devname, - dev_id)); -#endif - default: /* unknown IRQ -> panic */ - panic("request_irq"); - } -#endif } - -EXPORT_SYMBOL(request_irq); +#endif /* CONFIG_PCI */ diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c index 1ddb0c0eb..7abcdb526 100644 --- a/arch/ppc/syslib/prom.c +++ b/arch/ppc/syslib/prom.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -1397,7 +1397,7 @@ print_properties(struct device_node *np) } #endif -static spinlock_t rtas_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(rtas_lock); /* this can be called after setup -- Cort */ int __openfirmware diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c index ac4c8b158..83686bc4d 100644 --- a/arch/ppc/syslib/prom_init.c +++ b/arch/ppc/syslib/prom_init.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -810,6 +810,9 @@ prom_init(int r3, int r4, prom_entry pp) char *p, *d; unsigned long phys; void *result[3]; + char model[32]; + phandle node; + int rc; /* Default */ phys = (unsigned long) &_stext; @@ -866,11 +869,20 @@ prom_init(int r3, int r4, prom_entry pp) klimit = (char *) (mem - offset); - /* If we are already running at 0xc0000000, we assume we were - * loaded by an OF bootloader which did set a BAT for us. - * This breaks OF translate so we force phys to be 0. - */ - if (offset == 0) { + node = call_prom("finddevice", 1, 1, "/"); + rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model)); + if (rc > 0 && !strncmp (model, "Pegasos", 7) + && strncmp (model, "Pegasos2", 8)) { + /* Pegasos 1 has a broken translate method in the OF, + * and furthermore the BATs are mapped 1:1 so the phys + * address calculated above is correct, so let's use + * it directly. + */ + } else if (offset == 0) { + /* If we are already running at 0xc0000000, we assume we were + * loaded by an OF bootloader which did set a BAT for us. + * This breaks OF translate so we force phys to be 0. + */ prom_print("(already at 0xc0000000) phys=0\n"); phys = 0; } else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu", diff --git a/arch/ppc/syslib/qspan_pci.c b/arch/ppc/syslib/qspan_pci.c index 57edf3a27..57f4ed5e5 100644 --- a/arch/ppc/syslib/qspan_pci.c +++ b/arch/ppc/syslib/qspan_pci.c @@ -94,6 +94,8 @@ #define mk_config_type1(bus, dev, offset) \ mk_config_addr(bus, dev, offset) | 1; +static spinlock_t pcibios_lock = SPIN_LOCK_UNLOCKED; + int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned char *val) { @@ -109,8 +111,8 @@ int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, } #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -124,7 +126,7 @@ int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif offset ^= 0x03; @@ -148,8 +150,8 @@ int qspan_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, } #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -164,7 +166,7 @@ int qspan_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif sp = ((ushort *)&temp) + ((offset >> 1) & 1); @@ -185,8 +187,8 @@ int qspan_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, } #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -200,7 +202,7 @@ int qspan_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif return PCIBIOS_SUCCESSFUL; @@ -225,8 +227,8 @@ int qspan_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, *cp = val; #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -240,7 +242,7 @@ int qspan_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif return PCIBIOS_SUCCESSFUL; @@ -265,8 +267,8 @@ int qspan_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, *sp = val; #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -280,7 +282,7 @@ int qspan_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif return PCIBIOS_SUCCESSFUL; @@ -297,8 +299,8 @@ int qspan_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, return PCIBIOS_DEVICE_NOT_FOUND; #ifdef CONFIG_RPXCLASSIC - save_flags(flags); - cli(); + /* disable interrupts */ + spin_lock_irqsave(&pcibios_lock, flags); *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL; eieio(); #endif @@ -312,7 +314,7 @@ int qspan_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, #ifdef CONFIG_RPXCLASSIC *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL; eieio(); - restore_flags(flags); + spin_unlock_irqrestore(&pcibios_lock, flags); #endif return PCIBIOS_SUCCESSFUL; diff --git a/arch/ppc/syslib/todc_time.c b/arch/ppc/syslib/todc_time.c index 1dc7e0bf5..0165e1834 100644 --- a/arch/ppc/syslib/todc_time.c +++ b/arch/ppc/syslib/todc_time.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -48,8 +49,6 @@ * --MAG */ -extern spinlock_t rtc_lock; - /* * 'todc_info' should be initialized in your *_setup.c file to * point to a fully initialized 'todc_info_t' structure. @@ -82,13 +81,13 @@ extern spinlock_t rtc_lock; u_char todc_direct_read_val(int addr) { - return readb(todc_info->nvram_data + addr); + return readb((void __iomem *)(todc_info->nvram_data + addr)); } void todc_direct_write_val(int addr, unsigned char val) { - writeb(val, todc_info->nvram_data + addr); + writeb(val, (void __iomem *)(todc_info->nvram_data + addr)); return; } diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c index 89b5ac169..483d06d9a 100644 --- a/arch/ppc/syslib/xilinx_pic.c +++ b/arch/ppc/syslib/xilinx_pic.c @@ -38,9 +38,6 @@ static volatile u32 *intc; #define intc_in_be32(addr) mfdcr((addr)) #endif -/* Global Variables */ -struct hw_interrupt_type *ppc4xx_pic; - static void xilinx_intc_enable(unsigned int irq) { @@ -115,6 +112,8 @@ xilinx_pic_get_irq(struct pt_regs *regs) void __init ppc4xx_pic_init(void) { + int i; + #if XPAR_XINTC_USE_DCR == 0 intc = ioremap(XPAR_INTC_0_BASEADDR, 32); @@ -137,6 +136,8 @@ ppc4xx_pic_init(void) /* Turn on the Master Enable. */ intc_out_be32(intc + MER, 0x3UL); - ppc4xx_pic = &xilinx_intc; ppc_md.get_irq = xilinx_pic_get_irq; + + for (i = 0; i < NR_IRQS; ++i) + irq_desc[i].handler = &xilinx_intc; } diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c index d88096739..8d3fde10b 100644 --- a/arch/ppc/xmon/start.c +++ b/arch/ppc/xmon/start.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -21,9 +22,6 @@ #include #include #include -#ifdef CONFIG_SMP -#include -#endif static volatile unsigned char *sccc, *sccd; unsigned int TXRDY, RXRDY, DLAB; @@ -104,7 +102,7 @@ static struct sysrq_key_op sysrq_xmon_op = { .handler = sysrq_handle_xmon, .help_msg = "Xmon", - .action_msg = "Entering xmon\n", + .action_msg = "Entering xmon", }; #endif diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c index e7fe8d4c2..9976e7cb5 100644 --- a/arch/ppc/xmon/xmon.c +++ b/arch/ppc/xmon/xmon.c @@ -8,10 +8,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index 6a4adf98f..8527fab45 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig @@ -20,6 +20,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_ISA_DMA bool default y @@ -80,6 +84,16 @@ config PPC_PMAC select ADB_PMU select U3_DART +config PPC_MAPLE + depends on PPC_MULTIPLATFORM + bool " Maple 970FX Evaluation Board" + select U3_DART + select MPIC_BROKEN_U3 + default n + help + This option enables support for the Maple 970FX Evaluation Board. + For more informations, refer to + config PPC bool default y @@ -110,11 +124,21 @@ config PPC_SPLPAR processors, that is, which share physical processors between two or more partitions. +config IBMVIO + depends on PPC_PSERIES || PPC_ISERIES + bool + default y + config U3_DART bool depends on PPC_MULTIPLATFORM default n +config MPIC_BROKEN_U3 + bool + depends on PPC_MAPLE + default y + config PPC_PMAC64 bool depends on PPC_PMAC @@ -162,14 +186,6 @@ config SMP If you don't know what to do here, say Y. -config IRQ_ALL_CPUS - bool "Distribute interrupts on all CPUs by default" - depends on SMP && PPC_MULTIPLATFORM - help - This option gives the kernel permission to distribute IRQs across - multiple CPUs. Saying N here will route all IRQs to the first - CPU. - config NR_CPUS int "Maximum number of CPUs (2-128)" range 2 128 @@ -207,6 +223,29 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +config PREEMPT_BKL + bool "Preempt The Big Kernel Lock" + depends on PREEMPT + default y + help + This option reduces the latency of the kernel by making the + big kernel lock preemptible. + + Say Y here if you are building a kernel for a desktop system. + Say N if you are unsure. + +config EEH + bool "PCI Extended Error Handling (EEH)" if EMBEDDED + depends on PPC_PSERIES + default y if !EMBEDDED + +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + config MSCHUNKS bool depends on PPC_ISERIES @@ -274,7 +313,8 @@ source "drivers/pci/Kconfig" config HOTPLUG_CPU bool "Support for hot-pluggable CPUs" - depends on SMP && HOTPLUG && EXPERIMENTAL && PPC_PSERIES + depends on SMP && EXPERIMENTAL && PPC_PSERIES + select HOTPLUG ---help--- Say Y here to be able to turn CPUs off and on. @@ -351,6 +391,11 @@ source "kernel/vserver/Kconfig" source "security/Kconfig" +config KEYS_COMPAT + bool + depends on COMPAT && KEYS + default y + source "crypto/Kconfig" source "lib/Kconfig" diff --git a/arch/ppc64/Kconfig.debug b/arch/ppc64/Kconfig.debug index c3cd4c747..e341a129d 100644 --- a/arch/ppc64/Kconfig.debug +++ b/arch/ppc64/Kconfig.debug @@ -6,6 +6,16 @@ config DEBUG_STACKOVERFLOW bool "Check for stack overflows" depends on DEBUG_KERNEL +config KPROBES + bool "Kprobes" + depends on DEBUG_KERNEL + help + Kprobes allows you to trap at almost any kernel address and + execute a callback function. register_kprobe() establishes + a probepoint and specifies the callback. Kprobes is useful + for kernel debugging, non-intrusive instrumentation and testing. + If in doubt, say "N". + config DEBUG_STACK_USAGE bool "Stack utilization instrumentation" depends on DEBUG_KERNEL @@ -24,7 +34,7 @@ config DEBUGGER config XMON bool "Include xmon kernel debugger" - depends on DEBUGGER + depends on DEBUGGER && !PPC_ISERIES help Include in-kernel hooks for the xmon kernel monitor/debugger. Unless you are intending to debug the kernel, say N here. @@ -44,16 +54,4 @@ config IRQSTACKS for handling hard and soft interrupts. This can help avoid overflowing the process kernel stacks. -config SCHEDSTATS - bool "Collect scheduler statistics" - depends on DEBUG_KERNEL && PROC_FS - help - If you say Y here, additional code will be inserted into the - scheduler and related routines to collect statistics about - scheduler behavior and provide them in /proc/schedstat. These - stats may be useful for both tuning and debugging the scheduler - If you aren't debugging the scheduler or trying to tune a specific - application, you can say N to avoid the very slight overhead - this adds. - endmenu diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile index 59fdc0e27..e8f9cd714 100644 --- a/arch/ppc64/Makefile +++ b/arch/ppc64/Makefile @@ -32,10 +32,15 @@ CHECKFLAGS += -m64 -D__powerpc__ LDFLAGS := -m elf64ppc LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) -CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none +CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \ + -mcall-aixdesc ifeq ($(CONFIG_POWER4_ONLY),y) +ifeq ($(CONFIG_ALTIVEC),y) + CFLAGS += $(call cc-option,-mcpu=970) +else CFLAGS += $(call cc-option,-mcpu=power4) +endif else CFLAGS += $(call cc-option,-mtune=power4) endif @@ -55,11 +60,13 @@ drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/ boot := arch/ppc64/boot boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd +boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm $(boottarget-y): vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ bootimage-$(CONFIG_PPC_PSERIES) := zImage +bootimage-$(CONFIG_PPC_MAPLE) := zImage bootimage-$(CONFIG_PPC_ISERIES) := vmlinux BOOTIMAGE := $(bootimage-y) install: vmlinux diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile index 8f99c9dbc..9963fedcc 100644 --- a/arch/ppc64/boot/Makefile +++ b/arch/ppc64/boot/Makefile @@ -118,6 +118,6 @@ $(obj)/imagesize.c: vmlinux.strip >> $(obj)/imagesize.c install: $(CONFIGURE) $(obj)/$(BOOTIMAGE) - sh -x $(src)/install.sh "$(KERNELRELEASE)" "$(obj)/$(BOOTIMAGE)" "$(INSTALL_PATH)" + sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" "$(obj)/$(BOOTIMAGE)" "$(INSTALL_PATH)" clean-files := $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip) diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c index 6cf78020a..4ce7f85bb 100644 --- a/arch/ppc64/boot/main.c +++ b/arch/ppc64/boot/main.c @@ -73,7 +73,7 @@ void *stdin; void *stdout; void *stderr; -#define DEBUG +#undef DEBUG static unsigned long claim_base = PROG_START; @@ -166,7 +166,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr) gunzip((void *)vmlinux.addr, vmlinux.size, (unsigned char *)vmlinuz.addr, &len); printf("done 0x%lx bytes\n\r", len); - printf("0x%x bytes of heap consumed, max in use 0x%\n\r", + printf("0x%x bytes of heap consumed, max in use 0x%x\n\r", (unsigned)(avail_high - begin_avail), heap_max); } else { memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size); diff --git a/arch/ppc64/boot/string.S b/arch/ppc64/boot/string.S index 105368607..ba5f2d21c 100644 --- a/arch/ppc64/boot/string.S +++ b/arch/ppc64/boot/string.S @@ -96,13 +96,6 @@ memset: bdnz 8b blr - .globl bcopy -bcopy: - mr r6,r3 - mr r3,r4 - mr r4,r6 - b memcpy - .globl memmove memmove: cmplw 0,r3,r4 diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig index 9cc01b5ba..39c0eb00d 100644 --- a/arch/ppc64/configs/g5_defconfig +++ b/arch/ppc64/configs/g5_defconfig @@ -440,7 +440,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y -# CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig index 84ae55bcc..0ee69246b 100644 --- a/arch/ppc64/configs/iSeries_defconfig +++ b/arch/ppc64/configs/iSeries_defconfig @@ -316,7 +316,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig index 73981148d..a56c5ee9c 100644 --- a/arch/ppc64/configs/pSeries_defconfig +++ b/arch/ppc64/configs/pSeries_defconfig @@ -268,7 +268,7 @@ CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set -CONFIG_SCSI_IBMVSCSI=m +CONFIG_SCSI_IBMVSCSI=y # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 @@ -408,7 +408,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -493,7 +492,7 @@ CONFIG_VORTEX=y # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set -CONFIG_IBMVETH=m +CONFIG_IBMVETH=y CONFIG_NET_PCI=y CONFIG_PCNET32=y # CONFIG_AMD8111_ETH is not set diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig index f5503873a..cdee0276b 100644 --- a/arch/ppc64/defconfig +++ b/arch/ppc64/defconfig @@ -374,7 +374,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m diff --git a/arch/ppc64/kernel/HvLpEvent.c b/arch/ppc64/kernel/HvLpEvent.c index 93eea792f..9802beefa 100644 --- a/arch/ppc64/kernel/HvLpEvent.c +++ b/arch/ppc64/kernel/HvLpEvent.c @@ -34,10 +34,18 @@ int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler handler int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType ) { int rc = 1; + + might_sleep(); + if ( eventType < HvLpEvent_Type_NumTypes ) { if ( !lpEventHandlerPaths[eventType] ) { lpEventHandler[eventType] = NULL; rc = 0; + + /* We now sleep until all other CPUs have scheduled. This ensures that + * the deletion is seen by all other CPUs, and that the deleted handler + * isn't still running on another CPU when we return. */ + synchronize_kernel(); } } return rc; diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c index 73d919bf8..bfda45cf8 100644 --- a/arch/ppc64/kernel/LparData.c +++ b/arch/ppc64/kernel/LparData.c @@ -6,18 +6,17 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include -#include -#include +#include +#include #include #include +#include #include #include #include #include -#include #include -#include +#include #include #include #include @@ -42,86 +41,91 @@ struct ItLpQueue xItLpQueue __attribute__((__section__(".data"))); */ struct HvReleaseData hvReleaseData = { - 0xc8a5d9c4, /* desc = "HvRD" ebcdic */ - sizeof(struct HvReleaseData), - offsetof(struct naca_struct, xItVpdAreas), - (struct naca_struct *)(NACA_VIRT_ADDR), /* 64-bit Naca address */ - 0x6000, /* offset of LparMap within loadarea (see head.S) */ - 0, - 1, /* tags inactive */ - 0, /* 64 bit */ - 0, /* shared processors */ - 0, /* HMT allowed */ - 6, /* TEMP: This allows non-GA driver */ - 4, /* We are v5r2m0 */ - 3, /* Min supported PLIC = v5r1m0 */ - 3, /* Min usable PLIC = v5r1m0 */ - { 0xd3, 0x89, 0x95, 0xa4, /* "Linux 2.4 "*/ - 0xa7, 0x40, 0xf2, 0x4b, - 0xf4, 0x4b, 0xf6, 0xf4 }, - {0} + .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ + .xSize = sizeof(struct HvReleaseData), + .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas), + .xSlicNacaAddr = &naca, /* 64-bit Naca address */ + .xMsNucDataOffset = 0x6000, /* offset of LparMap within loadarea (see head.S) */ + .xTagsMode = 1, /* tags inactive */ + .xAddressSize = 0, /* 64 bit */ + .xNoSharedProcs = 0, /* shared processors */ + .xNoHMT = 0, /* HMT allowed */ + .xRsvd2 = 6, /* TEMP: This allows non-GA driver */ + .xVrmIndex = 4, /* We are v5r2m0 */ + .xMinSupportedPlicVrmIndex = 3, /* v5r1m0 */ + .xMinCompatablePlicVrmIndex = 3, /* v5r1m0 */ + .xVrmName = { 0xd3, 0x89, 0x95, 0xa4, /* "Linux 2.4.64" ebcdic */ + 0xa7, 0x40, 0xf2, 0x4b, + 0xf4, 0x4b, 0xf6, 0xf4 }, }; -extern void SystemReset_Iseries(void); -extern void MachineCheck_Iseries(void); -extern void DataAccess_Iseries(void); -extern void InstructionAccess_Iseries(void); -extern void HardwareInterrupt_Iseries(void); -extern void Alignment_Iseries(void); -extern void ProgramCheck_Iseries(void); -extern void FPUnavailable_Iseries(void); -extern void Decrementer_Iseries(void); -extern void Trap_0a_Iseries(void); -extern void Trap_0b_Iseries(void); -extern void SystemCall_Iseries(void); -extern void SingleStep_Iseries(void); -extern void Trap_0e_Iseries(void); -extern void PerformanceMonitor_Iseries(void); -extern void DataAccessSLB_Iseries(void); -extern void InstructionAccessSLB_Iseries(void); +extern void system_reset_iSeries(void); +extern void machine_check_iSeries(void); +extern void data_access_iSeries(void); +extern void instruction_access_iSeries(void); +extern void hardware_interrupt_iSeries(void); +extern void alignment_iSeries(void); +extern void program_check_iSeries(void); +extern void fp_unavailable_iSeries(void); +extern void decrementer_iSeries(void); +extern void trap_0a_iSeries(void); +extern void trap_0b_iSeries(void); +extern void system_call_iSeries(void); +extern void single_step_iSeries(void); +extern void trap_0e_iSeries(void); +extern void performance_monitor_iSeries(void); +extern void data_access_slb_iSeries(void); +extern void instruction_access_slb_iSeries(void); struct ItLpNaca itLpNaca = { - 0xd397d581, /* desc = "LpNa" ebcdic */ - 0x0400, /* size of ItLpNaca */ - 0x0300, 19, /* offset to int array, # ents */ - 0, 0, 0, /* Part # of primary, serv, me */ - 0, 0x100, /* # of LP queues, offset */ - 0, 0, 0, /* Piranha stuff */ - { 0,0,0,0,0 }, /* reserved */ - 0,0,0,0,0,0,0, /* stuff */ - { 0,0,0,0,0 }, /* reserved */ - 0, /* reserved */ - 0, /* VRM index of PLIC */ - 0, 0, /* min supported, compat SLIC */ - 0, /* 64-bit addr of load area */ - 0, /* chunks for load area */ - 0, 0, /* PASE mask, seg table */ - { 0 }, /* 64 reserved bytes */ - { 0 }, /* 128 reserved bytes */ - { 0 }, /* Old LP Queue */ - { 0 }, /* 384 reserved bytes */ - { - (u64)SystemReset_Iseries, /* 0x100 System Reset */ - (u64)MachineCheck_Iseries, /* 0x200 Machine Check */ - (u64)DataAccess_Iseries, /* 0x300 Data Access */ - (u64)InstructionAccess_Iseries, /* 0x400 Instruction Access */ - (u64)HardwareInterrupt_Iseries, /* 0x500 External */ - (u64)Alignment_Iseries, /* 0x600 Alignment */ - (u64)ProgramCheck_Iseries, /* 0x700 Program Check */ - (u64)FPUnavailable_Iseries, /* 0x800 FP Unavailable */ - (u64)Decrementer_Iseries, /* 0x900 Decrementer */ - (u64)Trap_0a_Iseries, /* 0xa00 Trap 0A */ - (u64)Trap_0b_Iseries, /* 0xb00 Trap 0B */ - (u64)SystemCall_Iseries, /* 0xc00 System Call */ - (u64)SingleStep_Iseries, /* 0xd00 Single Step */ - (u64)Trap_0e_Iseries, /* 0xe00 Trap 0E */ - (u64)PerformanceMonitor_Iseries,/* 0xf00 Performance Monitor */ + .xDesc = 0xd397d581, /* "LpNa" ebcdic */ + .xSize = 0x0400, /* size of ItLpNaca */ + .xIntHdlrOffset = 0x0300, /* offset to int array */ + .xMaxIntHdlrEntries = 19, /* # ents */ + .xPrimaryLpIndex = 0, /* Part # of primary */ + .xServiceLpIndex = 0, /* Part # of serv */ + .xLpIndex = 0, /* Part # of me */ + .xMaxLpQueues = 0, /* # of LP queues */ + .xLpQueueOffset = 0x100, /* offset of start of LP queues */ + .xPirEnvironMode = 0, /* Piranha stuff */ + .xPirConsoleMode = 0, + .xPirDasdMode = 0, + .xLparInstalled = 0, + .xSysPartitioned = 0, + .xHwSyncedTBs = 0, + .xIntProcUtilHmt = 0, + .xSpVpdFormat = 0, + .xIntProcRatio = 0, + .xPlicVrmIndex = 0, /* VRM index of PLIC */ + .xMinSupportedSlicVrmInd = 0, /* min supported SLIC */ + .xMinCompatableSlicVrmInd = 0, /* min compat SLIC */ + .xLoadAreaAddr = 0, /* 64-bit addr of load area */ + .xLoadAreaChunks = 0, /* chunks for load area */ + .xPaseSysCallCRMask = 0, /* PASE mask */ + .xSlicSegmentTablePtr = 0, /* seg table */ + .xOldLpQueue = { 0 }, /* Old LP Queue */ + .xInterruptHdlr = { + (u64)system_reset_iSeries, /* 0x100 System Reset */ + (u64)machine_check_iSeries, /* 0x200 Machine Check */ + (u64)data_access_iSeries, /* 0x300 Data Access */ + (u64)instruction_access_iSeries, /* 0x400 Instruction Access */ + (u64)hardware_interrupt_iSeries, /* 0x500 External */ + (u64)alignment_iSeries, /* 0x600 Alignment */ + (u64)program_check_iSeries, /* 0x700 Program Check */ + (u64)fp_unavailable_iSeries, /* 0x800 FP Unavailable */ + (u64)decrementer_iSeries, /* 0x900 Decrementer */ + (u64)trap_0a_iSeries, /* 0xa00 Trap 0A */ + (u64)trap_0b_iSeries, /* 0xb00 Trap 0B */ + (u64)system_call_iSeries, /* 0xc00 System Call */ + (u64)single_step_iSeries, /* 0xd00 Single Step */ + (u64)trap_0e_iSeries, /* 0xe00 Trap 0E */ + (u64)performance_monitor_iSeries,/* 0xf00 Performance Monitor */ 0, /* int 0x1000 */ 0, /* int 0x1010 */ 0, /* int 0x1020 CPU ctls */ - (u64)HardwareInterrupt_Iseries, /* SC Ret Hdlr */ - (u64)DataAccessSLB_Iseries, /* 0x380 D-SLB */ - (u64)InstructionAccessSLB_Iseries /* 0x480 I-SLB */ + (u64)hardware_interrupt_iSeries, /* SC Ret Hdlr */ + (u64)data_access_slb_iSeries, /* 0x380 D-SLB */ + (u64)instruction_access_slb_iSeries /* 0x480 I-SLB */ } }; EXPORT_SYMBOL(itLpNaca); @@ -154,10 +158,8 @@ u64 xMsVpd[3400] __attribute__((__section__(".data"))); u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data"))); struct SpCommArea xSpCommArea = { - 0xE2D7C3C2, - 1, - {0}, - 0, 0, 0, 0, {0} + .xDesc = 0xE2D7C3C2, + .xFormat = 1, }; /* The LparMap data is now located at offset 0x6000 in head.S @@ -169,22 +171,21 @@ struct SpCommArea xSpCommArea = { * offset into the Naca of the pointer to the ItVpdAreas. */ struct ItVpdAreas itVpdAreas = { - 0xc9a3e5c1, /* "ItVA" */ - sizeof( struct ItVpdAreas ), - 0, 0, - 26, /* # VPD array entries */ - 10, /* # DMA array entries */ - NR_CPUS*2, maxPhysicalProcessors, /* Max logical, physical procs */ - offsetof(struct ItVpdAreas,xPlicDmaToks),/* offset to DMA toks */ - offsetof(struct ItVpdAreas,xSlicVpdAdrs),/* offset to VPD addrs */ - offsetof(struct ItVpdAreas,xPlicDmaLens),/* offset to DMA lens */ - offsetof(struct ItVpdAreas,xSlicVpdLens),/* offset to VPD lens */ - 0, /* max slot labels */ - 1, /* max LP queues */ - {0}, {0}, /* reserved */ - {0}, /* DMA lengths */ - {0}, /* DMA tokens */ - { /* VPD lengths */ + .xSlicDesc = 0xc9a3e5c1, /* "ItVA" */ + .xSlicSize = sizeof(struct ItVpdAreas), + .xSlicVpdEntries = ItVpdMaxEntries, /* # VPD array entries */ + .xSlicDmaEntries = ItDmaMaxEntries, /* # DMA array entries */ + .xSlicMaxLogicalProcs = NR_CPUS * 2, /* Max logical procs */ + .xSlicMaxPhysicalProcs = maxPhysicalProcessors, /* Max physical procs */ + .xSlicDmaToksOffset = offsetof(struct ItVpdAreas, xPlicDmaToks), + .xSlicVpdAdrsOffset = offsetof(struct ItVpdAreas, xSlicVpdAdrs), + .xSlicDmaLensOffset = offsetof(struct ItVpdAreas, xPlicDmaLens), + .xSlicVpdLensOffset = offsetof(struct ItVpdAreas, xSlicVpdLens), + .xSlicMaxSlotLabels = 0, /* max slot labels */ + .xSlicMaxLpQueues = 1, /* max LP queues */ + .xPlicDmaLens = { 0 }, /* DMA lengths */ + .xPlicDmaToks = { 0 }, /* DMA tokens */ + .xSlicVpdLens = { /* VPD lengths */ 0,0,0, /* 0 - 2 */ sizeof(xItExtVpdPanel), /* 3 Extended VPD */ sizeof(struct paca_struct), /* 4 length of Paca */ @@ -202,7 +203,7 @@ struct ItVpdAreas itVpdAreas = { sizeof(struct ItLpQueue),/* 23 length of Lp Queue */ 0,0 /* 24 - 25 */ }, - { /* VPD addresses */ + .xSlicVpdAdrs = { /* VPD addresses */ 0,0,0, /* 0 - 2 */ &xItExtVpdPanel, /* 3 Extended VPD */ &paca[0], /* 4 first Paca */ diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 020b64fac..09ddd5074 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile @@ -11,29 +11,29 @@ obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \ ptrace32.o signal32.o rtc.o init_task.o \ lmb.o cputable.o cpu_setup_power4.o idle_power4.o \ - iommu.o sysfs.o vio.o + iommu.o sysfs.o obj-$(CONFIG_PPC_OF) += of_device.o -pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o \ - iSeries_IoMmTable.o -pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_dma_direct.o +pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o +pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \ iSeries_VpdInfo.o XmPciLpEvent.o \ - HvCall.o HvLpConfig.o LparData.o mf_proc.o \ + HvCall.o HvLpConfig.o LparData.o \ iSeries_setup.o ItLpQueue.o hvCall.o \ mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \ iSeries_iommu.o -obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o open_pic.o i8259.o prom_init.o prom.o +obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o prom.o mpic.o obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \ - eeh.o pSeries_nvram.o rtasd.o ras.o \ + pSeries_nvram.o rtasd.o ras.o \ xics.o rtas.o pSeries_setup.o pSeries_iommu.o +obj-$(CONFIG_EEH) += eeh.o obj-$(CONFIG_PROC_FS) += proc_ppc64.o obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o obj-$(CONFIG_SMP) += smp.o @@ -45,16 +45,23 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o obj-$(CONFIG_BOOTX_TEXT) += btext.o obj-$(CONFIG_HVCS) += hvcserver.o +obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_PPC_PMAC) += pmac_setup.o pmac_feature.o pmac_pci.o \ - pmac_time.o pmac_nvram.o pmac_low_i2c.o \ - open_pic_u3.o + pmac_time.o pmac_nvram.o pmac_low_i2c.o + +obj-$(CONFIG_PPC_MAPLE) += maple_setup.o maple_pci.o maple_time.o + obj-$(CONFIG_U3_DART) += u3_iommu.o ifdef CONFIG_SMP obj-$(CONFIG_PPC_PMAC) += pmac_smp.o smp-tbsync.o +obj-$(CONFIG_PPC_ISERIES) += iSeries_smp.o +obj-$(CONFIG_PPC_PSERIES) += pSeries_smp.o +obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o endif obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o +obj-$(CONFIG_KPROBES) += kprobes.o CFLAGS_ioctl32.o += -Ifs/ diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c index 618592161..11a85558d 100644 --- a/arch/ppc64/kernel/asm-offsets.c +++ b/arch/ppc64/kernel/asm-offsets.c @@ -28,13 +28,13 @@ #include #include -#include #include -#include +#include #include #include #include #include +#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) @@ -67,14 +67,12 @@ int main(void) #endif /* CONFIG_ALTIVEC */ DEFINE(MM, offsetof(struct task_struct, mm)); - /* naca */ - DEFINE(PACA, offsetof(struct naca_struct, paca)); - DEFINE(DCACHEL1LINESIZE, offsetof(struct systemcfg, dCacheL1LineSize)); - DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct naca_struct, dCacheL1LogLineSize)); - DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct naca_struct, dCacheL1LinesPerPage)); - DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize)); - DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize)); - DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage)); + DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size)); + DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size)); + DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page)); + DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); + DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); + DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); /* paca */ @@ -103,10 +101,11 @@ int main(void) DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi)); DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); - DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0)); - DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1)); - DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt)); - DEFINE(LPPACADECRINT, offsetof(struct ItLpPaca, xIntDword.xFields.xDecrInt)); + DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); + DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); + DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1)); + DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int)); + DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int)); /* RTAS */ DEFINE(RTASBASE, offsetof(struct rtas_t, base)); diff --git a/arch/ppc64/kernel/binfmt_elf32.c b/arch/ppc64/kernel/binfmt_elf32.c index 478e5fce6..fadc699a0 100644 --- a/arch/ppc64/kernel/binfmt_elf32.c +++ b/arch/ppc64/kernel/binfmt_elf32.c @@ -60,10 +60,12 @@ struct elf_prpsinfo32 #include -#define jiffies_to_timeval jiffies_to_compat_timeval +#undef cputime_to_timeval +#define cputime_to_timeval cputime_to_compat_timeval static __inline__ void -jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) +cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { + unsigned long jiffies = cputime_to_jiffies(cputime); value->tv_usec = (jiffies % HZ) * (1000000L / HZ); value->tv_sec = jiffies / HZ; } diff --git a/arch/ppc64/kernel/bitops.c b/arch/ppc64/kernel/bitops.c index 6b24b0219..ae329e8b4 100644 --- a/arch/ppc64/kernel/bitops.c +++ b/arch/ppc64/kernel/bitops.c @@ -4,7 +4,7 @@ #include #include -#include +#include #include unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, diff --git a/arch/ppc64/kernel/cpu_setup_power4.S b/arch/ppc64/kernel/cpu_setup_power4.S index 0e009850f..3bd951820 100644 --- a/arch/ppc64/kernel/cpu_setup_power4.S +++ b/arch/ppc64/kernel/cpu_setup_power4.S @@ -156,6 +156,15 @@ _GLOBAL(__restore_cpu_setup) cror 4*cr0+eq,4*cr0+eq,4*cr1+eq bne 1f + /* Before accessing memory, we make sure rm_ci is clear */ + li r0,0 + mfspr r3,SPRN_HID4 + rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */ + sync + mtspr SPRN_HID4,r3 + isync + sync + /* Clear interrupt prefix */ li r0,0 sync diff --git a/arch/ppc64/kernel/dma.c b/arch/ppc64/kernel/dma.c index 68d517fa4..c08725182 100644 --- a/arch/ppc64/kernel/dma.c +++ b/arch/ppc64/kernel/dma.c @@ -17,8 +17,10 @@ int dma_supported(struct device *dev, u64 mask) { if (dev->bus == &pci_bus_type) return pci_dma_supported(to_pci_dev(dev), mask); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_dma_supported(to_vio_dev(dev), mask); +#endif /* CONFIG_IBMVIO */ BUG(); return 0; } @@ -28,8 +30,10 @@ int dma_set_mask(struct device *dev, u64 dma_mask) { if (dev->bus == &pci_bus_type) return pci_set_dma_mask(to_pci_dev(dev), dma_mask); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_set_dma_mask(to_vio_dev(dev), dma_mask); +#endif /* CONFIG_IBMVIO */ BUG(); return 0; } @@ -40,8 +44,10 @@ void *dma_alloc_coherent(struct device *dev, size_t size, { if (dev->bus == &pci_bus_type) return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_alloc_consistent(to_vio_dev(dev), size, dma_handle); +#endif /* CONFIG_IBMVIO */ BUG(); return NULL; } @@ -52,8 +58,10 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, { if (dev->bus == &pci_bus_type) pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); +#ifdef CONFIG_IBMVIO else if (dev->bus == &vio_bus_type) vio_free_consistent(to_vio_dev(dev), size, cpu_addr, dma_handle); +#endif /* CONFIG_IBMVIO */ else BUG(); } @@ -64,8 +72,10 @@ dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, { if (dev->bus == &pci_bus_type) return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_map_single(to_vio_dev(dev), cpu_addr, size, direction); +#endif /* CONFIG_IBMVIO */ BUG(); return (dma_addr_t)0; } @@ -76,8 +86,10 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, { if (dev->bus == &pci_bus_type) pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); +#ifdef CONFIG_IBMVIO else if (dev->bus == &vio_bus_type) vio_unmap_single(to_vio_dev(dev), dma_addr, size, direction); +#endif /* CONFIG_IBMVIO */ else BUG(); } @@ -89,8 +101,10 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page, { if (dev->bus == &pci_bus_type) return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_map_page(to_vio_dev(dev), page, offset, size, direction); +#endif /* CONFIG_IBMVIO */ BUG(); return (dma_addr_t)0; } @@ -101,8 +115,10 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, { if (dev->bus == &pci_bus_type) pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); +#ifdef CONFIG_IBMVIO else if (dev->bus == &vio_bus_type) vio_unmap_page(to_vio_dev(dev), dma_address, size, direction); +#endif /* CONFIG_IBMVIO */ else BUG(); } @@ -113,8 +129,10 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, { if (dev->bus == &pci_bus_type) return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); +#ifdef CONFIG_IBMVIO if (dev->bus == &vio_bus_type) return vio_map_sg(to_vio_dev(dev), sg, nents, direction); +#endif /* CONFIG_IBMVIO */ BUG(); return 0; } @@ -125,8 +143,10 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, { if (dev->bus == &pci_bus_type) pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); +#ifdef CONFIG_IBMVIO else if (dev->bus == &vio_bus_type) vio_unmap_sg(to_vio_dev(dev), sg, nhwentries, direction); +#endif /* CONFIG_IBMVIO */ else BUG(); } diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c index 6e87e5631..0f8d1c44a 100644 --- a/arch/ppc64/kernel/eeh.c +++ b/arch/ppc64/kernel/eeh.c @@ -17,54 +17,108 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include +#include +#include +#include #include #include -#include -#include #include -#include #include -#include -#include -#include +#include +#include #include #include -#include #include +#include +#include #include "pci.h" #undef DEBUG +/** Overview: + * EEH, or "Extended Error Handling" is a PCI bridge technology for + * dealing with PCI bus errors that can't be dealt with within the + * usual PCI framework, except by check-stopping the CPU. Systems + * that are designed for high-availability/reliability cannot afford + * to crash due to a "mere" PCI error, thus the need for EEH. + * An EEH-capable bridge operates by converting a detected error + * into a "slot freeze", taking the PCI adapter off-line, making + * the slot behave, from the OS'es point of view, as if the slot + * were "empty": all reads return 0xff's and all writes are silently + * ignored. EEH slot isolation events can be triggered by parity + * errors on the address or data busses (e.g. during posted writes), + * which in turn might be caused by dust, vibration, humidity, + * radioactivity or plain-old failed hardware. + * + * Note, however, that one of the leading causes of EEH slot + * freeze events are buggy device drivers, buggy device microcode, + * or buggy device hardware. This is because any attempt by the + * device to bus-master data to a memory address that is not + * assigned to the device will trigger a slot freeze. (The idea + * is to prevent devices-gone-wild from corrupting system memory). + * Buggy hardware/drivers will have a miserable time co-existing + * with EEH. + * + * Ideally, a PCI device driver, when suspecting that an isolation + * event has occured (e.g. by reading 0xff's), will then ask EEH + * whether this is the case, and then take appropriate steps to + * reset the PCI slot, the PCI device, and then resume operations. + * However, until that day, the checking is done here, with the + * eeh_check_failure() routine embedded in the MMIO macros. If + * the slot is found to be isolated, an "EEH Event" is synthesized + * and sent out for processing. + */ + +/** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */ #define BUID_HI(buid) ((buid) >> 32) #define BUID_LO(buid) ((buid) & 0xffffffff) -#define CONFIG_ADDR(busno, devfn) \ - (((((busno) & 0xff) << 8) | ((devfn) & 0xf8)) << 8) + +/* EEH event workqueue setup. */ +static DEFINE_SPINLOCK(eeh_eventlist_lock); +LIST_HEAD(eeh_eventlist); +static void eeh_event_handler(void *); +DECLARE_WORK(eeh_event_wq, eeh_event_handler, NULL); + +static struct notifier_block *eeh_notifier_chain; + +/* + * If a device driver keeps reading an MMIO register in an interrupt + * handler after a slot isolation event has occurred, we assume it + * is broken and panic. This sets the threshold for how many read + * attempts we allow before panicking. + */ +#define EEH_MAX_FAILS 1000 +static atomic_t eeh_fail_count; /* RTAS tokens */ static int ibm_set_eeh_option; static int ibm_set_slot_reset; static int ibm_read_slot_reset_state; +static int ibm_read_slot_reset_state2; static int ibm_slot_error_detail; static int eeh_subsystem_enabled; /* Buffer for reporting slot-error-detail rtas calls */ static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX]; -static spinlock_t slot_errbuf_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(slot_errbuf_lock); static int eeh_error_buf_size; /* System monitoring statistics */ static DEFINE_PER_CPU(unsigned long, total_mmio_ffs); static DEFINE_PER_CPU(unsigned long, false_positives); static DEFINE_PER_CPU(unsigned long, ignored_failures); +static DEFINE_PER_CPU(unsigned long, slot_resets); /** * The pci address cache subsystem. This subsystem places * PCI device address resources into a red-black tree, sorted * according to the address range, so that given only an i/o * address, the corresponding PCI device can be **quickly** - * found. + * found. It is safe to perform an address lookup in an interrupt + * context; this ability is an important feature. * * Currently, the only customer of this code is the EEH subsystem; * thus, this code has been somewhat tailored to suit EEH better. @@ -333,6 +387,115 @@ void __init pci_addr_cache_build(void) #endif } +/* --------------------------------------------------------------- */ +/* Above lies the PCI Address Cache. Below lies the EEH event infrastructure */ + +/** + * eeh_register_notifier - Register to find out about EEH events. + * @nb: notifier block to callback on events + */ +int eeh_register_notifier(struct notifier_block *nb) +{ + return notifier_chain_register(&eeh_notifier_chain, nb); +} + +/** + * eeh_unregister_notifier - Unregister to an EEH event notifier. + * @nb: notifier block to callback on events + */ +int eeh_unregister_notifier(struct notifier_block *nb) +{ + return notifier_chain_unregister(&eeh_notifier_chain, nb); +} + +/** + * read_slot_reset_state - Read the reset state of a device node's slot + * @dn: device node to read + * @rets: array to return results in + */ +static int read_slot_reset_state(struct device_node *dn, int rets[]) +{ + int token, outputs; + + if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) { + token = ibm_read_slot_reset_state2; + outputs = 4; + } else { + token = ibm_read_slot_reset_state; + outputs = 3; + } + + return rtas_call(token, 3, outputs, rets, dn->eeh_config_addr, + BUID_HI(dn->phb->buid), BUID_LO(dn->phb->buid)); +} + +/** + * eeh_panic - call panic() for an eeh event that cannot be handled. + * The philosophy of this routine is that it is better to panic and + * halt the OS than it is to risk possible data corruption by + * oblivious device drivers that don't know better. + * + * @dev pci device that had an eeh event + * @reset_state current reset state of the device slot + */ +static void eeh_panic(struct pci_dev *dev, int reset_state) +{ + /* + * XXX We should create a separate sysctl for this. + * + * Since the panic_on_oops sysctl is used to halt the system + * in light of potential corruption, we can use it here. + */ + if (panic_on_oops) + panic("EEH: MMIO failure (%d) on device:%s %s\n", reset_state, + pci_name(dev), pci_pretty_name(dev)); + else { + __get_cpu_var(ignored_failures)++; + printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s %s\n", + reset_state, pci_name(dev), pci_pretty_name(dev)); + } +} + +/** + * eeh_event_handler - dispatch EEH events. The detection of a frozen + * slot can occur inside an interrupt, where it can be hard to do + * anything about it. The goal of this routine is to pull these + * detection events out of the context of the interrupt handler, and + * re-dispatch them for processing at a later time in a normal context. + * + * @dummy - unused + */ +static void eeh_event_handler(void *dummy) +{ + unsigned long flags; + struct eeh_event *event; + + while (1) { + spin_lock_irqsave(&eeh_eventlist_lock, flags); + event = NULL; + if (!list_empty(&eeh_eventlist)) { + event = list_entry(eeh_eventlist.next, struct eeh_event, list); + list_del(&event->list); + } + spin_unlock_irqrestore(&eeh_eventlist_lock, flags); + if (event == NULL) + break; + + printk(KERN_INFO "EEH: MMIO failure (%d), notifiying device " + "%s %s\n", event->reset_state, + pci_name(event->dev), pci_pretty_name(event->dev)); + + atomic_set(&eeh_fail_count, 0); + notifier_call_chain (&eeh_notifier_chain, + EEH_NOTIFY_FREEZE, event); + + __get_cpu_var(slot_resets)++; + + pci_dev_put(event->dev); + kfree(event); + } +} + /** * eeh_token_to_phys - convert EEH address token to phys address * @token i/o token, should be address in the form 0xE.... @@ -357,19 +520,21 @@ static inline unsigned long eeh_token_to_phys(unsigned long token) * * Check for an EEH failure for the given device node. Call this * routine if the result of a read was all 0xff's and you want to - * find out if this is due to an EEH slot freeze event. This routine + * find out if this is due to an EEH slot freeze. This routine * will query firmware for the EEH status. * * Returns 0 if there has not been an EEH error; otherwise returns - * an error code. + * a non-zero value and queues up a solt isolation event notification. * * It is safe to call this routine in an interrupt context. */ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) { int ret; - int rets[2]; + int rets[3]; unsigned long flags; + int rc, reset_state; + struct eeh_event *event; __get_cpu_var(total_mmio_ffs)++; @@ -389,6 +554,21 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) return 0; } + /* + * If we already have a pending isolation event for this + * slot, we know it's bad already, we don't need to check... + */ + if (dn->eeh_mode & EEH_MODE_ISOLATED) { + atomic_inc(&eeh_fail_count); + if (atomic_read(&eeh_fail_count) >= EEH_MAX_FAILS) { + /* re-read the slot reset state */ + if (read_slot_reset_state(dn, rets) != 0) + rets[0] = -1; /* reset state unknown */ + eeh_panic(dev, rets[0]); + } + return 0; + } + /* * Now test for an EEH failure. This is VERY expensive. * Note that the eeh_config_addr may be a parent device @@ -396,51 +576,55 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) * function zero of a multi-function device. * In any case they must share a common PHB. */ - ret = rtas_call(ibm_read_slot_reset_state, 3, 3, rets, - dn->eeh_config_addr, BUID_HI(dn->phb->buid), - BUID_LO(dn->phb->buid)); - - if (ret == 0 && rets[1] == 1 && (rets[0] == 2 || rets[0] == 4)) { - int log_event; - - spin_lock_irqsave(&slot_errbuf_lock, flags); - memset(slot_errbuf, 0, eeh_error_buf_size); - - log_event = rtas_call(ibm_slot_error_detail, - 8, 1, NULL, dn->eeh_config_addr, - BUID_HI(dn->phb->buid), - BUID_LO(dn->phb->buid), NULL, 0, - virt_to_phys(slot_errbuf), - eeh_error_buf_size, - 1 /* Temporary Error */); - - if (log_event == 0) - log_error(slot_errbuf, ERR_TYPE_RTAS_LOG, - 1 /* Fatal */); - - spin_unlock_irqrestore(&slot_errbuf_lock, flags); - - printk(KERN_INFO "EEH: MMIO failure (%d) on device: %s %s\n", - rets[0], dn->name, dn->full_name); - WARN_ON(1); - - /* - * XXX We should create a separate sysctl for this. - * - * Since the panic_on_oops sysctl is used to halt - * the system in light of potential corruption, we - * can use it here. - */ - if (panic_on_oops) { - panic("EEH: MMIO failure (%d) on device: %s %s\n", - rets[0], dn->name, dn->full_name); - } else { - __get_cpu_var(ignored_failures)++; - } - } else { + ret = read_slot_reset_state(dn, rets); + if (!(ret == 0 && rets[1] == 1 && (rets[0] == 2 || rets[0] == 4))) { __get_cpu_var(false_positives)++; + return 0; } + /* prevent repeated reports of this failure */ + dn->eeh_mode |= EEH_MODE_ISOLATED; + + reset_state = rets[0]; + + spin_lock_irqsave(&slot_errbuf_lock, flags); + memset(slot_errbuf, 0, eeh_error_buf_size); + + rc = rtas_call(ibm_slot_error_detail, + 8, 1, NULL, dn->eeh_config_addr, + BUID_HI(dn->phb->buid), + BUID_LO(dn->phb->buid), NULL, 0, + virt_to_phys(slot_errbuf), + eeh_error_buf_size, + 1 /* Temporary Error */); + + if (rc == 0) + log_error(slot_errbuf, ERR_TYPE_RTAS_LOG, 0); + spin_unlock_irqrestore(&slot_errbuf_lock, flags); + + printk(KERN_INFO "EEH: MMIO failure (%d) on device: %s %s\n", + rets[0], dn->name, dn->full_name); + event = kmalloc(sizeof(*event), GFP_ATOMIC); + if (event == NULL) { + eeh_panic(dev, reset_state); + return 1; + } + + event->dev = dev; + event->dn = dn; + event->reset_state = reset_state; + + /* We may or may not be called in an interrupt context */ + spin_lock_irqsave(&eeh_eventlist_lock, flags); + list_add(&event->list, &eeh_eventlist); + spin_unlock_irqrestore(&eeh_eventlist_lock, flags); + + /* Most EEH events are due to device driver bugs. Having + * a stack trace will help the device-driver authors figure + * out what happened. So print that out. */ + dump_stack(); + schedule_work(&eeh_event_wq); + return 0; } @@ -580,14 +764,13 @@ void __init eeh_init(void) struct device_node *phb, *np; struct eeh_early_enable_info info; - init_pci_config_tokens(); - np = of_find_node_by_path("/rtas"); if (np == NULL) return; ibm_set_eeh_option = rtas_token("ibm,set-eeh-option"); ibm_set_slot_reset = rtas_token("ibm,set-slot-reset"); + ibm_read_slot_reset_state2 = rtas_token("ibm,read-slot-reset-state2"); ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state"); ibm_slot_error_detail = rtas_token("ibm,slot-error-detail"); @@ -701,11 +884,13 @@ static int proc_eeh_show(struct seq_file *m, void *v) { unsigned int cpu; unsigned long ffs = 0, positives = 0, failures = 0; + unsigned long resets = 0; for_each_cpu(cpu) { ffs += per_cpu(total_mmio_ffs, cpu); positives += per_cpu(false_positives, cpu); failures += per_cpu(ignored_failures, cpu); + resets += per_cpu(slot_resets, cpu); } if (0 == eeh_subsystem_enabled) { @@ -715,8 +900,11 @@ static int proc_eeh_show(struct seq_file *m, void *v) seq_printf(m, "EEH Subsystem is enabled\n"); seq_printf(m, "eeh_total_mmio_ffs=%ld\n" "eeh_false_positives=%ld\n" - "eeh_ignored_failures=%ld\n", - ffs, positives, failures); + "eeh_ignored_failures=%ld\n" + "eeh_slot_resets=%ld\n" + "eeh_fail_count=%d\n", + ffs, positives, failures, resets, + eeh_fail_count.counter); } return 0; diff --git a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S index f0a12eaa3..0741f9e0a 100644 --- a/arch/ppc64/kernel/entry.S +++ b/arch/ppc64/kernel/entry.S @@ -54,8 +54,8 @@ exception_marker: #undef SHOW_SYSCALLS - .globl SystemCall_common -SystemCall_common: + .globl system_call_common +system_call_common: andi. r10,r12,MSR_PR mr r10,r1 addi r1,r1,-INT_FRAME_SIZE @@ -100,7 +100,7 @@ SystemCall_common: cmpdi cr1,r0,0x5555 /* syscall 0x5555 */ andi. r10,r12,MSR_PR /* from kernel */ crand 4*cr0+eq,4*cr1+eq,4*cr0+eq - beq HardwareInterrupt_entry + beq hardware_interrupt_entry lbz r10,PACAPROCENABLED(r13) std r10,SOFTE(r1) #endif @@ -162,7 +162,7 @@ syscall_error_cont: /* check for syscall tracing or audit */ ld r9,TI_FLAGS(r12) - andi. r0,r9,_TIF_SYSCALL_T_OR_A + andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) bne- syscall_exit_trace syscall_exit_trace_cont: @@ -185,10 +185,10 @@ syscall_exit_trace_cont: beq- 1f /* only restore r13 if */ ld r13,GPR13(r1) /* returning to usermode */ 1: ld r2,GPR2(r1) - ld r1,GPR1(r1) li r12,MSR_RI andc r10,r10,r12 mtmsrd r10,1 /* clear MSR.RI */ + ld r1,GPR1(r1) mtlr r4 mtcr r5 mtspr SRR0,r7 @@ -231,6 +231,7 @@ syscall_dotrace: syscall_exit_trace: std r3,GPR3(r1) bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD bl .do_syscall_trace_leave REST_NVGPRS(r1) ld r3,GPR3(r1) @@ -265,16 +266,21 @@ _GLOBAL(save_nvgprs) _GLOBAL(ppc32_sigsuspend) bl .save_nvgprs bl .sys32_sigsuspend - b syscall_exit + b 70f _GLOBAL(ppc64_rt_sigsuspend) bl .save_nvgprs bl .sys_rt_sigsuspend - b syscall_exit + b 70f _GLOBAL(ppc32_rt_sigsuspend) bl .save_nvgprs bl .sys32_rt_sigsuspend + /* If sigsuspend() returns zero, we are going into a signal handler */ +70: cmpdi 0,r3,0 + beq .ret_from_except + /* If it returned -EINTR, we need to return via syscall_exit to set + the SO bit in cr0 and potentially stop for ptrace. */ b syscall_exit _GLOBAL(ppc_fork) @@ -317,8 +323,9 @@ _GLOBAL(ppc64_rt_sigreturn) blt syscall_exit clrrdi r4,r1,THREAD_SHIFT ld r4,TI_FLAGS(r4) - andi. r4,r4,_TIF_SYSCALL_T_OR_A + andi. r4,r4,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) beq+ 81f + addi r3,r1,STACK_FRAME_OVERHEAD bl .do_syscall_trace_leave 81: b .ret_from_except @@ -497,10 +504,11 @@ restore: li r3,0 stb r3,PACAPROCENABLED(r13) /* ensure we are soft-disabled */ + ori r10,r10,MSR_EE mtmsrd r10 /* hard-enable again */ addi r3,r1,STACK_FRAME_OVERHEAD bl .do_IRQ - b .ret_from_except /* loop back and handle more */ + b .ret_from_except_lite /* loop back and handle more */ 4: stb r5,PACAPROCENABLED(r13) #endif @@ -568,29 +576,28 @@ do_work: crandc eq,cr1*4+eq,eq bne restore /* here we are preempting the current task */ -1: lis r0,PREEMPT_ACTIVE@h - stw r0,TI_PREEMPT(r9) +1: #ifdef CONFIG_PPC_ISERIES li r0,1 stb r0,PACAPROCENABLED(r13) #endif + ori r10,r10,MSR_EE mtmsrd r10,1 /* reenable interrupts */ - bl .schedule + bl .preempt_schedule mfmsr r10 clrrdi r9,r1,THREAD_SHIFT rldicl r10,r10,48,1 /* disable interrupts again */ - li r0,0 rotldi r10,r10,16 mtmsrd r10,1 ld r4,TI_FLAGS(r9) andi. r0,r4,_TIF_NEED_RESCHED bne 1b - stw r0,TI_PREEMPT(r9) b restore user_work: #endif /* Enable interrupts */ + ori r10,r10,MSR_EE mtmsrd r10,1 andi. r0,r4,_TIF_NEED_RESCHED diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 90be51ae4..f62494bec 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S @@ -26,6 +26,7 @@ #define SECONDARY_PROCESSORS #include +#include #include #include #include @@ -77,7 +78,7 @@ * * For iSeries: * 1. The MMU is on (as it always is for iSeries) - * 2. The kernel is entered at SystemReset_Iseries + * 2. The kernel is entered at system_reset_iSeries */ .text @@ -164,7 +165,7 @@ _GLOBAL(__secondary_hold) #else #ifdef CONFIG_SMP mr r3,r24 - b .pseries_secondary_smp_init + b .pSeries_secondary_smp_init #else BUG_OPCODE #endif @@ -304,15 +305,15 @@ exception_marker: */ #define STD_EXCEPTION_PSERIES(n, label) \ . = n; \ - .globl label##_Pseries; \ -label##_Pseries: \ + .globl label##_pSeries; \ +label##_pSeries: \ HMT_MEDIUM; \ mtspr SPRG1,r13; /* save r13 */ \ EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) #define STD_EXCEPTION_ISERIES(n, label, area) \ - .globl label##_Iseries; \ -label##_Iseries: \ + .globl label##_iSeries; \ +label##_iSeries: \ HMT_MEDIUM; \ mtspr SPRG1,r13; /* save r13 */ \ EXCEPTION_PROLOG_ISERIES_1(area); \ @@ -320,14 +321,14 @@ label##_Iseries: \ b label##_common #define MASKABLE_EXCEPTION_ISERIES(n, label) \ - .globl label##_Iseries; \ -label##_Iseries: \ + .globl label##_iSeries; \ +label##_iSeries: \ HMT_MEDIUM; \ mtspr SPRG1,r13; /* save r13 */ \ EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ lbz r10,PACAPROCENABLED(r13); \ cmpwi 0,r10,0; \ - beq- label##_Iseries_masked; \ + beq- label##_iSeries_masked; \ EXCEPTION_PROLOG_ISERIES_2; \ b label##_common; \ @@ -387,17 +388,17 @@ label##_common: \ .globl __start_interrupts __start_interrupts: - STD_EXCEPTION_PSERIES(0x100, SystemReset) + STD_EXCEPTION_PSERIES(0x100, system_reset) . = 0x200 -_MachineCheckPseries: +_machine_check_pSeries: HMT_MEDIUM mtspr SPRG1,r13 /* save r13 */ - EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common) + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) . = 0x300 - .globl DataAccess_Pseries -DataAccess_Pseries: + .globl data_access_pSeries +data_access_pSeries: HMT_MEDIUM mtspr SPRG1,r13 BEGIN_FTR_SECTION @@ -408,15 +409,15 @@ BEGIN_FTR_SECTION rlwimi r13,r12,16,0x20 mfcr r12 cmpwi r13,0x2c - beq .do_stab_bolted_Pseries + beq .do_stab_bolted_pSeries mtcrf 0x80,r12 mfspr r12,SPRG2 END_FTR_SECTION_IFCLR(CPU_FTR_SLB) - EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, DataAccess_common) + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) . = 0x380 - .globl DataAccessSLB_Pseries -DataAccessSLB_Pseries: + .globl data_access_slb_pSeries +data_access_slb_pSeries: HMT_MEDIUM mtspr SPRG1,r13 mfspr r13,SPRG3 /* get paca address into r13 */ @@ -432,11 +433,11 @@ DataAccessSLB_Pseries: mfspr r3,DAR b .do_slb_miss /* Rel. branch works in real mode */ - STD_EXCEPTION_PSERIES(0x400, InstructionAccess) + STD_EXCEPTION_PSERIES(0x400, instruction_access) . = 0x480 - .globl InstructionAccessSLB_Pseries -InstructionAccessSLB_Pseries: + .globl instruction_access_slb_pSeries +instruction_access_slb_pSeries: HMT_MEDIUM mtspr SPRG1,r13 mfspr r13,SPRG3 /* get paca address into r13 */ @@ -452,25 +453,25 @@ InstructionAccessSLB_Pseries: mfspr r3,SRR0 /* SRR0 is faulting address */ b .do_slb_miss /* Rel. branch works in real mode */ - STD_EXCEPTION_PSERIES(0x500, HardwareInterrupt) - STD_EXCEPTION_PSERIES(0x600, Alignment) - STD_EXCEPTION_PSERIES(0x700, ProgramCheck) - STD_EXCEPTION_PSERIES(0x800, FPUnavailable) - STD_EXCEPTION_PSERIES(0x900, Decrementer) - STD_EXCEPTION_PSERIES(0xa00, Trap_0a) - STD_EXCEPTION_PSERIES(0xb00, Trap_0b) + STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) + STD_EXCEPTION_PSERIES(0x600, alignment) + STD_EXCEPTION_PSERIES(0x700, program_check) + STD_EXCEPTION_PSERIES(0x800, fp_unavailable) + STD_EXCEPTION_PSERIES(0x900, decrementer) + STD_EXCEPTION_PSERIES(0xa00, trap_0a) + STD_EXCEPTION_PSERIES(0xb00, trap_0b) . = 0xc00 - .globl SystemCall_Pseries -SystemCall_Pseries: + .globl system_call_pSeries +system_call_pSeries: HMT_MEDIUM mr r9,r13 mfmsr r10 mfspr r13,SPRG3 mfspr r11,SRR0 clrrdi r12,r13,32 - oris r12,r12,SystemCall_common@h - ori r12,r12,SystemCall_common@l + oris r12,r12,system_call_common@h + ori r12,r12,system_call_common@l mtspr SRR0,r12 ori r10,r10,MSR_IR|MSR_DR|MSR_RI mfspr r12,SRR1 @@ -478,8 +479,8 @@ SystemCall_Pseries: rfid b . /* prevent speculative execution */ - STD_EXCEPTION_PSERIES(0xd00, SingleStep) - STD_EXCEPTION_PSERIES(0xe00, Trap_0e) + STD_EXCEPTION_PSERIES(0xd00, single_step) + STD_EXCEPTION_PSERIES(0xe00, trap_0e) /* We need to deal with the Altivec unavailable exception * here which is at 0xf20, thus in the middle of the @@ -487,18 +488,18 @@ SystemCall_Pseries: * trickery is thus necessary */ . = 0xf00 - b PerformanceMonitor_Pseries + b performance_monitor_pSeries - STD_EXCEPTION_PSERIES(0xf20, AltivecUnavailable) + STD_EXCEPTION_PSERIES(0xf20, altivec_unavailable) - STD_EXCEPTION_PSERIES(0x1300, InstructionBreakpoint) - STD_EXCEPTION_PSERIES(0x1700, AltivecAssist) + STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint) + STD_EXCEPTION_PSERIES(0x1700, altivec_assist) /* moved from 0xf00 */ - STD_EXCEPTION_PSERIES(0x3000, PerformanceMonitor) + STD_EXCEPTION_PSERIES(0x3000, performance_monitor) . = 0x3100 -_GLOBAL(do_stab_bolted_Pseries) +_GLOBAL(do_stab_bolted_pSeries) mtcrf 0x80,r12 mfspr r12,SPRG2 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) @@ -511,22 +512,15 @@ _GLOBAL(do_stab_bolted_Pseries) */ . = NACA_PHYS_ADDR .globl __end_interrupts - .globl __start_naca __end_interrupts: -__start_naca: #ifdef CONFIG_PPC_ISERIES + .globl naca +naca: .llong itVpdAreas -#else - .llong 0x0 #endif - .llong 0x0 - .llong 0x0 - .llong paca . = SYSTEMCFG_PHYS_ADDR - .globl __end_naca .globl __start_systemcfg -__end_naca: __start_systemcfg: . = (SYSTEMCFG_PHYS_ADDR + PAGE_SIZE) .globl __end_systemcfg @@ -564,10 +558,10 @@ __end_systemcfg: /*** ISeries-LPAR interrupt handlers ***/ - STD_EXCEPTION_ISERIES(0x200, MachineCheck, PACA_EXMC) + STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC) - .globl DataAccess_Iseries -DataAccess_Iseries: + .globl data_access_iSeries +data_access_iSeries: mtspr SPRG1,r13 BEGIN_FTR_SECTION mtspr SPRG2,r12 @@ -577,23 +571,23 @@ BEGIN_FTR_SECTION rlwimi r13,r12,16,0x20 mfcr r12 cmpwi r13,0x2c - beq .do_stab_bolted_Iseries + beq .do_stab_bolted_iSeries mtcrf 0x80,r12 mfspr r12,SPRG2 END_FTR_SECTION_IFCLR(CPU_FTR_SLB) EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN) EXCEPTION_PROLOG_ISERIES_2 - b DataAccess_common + b data_access_common -.do_stab_bolted_Iseries: +.do_stab_bolted_iSeries: mtcrf 0x80,r12 mfspr r12,SPRG2 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) EXCEPTION_PROLOG_ISERIES_2 b .do_stab_bolted - .globl DataAccessSLB_Iseries -DataAccessSLB_Iseries: + .globl data_access_slb_iSeries +data_access_slb_iSeries: mtspr SPRG1,r13 /* save r13 */ EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) std r3,PACA_EXSLB+EX_R3(r13) @@ -601,10 +595,10 @@ DataAccessSLB_Iseries: mfspr r3,DAR b .do_slb_miss - STD_EXCEPTION_ISERIES(0x400, InstructionAccess, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) - .globl InstructionAccessSLB_Iseries -InstructionAccessSLB_Iseries: + .globl instruction_access_slb_iSeries +instruction_access_slb_iSeries: mtspr SPRG1,r13 /* save r13 */ EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) std r3,PACA_EXSLB+EX_R3(r13) @@ -612,27 +606,27 @@ InstructionAccessSLB_Iseries: ld r3,PACALPPACA+LPPACASRR0(r13) b .do_slb_miss - MASKABLE_EXCEPTION_ISERIES(0x500, HardwareInterrupt) - STD_EXCEPTION_ISERIES(0x600, Alignment, PACA_EXGEN) - STD_EXCEPTION_ISERIES(0x700, ProgramCheck, PACA_EXGEN) - STD_EXCEPTION_ISERIES(0x800, FPUnavailable, PACA_EXGEN) - MASKABLE_EXCEPTION_ISERIES(0x900, Decrementer) - STD_EXCEPTION_ISERIES(0xa00, Trap_0a, PACA_EXGEN) - STD_EXCEPTION_ISERIES(0xb00, Trap_0b, PACA_EXGEN) + MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt) + STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x700, program_check, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x800, fp_unavailable, PACA_EXGEN) + MASKABLE_EXCEPTION_ISERIES(0x900, decrementer) + STD_EXCEPTION_ISERIES(0xa00, trap_0a, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0xb00, trap_0b, PACA_EXGEN) - .globl SystemCall_Iseries -SystemCall_Iseries: + .globl system_call_iSeries +system_call_iSeries: mr r9,r13 mfspr r13,SPRG3 EXCEPTION_PROLOG_ISERIES_2 - b SystemCall_common + b system_call_common - STD_EXCEPTION_ISERIES( 0xd00, SingleStep, PACA_EXGEN) - STD_EXCEPTION_ISERIES( 0xe00, Trap_0e, PACA_EXGEN) - STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xd00, single_step, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN) - .globl SystemReset_Iseries -SystemReset_Iseries: + .globl system_reset_iSeries +system_reset_iSeries: mfspr r13,SPRG3 /* Get paca address */ mfmsr r24 ori r24,r24,MSR_RI @@ -658,11 +652,11 @@ SystemReset_Iseries: subi r1,r1,STACK_FRAME_OVERHEAD cmpwi 0,r23,0 - beq iseries_secondary_smp_loop /* Loop until told to go */ + beq iSeries_secondary_smp_loop /* Loop until told to go */ #ifdef SECONDARY_PROCESSORS bne .__secondary_start /* Loop until told to go */ #endif -iseries_secondary_smp_loop: +iSeries_secondary_smp_loop: /* Let the Hypervisor know we are alive */ /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */ lis r3,0x8002 @@ -682,16 +676,16 @@ iseries_secondary_smp_loop: b 1b /* If SMP not configured, secondaries * loop forever */ - .globl Decrementer_Iseries_masked -Decrementer_Iseries_masked: + .globl decrementer_iSeries_masked +decrementer_iSeries_masked: li r11,1 stb r11,PACALPPACA+LPPACADECRINT(r13) lwz r12,PACADEFAULTDECR(r13) mtspr SPRN_DEC,r12 /* fall through */ - .globl HardwareInterrupt_Iseries_masked -HardwareInterrupt_Iseries_masked: + .globl hardware_interrupt_iSeries_masked +hardware_interrupt_iSeries_masked: mtcrf 0x80,r9 /* Restore regs */ ld r11,PACALPPACA+LPPACASRR0(r13) ld r12,PACALPPACA+LPPACASRR1(r13) @@ -717,16 +711,16 @@ fwnmi_data_area: * Vectors for the FWNMI option. Share common code. */ . = 0x8000 - .globl SystemReset_FWNMI -SystemReset_FWNMI: + .globl system_reset_fwnmi +system_reset_fwnmi: HMT_MEDIUM mtspr SPRG1,r13 /* save r13 */ - EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, SystemReset_common) - .globl MachineCheck_FWNMI -MachineCheck_FWNMI: + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) + .globl machine_check_fwnmi +machine_check_fwnmi: HMT_MEDIUM mtspr SPRG1,r13 /* save r13 */ - EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common) + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) /* * Space for the initial segment table @@ -744,33 +738,33 @@ __end_stab: /*** Common interrupt handlers ***/ - STD_EXCEPTION_COMMON(0x100, SystemReset, .SystemResetException) + STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception) /* * Machine check is different because we use a different * save area: PACA_EXMC instead of PACA_EXGEN. */ .align 7 - .globl MachineCheck_common -MachineCheck_common: + .globl machine_check_common +machine_check_common: EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC) DISABLE_INTS bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD - bl .MachineCheckException + bl .machine_check_exception b .ret_from_except - STD_EXCEPTION_COMMON_LITE(0x900, Decrementer, .timer_interrupt) - STD_EXCEPTION_COMMON(0xa00, Trap_0a, .UnknownException) - STD_EXCEPTION_COMMON(0xb00, Trap_0b, .UnknownException) - STD_EXCEPTION_COMMON(0xd00, SingleStep, .SingleStepException) - STD_EXCEPTION_COMMON(0xe00, Trap_0e, .UnknownException) - STD_EXCEPTION_COMMON(0xf00, PerformanceMonitor, .PerformanceMonitorException) - STD_EXCEPTION_COMMON(0x1300, InstructionBreakpoint, .InstructionBreakpointException) + STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt) + STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception) + STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) + STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) + STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) + STD_EXCEPTION_COMMON(0xf00, performance_monitor, .performance_monitor_exception) + STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) #ifdef CONFIG_ALTIVEC - STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .AltivecAssistException) + STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception) #else - STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .UnknownException) + STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception) #endif /* @@ -860,8 +854,8 @@ unrecov_fer: * r9 - r13 are saved in paca->exgen. */ .align 7 - .globl DataAccess_common -DataAccess_common: + .globl data_access_common +data_access_common: mfspr r10,DAR std r10,PACA_EXGEN+EX_DAR(r13) mfspr r10,DSISR @@ -873,8 +867,8 @@ DataAccess_common: b .do_hash_page /* Try to handle as hpte fault */ .align 7 - .globl InstructionAccess_common -InstructionAccess_common: + .globl instruction_access_common +instruction_access_common: EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN) ld r3,_NIP(r1) andis. r4,r12,0x5820 @@ -882,19 +876,19 @@ InstructionAccess_common: b .do_hash_page /* Try to handle as hpte fault */ .align 7 - .globl HardwareInterrupt_common - .globl HardwareInterrupt_entry -HardwareInterrupt_common: + .globl hardware_interrupt_common + .globl hardware_interrupt_entry +hardware_interrupt_common: EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) -HardwareInterrupt_entry: +hardware_interrupt_entry: DISABLE_INTS addi r3,r1,STACK_FRAME_OVERHEAD bl .do_IRQ b .ret_from_except_lite .align 7 - .globl Alignment_common -Alignment_common: + .globl alignment_common +alignment_common: mfspr r10,DAR std r10,PACA_EXGEN+EX_DAR(r13) mfspr r10,DSISR @@ -907,33 +901,33 @@ Alignment_common: bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD ENABLE_INTS - bl .AlignmentException + bl .alignment_exception b .ret_from_except .align 7 - .globl ProgramCheck_common -ProgramCheck_common: + .globl program_check_common +program_check_common: EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD ENABLE_INTS - bl .ProgramCheckException + bl .program_check_exception b .ret_from_except .align 7 - .globl FPUnavailable_common -FPUnavailable_common: + .globl fp_unavailable_common +fp_unavailable_common: EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) bne .load_up_fpu /* if from user, just load it up */ bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD ENABLE_INTS - bl .KernelFPUnavailableException + bl .kernel_fp_unavailable_exception BUG_OPCODE .align 7 - .globl AltivecUnavailable_common -AltivecUnavailable_common: + .globl altivec_unavailable_common +altivec_unavailable_common: EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN) #ifdef CONFIG_ALTIVEC bne .load_up_altivec /* if from user, just load it up */ @@ -941,7 +935,7 @@ AltivecUnavailable_common: bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD ENABLE_INTS - bl .AltivecUnavailableException + bl .altivec_unavailable_exception b .ret_from_except /* @@ -1192,23 +1186,39 @@ unrecov_slb: /* * On pSeries, secondary processors spin in the following code. - * At entry, r3 = this processor's number (in Linux terms, not hardware). + * At entry, r3 = this processor's number (physical cpu id) */ -_GLOBAL(pseries_secondary_smp_init) +_GLOBAL(pSeries_secondary_smp_init) + mr r24,r3 + /* turn on 64-bit mode */ bl .enable_64b_mode isync - /* Set up a paca value for this processor. */ - LOADADDR(r24, paca) /* Get base vaddr of paca array */ - mulli r13,r3,PACA_SIZE /* Calculate vaddr of right paca */ - add r13,r13,r24 /* for this processor. */ - - mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ - mr r24,r3 /* __secondary_start needs cpu# */ + /* Copy some CPU settings from CPU 0 */ + bl .__restore_cpu_setup -1: - HMT_LOW + /* Set up a paca value for this processor. Since we have the + * physical cpu id in r3, we need to search the pacas to find + * which logical id maps to our physical one. + */ + LOADADDR(r13, paca) /* Get base vaddr of paca array */ + li r5,0 /* logical cpu id */ +1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ + cmpw r6,r24 /* Compare to our id */ + beq 2f + addi r13,r13,PACA_SIZE /* Loop to next PACA on miss */ + addi r5,r5,1 + cmpwi r5,NR_CPUS + blt 1b + +99: HMT_LOW /* Couldn't find our CPU id */ + b 99b + +2: mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ + /* From now on, r24 is expected to be logica cpuid */ + mr r24,r5 +3: HMT_LOW lbz r23,PACAPROCSTART(r13) /* Test if this processor should */ /* start. */ sync @@ -1223,7 +1233,8 @@ _GLOBAL(pseries_secondary_smp_init) bne .__secondary_start #endif #endif - b 1b /* Loop until told to go */ + b 3b /* Loop until told to go */ + #ifdef CONFIG_PPC_ISERIES _STATIC(__start_initialization_iSeries) /* Clear out the BSS */ @@ -1257,14 +1268,6 @@ _STATIC(__start_initialization_iSeries) SET_REG_TO_CONST(r4, SYSTEMCFG_VIRT_ADDR) std r4,0(r9) /* set the systemcfg pointer */ - LOADADDR(r9,naca) - SET_REG_TO_CONST(r4, NACA_VIRT_ADDR) - std r4,0(r9) /* set the naca pointer */ - - /* Get the pointer to the segment table */ - ld r6,PACA(r4) /* Get the base paca pointer */ - ld r4,PACASTABVIRT(r6) - bl .iSeries_early_setup /* relocation is on at this point */ @@ -1864,12 +1867,6 @@ _STATIC(start_here_multiplatform) li r27,SYSTEMCFG_PHYS_ADDR std r27,0(r6) /* set the value of systemcfg */ - /* setup the naca pointer which is needed by *tab_initialize */ - LOADADDR(r6,naca) - sub r6,r6,r26 /* addr of the variable naca */ - li r27,NACA_PHYS_ADDR - std r27,0(r6) /* set the value of naca */ - #ifdef CONFIG_HMT /* Start up the second thread on cpu 0 */ mfspr r3,PVR @@ -1886,19 +1883,6 @@ _STATIC(start_here_multiplatform) 91: #endif -#ifdef CONFIG_SMP - /* All secondary cpus are now spinning on a common - * spinloop, release them all now so they can start - * to spin on their individual paca spinloops. - * For non SMP kernels, the secondary cpus never - * get out of the common spinloop. - */ - li r3,1 - LOADADDR(r5,__secondary_hold_spinloop) - tophys(r4,r5) - std r3,0(r4) -#endif - /* The following gets the stack and TOC set up with the regs */ /* pointing to the real addr of the kernel stack. This is */ /* all done to support the C function call below which sets */ @@ -1913,7 +1897,7 @@ _STATIC(start_here_multiplatform) li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) - /* set up the TOC (physical address) */ + /* set up the TOC (physical address) */ LOADADDR(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1926,6 +1910,12 @@ _STATIC(start_here_multiplatform) mr r5,r26 bl .identify_cpu + /* Save some low level config HIDs of CPU0 to be copied to + * other CPUs later on, or used for suspend/resume + */ + bl .__save_cpu_setup + sync + /* Setup a valid physical PACA pointer in SPRG3 for early_setup * note that boot_cpuid can always be 0 nowadays since there is * nowhere it can be initialized differently before we reach this @@ -2013,11 +2003,6 @@ _STATIC(start_here_common) SET_REG_TO_CONST(r8, SYSTEMCFG_VIRT_ADDR) std r8,0(r9) - /* setup the naca pointer */ - LOADADDR(r9,naca) - SET_REG_TO_CONST(r8, NACA_VIRT_ADDR) - std r8,0(r9) /* set the value of the naca ptr */ - LOADADDR(r26, boot_cpuid) lwz r26,0(r26) @@ -2098,7 +2083,7 @@ __hmt_secondary_hold: 101: #endif mr r3,r24 - b .pseries_secondary_smp_init + b .pSeries_secondary_smp_init #ifdef CONFIG_HMT _GLOBAL(hmt_start_secondary) @@ -2123,6 +2108,22 @@ _GLOBAL(hmt_start_secondary) blr #endif +#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) +_GLOBAL(smp_release_cpus) + /* All secondary cpus are spinning on a common + * spinloop, release them all now so they can start + * to spin on their individual paca spinloops. + * For non SMP kernels, the secondary cpus never + * get out of the common spinloop. + */ + li r3,1 + LOADADDR(r5,__secondary_hold_spinloop) + std r3,0(r5) + sync + blr +#endif /* CONFIG_SMP && !CONFIG_PPC_ISERIES */ + + /* * We put a few things here that have to be page-aligned. * This stuff goes at the beginning of the data segment, @@ -2144,10 +2145,12 @@ swapper_pg_dir: ioremap_dir: .space 4096 +#ifdef CONFIG_SMP /* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */ .globl stab_array stab_array: .space 4096 * 48 +#endif /* * This space gets a copy of optional info passed to us by the bootstrap diff --git a/arch/ppc64/kernel/i8259.c b/arch/ppc64/kernel/i8259.c index 2f2b9bf8c..9bea66770 100644 --- a/arch/ppc64/kernel/i8259.c +++ b/arch/ppc64/kernel/i8259.c @@ -21,9 +21,10 @@ unsigned char cached_8259[2] = { 0xff, 0xff }; #define cached_A1 (cached_8259[0]) #define cached_21 (cached_8259[1]) -static spinlock_t i8259_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned_in_smp DEFINE_SPINLOCK(i8259_lock); -int i8259_pic_irq_offset; +static int i8259_pic_irq_offset; +static int i8259_present; int i8259_irq(int cpu) { @@ -140,11 +141,13 @@ struct hw_interrupt_type i8259_pic = { NULL }; -void __init i8259_init(void) +void __init i8259_init(int offset) { unsigned long flags; spin_lock_irqsave(&i8259_lock, flags); + i8259_pic_irq_offset = offset; + i8259_present = 1; /* init master interrupt controller */ outb(0x11, 0x20); /* Start init sequence */ outb(0x00, 0x21); /* Vector base */ @@ -160,7 +163,18 @@ void __init i8259_init(void) outb(cached_A1, 0xA1); outb(cached_21, 0x21); spin_unlock_irqrestore(&i8259_lock, flags); + +} + +static int i8259_request_cascade(void) +{ + if (!i8259_present) + return -ENODEV; + request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT, "82c59 secondary cascade", NULL ); - + + return 0; } + +arch_initcall(i8259_request_cascade); diff --git a/arch/ppc64/kernel/i8259.h b/arch/ppc64/kernel/i8259.h index 620a99997..f74764ba0 100644 --- a/arch/ppc64/kernel/i8259.h +++ b/arch/ppc64/kernel/i8259.h @@ -11,7 +11,7 @@ extern struct hw_interrupt_type i8259_pic; -void i8259_init(void); -int i8259_irq(int); +extern void i8259_init(int offset); +extern int i8259_irq(int); #endif /* _PPC_KERNEL_i8259_H */ diff --git a/arch/ppc64/kernel/iSeries_VpdInfo.c b/arch/ppc64/kernel/iSeries_VpdInfo.c index b6d4b9308..a6f0ff2d0 100644 --- a/arch/ppc64/kernel/iSeries_VpdInfo.c +++ b/arch/ppc64/kernel/iSeries_VpdInfo.c @@ -36,7 +36,6 @@ #include #include #include -//#include #include #include "pci.h" @@ -84,30 +83,6 @@ struct SlotMapStruct { typedef struct SlotMapStruct SlotMap; #define SLOT_ENTRY_SIZE 16 -/* - * Bus, Card, Board, FrameId, CardLocation. - */ -LocationData* iSeries_GetLocationData(struct pci_dev *PciDev) -{ - struct iSeries_Device_Node *DevNode = - (struct iSeries_Device_Node *)PciDev->sysdata; - LocationData *LocationPtr = - (LocationData *)kmalloc(LOCATION_DATA_SIZE, GFP_KERNEL); - - if (LocationPtr == NULL) { - printk("PCI: LocationData area allocation failed!\n"); - return NULL; - } - memset(LocationPtr, 0, LOCATION_DATA_SIZE); - LocationPtr->Bus = ISERIES_BUS(DevNode); - LocationPtr->Board = DevNode->Board; - LocationPtr->FrameId = DevNode->FrameId; - LocationPtr->Card = PCI_SLOT(DevNode->DevFn); - strcpy(&LocationPtr->CardLocation[0], &DevNode->CardLocation[0]); - return LocationPtr; -} -EXPORT_SYMBOL(iSeries_GetLocationData); - /* * Formats the device information. * - Pass in pci_dev* pointer to the device. @@ -148,18 +123,6 @@ int iSeries_Device_Information(struct pci_dev *PciDev, char *buffer, return len; } -/* - * Build a character string of the device location, Frame 1, Card C10 - */ -int device_Location(struct pci_dev *PciDev, char *BufPtr) -{ - struct iSeries_Device_Node *DevNode = - (struct iSeries_Device_Node *)PciDev->sysdata; - return sprintf(BufPtr, "PCI: Bus%3d, AgentId%3d, Vendor %04X, Location %s", - DevNode->DsaAddr.Dsa.busNumber, DevNode->AgentId, - DevNode->Vendor, DevNode->Location); -} - /* * Parse the Slot Area */ diff --git a/arch/ppc64/kernel/iSeries_iommu.c b/arch/ppc64/kernel/iSeries_iommu.c index c09ea2aaa..4e1a47c8a 100644 --- a/arch/ppc64/kernel/iSeries_iommu.c +++ b/arch/ppc64/kernel/iSeries_iommu.c @@ -25,30 +25,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include +#include -#include -#include #include -#include -#include - #include - -#include "pci.h" - +#include +#include extern struct list_head iSeries_Global_Device_List; @@ -76,12 +60,11 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, tce.te_bits.tb_pciwr = 1; } - rc = HvCallXm_setTce((u64)tbl->it_index, - (u64)index, - tce.te_word); + rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, + tce.te_word); if (rc) - panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", rc); - + panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", + rc); index++; uaddr += PAGE_SIZE; } @@ -90,20 +73,14 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages) { u64 rc; - union tce_entry tce; while (npages--) { - tce.te_word = 0; - rc = HvCallXm_setTce((u64)tbl->it_index, - (u64)index, - tce.te_word); - + rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); if (rc) - panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", rc); - + panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", + rc); index++; } - } @@ -115,17 +92,14 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl) { struct iSeries_Device_Node *dp; - for (dp = (struct iSeries_Device_Node *)iSeries_Global_Device_List.next; - dp != (struct iSeries_Device_Node *)&iSeries_Global_Device_List; - dp = (struct iSeries_Device_Node *)dp->Device_List.next) - if (dp->iommu_table != NULL && - dp->iommu_table->it_type == TCE_PCI && - dp->iommu_table->it_offset == tbl->it_offset && - dp->iommu_table->it_index == tbl->it_index && - dp->iommu_table->it_size == tbl->it_size) + list_for_each_entry(dp, &iSeries_Global_Device_List, Device_List) { + if ((dp->iommu_table != NULL) && + (dp->iommu_table->it_type == TCE_PCI) && + (dp->iommu_table->it_offset == tbl->it_offset) && + (dp->iommu_table->it_index == tbl->it_index) && + (dp->iommu_table->it_size == tbl->it_size)) return dp->iommu_table; - - + } return NULL; } @@ -143,15 +117,14 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn, { struct iommu_table_cb *parms; - parms = (struct iommu_table_cb*)kmalloc(sizeof(*parms), GFP_KERNEL); - + parms = kmalloc(sizeof(*parms), GFP_KERNEL); if (parms == NULL) panic("PCI_DMA: TCE Table Allocation failed."); memset(parms, 0, sizeof(*parms)); - parms->itc_busno = ISERIES_BUS(dn); - parms->itc_slotno = dn->LogicalSlot; + parms->itc_busno = ISERIES_BUS(dn); + parms->itc_slotno = dn->LogicalSlot; parms->itc_virtbus = 0; HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms)); @@ -159,41 +132,44 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn, if (parms->itc_size == 0) panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); - tbl->it_size = parms->itc_size; - tbl->it_busno = parms->itc_busno; - tbl->it_offset = parms->itc_offset; - tbl->it_index = parms->itc_index; - tbl->it_entrysize = sizeof(union tce_entry); - tbl->it_blocksize = 1; - tbl->it_type = TCE_PCI; + /* itc_size is in pages worth of table, it_size is in # of entries */ + tbl->it_size = (parms->itc_size * PAGE_SIZE) / sizeof(union tce_entry); + tbl->it_busno = parms->itc_busno; + tbl->it_offset = parms->itc_offset; + tbl->it_index = parms->itc_index; + tbl->it_blocksize = 1; + tbl->it_type = TCE_PCI; kfree(parms); } -void iommu_devnode_init(struct iSeries_Device_Node *dn) { +void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn) +{ struct iommu_table *tbl; - tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), GFP_KERNEL); + tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); iommu_table_getparms(dn, tbl); /* Look for existing tce table */ dn->iommu_table = iommu_table_find(tbl); - if (dn->iommu_table == NULL) dn->iommu_table = iommu_init_table(tbl); else kfree(tbl); - - return; } +static void iommu_dev_setup_iSeries(struct pci_dev *dev) { } +static void iommu_bus_setup_iSeries(struct pci_bus *bus) { } -void tce_init_iSeries(void) +void iommu_init_early_iSeries(void) { ppc_md.tce_build = tce_build_iSeries; ppc_md.tce_free = tce_free_iSeries; + ppc_md.iommu_dev_setup = iommu_dev_setup_iSeries; + ppc_md.iommu_bus_setup = iommu_bus_setup_iSeries; + pci_iommu_init(); } diff --git a/arch/ppc64/kernel/iSeries_irq.c b/arch/ppc64/kernel/iSeries_irq.c index fe6d63676..f831d259d 100644 --- a/arch/ppc64/kernel/iSeries_irq.c +++ b/arch/ppc64/kernel/iSeries_irq.c @@ -110,6 +110,7 @@ static unsigned int iSeries_startup_IRQ(unsigned int irq) /* Unmask bridge interrupts in the FISR */ mask = 0x01010000 << function; HvCallPci_unmaskFisr(bus, subBus, deviceId, mask); + iSeries_enable_IRQ(irq); return 0; } diff --git a/arch/ppc64/kernel/iSeries_pci.c b/arch/ppc64/kernel/iSeries_pci.c index d3715a153..ffe54e1bd 100644 --- a/arch/ppc64/kernel/iSeries_pci.c +++ b/arch/ppc64/kernel/iSeries_pci.c @@ -1,4 +1,3 @@ -#define PCIFR(...) /* * iSeries_pci.c * @@ -36,7 +35,6 @@ #include #include #include -#include #include #include @@ -47,26 +45,17 @@ #include #include -#include "iSeries_IoMmTable.h" #include "pci.h" -extern int panic_timeout; - -extern unsigned long iSeries_Base_Io_Memory; - -extern struct iommu_table *tceTables[256]; - -extern void iSeries_MmIoTest(void); +extern unsigned long io_page_mask; /* * Forward declares of prototypes. */ static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn); -static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb); -static void iSeries_Scan_EADs_Bridge(HvBusNumber Bus, HvSubBusNumber SubBus, - int IdSel); -static int iSeries_Scan_Bridge_Slot(HvBusNumber Bus, - struct HvCallPci_BridgeInfo *Info); +static void scan_PHB_slots(struct pci_controller *Phb); +static void scan_EADS_bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel); +static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *Info); LIST_HEAD(iSeries_Global_Device_List); @@ -87,7 +76,116 @@ static int Pci_Error_Flag = 1; /* Set Retry Error on. */ static struct pci_ops iSeries_pci_ops; /* - * Log Error infor in Flight Recorder to system Console. + * Table defines + * Each Entry size is 4 MB * 1024 Entries = 4GB I/O address space. + */ +#define IOMM_TABLE_MAX_ENTRIES 1024 +#define IOMM_TABLE_ENTRY_SIZE 0x0000000000400000UL +#define BASE_IO_MEMORY 0xE000000000000000UL + +static unsigned long max_io_memory = 0xE000000000000000UL; +static long current_iomm_table_entry; + +/* + * Lookup Tables. + */ +static struct iSeries_Device_Node **iomm_table; +static u8 *iobar_table; + +/* + * Static and Global variables + */ +static char *pci_io_text = "iSeries PCI I/O"; +static DEFINE_SPINLOCK(iomm_table_lock); + +/* + * iomm_table_initialize + * + * Allocates and initalizes the Address Translation Table and Bar + * Tables to get them ready for use. Must be called before any + * I/O space is handed out to the device BARs. + */ +static void iomm_table_initialize(void) +{ + spin_lock(&iomm_table_lock); + iomm_table = kmalloc(sizeof(*iomm_table) * IOMM_TABLE_MAX_ENTRIES, + GFP_KERNEL); + iobar_table = kmalloc(sizeof(*iobar_table) * IOMM_TABLE_MAX_ENTRIES, + GFP_KERNEL); + spin_unlock(&iomm_table_lock); + if ((iomm_table == NULL) || (iobar_table == NULL)) + panic("PCI: I/O tables allocation failed.\n"); +} + +/* + * iomm_table_allocate_entry + * + * Adds pci_dev entry in address translation table + * + * - Allocates the number of entries required in table base on BAR + * size. + * - Allocates starting at BASE_IO_MEMORY and increases. + * - The size is round up to be a multiple of entry size. + * - CurrentIndex is incremented to keep track of the last entry. + * - Builds the resource entry for allocated BARs. + */ +static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) +{ + struct resource *bar_res = &dev->resource[bar_num]; + long bar_size = pci_resource_len(dev, bar_num); + + /* + * No space to allocate, quick exit, skip Allocation. + */ + if (bar_size == 0) + return; + /* + * Set Resource values. + */ + spin_lock(&iomm_table_lock); + bar_res->name = pci_io_text; + bar_res->start = + IOMM_TABLE_ENTRY_SIZE * current_iomm_table_entry; + bar_res->start += BASE_IO_MEMORY; + bar_res->end = bar_res->start + bar_size - 1; + /* + * Allocate the number of table entries needed for BAR. + */ + while (bar_size > 0 ) { + iomm_table[current_iomm_table_entry] = dev->sysdata; + iobar_table[current_iomm_table_entry] = bar_num; + bar_size -= IOMM_TABLE_ENTRY_SIZE; + ++current_iomm_table_entry; + } + max_io_memory = BASE_IO_MEMORY + + (IOMM_TABLE_ENTRY_SIZE * current_iomm_table_entry); + spin_unlock(&iomm_table_lock); +} + +/* + * allocate_device_bars + * + * - Allocates ALL pci_dev BAR's and updates the resources with the + * BAR value. BARS with zero length will have the resources + * The HvCallPci_getBarParms is used to get the size of the BAR + * space. It calls iomm_table_allocate_entry to allocate + * each entry. + * - Loops through The Bar resources(0 - 5) including the ROM + * is resource(6). + */ +static void allocate_device_bars(struct pci_dev *dev) +{ + struct resource *bar_res; + int bar_num; + + for (bar_num = 0; bar_num <= PCI_ROM_RESOURCE; ++bar_num) { + bar_res = &dev->resource[bar_num]; + iomm_table_allocate_entry(dev, bar_num); + } +} + +/* + * Log error information to system console. * Filter out the device not there errors. * PCI: EADs Connect Failed 0x18.58.10 Rc: 0x00xx * PCI: Read Vendor Failed 0x18.58.10 Rc: 0x00xx @@ -98,7 +196,6 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus, { if (HvRc == 0x0302) return; - printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X", Error_Text, Bus, SubBus, AgentId, HvRc); } @@ -132,8 +229,6 @@ static struct iSeries_Device_Node *build_device_node(HvBusNumber Bus, node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function); node->IoRetry = 0; iSeries_Get_Location_Code(node); - PCIFR("Device 0x%02X.%2X, Node:0x%p ", ISERIES_BUS(node), - ISERIES_DEVFUN(node), node); return node; } @@ -158,11 +253,12 @@ unsigned long __init find_and_init_phbs(void) int ret = HvCallXm_testBus(bus); if (ret == 0) { printk("bus %d appears to exist\n", bus); - phb = pci_alloc_pci_controller(phb_type_hypervisor); - if (phb == NULL) { - PCIFR("Allocate pci_controller failed."); - return -1; - } + + phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), GFP_KERNEL); + if (phb == NULL) + return -ENOMEM; + pci_setup_pci_controller(phb); + phb->pci_mem_offset = phb->local_number = bus; phb->first_busno = bus; phb->last_busno = bus; @@ -170,10 +266,9 @@ unsigned long __init find_and_init_phbs(void) PPCDBG(PPCDBG_BUSWALK, "PCI:Create iSeries pci_controller(%p), Bus: %04X\n", phb, bus); - PCIFR("Create iSeries PHB controller: %04X", bus); /* Find and connect the devices. */ - iSeries_Scan_PHBs_Slots(phb); + scan_PHB_slots(phb); } /* * Check for Unexpected Return code, a clue that something @@ -194,9 +289,9 @@ unsigned long __init find_and_init_phbs(void) void iSeries_pcibios_init(void) { PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n"); - iSeries_IoMmTable_Initialize(); + iomm_table_initialize(); find_and_init_phbs(); - /* pci_assign_all_busses = 0; SFRXXX*/ + io_page_mask = -1; PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n"); } @@ -213,11 +308,10 @@ void __init iSeries_pci_final_fixup(void) PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); /* Fix up at the device node and pci_dev relationship */ - mf_displaySrc(0xC9000100); + mf_display_src(0xC9000100); printk("pcibios_final_fixup\n"); - while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) - != NULL) { + for_each_pci_dev(pdev) { node = find_Device_Node(pdev->bus->number, pdev->devfn); printk("pci dev %p (%x.%x), node %p\n", pdev, pdev->bus->number, pdev->devfn, node); @@ -229,19 +323,18 @@ void __init iSeries_pci_final_fixup(void) PPCDBG(PPCDBG_BUSWALK, "pdev 0x%p <==> DevNode 0x%p\n", pdev, node); - iSeries_allocateDeviceBars(pdev); + allocate_device_bars(pdev); iSeries_Device_Information(pdev, Buffer, sizeof(Buffer)); printk("%d. %s\n", DeviceCount, Buffer); - iommu_devnode_init(node); + iommu_devnode_init_iSeries(node); } else printk("PCI: Device Tree not found for 0x%016lX\n", (unsigned long)pdev); pdev->irq = node->Irq; } - iSeries_IoMmTable_Status(); iSeries_activate_IRQs(); - mf_displaySrc(0xC9000200); + mf_display_src(0xC9000200); } void pcibios_fixup_bus(struct pci_bus *PciBus) @@ -258,7 +351,7 @@ void pcibios_fixup_resources(struct pci_dev *pdev) /* * Loop through each node function to find usable EADs bridges. */ -static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb) +static void scan_PHB_slots(struct pci_controller *Phb) { struct HvCallPci_DeviceInfo *DevInfo; HvBusNumber bus = Phb->local_number; /* System Bus */ @@ -281,7 +374,7 @@ static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb) sizeof(struct HvCallPci_DeviceInfo)); if (HvRc == 0) { if (DevInfo->deviceType == HvCallPci_NodeDevice) - iSeries_Scan_EADs_Bridge(bus, SubBus, IdSel); + scan_EADS_bridge(bus, SubBus, IdSel); else printk("PCI: Invalid System Configuration(0x%02X)" " for bus 0x%02x id 0x%02x.\n", @@ -293,7 +386,7 @@ static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb) kfree(DevInfo); } -static void iSeries_Scan_EADs_Bridge(HvBusNumber bus, HvSubBusNumber SubBus, +static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus, int IdSel) { struct HvCallPci_BridgeInfo *BridgeInfo; @@ -338,7 +431,7 @@ static void iSeries_Scan_EADs_Bridge(HvBusNumber bus, HvSubBusNumber SubBus, if (BridgeInfo->busUnitInfo.deviceType == HvCallPci_BridgeDevice) { /* Scan_Bridge_Slot...: 0x18.00.12 */ - iSeries_Scan_Bridge_Slot(bus, BridgeInfo); + scan_bridge_slot(bus, BridgeInfo); } else printk("PCI: Invalid Bridge Configuration(0x%02X)", BridgeInfo->busUnitInfo.deviceType); @@ -353,7 +446,7 @@ static void iSeries_Scan_EADs_Bridge(HvBusNumber bus, HvSubBusNumber SubBus, /* * This assumes that the node slot is always on the primary bus! */ -static int iSeries_Scan_Bridge_Slot(HvBusNumber Bus, +static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *BridgeInfo) { struct iSeries_Device_Node *node; @@ -583,7 +676,7 @@ static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, */ if ((DevNode->IoRetry > Pci_Retry_Max) && (Pci_Error_Flag > 0)) { - mf_displaySrc(0xB6000103); + mf_display_src(0xB6000103); panic_timeout = 0; panic("PCI: Hardware I/O Error, SRC B6000103, " "Automatic Reboot Disabled.\n"); @@ -591,12 +684,8 @@ static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, return -1; /* Retry Try */ } /* If retry was in progress, log success and rest retry count */ - if (DevNode->IoRetry > 0) { - PCIFR("%s: Device 0x%04X:%02X Retry Successful(%2d).", - TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn, - DevNode->IoRetry); + if (DevNode->IoRetry > 0) DevNode->IoRetry = 0; - } return 0; } @@ -605,8 +694,9 @@ static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, * Note: Make sure the passed variable end up on the stack to avoid * the exposure of being device global. */ -static inline struct iSeries_Device_Node *xlateIoMmAddress(const volatile void __iomem *IoAddress, - u64 *dsaptr, u64 *BarOffsetPtr) +static inline struct iSeries_Device_Node *xlate_iomm_address( + const volatile void __iomem *IoAddress, + u64 *dsaptr, u64 *BarOffsetPtr) { unsigned long OrigIoAddr; unsigned long BaseIoAddr; @@ -614,17 +704,16 @@ static inline struct iSeries_Device_Node *xlateIoMmAddress(const volatile void _ struct iSeries_Device_Node *DevNode; OrigIoAddr = (unsigned long __force)IoAddress; - if ((OrigIoAddr < iSeries_Base_Io_Memory) || - (OrigIoAddr >= iSeries_Max_Io_Memory)) + if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory)) return NULL; - BaseIoAddr = OrigIoAddr - iSeries_Base_Io_Memory; - TableIndex = BaseIoAddr / iSeries_IoMmTable_Entry_Size; - DevNode = iSeries_IoMmTable[TableIndex]; + BaseIoAddr = OrigIoAddr - BASE_IO_MEMORY; + TableIndex = BaseIoAddr / IOMM_TABLE_ENTRY_SIZE; + DevNode = iomm_table[TableIndex]; if (DevNode != NULL) { - int barnum = iSeries_IoBarTable[TableIndex]; + int barnum = iobar_table[TableIndex]; *dsaptr = DevNode->DsaAddr.DsaAddr | (barnum << 24); - *BarOffsetPtr = BaseIoAddr % iSeries_IoMmTable_Entry_Size; + *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE; } else panic("PCI: Invalid PCI IoAddress detected!\n"); return DevNode; @@ -645,7 +734,7 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) u64 dsa; struct HvCallPci_LoadReturn ret; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; @@ -674,7 +763,7 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress) u64 dsa; struct HvCallPci_LoadReturn ret; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; @@ -704,7 +793,7 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress) u64 dsa; struct HvCallPci_LoadReturn ret; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; @@ -741,7 +830,7 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress) u64 dsa; u64 rc; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; @@ -768,7 +857,7 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress) u64 dsa; u64 rc; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; @@ -795,7 +884,7 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress) u64 dsa; u64 rc; struct iSeries_Device_Node *DevNode = - xlateIoMmAddress(IoAddress, &dsa, &BarOffset); + xlate_iomm_address(IoAddress, &dsa, &BarOffset); if (DevNode == NULL) { static unsigned long last_jiffies; diff --git a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c index 8848ece79..0f785e458 100644 --- a/arch/ppc64/kernel/iSeries_pci_reset.c +++ b/arch/ppc64/kernel/iSeries_pci_reset.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -49,7 +50,7 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, int DelayTime) { - unsigned long AssertDelay, WaitDelay; + unsigned int AssertDelay, WaitDelay; struct iSeries_Device_Node *DeviceNode = (struct iSeries_Device_Node *)PciDev->sysdata; @@ -62,14 +63,14 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, * Set defaults, Assert is .5 second, Wait is 3 seconds. */ if (AssertTime == 0) - AssertDelay = (5 * HZ) / 10; + AssertDelay = 500; else - AssertDelay = (AssertTime * HZ) / 10; + AssertDelay = AssertTime * 100; if (DelayTime == 0) - WaitDelay = (30 * HZ) / 10; + WaitDelay = 3000; else - WaitDelay = (DelayTime * HZ) / 10; + WaitDelay = DelayTime * 100; /* * Assert reset @@ -77,8 +78,7 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 1); if (DeviceNode->ReturnCode == 0) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(AssertDelay); /* Sleep for the time */ + msleep(AssertDelay); /* Sleep for the time */ DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 0); @@ -86,8 +86,7 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, /* * Wait for device to reset */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(WaitDelay); + msleep(WaitDelay); } if (DeviceNode->ReturnCode == 0) PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode), diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c index 1babbb6b9..0cc58ddf4 100644 --- a/arch/ppc64/kernel/iSeries_proc.c +++ b/arch/ppc64/kernel/iSeries_proc.c @@ -20,11 +20,11 @@ #include #include #include +#include /* for HZ */ #include #include #include -#include -#include +#include #include #include #include diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c index 9b59f5165..7191f57d8 100644 --- a/arch/ppc64/kernel/iSeries_setup.c +++ b/arch/ppc64/kernel/iSeries_setup.c @@ -44,6 +44,7 @@ #include "iSeries_setup.h" #include #include +#include #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include extern void hvlog(char *fmt, ...); @@ -66,7 +68,6 @@ extern void hvlog(char *fmt, ...); /* Function Prototypes */ extern void ppcdbg_initialize(void); -extern void tce_init_iSeries(void); static void build_iSeries_Memory_Map(void); static void setup_iSeries_cache_sizes(void); @@ -312,13 +313,13 @@ static void __init iSeries_parse_cmdline(void) * If the init RAM disk has been configured and there is * a non-zero starting address for it, set it up */ - if (naca->xRamDisk) { - initrd_start = (unsigned long)__va(naca->xRamDisk); - initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE; + if (naca.xRamDisk) { + initrd_start = (unsigned long)__va(naca.xRamDisk); + initrd_end = initrd_start + naca.xRamDiskSize * PAGE_SIZE; initrd_below_start_ok = 1; // ramdisk in kernel space ROOT_DEV = Root_RAM0; - if (((rd_size * 1024) / PAGE_SIZE) < naca->xRamDiskSize) - rd_size = (naca->xRamDiskSize * PAGE_SIZE) / 1024; + if (((rd_size * 1024) / PAGE_SIZE) < naca.xRamDiskSize) + rd_size = (naca.xRamDiskSize * PAGE_SIZE) / 1024; } else #endif /* CONFIG_BLK_DEV_INITRD */ { @@ -342,7 +343,7 @@ static void __init iSeries_parse_cmdline(void) /* * Initialize the DMA/TCE management */ - tce_init_iSeries(); + iommu_init_early_iSeries(); /* * Initialize the table which translate Linux physical addresses to @@ -470,18 +471,16 @@ static void __init build_iSeries_Memory_Map(void) printk("HPT absolute addr = %016lx, size = %dK\n", chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); - /* Fill in the htab_data structure */ - /* Fill in size of hashed page table */ + /* Fill in the hashed page table hash mask */ num_ptegs = hptSizePages * (PAGE_SIZE / (sizeof(HPTE) * HPTES_PER_GROUP)); - htab_data.htab_num_ptegs = num_ptegs; - htab_data.htab_hash_mask = num_ptegs - 1; + htab_hash_mask = num_ptegs - 1; /* * The actual hashed page table is in the hypervisor, * we have no direct access */ - htab_data.htab = NULL; + htab_address = NULL; /* * Determine if absolute memory has any @@ -557,35 +556,38 @@ static void __init build_iSeries_Memory_Map(void) static void __init setup_iSeries_cache_sizes(void) { unsigned int i, n; - unsigned int procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex; + unsigned int procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; - systemcfg->iCacheL1Size = - xIoHriProcessorVpd[procIx].xInstCacheSize * 1024; - systemcfg->iCacheL1LineSize = + systemcfg->icache_size = + ppc64_caches.isize = xIoHriProcessorVpd[procIx].xInstCacheSize * 1024; + systemcfg->icache_line_size = + ppc64_caches.iline_size = xIoHriProcessorVpd[procIx].xInstCacheOperandSize; - systemcfg->dCacheL1Size = + systemcfg->dcache_size = + ppc64_caches.dsize = xIoHriProcessorVpd[procIx].xDataL1CacheSizeKB * 1024; - systemcfg->dCacheL1LineSize = + systemcfg->dcache_line_size = + ppc64_caches.dline_size = xIoHriProcessorVpd[procIx].xDataCacheOperandSize; - naca->iCacheL1LinesPerPage = PAGE_SIZE / systemcfg->iCacheL1LineSize; - naca->dCacheL1LinesPerPage = PAGE_SIZE / systemcfg->dCacheL1LineSize; + ppc64_caches.ilines_per_page = PAGE_SIZE / ppc64_caches.iline_size; + ppc64_caches.dlines_per_page = PAGE_SIZE / ppc64_caches.dline_size; - i = systemcfg->iCacheL1LineSize; + i = ppc64_caches.iline_size; n = 0; while ((i = (i / 2))) ++n; - naca->iCacheL1LogLineSize = n; + ppc64_caches.log_iline_size = n; - i = systemcfg->dCacheL1LineSize; + i = ppc64_caches.dline_size; n = 0; while ((i = (i / 2))) ++n; - naca->dCacheL1LogLineSize = n; + ppc64_caches.log_dline_size = n; printk("D-cache line size = %d\n", - (unsigned int)systemcfg->dCacheL1LineSize); + (unsigned int)ppc64_caches.dline_size); printk("I-cache line size = %d\n", - (unsigned int)systemcfg->iCacheL1LineSize); + (unsigned int)ppc64_caches.iline_size); } /* @@ -651,7 +653,7 @@ extern unsigned long ppc_tb_freq; void __init iSeries_setup_arch(void) { void *eventStack; - unsigned procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex; + unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; /* Add an eye catcher and the systemcfg layout version number */ strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); @@ -732,7 +734,7 @@ void iSeries_restart(char *cmd) */ void iSeries_power_off(void) { - mf_powerOff(); + mf_power_off(); } /* @@ -740,7 +742,7 @@ void iSeries_power_off(void) */ void iSeries_halt(void) { - mf_powerOff(); + mf_power_off(); } /* JDH Hack */ @@ -796,9 +798,9 @@ void __init iSeries_progress(char * st, unsigned short code) printk("Progress: [%04x] - %s\n", (unsigned)code, st); if (!piranha_simulator && mf_initialized) { if (code != 0xffff) - mf_displayProgress(code); + mf_display_progress(code); else - mf_clearSrc(); + mf_clear_src(); } } @@ -808,9 +810,9 @@ static void __init iSeries_fixup_klimit(void) * Change klimit to take into account any ram disk * that may be included */ - if (naca->xRamDisk) - klimit = KERNELBASE + (u64)naca->xRamDisk + - (naca->xRamDiskSize * PAGE_SIZE); + if (naca.xRamDisk) + klimit = KERNELBASE + (u64)naca.xRamDisk + + (naca.xRamDiskSize * PAGE_SIZE); else { /* * No ram disk was included - check and see if there diff --git a/arch/ppc64/kernel/iSeries_smp.c b/arch/ppc64/kernel/iSeries_smp.c index a5835eb6c..ba1f084d5 100644 --- a/arch/ppc64/kernel/iSeries_smp.c +++ b/arch/ppc64/kernel/iSeries_smp.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,7 @@ static int smp_iSeries_numProcs(void) np = 0; for (i=0; i < NR_CPUS; ++i) { - if (paca[i].lppaca.xDynProcStatus < 2) { + if (paca[i].lppaca.dyn_proc_status < 2) { cpu_set(i, cpu_possible_map); cpu_set(i, cpu_present_map); cpu_set(i, cpu_sibling_map[i]); @@ -107,7 +106,7 @@ static int smp_iSeries_probe(void) unsigned np = 0; for (i=0; i < NR_CPUS; ++i) { - if (paca[i].lppaca.xDynProcStatus < 2) { + if (paca[i].lppaca.dyn_proc_status < 2) { /*paca[i].active = 1;*/ ++np; } @@ -121,7 +120,7 @@ static void smp_iSeries_kick_cpu(int nr) BUG_ON(nr < 0 || nr >= NR_CPUS); /* Verify that our partition has a processor nr */ - if (paca[nr].lppaca.xDynProcStatus >= 2) + if (paca[nr].lppaca.dyn_proc_status >= 2) return; /* The processor is currently spinning, waiting diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c index 62e509d96..398b46821 100644 --- a/arch/ppc64/kernel/idle.c +++ b/arch/ppc64/kernel/idle.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include extern void power4_idle(void); @@ -65,7 +67,7 @@ static void yield_shared_processor(void) * The decrementer stops during the yield. Force a fake decrementer * here and let the timer_interrupt code sort out the actual time. */ - get_paca()->lppaca.xIntDword.xFields.xDecrInt = 1; + get_paca()->lppaca.int_dword.fields.decr_int = 1; process_iSeries_events(); } @@ -84,7 +86,7 @@ static int iSeries_idle(void) lpaca = get_paca(); while (1) { - if (lpaca->lppaca.xSharedProc) { + if (lpaca->lppaca.shared_proc) { if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) process_iSeries_events(); if (!need_resched()) @@ -171,7 +173,7 @@ int dedicated_idle(void) * Indicate to the HV that we are idle. Now would be * a good time to find other work to dispatch. */ - lpaca->lppaca.xIdle = 1; + lpaca->lppaca.idle = 1; oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); if (!oldval) { @@ -192,7 +194,7 @@ int dedicated_idle(void) HMT_medium(); - if (!(ppaca->lppaca.xIdle)) { + if (!(ppaca->lppaca.idle)) { local_irq_disable(); /* @@ -231,7 +233,7 @@ int dedicated_idle(void) } HMT_medium(); - lpaca->lppaca.xIdle = 0; + lpaca->lppaca.idle = 0; schedule(); if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) cpu_die(); @@ -249,7 +251,7 @@ static int shared_idle(void) * Indicate to the HV that we are idle. Now would be * a good time to find other work to dispatch. */ - lpaca->lppaca.xIdle = 1; + lpaca->lppaca.idle = 1; while (!need_resched() && !cpu_is_offline(cpu)) { local_irq_disable(); @@ -271,7 +273,7 @@ static int shared_idle(void) } HMT_medium(); - lpaca->lppaca.xIdle = 0; + lpaca->lppaca.idle = 0; schedule(); if (cpu_is_offline(smp_processor_id()) && system_state == SYSTEM_RUNNING) @@ -297,10 +299,9 @@ static int native_idle(void) #endif /* CONFIG_PPC_ISERIES */ -int cpu_idle(void) +void cpu_idle(void) { idle_loop(); - return 0; } int powersave_nap; @@ -350,7 +351,7 @@ int idle_setup(void) #ifdef CONFIG_PPC_PSERIES if (systemcfg->platform & PLATFORM_PSERIES) { if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { - if (get_paca()->lppaca.xSharedProc) { + if (get_paca()->lppaca.shared_proc) { printk(KERN_INFO "Using shared processor idle loop\n"); idle_loop = shared_idle; } else { @@ -363,12 +364,13 @@ int idle_setup(void) } } #endif /* CONFIG_PPC_PSERIES */ -#ifdef CONFIG_PPC_PMAC - if (systemcfg->platform == PLATFORM_POWERMAC) { +#ifndef CONFIG_PPC_ISERIES + if (systemcfg->platform == PLATFORM_POWERMAC || + systemcfg->platform == PLATFORM_MAPLE) { printk(KERN_INFO "Using native/NAP idle loop\n"); idle_loop = native_idle; } -#endif /* CONFIG_PPC_PMAC */ +#endif /* CONFIG_PPC_ISERIES */ return 1; } diff --git a/arch/ppc64/kernel/iomap.c b/arch/ppc64/kernel/iomap.c index b70a9240c..153cc8b0f 100644 --- a/arch/ppc64/kernel/iomap.c +++ b/arch/ppc64/kernel/iomap.c @@ -1,3 +1,10 @@ +/* + * arch/ppc64/kernel/iomap.c + * + * ppc64 "iomap" interface implementation. + * + * (C) Copyright 2004 Linus Torvalds + */ #include #include #include @@ -106,7 +113,7 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) if (flags & IORESOURCE_IO) return ioport_map(start, len); if (flags & IORESOURCE_MEM) - return (void __iomem *) start; + return ioremap(start, len); /* What? */ return NULL; } diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c index d5d64d1d7..0f0ba6b64 100644 --- a/arch/ppc64/kernel/iommu.c +++ b/arch/ppc64/kernel/iommu.c @@ -33,12 +33,12 @@ #include #include #include +#include #include #include #include #include #include -#include #define DBG(...) @@ -59,13 +59,18 @@ static int __init setup_iommu(char *str) __setup("iommu=", setup_iommu); -static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long npages, - unsigned long *handle) +static unsigned long iommu_range_alloc(struct iommu_table *tbl, + unsigned long npages, + unsigned long *handle, + unsigned int align_order) { unsigned long n, end, i, start; unsigned long limit; int largealloc = npages > 15; int pass = 0; + unsigned long align_mask; + + align_mask = 0xffffffffffffffffl >> (64 - align_order); /* This allocator was derived from x86_64's bit string search */ @@ -82,7 +87,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np start = largealloc ? tbl->it_largehint : tbl->it_hint; /* Use only half of the table for small allocs (15 pages or less) */ - limit = largealloc ? tbl->it_mapsize : tbl->it_halfpoint; + limit = largealloc ? tbl->it_size : tbl->it_halfpoint; if (largealloc && start < tbl->it_halfpoint) start = tbl->it_halfpoint; @@ -97,6 +102,10 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np again: n = find_next_zero_bit(tbl->it_map, limit, start); + + /* Align allocation */ + n = (n + align_mask) & ~align_mask; + end = n + npages; if (unlikely(end >= limit)) { @@ -105,7 +114,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np * Second failure, rescan the other half of the table. */ start = (largealloc ^ pass) ? tbl->it_halfpoint : 0; - limit = pass ? tbl->it_mapsize : limit; + limit = pass ? tbl->it_size : limit; pass++; goto again; } else { @@ -141,14 +150,15 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np } static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page, - unsigned int npages, enum dma_data_direction direction) + unsigned int npages, enum dma_data_direction direction, + unsigned int align_order) { unsigned long entry, flags; dma_addr_t ret = DMA_ERROR_CODE; spin_lock_irqsave(&(tbl->it_lock), flags); - entry = iommu_range_alloc(tbl, npages, NULL); + entry = iommu_range_alloc(tbl, npages, NULL, align_order); if (unlikely(entry == DMA_ERROR_CODE)) { spin_unlock_irqrestore(&(tbl->it_lock), flags); @@ -184,7 +194,7 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, entry = dma_addr >> PAGE_SHIFT; free_entry = entry - tbl->it_offset; - if (((free_entry + npages) > tbl->it_mapsize) || + if (((free_entry + npages) > tbl->it_size) || (entry < tbl->it_offset)) { if (printk_ratelimit()) { printk(KERN_INFO "iommu_free: invalid entry\n"); @@ -192,7 +202,7 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, printk(KERN_INFO "\tdma_addr = 0x%lx\n", (u64)dma_addr); printk(KERN_INFO "\tTable = 0x%lx\n", (u64)tbl); printk(KERN_INFO "\tbus# = 0x%lx\n", (u64)tbl->it_busno); - printk(KERN_INFO "\tmapsize = 0x%lx\n", (u64)tbl->it_mapsize); + printk(KERN_INFO "\tsize = 0x%lx\n", (u64)tbl->it_size); printk(KERN_INFO "\tstartOff = 0x%lx\n", (u64)tbl->it_offset); printk(KERN_INFO "\tindex = 0x%lx\n", (u64)tbl->it_index); WARN_ON(1); @@ -264,7 +274,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, vaddr = (unsigned long)page_address(s->page) + s->offset; npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK); npages >>= PAGE_SHIFT; - entry = iommu_range_alloc(tbl, npages, &handle); + entry = iommu_range_alloc(tbl, npages, &handle, 0); DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); @@ -397,14 +407,11 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl) unsigned long sz; static int welcomed = 0; - /* it_size is in pages, it_mapsize in number of entries */ - tbl->it_mapsize = (tbl->it_size << PAGE_SHIFT) / tbl->it_entrysize; - /* Set aside 1/4 of the table for large allocations. */ - tbl->it_halfpoint = tbl->it_mapsize * 3 / 4; + tbl->it_halfpoint = tbl->it_size * 3 / 4; /* number of bytes needed for the bitmap */ - sz = (tbl->it_mapsize + 7) >> 3; + sz = (tbl->it_size + 7) >> 3; tbl->it_map = (unsigned long *)__get_free_pages(GFP_ATOMIC, get_order(sz)); if (!tbl->it_map) @@ -425,6 +432,39 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl) return tbl; } +void iommu_free_table(struct device_node *dn) +{ + struct iommu_table *tbl = dn->iommu_table; + unsigned long bitmap_sz, i; + unsigned int order; + + if (!tbl || !tbl->it_map) { + printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__, + dn->full_name); + return; + } + + /* verify that table contains no entries */ + /* it_size is in entries, and we're examining 64 at a time */ + for (i = 0; i < (tbl->it_size/64); i++) { + if (tbl->it_map[i] != 0) { + printk(KERN_WARNING "%s: Unexpected TCEs for %s\n", + __FUNCTION__, dn->full_name); + break; + } + } + + /* calculate bitmap size in bytes */ + bitmap_sz = (tbl->it_size + 7) / 8; + + /* free bitmap */ + order = get_order(bitmap_sz); + free_pages((unsigned long) tbl->it_map, order); + + /* free table */ + kfree(tbl); +} + /* Creates TCEs for a user provided buffer. The user buffer must be * contiguous real kernel storage (not vmalloc). The address of the buffer * passed here is the kernel (virtual) address of the buffer. The buffer @@ -445,7 +485,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, npages >>= PAGE_SHIFT; if (tbl) { - dma_handle = iommu_alloc(tbl, vaddr, npages, direction); + dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 0); if (dma_handle == DMA_ERROR_CODE) { if (printk_ratelimit()) { printk(KERN_INFO "iommu_alloc failed, " @@ -504,7 +544,7 @@ void *iommu_alloc_consistent(struct iommu_table *tbl, size_t size, memset(ret, 0, size); /* Set up tces to cover the allocated range */ - mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL); + mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, order); if (mapping == DMA_ERROR_CODE) { free_pages((unsigned long)ret, order); ret = NULL; diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c index 3ebe47340..3a0f67c18 100644 --- a/arch/ppc64/kernel/irq.c +++ b/arch/ppc64/kernel/irq.c @@ -42,9 +42,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -60,258 +60,13 @@ extern void iSeries_smp_message_recv( struct pt_regs * ); #endif -static void register_irq_proc (unsigned int irq); - -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .lock = SPIN_LOCK_UNLOCKED - } -}; +extern irq_desc_t irq_desc[NR_IRQS]; +int distribute_irqs = 1; int __irq_offset_value; int ppc_spurious_interrupts; unsigned long lpevent_count; - -int -setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = get_irq_desc(irq); - - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); - if (desc->handler && desc->handler->startup) - desc->handler->startup(irq); - unmask_irq(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -#ifdef CONFIG_SMP - -inline void synchronize_irq(unsigned int irq) -{ - while (get_irq_desc(irq)->status & IRQ_INPROGRESS) - cpu_relax(); -} - -EXPORT_SYMBOL(synchronize_irq); - -#endif /* CONFIG_SMP */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, const char * devname, void *dev_id) -{ - struct irqaction *action; - int retval; - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if (!action) { - printk(KERN_ERR "kmalloc() failed for irq %d !\n", irq); - return -ENOMEM; - } - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->dev_id = dev_id; - action->next = NULL; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - - return 0; -} - -EXPORT_SYMBOL(request_irq); - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc = get_irq_desc(irq); - struct irqaction **p; - unsigned long flags; - - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - mask_irq(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - break; - } - return; -} - -EXPORT_SYMBOL(free_irq); - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = get_irq_desc(irq); - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - if (!(desc->status & IRQ_PER_CPU)) - desc->status |= IRQ_DISABLED; - mask_irq(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -EXPORT_SYMBOL(disable_irq_nosync); - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. That is for two disables you need two enables. This - * function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - irq_desc_t *desc = get_irq_desc(irq); - disable_irq_nosync(irq); - if (desc->action) - synchronize_irq(irq); -} - -EXPORT_SYMBOL(disable_irq); - -/** - * enable_irq - enable interrupt handling on an irq - * @irq: Interrupt to enable - * - * Re-enables the processing of interrupts on this IRQ line - * providing no disable_irq calls are now in effect. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = get_irq_desc(irq); - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - unmask_irq(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced from %p\n", irq, - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -EXPORT_SYMBOL(enable_irq); +u64 ppc64_interrupt_controller; int show_interrupts(struct seq_file *p, void *v) { @@ -360,107 +115,7 @@ skip: return 0; } -int handle_irq_event(int irq, struct pt_regs *regs, struct irqaction *action) -{ - int status = 0; - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - retval |= ret; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - return retval; -} - -static void __report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - struct irqaction *action; - - if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { - printk(KERN_ERR "irq event %d: bogus return value %x\n", - irq, action_ret); - } else { - printk(KERN_ERR "irq %d: nobody cared!\n", irq); - } - dump_stack(); - printk(KERN_ERR "handlers:\n"); - action = desc->action; - do { - printk(KERN_ERR "[<%p>]", action->handler); - print_symbol(" (%s)", - (unsigned long)action->handler); - printk("\n"); - action = action->next; - } while (action); -} - -static void report_bad_irq(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - static int count = 100; - - if (count) { - count--; - __report_bad_irq(irq, desc, action_ret); - } -} - -static int noirqdebug; - -static int __init noirqdebug_setup(char *str) -{ - noirqdebug = 1; - printk("IRQ lockup detection disabled\n"); - return 1; -} - -__setup("noirqdebug", noirqdebug_setup); - -/* - * If 99,900 of the previous 100,000 interrupts have not been handled then - * assume that the IRQ is stuck in some manner. Drop a diagnostic and try to - * turn the IRQ off. - * - * (The other 100-of-100,000 interrupts may have been a correctly-functioning - * device sharing an IRQ with the failing one) - * - * Called under desc->lock - */ -static void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) -{ - if (action_ret != IRQ_HANDLED) { - desc->irqs_unhandled++; - if (action_ret != IRQ_NONE) - report_bad_irq(irq, desc, action_ret); - } - - desc->irq_count++; - if (desc->irq_count < 100000) - return; - - desc->irq_count = 0; - if (desc->irqs_unhandled > 99900) { - /* - * The interrupt is stuck - */ - __report_bad_irq(irq, desc, action_ret); - /* - * Now kill the IRQ - */ - printk(KERN_EMERG "Disabling IRQ #%d\n", irq); - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - desc->irqs_unhandled = 0; -} +extern int noirqdebug; /* * Eventually, this should take an array of interrupts and an array size @@ -482,7 +137,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) if (desc->status & IRQ_PER_CPU) { /* no locking required for CPU-local interrupts: */ ack_irq(irq); - action_ret = handle_irq_event(irq, regs, desc->action); + action_ret = handle_IRQ_event(irq, regs, desc->action); desc->handler->end(irq); return; } @@ -550,13 +205,13 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) if (curtp != irqtp) { irqtp->task = curtp->task; irqtp->flags = 0; - action_ret = call_handle_irq_event(irq, regs, action, irqtp); + action_ret = call_handle_IRQ_event(irq, regs, action, irqtp); irqtp->task = NULL; if (irqtp->flags) set_bits(irqtp->flags, &curtp->flags); } else #endif - action_ret = handle_irq_event(irq, regs, action); + action_ret = handle_IRQ_event(irq, regs, action); spin_lock(&desc->lock); if (!noirqdebug) @@ -605,8 +260,8 @@ void do_IRQ(struct pt_regs *regs) lpaca = get_paca(); #ifdef CONFIG_SMP - if (lpaca->lppaca.xIntDword.xFields.xIpiCnt) { - lpaca->lppaca.xIntDword.xFields.xIpiCnt = 0; + if (lpaca->lppaca.int_dword.fields.ipi_cnt) { + lpaca->lppaca.int_dword.fields.ipi_cnt = 0; iSeries_smp_message_recv(regs); } #endif /* CONFIG_SMP */ @@ -616,8 +271,8 @@ void do_IRQ(struct pt_regs *regs) irq_exit(); - if (lpaca->lppaca.xIntDword.xFields.xDecrInt) { - lpaca->lppaca.xIntDword.xFields.xDecrInt = 0; + if (lpaca->lppaca.int_dword.fields.decr_int) { + lpaca->lppaca.int_dword.fields.decr_int = 0; /* Signal a fake decrementer interrupt */ timer_interrupt(regs); } @@ -658,27 +313,6 @@ void do_IRQ(struct pt_regs *regs) } #endif /* CONFIG_PPC_ISERIES */ -unsigned long probe_irq_on (void) -{ - return 0; -} - -EXPORT_SYMBOL(probe_irq_on); - -int probe_irq_off (unsigned long irqs) -{ - return 0; -} - -EXPORT_SYMBOL(probe_irq_off); - -unsigned int probe_irq_mask(unsigned long irqs) -{ - return 0; -} - -EXPORT_SYMBOL(probe_irq_mask); - void __init init_IRQ(void) { static int once = 0; @@ -692,130 +326,6 @@ void __init init_IRQ(void) irq_ctx_init(); } -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; - -/* Protected by get_irq_desc(irq)->lock. */ -#ifdef CONFIG_IRQ_ALL_CPUS -cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; -#else /* CONFIG_IRQ_ALL_CPUS */ -cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_NONE }; -#endif /* CONFIG_IRQ_ALL_CPUS */ - -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, const char __user *buffer, - unsigned long count, void *data) -{ - unsigned int irq = (long)data; - irq_desc_t *desc = get_irq_desc(irq); - int ret; - cpumask_t new_value, tmp; - - if (!desc->handler->set_affinity) - return -EIO; - - ret = cpumask_parse(buffer, count, new_value); - if (ret != 0) - return ret; - - /* - * We check for CPU_MASK_ALL in xics to send irqs to all cpus. - * In some cases CPU_MASK_ALL is smaller than the cpumask (eg - * NR_CPUS == 32 and cpumask is a long), so we mask it here to - * be consistent. - */ - cpus_and(new_value, new_value, CPU_MASK_ALL); - - /* - * Grab lock here so cpu_online_map can't change, and also - * protect irq_affinity[]. - */ - spin_lock(&desc->lock); - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) { - ret = -EINVAL; - goto out; - } - - irq_affinity[irq] = new_value; - desc->handler->set_affinity(irq, new_value); - ret = count; - -out: - spin_unlock(&desc->lock); - return ret; -} - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - struct proc_dir_entry *entry; - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == NULL) || irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; -} - -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for_each_irq(i) { - if (get_irq_desc(i)->handler == NULL) - continue; - register_irq_proc(i); - } -} - -irqreturn_t no_action(int irq, void *dev, struct pt_regs *regs) -{ - return IRQ_NONE; -} - #ifndef CONFIG_PPC_ISERIES /* * Virtual IRQ mapping code, used on systems with XICS interrupt controllers. @@ -852,7 +362,7 @@ int virt_irq_create_mapping(unsigned int real_irq) unsigned int virq, first_virq; static int warned; - if (naca->interrupt_controller == IC_OPEN_PIC) + if (ppc64_interrupt_controller == IC_OPEN_PIC) return real_irq; /* no mapping for openpic (for now) */ /* don't map interrupts < MIN_VIRT_IRQ */ @@ -970,3 +480,10 @@ EXPORT_SYMBOL(do_softirq); #endif /* CONFIG_IRQSTACKS */ +static int __init setup_noirqdistrib(char *str) +{ + distribute_irqs = 0; + return 1; +} + +__setup("noirqdistrib", setup_noirqdistrib); diff --git a/arch/ppc64/kernel/lmb.c b/arch/ppc64/kernel/lmb.c index 56a26eec0..56d7ba87f 100644 --- a/arch/ppc64/kernel/lmb.c +++ b/arch/ppc64/kernel/lmb.c @@ -13,12 +13,12 @@ #include #include #include +#include #include #include #include #include #include -#include struct lmb lmb; diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c index f7ac3f742..860dea505 100644 --- a/arch/ppc64/kernel/lparcfg.c +++ b/arch/ppc64/kernel/lparcfg.c @@ -27,14 +27,14 @@ #include #include #include -#include +#include #include #include #include #include #include -#define MODULE_VERS "1.4" +#define MODULE_VERS "1.5" #define MODULE_NAME "lparcfg" /* #define LPARCFG_DEBUG */ @@ -70,6 +70,28 @@ static struct proc_dir_entry *proc_ppc64_lparcfg; #ifdef CONFIG_PPC_ISERIES +/* + * For iSeries legacy systems, the PPA purr function is available from the + * emulated_time_base field in the paca. + */ +static unsigned long get_purr(void) +{ + unsigned long sum_purr = 0; + int cpu; + struct paca_struct *lpaca; + + for_each_cpu(cpu) { + lpaca = paca + cpu; + sum_purr += lpaca->lppaca.emulated_time_base; + +#ifdef PURR_DEBUG + printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n", + cpu, lpaca->lppaca.emulated_time_base); +#endif + } + return sum_purr; +} + #define lparcfg_write NULL /* @@ -81,8 +103,11 @@ static int lparcfg_data(struct seq_file *m, void *v) int shared, entitled_capacity, max_entitled_capacity; int processors, max_processors; struct paca_struct *lpaca = get_paca(); + unsigned long purr = get_purr(); - shared = (int)(lpaca->lppaca_ptr->xSharedProc); + seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); + + shared = (int)(lpaca->lppaca_ptr->shared_proc); seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n", e2a(xItExtVpdPanel.mfgID[2]), e2a(xItExtVpdPanel.mfgID[3]), @@ -131,6 +156,7 @@ static int lparcfg_data(struct seq_file *m, void *v) seq_printf(m, "pool_capacity=%d\n", (int)(HvLpConfig_getNumProcsInSharedPool(pool_id) * 100)); + seq_printf(m, "purr=%ld\n", purr); } seq_printf(m, "shared_processor_mode=%d\n", shared); @@ -192,7 +218,7 @@ static unsigned long get_purr(void); * is coming, but at this time is still problematic, so for now this * function will return 0. */ -static unsigned long get_purr() +static unsigned long get_purr(void) { unsigned long sum_purr = 0; return sum_purr; @@ -369,7 +395,7 @@ static int lparcfg_data(struct seq_file *m, void *v) (h_resource >> 0 * 8) & 0xffff); /* pool related entries are apropriate for shared configs */ - if (paca[0].lppaca.xSharedProc) { + if (paca[0].lppaca.shared_proc) { h_pic(&pool_idle_time, &pool_procs); @@ -418,7 +444,7 @@ static int lparcfg_data(struct seq_file *m, void *v) seq_printf(m, "partition_potential_processors=%d\n", partition_potential_processors); - seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.xSharedProc); + seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.shared_proc); return 0; } @@ -524,10 +550,10 @@ static int lparcfg_open(struct inode *inode, struct file *file) } struct file_operations lparcfg_fops = { - owner:THIS_MODULE, - read:seq_read, - open:lparcfg_open, - release:single_release, + .owner = THIS_MODULE, + .read = seq_read, + .open = lparcfg_open, + .release = single_release, }; int __init lparcfg_init(void) diff --git a/arch/ppc64/kernel/maple_pci.c b/arch/ppc64/kernel/maple_pci.c index bf3a3c057..53993999b 100644 --- a/arch/ppc64/kernel/maple_pci.c +++ b/arch/ppc64/kernel/maple_pci.c @@ -382,12 +382,6 @@ void __init maple_pcibios_fixup(void) /* Do the mapping of the IO space */ phbs_remap_io(); - /* Fixup the pci_bus sysdata pointers */ - pci_fix_bus_sysdata(); - - /* Setup the iommu */ - iommu_setup_u3(); - DBG(" <- maple_pcibios_fixup\n"); } diff --git a/arch/ppc64/kernel/maple_setup.c b/arch/ppc64/kernel/maple_setup.c index 29d5859db..1db6ea0f3 100644 --- a/arch/ppc64/kernel/maple_setup.c +++ b/arch/ppc64/kernel/maple_setup.c @@ -75,7 +75,8 @@ extern void maple_calibrate_decr(void); extern void maple_pci_init(void); extern void maple_pcibios_fixup(void); extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel); -extern void generic_find_legacy_serial_ports(unsigned int *default_speed); +extern void generic_find_legacy_serial_ports(u64 *physport, + unsigned int *default_speed); static void maple_restart(char *cmd) @@ -110,11 +111,6 @@ void __init maple_setup_arch(void) #ifdef CONFIG_SMP smp_ops = &maple_smp_ops; #endif - /* Setup the PCI DMA to "direct" by default. May be overriden - * by iommu later on - */ - pci_dma_init_direct(); - /* Lookup PCI hosts */ maple_pci_init(); @@ -129,6 +125,7 @@ void __init maple_setup_arch(void) static void __init maple_init_early(void) { unsigned int default_speed; + u64 physport; DBG(" -> maple_init_early\n"); @@ -138,14 +135,14 @@ static void __init maple_init_early(void) hpte_init_native(); /* Find the serial port */ - generic_find_legacy_serial_ports(&default_speed); + generic_find_legacy_serial_ports(&physport, &default_speed); - DBG("naca->serialPortAddr: %lx\n", (long)naca->serialPortAddr); + DBG("phys port addr: %lx\n", (long)physport); - if (naca->serialPortAddr) { + if (physport) { void *comport; /* Map the uart for udbg. */ - comport = (void *)__ioremap(naca->serialPortAddr, 16, _PAGE_NO_CACHE); + comport = (void *)__ioremap(physport, 16, _PAGE_NO_CACHE); udbg_init_uart(comport, default_speed); ppc_md.udbg_putc = udbg_putc; @@ -155,7 +152,9 @@ static void __init maple_init_early(void) } /* Setup interrupt mapping options */ - naca->interrupt_controller = IC_OPEN_PIC; + ppc64_interrupt_controller = IC_OPEN_PIC; + + iommu_init_early_u3(); DBG(" <- maple_init_early\n"); } diff --git a/arch/ppc64/kernel/mf.c b/arch/ppc64/kernel/mf.c index 02a68b116..1bd52ece4 100644 --- a/arch/ppc64/kernel/mf.c +++ b/arch/ppc64/kernel/mf.c @@ -1,6 +1,7 @@ /* * mf.c * Copyright (C) 2001 Troy D. Armstrong IBM Corporation + * Copyright (C) 2004 Stephen Rothwell IBM Corporation * * This modules exists as an interface between a Linux secondary partition * running on an iSeries and the primary partition's Virtual Service @@ -8,52 +9,44 @@ * all partitions in the iSeries. It also provides miscellaneous low-level * machine facility type operations. * - * + * * 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 #include #include #include #include -#include -#include #include -#include -#include #include -#include -#include -#include -#include #include #include + +#include +#include #include +#include +#include +#include /* * This is the structure layout for the Machine Facilites LPAR event * flows. */ -union safe_cast { - u64 ptr_as_u64; - void *ptr; -}; - -struct VspCmdData { - union safe_cast token; +struct vsp_cmd_data { + u64 token; u16 cmd; HvLpIndex lp_index; u8 result_code; @@ -81,12 +74,12 @@ struct VspCmdData { } sub_data; }; -struct VspRspData { +struct vsp_rsp_data { struct completion com; - struct VspCmdData *response; + struct vsp_cmd_data *response; }; -struct AllocData { +struct alloc_data { u16 size; u16 type; u32 count; @@ -95,30 +88,30 @@ struct AllocData { HvLpIndex target_lp; }; -struct CeMsgData; +struct ce_msg_data; -typedef void (*CeMsgCompleteHandler)(void *token, struct CeMsgData *vspCmdRsp); +typedef void (*ce_msg_comp_hdlr)(void *token, struct ce_msg_data *vsp_cmd_rsp); -struct CeMsgCompleteData { - CeMsgCompleteHandler handler; +struct ce_msg_comp_data { + ce_msg_comp_hdlr handler; void *token; }; -struct CeMsgData { +struct ce_msg_data { u8 ce_msg[12]; char reserved[4]; - struct CeMsgCompleteData *completion; + struct ce_msg_comp_data *completion; }; -struct IoMFLpEvent { +struct io_mf_lp_event { struct HvLpEvent hp_lp_event; u16 subtype_result_code; u16 reserved1; u32 reserved2; union { - struct AllocData alloc; - struct CeMsgData ce_msg; - struct VspCmdData vsp_cmd; + struct alloc_data alloc; + struct ce_msg_data ce_msg; + struct vsp_cmd_data vsp_cmd; } data; }; @@ -134,7 +127,7 @@ struct IoMFLpEvent { */ struct pending_event { struct pending_event *next; - struct IoMFLpEvent event; + struct io_mf_lp_event event; MFCompleteHandler hdlr; char dma_data[72]; unsigned dma_data_length; @@ -172,7 +165,7 @@ static int signal_event(struct pending_event *ev) unsigned long flags; int go = 1; struct pending_event *ev1; - HvLpEvent_Rc hvRc; + HvLpEvent_Rc hv_rc; /* enqueue the event */ if (ev != NULL) { @@ -199,11 +192,11 @@ static int signal_event(struct pending_event *ev) pending_event_head->dma_data_length, HvLpDma_Direction_LocalToRemote); - hvRc = HvCallEvent_signalLpEvent( + hv_rc = HvCallEvent_signalLpEvent( &pending_event_head->event.hp_lp_event); - if (hvRc != HvLpEvent_Rc_Good) { - printk(KERN_ERR "mf.c: HvCallEvent_signalLpEvent() failed with %d\n", - (int)hvRc); + if (hv_rc != HvLpEvent_Rc_Good) { + printk(KERN_ERR "mf.c: HvCallEvent_signalLpEvent() " + "failed with %d\n", (int)hv_rc); spin_lock_irqsave(&pending_event_spinlock, flags); ev1 = pending_event_head; @@ -214,12 +207,8 @@ static int signal_event(struct pending_event *ev) if (ev1 == ev) rc = -EIO; - else if (ev1->hdlr != NULL) { - union safe_cast mySafeCast; - - mySafeCast.ptr_as_u64 = ev1->event.hp_lp_event.xCorrelationToken; - (*ev1->hdlr)(mySafeCast.ptr, -EIO); - } + else if (ev1->hdlr != NULL) + (*ev1->hdlr)((void *)ev1->event.hp_lp_event.xCorrelationToken, -EIO); spin_lock_irqsave(&pending_event_spinlock, flags); free_pending_event(ev1); @@ -236,7 +225,7 @@ static int signal_event(struct pending_event *ev) static struct pending_event *new_pending_event(void) { struct pending_event *ev = NULL; - HvLpIndex primaryLp = HvLpConfig_getPrimaryLpIndex(); + HvLpIndex primary_lp = HvLpConfig_getPrimaryLpIndex(); unsigned long flags; struct HvLpEvent *hev; @@ -246,12 +235,13 @@ static struct pending_event *new_pending_event(void) pending_event_avail = pending_event_avail->next; } spin_unlock_irqrestore(&pending_event_spinlock, flags); - if (ev == NULL) - ev = kmalloc(sizeof(struct pending_event),GFP_ATOMIC); if (ev == NULL) { - printk(KERN_ERR "mf.c: unable to kmalloc %ld bytes\n", - sizeof(struct pending_event)); - return NULL; + ev = kmalloc(sizeof(struct pending_event), GFP_ATOMIC); + if (ev == NULL) { + printk(KERN_ERR "mf.c: unable to kmalloc %ld bytes\n", + sizeof(struct pending_event)); + return NULL; + } } memset(ev, 0, sizeof(struct pending_event)); hev = &ev->event.hp_lp_event; @@ -261,38 +251,38 @@ static struct pending_event *new_pending_event(void) hev->xFlags.xFunction = HvLpEvent_Function_Int; hev->xType = HvLpEvent_Type_MachineFac; hev->xSourceLp = HvLpConfig_getLpIndex(); - hev->xTargetLp = primaryLp; - hev->xSizeMinus1 = sizeof(ev->event)-1; + hev->xTargetLp = primary_lp; + hev->xSizeMinus1 = sizeof(ev->event) - 1; hev->xRc = HvLpEvent_Rc_Good; - hev->xSourceInstanceId = HvCallEvent_getSourceLpInstanceId(primaryLp, + hev->xSourceInstanceId = HvCallEvent_getSourceLpInstanceId(primary_lp, HvLpEvent_Type_MachineFac); - hev->xTargetInstanceId = HvCallEvent_getTargetLpInstanceId(primaryLp, + hev->xTargetInstanceId = HvCallEvent_getTargetLpInstanceId(primary_lp, HvLpEvent_Type_MachineFac); return ev; } -static int signal_vsp_instruction(struct VspCmdData *vspCmd) +static int signal_vsp_instruction(struct vsp_cmd_data *vsp_cmd) { struct pending_event *ev = new_pending_event(); int rc; - struct VspRspData response; + struct vsp_rsp_data response; if (ev == NULL) return -ENOMEM; init_completion(&response.com); - response.response = vspCmd; + response.response = vsp_cmd; ev->event.hp_lp_event.xSubtype = 6; ev->event.hp_lp_event.x.xSubtypeData = subtype_data('M', 'F', 'V', 'I'); - ev->event.data.vsp_cmd.token.ptr = &response; - ev->event.data.vsp_cmd.cmd = vspCmd->cmd; + ev->event.data.vsp_cmd.token = (u64)&response; + ev->event.data.vsp_cmd.cmd = vsp_cmd->cmd; ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex(); ev->event.data.vsp_cmd.result_code = 0xFF; ev->event.data.vsp_cmd.reserved = 0; memcpy(&(ev->event.data.vsp_cmd.sub_data), - &(vspCmd->sub_data), sizeof(vspCmd->sub_data)); + &(vsp_cmd->sub_data), sizeof(vsp_cmd->sub_data)); mb(); rc = signal_event(ev); @@ -305,7 +295,7 @@ static int signal_vsp_instruction(struct VspCmdData *vspCmd) /* * Send a 12-byte CE message to the primary partition VSP object */ -static int signal_ce_msg(char *ce_msg, struct CeMsgCompleteData *completion) +static int signal_ce_msg(char *ce_msg, struct ce_msg_comp_data *completion) { struct pending_event *ev = new_pending_event(); @@ -320,11 +310,23 @@ static int signal_ce_msg(char *ce_msg, struct CeMsgCompleteData *completion) return signal_event(ev); } +/* + * Send a 12-byte CE message (with no data) to the primary partition VSP object + */ +static int signal_ce_msg_simple(u8 ce_op, struct ce_msg_comp_data *completion) +{ + u8 ce_msg[12]; + + memset(ce_msg, 0, sizeof(ce_msg)); + ce_msg[3] = ce_op; + return signal_ce_msg(ce_msg, completion); +} + /* * Send a 12-byte CE message and DMA data to the primary partition VSP object */ static int dma_and_signal_ce_msg(char *ce_msg, - struct CeMsgCompleteData *completion, void *dma_data, + struct ce_msg_comp_data *completion, void *dma_data, unsigned dma_data_length, unsigned remote_address) { struct pending_event *ev = new_pending_event(); @@ -356,7 +358,7 @@ static int shutdown(void) if (rc) { printk(KERN_ALERT "mf.c: SIGINT to init failed (%d), " "hard shutdown commencing\n", rc); - mf_powerOff(); + mf_power_off(); } else printk(KERN_INFO "mf.c: init has been successfully notified " "to proceed with shutdown\n"); @@ -367,10 +369,12 @@ static int shutdown(void) * The primary partition VSP object is sending us a new * event flow. Handle it... */ -static void intReceived(struct IoMFLpEvent *event) +static void handle_int(struct io_mf_lp_event *event) { - int freeIt = 0; - struct pending_event *two = NULL; + struct ce_msg_data *ce_msg_data; + struct ce_msg_data *pce_msg_data; + unsigned long flags; + struct pending_event *pev; /* ack the interrupt */ event->hp_lp_event.xRc = HvLpEvent_Rc_Good; @@ -379,49 +383,42 @@ static void intReceived(struct IoMFLpEvent *event) /* process interrupt */ switch (event->hp_lp_event.xSubtype) { case 0: /* CE message */ - switch (event->data.ce_msg.ce_msg[3]) { + ce_msg_data = &event->data.ce_msg; + switch (ce_msg_data->ce_msg[3]) { case 0x5B: /* power control notification */ - if ((event->data.ce_msg.ce_msg[5] & 0x20) != 0) { + if ((ce_msg_data->ce_msg[5] & 0x20) != 0) { printk(KERN_INFO "mf.c: Commencing partition shutdown\n"); if (shutdown() == 0) - signal_ce_msg("\x00\x00\x00\xDB\x00\x00\x00\x00\x00\x00\x00\x00", NULL); + signal_ce_msg_simple(0xDB, NULL); } break; case 0xC0: /* get time */ - if ((pending_event_head == NULL) || - (pending_event_head->event.data.ce_msg.ce_msg[3] - != 0x40)) + spin_lock_irqsave(&pending_event_spinlock, flags); + pev = pending_event_head; + if (pev != NULL) + pending_event_head = pending_event_head->next; + spin_unlock_irqrestore(&pending_event_spinlock, flags); + if (pev == NULL) break; - freeIt = 1; - if (pending_event_head->event.data.ce_msg.completion != 0) { - CeMsgCompleteHandler handler = pending_event_head->event.data.ce_msg.completion->handler; - void *token = pending_event_head->event.data.ce_msg.completion->token; + pce_msg_data = &pev->event.data.ce_msg; + if (pce_msg_data->ce_msg[3] != 0x40) + break; + if (pce_msg_data->completion != NULL) { + ce_msg_comp_hdlr handler = + pce_msg_data->completion->handler; + void *token = pce_msg_data->completion->token; if (handler != NULL) - (*handler)(token, &(event->data.ce_msg)); + (*handler)(token, ce_msg_data); } - break; - } - - /* remove from queue */ - if (freeIt == 1) { - unsigned long flags; - spin_lock_irqsave(&pending_event_spinlock, flags); - if (pending_event_head != NULL) { - struct pending_event *oldHead = - pending_event_head; - - pending_event_head = pending_event_head->next; - two = pending_event_head; - free_pending_event(oldHead); - } + free_pending_event(pev); spin_unlock_irqrestore(&pending_event_spinlock, flags); + /* send next waiting event */ + if (pending_event_head != NULL) + signal_event(NULL); + break; } - - /* send next waiting event */ - if (two != NULL) - signal_event(NULL); break; case 1: /* IT sys shutdown */ printk(KERN_INFO "mf.c: Commencing system shutdown\n"); @@ -435,68 +432,70 @@ static void intReceived(struct IoMFLpEvent *event) * of a flow we sent to them. If there are other flows queued * up, we must send another one now... */ -static void ackReceived(struct IoMFLpEvent *event) +static void handle_ack(struct io_mf_lp_event *event) { unsigned long flags; - struct pending_event * two = NULL; - unsigned long freeIt = 0; + struct pending_event *two = NULL; + unsigned long free_it = 0; + struct ce_msg_data *ce_msg_data; + struct ce_msg_data *pce_msg_data; + struct vsp_rsp_data *rsp; /* handle current event */ - if (pending_event_head != NULL) { - switch (event->hp_lp_event.xSubtype) { - case 0: /* CE msg */ - if (event->data.ce_msg.ce_msg[3] == 0x40) { - if (event->data.ce_msg.ce_msg[2] != 0) { - freeIt = 1; - if (pending_event_head->event.data.ce_msg.completion - != 0) { - CeMsgCompleteHandler handler = pending_event_head->event.data.ce_msg.completion->handler; - void *token = pending_event_head->event.data.ce_msg.completion->token; - - if (handler != NULL) - (*handler)(token, &(event->data.ce_msg)); - } - } - } else - freeIt = 1; - break; - case 4: /* allocate */ - case 5: /* deallocate */ - if (pending_event_head->hdlr != NULL) { - union safe_cast mySafeCast; + if (pending_event_head == NULL) { + printk(KERN_ERR "mf.c: stack empty for receiving ack\n"); + return; + } - mySafeCast.ptr_as_u64 = event->hp_lp_event.xCorrelationToken; - (*pending_event_head->hdlr)(mySafeCast.ptr, event->data.alloc.count); - } - freeIt = 1; + switch (event->hp_lp_event.xSubtype) { + case 0: /* CE msg */ + ce_msg_data = &event->data.ce_msg; + if (ce_msg_data->ce_msg[3] != 0x40) { + free_it = 1; break; - case 6: - { - struct VspRspData *rsp = (struct VspRspData *)event->data.vsp_cmd.token.ptr; - - if (rsp != NULL) { - if (rsp->response != NULL) - memcpy(rsp->response, &(event->data.vsp_cmd), sizeof(event->data.vsp_cmd)); - complete(&rsp->com); - } else - printk(KERN_ERR "mf.c: no rsp\n"); - freeIt = 1; - } + } + if (ce_msg_data->ce_msg[2] == 0) + break; + free_it = 1; + pce_msg_data = &pending_event_head->event.data.ce_msg; + if (pce_msg_data->completion != NULL) { + ce_msg_comp_hdlr handler = + pce_msg_data->completion->handler; + void *token = pce_msg_data->completion->token; + + if (handler != NULL) + (*handler)(token, ce_msg_data); + } + break; + case 4: /* allocate */ + case 5: /* deallocate */ + if (pending_event_head->hdlr != NULL) + (*pending_event_head->hdlr)((void *)event->hp_lp_event.xCorrelationToken, event->data.alloc.count); + free_it = 1; + break; + case 6: + free_it = 1; + rsp = (struct vsp_rsp_data *)event->data.vsp_cmd.token; + if (rsp == NULL) { + printk(KERN_ERR "mf.c: no rsp\n"); break; } + if (rsp->response != NULL) + memcpy(rsp->response, &event->data.vsp_cmd, + sizeof(event->data.vsp_cmd)); + complete(&rsp->com); + break; } - else - printk(KERN_ERR "mf.c: stack empty for receiving ack\n"); /* remove from queue */ spin_lock_irqsave(&pending_event_spinlock, flags); - if ((pending_event_head != NULL) && (freeIt == 1)) { + if ((pending_event_head != NULL) && (free_it == 1)) { struct pending_event *oldHead = pending_event_head; pending_event_head = pending_event_head->next; two = pending_event_head; free_pending_event(oldHead); - } + } spin_unlock_irqrestore(&pending_event_spinlock, flags); /* send next waiting event */ @@ -510,15 +509,15 @@ static void ackReceived(struct IoMFLpEvent *event) * parse it enough to know if it is an interrupt or an * acknowledge. */ -static void hvHandler(struct HvLpEvent *event, struct pt_regs *regs) +static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) { if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { switch(event->xFlags.xFunction) { case HvLpEvent_Function_Ack: - ackReceived((struct IoMFLpEvent *)event); + handle_ack((struct io_mf_lp_event *)event); break; case HvLpEvent_Function_Int: - intReceived((struct IoMFLpEvent *)event); + handle_int((struct io_mf_lp_event *)event); break; default: printk(KERN_ERR "mf.c: non ack/int event received\n"); @@ -532,9 +531,9 @@ static void hvHandler(struct HvLpEvent *event, struct pt_regs *regs) * Global kernel interface to allocate and seed events into the * Hypervisor. */ -void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type, +void mf_allocate_lp_events(HvLpIndex target_lp, HvLpEvent_Type type, unsigned size, unsigned count, MFCompleteHandler hdlr, - void *userToken) + void *user_token) { struct pending_event *ev = new_pending_event(); int rc; @@ -542,14 +541,11 @@ void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type, if (ev == NULL) { rc = -ENOMEM; } else { - union safe_cast mine; - - mine.ptr = userToken; ev->event.hp_lp_event.xSubtype = 4; - ev->event.hp_lp_event.xCorrelationToken = mine.ptr_as_u64; + ev->event.hp_lp_event.xCorrelationToken = (u64)user_token; ev->event.hp_lp_event.x.xSubtypeData = subtype_data('M', 'F', 'M', 'A'); - ev->event.data.alloc.target_lp = targetLp; + ev->event.data.alloc.target_lp = target_lp; ev->event.data.alloc.type = type; ev->event.data.alloc.size = size; ev->event.data.alloc.count = count; @@ -557,16 +553,16 @@ void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type, rc = signal_event(ev); } if ((rc != 0) && (hdlr != NULL)) - (*hdlr)(userToken, rc); + (*hdlr)(user_token, rc); } -EXPORT_SYMBOL(mf_allocateLpEvents); +EXPORT_SYMBOL(mf_allocate_lp_events); /* * Global kernel interface to unseed and deallocate events already in * Hypervisor. */ -void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type, - unsigned count, MFCompleteHandler hdlr, void *userToken) +void mf_deallocate_lp_events(HvLpIndex target_lp, HvLpEvent_Type type, + unsigned count, MFCompleteHandler hdlr, void *user_token) { struct pending_event *ev = new_pending_event(); int rc; @@ -574,33 +570,31 @@ void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type, if (ev == NULL) rc = -ENOMEM; else { - union safe_cast mine; - - mine.ptr = userToken; ev->event.hp_lp_event.xSubtype = 5; - ev->event.hp_lp_event.xCorrelationToken = mine.ptr_as_u64; + ev->event.hp_lp_event.xCorrelationToken = (u64)user_token; ev->event.hp_lp_event.x.xSubtypeData = subtype_data('M', 'F', 'M', 'D'); - ev->event.data.alloc.target_lp = targetLp; + ev->event.data.alloc.target_lp = target_lp; ev->event.data.alloc.type = type; ev->event.data.alloc.count = count; ev->hdlr = hdlr; rc = signal_event(ev); } if ((rc != 0) && (hdlr != NULL)) - (*hdlr)(userToken, rc); + (*hdlr)(user_token, rc); } -EXPORT_SYMBOL(mf_deallocateLpEvents); +EXPORT_SYMBOL(mf_deallocate_lp_events); /* * Global kernel interface to tell the VSP object in the primary * partition to power this partition off. */ -void mf_powerOff(void) +void mf_power_off(void) { printk(KERN_INFO "mf.c: Down it goes...\n"); - signal_ce_msg("\x00\x00\x00\x4D\x00\x00\x00\x00\x00\x00\x00\x00", NULL); - for (;;); + signal_ce_msg_simple(0x4d, NULL); + for (;;) + ; } /* @@ -610,18 +604,21 @@ void mf_powerOff(void) void mf_reboot(void) { printk(KERN_INFO "mf.c: Preparing to bounce...\n"); - signal_ce_msg("\x00\x00\x00\x4E\x00\x00\x00\x00\x00\x00\x00\x00", NULL); - for (;;); + signal_ce_msg_simple(0x4e, NULL); + for (;;) + ; } /* * Display a single word SRC onto the VSP control panel. */ -void mf_displaySrc(u32 word) +void mf_display_src(u32 word) { u8 ce[12]; - memcpy(ce, "\x00\x00\x00\x4A\x00\x00\x00\x01\x00\x00\x00\x00", 12); + memset(ce, 0, sizeof(ce)); + ce[3] = 0x4a; + ce[7] = 0x01; ce[8] = word >> 24; ce[9] = word >> 16; ce[10] = word >> 8; @@ -632,7 +629,7 @@ void mf_displaySrc(u32 word) /* * Display a single word SRC of the form "PROGXXXX" on the VSP control panel. */ -void mf_displayProgress(u16 value) +void mf_display_progress(u16 value) { u8 ce[12]; u8 src[72]; @@ -656,9 +653,9 @@ void mf_displayProgress(u16 value) * Clear the VSP control panel. Used to "erase" an SRC that was * previously displayed. */ -void mf_clearSrc(void) +void mf_clear_src(void) { - signal_ce_msg("\x00\x00\x00\x4B\x00\x00\x00\x00\x00\x00\x00\x00", NULL); + signal_ce_msg_simple(0x4b, NULL); } /* @@ -674,71 +671,331 @@ void mf_init(void) i < sizeof(pending_event_prealloc) / sizeof(*pending_event_prealloc); ++i) free_pending_event(&pending_event_prealloc[i]); - HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hvHandler); + HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hv_handler); /* virtual continue ack */ - signal_ce_msg("\x00\x00\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00", NULL); + signal_ce_msg_simple(0x57, NULL); /* initialization complete */ - printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities initialized\n"); + printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities " + "initialized\n"); } -void mf_setSide(char side) +struct rtc_time_data { + struct completion com; + struct ce_msg_data ce_msg; + int rc; +}; + +static void get_rtc_time_complete(void *token, struct ce_msg_data *ce_msg) { - u64 newSide; - struct VspCmdData myVspCmd; + struct rtc_time_data *rtc = token; - memset(&myVspCmd, 0, sizeof(myVspCmd)); - switch (side) { - case 'A': newSide = 0; - break; - case 'B': newSide = 1; - break; - case 'C': newSide = 2; - break; - default: newSide = 3; + memcpy(&rtc->ce_msg, ce_msg, sizeof(rtc->ce_msg)); + rtc->rc = 0; + complete(&rtc->com); +} + +int mf_get_rtc(struct rtc_time *tm) +{ + struct ce_msg_comp_data ce_complete; + struct rtc_time_data rtc_data; + int rc; + + memset(&ce_complete, 0, sizeof(ce_complete)); + memset(&rtc_data, 0, sizeof(rtc_data)); + init_completion(&rtc_data.com); + ce_complete.handler = &get_rtc_time_complete; + ce_complete.token = &rtc_data; + rc = signal_ce_msg_simple(0x40, &ce_complete); + if (rc) + return rc; + wait_for_completion(&rtc_data.com); + tm->tm_wday = 0; + tm->tm_yday = 0; + tm->tm_isdst = 0; + if (rtc_data.rc) { + tm->tm_sec = 0; + tm->tm_min = 0; + tm->tm_hour = 0; + tm->tm_mday = 15; + tm->tm_mon = 5; + tm->tm_year = 52; + return rtc_data.rc; + } + + if ((rtc_data.ce_msg.ce_msg[2] == 0xa9) || + (rtc_data.ce_msg.ce_msg[2] == 0xaf)) { + /* TOD clock is not set */ + tm->tm_sec = 1; + tm->tm_min = 1; + tm->tm_hour = 1; + tm->tm_mday = 10; + tm->tm_mon = 8; + tm->tm_year = 71; + mf_set_rtc(tm); + } + { + u8 *ce_msg = rtc_data.ce_msg.ce_msg; + u8 year = ce_msg[5]; + u8 sec = ce_msg[6]; + u8 min = ce_msg[7]; + u8 hour = ce_msg[8]; + u8 day = ce_msg[10]; + u8 mon = ce_msg[11]; + + BCD_TO_BIN(sec); + BCD_TO_BIN(min); + BCD_TO_BIN(hour); + BCD_TO_BIN(day); + BCD_TO_BIN(mon); + BCD_TO_BIN(year); + + if (year <= 69) + year += 100; + + tm->tm_sec = sec; + tm->tm_min = min; + tm->tm_hour = hour; + tm->tm_mday = day; + tm->tm_mon = mon; + tm->tm_year = year; + } + + return 0; +} + +int mf_set_rtc(struct rtc_time *tm) +{ + char ce_time[12]; + u8 day, mon, hour, min, sec, y1, y2; + unsigned year; + + year = 1900 + tm->tm_year; + y1 = year / 100; + y2 = year % 100; + + sec = tm->tm_sec; + min = tm->tm_min; + hour = tm->tm_hour; + day = tm->tm_mday; + mon = tm->tm_mon + 1; + + BIN_TO_BCD(sec); + BIN_TO_BCD(min); + BIN_TO_BCD(hour); + BIN_TO_BCD(mon); + BIN_TO_BCD(day); + BIN_TO_BCD(y1); + BIN_TO_BCD(y2); + + memset(ce_time, 0, sizeof(ce_time)); + ce_time[3] = 0x41; + ce_time[4] = y1; + ce_time[5] = y2; + ce_time[6] = sec; + ce_time[7] = min; + ce_time[8] = hour; + ce_time[10] = day; + ce_time[11] = mon; + + return signal_ce_msg(ce_time, NULL); +} + +#ifdef CONFIG_PROC_FS + +static int proc_mf_dump_cmdline(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + char *p; + struct vsp_cmd_data vsp_cmd; + int rc; + dma_addr_t dma_addr; + + /* The HV appears to return no more than 256 bytes of command line */ + if (off >= 256) + return 0; + if ((off + count) > 256) + count = 256 - off; + + dma_addr = dma_map_single(iSeries_vio_dev, page, off + count, + DMA_FROM_DEVICE); + if (dma_mapping_error(dma_addr)) + return -ENOMEM; + memset(page, 0, off + count); + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.cmd = 33; + vsp_cmd.sub_data.kern.token = dma_addr; + vsp_cmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; + vsp_cmd.sub_data.kern.side = (u64)data; + vsp_cmd.sub_data.kern.length = off + count; + mb(); + rc = signal_vsp_instruction(&vsp_cmd); + dma_unmap_single(iSeries_vio_dev, dma_addr, off + count, + DMA_FROM_DEVICE); + if (rc) + return rc; + if (vsp_cmd.result_code != 0) + return -ENOMEM; + p = page; + len = 0; + while (len < (off + count)) { + if ((*p == '\0') || (*p == '\n')) { + if (*p == '\0') + *p = '\n'; + p++; + len++; + *eof = 1; break; + } + p++; + len++; } - myVspCmd.sub_data.ipl_type = newSide; - myVspCmd.cmd = 10; - (void)signal_vsp_instruction(&myVspCmd); + if (len < off) { + *eof = 1; + len = 0; + } + return len; } -char mf_getSide(void) +#if 0 +static int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side) { - char returnValue = ' '; - int rc = 0; - struct VspCmdData myVspCmd; + struct vsp_cmd_data vsp_cmd; + int rc; + int len = *size; + dma_addr_t dma_addr; + + dma_addr = dma_map_single(iSeries_vio_dev, buffer, len, + DMA_FROM_DEVICE); + memset(buffer, 0, len); + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.cmd = 32; + vsp_cmd.sub_data.kern.token = dma_addr; + vsp_cmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; + vsp_cmd.sub_data.kern.side = side; + vsp_cmd.sub_data.kern.offset = offset; + vsp_cmd.sub_data.kern.length = len; + mb(); + rc = signal_vsp_instruction(&vsp_cmd); + if (rc == 0) { + if (vsp_cmd.result_code == 0) + *size = vsp_cmd.sub_data.length_out; + else + rc = -ENOMEM; + } + + dma_unmap_single(iSeries_vio_dev, dma_addr, len, DMA_FROM_DEVICE); + + return rc; +} + +static int proc_mf_dump_vmlinux(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int sizeToGet = count; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (mf_getVmlinuxChunk(page, &sizeToGet, off, (u64)data) == 0) { + if (sizeToGet != 0) { + *start = page + off; + return sizeToGet; + } + *eof = 1; + return 0; + } + *eof = 1; + return 0; +} +#endif + +static int proc_mf_dump_side(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + char mf_current_side = ' '; + struct vsp_cmd_data vsp_cmd; - memset(&myVspCmd, 0, sizeof(myVspCmd)); - myVspCmd.cmd = 2; - myVspCmd.sub_data.ipl_type = 0; + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.cmd = 2; + vsp_cmd.sub_data.ipl_type = 0; mb(); - rc = signal_vsp_instruction(&myVspCmd); - if (rc != 0) - return returnValue; + if (signal_vsp_instruction(&vsp_cmd) == 0) { + if (vsp_cmd.result_code == 0) { + switch (vsp_cmd.sub_data.ipl_type) { + case 0: mf_current_side = 'A'; + break; + case 1: mf_current_side = 'B'; + break; + case 2: mf_current_side = 'C'; + break; + default: mf_current_side = 'D'; + break; + } + } + } + + len = sprintf(page, "%c\n", mf_current_side); + + if (len <= (off + count)) + *eof = 1; + *start = page + off; + len -= off; + if (len > count) + len = count; + if (len < 0) + len = 0; + return len; +} + +static int proc_mf_change_side(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + char side; + u64 newSide; + struct vsp_cmd_data vsp_cmd; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; - if (myVspCmd.result_code == 0) { - switch (myVspCmd.sub_data.ipl_type) { - case 0: returnValue = 'A'; + if (count == 0) + return 0; + + if (get_user(side, buffer)) + return -EFAULT; + + switch (side) { + case 'A': newSide = 0; break; - case 1: returnValue = 'B'; + case 'B': newSide = 1; break; - case 2: returnValue = 'C'; + case 'C': newSide = 2; break; - default: returnValue = 'D'; + case 'D': newSide = 3; break; - } + default: + printk(KERN_ERR "mf_proc.c: proc_mf_change_side: invalid side\n"); + return -EINVAL; } - return returnValue; + + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.sub_data.ipl_type = newSide; + vsp_cmd.cmd = 10; + + (void)signal_vsp_instruction(&vsp_cmd); + + return count; } -void mf_getSrcHistory(char *buffer, int size) -{ #if 0 - struct IplTypeReturnStuff returnStuff; +static void mf_getSrcHistory(char *buffer, int size) +{ + struct IplTypeReturnStuff return_stuff; struct pending_event *ev = new_pending_event(); int rc = 0; char *pages[4]; @@ -751,13 +1008,13 @@ void mf_getSrcHistory(char *buffer, int size) || (pages[2] == NULL) || (pages[3] == NULL)) return -ENOMEM; - returnStuff.xType = 0; - returnStuff.xRc = 0; - returnStuff.xDone = 0; + return_stuff.xType = 0; + return_stuff.xRc = 0; + return_stuff.xDone = 0; ev->event.hp_lp_event.xSubtype = 6; ev->event.hp_lp_event.x.xSubtypeData = subtype_data('M', 'F', 'V', 'I'); - ev->event.data.vsp_cmd.xEvent = &returnStuff; + ev->event.data.vsp_cmd.xEvent = &return_stuff; ev->event.data.vsp_cmd.cmd = 4; ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex(); ev->event.data.vsp_cmd.result_code = 0xFF; @@ -770,312 +1027,213 @@ void mf_getSrcHistory(char *buffer, int size) if (signal_event(ev) != 0) return; - while (returnStuff.xDone != 1) + while (return_stuff.xDone != 1) udelay(10); - if (returnStuff.xRc == 0) + if (return_stuff.xRc == 0) memcpy(buffer, pages[0], size); kfree(pages[0]); kfree(pages[1]); kfree(pages[2]); kfree(pages[3]); -#endif -} - -void mf_setCmdLine(const char *cmdline, int size, u64 side) -{ - struct VspCmdData myVspCmd; - dma_addr_t dma_addr = 0; - char *page = dma_alloc_coherent(iSeries_vio_dev, size, &dma_addr, - GFP_ATOMIC); - - if (page == NULL) { - printk(KERN_ERR "mf.c: couldn't allocate memory to set command line\n"); - return; - } - - copy_from_user(page, cmdline, size); - - memset(&myVspCmd, 0, sizeof(myVspCmd)); - myVspCmd.cmd = 31; - myVspCmd.sub_data.kern.token = dma_addr; - myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; - myVspCmd.sub_data.kern.side = side; - myVspCmd.sub_data.kern.length = size; - mb(); - (void)signal_vsp_instruction(&myVspCmd); - - dma_free_coherent(iSeries_vio_dev, size, page, dma_addr); } +#endif -int mf_getCmdLine(char *cmdline, int *size, u64 side) +static int proc_mf_dump_src(char *page, char **start, off_t off, + int count, int *eof, void *data) { - struct VspCmdData myVspCmd; - int rc; - int len = *size; - dma_addr_t dma_addr; - - dma_addr = dma_map_single(iSeries_vio_dev, cmdline, len, - DMA_FROM_DEVICE); - memset(cmdline, 0, len); - memset(&myVspCmd, 0, sizeof(myVspCmd)); - myVspCmd.cmd = 33; - myVspCmd.sub_data.kern.token = dma_addr; - myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; - myVspCmd.sub_data.kern.side = side; - myVspCmd.sub_data.kern.length = len; - mb(); - rc = signal_vsp_instruction(&myVspCmd); - - if (rc == 0) { - if (myVspCmd.result_code == 0) - len = myVspCmd.sub_data.length_out; #if 0 - else - memcpy(cmdline, "Bad cmdline", 11); -#endif - } - - dma_unmap_single(iSeries_vio_dev, dma_addr, *size, DMA_FROM_DEVICE); - + int len; + + mf_getSrcHistory(page, count); + len = count; + len -= off; + if (len < count) { + *eof = 1; + if (len <= 0) + return 0; + } else + len = count; + *start = page + off; return len; +#else + return 0; +#endif } - -int mf_setVmlinuxChunk(const char *buffer, int size, int offset, u64 side) +static int proc_mf_change_src(struct file *file, const char __user *buffer, + unsigned long count, void *data) { - struct VspCmdData myVspCmd; - int rc; - dma_addr_t dma_addr = 0; - char *page = dma_alloc_coherent(iSeries_vio_dev, size, &dma_addr, - GFP_ATOMIC); + char stkbuf[10]; - if (page == NULL) { - printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n"); - return -ENOMEM; - } + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; - copy_from_user(page, buffer, size); - memset(&myVspCmd, 0, sizeof(myVspCmd)); - - myVspCmd.cmd = 30; - myVspCmd.sub_data.kern.token = dma_addr; - myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; - myVspCmd.sub_data.kern.side = side; - myVspCmd.sub_data.kern.offset = offset; - myVspCmd.sub_data.kern.length = size; - mb(); - rc = signal_vsp_instruction(&myVspCmd); - if (rc == 0) { - if (myVspCmd.result_code == 0) - rc = 0; - else - rc = -ENOMEM; + if ((count < 4) && (count != 1)) { + printk(KERN_ERR "mf_proc: invalid src\n"); + return -EINVAL; } - dma_free_coherent(iSeries_vio_dev, size, page, dma_addr); + if (count > (sizeof(stkbuf) - 1)) + count = sizeof(stkbuf) - 1; + if (copy_from_user(stkbuf, buffer, count)) + return -EFAULT; - return rc; + if ((count == 1) && (*stkbuf == '\0')) + mf_clear_src(); + else + mf_display_src(*(u32 *)stkbuf); + + return count; } -int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side) +static int proc_mf_change_cmdline(struct file *file, const char __user *buffer, + unsigned long count, void *data) { - struct VspCmdData myVspCmd; - int rc; - int len = *size; + struct vsp_cmd_data vsp_cmd; dma_addr_t dma_addr; + char *page; + int ret = -EACCES; - dma_addr = dma_map_single(iSeries_vio_dev, buffer, len, - DMA_FROM_DEVICE); - memset(buffer, 0, len); - memset(&myVspCmd, 0, sizeof(myVspCmd)); - myVspCmd.cmd = 32; - myVspCmd.sub_data.kern.token = dma_addr; - myVspCmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; - myVspCmd.sub_data.kern.side = side; - myVspCmd.sub_data.kern.offset = offset; - myVspCmd.sub_data.kern.length = len; - mb(); - rc = signal_vsp_instruction(&myVspCmd); - if (rc == 0) { - if (myVspCmd.result_code == 0) - *size = myVspCmd.sub_data.length_out; - else - rc = -ENOMEM; - } + if (!capable(CAP_SYS_ADMIN)) + goto out; - dma_unmap_single(iSeries_vio_dev, dma_addr, len, DMA_FROM_DEVICE); + dma_addr = 0; + page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, + GFP_ATOMIC); + ret = -ENOMEM; + if (page == NULL) + goto out; + + ret = -EFAULT; + if (copy_from_user(page, buffer, count)) + goto out_free; + + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.cmd = 31; + vsp_cmd.sub_data.kern.token = dma_addr; + vsp_cmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; + vsp_cmd.sub_data.kern.side = (u64)data; + vsp_cmd.sub_data.kern.length = count; + mb(); + (void)signal_vsp_instruction(&vsp_cmd); + ret = count; - return rc; +out_free: + dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); +out: + return ret; } -int mf_setRtcTime(unsigned long time) +static ssize_t proc_mf_change_vmlinux(struct file *file, + const char __user *buf, + size_t count, loff_t *ppos) { - struct rtc_time tm; + struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); + ssize_t rc; + dma_addr_t dma_addr; + char *page; + struct vsp_cmd_data vsp_cmd; - to_tm(time, &tm); + rc = -EACCES; + if (!capable(CAP_SYS_ADMIN)) + goto out; - return mf_setRtc(&tm); + dma_addr = 0; + page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, + GFP_ATOMIC); + rc = -ENOMEM; + if (page == NULL) { + printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n"); + goto out; + } + rc = -EFAULT; + if (copy_from_user(page, buf, count)) + goto out_free; + + memset(&vsp_cmd, 0, sizeof(vsp_cmd)); + vsp_cmd.cmd = 30; + vsp_cmd.sub_data.kern.token = dma_addr; + vsp_cmd.sub_data.kern.address_type = HvLpDma_AddressType_TceIndex; + vsp_cmd.sub_data.kern.side = (u64)dp->data; + vsp_cmd.sub_data.kern.offset = *ppos; + vsp_cmd.sub_data.kern.length = count; + mb(); + rc = signal_vsp_instruction(&vsp_cmd); + if (rc) + goto out_free; + rc = -ENOMEM; + if (vsp_cmd.result_code != 0) + goto out_free; + + *ppos += count; + rc = count; +out_free: + dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); +out: + return rc; } -struct RtcTimeData { - struct completion com; - struct CeMsgData xCeMsg; - int xRc; +static struct file_operations proc_vmlinux_operations = { + .write = proc_mf_change_vmlinux, }; -void getRtcTimeComplete(void * token, struct CeMsgData *ceMsg) +static int __init mf_proc_init(void) { - struct RtcTimeData *rtc = (struct RtcTimeData *)token; - - memcpy(&(rtc->xCeMsg), ceMsg, sizeof(rtc->xCeMsg)); - rtc->xRc = 0; - complete(&rtc->com); -} - -static unsigned long lastsec = 1; + struct proc_dir_entry *mf_proc_root; + struct proc_dir_entry *ent; + struct proc_dir_entry *mf; + char name[2]; + int i; -int mf_getRtcTime(unsigned long *time) -{ - u32 dataWord1 = *((u32 *)(&xSpCommArea.xBcdTimeAtIplStart)); - u32 dataWord2 = *(((u32 *)&(xSpCommArea.xBcdTimeAtIplStart)) + 1); - int year = 1970; - int year1 = (dataWord1 >> 24) & 0x000000FF; - int year2 = (dataWord1 >> 16) & 0x000000FF; - int sec = (dataWord1 >> 8) & 0x000000FF; - int min = dataWord1 & 0x000000FF; - int hour = (dataWord2 >> 24) & 0x000000FF; - int day = (dataWord2 >> 8) & 0x000000FF; - int mon = dataWord2 & 0x000000FF; - - BCD_TO_BIN(sec); - BCD_TO_BIN(min); - BCD_TO_BIN(hour); - BCD_TO_BIN(day); - BCD_TO_BIN(mon); - BCD_TO_BIN(year1); - BCD_TO_BIN(year2); - year = year1 * 100 + year2; - - *time = mktime(year, mon, day, hour, min, sec); - *time += (jiffies / HZ); - - /* - * Now THIS is a nasty hack! - * It ensures that the first two calls to mf_getRtcTime get different - * answers. That way the loop in init_time (time.c) will not think - * the clock is stuck. - */ - if (lastsec) { - *time -= lastsec; - --lastsec; + mf_proc_root = proc_mkdir("iSeries/mf", NULL); + if (!mf_proc_root) + return 1; + + name[1] = '\0'; + for (i = 0; i < 4; i++) { + name[0] = 'A' + i; + mf = proc_mkdir(name, mf_proc_root); + if (!mf) + return 1; + + ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf); + if (!ent) + return 1; + ent->nlink = 1; + ent->data = (void *)(long)i; + ent->read_proc = proc_mf_dump_cmdline; + ent->write_proc = proc_mf_change_cmdline; + + if (i == 3) /* no vmlinux entry for 'D' */ + continue; + + ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); + if (!ent) + return 1; + ent->nlink = 1; + ent->data = (void *)(long)i; + ent->proc_fops = &proc_vmlinux_operations; } - return 0; -} - -int mf_getRtc(struct rtc_time *tm) -{ - struct CeMsgCompleteData ceComplete; - struct RtcTimeData rtcData; - int rc; - - memset(&ceComplete, 0, sizeof(ceComplete)); - memset(&rtcData, 0, sizeof(rtcData)); - init_completion(&rtcData.com); - ceComplete.handler = &getRtcTimeComplete; - ceComplete.token = (void *)&rtcData; - rc = signal_ce_msg("\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", - &ceComplete); - if (rc == 0) { - wait_for_completion(&rtcData.com); - - if (rtcData.xRc == 0) { - if ((rtcData.xCeMsg.ce_msg[2] == 0xa9) || - (rtcData.xCeMsg.ce_msg[2] == 0xaf)) { - /* TOD clock is not set */ - tm->tm_sec = 1; - tm->tm_min = 1; - tm->tm_hour = 1; - tm->tm_mday = 10; - tm->tm_mon = 8; - tm->tm_year = 71; - mf_setRtc(tm); - } - { - u32 dataWord1 = *((u32 *)(rtcData.xCeMsg.ce_msg+4)); - u32 dataWord2 = *((u32 *)(rtcData.xCeMsg.ce_msg+8)); - u8 year = (dataWord1 >> 16) & 0x000000FF; - u8 sec = (dataWord1 >> 8) & 0x000000FF; - u8 min = dataWord1 & 0x000000FF; - u8 hour = (dataWord2 >> 24) & 0x000000FF; - u8 day = (dataWord2 >> 8) & 0x000000FF; - u8 mon = dataWord2 & 0x000000FF; - - BCD_TO_BIN(sec); - BCD_TO_BIN(min); - BCD_TO_BIN(hour); - BCD_TO_BIN(day); - BCD_TO_BIN(mon); - BCD_TO_BIN(year); - - if (year <= 69) - year += 100; - - tm->tm_sec = sec; - tm->tm_min = min; - tm->tm_hour = hour; - tm->tm_mday = day; - tm->tm_mon = mon; - tm->tm_year = year; - } - } else { - rc = rtcData.xRc; - tm->tm_sec = 0; - tm->tm_min = 0; - tm->tm_hour = 0; - tm->tm_mday = 15; - tm->tm_mon = 5; - tm->tm_year = 52; - } - tm->tm_wday = 0; - tm->tm_yday = 0; - tm->tm_isdst = 0; - } + ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); + if (!ent) + return 1; + ent->nlink = 1; + ent->data = (void *)0; + ent->read_proc = proc_mf_dump_side; + ent->write_proc = proc_mf_change_side; + + ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); + if (!ent) + return 1; + ent->nlink = 1; + ent->data = (void *)0; + ent->read_proc = proc_mf_dump_src; + ent->write_proc = proc_mf_change_src; - return rc; + return 0; } -int mf_setRtc(struct rtc_time * tm) -{ - char ceTime[12] = "\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x00"; - u8 day, mon, hour, min, sec, y1, y2; - unsigned year; - - year = 1900 + tm->tm_year; - y1 = year / 100; - y2 = year % 100; - - sec = tm->tm_sec; - min = tm->tm_min; - hour = tm->tm_hour; - day = tm->tm_mday; - mon = tm->tm_mon + 1; - - BIN_TO_BCD(sec); - BIN_TO_BCD(min); - BIN_TO_BCD(hour); - BIN_TO_BCD(mon); - BIN_TO_BCD(day); - BIN_TO_BCD(y1); - BIN_TO_BCD(y2); +__initcall(mf_proc_init); - ceTime[4] = y1; - ceTime[5] = y2; - ceTime[6] = sec; - ceTime[7] = min; - ceTime[8] = hour; - ceTime[10] = day; - ceTime[11] = mon; - - return signal_ce_msg(ceTime, NULL); -} +#endif /* CONFIG_PROC_FS */ diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 88e700266..edbd00aec 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S @@ -115,12 +115,12 @@ _GLOBAL(call_do_softirq) mtlr r0 blr -_GLOBAL(call_handle_irq_event) +_GLOBAL(call_handle_IRQ_event) mflr r0 std r0,16(r1) stdu r1,THREAD_SIZE-112(r6) mr r1,r6 - bl .handle_irq_event + bl .handle_IRQ_event ld r1,0(r1) ld r0,16(r1) mtlr r0 @@ -167,27 +167,12 @@ _GLOBAL(call_with_mmu_off) xori r0,r0,MSR_IR|MSR_DR mtspr SPRN_SRR1,r0 rfid - -/* - * Flush instruction cache. - */ -_GLOBAL(flush_instruction_cache) -/* - * This is called by kgdb code - * and should probably go away - * to be replaced by invalidating - * the cache lines that are actually - * modified - */ - /* use invalidate-all bit in HID0 - * - is this consistent across all 64-bit cpus? -- paulus */ - mfspr r3,HID0 - ori r3,r3,HID0_ICFI - mtspr HID0,r3 - sync - isync - blr + + .section ".toc","aw" +PPC64_CACHES: + .tc ppc64_caches[TC],ppc64_caches + .section ".text" /* * Write any modified data cache blocks out to memory @@ -207,11 +192,8 @@ _GLOBAL(__flush_icache_range) * and in some cases i-cache and d-cache line sizes differ from * each other. */ - LOADADDR(r10,naca) /* Get Naca address */ - ld r10,0(r10) - LOADADDR(r11,systemcfg) /* Get systemcfg address */ - ld r11,0(r11) - lwz r7,DCACHEL1LINESIZE(r11)/* Get cache line size */ + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10)/* Get cache line size */ addi r5,r7,-1 andc r6,r3,r5 /* round low to line bdy */ subf r8,r6,r4 /* compute length */ @@ -227,7 +209,7 @@ _GLOBAL(__flush_icache_range) /* Now invalidate the instruction cache */ - lwz r7,ICACHEL1LINESIZE(r11) /* Get Icache line size */ + lwz r7,ICACHEL1LINESIZE(r10) /* Get Icache line size */ addi r5,r7,-1 andc r6,r3,r5 /* round low to line bdy */ subf r8,r6,r4 /* compute length */ @@ -256,11 +238,8 @@ _GLOBAL(flush_dcache_range) * * Different systems have different cache line sizes */ - LOADADDR(r10,naca) /* Get Naca address */ - ld r10,0(r10) - LOADADDR(r11,systemcfg) /* Get systemcfg address */ - ld r11,0(r11) - lwz r7,DCACHEL1LINESIZE(r11) /* Get dcache line size */ + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */ addi r5,r7,-1 andc r6,r3,r5 /* round low to line bdy */ subf r8,r6,r4 /* compute length */ @@ -286,11 +265,8 @@ _GLOBAL(flush_dcache_range) * flush all bytes from start to stop-1 inclusive */ _GLOBAL(flush_dcache_phys_range) - LOADADDR(r10,naca) /* Get Naca address */ - ld r10,0(r10) - LOADADDR(r11,systemcfg) /* Get systemcfg address */ - ld r11,0(r11) - lwz r7,DCACHEL1LINESIZE(r11) /* Get dcache line size */ + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */ addi r5,r7,-1 andc r6,r3,r5 /* round low to line bdy */ subf r8,r6,r4 /* compute length */ @@ -332,13 +308,10 @@ _GLOBAL(__flush_dcache_icache) */ /* Flush the dcache */ - LOADADDR(r7,naca) - ld r7,0(r7) - LOADADDR(r8,systemcfg) /* Get systemcfg address */ - ld r8,0(r8) + ld r7,PPC64_CACHES@toc(r2) clrrdi r3,r3,12 /* Page align */ lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */ - lwz r5,DCACHEL1LINESIZE(r8) /* Get dcache line size */ + lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */ mr r6,r3 mtctr r4 0: dcbst 0,r6 @@ -349,7 +322,7 @@ _GLOBAL(__flush_dcache_icache) /* Now invalidate the icache */ lwz r4,ICACHEL1LINESPERPAGE(r7) /* Get # icache lines per page */ - lwz r5,ICACHEL1LINESIZE(r8) /* Get icache line size */ + lwz r5,ICACHEL1LINESIZE(r7) /* Get icache line size */ mtctr r4 1: icbi 0,r3 add r3,r3,r5 @@ -591,7 +564,7 @@ _GLOBAL(do_cpu_ftr_fixups) isync b 1b -#ifdef CONFIG_PPC_PMAC +#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) /* * Do an IO access in real mode */ @@ -653,7 +626,7 @@ _GLOBAL(real_writeb) sync isync blr -#endif /* CONFIG_PPC_PMAC */ +#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ /* * Create a kernel thread @@ -707,7 +680,7 @@ _GLOBAL(sys_call_table32) .llong .sys_unlink /* 10 */ .llong .sys32_execve .llong .sys_chdir - .llong .sys32_time + .llong .compat_sys_time .llong .sys_mknod .llong .sys_chmod /* 15 */ .llong .sys_lchown @@ -719,7 +692,7 @@ _GLOBAL(sys_call_table32) .llong .sys_oldumount .llong .sys_setuid .llong .sys_getuid - .llong .ppc64_sys32_stime /* 25 */ + .llong .compat_sys_stime /* 25 */ .llong .sys32_ptrace .llong .sys_alarm .llong .sys_ni_syscall /* old fstat syscall */ @@ -870,7 +843,7 @@ _GLOBAL(sys_call_table32) .llong .sys32_rt_sigaction .llong .sys32_rt_sigprocmask .llong .sys32_rt_sigpending /* 175 */ - .llong .sys32_rt_sigtimedwait + .llong .compat_sys_rt_sigtimedwait .llong .sys32_rt_sigqueueinfo .llong .ppc32_rt_sigsuspend .llong .sys32_pread64 @@ -935,27 +908,27 @@ _GLOBAL(sys_call_table32) .llong .sys_epoll_wait .llong .sys_remap_file_pages .llong .ppc32_timer_create /* 240 */ - .llong .compat_timer_settime - .llong .compat_timer_gettime + .llong .compat_sys_timer_settime + .llong .compat_sys_timer_gettime .llong .sys_timer_getoverrun .llong .sys_timer_delete - .llong .compat_clock_settime /* 245 */ - .llong .compat_clock_gettime - .llong .compat_clock_getres - .llong .compat_clock_nanosleep + .llong .compat_sys_clock_settime /* 245 */ + .llong .compat_sys_clock_gettime + .llong .compat_sys_clock_getres + .llong .compat_sys_clock_nanosleep .llong .ppc32_swapcontext .llong .sys32_tgkill /* 250 */ .llong .sys32_utimes - .llong .compat_statfs64 - .llong .compat_fstatfs64 + .llong .compat_sys_statfs64 + .llong .compat_sys_fstatfs64 .llong .ppc32_fadvise64_64 /* 32bit only fadvise64_64 */ .llong .ppc_rtas /* 255 */ .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */ .llong .sys_vserver .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ - .llong .compat_mbind - .llong .compat_get_mempolicy /* 260 */ - .llong .compat_set_mempolicy + .llong .compat_sys_mbind + .llong .compat_sys_get_mempolicy /* 260 */ + .llong .compat_sys_set_mempolicy .llong .compat_sys_mq_open .llong .sys_mq_unlink .llong .compat_sys_mq_timedsend @@ -963,6 +936,9 @@ _GLOBAL(sys_call_table32) .llong .compat_sys_mq_notify .llong .compat_sys_mq_getsetattr .llong .sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .llong .sys32_add_key + .llong .sys32_request_key + .llong .compat_sys_keyctl .balign 8 _GLOBAL(sys_call_table) @@ -991,7 +967,7 @@ _GLOBAL(sys_call_table) .llong .sys_ni_syscall /* old umount syscall */ .llong .sys_setuid .llong .sys_getuid - .llong .ppc64_sys_stime /* 25 */ + .llong .sys_stime /* 25 */ .llong .sys_ptrace .llong .sys_alarm .llong .sys_ni_syscall /* old fstat syscall */ @@ -1235,3 +1211,6 @@ _GLOBAL(sys_call_table) .llong .sys_mq_notify .llong .sys_mq_getsetattr .llong .sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .llong .sys_add_key + .llong .sys_request_key /* 270 */ + .llong .sys_keyctl diff --git a/arch/ppc64/kernel/mpic.c b/arch/ppc64/kernel/mpic.c index e013e85f2..593ea5b82 100644 --- a/arch/ppc64/kernel/mpic.c +++ b/arch/ppc64/kernel/mpic.c @@ -42,7 +42,7 @@ static struct mpic *mpics; static struct mpic *mpic_primary; -static spinlock_t mpic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mpic_lock); /* @@ -765,10 +765,8 @@ void mpic_setup_this_cpu(void) #ifdef CONFIG_SMP struct mpic *mpic = mpic_primary; unsigned long flags; -#ifdef CONFIG_IRQ_ALL_CPUS u32 msk = 1 << hard_smp_processor_id(); unsigned int i; -#endif BUG_ON(mpic == NULL); @@ -776,16 +774,16 @@ void mpic_setup_this_cpu(void) spin_lock_irqsave(&mpic_lock, flags); -#ifdef CONFIG_IRQ_ALL_CPUS /* let the mpic know we want intrs. default affinity is 0xffffffff * until changed via /proc. That's how it's done on x86. If we want * it differently, then we should make sure we also change the default * values of irq_affinity in irq.c. */ - for (i = 0; i < mpic->num_sources ; i++) - mpic_irq_write(i, MPIC_IRQ_DESTINATION, - mpic_irq_read(i, MPIC_IRQ_DESTINATION) | msk); -#endif /* CONFIG_IRQ_ALL_CPUS */ + if (distribute_irqs) { + for (i = 0; i < mpic->num_sources ; i++) + mpic_irq_write(i, MPIC_IRQ_DESTINATION, + mpic_irq_read(i, MPIC_IRQ_DESTINATION) | msk); + } /* Set current processor priority to 0 */ mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0); diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c index 49ddf5e09..241ba3aec 100644 --- a/arch/ppc64/kernel/nvram.c +++ b/arch/ppc64/kernel/nvram.c @@ -31,6 +31,7 @@ #include #include #include +#include #undef DEBUG_NVRAM @@ -43,9 +44,9 @@ static struct nvram_partition * nvram_part; static long nvram_error_log_index = -1; static long nvram_error_log_size = 0; -volatile int no_more_logging = 1; /* Until we initialize everything, - * make sure we don't try logging - * anything */ +int no_logging = 1; /* Until we initialize everything, + * make sure we don't try logging + * anything */ extern volatile int error_log_cnt; @@ -77,7 +78,7 @@ static loff_t dev_nvram_llseek(struct file *file, loff_t offset, int origin) } -static ssize_t dev_nvram_read(struct file *file, char *buf, +static ssize_t dev_nvram_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { ssize_t len; @@ -117,7 +118,7 @@ static ssize_t dev_nvram_read(struct file *file, char *buf, } -static ssize_t dev_nvram_write(struct file *file, const char *buf, +static ssize_t dev_nvram_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { ssize_t len; @@ -640,7 +641,7 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type) loff_t tmp_index; struct err_log_info info; - if (no_more_logging) { + if (no_logging) { return -EPERM; } @@ -711,7 +712,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type) /* This doesn't actually zero anything, but it sets the event_logged * word to tell that this event is safely in syslog. */ -int nvram_clear_error_log() +int nvram_clear_error_log(void) { loff_t tmp_index; int clear_word = ERR_FLAG_ALREADY_LOGGED; diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c index abbbe2823..5543aaa56 100644 --- a/arch/ppc64/kernel/pSeries_iommu.c +++ b/arch/ppc64/kernel/pSeries_iommu.c @@ -43,8 +43,12 @@ #include #include #include +#include #include "pci.h" +#define DBG(fmt...) + +extern int is_python(struct device_node *); static void tce_build_pSeries(struct iommu_table *tbl, long index, long npages, unsigned long uaddr, @@ -120,7 +124,7 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, } } -DEFINE_PER_CPU(void *, tce_page) = NULL; +static DEFINE_PER_CPU(void *, tce_page) = NULL; static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages, unsigned long uaddr, @@ -232,81 +236,6 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n } } - -static void iommu_buses_init(void) -{ - struct pci_controller *phb, *tmp; - struct device_node *dn, *first_dn; - int num_slots, num_slots_ilog2; - int first_phb = 1; - unsigned long tcetable_ilog2; - - /* - * We default to a TCE table that maps 2GB (4MB table, 22 bits), - * however some machines have a 3GB IO hole and for these we - * create a table that maps 1GB (2MB table, 21 bits) - */ - if (io_hole_start < 0x80000000UL) - tcetable_ilog2 = 21; - else - tcetable_ilog2 = 22; - - /* XXX Should we be using pci_root_buses instead? -ojn - */ - - list_for_each_entry_safe(phb, tmp, &hose_list, list_node) { - first_dn = ((struct device_node *)phb->arch_data)->child; - - /* Carve 2GB into the largest dma_window_size possible */ - for (dn = first_dn, num_slots = 0; dn != NULL; dn = dn->sibling) - num_slots++; - num_slots_ilog2 = __ilog2(num_slots); - - if ((1<dma_window_size = 1 << (tcetable_ilog2 - num_slots_ilog2); - - /* Reserve 16MB of DMA space on the first PHB. - * We should probably be more careful and use firmware props. - * In reality this space is remapped, not lost. But we don't - * want to get that smart to handle it -- too much work. - */ - phb->dma_window_base_cur = first_phb ? (1 << 12) : 0; - first_phb = 0; - - for (dn = first_dn; dn != NULL; dn = dn->sibling) - iommu_devnode_init(dn); - } -} - - -static void iommu_buses_init_lpar(struct list_head *bus_list) -{ - struct list_head *ln; - struct pci_bus *bus; - struct device_node *busdn; - unsigned int *dma_window; - - for (ln=bus_list->next; ln != bus_list; ln=ln->next) { - bus = pci_bus_b(ln); - busdn = PCI_GET_DN(bus); - - dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", NULL); - if (dma_window) { - /* Bussubno hasn't been copied yet. - * Do it now because iommu_table_setparms_lpar needs it. - */ - busdn->bussubno = bus->number; - iommu_devnode_init(busdn); - } - - /* look for a window on a bridge even if the PHB had one */ - iommu_buses_init_lpar(&bus->children); - } -} - - static void iommu_table_setparms(struct pci_controller *phb, struct device_node *dn, struct iommu_table *tbl) @@ -317,45 +246,32 @@ static void iommu_table_setparms(struct pci_controller *phb, node = (struct device_node *)phb->arch_data; - if (get_property(node, "linux,has-tce-table", NULL) == NULL) { - printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has no tce table !\n", - dn->full_name); - return; - } basep = (unsigned long *)get_property(node, "linux,tce-base", NULL); sizep = (unsigned int *)get_property(node, "linux,tce-size", NULL); if (basep == NULL || sizep == NULL) { - printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has missing tce" - " entries !\n", dn->full_name); + printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has " + "missing tce entries !\n", dn->full_name); return; } - memset((void *)(*basep), 0, *sizep); + + tbl->it_base = (unsigned long)__va(*basep); + memset((void *)tbl->it_base, 0, *sizep); tbl->it_busno = phb->bus->number; /* Units of tce entries */ - tbl->it_offset = phb->dma_window_base_cur; - - /* Adjust the current table offset to the next - * region. Measured in TCE entries. Force an - * alignment to the size allotted per IOA. This - * makes it easier to remove the 1st 16MB. - */ - phb->dma_window_base_cur += (phb->dma_window_size>>3); - phb->dma_window_base_cur &= - ~((phb->dma_window_size>>3)-1); - - /* Set the tce table size - measured in pages */ - tbl->it_size = ((phb->dma_window_base_cur - - tbl->it_offset) << 3) >> PAGE_SHIFT; + tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT; /* Test if we are going over 2GB of DMA space */ - if (phb->dma_window_base_cur > (1 << 19)) + if (phb->dma_window_base_cur + phb->dma_window_size > (1L << 31)) panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n"); - tbl->it_base = *basep; + phb->dma_window_base_cur += phb->dma_window_size; + + /* Set the tce table size - measured in entries */ + tbl->it_size = phb->dma_window_size >> PAGE_SHIFT; + tbl->it_index = 0; - tbl->it_entrysize = sizeof(union tce_entry); tbl->it_blocksize = 16; tbl->it_type = TCE_PCI; } @@ -374,84 +290,203 @@ static void iommu_table_setparms(struct pci_controller *phb, */ static void iommu_table_setparms_lpar(struct pci_controller *phb, struct device_node *dn, - struct iommu_table *tbl) + struct iommu_table *tbl, + unsigned int *dma_window) { - unsigned int *dma_window; - - dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", NULL); - - if (!dma_window) - panic("iommu_table_setparms_lpar: device %s has no" - " ibm,dma-window property!\n", dn->full_name); - tbl->it_busno = dn->bussubno; - tbl->it_size = (((((unsigned long)dma_window[4] << 32) | - (unsigned long)dma_window[5]) >> PAGE_SHIFT) << 3) >> PAGE_SHIFT; - tbl->it_offset = ((((unsigned long)dma_window[2] << 32) | - (unsigned long)dma_window[3]) >> 12); + + /* TODO: Parse field size properties properly. */ + tbl->it_size = (((unsigned long)dma_window[4] << 32) | + (unsigned long)dma_window[5]) >> PAGE_SHIFT; + tbl->it_offset = (((unsigned long)dma_window[2] << 32) | + (unsigned long)dma_window[3]) >> PAGE_SHIFT; tbl->it_base = 0; tbl->it_index = dma_window[0]; - tbl->it_entrysize = sizeof(union tce_entry); tbl->it_blocksize = 16; tbl->it_type = TCE_PCI; } +static void iommu_bus_setup_pSeries(struct pci_bus *bus) +{ + struct device_node *dn, *pdn; + struct iommu_table *tbl; + + DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self); + + /* For each (root) bus, we carve up the available DMA space in 256MB + * pieces. Since each piece is used by one (sub) bus/device, that would + * give a maximum of 7 devices per PHB. In most cases, this is plenty. + * + * The exception is on Python PHBs (pre-POWER4). Here we don't have EADS + * bridges below the PHB to allocate the sectioned tables to, so instead + * we allocate a 1GB table at the PHB level. + */ + + dn = pci_bus_to_OF_node(bus); + + if (!bus->self) { + /* Root bus */ + if (is_python(dn)) { + unsigned int *iohole; + + DBG("Python root bus %s\n", bus->name); + + iohole = (unsigned int *)get_property(dn, "io-hole", 0); + + if (iohole) { + /* On first bus we need to leave room for the + * ISA address space. Just skip the first 256MB + * alltogether. This leaves 768MB for the window. + */ + DBG("PHB has io-hole, reserving 256MB\n"); + dn->phb->dma_window_size = 3 << 28; + dn->phb->dma_window_base_cur = 1 << 28; + } else { + /* 1GB window by default */ + dn->phb->dma_window_size = 1 << 30; + dn->phb->dma_window_base_cur = 0; + } + + tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); + + iommu_table_setparms(dn->phb, dn, tbl); + dn->iommu_table = iommu_init_table(tbl); + } else { + /* Do a 128MB table at root. This is used for the IDE + * controller on some SMP-mode POWER4 machines. It + * doesn't hurt to allocate it on other machines + * -- it'll just be unused since new tables are + * allocated on the EADS level. + * + * Allocate at offset 128MB to avoid having to deal + * with ISA holes; 128MB table for IDE is plenty. + */ + dn->phb->dma_window_size = 1 << 27; + dn->phb->dma_window_base_cur = 1 << 27; + + tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); + + iommu_table_setparms(dn->phb, dn, tbl); + dn->iommu_table = iommu_init_table(tbl); + + /* All child buses have 256MB tables */ + dn->phb->dma_window_size = 1 << 28; + } + } else { + pdn = pci_bus_to_OF_node(bus->parent); + + if (!bus->parent->self && !is_python(pdn)) { + struct iommu_table *tbl; + /* First child and not python means this is the EADS + * level. Allocate new table for this slot with 256MB + * window. + */ + + tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); + + iommu_table_setparms(dn->phb, dn, tbl); + + dn->iommu_table = iommu_init_table(tbl); + } else { + /* Lower than first child or under python, use parent table */ + dn->iommu_table = pdn->iommu_table; + } + } +} + -void iommu_devnode_init(struct device_node *dn) +static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus) { struct iommu_table *tbl; + struct device_node *dn, *pdn; + unsigned int *dma_window = NULL; - tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), - GFP_KERNEL); - - if (systemcfg->platform == PLATFORM_PSERIES_LPAR) - iommu_table_setparms_lpar(dn->phb, dn, tbl); - else - iommu_table_setparms(dn->phb, dn, tbl); + dn = pci_bus_to_OF_node(bus); + + /* Find nearest ibm,dma-window, walking up the device tree */ + for (pdn = dn; pdn != NULL; pdn = pdn->parent) { + dma_window = (unsigned int *)get_property(pdn, "ibm,dma-window", NULL); + if (dma_window != NULL) + break; + } + + if (dma_window == NULL) { + DBG("iommu_bus_setup_pSeriesLP: bus %s seems to have no ibm,dma-window property\n", dn->full_name); + return; + } + + if (!pdn->iommu_table) { + /* Bussubno hasn't been copied yet. + * Do it now because iommu_table_setparms_lpar needs it. + */ + pdn->bussubno = bus->number; + + tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), + GFP_KERNEL); - dn->iommu_table = iommu_init_table(tbl); + iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window); + + pdn->iommu_table = iommu_init_table(tbl); + } + + if (pdn != dn) + dn->iommu_table = pdn->iommu_table; } -void iommu_setup_pSeries(void) +static void iommu_dev_setup_pSeries(struct pci_dev *dev) { - struct pci_dev *dev = NULL; struct device_node *dn, *mydn; - if (systemcfg->platform == PLATFORM_PSERIES_LPAR) - iommu_buses_init_lpar(&pci_root_buses); - else - iommu_buses_init(); - - /* Now copy the iommu_table ptr from the bus devices down to every + DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name); + /* Now copy the iommu_table ptr from the bus device down to the * pci device_node. This means get_iommu_table() won't need to search * up the device tree to find it. */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - mydn = dn = PCI_GET_DN(dev); + mydn = dn = pci_device_to_OF_node(dev); - while (dn && dn->iommu_table == NULL) - dn = dn->parent; - if (dn) - mydn->iommu_table = dn->iommu_table; + while (dn && dn->iommu_table == NULL) + dn = dn->parent; + + if (dn) { + mydn->iommu_table = dn->iommu_table; + } else { + DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name); } } +static void iommu_bus_setup_null(struct pci_bus *b) { } +static void iommu_dev_setup_null(struct pci_dev *d) { } /* These are called very early. */ -void tce_init_pSeries(void) +void iommu_init_early_pSeries(void) { - if (!(systemcfg->platform & PLATFORM_LPAR)) { + if (of_chosen && get_property(of_chosen, "linux,iommu-off", NULL)) { + /* Direct I/O, IOMMU off */ + ppc_md.iommu_dev_setup = iommu_dev_setup_null; + ppc_md.iommu_bus_setup = iommu_bus_setup_null; + pci_direct_iommu_init(); + + return; + } + + if (systemcfg->platform & PLATFORM_LPAR) { + if (cur_cpu_spec->firmware_features & FW_FEATURE_MULTITCE) { + ppc_md.tce_build = tce_buildmulti_pSeriesLP; + ppc_md.tce_free = tce_freemulti_pSeriesLP; + } else { + ppc_md.tce_build = tce_build_pSeriesLP; + ppc_md.tce_free = tce_free_pSeriesLP; + } + ppc_md.iommu_bus_setup = iommu_bus_setup_pSeriesLP; + } else { ppc_md.tce_build = tce_build_pSeries; ppc_md.tce_free = tce_free_pSeries; - } else if (cur_cpu_spec->firmware_features & FW_FEATURE_MULTITCE) { - ppc_md.tce_build = tce_buildmulti_pSeriesLP; - ppc_md.tce_free = tce_freemulti_pSeriesLP; - } else { - ppc_md.tce_build = tce_build_pSeriesLP; - ppc_md.tce_free = tce_free_pSeriesLP; + ppc_md.iommu_bus_setup = iommu_bus_setup_pSeries; } + ppc_md.iommu_dev_setup = iommu_dev_setup_pSeries; + pci_iommu_init(); } diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c index 68eeb7a81..624acf0c8 100644 --- a/arch/ppc64/kernel/pSeries_lpar.c +++ b/arch/ppc64/kernel/pSeries_lpar.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -59,6 +58,74 @@ extern void pSeries_find_serial_port(void); int vtermno; /* virtual terminal# for udbg */ +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) +static void udbg_hvsi_putc(unsigned char c) +{ + /* packet's seqno isn't used anyways */ + uint8_t packet[] __ALIGNED__ = { 0xff, 5, 0, 0, c }; + int rc; + + if (c == '\n') + udbg_hvsi_putc('\r'); + + do { + rc = plpar_put_term_char(vtermno, sizeof(packet), packet); + } while (rc == H_Busy); +} + +static long hvsi_udbg_buf_len; +static uint8_t hvsi_udbg_buf[256]; + +static int udbg_hvsi_getc_poll(void) +{ + unsigned char ch; + int rc, i; + + if (hvsi_udbg_buf_len == 0) { + rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf); + if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) { + /* bad read or non-data packet */ + hvsi_udbg_buf_len = 0; + } else { + /* remove the packet header */ + for (i = 4; i < hvsi_udbg_buf_len; i++) + hvsi_udbg_buf[i-4] = hvsi_udbg_buf[i]; + hvsi_udbg_buf_len -= 4; + } + } + + if (hvsi_udbg_buf_len <= 0 || hvsi_udbg_buf_len > 256) { + /* no data ready */ + hvsi_udbg_buf_len = 0; + return -1; + } + + ch = hvsi_udbg_buf[0]; + /* shift remaining data down */ + for (i = 1; i < hvsi_udbg_buf_len; i++) { + hvsi_udbg_buf[i-1] = hvsi_udbg_buf[i]; + } + hvsi_udbg_buf_len--; + + return ch; +} + +static unsigned char udbg_hvsi_getc(void) +{ + int ch; + for (;;) { + ch = udbg_hvsi_getc_poll(); + if (ch == -1) { + /* This shouldn't be needed...but... */ + volatile unsigned long delay; + for (delay=0; delay < 2000000; delay++) + ; + } else { + return ch; + } + } +} + static void udbg_putcLP(unsigned char c) { char buf[16]; @@ -166,11 +233,15 @@ int find_udbg_vterm(void) ppc_md.udbg_getc_poll = udbg_getc_pollLP; found = 1; } - } else { - /* XXX implement udbg_putcLP_vtty for hvterm-protocol1 case */ - printk(KERN_WARNING "%s doesn't speak hvterm1; " - "can't print udbg messages\n", - stdout_node->full_name); + } else if (device_is_compatible(stdout_node, "hvterm-protocol")) { + termno = (u32 *)get_property(stdout_node, "reg", NULL); + if (termno) { + vtermno = termno[0]; + ppc_md.udbg_putc = udbg_hvsi_putc; + ppc_md.udbg_getc = udbg_hvsi_getc; + ppc_md.udbg_getc_poll = udbg_hvsi_getc_poll; + found = 1; + } } } else if (strncmp(name, "serial", 6)) { /* XXX fix ISA serial console */ @@ -187,6 +258,22 @@ out: return found; } +void vpa_init(int cpu) +{ + int hwcpu = get_hard_smp_processor_id(cpu); + unsigned long vpa = (unsigned long)&(paca[cpu].lppaca); + long ret; + unsigned long flags; + + /* Register the Virtual Processor Area (VPA) */ + flags = 1UL << (63 - 18); + ret = register_vpa(flags, hwcpu, __pa(vpa)); + + if (ret) + printk(KERN_ERR "WARNING: vpa_init: VPA registration for " + "cpu %d (hw %d) of area %lx returns %ld\n", + cpu, hwcpu, __pa(vpa), ret); +} long pSeries_lpar_hpte_insert(unsigned long hpte_group, unsigned long va, unsigned long prpn, @@ -248,7 +335,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, return (slot & 7) | (secondary << 3); } -static spinlock_t pSeries_lpar_tlbie_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock); static long pSeries_lpar_hpte_remove(unsigned long hpte_group) { @@ -280,7 +367,7 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) static void pSeries_lpar_hptab_clear(void) { - unsigned long size_bytes = 1UL << naca->pftSize; + unsigned long size_bytes = 1UL << ppc64_pft_size; unsigned long hpte_count = size_bytes >> 4; unsigned long dummy1, dummy2; int i; @@ -349,7 +436,7 @@ static long pSeries_lpar_hpte_find(unsigned long vpn) hash = hpt_hash(vpn, 0); for (j = 0; j < 2; j++) { - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; + slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; for (i = 0; i < HPTES_PER_GROUP; i++) { hpte_dw0.dword0 = pSeries_lpar_hpte_getword0(slot); dw0 = hpte_dw0.dw0; @@ -416,7 +503,7 @@ void pSeries_lpar_flush_hash_range(unsigned long context, unsigned long number, int local) { int i; - unsigned long flags; + unsigned long flags = 0; struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE); diff --git a/arch/ppc64/kernel/pSeries_nvram.c b/arch/ppc64/kernel/pSeries_nvram.c index 5d74028d5..52aeefdec 100644 --- a/arch/ppc64/kernel/pSeries_nvram.c +++ b/arch/ppc64/kernel/pSeries_nvram.c @@ -31,7 +31,7 @@ static unsigned int nvram_size; static int nvram_fetch, nvram_store; static char nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */ -static spinlock_t nvram_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(nvram_lock); static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c index a9afded6c..8953e9488 100644 --- a/arch/ppc64/kernel/pSeries_pci.c +++ b/arch/ppc64/kernel/pSeries_pci.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -37,12 +36,10 @@ #include #include #include -#include -#include #include #include -#include "open_pic.h" +#include "mpic.h" #include "pci.h" /* RTAS tokens */ @@ -53,7 +50,7 @@ static int ibm_write_pci_config; static int s7a_workaround; -extern unsigned long pci_probe_only; +extern struct mpic *pSeries_mpic; static int rtas_read_config(struct device_node *dn, int where, int size, u32 *val) { @@ -151,13 +148,49 @@ struct pci_ops rtas_pci_ops = { rtas_pci_write_config }; -static void python_countermeasures(unsigned long addr) +int is_python(struct device_node *dev) { - void *chip_regs; - volatile u32 *tmp, i; + char *model = (char *)get_property(dev, "model", NULL); + + if (model && strstr(model, "Python")) + return 1; + + return 0; +} + +static int get_phb_reg_prop(struct device_node *dev, + unsigned int addr_size_words, + struct reg_property64 *reg) +{ + unsigned int *ui_ptr = NULL, len; + + /* Found a PHB, now figure out where his registers are mapped. */ + ui_ptr = (unsigned int *)get_property(dev, "reg", &len); + if (ui_ptr == NULL) + return 1; + + if (addr_size_words == 1) { + reg->address = ((struct reg_property32 *)ui_ptr)->address; + reg->size = ((struct reg_property32 *)ui_ptr)->size; + } else { + *reg = *((struct reg_property64 *)ui_ptr); + } + + return 0; +} + +static void python_countermeasures(struct device_node *dev, + unsigned int addr_size_words) +{ + struct reg_property64 reg_struct; + void __iomem *chip_regs; + volatile u32 val; + + if (get_phb_reg_prop(dev, addr_size_words, ®_struct)) + return; /* Python's register file is 1 MB in size. */ - chip_regs = ioremap(addr & ~(0xfffffUL), 0x100000); + chip_regs = ioremap(reg_struct.address & ~(0xfffffUL), 0x100000); /* * Firmware doesn't always clear this bit which is critical @@ -166,17 +199,17 @@ static void python_countermeasures(unsigned long addr) #define PRG_CL_RESET_VALID 0x00010000 - tmp = (u32 *)((unsigned long)chip_regs + 0xf6030); - - if (*tmp & PRG_CL_RESET_VALID) { + val = in_be32(chip_regs + 0xf6030); + if (val & PRG_CL_RESET_VALID) { printk(KERN_INFO "Python workaround: "); - *tmp &= ~PRG_CL_RESET_VALID; + val &= ~PRG_CL_RESET_VALID; + out_be32(chip_regs + 0xf6030, val); /* * We must read it back for changes to * take effect */ - i = *tmp; - printk("reg0: %x\n", i); + val = in_be32(chip_regs + 0xf6030); + printk("reg0: %x\n", val); } iounmap(chip_regs); @@ -190,7 +223,7 @@ void __init init_pci_config_tokens (void) ibm_write_pci_config = rtas_token("ibm,write-pci-config"); } -unsigned long __init get_phb_buid (struct device_node *phb) +unsigned long __devinit get_phb_buid (struct device_node *phb) { int addr_cells; unsigned int *buid_vals; @@ -220,88 +253,96 @@ unsigned long __init get_phb_buid (struct device_node *phb) return buid; } -static struct pci_controller * __init alloc_phb(struct device_node *dev, - unsigned int addr_size_words) +static int phb_set_bus_ranges(struct device_node *dev, + struct pci_controller *phb) { - struct pci_controller *phb; - unsigned int *ui_ptr = NULL, len; - struct reg_property64 reg_struct; int *bus_range; - char *model; - enum phb_types phb_type; - struct property *of_prop; - - model = (char *)get_property(dev, "model", NULL); - - if (!model) { - printk(KERN_ERR "alloc_phb: phb has no model property\n"); - model = ""; - } - - /* Found a PHB, now figure out where his registers are mapped. */ - ui_ptr = (unsigned int *) get_property(dev, "reg", &len); - if (ui_ptr == NULL) { - PPCDBG(PPCDBG_PHBINIT, "\tget reg failed.\n"); - return NULL; - } + unsigned int len; - if (addr_size_words == 1) { - reg_struct.address = ((struct reg_property32 *)ui_ptr)->address; - reg_struct.size = ((struct reg_property32 *)ui_ptr)->size; - } else { - reg_struct = *((struct reg_property64 *)ui_ptr); - } + bus_range = (int *) get_property(dev, "bus-range", &len); + if (bus_range == NULL || len < 2 * sizeof(int)) { + return 1; + } + + phb->first_busno = bus_range[0]; + phb->last_busno = bus_range[1]; - if (strstr(model, "Python")) { - phb_type = phb_type_python; - } else if (strstr(model, "Speedwagon")) { - phb_type = phb_type_speedwagon; - } else if (strstr(model, "Winnipeg")) { - phb_type = phb_type_winnipeg; - } else { - printk(KERN_ERR "alloc_phb: unknown PHB %s\n", model); - phb_type = phb_type_unknown; - } + return 0; +} - phb = pci_alloc_pci_controller(phb_type); - if (phb == NULL) - return NULL; +static int __devinit setup_phb(struct device_node *dev, + struct pci_controller *phb, + unsigned int addr_size_words) +{ + pci_setup_pci_controller(phb); - if (phb_type == phb_type_python) - python_countermeasures(reg_struct.address); + if (is_python(dev)) + python_countermeasures(dev, addr_size_words); - bus_range = (int *) get_property(dev, "bus-range", &len); - if (bus_range == NULL || len < 2 * sizeof(int)) { - kfree(phb); - return NULL; - } + if (phb_set_bus_ranges(dev, phb)) + return 1; - of_prop = (struct property *)alloc_bootmem(sizeof(struct property) + - sizeof(phb->global_number)); + phb->arch_data = dev; + phb->ops = &rtas_pci_ops; + phb->buid = get_phb_buid(dev); - if (!of_prop) { - kfree(phb); - return NULL; - } + return 0; +} +static void __devinit add_linux_pci_domain(struct device_node *dev, + struct pci_controller *phb, + struct property *of_prop) +{ memset(of_prop, 0, sizeof(struct property)); of_prop->name = "linux,pci-domain"; of_prop->length = sizeof(phb->global_number); of_prop->value = (unsigned char *)&of_prop[1]; memcpy(of_prop->value, &phb->global_number, sizeof(phb->global_number)); prom_add_property(dev, of_prop); +} - phb->first_busno = bus_range[0]; - phb->last_busno = bus_range[1]; +static struct pci_controller * __init alloc_phb(struct device_node *dev, + unsigned int addr_size_words) +{ + struct pci_controller *phb; + struct property *of_prop; - phb->arch_data = dev; - phb->ops = &rtas_pci_ops; + phb = alloc_bootmem(sizeof(struct pci_controller)); + if (phb == NULL) + return NULL; - phb->buid = get_phb_buid(dev); + of_prop = alloc_bootmem(sizeof(struct property) + + sizeof(phb->global_number)); + if (!of_prop) + return NULL; + + if (setup_phb(dev, phb, addr_size_words)) + return NULL; + + add_linux_pci_domain(dev, phb, of_prop); return phb; } +static struct pci_controller * __devinit alloc_phb_dynamic(struct device_node *dev, unsigned int addr_size_words) +{ + struct pci_controller *phb; + + phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), + GFP_KERNEL); + if (phb == NULL) + return NULL; + + if (setup_phb(dev, phb, addr_size_words)) + return NULL; + + phb->is_dynamic = 1; + + /* TODO: linux,pci-domain? */ + + return phb; +} + unsigned long __init find_and_init_phbs(void) { struct device_node *node; @@ -311,7 +352,7 @@ unsigned long __init find_and_init_phbs(void) unsigned int *opprop = NULL; struct device_node *root = of_find_node_by_path("/"); - if (naca->interrupt_controller == IC_OPEN_PIC) { + if (ppc64_interrupt_controller == IC_OPEN_PIC) { opprop = (unsigned int *)get_property(root, "platform-open-pic", NULL); } @@ -330,11 +371,12 @@ unsigned long __init find_and_init_phbs(void) if (!phb) continue; - pci_process_bridge_OF_ranges(phb, node, index == 0); + pci_process_bridge_OF_ranges(phb, node); + pci_setup_phb_io(phb, index == 0); - if (naca->interrupt_controller == IC_OPEN_PIC) { + if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) { int addr = root_size_cells * (index + 2) - 1; - openpic_setup_ISU(index, opprop[addr]); + mpic_assign_isu(pSeries_mpic, index, opprop[addr]); } index++; @@ -343,9 +385,55 @@ unsigned long __init find_and_init_phbs(void) of_node_put(root); pci_devs_phb_init(); + /* + * pci_probe_only and pci_assign_all_buses can be set via properties + * in chosen. + */ + if (of_chosen) { + int *prop; + + prop = (int *)get_property(of_chosen, "linux,pci-probe-only", + NULL); + if (prop) + pci_probe_only = *prop; + + prop = (int *)get_property(of_chosen, + "linux,pci-assign-all-buses", NULL); + if (prop) + pci_assign_all_buses = *prop; + } + return 0; } +struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) +{ + struct device_node *root = of_find_node_by_path("/"); + unsigned int root_size_cells = 0; + struct pci_controller *phb; + struct pci_bus *bus; + + root_size_cells = prom_n_size_cells(root); + + phb = alloc_phb_dynamic(dn, root_size_cells); + if (!phb) + return NULL; + + pci_process_bridge_OF_ranges(phb, dn); + + pci_setup_phb_io_dynamic(phb); + of_node_put(root); + + pci_devs_phb_init_dynamic(phb); + phb->last_busno = 0xff; + bus = pci_scan_bus(phb->first_busno, phb->ops, phb->arch_data); + phb->bus = bus; + phb->last_busno = bus->subordinate; + + return phb; +} +EXPORT_SYMBOL(init_phb_dynamic); + #if 0 void pcibios_name_device(struct pci_dev *dev) { @@ -386,113 +474,64 @@ static void check_s7a(void) } } -static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys, - unsigned long *start_virt, unsigned long *size) +/* RPA-specific bits for removing PHBs */ +int pcibios_remove_root_bus(struct pci_controller *phb) { - struct pci_controller *hose = PCI_GET_PHB_PTR(bus); - struct pci_bus_region region; + struct pci_bus *b = phb->bus; struct resource *res; + int rc, i; - if (bus->self) { - res = bus->resource[0]; - pcibios_resource_to_bus(bus->self, ®ion, res); - *start_phys = hose->io_base_phys + region.start; - *start_virt = (unsigned long) hose->io_base_virt + - region.start; - if (region.end > region.start) - *size = region.end - region.start + 1; - else { - printk("%s(): unexpected region 0x%lx->0x%lx\n", - __FUNCTION__, region.start, region.end); - return 1; - } - - } else { - /* Root Bus */ - res = &hose->io_resource; - *start_phys = hose->io_base_phys; - *start_virt = (unsigned long) hose->io_base_virt; - if (res->end > res->start) - *size = res->end - res->start + 1; - else { - printk("%s(): unexpected region 0x%lx->0x%lx\n", - __FUNCTION__, res->start, res->end); - return 1; - } + res = b->resource[0]; + if (!res->flags) { + printk(KERN_ERR "%s: no IO resource for PHB %s\n", __FUNCTION__, + b->name); + return 1; } - return 0; -} - -int unmap_bus_range(struct pci_bus *bus) -{ - unsigned long start_phys; - unsigned long start_virt; - unsigned long size; - - if (!bus) { - printk(KERN_ERR "%s() expected bus\n", __FUNCTION__); + rc = unmap_bus_range(b); + if (rc) { + printk(KERN_ERR "%s: failed to unmap IO on bus %s\n", + __FUNCTION__, b->name); return 1; } - - if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) - return 1; - if (iounmap_explicit((void *) start_virt, size)) - return 1; - return 0; -} -EXPORT_SYMBOL(unmap_bus_range); - -int remap_bus_range(struct pci_bus *bus) -{ - unsigned long start_phys; - unsigned long start_virt; - unsigned long size; - - if (!bus) { - printk(KERN_ERR "%s() expected bus\n", __FUNCTION__); + if (release_resource(res)) { + printk(KERN_ERR "%s: failed to release IO on bus %s\n", + __FUNCTION__, b->name); return 1; } - - if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) - return 1; - if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE)) - return 1; - return 0; -} -EXPORT_SYMBOL(remap_bus_range); + for (i = 1; i < 3; ++i) { + res = b->resource[i]; + if (!res->flags && i == 0) { + printk(KERN_ERR "%s: no MEM resource for PHB %s\n", + __FUNCTION__, b->name); + return 1; + } + if (res->flags && release_resource(res)) { + printk(KERN_ERR + "%s: failed to release IO %d on bus %s\n", + __FUNCTION__, i, b->name); + return 1; + } + } -static void phbs_fixup_io(void) -{ - struct pci_controller *hose, *tmp; + list_del(&phb->list_node); + if (phb->is_dynamic) + kfree(phb); - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) - remap_bus_range(hose->bus); + return 0; } +EXPORT_SYMBOL(pcibios_remove_root_bus); static void __init pSeries_request_regions(void) { - struct device_node *i8042; - request_region(0x20,0x20,"pic1"); request_region(0xa0,0x20,"pic2"); request_region(0x00,0x20,"dma1"); request_region(0x40,0x20,"timer"); request_region(0x80,0x10,"dma page reg"); request_region(0xc0,0x20,"dma2"); - -#define I8042_DATA_REG 0x60 - - /* - * Some machines have an unterminated i8042 so check the device - * tree and reserve the region if it does not appear. Later on - * the i8042 code will try and reserve this region and fail. - */ - if (!(i8042 = of_find_node_by_type(NULL, "8042"))) - request_region(I8042_DATA_REG, 16, "reserved (no i8042)"); - of_node_put(i8042); } void __init pSeries_final_fixup(void) @@ -501,7 +540,7 @@ void __init pSeries_final_fixup(void) check_s7a(); - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { pci_read_irq_line(dev); if (s7a_workaround) { if (dev->irq > 16) { @@ -511,13 +550,36 @@ void __init pSeries_final_fixup(void) } } - phbs_fixup_io(); + phbs_remap_io(); pSeries_request_regions(); - pci_fix_bus_sysdata(); - - if (!of_chosen || !get_property(of_chosen, "linux,iommu-off", NULL)) - iommu_setup_pSeries(); pci_addr_cache_build(); } +/* + * Assume the winbond 82c105 is the IDE controller on a + * p610. We should probably be more careful in case + * someone tries to plug in a similar adapter. + */ +static void fixup_winbond_82c105(struct pci_dev* dev) +{ + int i; + unsigned int reg; + + if (!(systemcfg->platform & PLATFORM_PSERIES)) + return; + + printk("Using INTC for W82c105 IDE controller.\n"); + pci_read_config_dword(dev, 0x40, ®); + /* Enable LEGIRQ to use INTC instead of ISA interrupts */ + pci_write_config_dword(dev, 0x40, reg | (1<<11)); + + for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) { + /* zap the 2nd function of the winbond chip */ + if (dev->resource[i].flags & IORESOURCE_IO + && dev->bus->number == 0 && dev->devfn == 0x81) + dev->resource[i].flags &= ~IORESOURCE_IO; + } +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, + fixup_winbond_82c105); diff --git a/arch/ppc64/kernel/pSeries_setup.c b/arch/ppc64/kernel/pSeries_setup.c index 80e028904..f603397b7 100644 --- a/arch/ppc64/kernel/pSeries_setup.c +++ b/arch/ppc64/kernel/pSeries_setup.c @@ -40,7 +40,6 @@ #include #include #include - #include #include #include @@ -56,41 +55,44 @@ #include #include #include -#include #include #include - -#include "i8259.h" -#include "open_pic.h" +#include #include -#include #include +#include "i8259.h" +#include "mpic.h" +#include "pci.h" + #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif -extern void pSeries_init_openpic(void); - -extern void find_and_init_phbs(void); extern void pSeries_final_fixup(void); extern void pSeries_get_boot_time(struct rtc_time *rtc_time); extern void pSeries_get_rtc_time(struct rtc_time *rtc_time); extern int pSeries_set_rtc_time(struct rtc_time *rtc_time); extern void find_udbg_vterm(void); -extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void); /* from head.S */ -int fwnmi_active; /* TRUE if an FWNMI handler is present */ - -unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address. +extern void system_reset_fwnmi(void); /* from head.S */ +extern void machine_check_fwnmi(void); /* from head.S */ +extern void generic_find_legacy_serial_ports(u64 *physport, + unsigned int *default_speed); -extern unsigned long loops_per_jiffy; +int fwnmi_active; /* TRUE if an FWNMI handler is present */ extern unsigned long ppc_proc_freq; extern unsigned long ppc_tb_freq; +extern void pSeries_system_reset_exception(struct pt_regs *regs); +extern int pSeries_machine_check_exception(struct pt_regs *regs); + +static volatile void __iomem * chrp_int_ack_special; +struct mpic *pSeries_mpic; + void pSeries_get_cpuinfo(struct seq_file *m) { struct device_node *root; @@ -114,21 +116,90 @@ static void __init fwnmi_init(void) if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE) return; ret = rtas_call(ibm_nmi_register, 2, 1, NULL, - __pa((unsigned long)SystemReset_FWNMI), - __pa((unsigned long)MachineCheck_FWNMI)); + __pa((unsigned long)system_reset_fwnmi), + __pa((unsigned long)machine_check_fwnmi)); if (ret == 0) fwnmi_active = 1; } -static void __init pSeries_setup_arch(void) +static int pSeries_irq_cascade(struct pt_regs *regs, void *data) +{ + if (chrp_int_ack_special) + return readb(chrp_int_ack_special); + else + return i8259_irq(smp_processor_id()); +} + +static void __init pSeries_init_mpic(void) +{ + unsigned int *addrp; + struct device_node *np; + int i; + + /* All ISUs are setup, complete initialization */ + mpic_init(pSeries_mpic); + + /* Check what kind of cascade ACK we have */ + if (!(np = of_find_node_by_name(NULL, "pci")) + || !(addrp = (unsigned int *) + get_property(np, "8259-interrupt-acknowledge", NULL))) + printk(KERN_ERR "Cannot find pci to get ack address\n"); + else + chrp_int_ack_special = ioremap(addrp[prom_n_addr_cells(np)-1], 1); + of_node_put(np); + + /* Setup the legacy interrupts & controller */ + for (i = 0; i < NUM_ISA_INTERRUPTS; i++) + irq_desc[i].handler = &i8259_pic; + i8259_init(0); + + /* Hook cascade to mpic */ + mpic_setup_cascade(NUM_ISA_INTERRUPTS, pSeries_irq_cascade, NULL); +} + +static void __init pSeries_setup_mpic(void) { - struct device_node *root; unsigned int *opprop; + unsigned long openpic_addr = 0; + unsigned char senses[NR_IRQS - NUM_ISA_INTERRUPTS]; + struct device_node *root; + int irq_count; + + /* Find the Open PIC if present */ + root = of_find_node_by_path("/"); + opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL); + if (opprop != 0) { + int n = prom_n_addr_cells(root); + + for (openpic_addr = 0; n > 0; --n) + openpic_addr = (openpic_addr << 32) + *opprop++; + printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); + } + of_node_put(root); + + BUG_ON(openpic_addr == 0); + /* Get the sense values from OF */ + prom_get_irq_senses(senses, NUM_ISA_INTERRUPTS, NR_IRQS); + + /* Setup the openpic driver */ + irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */ + pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY, + 16, 16, irq_count, /* isu size, irq offset, irq count */ + NR_IRQS - 4, /* ipi offset */ + senses, irq_count, /* sense & sense size */ + " MPIC "); +} + +static void __init pSeries_setup_arch(void) +{ /* Fixup ppc_md depending on the type of interrupt controller */ - if (naca->interrupt_controller == IC_OPEN_PIC) { - ppc_md.init_IRQ = pSeries_init_openpic; - ppc_md.get_irq = openpic_get_irq; + if (ppc64_interrupt_controller == IC_OPEN_PIC) { + ppc_md.init_IRQ = pSeries_init_mpic; + ppc_md.get_irq = mpic_get_irq; + /* Allocate the mpic now, so that find_and_init_phbs() can + * fill the ISUs */ + pSeries_setup_mpic(); } else { ppc_md.init_IRQ = xics_init_IRQ; ppc_md.get_irq = xics_get_irq; @@ -152,30 +223,18 @@ static void __init pSeries_setup_arch(void) fwnmi_init(); /* Find and initialize PCI host bridges */ - /* iSeries needs to be done much later. */ + init_pci_config_tokens(); eeh_init(); find_and_init_phbs(); - /* Find the Open PIC if present */ - root = of_find_node_by_path("/"); - opprop = (unsigned int *) get_property(root, - "platform-open-pic", NULL); - if (opprop != 0) { - int n = prom_n_addr_cells(root); - unsigned long openpic; - - for (openpic = 0; n > 0; --n) - openpic = (openpic << 32) + *opprop++; - printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic); - OpenPIC_Addr = __ioremap(openpic, 0x40000, _PAGE_NO_CACHE); - } - of_node_put(root); - #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif pSeries_nvram_init(); + + if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) + vpa_init(boot_cpuid); } static int __init pSeries_init_panel(void) @@ -189,75 +248,6 @@ static int __init pSeries_init_panel(void) arch_initcall(pSeries_init_panel); - -void __init pSeries_find_serial_port(void) -{ - struct device_node *np; - unsigned long encode_phys_size = 32; - u32 *sizeprop; - - struct isa_reg_property { - u32 space; - u32 address; - u32 size; - }; - struct pci_reg_property { - struct pci_address addr; - u32 size_hi; - u32 size_lo; - }; - - DBG(" -> pSeries_find_serial_port()\n"); - - naca->serialPortAddr = 0; - - np = of_find_node_by_path("/"); - if (!np) - return; - sizeprop = (u32 *)get_property(np, "#size-cells", NULL); - if (sizeprop != NULL) - encode_phys_size = (*sizeprop) << 5; - - for (np = NULL; (np = of_find_node_by_type(np, "serial"));) { - struct device_node *isa, *pci; - struct isa_reg_property *reg; - union pci_range *rangesp; - char *typep; - - typep = (char *)get_property(np, "ibm,aix-loc", NULL); - if ((typep == NULL) || (typep && strcmp(typep, "S1"))) - continue; - - reg = (struct isa_reg_property *)get_property(np, "reg", NULL); - - isa = of_get_parent(np); - if (!isa) { - DBG("no isa parent found\n"); - break; - } - pci = of_get_parent(isa); - if (!pci) { - DBG("no pci parent found\n"); - break; - } - - rangesp = (union pci_range *)get_property(pci, "ranges", NULL); - - if ( encode_phys_size == 32 ) - naca->serialPortAddr = rangesp->pci32.phys+reg->address; - else { - naca->serialPortAddr = - ((((unsigned long)rangesp->pci64.phys_hi) << 32) - | - (rangesp->pci64.phys_lo)) + reg->address; - } - break; - } - - DBG(" <- pSeries_find_serial_port()\n"); -} - - /* Build up the firmware_features bitmask field * using contents of device-tree/ibm,hypertas-functions. * Ultimately this functionality may be moved into prom.c prom_init(). @@ -316,20 +306,34 @@ static void __init pSeries_discover_pic(void) * to properly parse the OF interrupt tree & do the virtual irq mapping */ __irq_offset_value = NUM_ISA_INTERRUPTS; - naca->interrupt_controller = IC_INVALID; + ppc64_interrupt_controller = IC_INVALID; for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) { typep = (char *)get_property(np, "compatible", NULL); if (strstr(typep, "open-pic")) - naca->interrupt_controller = IC_OPEN_PIC; + ppc64_interrupt_controller = IC_OPEN_PIC; else if (strstr(typep, "ppc-xicp")) - naca->interrupt_controller = IC_PPC_XIC; + ppc64_interrupt_controller = IC_PPC_XIC; else - printk("initialize_naca: failed to recognize" + printk("pSeries_discover_pic: failed to recognize" " interrupt-controller\n"); break; } } +static void pSeries_cpu_die(void) +{ + local_irq_disable(); + /* Some hardware requires clearing the CPPR, while other hardware does not + * it is safe either way + */ + pSeriesLP_cppr_info(0, 0); + rtas_stop_self(); + /* Should never get here... */ + BUG(); + for(;;); +} + + /* * Early initialization. Relocation is on but do not reference unbolted pages */ @@ -337,6 +341,8 @@ static void __init pSeries_init_early(void) { void *comport; int iommu_off = 0; + unsigned int default_speed; + u64 physport; DBG(" -> pSeries_init_early()\n"); @@ -350,14 +356,14 @@ static void __init pSeries_init_early(void) get_property(of_chosen, "linux,iommu-off", NULL)); } - pSeries_find_serial_port(); + generic_find_legacy_serial_ports(&physport, &default_speed); if (systemcfg->platform & PLATFORM_LPAR) find_udbg_vterm(); - else if (naca->serialPortAddr) { + else if (physport) { /* Map the uart for udbg. */ - comport = (void *)__ioremap(naca->serialPortAddr, 16, _PAGE_NO_CACHE); - udbg_init_uart(comport); + comport = (void *)__ioremap(physport, 16, _PAGE_NO_CACHE); + udbg_init_uart(comport, default_speed); ppc_md.udbg_putc = udbg_putc; ppc_md.udbg_getc = udbg_getc; @@ -366,10 +372,7 @@ static void __init pSeries_init_early(void) } - if (iommu_off) - pci_dma_init_direct(); - else - tce_init_pSeries(); + iommu_init_early_pSeries(); pSeries_discover_pic(); @@ -384,7 +387,7 @@ static void pSeries_progress(char *s, unsigned short hex) char *os; static int display_character, set_indicator; static int max_width; - static spinlock_t progress_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(progress_lock); static int pending_newline = 0; /* did last write end with unprinted newline? */ if (!rtas.base) @@ -542,6 +545,31 @@ static void __init pSeries_calibrate_decr(void) setup_default_decr(); } +static int pSeries_check_legacy_ioport(unsigned int baseport) +{ + struct device_node *np; + +#define I8042_DATA_REG 0x60 +#define FDC_BASE 0x3f0 + + + switch(baseport) { + case I8042_DATA_REG: + np = of_find_node_by_type(NULL, "8042"); + if (np == NULL) + return -ENODEV; + of_node_put(np); + break; + case FDC_BASE: + np = of_find_node_by_type(NULL, "fdc"); + if (np == NULL) + return -ENODEV; + of_node_put(np); + break; + } + return 0; +} + /* * Called very early, MMU is off, device-tree isn't unflattened */ @@ -571,9 +599,13 @@ struct machdep_calls __initdata pSeries_md = { .power_off = rtas_power_off, .halt = rtas_halt, .panic = rtas_os_term, + .cpu_die = pSeries_cpu_die, .get_boot_time = pSeries_get_boot_time, .get_rtc_time = pSeries_get_rtc_time, .set_rtc_time = pSeries_set_rtc_time, .calibrate_decr = pSeries_calibrate_decr, .progress = pSeries_progress, + .check_legacy_ioport = pSeries_check_legacy_ioport, + .system_reset_exception = pSeries_system_reset_exception, + .machine_check_exception = pSeries_machine_check_exception, }; diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c index 6eba926cd..27ab1ed2c 100644 --- a/arch/ppc64/kernel/pSeries_smp.c +++ b/arch/ppc64/kernel/pSeries_smp.c @@ -19,9 +19,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -38,10 +36,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -57,7 +53,7 @@ #define DBG(fmt...) #endif -extern void pseries_secondary_smp_init(unsigned long); +extern void pSeries_secondary_smp_init(unsigned long); /* Get state of physical CPU. * Return codes: @@ -88,11 +84,8 @@ static int query_cpu_stopped(unsigned int pcpu) #ifdef CONFIG_HOTPLUG_CPU -int __cpu_disable(void) +int pSeries_cpu_disable(void) { - /* FIXME: go put this in a header somewhere */ - extern void xics_migrate_irqs_away(void); - systemcfg->processorCount--; /*fix boot_cpuid here*/ @@ -104,7 +97,7 @@ int __cpu_disable(void) return 0; } -void __cpu_die(unsigned int cpu) +void pSeries_cpu_die(unsigned int cpu) { int tries; int cpu_status; @@ -114,8 +107,7 @@ void __cpu_die(unsigned int cpu) cpu_status = query_cpu_stopped(pcpu); if (cpu_status == 0 || cpu_status == -1) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + msleep(200); } if (cpu_status != 0) { printk("Querying DEAD? cpu %i (%i) shows %i\n", @@ -193,7 +185,7 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu) { int status; unsigned long start_here = __pa((u32)*((unsigned long *) - pseries_secondary_smp_init)); + pSeries_secondary_smp_init)); unsigned int pcpu; /* At boot time the cpus are already spinning in hold @@ -251,8 +243,6 @@ static void smp_xics_message_pass(int target, int msg) } } -extern void xics_request_IPIs(void); - static int __init smp_xics_probe(void) { xics_request_IPIs(); @@ -264,9 +254,20 @@ static void __devinit smp_xics_setup_cpu(int cpu) { if (cpu != boot_cpuid) xics_setup_cpu(); + + if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) + vpa_init(cpu); + + /* + * Put the calling processor into the GIQ. This is really only + * necessary from a secondary thread as the OF start-cpu interface + * performs this function for us on primary threads. + */ + rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, + (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); } -static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(timebase_lock); static unsigned long timebase = 0; static void __devinit pSeries_give_timebase(void) @@ -291,26 +292,7 @@ static void __devinit pSeries_take_timebase(void) spin_unlock(&timebase_lock); } -static void __devinit pSeries_late_setup_cpu(int cpu) -{ - extern unsigned int default_distrib_server; - - if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { - vpa_init(cpu); - } - -#ifdef CONFIG_IRQ_ALL_CPUS - /* Put the calling processor into the GIQ. This is really only - * necessary from a secondary thread as the OF start-cpu interface - * performs this function for us on primary threads. - */ - /* TODO: 9005 is #defined in rtas-proc.c -- move to a header */ - rtas_set_indicator(9005, default_distrib_server, 1); -#endif -} - - -void __devinit smp_pSeries_kick_cpu(int nr) +static void __devinit smp_pSeries_kick_cpu(int nr) { BUG_ON(nr < 0 || nr >= NR_CPUS); @@ -330,7 +312,6 @@ static struct smp_ops_t pSeries_mpic_smp_ops = { .probe = smp_mpic_probe, .kick_cpu = smp_pSeries_kick_cpu, .setup_cpu = smp_mpic_setup_cpu, - .late_setup_cpu = pSeries_late_setup_cpu, }; static struct smp_ops_t pSeries_xics_smp_ops = { @@ -338,7 +319,6 @@ static struct smp_ops_t pSeries_xics_smp_ops = { .probe = smp_xics_probe, .kick_cpu = smp_pSeries_kick_cpu, .setup_cpu = smp_xics_setup_cpu, - .late_setup_cpu = pSeries_late_setup_cpu, }; /* This is called very early */ @@ -348,11 +328,16 @@ void __init smp_init_pSeries(void) DBG(" -> smp_init_pSeries()\n"); - if (naca->interrupt_controller == IC_OPEN_PIC) + if (ppc64_interrupt_controller == IC_OPEN_PIC) smp_ops = &pSeries_mpic_smp_ops; else smp_ops = &pSeries_xics_smp_ops; +#ifdef CONFIG_HOTPLUG_CPU + smp_ops->cpu_disable = pSeries_cpu_disable; + smp_ops->cpu_die = pSeries_cpu_die; +#endif + /* Start secondary threads on SMT systems; primary threads * are already in the running state. */ @@ -363,14 +348,11 @@ void __init smp_init_pSeries(void) rtas_call(rtas_token("start-cpu"), 3, 1, &ret, get_hard_smp_processor_id(i), __pa((u32)*((unsigned long *) - pseries_secondary_smp_init)), + pSeries_secondary_smp_init)), i); } } - if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) - vpa_init(boot_cpuid); - /* Non-lpar has additional take/give timebase */ if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { smp_ops->give_timebase = pSeries_give_timebase; diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c index 61d7f8e33..0b18d17b9 100644 --- a/arch/ppc64/kernel/pacaData.c +++ b/arch/ppc64/kernel/pacaData.c @@ -7,28 +7,28 @@ * 2 of the License, or (at your option) any later version. */ -#include -#include -#include #include +#include #include +#include + #include #include +#include -#include +#include #include -#include #include -struct naca_struct *naca; struct systemcfg *systemcfg; +EXPORT_SYMBOL(systemcfg); /* This symbol is provided by the linker - let it fill in the paca * field correctly */ extern unsigned long __toc_start; /* The Paca is an array with one entry per processor. Each contains an - * ItLpPaca, which contains the information shared between the + * lppaca, which contains the information shared between the * hypervisor and Linux. Each also contains an ItLpRegSave area which * is used by the hypervisor to save registers. * On systems with hardware multi-threading, there are two threads @@ -59,14 +59,15 @@ extern unsigned long __toc_start; .stab_real = (asrr), /* Real pointer to segment table */ \ .stab_addr = (asrv), /* Virt pointer to segment table */ \ .cpu_start = (start), /* Processor start */ \ + .hw_cpu_id = 0xffff, \ .lppaca = { \ - .xDesc = 0xd397d781, /* "LpPa" */ \ - .xSize = sizeof(struct ItLpPaca), \ - .xFPRegsInUse = 1, \ - .xDynProcStatus = 2, \ - .xDecrVal = 0x00ff0000, \ - .xEndOfQuantum = 0xfffffffffffffffful, \ - .xSLBCount = 64, \ + .desc = 0xd397d781, /* "LpPa" */ \ + .size = sizeof(struct lppaca), \ + .dyn_proc_status = 2, \ + .decr_val = 0x00ff0000, \ + .fpregs_in_use = 1, \ + .end_of_quantum = 0xfffffffffffffffful, \ + .slb_count = 64, \ }, \ EXTRA_INITS((number), (lpq)) \ } @@ -77,13 +78,16 @@ struct paca_struct paca[] = { #else PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR), #endif +#if NR_CPUS > 1 PACAINITDATA( 1, 0, NULL, 0, 0), PACAINITDATA( 2, 0, NULL, 0, 0), PACAINITDATA( 3, 0, NULL, 0, 0), +#if NR_CPUS > 4 PACAINITDATA( 4, 0, NULL, 0, 0), PACAINITDATA( 5, 0, NULL, 0, 0), PACAINITDATA( 6, 0, NULL, 0, 0), PACAINITDATA( 7, 0, NULL, 0, 0), +#if NR_CPUS > 8 PACAINITDATA( 8, 0, NULL, 0, 0), PACAINITDATA( 9, 0, NULL, 0, 0), PACAINITDATA(10, 0, NULL, 0, 0), @@ -208,4 +212,7 @@ struct paca_struct paca[] = { PACAINITDATA(127, 0, NULL, 0, 0), #endif #endif +#endif +#endif +#endif }; diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index 751071af3..f7486bee0 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c @@ -11,17 +11,14 @@ * 2 of the License, or (at your option) any later version. */ +#undef DEBUG + #include #include #include -#include #include #include -#include -#include -#include #include -#include #include #include @@ -31,19 +28,24 @@ #include #include #include -#include -#include -#include -#include #include +#include #include "pci.h" +#ifdef DEBUG +#define DBG(fmt...) udbg_printf(fmt) +#else +#define DBG(fmt...) +#endif + unsigned long pci_probe_only = 1; unsigned long pci_assign_all_buses = 0; -/* legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch - devices we don't have access to. */ +/* + * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch + * devices we don't have access to. + */ unsigned long io_page_mask; EXPORT_SYMBOL(io_page_mask); @@ -85,35 +87,11 @@ static void fixup_broken_pcnet32(struct pci_dev* dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32); -static void fixup_windbond_82c105(struct pci_dev* dev) -{ - /* Assume the windbond 82c105 is the IDE controller on a - * p610. We should probably be more careful in case - * someone tries to plug in a similar adapter. - */ - int i; - unsigned int reg; - - printk("Using INTC for W82c105 IDE controller.\n"); - pci_read_config_dword(dev, 0x40, ®); - /* Enable LEGIRQ to use INTC instead of ISA interrupts */ - pci_write_config_dword(dev, 0x40, reg | (1<<11)); - - for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) { - /* zap the 2nd function of the winbond chip */ - if (dev->resource[i].flags & IORESOURCE_IO - && dev->bus->number == 0 && dev->devfn == 0x81) - dev->resource[i].flags &= ~IORESOURCE_IO; - } -} -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, fixup_windbond_82c105); - -void -pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, - struct resource *res) +void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res) { unsigned long offset = 0; - struct pci_controller *hose = PCI_GET_PHB_PTR(dev); + struct pci_controller *hose = pci_bus_to_host(dev->bus); if (!hose) return; @@ -149,7 +127,7 @@ void pcibios_align_resource(void *data, struct resource *res, unsigned long size, unsigned long align) { struct pci_dev *dev = data; - struct pci_controller *hose = PCI_GET_PHB_PTR(dev); + struct pci_controller *hose = pci_bus_to_host(dev->bus); unsigned long start = res->start; unsigned long alignto; @@ -179,68 +157,27 @@ void pcibios_align_resource(void *data, struct resource *res, res->start = start; } -/* - * Allocate pci_controller(phb) initialized common variables. +static DEFINE_SPINLOCK(hose_spinlock); + +/* + * pci_controller(phb) initialized common variables. */ -struct pci_controller * __init -pci_alloc_pci_controller(enum phb_types controller_type) +void __devinit pci_setup_pci_controller(struct pci_controller *hose) { - struct pci_controller *hose; - char *model; - -#ifdef CONFIG_PPC_ISERIES - hose = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), GFP_KERNEL); -#else - hose = (struct pci_controller *)alloc_bootmem(sizeof(struct pci_controller)); -#endif - if(hose == NULL) { - printk(KERN_ERR "PCI: Allocate pci_controller failed.\n"); - return NULL; - } - memset(hose, 0, sizeof(struct pci_controller)); - - switch(controller_type) { -#ifdef CONFIG_PPC_ISERIES - case phb_type_hypervisor: - model = "PHB HV"; - break; -#endif - case phb_type_python: - model = "PHB PY"; - break; - case phb_type_speedwagon: - model = "PHB SW"; - break; - case phb_type_winnipeg: - model = "PHB WP"; - break; - case phb_type_apple: - model = "PHB APPLE"; - break; - default: - model = "PHB UK"; - break; - } - - if(strlen(model) < 8) - strcpy(hose->what,model); - else - memcpy(hose->what,model,7); - hose->type = controller_type; - hose->global_number = global_phb_number++; + memset(hose, 0, sizeof(struct pci_controller)); + spin_lock(&hose_spinlock); + hose->global_number = global_phb_number++; list_add_tail(&hose->list_node, &hose_list); - - return hose; + spin_unlock(&hose_spinlock); } static void __init pcibios_claim_one_bus(struct pci_bus *b) { - struct list_head *ld; + struct pci_dev *dev; struct pci_bus *child_bus; - for (ld = b->devices.next; ld != &b->devices; ld = ld->next) { - struct pci_dev *dev = pci_dev_b(ld); + list_for_each_entry(dev, &b->devices, bus_list) { int i; for (i = 0; i < PCI_NUM_RESOURCES; i++) { @@ -259,12 +196,10 @@ static void __init pcibios_claim_one_bus(struct pci_bus *b) #ifndef CONFIG_PPC_ISERIES static void __init pcibios_claim_of_setup(void) { - struct list_head *lb; + struct pci_bus *b; - for (lb = pci_root_buses.next; lb != &pci_root_buses; lb = lb->next) { - struct pci_bus *b = pci_bus_b(lb); + list_for_each_entry(b, &pci_root_buses, node) pcibios_claim_one_bus(b); - } } #endif @@ -303,7 +238,7 @@ static int __init pcibios_init(void) ppc_md.pcibios_fixup(); /* Cache the location of the ISA bridge (if we have one) */ - ppc64_isabridge_dev = pci_find_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); + ppc64_isabridge_dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); if (ppc64_isabridge_dev != NULL) printk("ISA bridge at %s\n", pci_name(ppc64_isabridge_dev)); @@ -357,7 +292,7 @@ int pci_domain_nr(struct pci_bus *bus) #ifdef CONFIG_PPC_ISERIES return 0; #else - struct pci_controller *hose = PCI_GET_PHB_PTR(bus); + struct pci_controller *hose = pci_bus_to_host(bus); return hose->global_number; #endif @@ -369,7 +304,7 @@ EXPORT_SYMBOL(pci_domain_nr); int pci_name_bus(char *name, struct pci_bus *bus) { #ifndef CONFIG_PPC_ISERIES - struct pci_controller *hose = PCI_GET_PHB_PTR(bus); + struct pci_controller *hose = pci_bus_to_host(bus); if (hose->buid) sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number); @@ -397,11 +332,11 @@ int pci_name_bus(char *name, struct pci_bus *bus) * * Returns negative error code on failure, zero on success. */ -static __inline__ int -__pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma, - enum pci_mmap_state mmap_state) +static __inline__ int __pci_mmap_make_offset(struct pci_dev *dev, + struct vm_area_struct *vma, + enum pci_mmap_state mmap_state) { - struct pci_controller *hose = PCI_GET_PHB_PTR(dev); + struct pci_controller *hose = pci_bus_to_host(dev->bus); unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; unsigned long io_offset = 0; int i, res_bit; @@ -454,9 +389,9 @@ __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma, * Set vm_flags of VMA, as appropriate for this architecture, for a pci device * mapping. */ -static __inline__ void -__pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, - enum pci_mmap_state mmap_state) +static __inline__ void __pci_mmap_set_flags(struct pci_dev *dev, + struct vm_area_struct *vma, + enum pci_mmap_state mmap_state) { vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; } @@ -465,9 +400,10 @@ __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci * device mapping. */ -static __inline__ void -__pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, - enum pci_mmap_state mmap_state, int write_combine) +static __inline__ void __pci_mmap_set_pgprot(struct pci_dev *dev, + struct vm_area_struct *vma, + enum pci_mmap_state mmap_state, + int write_combine) { long prot = pgprot_val(vma->vm_page_prot); @@ -501,7 +437,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, __pci_mmap_set_flags(dev, vma, mmap_state); __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); - ret = remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT, + ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot); return ret; @@ -534,9 +470,9 @@ void pcibios_add_platform_entries(struct pci_dev *pdev) #define ISA_SPACE_MASK 0x1 #define ISA_SPACE_IO 0x1 -static void pci_process_ISA_OF_ranges(struct device_node *isa_node, +static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, unsigned long phb_io_base_phys, - void * phb_io_base_virt) + void __iomem * phb_io_base_virt) { struct isa_range *range; unsigned long pci_addr; @@ -545,9 +481,11 @@ static void pci_process_ISA_OF_ranges(struct device_node *isa_node, int rlen = 0; range = (struct isa_range *) get_property(isa_node, "ranges", &rlen); - if (rlen < sizeof(struct isa_range)) { - printk(KERN_ERR "unexpected isa range size: %s\n", - __FUNCTION__); + if (range == NULL || (rlen < sizeof(struct isa_range))) { + printk(KERN_ERR "no ISA ranges or unexpected isa range size," + "mapping 64k\n"); + __ioremap_explicit(phb_io_base_phys, (unsigned long)phb_io_base_virt, + 0x10000, _PAGE_NO_CACHE); return; } @@ -579,8 +517,8 @@ static void pci_process_ISA_OF_ranges(struct device_node *isa_node, } } -void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, - struct device_node *dev, int primary) +void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, + struct device_node *dev) { unsigned int *ranges; unsigned long size; @@ -589,7 +527,6 @@ void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, struct resource *res; int np, na = prom_n_addr_cells(dev); unsigned long pci_addr, cpu_phys_addr; - struct device_node *isa_dn; np = na + 5; @@ -613,35 +550,18 @@ void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, cpu_phys_addr = cpu_phys_addr << 32 | ranges[4]; size = (unsigned long)ranges[na+3] << 32 | ranges[na+4]; - - switch (ranges[0] >> 24) { + if (size == 0) + continue; + switch ((ranges[0] >> 24) & 0x3) { case 1: /* I/O space */ hose->io_base_phys = cpu_phys_addr; - hose->io_base_virt = reserve_phb_iospace(size); - PPCDBG(PPCDBG_PHBINIT, - "phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", - hose->global_number, hose->io_base_phys, - (unsigned long) hose->io_base_virt); - - if (primary) { - pci_io_base = (unsigned long)hose->io_base_virt; - isa_dn = of_find_node_by_type(NULL, "isa"); - if (isa_dn) { - isa_io_base = pci_io_base; - pci_process_ISA_OF_ranges(isa_dn, - hose->io_base_phys, - hose->io_base_virt); - of_node_put(isa_dn); - /* Allow all IO */ - io_page_mask = -1; - } - } + hose->pci_io_size = size; res = &hose->io_resource; res->flags = IORESOURCE_IO; res->start = pci_addr; - res->start += (unsigned long)hose->io_base_virt - - pci_io_base; + DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number, + res->start, res->start + size - 1); break; case 2: /* memory space */ memno = 0; @@ -654,6 +574,8 @@ void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, res = &hose->mem_resources[memno]; res->flags = IORESOURCE_MEM; res->start = cpu_phys_addr; + DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number, + res->start, res->start + size - 1); } break; } @@ -668,23 +590,142 @@ void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, } } -/*********************************************************************** - * pci_find_hose_for_OF_device - * - * This function finds the PHB that matching device_node in the - * OpenFirmware by scanning all the pci_controllers. - * - ***********************************************************************/ -struct pci_controller* pci_find_hose_for_OF_device(struct device_node *node) +void __init pci_setup_phb_io(struct pci_controller *hose, int primary) +{ + unsigned long size = hose->pci_io_size; + unsigned long io_virt_offset; + struct resource *res; + struct device_node *isa_dn; + + hose->io_base_virt = reserve_phb_iospace(size); + DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", + hose->global_number, hose->io_base_phys, + (unsigned long) hose->io_base_virt); + + if (primary) { + pci_io_base = (unsigned long)hose->io_base_virt; + isa_dn = of_find_node_by_type(NULL, "isa"); + if (isa_dn) { + isa_io_base = pci_io_base; + pci_process_ISA_OF_ranges(isa_dn, hose->io_base_phys, + hose->io_base_virt); + of_node_put(isa_dn); + /* Allow all IO */ + io_page_mask = -1; + } + } + + io_virt_offset = (unsigned long)hose->io_base_virt - pci_io_base; + res = &hose->io_resource; + res->start += io_virt_offset; + res->end += io_virt_offset; +} + +void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose) +{ + unsigned long size = hose->pci_io_size; + unsigned long io_virt_offset; + struct resource *res; + + hose->io_base_virt = __ioremap(hose->io_base_phys, size, + _PAGE_NO_CACHE); + DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", + hose->global_number, hose->io_base_phys, + (unsigned long) hose->io_base_virt); + + io_virt_offset = (unsigned long)hose->io_base_virt - pci_io_base; + res = &hose->io_resource; + res->start += io_virt_offset; + res->end += io_virt_offset; +} + + +static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys, + unsigned long *start_virt, unsigned long *size) { - while (node) { - struct pci_controller *hose, *tmp; - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) - if (hose->arch_data == node) - return hose; - node=node->parent; + struct pci_controller *hose = pci_bus_to_host(bus); + struct pci_bus_region region; + struct resource *res; + + if (bus->self) { + res = bus->resource[0]; + pcibios_resource_to_bus(bus->self, ®ion, res); + *start_phys = hose->io_base_phys + region.start; + *start_virt = (unsigned long) hose->io_base_virt + + region.start; + if (region.end > region.start) + *size = region.end - region.start + 1; + else { + printk("%s(): unexpected region 0x%lx->0x%lx\n", + __FUNCTION__, region.start, region.end); + return 1; + } + + } else { + /* Root Bus */ + res = &hose->io_resource; + *start_phys = hose->io_base_phys; + *start_virt = (unsigned long) hose->io_base_virt; + if (res->end > res->start) + *size = res->end - res->start + 1; + else { + printk("%s(): unexpected region 0x%lx->0x%lx\n", + __FUNCTION__, res->start, res->end); + return 1; + } } - return NULL; + + return 0; +} + +int unmap_bus_range(struct pci_bus *bus) +{ + unsigned long start_phys; + unsigned long start_virt; + unsigned long size; + + if (!bus) { + printk(KERN_ERR "%s() expected bus\n", __FUNCTION__); + return 1; + } + + if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) + return 1; + if (iounmap_explicit((void __iomem *) start_virt, size)) + return 1; + + return 0; +} +EXPORT_SYMBOL(unmap_bus_range); + +int remap_bus_range(struct pci_bus *bus) +{ + unsigned long start_phys; + unsigned long start_virt; + unsigned long size; + + if (!bus) { + printk(KERN_ERR "%s() expected bus\n", __FUNCTION__); + return 1; + } + + + if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) + return 1; + printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size); + if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE)) + return 1; + + return 0; +} +EXPORT_SYMBOL(remap_bus_range); + +void phbs_remap_io(void) +{ + struct pci_controller *hose, *tmp; + + list_for_each_entry_safe(hose, tmp, &hose_list, list_node) + remap_bus_range(hose->bus); } /* @@ -700,6 +741,9 @@ int pcibios_scan_all_fns(struct pci_bus *bus, int devfn) else busdn = bus->sysdata; /* must be a phb */ + if (busdn == NULL) + return 0; + /* * Check to see if there is any of the 8 functions are in the * device tree. If they are then we need to scan all the @@ -717,12 +761,13 @@ void __devinit pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus) { /* Update device resources. */ - struct pci_controller *hose = PCI_GET_PHB_PTR(bus); + struct pci_controller *hose = pci_bus_to_host(bus); int i; for (i = 0; i < PCI_NUM_RESOURCES; i++) { if (dev->resource[i].flags & IORESOURCE_IO) { - unsigned long offset = (unsigned long)hose->io_base_virt - pci_io_base; + unsigned long offset = (unsigned long)hose->io_base_virt + - pci_io_base; unsigned long start, end, mask; start = dev->resource[i].start += offset; @@ -752,10 +797,7 @@ EXPORT_SYMBOL(pcibios_fixup_device_resources); void __devinit pcibios_fixup_bus(struct pci_bus *bus) { - struct pci_controller *hose = PCI_GET_PHB_PTR(bus); - struct list_head *ln; - - /* XXX or bus->parent? */ + struct pci_controller *hose = pci_bus_to_host(bus); struct pci_dev *dev = bus->self; struct resource *res; int i; @@ -765,18 +807,13 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) hose->bus = bus; bus->resource[0] = res = &hose->io_resource; - if (!res->flags) - BUG(); /* No I/O resource for this PHB? */ - if (request_resource(&ioport_resource, res)) + if (res->flags && request_resource(&ioport_resource, res)) printk(KERN_ERR "Failed to request IO on " "PCI domain %d\n", pci_domain_nr(bus)); - for (i = 0; i < 3; ++i) { res = &hose->mem_resources[i]; - if (!res->flags && i == 0) - BUG(); /* No memory resource for this PHB? */ bus->resource[i+1] = res; if (res->flags && request_resource(&iomem_resource, res)) printk(KERN_ERR "Failed to request MEM on " @@ -791,56 +828,46 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) pcibios_fixup_device_resources(dev, bus); } - /* XXX Need to check why Alpha doesnt do this - Anton */ + ppc_md.iommu_bus_setup(bus); + + list_for_each_entry(dev, &bus->devices, bus_list) + ppc_md.iommu_dev_setup(dev); + if (!pci_probe_only) return; - for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { - struct pci_dev *dev = pci_dev_b(ln); + list_for_each_entry(dev, &bus->devices, bus_list) { if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) pcibios_fixup_device_resources(dev, bus); } } EXPORT_SYMBOL(pcibios_fixup_bus); -/****************************************************************** - * pci_read_irq_line - * - * Reads the Interrupt Pin to determine if interrupt is use by card. +/* + * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the * openfirmware and sets it in the pci_dev and pci_config line. - * - ******************************************************************/ + */ int pci_read_irq_line(struct pci_dev *pci_dev) { u8 intpin; struct device_node *node; pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin); - - if (intpin == 0) { - PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Interrupt used by device.\n", - pci_name(pci_dev)); - return 0; - } + if (intpin == 0) + return 0; node = pci_device_to_OF_node(pci_dev); - if (node == NULL) { - PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s Device Node not found.\n", - pci_name(pci_dev)); - return -1; - } - if (node->n_intrs == 0) { - PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Device OF interrupts defined.\n", - pci_name(pci_dev)); - return -1; - } + if (node == NULL) + return -1; + + if (node->n_intrs == 0) + return -1; + pci_dev->irq = node->intrs[0].line; pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq); - - PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s pci_dev->irq = 0x%02X\n", - pci_name(pci_dev), pci_dev->irq); + return 0; } EXPORT_SYMBOL(pci_read_irq_line); diff --git a/arch/ppc64/kernel/pci.h b/arch/ppc64/kernel/pci.h index 9e85ebd48..28517c140 100644 --- a/arch/ppc64/kernel/pci.h +++ b/arch/ppc64/kernel/pci.h @@ -14,33 +14,29 @@ extern unsigned long isa_io_base; -extern struct pci_controller* pci_alloc_pci_controller(enum phb_types controller_type); -extern struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node); +extern void pci_setup_pci_controller(struct pci_controller *hose); +extern void pci_setup_phb_io(struct pci_controller *hose, int primary); + +extern void pci_setup_phb_io_dynamic(struct pci_controller *hose); + extern struct list_head hose_list; extern int global_phb_number; -/******************************************************************* - * Platform functions that are brand specific implementation. - *******************************************************************/ extern unsigned long find_and_init_phbs(void); extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */ -/******************************************************************* - * PCI device_node operations - *******************************************************************/ +/* PCI device_node operations */ struct device_node; typedef void *(*traverse_func)(struct device_node *me, void *data); void *traverse_pci_devices(struct device_node *start, traverse_func pre, void *data); void pci_devs_phb_init(void); -void pci_fix_bus_sysdata(void); +void pci_devs_phb_init_dynamic(struct pci_controller *phb); struct device_node *fetch_dev_dn(struct pci_dev *dev); -#define PCI_GET_PHB_PTR(dev) (((struct device_node *)(dev)->sysdata)->phb) - /* PCI address cache management routines */ void pci_addr_cache_insert_device(struct pci_dev *dev); void pci_addr_cache_remove_device(struct pci_dev *dev); @@ -49,5 +45,8 @@ void pci_addr_cache_remove_device(struct pci_dev *dev); void init_pci_config_tokens (void); unsigned long get_phb_buid (struct device_node *); +extern unsigned long pci_probe_only; +extern unsigned long pci_assign_all_buses; +extern int pci_read_irq_line(struct pci_dev *pci_dev); #endif /* __PPC_KERNEL_PCI_H__ */ diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c index 2ef21d7da..280b744fe 100644 --- a/arch/ppc64/kernel/pci_dn.c +++ b/arch/ppc64/kernel/pci_dn.c @@ -21,20 +21,12 @@ */ #include #include -#include #include #include -#include #include -#include -#include #include -#include #include -#include -#include -#include #include "pci.h" @@ -42,33 +34,17 @@ * Traverse_func that inits the PCI fields of the device node. * NOTE: this *must* be done before read/write config to the device. */ -static void * __init update_dn_pci_info(struct device_node *dn, void *data) +static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) { struct pci_controller *phb = data; u32 *regs; - char *device_type = get_property(dn, "device_type", NULL); - char *model; dn->phb = phb; - if (device_type && (strcmp(device_type, "pci") == 0) && - (get_property(dn, "class-code", NULL) == 0)) { - /* special case for PHB's. Sigh. */ - regs = (u32 *)get_property(dn, "bus-range", NULL); - dn->busno = regs[0]; - - model = (char *)get_property(dn, "model", NULL); - - if (strstr(model, "U3")) - dn->devfn = -1; - else - dn->devfn = 0; /* assumption */ - } else { - regs = (u32 *)get_property(dn, "reg", NULL); - if (regs) { - /* First register entry is addr (00BBSS00) */ - dn->busno = (regs[0] >> 16) & 0xff; - dn->devfn = (regs[0] >> 8) & 0xff; - } + regs = (u32 *)get_property(dn, "reg", NULL); + if (regs) { + /* First register entry is addr (00BBSS00) */ + dn->busno = (regs[0] >> 16) & 0xff; + dn->devfn = (regs[0] >> 8) & 0xff; } return NULL; } @@ -97,20 +73,25 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, struct device_node *dn, *nextdn; void *ret; - if (pre && ((ret = pre(start, data)) != NULL)) - return ret; + /* We started with a phb, iterate all childs */ for (dn = start->child; dn; dn = nextdn) { + u32 *classp, class; + nextdn = NULL; - if (get_property(dn, "class-code", NULL)) { - if (pre && ((ret = pre(dn, data)) != NULL)) - return ret; - if (dn->child) - /* Depth first...do children */ - nextdn = dn->child; - else if (dn->sibling) - /* ok, try next sibling instead. */ - nextdn = dn->sibling; - } + classp = (u32 *)get_property(dn, "class-code", NULL); + class = classp ? *classp : 0; + + if (pre && ((ret = pre(dn, data)) != NULL)) + return ret; + + /* If we are a PCI bridge, go down */ + if (dn->child && ((class >> 8) == PCI_CLASS_BRIDGE_PCI || + (class >> 8) == PCI_CLASS_BRIDGE_CARDBUS)) + /* Depth first...do children */ + nextdn = dn->child; + else if (dn->sibling) + /* ok, try next sibling instead. */ + nextdn = dn->sibling; if (!nextdn) { /* Walk up to next valid sibling. */ do { @@ -124,21 +105,17 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, return NULL; } -/* - * Same as traverse_pci_devices except this does it for all phbs. - */ -static void *traverse_all_pci_devices(traverse_func pre) +void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) { - struct pci_controller *phb, *tmp; - void *ret; + struct device_node * dn = (struct device_node *) phb->arch_data; - list_for_each_entry_safe(phb, tmp, &hose_list, list_node) - if ((ret = traverse_pci_devices(phb->arch_data, pre, phb)) - != NULL) - return ret; - return NULL; -} + /* PHB nodes themselves must not match */ + dn->devfn = dn->busno = -1; + dn->phb = phb; + /* Update dn->phb ptrs for new phb and children devices */ + traverse_pci_devices(dn, update_dn_pci_info, phb); +} /* * Traversal func that looks for a value. @@ -148,6 +125,7 @@ static void *is_devfn_node(struct device_node *dn, void *data) { int busno = ((unsigned long)data >> 8) & 0xff; int devfn = ((unsigned long)data) & 0xff; + return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL; } @@ -174,10 +152,8 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev) phb_dn = phb->arch_data; dn = traverse_pci_devices(phb_dn, is_devfn_node, (void *)searchval); - if (dn) { + if (dn) dev->sysdata = dn; - /* ToDo: call some device init hook here */ - } return dn; } EXPORT_SYMBOL(fetch_dev_dn); @@ -189,34 +165,9 @@ EXPORT_SYMBOL(fetch_dev_dn); */ void __init pci_devs_phb_init(void) { - /* This must be done first so the device nodes have valid pci info! */ - traverse_all_pci_devices(update_dn_pci_info); -} - - -static void __init pci_fixup_bus_sysdata_list(struct list_head *bus_list) -{ - struct list_head *ln; - struct pci_bus *bus; - - for (ln = bus_list->next; ln != bus_list; ln = ln->next) { - bus = pci_bus_b(ln); - if (bus->self) - bus->sysdata = bus->self->sysdata; - pci_fixup_bus_sysdata_list(&bus->children); - } -} + struct pci_controller *phb, *tmp; -/* - * Fixup the bus->sysdata ptrs to point to the bus' device_node. - * This is done late in pcibios_init(). We do this mostly for - * sanity, but pci_dma.c uses these at DMA time so they must be - * correct. - * To do this we recurse down the bus hierarchy. Note that PHB's - * have bus->self == NULL, but fortunately bus->sysdata is already - * correct in this case. - */ -void __init pci_fix_bus_sysdata(void) -{ - pci_fixup_bus_sysdata_list(&pci_root_buses); + /* This must be done first so the device nodes have valid pci info! */ + list_for_each_entry_safe(phb, tmp, &hose_list, list_node) + pci_devs_phb_init_dynamic(phb); } diff --git a/arch/ppc64/kernel/pci_iommu.c b/arch/ppc64/kernel/pci_iommu.c index 951831f99..dd5ad02d7 100644 --- a/arch/ppc64/kernel/pci_iommu.c +++ b/arch/ppc64/kernel/pci_iommu.c @@ -43,6 +43,13 @@ #include #endif /* CONFIG_PPC_ISERIES */ +/* + * We can use ->sysdata directly and avoid the extra work in + * pci_device_to_OF_node since ->sysdata will have been initialised + * in the iommu init code for all devices. + */ +#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata)) + static inline struct iommu_table *devnode_table(struct pci_dev *dev) { if (!dev) diff --git a/arch/ppc64/kernel/pmac.h b/arch/ppc64/kernel/pmac.h index 4d69b3abc..40e1c5030 100644 --- a/arch/ppc64/kernel/pmac.h +++ b/arch/ppc64/kernel/pmac.h @@ -18,7 +18,6 @@ extern void pmac_calibrate_decr(void); extern void pmac_pcibios_fixup(void); extern void pmac_pci_init(void); extern void pmac_setup_pci_dma(void); -extern void fixup_k2_sata(struct pci_dev* dev); extern void pmac_check_ht_link(void); extern void pmac_setup_smp(void); diff --git a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c index c45ecbdb2..56686fc9d 100644 --- a/arch/ppc64/kernel/pmac_feature.c +++ b/arch/ppc64/kernel/pmac_feature.c @@ -53,7 +53,7 @@ * We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -static spinlock_t feature_lock __pmacdata = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(feature_lock __pmacdata); #define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); @@ -111,7 +111,7 @@ static u32* uninorth_base __pmacdata; static u32 uninorth_rev __pmacdata; static void *u3_ht; -extern struct pci_dev *k2_skiplist[2]; +extern struct device_node *k2_skiplist[2]; /* * For each motherboard family, we have a table of functions pointers @@ -160,30 +160,17 @@ static long __pmac g5_gmac_enable(struct device_node* node, long param, long val { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; - struct pci_dev *pdev = NULL; if (node == NULL) return -ENODEV; - /* XXX FIXME: We should fix pci_device_from_OF_node here, and - * get to a real pci_dev or we'll get into trouble with PCI - * domains the day we get overlapping numbers (like if we ever - * decide to show the HT root. - * Note that we only get the slot when value is 0. This is called - * early during boot with value 1 to enable all devices, at which - * point, we don't yet have probed pci_find_slot, so it would fail - * to look for the slot at this point. - */ - if (!value) - pdev = pci_find_slot(node->busno, node->devfn); - LOCK(flags); if (value) { MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE); mb(); k2_skiplist[0] = NULL; } else { - k2_skiplist[0] = pdev; + k2_skiplist[0] = node; mb(); MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE); } @@ -198,30 +185,17 @@ static long __pmac g5_fw_enable(struct device_node* node, long param, long value { struct macio_chip* macio = &macio_chips[0]; unsigned long flags; - struct pci_dev *pdev = NULL; - - /* XXX FIXME: We should fix pci_device_from_OF_node here, and - * get to a real pci_dev or we'll get into trouble with PCI - * domains the day we get overlapping numbers (like if we ever - * decide to show the HT root - * Note that we only get the slot when value is 0. This is called - * early during boot with value 1 to enable all devices, at which - * point, we don't yet have probed pci_find_slot, so it would fail - * to look for the slot at this point. - */ + if (node == NULL) return -ENODEV; - if (!value) - pdev = pci_find_slot(node->busno, node->devfn); - LOCK(flags); if (value) { MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE); mb(); k2_skiplist[1] = NULL; } else { - k2_skiplist[1] = pdev; + k2_skiplist[1] = node; mb(); MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE); } diff --git a/arch/ppc64/kernel/pmac_low_i2c.c b/arch/ppc64/kernel/pmac_low_i2c.c index 52da75719..f3f39e8e3 100644 --- a/arch/ppc64/kernel/pmac_low_i2c.c +++ b/arch/ppc64/kernel/pmac_low_i2c.c @@ -16,9 +16,10 @@ * properties parser */ +#undef DEBUG + #include #include -#include #include #include #include @@ -33,12 +34,12 @@ #define MAX_LOW_I2C_HOST 4 -#if 1 +#ifdef DEBUG #define DBG(x...) do {\ printk(KERN_DEBUG "KW:" x); \ } while(0) #else -#define DBGG(x...) +#define DBG(x...) #endif struct low_i2c_host; @@ -50,11 +51,11 @@ struct low_i2c_host struct device_node *np; /* OF device node */ struct semaphore mutex; /* Access mutex for use by i2c-keywest */ low_i2c_func_t func; /* Access function */ - unsigned is_open : 1; /* Poor man's access control */ + unsigned int is_open : 1; /* Poor man's access control */ int mode; /* Current mode */ int channel; /* Current channel */ int num_channels; /* Number of channels */ - unsigned long base; /* For keywest-i2c, base address */ + void __iomem *base; /* For keywest-i2c, base address */ int bsteps; /* And register stepping */ int speed; /* And speed */ }; @@ -154,14 +155,12 @@ static const char *__kw_state_names[] = { static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg) { - return in_8(((volatile u8 *)host->base) - + (((unsigned)reg) << host->bsteps)); + return readb(host->base + (((unsigned int)reg) << host->bsteps)); } static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val) { - out_8(((volatile u8 *)host->base) - + (((unsigned)reg) << host->bsteps), val); + writeb(val, host->base + (((unsigned)reg) << host->bsteps)); (void)__kw_read_reg(host, reg_subaddr); } @@ -174,14 +173,19 @@ static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val) */ static u8 kw_wait_interrupt(struct low_i2c_host* host) { - int i; + int i, j; u8 isr; - for (i = 0; i < 200000; i++) { + for (i = 0; i < 100000; i++) { isr = kw_read_reg(reg_isr) & KW_I2C_IRQ_MASK; if (isr != 0) return isr; - udelay(1); + + /* This code is used with the timebase frozen, we cannot rely + * on udelay ! For now, just use a bogus loop + */ + for (j = 1; j < 10000; j++) + mb(); } return isr; } @@ -190,6 +194,8 @@ static int kw_handle_interrupt(struct low_i2c_host *host, int state, int rw, int { u8 ack; + DBG("kw_handle_interrupt(%s, isr: %x)\n", __kw_state_names[state], isr); + if (isr == 0) { if (state != state_stop) { DBG("KW: Timeout !\n"); @@ -301,11 +307,9 @@ static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, break; case pmac_low_i2c_mode_stdsub: mode_reg |= KW_I2C_MODE_STANDARDSUB; - kw_write_reg(reg_subaddr, subaddr); break; case pmac_low_i2c_mode_combined: mode_reg |= KW_I2C_MODE_COMBINED; - kw_write_reg(reg_subaddr, subaddr); break; } @@ -317,6 +321,11 @@ static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, /* Set up address and r/w bit */ kw_write_reg(reg_addr, addr); + /* Set up the sub address */ + if ((mode_reg & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB + || (mode_reg & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_COMBINED) + kw_write_reg(reg_subaddr, subaddr); + /* Start sending address & disable interrupt*/ kw_write_reg(reg_ier, 0 /*KW_I2C_IRQ_MASK*/); kw_write_reg(reg_control, KW_I2C_CTL_XADDR); @@ -333,7 +342,7 @@ static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, static void keywest_low_i2c_add(struct device_node *np) { struct low_i2c_host *host = find_low_i2c_host(NULL); - unsigned long *psteps, *prate, steps, aoffset = 0; + u32 *psteps, *prate, steps, aoffset = 0; struct device_node *parent; if (host == NULL) { @@ -345,7 +354,7 @@ static void keywest_low_i2c_add(struct device_node *np) init_MUTEX(&host->mutex); host->np = of_node_get(np); - psteps = (unsigned long *)get_property(np, "AAPL,address-step", NULL); + psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); steps = psteps ? (*psteps) : 0x10; for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) steps >>= 1; @@ -357,7 +366,7 @@ static void keywest_low_i2c_add(struct device_node *np) } /* Select interface rate */ host->speed = KW_I2C_MODE_100KHZ; - prate = (unsigned long *)get_property(np, "AAPL,i2c-rate", NULL); + prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); if (prate) switch(*prate) { case 100: host->speed = KW_I2C_MODE_100KHZ; @@ -369,8 +378,9 @@ static void keywest_low_i2c_add(struct device_node *np) host->speed = KW_I2C_MODE_25KHZ; break; } + host->mode = pmac_low_i2c_mode_std; - host->base = (unsigned long)ioremap(np->addrs[0].address + aoffset, + host->base = ioremap(np->addrs[0].address + aoffset, np->addrs[0].size); host->func = keywest_low_i2c_func; } diff --git a/arch/ppc64/kernel/pmac_nvram.c b/arch/ppc64/kernel/pmac_nvram.c index 5ab6cd401..e32a90223 100644 --- a/arch/ppc64/kernel/pmac_nvram.c +++ b/arch/ppc64/kernel/pmac_nvram.c @@ -75,7 +75,7 @@ struct core99_header { static volatile unsigned char *nvram_data; static int core99_bank = 0; // XXX Turn that into a sem -static spinlock_t nv_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(nv_lock); extern int system_running; diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c index 9e1a06955..a0df4e8c0 100644 --- a/arch/ppc64/kernel/pmac_pci.c +++ b/arch/ppc64/kernel/pmac_pci.c @@ -39,15 +39,11 @@ #define DBG(x...) #endif -extern int pci_probe_only; -extern int pci_read_irq_line(struct pci_dev *pci_dev); - /* XXX Could be per-controller, but I don't think we risk anything by * assuming we won't have both UniNorth and Bandit */ static int has_uninorth; static struct pci_controller *u3_agp; -u8 pci_cache_line_size; -struct pci_dev *k2_skiplist[2]; +struct device_node *k2_skiplist[2]; static int __init fixup_one_level_bus_range(struct device_node *node, int higher) { @@ -150,16 +146,9 @@ static int __pmac macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose; - struct device_node *busdn; unsigned long addr; - if (bus->self) - busdn = pci_device_to_OF_node(bus->self); - else - busdn = bus->sysdata; /* must be a phb */ - if (busdn == NULL) - return PCIBIOS_DEVICE_NOT_FOUND; - hose = busdn->phb; + hose = pci_bus_to_host(bus); if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; @@ -188,16 +177,9 @@ static int __pmac macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose; - struct device_node *busdn; unsigned long addr; - if (bus->self) - busdn = pci_device_to_OF_node(bus->self); - else - busdn = bus->sysdata; /* must be a phb */ - if (busdn == NULL) - return PCIBIOS_DEVICE_NOT_FOUND; - hose = busdn->phb; + hose = pci_bus_to_host(bus); if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; @@ -236,14 +218,43 @@ static struct pci_ops macrisc_pci_ops = * implement self-view of the HT host yet */ -static int skip_k2_device(struct pci_bus *bus, unsigned int devfn) +/* + * This function deals with some "special cases" devices. + * + * 0 -> No special case + * 1 -> Skip the device but act as if the access was successfull + * (return 0xff's on reads, eventually, cache config space + * accesses in a later version) + * -1 -> Hide the device (unsuccessful acess) + */ +static int u3_ht_skip_device(struct pci_controller *hose, + struct pci_bus *bus, unsigned int devfn) { + struct device_node *busdn, *dn; int i; + /* We only allow config cycles to devices that are in OF device-tree + * as we are apparently having some weird things going on with some + * revs of K2 on recent G5s + */ + if (bus->self) + busdn = pci_device_to_OF_node(bus->self); + else + busdn = hose->arch_data; + for (dn = busdn->child; dn; dn = dn->sibling) + if (dn->devfn == devfn) + break; + if (dn == NULL) + return -1; + + /* + * When a device in K2 is powered down, we die on config + * cycle accesses. Fix that here. + */ for (i=0; i<2; i++) - if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && - k2_skiplist[i]->devfn == devfn) + if (k2_skiplist[i] == dn) return 1; + return 0; } @@ -259,8 +270,7 @@ static unsigned long __pmac u3_ht_cfg_access(struct pci_controller* hose, { if (bus == hose->first_busno) { /* For now, we don't self probe U3 HT bridge */ - if (PCI_FUNC(devfn) != 0 || PCI_SLOT(devfn) > 7 || - PCI_SLOT(devfn) < 1) + if (PCI_SLOT(devfn) == 0) return 0; return ((unsigned long)hose->cfg_data) + U3_HT_CFA0(devfn, offset); } else @@ -271,39 +281,21 @@ static int __pmac u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { struct pci_controller *hose; - struct device_node *busdn, *dn; unsigned long addr; - if (bus->self) - busdn = pci_device_to_OF_node(bus->self); - else - busdn = bus->sysdata; /* must be a phb */ - if (busdn == NULL) - return PCIBIOS_DEVICE_NOT_FOUND; - hose = busdn->phb; - if (hose == NULL) - return PCIBIOS_DEVICE_NOT_FOUND; - /* We only allow config cycles to devices that are in OF device-tree - * as we are apparently having some weird things going on with some - * revs of K2 on recent G5s - */ - for (dn = busdn->child; dn; dn = dn->sibling) - if (dn->devfn == devfn) - break; - if (dn == NULL) + hose = pci_bus_to_host(bus); + if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; addr = u3_ht_cfg_access(hose, bus->number, devfn, offset); if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; - /* - * When a device in K2 is powered down, we die on config - * cycle accesses. Fix that here. We may ultimately want - * to cache the config space for those instead of returning - * 0xffffffff's to make life easier to HW detection tools - */ - if (skip_k2_device(bus, devfn)) { + + switch (u3_ht_skip_device(hose, bus, devfn)) { + case 0: + break; + case 1: switch (len) { case 1: *val = 0xff; break; @@ -313,6 +305,8 @@ static int __pmac u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, *val = 0xfffffffful; break; } return PCIBIOS_SUCCESSFUL; + default: + return PCIBIOS_DEVICE_NOT_FOUND; } /* @@ -337,28 +331,24 @@ static int __pmac u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { struct pci_controller *hose; - struct device_node *busdn; unsigned long addr; - if (bus->self) - busdn = pci_device_to_OF_node(bus->self); - else - busdn = bus->sysdata; /* must be a phb */ - if (busdn == NULL) - return PCIBIOS_DEVICE_NOT_FOUND; - hose = busdn->phb; + hose = pci_bus_to_host(bus); if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; addr = u3_ht_cfg_access(hose, bus->number, devfn, offset); if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; - /* - * When a device in K2 is powered down, we die on config - * cycle accesses. Fix that here. - */ - if (skip_k2_device(bus, devfn)) + + switch (u3_ht_skip_device(hose, bus, devfn)) { + case 0: + break; + case 1: return PCIBIOS_SUCCESSFUL; + default: + return PCIBIOS_DEVICE_NOT_FOUND; + } /* * Note: the caller has already checked that offset is @@ -513,7 +503,7 @@ static void __init pmac_process_bridge_OF_ranges(struct pci_controller *hose, dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen); if (!dt_ranges) return; - /* lc_ranges = (unsigned int *) alloc_bootmem(rlen);*/ + /* lc_ranges = alloc_bootmem(rlen);*/ lc_ranges = static_lc_ranges; if (!lc_ranges) return; /* what can we do here ? */ @@ -623,15 +613,17 @@ static int __init add_bridge(struct device_node *dev) dev->full_name); } - hose = pci_alloc_pci_controller(phb_type_apple); - if (!hose) - return -ENOMEM; + hose = alloc_bootmem(sizeof(struct pci_controller)); + if (hose == NULL) + return -ENOMEM; + pci_setup_pci_controller(hose); + hose->arch_data = dev; hose->first_busno = bus_range ? bus_range[0] : 0; hose->last_busno = bus_range ? bus_range[1] : 0xff; - of_prop = (struct property *)alloc_bootmem(sizeof(struct property) + - sizeof(hose->global_number)); + of_prop = alloc_bootmem(sizeof(struct property) + + sizeof(hose->global_number)); if (of_prop) { memset(of_prop, 0, sizeof(struct property)); of_prop->name = "linux,pci-domain"; @@ -669,13 +661,8 @@ void __init pmac_pcibios_fixup(void) { struct pci_dev *dev = NULL; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) + for_each_pci_dev(dev) pci_read_irq_line(dev); - - pci_fix_bus_sysdata(); - - iommu_setup_u3(); - } static void __init pmac_fixup_phb_resources(void) @@ -747,14 +734,9 @@ void __init pmac_pci_init(void) pmac_check_ht_link(); - /* Tell pci.c to use the common resource allocation mecanism */ - pci_probe_only = 0; + /* Tell pci.c to not use the common resource allocation mecanism */ + pci_probe_only = 1; - /* HT don't do more than 64 bytes transfers. FIXME: Deal with - * the exception of U3/AGP (hook into pci_set_mwi) - */ - pci_cache_line_size = 16; /* 64 bytes */ - /* Allow all IO */ io_page_mask = -1; } @@ -763,7 +745,7 @@ void __init pmac_pci_init(void) * Disable second function on K2-SATA, it's broken * and disable IO BARs on first one */ -void fixup_k2_sata(struct pci_dev* dev) +static void fixup_k2_sata(struct pci_dev* dev) { int i; u16 cmd; diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c index 3d1de0f9b..41fa6e95a 100644 --- a/arch/ppc64/kernel/pmac_setup.c +++ b/arch/ppc64/kernel/pmac_setup.c @@ -53,13 +53,12 @@ #include #include #include +#include #include #include #include #include -#include -#include #include #include #include @@ -73,6 +72,7 @@ #include #include "pmac.h" +#include "mpic.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -166,11 +166,6 @@ void __init pmac_setup_arch(void) pmac_setup_smp(); #endif - /* Setup the PCI DMA to "direct" by default. May be overriden - * by iommu later on - */ - pci_dma_init_direct(); - /* Lookup PCI hosts */ pmac_pci_init(); @@ -315,34 +310,16 @@ void __init pmac_init_early(void) } /* Setup interrupt mapping options */ - naca->interrupt_controller = IC_OPEN_PIC; + ppc64_interrupt_controller = IC_OPEN_PIC; + + iommu_init_early_u3(); DBG(" <- pmac_init_early\n"); } -extern void* OpenPIC_Addr; -extern void* OpenPIC2_Addr; -extern u_int OpenPIC_NumInitSenses; -extern u_char *OpenPIC_InitSenses; -extern void openpic_init(int main_pic, int offset, unsigned char* chrp_ack, - int programmer_switch_irq); -extern void openpic2_init(int offset); -extern int openpic_get_irq(struct pt_regs *regs); -extern int openpic2_get_irq(struct pt_regs *regs); - -static int pmac_cascade_irq = -1; - -static irqreturn_t pmac_u3_do_cascade(int cpl, void *dev_id, struct pt_regs *regs) +static int pmac_u3_cascade(struct pt_regs *regs, void *data) { - int irq; - - for (;;) { - irq = openpic2_get_irq(regs); - if (irq == -1) - break; - ppc_irq_dispatch_handler(regs, irq); - } - return IRQ_HANDLED; + return mpic_get_one_irq((struct mpic *)data, regs); } static __init void pmac_init_IRQ(void) @@ -350,6 +327,7 @@ static __init void pmac_init_IRQ(void) struct device_node *irqctrler = NULL; struct device_node *irqctrler2 = NULL; struct device_node *np = NULL; + struct mpic *mpic1, *mpic2; /* We first try to detect Apple's new Core99 chipset, since mac-io * is quite different on those machines and contains an IBM MPIC2. @@ -369,44 +347,37 @@ static __init void pmac_init_IRQ(void) (unsigned int)irqctrler->addrs[0].address); prom_get_irq_senses(senses, 0, 128); - OpenPIC_InitSenses = senses; - OpenPIC_NumInitSenses = 128; - OpenPIC_Addr = ioremap(irqctrler->addrs[0].address, - irqctrler->addrs[0].size); - openpic_init(1, 0, NULL, -1); + mpic1 = mpic_alloc(irqctrler->addrs[0].address, + MPIC_PRIMARY | MPIC_WANTS_RESET, + 0, 0, 128, 256, senses, 128, " K2-MPIC "); + BUG_ON(mpic1 == NULL); + mpic_init(mpic1); if (irqctrler2 != NULL && irqctrler2->n_intrs > 0 && irqctrler2->n_addrs > 0) { printk(KERN_INFO "Slave OpenPIC at 0x%08x hooked on IRQ %d\n", (u32)irqctrler2->addrs[0].address, irqctrler2->intrs[0].line); + pmac_call_feature(PMAC_FTR_ENABLE_MPIC, irqctrler2, 0, 0); - OpenPIC2_Addr = ioremap(irqctrler2->addrs[0].address, - irqctrler2->addrs[0].size); prom_get_irq_senses(senses, 128, 128 + 128); - OpenPIC_InitSenses = senses; - OpenPIC_NumInitSenses = 128; - openpic2_init(128); - pmac_cascade_irq = irqctrler2->intrs[0].line; + + /* We don't need to set MPIC_BROKEN_U3 here since we don't have + * hypertransport interrupts routed to it + */ + mpic2 = mpic_alloc(irqctrler2->addrs[0].address, + MPIC_BIG_ENDIAN | MPIC_WANTS_RESET, + 0, 128, 128, 0, senses, 128, " U3-MPIC "); + BUG_ON(mpic2 == NULL); + mpic_init(mpic2); + mpic_setup_cascade(irqctrler2->intrs[0].line, + pmac_u3_cascade, mpic2); } } of_node_put(irqctrler); of_node_put(irqctrler2); } -/* We cannot do request_irq too early ... Right now, we get the - * cascade as a core_initcall, which should be fine for our needs - */ -static int __init pmac_irq_cascade_init(void) -{ - if (request_irq(pmac_cascade_irq, pmac_u3_do_cascade, 0, - "U3->K2 Cascade", NULL)) - printk(KERN_ERR "Unable to get OpenPIC IRQ for cascade\n"); - return 0; -} - -core_initcall(pmac_irq_cascade_init); - static void __init pmac_progress(char *s, unsigned short hex) { if (sccdbg) { @@ -421,6 +392,15 @@ static void __init pmac_progress(char *s, unsigned short hex) #endif /* CONFIG_BOOTX_TEXT */ } +/* + * pmac has no legacy IO, anything calling this function has to + * fail or bad things will happen + */ +static int pmac_check_legacy_ioport(unsigned int baseport) +{ + return -ENODEV; +} + static int __init pmac_declare_of_platform_devices(void) { struct device_node *np; @@ -464,7 +444,7 @@ struct machdep_calls __initdata pmac_md = { .init_early = pmac_init_early, .get_cpuinfo = pmac_show_cpuinfo, .init_IRQ = pmac_init_IRQ, - .get_irq = openpic_get_irq, + .get_irq = mpic_get_irq, .pcibios_fixup = pmac_pcibios_fixup, .restart = pmac_restart, .power_off = pmac_power_off, @@ -475,4 +455,5 @@ struct machdep_calls __initdata pmac_md = { .calibrate_decr = pmac_calibrate_decr, .feature_call = pmac_do_feature_call, .progress = pmac_progress, + .check_legacy_ioport = pmac_check_legacy_ioport }; diff --git a/arch/ppc64/kernel/pmac_smp.c b/arch/ppc64/kernel/pmac_smp.c index fb6ab4014..e0b370799 100644 --- a/arch/ppc64/kernel/pmac_smp.c +++ b/arch/ppc64/kernel/pmac_smp.c @@ -21,6 +21,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#undef DEBUG + #include #include #include @@ -28,10 +31,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -47,42 +50,180 @@ #include #include #include +#include + +#include "mpic.h" -#include "open_pic.h" +#ifdef DEBUG +#define DBG(fmt...) udbg_printf(fmt) +#else +#define DBG(fmt...) +#endif extern void pmac_secondary_start_1(void); extern void pmac_secondary_start_2(void); extern void pmac_secondary_start_3(void); -extern void smp_openpic_message_pass(int target, int msg); - extern struct smp_ops_t *smp_ops; +static void (*pmac_tb_freeze)(int freeze); +static struct device_node *pmac_tb_clock_chip_host; +static DEFINE_SPINLOCK(timebase_lock); +static unsigned long timebase; + +static void smp_core99_cypress_tb_freeze(int freeze) +{ + u8 data; + int rc; + + /* Strangely, the device-tree says address is 0xd2, but darwin + * accesses 0xd0 ... + */ + pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined); + rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_low_i2c_read, + 0x81, &data, 1); + if (rc != 0) + goto bail; + + data = (data & 0xf3) | (freeze ? 0x00 : 0x0c); + + pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); + rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_low_i2c_write, + 0x81, &data, 1); + + bail: + if (rc != 0) { + printk("Cypress Timebase %s rc: %d\n", + freeze ? "freeze" : "unfreeze", rc); + panic("Timebase freeze failed !\n"); + } +} + +static void smp_core99_pulsar_tb_freeze(int freeze) +{ + u8 data; + int rc; + + /* Strangely, the device-tree says address is 0xd2, but darwin + * accesses 0xd0 ... + */ + pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined); + rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, + 0xd4 | pmac_low_i2c_read, + 0x2e, &data, 1); + if (rc != 0) + goto bail; + + data = (data & 0x88) | (freeze ? 0x11 : 0x22); + + pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); + rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, + 0xd4 | pmac_low_i2c_write, + 0x2e, &data, 1); + bail: + if (rc != 0) { + printk(KERN_ERR "Pulsar Timebase %s rc: %d\n", + freeze ? "freeze" : "unfreeze", rc); + panic("Timebase freeze failed !\n"); + } +} + + +static void smp_core99_give_timebase(void) +{ + /* Open i2c bus for synchronous access */ + if (pmac_low_i2c_open(pmac_tb_clock_chip_host, 0)) + panic("Can't open i2c for TB sync !\n"); + + spin_lock(&timebase_lock); + (*pmac_tb_freeze)(1); + mb(); + timebase = get_tb(); + spin_unlock(&timebase_lock); + + while (timebase) + barrier(); + + spin_lock(&timebase_lock); + (*pmac_tb_freeze)(0); + spin_unlock(&timebase_lock); + + /* Close i2c bus */ + pmac_low_i2c_close(pmac_tb_clock_chip_host); +} + + +static void __devinit smp_core99_take_timebase(void) +{ + while (!timebase) + barrier(); + spin_lock(&timebase_lock); + set_tb(timebase >> 32, timebase & 0xffffffff); + timebase = 0; + spin_unlock(&timebase_lock); +} + + static int __init smp_core99_probe(void) { - struct device_node *cpus; - int ncpus = 1; + struct device_node *cpus; + struct device_node *cc; + int ncpus = 0; /* Maybe use systemconfiguration here ? */ if (ppc_md.progress) ppc_md.progress("smp_core99_probe", 0x345); - cpus = find_type_devices("cpu"); - if (cpus == NULL) - return 0; - while ((cpus = cpus->next) != NULL) + /* Count CPUs in the device-tree */ + for (cpus = NULL; (cpus = of_find_node_by_type(cpus, "cpu")) != NULL;) ++ncpus; printk(KERN_INFO "PowerMac SMP probe found %d cpus\n", ncpus); - if (ncpus > 1) - openpic_request_IPIs(); + /* Nothing more to do if less than 2 of them */ + if (ncpus <= 1) + return 1; + + /* Look for the clock chip */ + for (cc = NULL; (cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL;) { + struct device_node *p = of_get_parent(cc); + u32 *reg; + int ok; + ok = p && device_is_compatible(p, "uni-n-i2c"); + if (!ok) + goto next; + reg = (u32 *)get_property(cc, "reg", NULL); + if (reg == NULL) + goto next; + switch (*reg) { + case 0xd2: + pmac_tb_freeze = smp_core99_cypress_tb_freeze; + printk(KERN_INFO "Timebase clock is Cypress chip\n"); + break; + case 0xd4: + pmac_tb_freeze = smp_core99_pulsar_tb_freeze; + printk(KERN_INFO "Timebase clock is Pulsar chip\n"); + break; + } + if (pmac_tb_freeze != NULL) { + pmac_tb_clock_chip_host = p; + smp_ops->give_timebase = smp_core99_give_timebase; + smp_ops->take_timebase = smp_core99_take_timebase; + break; + } + next: + of_node_put(p); + } + + mpic_request_ipis(); return ncpus; } static void __init smp_core99_kick_cpu(int nr) { - int save_vector; + int save_vector, j; unsigned long new_vector; unsigned long flags; volatile unsigned int *vector @@ -102,15 +243,16 @@ static void __init smp_core99_kick_cpu(int nr) * b .pmac_secondary_start - KERNELBASE */ switch(nr) { - case 1: - new_vector = (unsigned long)pmac_secondary_start_1; - break; - case 2: - new_vector = (unsigned long)pmac_secondary_start_2; - break; - case 3: - new_vector = (unsigned long)pmac_secondary_start_3; - break; + case 1: + new_vector = (unsigned long)pmac_secondary_start_1; + break; + case 2: + new_vector = (unsigned long)pmac_secondary_start_2; + break; + case 3: + default: + new_vector = (unsigned long)pmac_secondary_start_3; + break; } *vector = 0x48000002 + (new_vector - KERNELBASE); @@ -126,7 +268,8 @@ static void __init smp_core99_kick_cpu(int nr) * ideally, all that crap will be done in prom.c and the CPU left * in a RAM-based wait loop like CHRP. */ - mdelay(1); + for (j = 1; j < 1000000; j++) + mb(); /* Restore our exception vector */ *vector = save_vector; @@ -138,8 +281,8 @@ static void __init smp_core99_kick_cpu(int nr) static void __init smp_core99_setup_cpu(int cpu_nr) { - /* Setup openpic */ - do_openpic_setup_cpu(); + /* Setup MPIC */ + mpic_setup_this_cpu(); if (cpu_nr == 0) { extern void g5_phy_disable_cpu1(void); @@ -149,15 +292,12 @@ static void __init smp_core99_setup_cpu(int cpu_nr) */ if (num_online_cpus() < 2) g5_phy_disable_cpu1(); - if (ppc_md.progress) ppc_md.progress("core99_setup_cpu 0 done", 0x349); + if (ppc_md.progress) ppc_md.progress("smp_core99_setup_cpu 0 done", 0x349); } } -extern void smp_generic_give_timebase(void); -extern void smp_generic_take_timebase(void); - struct smp_ops_t core99_smp_ops __pmacdata = { - .message_pass = smp_openpic_message_pass, + .message_pass = smp_mpic_message_pass, .probe = smp_core99_probe, .kick_cpu = smp_core99_kick_cpu, .setup_cpu = smp_core99_setup_cpu, diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c index 3732fe048..38c0398d8 100644 --- a/arch/ppc64/kernel/ppc_ksyms.c +++ b/arch/ppc64/kernel/ppc_ksyms.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -67,11 +67,7 @@ EXPORT_SYMBOL(strncmp); EXPORT_SYMBOL(__down_interruptible); EXPORT_SYMBOL(__up); -EXPORT_SYMBOL(naca); EXPORT_SYMBOL(__down); -#ifdef CONFIG_PPC_ISERIES -EXPORT_SYMBOL(itLpNaca); -#endif EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(csum_partial_copy_generic); @@ -118,7 +114,6 @@ EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(start_thread); EXPORT_SYMBOL(kernel_thread); -EXPORT_SYMBOL(flush_instruction_cache); EXPORT_SYMBOL(giveup_fpu); #ifdef CONFIG_ALTIVEC EXPORT_SYMBOL(giveup_altivec); @@ -162,4 +157,3 @@ EXPORT_SYMBOL(console_drivers); EXPORT_SYMBOL(tb_ticks_per_usec); EXPORT_SYMBOL(paca); EXPORT_SYMBOL(cur_cpu_spec); -EXPORT_SYMBOL(systemcfg); diff --git a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c index ed172cd78..d3bd869fa 100644 --- a/arch/ppc64/kernel/proc_ppc64.c +++ b/arch/ppc64/kernel/proc_ppc64.c @@ -25,15 +25,14 @@ #include #include -#include -#include #include #include #include #include static loff_t page_map_seek( struct file *file, loff_t off, int whence); -static ssize_t page_map_read( struct file *file, char *buf, size_t nbytes, loff_t *ppos); +static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, + loff_t *ppos); static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); static struct file_operations page_map_fops = { @@ -56,26 +55,6 @@ static struct file_operations ofdt_fops = { }; #endif -/* - * NOTE: since paca data is always in flux the values will never be a - * consistant set. - */ -static void __init proc_create_paca(struct proc_dir_entry *dir, int num) -{ - struct proc_dir_entry *ent; - struct paca_struct *lpaca = paca + num; - char buf[16]; - - sprintf(buf, "%02x", num); - ent = create_proc_entry(buf, S_IRUSR, dir); - if (ent) { - ent->nlink = 1; - ent->data = lpaca; - ent->size = 4096; - ent->proc_fops = &page_map_fops; - } -} - /* * Create the ppc64 and ppc64/rtas directories early. This allows us to * assume that they have been previously created in drivers. @@ -103,17 +82,8 @@ core_initcall(proc_ppc64_create); static int __init proc_ppc64_init(void) { - unsigned long i; struct proc_dir_entry *pde; - pde = create_proc_entry("ppc64/naca", S_IRUSR, NULL); - if (!pde) - return 1; - pde->nlink = 1; - pde->data = naca; - pde->size = 4096; - pde->proc_fops = &page_map_fops; - pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); if (!pde) return 1; @@ -122,13 +92,6 @@ static int __init proc_ppc64_init(void) pde->size = 4096; pde->proc_fops = &page_map_fops; - /* /proc/ppc64/paca/XX -- raw paca contents. Only readable to root */ - pde = proc_mkdir("ppc64/paca", NULL); - if (!pde) - return 1; - for_each_cpu(i) - proc_create_paca(pde, i); - #ifdef CONFIG_PPC_PSERIES if ((systemcfg->platform & PLATFORM_PSERIES)) proc_ppc64_create_ofdt(); @@ -161,7 +124,8 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence) return (file->f_pos = new); } -static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) +static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, + loff_t *ppos) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); @@ -176,7 +140,8 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) if ((vma->vm_end - vma->vm_start) > dp->size) return -EINVAL; - remap_page_range( vma, vma->vm_start, __pa(dp->data), dp->size, vma->vm_page_prot ); + remap_pfn_range(vma, vma->vm_start, __pa(dp->data) >> PAGE_SHIFT, + dp->size, vma->vm_page_prot); return 0; } @@ -207,7 +172,8 @@ static void proc_ppc64_create_ofdt(void) * whole nodes along with their properties. Operations on individual * properties are not implemented (yet). */ -static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count, loff_t *off) +static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count, + loff_t *off) { int rv = 0; char *kbuf; @@ -301,7 +267,8 @@ out: return rv; } -static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last) +static struct property *new_property(const char *name, const int length, + const unsigned char *value, struct property *last) { struct property *new = kmalloc(sizeof(*new), GFP_KERNEL); @@ -342,7 +309,8 @@ cleanup: * this function does no allocation or copying of the data. Return value * is set to the next name in buf, or NULL on error. */ -static char * parse_next_property(char *buf, char *end, char **name, int *length, unsigned char **value) +static char * parse_next_property(char *buf, char *end, char **name, int *length, + unsigned char **value) { char *tmp; @@ -350,13 +318,15 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length tmp = strchr(buf, ' '); if (!tmp) { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } *tmp = '\0'; if (++tmp >= end) { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } @@ -364,11 +334,13 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length *length = -1; *length = simple_strtoul(tmp, &tmp, 10); if (*length == -1) { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } if (*tmp != ' ' || ++tmp >= end) { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } @@ -376,11 +348,13 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length *value = tmp; tmp += *length; if (tmp > end) { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } else if (tmp < end && *tmp != ' ' && *tmp != '\0') { - printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__); + printk(KERN_ERR "property parse failed in %s at line %d\n", + __FUNCTION__, __LINE__); return NULL; } tmp++; diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c index 821133707..d1c152db9 100644 --- a/arch/ppc64/kernel/process.c +++ b/arch/ppc64/kernel/process.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -214,23 +214,57 @@ struct task_struct *__switch_to(struct task_struct *prev, return last; } +static int instructions_to_print = 16; + +static void show_instructions(struct pt_regs *regs) +{ + int i; + unsigned long pc = regs->nip - (instructions_to_print * 3 / 4 * + sizeof(int)); + + printk("Instruction dump:"); + + for (i = 0; i < instructions_to_print; i++) { + int instr; + + if (!(i % 8)) + printk("\n"); + + if (((REGION_ID(pc) != KERNEL_REGION_ID) && + (REGION_ID(pc) != VMALLOC_REGION_ID)) || + __get_user(instr, (unsigned int *)pc)) { + printk("XXXXXXXX "); + } else { + if (regs->nip == pc) + printk("<%08x> ", instr); + else + printk("%08x ", instr); + } + + pc += sizeof(int); + } + + printk("\n"); +} + void show_regs(struct pt_regs * regs) { int i; unsigned long trap; - printk("NIP: %016lX XER: %016lX LR: %016lX\n", - regs->nip, regs->xer, regs->link); + printk("NIP: %016lX XER: %08X LR: %016lX CTR: %016lX\n", + regs->nip, (unsigned int)regs->xer, regs->link, regs->ctr); printk("REGS: %p TRAP: %04lx %s (%s)\n", - regs, regs->trap, print_tainted(), UTS_RELEASE); - printk("MSR: %016lx EE: %01x PR: %01x FP: %01x ME: %01x IR/DR: %01x%01x\n", + regs, regs->trap, print_tainted(), system_utsname.release); + printk("MSR: %016lx EE: %01x PR: %01x FP: %01x ME: %01x " + "IR/DR: %01x%01x CR: %08X\n", regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0, regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0, regs->msr&MSR_IR ? 1 : 0, - regs->msr&MSR_DR ? 1 : 0); + regs->msr&MSR_DR ? 1 : 0, + (unsigned int)regs->ccr); trap = TRAP(regs); - if (trap == 0x300 || trap == 0x380 || trap == 0x600) - printk("DAR: %016lx, DSISR: %016lx\n", regs->dar, regs->dsisr); + printk("DAR: %016lx DSISR: %016lx\n", regs->dar, regs->dsisr); printk("TASK: %p[%d] '%s' THREAD: %p", current, current->pid, current->comm, current->thread_info); @@ -257,6 +291,8 @@ void show_regs(struct pt_regs * regs) printk("LR [%016lx] ", regs->link); print_symbol("%s\n", regs->link); show_stack(current, (unsigned long *)regs->gpr[1]); + if (!user_mode(regs)) + show_instructions(regs); } void exit_thread(void) @@ -315,8 +351,6 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp, extern void ret_from_fork(void); unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE; - p->set_child_tid = p->clear_child_tid = NULL; - /* Copy registers */ sp -= sizeof(struct pt_regs); childregs = (struct pt_regs *) sp; @@ -512,8 +546,11 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, error = do_execve(filename, (char __user * __user *) a1, (char __user * __user *) a2, regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index f121ffbc2..eed1a707d 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -43,8 +44,6 @@ #include #include #include -#include -#include #include #include #include @@ -52,7 +51,6 @@ #include #include #include -#include "open_pic.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -97,7 +95,7 @@ static struct device_node *allnodes = NULL; /* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node. */ -static rwlock_t devtree_lock = RW_LOCK_UNLOCKED; +static DEFINE_RWLOCK(devtree_lock); /* export that to outside world */ struct device_node *of_chosen; @@ -442,7 +440,7 @@ static unsigned long __init interpret_isa_props(struct device_node *np, if (rp != 0 && l >= sizeof(struct isa_reg_property)) { i = 0; adr = (struct address_range *) mem_start; - while ((l -= sizeof(struct reg_property)) >= 0) { + while ((l -= sizeof(struct isa_reg_property)) >= 0) { if (!measure_only) { adr[i].space = rp[i].space; adr[i].address = rp[i].address; @@ -558,7 +556,7 @@ void __init finish_device_tree(void) DBG(" -> finish_device_tree\n"); - if (naca->interrupt_controller == IC_INVALID) { + if (ppc64_interrupt_controller == IC_INVALID) { DBG("failed to configure interrupt controller type\n"); panic("failed to configure interrupt controller type\n"); } @@ -719,6 +717,7 @@ static unsigned long __init unflatten_dt_node(unsigned long mem, dad->next->sibling = np; dad->next = np; } + kref_init(&np->kref); } while(1) { u32 sz, noff; @@ -824,7 +823,7 @@ void __init unflatten_device_tree(void) strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE)); } #ifdef CONFIG_CMDLINE - if (l == 0) /* dbl check */ + if (l == 0 || (l == 1 && (*p) == 0)) strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); #endif /* CONFIG_CMDLINE */ @@ -845,19 +844,28 @@ static int __init early_init_dt_scan_cpus(unsigned long node, /* On LPAR, look for the first ibm,pft-size property for the hash table size */ - if (systemcfg->platform == PLATFORM_PSERIES_LPAR && naca->pftSize == 0) { + if (systemcfg->platform == PLATFORM_PSERIES_LPAR && ppc64_pft_size == 0) { u32 *pft_size; pft_size = (u32 *)get_flat_dt_prop(node, "ibm,pft-size", NULL); if (pft_size != NULL) { /* pft_size[0] is the NUMA CEC cookie */ - naca->pftSize = pft_size[1]; + ppc64_pft_size = pft_size[1]; } } - /* Check if it's the boot-cpu, set it's hw index in paca now */ - if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) { - u32 *prop = get_flat_dt_prop(node, "reg", NULL); - paca[0].hw_cpu_id = prop == NULL ? 0 : *prop; + if (initial_boot_params && initial_boot_params->version >= 2) { + /* version 2 of the kexec param format adds the phys cpuid + * of booted proc. + */ + boot_cpuid_phys = initial_boot_params->boot_cpuid_phys; + boot_cpuid = 0; + } else { + /* Check if it's the boot-cpu, set it's hw index in paca now */ + if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) { + u32 *prop = get_flat_dt_prop(node, "reg", NULL); + set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop); + boot_cpuid_phys = get_hard_smp_processor_id(0); + } } return 0; @@ -1010,7 +1018,7 @@ void __init early_init_devtree(void *params) initial_boot_params = params; /* By default, hash size is not set */ - naca->pftSize = 0; + ppc64_pft_size = 0; /* Retreive various informations from the /chosen node of the * device-tree, including the platform type, initrd location and @@ -1024,6 +1032,7 @@ void __init early_init_devtree(void *params) scan_flat_dt(early_init_dt_scan_memory, NULL); lmb_analyze(); systemcfg->physicalMemorySize = lmb_phys_mem_size(); + lmb_reserve(0, __pa(klimit)); DBG("Phys. mem: %lx\n", systemcfg->physicalMemorySize); @@ -1038,7 +1047,7 @@ void __init early_init_devtree(void *params) /* If hash size wasn't obtained above, we calculate it now based on * the total RAM size */ - if (naca->pftSize == 0) { + if (ppc64_pft_size == 0) { unsigned long rnd_mem_size, pteg_count; /* round mem_size up to next power of 2 */ @@ -1047,12 +1056,12 @@ void __init early_init_devtree(void *params) rnd_mem_size <<= 1; /* # pages / 2 */ - pteg_count = (rnd_mem_size >> (12 + 1)); + pteg_count = max(rnd_mem_size >> (12 + 1), 1UL << 11); - naca->pftSize = __ilog2(pteg_count << 7); + ppc64_pft_size = __ilog2(pteg_count << 7); } - DBG("Hash pftSize: %x\n", (int)naca->pftSize); + DBG("Hash pftSize: %x\n", (int)ppc64_pft_size); DBG(" <- early_init_devtree()\n"); } @@ -1092,8 +1101,7 @@ prom_n_size_cells(struct device_node* np) * Work out the sense (active-low level / active-high edge) * of each interrupt from the device tree. */ -void __init -prom_get_irq_senses(unsigned char *senses, int off, int max) +void __init prom_get_irq_senses(unsigned char *senses, int off, int max) { struct device_node *np; int i, j; @@ -1105,7 +1113,9 @@ prom_get_irq_senses(unsigned char *senses, int off, int max) for (j = 0; j < np->n_intrs; j++) { i = np->intrs[j].line; if (i >= off && i < max) - senses[i-off] = np->intrs[j].sense; + senses[i-off] = np->intrs[j].sense ? + IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE : + IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE; } } } @@ -1466,24 +1476,31 @@ EXPORT_SYMBOL(of_get_next_child); * @node: Node to inc refcount, NULL is supported to * simplify writing of callers * - * Returns the node itself or NULL if gone. + * Returns node. */ struct device_node *of_node_get(struct device_node *node) { - if (node && !OF_IS_STALE(node)) { - atomic_inc(&node->_users); - return node; - } - return NULL; + if (node) + kref_get(&node->kref); + return node; } EXPORT_SYMBOL(of_node_get); +static inline struct device_node * kref_to_device_node(struct kref *kref) +{ + return container_of(kref, struct device_node, kref); +} + /** - * of_node_cleanup - release a dynamically allocated node - * @arg: Node to be released + * of_node_release - release a dynamically allocated node + * @kref: kref element of the node to be released + * + * In of_node_put() this function is passed to kref_put() + * as the destructor. */ -static void of_node_cleanup(struct device_node *node) +static void of_node_release(struct kref *kref) { + struct device_node *node = kref_to_device_node(kref); struct property *prop = node->properties; if (!OF_IS_DYNAMIC(node)) @@ -1509,19 +1526,8 @@ static void of_node_cleanup(struct device_node *node) */ void of_node_put(struct device_node *node) { - if (!node) - return; - - WARN_ON(0 == atomic_read(&node->_users)); - - if (OF_IS_STALE(node)) { - if (atomic_dec_and_test(&node->_users)) { - of_node_cleanup(node); - return; - } - } - else - atomic_dec(&node->_users); + if (node) + kref_put(&node->kref, of_node_release); } EXPORT_SYMBOL(of_node_put); @@ -1734,17 +1740,6 @@ static int of_finish_dynamic_node(struct device_node *node) node->devfn = (regs[0] >> 8) & 0xff; } - /* fixing up iommu_table */ - -#ifdef CONFIG_PPC_PSERIES - if (strcmp(node->name, "pci") == 0 && - get_property(node, "ibm,dma-window", NULL)) { - node->bussubno = node->busno; - iommu_devnode_init(node); - } else - node->iommu_table = parent->iommu_table; -#endif /* CONFIG_PPC_PSERIES */ - out: of_node_put(parent); return err; @@ -1775,6 +1770,7 @@ int of_add_node(const char *path, struct property *proplist) np->properties = proplist; OF_MARK_DYNAMIC(np); + kref_init(&np->kref); of_node_get(np); np->parent = derive_parent(path); if (!np->parent) { @@ -1802,8 +1798,18 @@ int of_add_node(const char *path, struct property *proplist) } /* - * Remove an OF device node from the system. - * Caller should have already "gotten" np. + * Prepare an OF node for removal from system + */ +static void of_cleanup_node(struct device_node *np) +{ + if (np->iommu_table && get_property(np, "ibm,dma-window", NULL)) + iommu_free_table(np); +} + +/* + * "Unplug" a node from the device tree. The caller must hold + * a reference to the node. The memory associated with the node + * is not freed until its refcount goes to zero. */ int of_remove_node(struct device_node *np) { @@ -1818,8 +1824,9 @@ int of_remove_node(struct device_node *np) return -EBUSY; } + of_cleanup_node(np); + write_lock(&devtree_lock); - OF_MARK_STALE(np); remove_node_proc_entries(np); if (allnodes == np) allnodes = np->allnext; @@ -1844,6 +1851,7 @@ int of_remove_node(struct device_node *np) } write_unlock(&devtree_lock); of_node_put(parent); + of_node_put(np); /* Must decrement the refcount */ return 0; } diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index f62bda79e..e0e3e219d 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,6 @@ #include #include #include -#include -#include #include #include #include @@ -51,7 +50,6 @@ #include #include #include -#include "open_pic.h" #ifdef CONFIG_LOGO_LINUX_CLUT224 #include @@ -160,8 +158,6 @@ extern void copy_and_flush(unsigned long dest, unsigned long src, extern unsigned long klimit; -//int global_width = 640, global_height = 480, global_depth = 8, global_pitch; -//unsigned global_address; /* prom structure */ static struct prom_t __initdata prom; @@ -675,7 +671,7 @@ static void __init prom_init_mem(void) if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR ) RELOC(alloc_top) = RELOC(rmo_top); else - RELOC(alloc_top) = min(0x40000000ul, RELOC(ram_top)); + RELOC(alloc_top) = RELOC(rmo_top) = min(0x40000000ul, RELOC(ram_top)); RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(klimit) - offset + 0x4000); RELOC(alloc_top_high) = RELOC(ram_top); @@ -704,48 +700,51 @@ static void __init prom_instantiate_rtas(void) { unsigned long offset = reloc_offset(); struct prom_t *_prom = PTRRELOC(&prom); - phandle prom_rtas; - u64 base, entry = 0; - u32 size; + phandle prom_rtas, rtas_node; + u32 base, entry = 0; + u32 size = 0; prom_debug("prom_instantiate_rtas: start...\n"); prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); - if (prom_rtas != (phandle) -1) { - prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size)); - if (size != 0) { - base = alloc_down(size, PAGE_SIZE, 0); - if (base == 0) { - prom_printf("RTAS allocation failed !\n"); - return; - } - prom_printf("instantiating rtas at 0x%x", base); - - prom_rtas = call_prom("open", 1, 1, ADDR("/rtas")); - prom_printf("..."); + prom_debug("prom_rtas: %x\n", prom_rtas); + if (prom_rtas == (phandle) -1) + return; - if (call_prom("call-method", 3, 2, - ADDR("instantiate-rtas"), - prom_rtas, base) != PROM_ERROR) { - entry = (long)_prom->args.rets[1]; - } - if (entry == 0) { - prom_printf(" failed\n"); - return; - } - prom_printf(" done\n"); + prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size)); + if (size == 0) + return; - reserve_mem(base, size); - } + base = alloc_down(size, PAGE_SIZE, 0); + if (base == 0) { + prom_printf("RTAS allocation failed !\n"); + return; + } + prom_printf("instantiating rtas at 0x%x", base); - prom_setprop(_prom->chosen, "linux,rtas-base", &base, sizeof(base)); - prom_setprop(_prom->chosen, "linux,rtas-entry", &entry, sizeof(entry)); - prom_setprop(_prom->chosen, "linux,rtas-size", &size, sizeof(size)); + rtas_node = call_prom("open", 1, 1, ADDR("/rtas")); + prom_printf("..."); - prom_debug("rtas base = 0x%x\n", base); - prom_debug("rtas entry = 0x%x\n", entry); - prom_debug("rtas size = 0x%x\n", (long)size); + if (call_prom("call-method", 3, 2, + ADDR("instantiate-rtas"), + rtas_node, base) != PROM_ERROR) { + entry = (long)_prom->args.rets[1]; + } + if (entry == 0) { + prom_printf(" failed\n"); + return; } + prom_printf(" done\n"); + + reserve_mem(base, size); + + prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base)); + prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry)); + + prom_debug("rtas base = 0x%x\n", base); + prom_debug("rtas entry = 0x%x\n", entry); + prom_debug("rtas size = 0x%x\n", (long)size); + prom_debug("prom_instantiate_rtas: end...\n"); } @@ -760,7 +759,7 @@ static void __init prom_initialize_tce_table(void) unsigned long offset = reloc_offset(); char compatible[64], type[64], model[64]; char *path = RELOC(prom_scratch); - u64 base, vbase, align; + u64 base, align; u32 minalign, minsize; u64 tce_entry, *tce_entryp; u64 local_alloc_top, local_alloc_bottom; @@ -832,12 +831,9 @@ static void __init prom_initialize_tce_table(void) if (base < local_alloc_bottom) local_alloc_bottom = base; - vbase = (unsigned long)abs_to_virt(base); - /* Save away the TCE table attributes for later use. */ - prom_setprop(node, "linux,tce-base", &vbase, sizeof(vbase)); + prom_setprop(node, "linux,tce-base", &base, sizeof(base)); prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize)); - prom_setprop(node, "linux,has-tce-table", NULL, 0); /* It seems OF doesn't null-terminate the path :-( */ memset(path, 0, sizeof(path)); @@ -849,7 +845,7 @@ static void __init prom_initialize_tce_table(void) prom_debug("TCE table: %s\n", path); prom_debug("\tnode = 0x%x\n", node); - prom_debug("\tbase = 0x%x\n", vbase); + prom_debug("\tbase = 0x%x\n", base); prom_debug("\tsize = 0x%x\n", minsize); /* Initialize the table to have a one-to-one mapping @@ -952,9 +948,9 @@ static void __init prom_hold_cpus(void) continue; /* Skip non-configured cpus. */ - prom_getprop(node, "status", type, sizeof(type)); - if (strcmp(type, RELOC("okay")) != 0) - continue; + if (prom_getprop(node, "status", type, sizeof(type)) > 0) + if (strcmp(type, RELOC("okay")) != 0) + continue; reg = -1; prom_getprop(node, "reg", ®, sizeof(reg)); @@ -991,12 +987,13 @@ static void __init prom_hold_cpus(void) /* Primary Thread of non-boot cpu */ prom_printf("%x : starting cpu hw idx %x... ", cpuid, reg); call_prom("start-cpu", 3, 0, node, - secondary_hold, cpuid); + secondary_hold, reg); for ( i = 0 ; (i < 100000000) && - (*acknowledge == ((unsigned long)-1)); i++ ) ; + (*acknowledge == ((unsigned long)-1)); i++ ) + mb(); - if (*acknowledge == cpuid) { + if (*acknowledge == reg) { prom_printf("done\n"); /* We have to get every CPU out of OF, * even if we never start it. */ @@ -1110,6 +1107,16 @@ static void __init prom_init_stdout(void) } } +static void __init prom_close_stdin(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + ihandle val; + + if (prom_getprop(_prom->chosen, "stdin", &val, sizeof(val)) > 0) + call_prom("close", 1, 0, val); +} + static int __init prom_find_machine_type(void) { unsigned long offset = reloc_offset(); @@ -1130,6 +1137,8 @@ static int __init prom_find_machine_type(void) if (strstr(p, RELOC("Power Macintosh")) || strstr(p, RELOC("MacRISC4"))) return PLATFORM_POWERMAC; + if (strstr(p, RELOC("Momentum,Maple"))) + return PLATFORM_MAPLE; i += sl + 1; } } @@ -1161,7 +1170,7 @@ static int __init prom_set_color(ihandle ih, int i, int r, int g, int b) * So we check whether we will need to open the display, * and if so, open it now. */ -static unsigned long __init prom_check_displays(void) +static void __init prom_check_displays(void) { unsigned long offset = reloc_offset(); struct prom_t *_prom = PTRRELOC(&prom); @@ -1602,11 +1611,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long prom_debug("klimit=0x%x\n", RELOC(klimit)); prom_debug("offset=0x%x\n", offset); - /* - * Reserve kernel in reserve map - */ - reserve_mem(0, __pa(RELOC(klimit))); - /* * Check for an initrd */ @@ -1691,6 +1695,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long prom_printf("copying OF device tree ...\n"); flatten_device_tree(); + /* in case stdin is USB and still active on IBM machines... */ + prom_close_stdin(); + /* * Call OF "quiesce" method to shut down pending DMA's from * devices etc... diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c index 9c3d2f55e..93d073f77 100644 --- a/arch/ppc64/kernel/ptrace.c +++ b/arch/ppc64/kernel/ptrace.c @@ -184,7 +184,7 @@ int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ @@ -315,12 +315,13 @@ void do_syscall_trace_enter(struct pt_regs *regs) do_syscall_trace(); } -void do_syscall_trace_leave(void) +void do_syscall_trace_leave(struct pt_regs *regs) { if (unlikely(current->audit_context)) - audit_syscall_exit(current, 0); /* FIXME: pass pt_regs */ + audit_syscall_exit(current, regs->result); - if (test_thread_flag(TIF_SYSCALL_TRACE) + if ((test_thread_flag(TIF_SYSCALL_TRACE) + || test_thread_flag(TIF_SINGLESTEP)) && (current->ptrace & PT_PTRACED)) do_syscall_trace(); } diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c index e0ab44dc1..ee81b1b77 100644 --- a/arch/ppc64/kernel/ptrace32.c +++ b/arch/ppc64/kernel/ptrace32.c @@ -314,7 +314,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ diff --git a/arch/ppc64/kernel/ras.c b/arch/ppc64/kernel/ras.c index 75ced99c5..1c4c796b2 100644 --- a/arch/ppc64/kernel/ras.c +++ b/arch/ppc64/kernel/ras.c @@ -37,9 +37,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -53,7 +53,14 @@ #include static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; -static spinlock_t ras_log_buf_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ras_log_buf_lock); + +char mce_data_buf[RTAS_ERROR_LOG_MAX] +; +/* This is true if we are using the firmware NMI handler (typically LPAR) */ +extern int fwnmi_active; + +extern void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); static int ras_get_sensor_state_token; static int ras_check_exception_token; @@ -234,3 +241,116 @@ ras_error_interrupt(int irq, void *dev_id, struct pt_regs * regs) spin_unlock(&ras_log_buf_lock); return IRQ_HANDLED; } + +/* Get the error information for errors coming through the + * FWNMI vectors. The pt_regs' r3 will be updated to reflect + * the actual r3 if possible, and a ptr to the error log entry + * will be returned if found. + * + * The mce_data_buf does not have any locks or protection around it, + * if a second machine check comes in, or a system reset is done + * before we have logged the error, then we will get corruption in the + * error log. This is preferable over holding off on calling + * ibm,nmi-interlock which would result in us checkstopping if a + * second machine check did come in. + */ +static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) +{ + unsigned long errdata = regs->gpr[3]; + struct rtas_error_log *errhdr = NULL; + unsigned long *savep; + + if ((errdata >= 0x7000 && errdata < 0x7fff0) || + (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) { + savep = __va(errdata); + regs->gpr[3] = savep[0]; /* restore original r3 */ + memset(mce_data_buf, 0, RTAS_ERROR_LOG_MAX); + memcpy(mce_data_buf, (char *)(savep + 1), RTAS_ERROR_LOG_MAX); + errhdr = (struct rtas_error_log *)mce_data_buf; + } else { + printk("FWNMI: corrupt r3\n"); + } + return errhdr; +} + +/* Call this when done with the data returned by FWNMI_get_errinfo. + * It will release the saved data area for other CPUs in the + * partition to receive FWNMI errors. + */ +static void fwnmi_release_errinfo(void) +{ + int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL); + if (ret != 0) + printk("FWNMI: nmi-interlock failed: %d\n", ret); +} + +void pSeries_system_reset_exception(struct pt_regs *regs) +{ + if (fwnmi_active) { + struct rtas_error_log *errhdr = fwnmi_get_errinfo(regs); + if (errhdr) { + /* XXX Should look at FWNMI information */ + } + fwnmi_release_errinfo(); + } +} + +/* + * See if we can recover from a machine check exception. + * This is only called on power4 (or above) and only via + * the Firmware Non-Maskable Interrupts (fwnmi) handler + * which provides the error analysis for us. + * + * Return 1 if corrected (or delivered a signal). + * Return 0 if there is nothing we can do. + */ +static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err) +{ + int nonfatal = 0; + + if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { + /* Platform corrected itself */ + nonfatal = 1; + } else if ((regs->msr & MSR_RI) && + user_mode(regs) && + err->severity == RTAS_SEVERITY_ERROR_SYNC && + err->disposition == RTAS_DISP_NOT_RECOVERED && + err->target == RTAS_TARGET_MEMORY && + err->type == RTAS_TYPE_ECC_UNCORR && + !(current->pid == 0 || current->pid == 1)) { + /* Kill off a user process with an ECC error */ + printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", + current->pid); + /* XXX something better for ECC error? */ + _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); + nonfatal = 1; + } + + log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal); + + return nonfatal; +} + +/* + * Handle a machine check. + * + * Note that on Power 4 and beyond Firmware Non-Maskable Interrupts (fwnmi) + * should be present. If so the handler which called us tells us if the + * error was recovered (never true if RI=0). + * + * On hardware prior to Power 4 these exceptions were asynchronous which + * means we can't tell exactly where it occurred and so we can't recover. + */ +int pSeries_machine_check_exception(struct pt_regs *regs) +{ + struct rtas_error_log *errp; + + if (fwnmi_active) { + errp = fwnmi_get_errinfo(regs); + fwnmi_release_errinfo(); + if (errp && recover_mce(regs, errp)) + return 1; + } + + return 0; +} diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c index bd75066cc..28b1f1521 100644 --- a/arch/ppc64/kernel/rtas-proc.c +++ b/arch/ppc64/kernel/rtas-proc.c @@ -22,15 +22,16 @@ #include #include #include +#include #include -#include #include #include #include #include #include /* for ppc_md */ #include +#include /* Token for Sensors */ #define KEY_SWITCH 0x0001 @@ -51,7 +52,6 @@ #define IBM_VOLTAGE 0x232a /* 9002 */ #define IBM_DRCONNECTOR 0x232b /* 9003 */ #define IBM_POWERSUPPLY 0x232c /* 9004 */ -#define IBM_INTQUEUE 0x232d /* 9005 */ /* Status return values */ #define SENSOR_CRITICAL_HIGH 13 @@ -106,7 +106,6 @@ #define DR_ACTION 0x2329 /* 9001 */ #define DR_INDICATOR 0x232a /* 9002 */ /* 9003 - 9004: Vendor specific */ -#define GLOBAL_INTERRUPT_QUEUE 0x232d /* 9005 */ /* 9006 - 9999: Vendor specific */ /* other */ @@ -552,7 +551,6 @@ static void ppc_rtas_process_sensor(struct seq_file *m, "No current flow" }; const char * ibm_drconnector[] = { "Empty", "Present", "Unusable", "Exchange" }; - const char * ibm_intqueue[] = { "Disabled", "Enabled" }; int have_strings = 0; int num_states = 0; @@ -664,15 +662,6 @@ static void ppc_rtas_process_sensor(struct seq_file *m, case IBM_POWERSUPPLY: seq_printf(m, "Powersupply:\t"); break; - case IBM_INTQUEUE: - seq_printf(m, "Interrupt queue:\t"); - num_states = sizeof(ibm_intqueue) / sizeof(char *); - if (state < num_states) { - seq_printf(m, "%s\t", - ibm_intqueue[state]); - have_strings = 1; - } - break; default: seq_printf(m, "Unknown sensor (type %d), ignoring it\n", s->token); diff --git a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c index becb652e1..e3d7f833b 100644 --- a/arch/ppc64/kernel/rtas.c +++ b/arch/ppc64/kernel/rtas.c @@ -29,6 +29,7 @@ #include #include #include +#include struct flash_block_list_header rtas_firmware_flash_list = {0, NULL}; @@ -40,7 +41,7 @@ EXPORT_SYMBOL(rtas); char rtas_err_buf[RTAS_ERROR_LOG_MAX]; -spinlock_t rtas_data_buf_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtas_data_buf_lock); char rtas_data_buf[RTAS_DATA_BUF_SIZE]__page_aligned; unsigned long rtas_rmo_buf; @@ -102,6 +103,27 @@ rtas_token(const char *service) return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; } +/* + * Return the firmware-specified size of the error log buffer + * for all rtas calls that require an error buffer argument. + * This includes 'check-exception' and 'rtas-last-error'. + */ +int rtas_get_error_log_max(void) +{ + static int rtas_error_log_max; + if (rtas_error_log_max) + return rtas_error_log_max; + + rtas_error_log_max = rtas_token ("rtas-error-log-max"); + if ((rtas_error_log_max == RTAS_UNKNOWN_SERVICE) || + (rtas_error_log_max > RTAS_ERROR_LOG_MAX)) { + printk (KERN_WARNING "RTAS: bad log buffer size %d\n", rtas_error_log_max); + rtas_error_log_max = RTAS_ERROR_LOG_MAX; + } + return rtas_error_log_max; +} + + /** Return a copy of the detailed error text associated with the * most recent failed call to rtas. Because the error text * might go stale if there are any other intervening rtas calls, @@ -114,12 +136,7 @@ __fetch_rtas_last_error(void) struct rtas_args err_args, save_args; u32 bufsz; - bufsz = rtas_token ("rtas-error-log-max"); - if ((bufsz == RTAS_UNKNOWN_SERVICE) || - (bufsz > RTAS_ERROR_LOG_MAX)) { - printk (KERN_WARNING "RTAS: bad log buffer size %d\n", bufsz); - bufsz = RTAS_ERROR_LOG_MAX; - } + bufsz = rtas_get_error_log_max(); err_args.token = rtas_token("rtas-last-error"); err_args.nargs = 2; @@ -439,6 +456,9 @@ void rtas_os_term(char *str) { int status; + if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term")) + return; + snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str); do { @@ -516,7 +536,6 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs) return 0; } -#ifdef CONFIG_HOTPLUG_CPU /* This version can't take the spinlock, because it never returns */ struct rtas_args rtas_stop_self_args = { @@ -541,27 +560,6 @@ void rtas_stop_self(void) panic("Alas, I survived.\n"); } -#endif /* CONFIG_HOTPLUG_CPU */ - -/* - * Return the firmware-specified size of the error log buffer - * for all rtas calls that require an error buffer argument. - * This includes 'check-exception' and 'rtas-last-error'. - */ -int rtas_get_error_log_max(void) -{ - static int rtas_error_log_max; - if (rtas_error_log_max) - return rtas_error_log_max; - - rtas_error_log_max = rtas_token ("rtas-error-log-max"); - if ((rtas_error_log_max == RTAS_UNKNOWN_SERVICE) || - (rtas_error_log_max > RTAS_ERROR_LOG_MAX)) { - printk (KERN_WARNING "RTAS: bad log buffer size %d\n", rtas_error_log_max); - rtas_error_log_max = RTAS_ERROR_LOG_MAX; - } - return rtas_error_log_max; -} /* * Call early during boot, before mem init or bootmem, to retreive the RTAS @@ -575,15 +573,15 @@ void __init rtas_initialize(void) */ rtas.dev = of_find_node_by_name(NULL, "rtas"); if (rtas.dev) { - u64 *basep, *entryp; + u32 *basep, *entryp; u32 *sizep; - basep = (u64 *)get_property(of_chosen, "linux,rtas-base", NULL); - sizep = (u32 *)get_property(of_chosen, "linux,rtas-size", NULL); + basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL); + sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL); if (basep != NULL && sizep != NULL) { rtas.base = *basep; rtas.size = *sizep; - entryp = (u64 *)get_property(of_chosen, "linux,rtas-entry", NULL); + entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL); if (entryp == NULL) /* Ugh */ rtas.entry = rtas.base; else diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c index aac9e9609..c0cefd3c9 100644 --- a/arch/ppc64/kernel/rtas_flash.c +++ b/arch/ppc64/kernel/rtas_flash.c @@ -105,7 +105,7 @@ struct rtas_validate_flash_t unsigned int update_results; /* Update results token */ }; -static spinlock_t flash_file_open_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(flash_file_open_lock); static struct proc_dir_entry *firmware_flash_pde; static struct proc_dir_entry *firmware_update_pde; static struct proc_dir_entry *validate_pde; @@ -562,6 +562,7 @@ static int validate_flash_release(struct inode *inode, struct file *file) validate_flash(args_buf); } + /* The matching atomic_inc was in rtas_excl_open() */ atomic_dec(&dp->count); return 0; @@ -572,7 +573,8 @@ static void remove_flash_pde(struct proc_dir_entry *dp) if (dp) { if (dp->data != NULL) kfree(dp->data); - remove_proc_entry(dp->name, NULL); + dp->owner = NULL; + remove_proc_entry(dp->name, dp->parent); } } diff --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c index c6370a8e3..e41a15897 100644 --- a/arch/ppc64/kernel/rtasd.c +++ b/arch/ppc64/kernel/rtasd.c @@ -26,6 +26,7 @@ #include #include #include +#include #if 0 #define DEBUG(A...) printk(KERN_ERR A) @@ -33,7 +34,7 @@ #define DEBUG(A...) #endif -static spinlock_t rtasd_log_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(rtasd_log_lock); DECLARE_WAIT_QUEUE_HEAD(rtas_log_wait); @@ -48,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max; static int full_rtas_msgs = 0; -extern volatile int no_more_logging; +extern int no_logging; volatile int error_log_cnt = 0; @@ -213,7 +214,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal) } /* Write error to NVRAM */ - if (!no_more_logging && !(err_type & ERR_FLAG_BOOT)) + if (!no_logging && !(err_type & ERR_FLAG_BOOT)) nvram_write_error_log(buf, len, err_type); /* @@ -225,8 +226,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal) printk_log_rtas(buf, len); /* Check to see if we need to or have stopped logging */ - if (fatal || no_more_logging) { - no_more_logging = 1; + if (fatal || no_logging) { + no_logging = 1; spin_unlock_irqrestore(&rtasd_log_lock, s); return; } @@ -275,7 +276,7 @@ static int rtas_log_release(struct inode * inode, struct file * file) * know that we can safely clear the events in NVRAM. * Next we'll sit and wait for something else to log. */ -static ssize_t rtas_log_read(struct file * file, char * buf, +static ssize_t rtas_log_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { int error; @@ -299,7 +300,7 @@ static ssize_t rtas_log_read(struct file * file, char * buf, spin_lock_irqsave(&rtasd_log_lock, s); /* if it's 0, then we know we got the last one (the one in NVRAM) */ - if (rtas_log_size == 0 && !no_more_logging) + if (rtas_log_size == 0 && !no_logging) nvram_clear_error_log(); spin_unlock_irqrestore(&rtasd_log_lock, s); @@ -417,9 +418,6 @@ static int rtasd(void *unused) goto error; } - /* We can use rtas_log_buf now */ - no_more_logging = 0; - printk(KERN_ERR "RTAS daemon started\n"); DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2); @@ -428,6 +426,10 @@ static int rtasd(void *unused) memset(logdata, 0, rtas_error_log_max); rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type); + + /* We can use rtas_log_buf now */ + no_logging = 0; + if (!rc) { if (err_type != ERR_FLAG_ALREADY_LOGGED) { pSeries_log_error(logdata, err_type | ERR_FLAG_BOOT, 0); @@ -484,8 +486,8 @@ static int __init rtas_init(void) /* No RTAS, only warn if we are on a pSeries box */ if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { - if (systemcfg->platform & PLATFORM_PSERIES); - printk(KERN_ERR "rtasd: no RTAS on system\n"); + if (systemcfg->platform & PLATFORM_PSERIES) + printk(KERN_ERR "rtasd: no event-scan on system\n"); return 1; } diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c index 536a49918..f941278bd 100644 --- a/arch/ppc64/kernel/rtc.c +++ b/arch/ppc64/kernel/rtc.c @@ -185,11 +185,10 @@ static struct file_operations rtc_fops = { .release = rtc_release, }; -static struct miscdevice rtc_dev= -{ - RTC_MINOR, - "rtc", - &rtc_fops +static struct miscdevice rtc_dev = { + .minor = RTC_MINOR, + .name = "rtc", + .fops = &rtc_fops }; static int __init rtc_init(void) @@ -201,9 +200,11 @@ static int __init rtc_init(void) return retval; #ifdef CONFIG_PROC_FS - if (create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL) == NULL) + if (create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL) + == NULL) { misc_deregister(&rtc_dev); return -ENOMEM; + } #endif printk(KERN_INFO "i/pSeries Real Time Clock Driver v" RTC_VERSION "\n"); @@ -275,7 +276,7 @@ void iSeries_get_rtc_time(struct rtc_time *rtc_tm) if (piranha_simulator) return; - mf_getRtc(rtc_tm); + mf_get_rtc(rtc_tm); rtc_tm->tm_mon--; } @@ -285,7 +286,7 @@ void iSeries_get_rtc_time(struct rtc_time *rtc_tm) */ int iSeries_set_rtc_time(struct rtc_time *tm) { - mf_setRtc(tm); + mf_set_rtc(tm); return 0; } @@ -356,7 +357,7 @@ void pSeries_get_boot_time(struct rtc_time *rtc_tm) } } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); - if (error != 0) { + if (error != 0 && printk_ratelimit()) { printk(KERN_WARNING "error: reading the clock failed (%d)\n", error); return; @@ -384,7 +385,7 @@ void pSeries_get_rtc_time(struct rtc_time *rtc_tm) do { error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { - if (in_interrupt()) { + if (in_interrupt() && printk_ratelimit()) { printk(KERN_WARNING "error: reading clock would delay interrupt\n"); return; /* delay not allowed */ } @@ -395,7 +396,7 @@ void pSeries_get_rtc_time(struct rtc_time *rtc_tm) } } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); - if (error != 0) { + if (error != 0 && printk_ratelimit()) { printk(KERN_WARNING "error: reading the clock failed (%d)\n", error); return; @@ -430,7 +431,7 @@ int pSeries_set_rtc_time(struct rtc_time *tm) } } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); - if (error != 0) + if (error != 0 && printk_ratelimit()) printk(KERN_WARNING "error: setting the clock failed (%d)\n", error); diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 1951866a7..870c69ee8 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,8 @@ #include #include #include +#include +#include #include #include #include @@ -39,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +53,10 @@ #include #include #include +#include +#include +#include +#include #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -72,18 +78,20 @@ extern void udbg_init_debug_lpar(void); extern void udbg_init_pmac_realmode(void); /* That's RTAS panel debug */ extern void call_rtas_display_status_delay(unsigned char c); +/* Here's maple real mode debug */ +extern void udbg_init_maple_realmode(void); #define EARLY_DEBUG_INIT() do {} while(0) #if 0 #define EARLY_DEBUG_INIT() udbg_init_debug_lpar() +#define EARLY_DEBUG_INIT() udbg_init_maple_realmode() #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() #define EARLY_DEBUG_INIT() \ do { ppc_md.udbg_putc = call_rtas_display_status_delay; } while(0) #endif /* extern void *stab; */ -extern HTAB htab_data; extern unsigned long klimit; extern void mm_init_ppc64(void); @@ -93,6 +101,8 @@ extern void htab_initialize(void); extern void early_init_devtree(void *flat_dt); extern void unflatten_device_tree(void); +extern void smp_release_cpus(void); + unsigned long decr_overclock = 1; unsigned long decr_overclock_proc0 = 1; unsigned long decr_overclock_set = 0; @@ -100,7 +110,13 @@ unsigned long decr_overclock_proc0_set = 0; int have_of = 1; int boot_cpuid = 0; +int boot_cpuid_phys = 0; dev_t boot_dev; +u64 ppc64_pft_size; +u64 ppc64_debug_switch; + +struct ppc64_caches ppc64_caches; +EXPORT_SYMBOL_GPL(ppc64_caches); /* * These are used in binfmt_elf.c to put aux entries on the stack @@ -147,7 +163,7 @@ struct screen_info screen_info = { */ void __init ppcdbg_initialize(void) { - naca->debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */ + ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */ /* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */; } @@ -236,6 +252,7 @@ static void __init setup_cpu_maps(void) { struct device_node *dn = NULL; int cpu = 0; + int swap_cpuid = 0; check_smt_enabled(); @@ -260,11 +277,23 @@ static void __init setup_cpu_maps(void) cpu_set(cpu, cpu_present_map); set_hard_smp_processor_id(cpu, intserv[j]); } + if (intserv[j] == boot_cpuid_phys) + swap_cpuid = cpu; cpu_set(cpu, cpu_possible_map); cpu++; } } + /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that + * boot cpu is logical 0. + */ + if (boot_cpuid_phys != get_hard_smp_processor_id(0)) { + u32 tmp; + tmp = get_hard_smp_processor_id(0); + set_hard_smp_processor_id(0, boot_cpuid_phys); + set_hard_smp_processor_id(swap_cpuid, tmp); + } + /* * On pSeries LPAR, we need to know how many cpus * could possibly be added to this partition. @@ -323,6 +352,7 @@ static void __init setup_cpu_maps(void) extern struct machdep_calls pSeries_md; extern struct machdep_calls pmac_md; +extern struct machdep_calls maple_md; /* Ultimately, stuff them in an elf section like initcalls... */ static struct machdep_calls __initdata *machines[] = { @@ -332,6 +362,9 @@ static struct machdep_calls __initdata *machines[] = { #ifdef CONFIG_PPC_PMAC &pmac_md, #endif /* CONFIG_PPC_PMAC */ +#ifdef CONFIG_PPC_MAPLE + &maple_md, +#endif /* CONFIG_PPC_MAPLE */ NULL }; @@ -368,7 +401,7 @@ void __init early_setup(unsigned long dt_ptr) DBG(" -> early_setup()\n"); /* - * Fill the default DBG level in naca (do we want to keep + * Fill the default DBG level (do we want to keep * that old mecanism around forever ?) */ ppcdbg_initialize(); @@ -422,17 +455,17 @@ void __init early_setup(unsigned long dt_ptr) /* - * Initialize some remaining members of the naca and systemcfg structures + * Initialize some remaining members of the ppc64_caches and systemcfg structures * (at least until we get rid of them completely). This is mostly some * cache informations about the CPU that will be used by cache flush * routines and/or provided to userland */ -static void __init initialize_naca(void) +static void __init initialize_cache_info(void) { struct device_node *np; unsigned long num_cpus = 0; - DBG(" -> initialize_naca()\n"); + DBG(" -> initialize_cache_info()\n"); for (np = NULL; (np = of_find_node_by_type(np, "cpu"));) { num_cpus += 1; @@ -463,15 +496,15 @@ static void __init initialize_naca(void) lsizep = (u32 *) get_property(np, dc, NULL); if (lsizep != NULL) lsize = *lsizep; - if (sizep == 0 || lsizep == 0) DBG("Argh, can't find dcache properties ! " "sizep: %p, lsizep: %p\n", sizep, lsizep); - systemcfg->dCacheL1Size = size; - systemcfg->dCacheL1LineSize = lsize; - naca->dCacheL1LogLineSize = __ilog2(lsize); - naca->dCacheL1LinesPerPage = PAGE_SIZE/(lsize); + systemcfg->dcache_size = ppc64_caches.dsize = size; + systemcfg->dcache_line_size = + ppc64_caches.dline_size = lsize; + ppc64_caches.log_dline_size = __ilog2(lsize); + ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; size = 0; lsize = cur_cpu_spec->icache_bsize; @@ -485,11 +518,11 @@ static void __init initialize_naca(void) DBG("Argh, can't find icache properties ! " "sizep: %p, lsizep: %p\n", sizep, lsizep); - systemcfg->iCacheL1Size = size; - systemcfg->iCacheL1LineSize = lsize; - naca->iCacheL1LogLineSize = __ilog2(lsize); - naca->iCacheL1LinesPerPage = PAGE_SIZE/(lsize); - + systemcfg->icache_size = ppc64_caches.isize = size; + systemcfg->icache_line_size = + ppc64_caches.iline_size = lsize; + ppc64_caches.log_iline_size = __ilog2(lsize); + ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; } } @@ -499,7 +532,7 @@ static void __init initialize_naca(void) systemcfg->version.minor = SYSTEMCFG_MINOR; systemcfg->processor = mfspr(SPRN_PVR); - DBG(" <- initialize_naca()\n"); + DBG(" <- initialize_cache_info()\n"); } static void __init check_for_initrd(void) @@ -560,7 +593,7 @@ void __init setup_system(void) unflatten_device_tree(); /* - * Fill the naca & systemcfg structures with informations + * Fill the ppc64_caches & systemcfg structures with informations * retreived from the device-tree. Need to be called before * finish_device_tree() since the later requires some of the * informations filled up here to properly parse the interrupt @@ -569,7 +602,7 @@ void __init setup_system(void) * routines like flush_icache_range (used by the hash init * later on). */ - initialize_naca(); + initialize_cache_info(); #ifdef CONFIG_PPC_PSERIES /* @@ -620,22 +653,29 @@ void __init setup_system(void) * iSeries has already initialized the cpu maps at this point. */ setup_cpu_maps(); + + /* Release secondary cpus out of their spinloops at 0x60 now that + * we can map physical -> logical CPU ids + */ + smp_release_cpus(); #endif /* defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) */ printk("Starting Linux PPC64 %s\n", UTS_RELEASE); printk("-----------------------------------------------------\n"); - printk("naca = 0x%p\n", naca); - printk("naca->pftSize = 0x%lx\n", naca->pftSize); - printk("naca->debug_switch = 0x%lx\n", naca->debug_switch); - printk("naca->interrupt_controller = 0x%ld\n", naca->interrupt_controller); + printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); + printk("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch); + printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); printk("systemcfg = 0x%p\n", systemcfg); + printk("systemcfg->platform = 0x%x\n", systemcfg->platform); printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount); printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize); - printk("systemcfg->dCacheL1LineSize = 0x%x\n", systemcfg->dCacheL1LineSize); - printk("systemcfg->iCacheL1LineSize = 0x%x\n", systemcfg->iCacheL1LineSize); - printk("htab_data.htab = 0x%p\n", htab_data.htab); - printk("htab_data.num_ptegs = 0x%lx\n", htab_data.htab_num_ptegs); + printk("ppc64_caches.dcache_line_size = 0x%x\n", + ppc64_caches.dline_size); + printk("ppc64_caches.icache_line_size = 0x%x\n", + ppc64_caches.iline_size); + printk("htab_address = 0x%p\n", htab_address); + printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); printk("-----------------------------------------------------\n"); mm_init_ppc64(); @@ -783,12 +823,11 @@ early_param("mem", early_parsemem); #ifdef CONFIG_PPC_MULTIPLATFORM static int __init set_preferred_console(void) { - struct device_node *prom_stdout; + struct device_node *prom_stdout = NULL; char *name; + u32 *spd; int offset = 0; -#if 0 - phandle *stdout_ph; -#endif + DBG(" -> set_preferred_console()\n"); /* The user has requested a console so this is already set up. */ @@ -802,20 +841,7 @@ static int __init set_preferred_console(void) return -ENODEV; } /* We are getting a weird phandle from OF ... */ -#if 0 - stdout_ph = (phandle *)get_property(of_chosen, "linux,stdout-package", NULL); - if (stdout_ph == NULL) { - DBG(" no linux,stdout-package !\n"); - return -ENODEV; - } - prom_stdout = of_find_node_by_phandle(*stdout_ph); - if (!prom_stdout) { - DBG(" can't find stdout package for phandle 0x%x !\n", *stdout_ph); - return -ENODEV; - } -#endif /* ... So use the full path instead */ -#if 1 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL); if (name == NULL) { DBG(" no linux,stdout-path !\n"); @@ -826,7 +852,6 @@ static int __init set_preferred_console(void) DBG(" can't find stdout package %s !\n", name); return -ENODEV; } -#endif DBG("stdout is %s\n", prom_stdout->full_name); name = (char *)get_property(prom_stdout, "name", NULL); @@ -834,8 +859,12 @@ static int __init set_preferred_console(void) DBG(" stdout package has no name !\n"); goto not_found; } + spd = (u32 *)get_property(prom_stdout, "current-speed", NULL); - if (strcmp(name, "serial") == 0) { + if (0) + ; +#ifdef CONFIG_SERIAL_8250_CONSOLE + else if (strcmp(name, "serial") == 0) { int i; u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i); if (i > 8) { @@ -858,6 +887,7 @@ static int __init set_preferred_console(void) } } } +#endif /* CONFIG_SERIAL_8250_CONSOLE */ #ifdef CONFIG_PPC_PSERIES else if (strcmp(name, "vty") == 0) { u32 *reg = (u32 *)get_property(prom_stdout, "reg", NULL); @@ -887,17 +917,24 @@ static int __init set_preferred_console(void) } } #endif /* CONFIG_PPC_PSERIES */ +#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE else if (strcmp(name, "ch-a") == 0) offset = 0; else if (strcmp(name, "ch-b") == 0) offset = 1; +#endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */ else goto not_found; of_node_put(prom_stdout); DBG("Found serial console at ttyS%d\n", offset); - return add_preferred_console("ttyS", offset, NULL); + if (spd) { + static char __initdata opt[16]; + sprintf(opt, "%d", *spd); + return add_preferred_console("ttyS", offset, opt); + } else + return add_preferred_console("ttyS", offset, NULL); not_found: DBG("No preferred console found !\n"); @@ -959,7 +996,6 @@ static void __init emergency_stack_init(void) */ void __init setup_arch(char **cmdline_p) { - extern int panic_timeout; extern void do_init_bootmem(void); ppc64_boot_msg(0x12, "Setup Arch"); @@ -971,8 +1007,8 @@ void __init setup_arch(char **cmdline_p) * Systems with OF can look in the properties on the cpu node(s) * for a possibly more accurate value. */ - dcache_bsize = systemcfg->dCacheL1LineSize; - icache_bsize = systemcfg->iCacheL1LineSize; + dcache_bsize = ppc64_caches.dline_size; + icache_bsize = ppc64_caches.iline_size; /* reboot on panic */ panic_timeout = 180; @@ -991,11 +1027,11 @@ void __init setup_arch(char **cmdline_p) /* set up the bootmem stuff with available memory */ do_init_bootmem(); + ppc_md.setup_arch(); + /* Select the correct idle loop for the platform. */ idle_setup(); - ppc_md.setup_arch(); - paging_init(); ppc64_boot_msg(0x15, "Setup Done"); } @@ -1106,15 +1142,212 @@ __setup("spread_lpevents=", set_spread_lpevents ); __setup("decr_overclock_proc0=", set_decr_overclock_proc0 ); __setup("decr_overclock=", set_decr_overclock ); +#ifndef CONFIG_PPC_ISERIES +/* + * This function can be used by platforms to "find" legacy serial ports. + * It works for "serial" nodes under an "isa" node, and will try to + * respect the "ibm,aix-loc" property if any. It works with up to 8 + * ports. + */ + +#define MAX_LEGACY_SERIAL_PORTS 8 +static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1]; +static unsigned int old_serial_count; + +void __init generic_find_legacy_serial_ports(u64 *physport, + unsigned int *default_speed) +{ + struct device_node *np; + u32 *sizeprop; + + struct isa_reg_property { + u32 space; + u32 address; + u32 size; + }; + struct pci_reg_property { + struct pci_address addr; + u32 size_hi; + u32 size_lo; + }; + + DBG(" -> generic_find_legacy_serial_port()\n"); + + *physport = 0; + if (default_speed) + *default_speed = 0; + + np = of_find_node_by_path("/"); + if (!np) + return; + + /* First fill our array */ + for (np = NULL; (np = of_find_node_by_type(np, "serial"));) { + struct device_node *isa, *pci; + struct isa_reg_property *reg; + unsigned long phys_size, addr_size, io_base; + u32 *rangesp; + u32 *interrupts, *clk, *spd; + char *typep; + int index, rlen, rentsize; + + /* Ok, first check if it's under an "isa" parent */ + isa = of_get_parent(np); + if (!isa || strcmp(isa->name, "isa")) { + DBG("%s: no isa parent found\n", np->full_name); + continue; + } + + /* Now look for an "ibm,aix-loc" property that gives us ordering + * if any... + */ + typep = (char *)get_property(np, "ibm,aix-loc", NULL); + + /* Get the ISA port number */ + reg = (struct isa_reg_property *)get_property(np, "reg", NULL); + if (reg == NULL) + goto next_port; + /* We assume the interrupt number isn't translated ... */ + interrupts = (u32 *)get_property(np, "interrupts", NULL); + /* get clock freq. if present */ + clk = (u32 *)get_property(np, "clock-frequency", NULL); + /* get default speed if present */ + spd = (u32 *)get_property(np, "current-speed", NULL); + /* Default to locate at end of array */ + index = old_serial_count; /* end of the array by default */ + + /* If we have a location index, then use it */ + if (typep && *typep == 'S') { + index = simple_strtol(typep+1, NULL, 0) - 1; + /* if index is out of range, use end of array instead */ + if (index >= MAX_LEGACY_SERIAL_PORTS) + index = old_serial_count; + /* if our index is still out of range, that mean that + * array is full, we could scan for a free slot but that + * make little sense to bother, just skip the port + */ + if (index >= MAX_LEGACY_SERIAL_PORTS) + goto next_port; + if (index >= old_serial_count) + old_serial_count = index + 1; + /* Check if there is a port who already claimed our slot */ + if (serial_ports[index].iobase != 0) { + /* if we still have some room, move it, else override */ + if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) { + DBG("Moved legacy port %d -> %d\n", index, + old_serial_count); + serial_ports[old_serial_count++] = + serial_ports[index]; + } else { + DBG("Replacing legacy port %d\n", index); + } + } + } + if (index >= MAX_LEGACY_SERIAL_PORTS) + goto next_port; + if (index >= old_serial_count) + old_serial_count = index + 1; + + /* Now fill the entry */ + memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port)); + serial_ports[index].uartclk = clk ? *clk : BASE_BAUD * 16; + serial_ports[index].iobase = reg->address; + serial_ports[index].irq = interrupts ? interrupts[0] : 0; + serial_ports[index].flags = ASYNC_BOOT_AUTOCONF; + + DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n", + index, + serial_ports[index].iobase, + serial_ports[index].irq, + serial_ports[index].uartclk); + + /* Get phys address of IO reg for port 1 */ + if (index != 0) + goto next_port; + + pci = of_get_parent(isa); + if (!pci) { + DBG("%s: no pci parent found\n", np->full_name); + goto next_port; + } + + rangesp = (u32 *)get_property(pci, "ranges", &rlen); + if (rangesp == NULL) { + of_node_put(pci); + goto next_port; + } + rlen /= 4; + + /* we need the #size-cells of the PCI bridge node itself */ + phys_size = 1; + sizeprop = (u32 *)get_property(pci, "#size-cells", NULL); + if (sizeprop != NULL) + phys_size = *sizeprop; + /* we need the parent #addr-cells */ + addr_size = prom_n_addr_cells(pci); + rentsize = 3 + addr_size + phys_size; + io_base = 0; + for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) { + if (((rangesp[0] >> 24) & 0x3) != 1) + continue; /* not IO space */ + io_base = rangesp[3]; + if (addr_size == 2) + io_base = (io_base << 32) | rangesp[4]; + } + if (io_base != 0) { + *physport = io_base + reg->address; + if (default_speed && spd) + *default_speed = *spd; + } + of_node_put(pci); + next_port: + of_node_put(isa); + } + + DBG(" <- generic_find_legacy_serial_port()\n"); +} + +static struct platform_device serial_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_ports, + }, +}; + +static int __init serial_dev_init(void) +{ + return platform_device_register(&serial_device); +} +arch_initcall(serial_dev_init); + +#endif /* CONFIG_PPC_ISERIES */ + +int check_legacy_ioport(unsigned long base_port) +{ + if (ppc_md.check_legacy_ioport == NULL) + return 0; + return ppc_md.check_legacy_ioport(base_port); +} +EXPORT_SYMBOL(check_legacy_ioport); + #ifdef CONFIG_XMON static int __init early_xmon(char *p) { /* ensure xmon is enabled */ xmon_init(); - debugger(0); + debugger(NULL); return 0; } early_param("xmon", early_xmon); #endif +void cpu_die(void) +{ + idle_task_exit(); + if (ppc_md.cpu_die) + ppc_md.cpu_die(); + local_irq_disable(); + for (;;); +} diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c index ce616280b..bea0bbcfe 100644 --- a/arch/ppc64/kernel/signal.c +++ b/arch/ppc64/kernel/signal.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -66,7 +67,7 @@ struct rt_sigframe { struct siginfo info; /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ char abigap[288]; -}; +} __attribute__ ((aligned (16))); /* @@ -98,7 +99,7 @@ long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, int p3, int current->state = TASK_INTERRUPTIBLE; schedule(); if (do_signal(&saveset, regs)) - return regs->gpr[3]; + return 0; } } @@ -179,6 +180,9 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, unsigned long err = 0; unsigned long save_r13 = 0; elf_greg_t *gregs = (elf_greg_t *)regs; +#ifdef CONFIG_ALTIVEC + unsigned long msr; +#endif int i; /* If this is not a signal return, we preserve the TLS in r13 */ @@ -204,13 +208,15 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, #ifdef CONFIG_ALTIVEC err |= __get_user(v_regs, &sc->v_regs); + err |= __get_user(msr, &sc->gp_regs[PT_MSR]); if (err) return err; /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ - if (v_regs != 0 && (regs->msr & MSR_VEC) != 0) - err |= __copy_from_user(current->thread.vr, v_regs, 33 * sizeof(vector128)); + if (v_regs != 0 && (msr & MSR_VEC) != 0) + err |= __copy_from_user(current->thread.vr, v_regs, + 33 * sizeof(vector128)); else if (current->thread.used_vr) - memset(¤t->thread.vr, 0, 33); + memset(current->thread.vr, 0, 33 * sizeof(vector128)); /* Always get VRSAVE back */ if (v_regs != 0) err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]); @@ -218,6 +224,14 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, current->thread.vrsave = 0; #endif /* CONFIG_ALTIVEC */ +#ifndef CONFIG_SMP + preempt_disable(); + if (last_task_used_math == current) + last_task_used_math = NULL; + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; + preempt_enable(); +#endif /* Force reload of FP/VEC */ regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC); @@ -240,7 +254,7 @@ static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs newsp = (current->sas_ss_sp + current->sas_ss_size); } - return (void __user *)((newsp - frame_size) & -8ul); + return (void __user *)((newsp - frame_size) & -16ul); } /* @@ -374,7 +388,7 @@ badframe: return 0; } -static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, +static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { /* Handler is *really* a pointer to the function descriptor for @@ -420,7 +434,7 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, /* Allocate a dummy caller frame for the signal handler. */ newsp = (unsigned long)frame - __SIGNAL_FRAMESIZE; - err |= put_user(0, (unsigned long __user *)newsp); + err |= put_user(regs->gpr[1], (unsigned long __user *)newsp); /* Set up "regs" so we "return" to the signal handler. */ err |= get_user(regs->nip, &funct_desc_ptr->entry); @@ -439,7 +453,10 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, if (err) goto badframe; - return; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + + return 1; badframe: #if DEBUG_SIG @@ -447,25 +464,30 @@ badframe: regs, frame, newsp); #endif force_sigsegv(signr, current); + return 0; } /* * OK, we're invoking a handler */ -static void handle_signal(unsigned long sig, struct k_sigaction *ka, - siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) +static int handle_signal(unsigned long sig, struct k_sigaction *ka, + siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) { + int ret; + /* Set up Signal Frame */ - setup_rt_frame(sig, ka, info, oldset, regs); + ret = setup_rt_frame(sig, ka, info, oldset, regs); - if (!(ka->sa.sa_flags & SA_NODEFER)) { + if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); } + + return ret; } static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) @@ -525,8 +547,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (TRAP(regs) == 0x0C00) syscall_restart(regs, &ka); - handle_signal(signr, &ka, &info, oldset, regs); - return 1; + return handle_signal(signr, &ka, &info, oldset, regs); } if (TRAP(regs) == 0x0C00) { /* System Call! */ diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c index 79f7b8446..145eac7ef 100644 --- a/arch/ppc64/kernel/signal32.c +++ b/arch/ppc64/kernel/signal32.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,7 @@ struct sigregs32 { * */ struct rt_sigframe32 { - struct compat_siginfo info; + compat_siginfo_t info; struct ucontext32 uc; /* * Programs using the rs6000/xcoff abi can save up to 19 gp @@ -227,13 +228,21 @@ static long restore_user_regs(struct pt_regs *regs, sizeof(sr->mc_vregs))) return 1; } else if (current->thread.used_vr) - memset(¤t->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128)); + memset(current->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128)); /* Always get VRSAVE back */ if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32])) return 1; #endif /* CONFIG_ALTIVEC */ +#ifndef CONFIG_SMP + preempt_disable(); + if (last_task_used_math == current) + last_task_used_math = NULL; + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; + preempt_enable(); +#endif return 0; } @@ -276,14 +285,12 @@ long sys32_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7, schedule(); if (do_signal32(&saveset, regs)) /* - * If a signal handler needs to be called, - * do_signal32() has set R3 to the signal number (the - * first argument of the signal handler), so don't - * overwrite that with EINTR ! - * In the other cases, do_signal32() doesn't touch - * R3, so it's still set to -EINTR (see above). + * Returning 0 means we return to userspace via + * ret_from_except and thus restore all user + * registers from *regs. This is what we need + * to do when a signal has been delivered. */ - return regs->gpr[3]; + return 0; } } @@ -334,7 +341,6 @@ long sys32_sigaction(int sig, struct old_sigaction32 __user *act, * sigpending sys32_rt_sigpending * sigprocmask sys32_rt_sigprocmask * sigreturn sys32_rt_sigreturn - * sigtimedwait sys32_rt_sigtimedwait * sigqueueinfo sys32_rt_sigqueueinfo * sigsuspend sys32_rt_sigsuspend * @@ -438,9 +444,9 @@ long sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) } -static long copy_siginfo_to_user32(compat_siginfo_t __user *d, siginfo_t *s) +int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s) { - long err; + int err; if (!access_ok (VERIFY_WRITE, d, sizeof(*d))) return -EFAULT; @@ -493,35 +499,6 @@ static long copy_siginfo_to_user32(compat_siginfo_t __user *d, siginfo_t *s) return err; } -long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, compat_siginfo_t __user *uinfo, - struct compat_timespec __user *uts, compat_size_t sigsetsize) -{ - sigset_t s; - compat_sigset_t s32; - struct timespec t; - int ret; - mm_segment_t old_fs = get_fs(); - siginfo_t info; - - if (copy_from_user(&s32, uthese, sizeof(compat_sigset_t))) - return -EFAULT; - sigset_from_compat(&s, &s32); - if (uts && get_compat_timespec(&t, uts)) - return -EFAULT; - set_fs(KERNEL_DS); - /* The __user pointer casts are valid because of the set_fs() */ - ret = sys_rt_sigtimedwait((sigset_t __user *) &s, - uinfo ? (siginfo_t __user *) &info : NULL, - uts ? (struct timespec __user *) &t : NULL, - sigsetsize); - set_fs(old_fs); - if (ret >= 0 && uinfo) { - if (copy_siginfo_to_user32(uinfo, &info)) - return -EFAULT; - } - return ret; -} - /* * Note: it is necessary to treat pid and sig as unsigned ints, with the * corresponding cast to a signed int to insure that the proper conversion @@ -579,14 +556,12 @@ int sys32_rt_sigsuspend(compat_sigset_t __user * unewset, size_t sigsetsize, int schedule(); if (do_signal32(&saveset, regs)) /* - * If a signal handler needs to be called, - * do_signal32() has set R3 to the signal number (the - * first argument of the signal handler), so don't - * overwrite that with EINTR ! - * In the other cases, do_signal32() doesn't touch - * R3, so it's still set to -EINTR (see above). + * Returning 0 means we return to userspace via + * ret_from_except and thus restore all user + * registers from *regs. This is what we need + * to do when a signal has been delivered. */ - return regs->gpr[3]; + return 0; } } @@ -645,9 +620,9 @@ int sys32_sigaltstack(u32 __new, u32 __old, int r5, * Set up a signal frame for a "real-time" signal handler * (one which gets siginfo). */ -static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, - siginfo_t *info, sigset_t *oldset, - struct pt_regs * regs, unsigned long newsp) +static int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, + siginfo_t *info, sigset_t *oldset, + struct pt_regs * regs, unsigned long newsp) { struct rt_sigframe32 __user *rt_sf; struct mcontext32 __user *frame; @@ -696,7 +671,10 @@ static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, regs->trap = 0; regs->result = 0; - return; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + + return 1; badframe: #if DEBUG_SIG @@ -704,6 +682,7 @@ badframe: regs, frame, newsp); #endif force_sigsegv(sig, current); + return 0; } static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs, int sig) @@ -814,7 +793,7 @@ long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, /* * OK, we're invoking a handler */ -static void handle_signal32(unsigned long sig, struct k_sigaction *ka, +static int handle_signal32(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, struct pt_regs * regs, unsigned long newsp) { @@ -859,7 +838,10 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka, regs->trap = 0; regs->result = 0; - return; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + + return 1; badframe: #if DEBUG_SIG @@ -867,6 +849,7 @@ badframe: regs, frame, *newspp); #endif force_sigsegv(sig, current); + return 0; } /* @@ -976,11 +959,11 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (ka.sa.sa_flags & SA_SIGINFO) - handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp); + ret = handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp); else - handle_signal32(signr, &ka, &info, oldset, regs, newsp); + ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp); - if (!(ka.sa.sa_flags & SA_NODEFER)) { + if (ret && !(ka.sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka.sa.sa_mask); @@ -989,5 +972,5 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) spin_unlock_irq(¤t->sighand->siglock); } - return 1; + return ret; } diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index 75ced7528..2eb4f5e64 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c @@ -22,9 +22,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -38,23 +36,16 @@ #include #include #include -#include #include #include -#include #include -#include -#include -#include #include -#include -#include "open_pic.h" #include -#include #include #include -#include -#include +#include + +#include "mpic.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -63,7 +54,6 @@ #endif int smp_threads_ready; -unsigned long cache_decay_ticks; cpumask_t cpu_possible_map = CPU_MASK_NONE; cpumask_t cpu_online_map = CPU_MASK_NONE; @@ -78,123 +68,12 @@ static volatile unsigned int cpu_callin_map[NR_CPUS]; extern unsigned char stab_array[]; -extern int cpu_idle(void *unused); void smp_call_function_interrupt(void); -extern long register_vpa(unsigned long flags, unsigned long proc, - unsigned long vpa); int smt_enabled_at_boot = 1; -/* Low level assembly function used to backup CPU 0 state */ -extern void __save_cpu_setup(void); - -extern void pseries_secondary_smp_init(unsigned long); - -#ifdef CONFIG_PPC_ISERIES -static unsigned long iSeries_smp_message[NR_CPUS]; - -void iSeries_smp_message_recv( struct pt_regs * regs ) -{ - int cpu = smp_processor_id(); - int msg; - - if ( num_online_cpus() < 2 ) - return; - - for ( msg = 0; msg < 4; ++msg ) - if ( test_and_clear_bit( msg, &iSeries_smp_message[cpu] ) ) - smp_message_recv( msg, regs ); -} - -static inline void smp_iSeries_do_message(int cpu, int msg) -{ - set_bit(msg, &iSeries_smp_message[cpu]); - HvCall_sendIPI(&(paca[cpu])); -} - -static void smp_iSeries_message_pass(int target, int msg) -{ - int i; - - if (target < NR_CPUS) - smp_iSeries_do_message(target, msg); - else { - for_each_online_cpu(i) { - if (target == MSG_ALL_BUT_SELF - && i == smp_processor_id()) - continue; - smp_iSeries_do_message(i, msg); - } - } -} - -static int smp_iSeries_numProcs(void) -{ - unsigned np, i; - - np = 0; - for (i=0; i < NR_CPUS; ++i) { - if (paca[i].lppaca.xDynProcStatus < 2) { - cpu_set(i, cpu_possible_map); - cpu_set(i, cpu_present_map); - ++np; - } - } - return np; -} - -static int smp_iSeries_probe(void) -{ - unsigned i; - unsigned np = 0; - - for (i=0; i < NR_CPUS; ++i) { - if (paca[i].lppaca.xDynProcStatus < 2) { - /*paca[i].active = 1;*/ - ++np; - } - } - - return np; -} - -static void smp_iSeries_kick_cpu(int nr) -{ - BUG_ON(nr < 0 || nr >= NR_CPUS); - - /* Verify that our partition has a processor nr */ - if (paca[nr].lppaca.xDynProcStatus >= 2) - return; - - /* The processor is currently spinning, waiting - * for the cpu_start field to become non-zero - * After we set cpu_start, the processor will - * continue on to secondary_start in iSeries_head.S - */ - paca[nr].cpu_start = 1; -} - -static void __devinit smp_iSeries_setup_cpu(int nr) -{ -} - -static struct smp_ops_t iSeries_smp_ops = { - .message_pass = smp_iSeries_message_pass, - .probe = smp_iSeries_probe, - .kick_cpu = smp_iSeries_kick_cpu, - .setup_cpu = smp_iSeries_setup_cpu, -}; - -/* This is called very early. */ -void __init smp_init_iSeries(void) -{ - smp_ops = &iSeries_smp_ops; - systemcfg->processorCount = smp_iSeries_numProcs(); -} -#endif - #ifdef CONFIG_PPC_MULTIPLATFORM -void smp_openpic_message_pass(int target, int msg) +void smp_mpic_message_pass(int target, int msg) { /* make sure we're sending something that translates to an IPI */ if ( msg > 0x3 ){ @@ -205,242 +84,52 @@ void smp_openpic_message_pass(int target, int msg) switch ( target ) { case MSG_ALL: - openpic_cause_IPI(msg, 0xffffffff); + mpic_send_ipi(msg, 0xffffffff); break; case MSG_ALL_BUT_SELF: - openpic_cause_IPI(msg, - 0xffffffff & ~(1 << smp_processor_id())); + mpic_send_ipi(msg, 0xffffffff & ~(1 << smp_processor_id())); break; default: - openpic_cause_IPI(msg, 1< 1) - openpic_request_IPIs(); + mpic_request_ipis(); return nr_cpus; } -static void __devinit smp_openpic_setup_cpu(int cpu) -{ - do_openpic_setup_cpu(); -} - -#endif /* CONFIG_PPC_MULTIPLATFORM */ - -#ifdef CONFIG_PPC_PSERIES - -/* Get state of physical CPU. - * Return codes: - * 0 - The processor is in the RTAS stopped state - * 1 - stop-self is in progress - * 2 - The processor is not in the RTAS stopped state - * -1 - Hardware Error - * -2 - Hardware Busy, Try again later. - */ -int query_cpu_stopped(unsigned int pcpu) -{ - int cpu_status; - int status, qcss_tok; - - DBG(" -> query_cpu_stopped(%d)\n", pcpu); - qcss_tok = rtas_token("query-cpu-stopped-state"); - if (qcss_tok == RTAS_UNKNOWN_SERVICE) - return -1; - status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu); - if (status != 0) { - printk(KERN_ERR - "RTAS query-cpu-stopped-state failed: %i\n", status); - return status; - } - - DBG(" <- query_cpu_stopped(), status: %d\n", cpu_status); - - return cpu_status; -} - -#ifdef CONFIG_HOTPLUG_CPU - -int __cpu_disable(void) -{ - /* FIXME: go put this in a header somewhere */ - extern void xics_migrate_irqs_away(void); - - systemcfg->processorCount--; - - /*fix boot_cpuid here*/ - if (smp_processor_id() == boot_cpuid) - boot_cpuid = any_online_cpu(cpu_online_map); - - /* FIXME: abstract this to not be platform specific later on */ - xics_migrate_irqs_away(); - return 0; -} - -void __cpu_die(unsigned int cpu) -{ - int tries; - int cpu_status; - unsigned int pcpu = get_hard_smp_processor_id(cpu); - - for (tries = 0; tries < 25; tries++) { - cpu_status = query_cpu_stopped(pcpu); - if (cpu_status == 0 || cpu_status == -1) - break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); - } - if (cpu_status != 0) { - printk("Querying DEAD? cpu %i (%i) shows %i\n", - cpu, pcpu, cpu_status); - } - - /* Isolation and deallocation are definatly done by - * drslot_chrp_cpu. If they were not they would be - * done here. Change isolate state to Isolate and - * change allocation-state to Unusable. - */ - paca[cpu].cpu_start = 0; - - /* So we can recognize if it fails to come up next time. */ - cpu_callin_map[cpu] = 0; -} - -/* Kill this cpu */ -void cpu_die(void) -{ - local_irq_disable(); - /* Some hardware requires clearing the CPPR, while other hardware does not - * it is safe either way - */ - pSeriesLP_cppr_info(0, 0); - rtas_stop_self(); - /* Should never get here... */ - BUG(); - for(;;); -} - -/* Search all cpu device nodes for an offline logical cpu. If a - * device node has a "ibm,my-drc-index" property (meaning this is an - * LPAR), paranoid-check whether we own the cpu. For each "thread" - * of a cpu, if it is offline and has the same hw index as before, - * grab that in preference. - */ -static unsigned int find_physical_cpu_to_start(unsigned int old_hwindex) -{ - struct device_node *np = NULL; - unsigned int best = -1U; - - while ((np = of_find_node_by_type(np, "cpu"))) { - int nr_threads, len; - u32 *index = (u32 *)get_property(np, "ibm,my-drc-index", NULL); - u32 *tid = (u32 *) - get_property(np, "ibm,ppc-interrupt-server#s", &len); - - if (!tid) - tid = (u32 *)get_property(np, "reg", &len); - - if (!tid) - continue; - - /* If there is a drc-index, make sure that we own - * the cpu. - */ - if (index) { - int state; - int rc = rtas_get_sensor(9003, *index, &state); - if (rc != 0 || state != 1) - continue; - } - - nr_threads = len / sizeof(u32); - - while (nr_threads--) { - if (0 == query_cpu_stopped(tid[nr_threads])) { - best = tid[nr_threads]; - if (best == old_hwindex) - goto out; - } - } - } -out: - of_node_put(np); - return best; -} - -/** - * smp_startup_cpu() - start the given cpu - * - * At boot time, there is nothing to do. At run-time, call RTAS with - * the appropriate start location, if the cpu is in the RTAS stopped - * state. - * - * Returns: - * 0 - failure - * 1 - success - */ -static inline int __devinit smp_startup_cpu(unsigned int lcpu) -{ - int status; - unsigned long start_here = __pa((u32)*((unsigned long *) - pseries_secondary_smp_init)); - unsigned int pcpu; - - /* At boot time the cpus are already spinning in hold - * loops, so nothing to do. */ - if (system_state < SYSTEM_RUNNING) - return 1; - - pcpu = find_physical_cpu_to_start(get_hard_smp_processor_id(lcpu)); - if (pcpu == -1U) { - printk(KERN_INFO "No more cpus available, failing\n"); - return 0; - } - - /* Fixup atomic count: it exited inside IRQ handler. */ - paca[lcpu].__current->thread_info->preempt_count = 0; - - /* At boot this is done in prom.c. */ - paca[lcpu].hw_cpu_id = pcpu; - - status = rtas_call(rtas_token("start-cpu"), 3, 1, NULL, - pcpu, start_here, lcpu); - if (status != 0) { - printk(KERN_ERR "start-cpu failed: %i\n", status); - return 0; - } - return 1; -} -#else /* ... CONFIG_HOTPLUG_CPU */ -static inline int __devinit smp_startup_cpu(unsigned int lcpu) +void __devinit smp_mpic_setup_cpu(int cpu) { - return 1; + mpic_setup_this_cpu(); } -#endif /* CONFIG_HOTPLUG_CPU */ -static void smp_pSeries_kick_cpu(int nr) +void __devinit smp_generic_kick_cpu(int nr) { BUG_ON(nr < 0 || nr >= NR_CPUS); - if (!smp_startup_cpu(nr)) - return; - /* * The processor is currently spinning, waiting for the * cpu_start field to become non-zero After we set cpu_start, * the processor will continue on to secondary_start */ paca[nr].cpu_start = 1; + mb(); } -#endif /* CONFIG_PPC_PSERIES */ + +#endif /* CONFIG_PPC_MULTIPLATFORM */ static void __init smp_space_timers(unsigned int max_cpus) { @@ -457,141 +146,6 @@ static void __init smp_space_timers(unsigned int max_cpus) } } -#ifdef CONFIG_PPC_PSERIES -static void vpa_init(int cpu) -{ - unsigned long flags, pcpu = get_hard_smp_processor_id(cpu); - - /* Register the Virtual Processor Area (VPA) */ - flags = 1UL << (63 - 18); - register_vpa(flags, pcpu, __pa((unsigned long)&(paca[cpu].lppaca))); -} - -static inline void smp_xics_do_message(int cpu, int msg) -{ - set_bit(msg, &xics_ipi_message[cpu].value); - mb(); - xics_cause_IPI(cpu); -} - -static void smp_xics_message_pass(int target, int msg) -{ - unsigned int i; - - if (target < NR_CPUS) { - smp_xics_do_message(target, msg); - } else { - for_each_online_cpu(i) { - if (target == MSG_ALL_BUT_SELF - && i == smp_processor_id()) - continue; - smp_xics_do_message(i, msg); - } - } -} - -extern void xics_request_IPIs(void); - -static int __init smp_xics_probe(void) -{ -#ifdef CONFIG_SMP - xics_request_IPIs(); -#endif - - return cpus_weight(cpu_possible_map); -} - -static void __devinit smp_xics_setup_cpu(int cpu) -{ - if (cpu != boot_cpuid) - xics_setup_cpu(); -} - -static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; -static unsigned long timebase = 0; - -static void __devinit pSeries_give_timebase(void) -{ - spin_lock(&timebase_lock); - rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL); - timebase = get_tb(); - spin_unlock(&timebase_lock); - - while (timebase) - barrier(); - rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL); -} - -static void __devinit pSeries_take_timebase(void) -{ - while (!timebase) - barrier(); - spin_lock(&timebase_lock); - set_tb(timebase >> 32, timebase & 0xffffffff); - timebase = 0; - spin_unlock(&timebase_lock); -} - -static struct smp_ops_t pSeries_openpic_smp_ops = { - .message_pass = smp_openpic_message_pass, - .probe = smp_openpic_probe, - .kick_cpu = smp_pSeries_kick_cpu, - .setup_cpu = smp_openpic_setup_cpu, -}; - -static struct smp_ops_t pSeries_xics_smp_ops = { - .message_pass = smp_xics_message_pass, - .probe = smp_xics_probe, - .kick_cpu = smp_pSeries_kick_cpu, - .setup_cpu = smp_xics_setup_cpu, -}; - -/* This is called very early */ -void __init smp_init_pSeries(void) -{ - int ret, i; - - DBG(" -> smp_init_pSeries()\n"); - - if (naca->interrupt_controller == IC_OPEN_PIC) - smp_ops = &pSeries_openpic_smp_ops; - else - smp_ops = &pSeries_xics_smp_ops; - - /* Start secondary threads on SMT systems; primary threads - * are already in the running state. - */ - for_each_present_cpu(i) { - if (query_cpu_stopped(get_hard_smp_processor_id(i)) == 0) { - printk("%16.16x : starting thread\n", i); - DBG("%16.16x : starting thread\n", i); - rtas_call(rtas_token("start-cpu"), 3, 1, &ret, - get_hard_smp_processor_id(i), - __pa((u32)*((unsigned long *) - pseries_secondary_smp_init)), - i); - } - } - - if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) - vpa_init(boot_cpuid); - - /* Non-lpar has additional take/give timebase */ - if (systemcfg->platform == PLATFORM_PSERIES) { - smp_ops->give_timebase = pSeries_give_timebase; - smp_ops->take_timebase = pSeries_take_timebase; - } - - - DBG(" <- smp_init_pSeries()\n"); -} -#endif /* CONFIG_PPC_PSERIES */ - -void smp_local_timer_interrupt(struct pt_regs * regs) -{ - update_process_times(user_mode(regs)); -} - void smp_message_recv(int msg, struct pt_regs *regs) { switch(msg) { @@ -648,7 +202,7 @@ void smp_send_stop(void) * static memory requirements. It also looks cleaner. * Stolen from the i386 version. */ -static spinlock_t call_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock); static struct call_data_struct { void (*func) (void *info); @@ -809,6 +363,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus) { unsigned int cpu; + DBG("smp_prepare_cpus\n"); + /* * setup_cpu may need to be called on the boot cpu. We havent * spun any cpus up but lets be paranoid. @@ -833,9 +389,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) max_cpus = smp_ops->probe(); - /* Backup CPU 0 state if necessary */ - __save_cpu_setup(); - smp_space_timers(max_cpus); for_each_cpu(cpu) @@ -876,6 +429,11 @@ int __devinit __cpu_up(unsigned int cpu) paca[cpu].stab_real = virt_to_abs(tmp); } + /* Make sure callin-map entry is 0 (can be leftover a CPU + * hotplug + */ + cpu_callin_map[cpu] = 0; + /* The information for processor bringup must * be written out to main store before we release * the processor. @@ -883,6 +441,7 @@ int __devinit __cpu_up(unsigned int cpu) mb(); /* wake up cpus */ + DBG("smp: kicking cpu %d\n", cpu); smp_ops->kick_cpu(cpu); /* @@ -900,8 +459,7 @@ int __devinit __cpu_up(unsigned int cpu) * hotplug case. Wait five seconds. */ for (c = 25; c && !cpu_callin_map[cpu]; c--) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + msleep(200); } #endif @@ -922,7 +480,7 @@ int __devinit __cpu_up(unsigned int cpu) return 0; } -extern unsigned int default_distrib_server; + /* Activate a secondary processor. */ int __devinit start_secondary(void *unused) { @@ -939,28 +497,14 @@ int __devinit start_secondary(void *unused) if (smp_ops->take_timebase) smp_ops->take_timebase(); -#ifdef CONFIG_PPC_PSERIES - if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { - vpa_init(cpu); - } - -#ifdef CONFIG_IRQ_ALL_CPUS - /* Put the calling processor into the GIQ. This is really only - * necessary from a secondary thread as the OF start-cpu interface - * performs this function for us on primary threads. - */ - /* TODO: 9005 is #defined in rtas-proc.c -- move to a header */ - rtas_set_indicator(9005, default_distrib_server, 1); -#endif -#endif - spin_lock(&call_lock); cpu_set(cpu, cpu_online_map); spin_unlock(&call_lock); local_irq_enable(); - return cpu_idle(NULL); + cpu_idle(); + return 0; } int setup_profiling_timer(unsigned int multiplier) @@ -981,9 +525,6 @@ void __init smp_cpus_done(unsigned int max_cpus) smp_ops->setup_cpu(boot_cpuid); - /* XXX fix this, xics currently relies on it - Anton */ - smp_threads_ready = 1; - set_cpus_allowed(current, old_mask); /* @@ -994,3 +535,19 @@ void __init smp_cpus_done(unsigned int max_cpus) */ cpu_present_map = cpu_possible_map; } + +#ifdef CONFIG_HOTPLUG_CPU +int __cpu_disable(void) +{ + if (smp_ops->cpu_disable) + return smp_ops->cpu_disable(); + + return -ENOSYS; +} + +void __cpu_die(unsigned int cpu) +{ + if (smp_ops->cpu_die) + smp_ops->cpu_die(cpu); +} +#endif diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c index 2ac5c7d01..979f79dfd 100644 --- a/arch/ppc64/kernel/sys_ppc32.c +++ b/arch/ppc64/kernel/sys_ppc32.c @@ -60,7 +60,6 @@ #include #include #include -#include #include #include @@ -74,6 +73,7 @@ #include #include #include +#include #include "pci.h" @@ -492,6 +492,7 @@ asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct time return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); } +#ifdef CONFIG_SYSVIPC long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, u32 fifth) { @@ -556,6 +557,7 @@ long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, return -ENOSYS; } +#endif /* Note: it is necessary to treat out_fd and in_fd as unsigned ints, * with the corresponding cast to a signed int to insure that the @@ -622,8 +624,11 @@ long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2, error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: @@ -1101,6 +1106,7 @@ asmlinkage long sys32_umask(u32 mask) return sys_umask((int)mask); } +#ifdef CONFIG_SYSCTL struct __sysctl_args32 { u32 name; int nlen; @@ -1150,23 +1156,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) } return error; } - -asmlinkage long sys32_time(compat_time_t __user * tloc) -{ - compat_time_t secs; - - struct timeval tv; - - do_gettimeofday( &tv ); - secs = tv.tv_sec; - - if (tloc) { - if (put_user(secs,tloc)) - secs = -EFAULT; - } - - return secs; -} +#endif asmlinkage int sys32_olduname(struct oldold_utsname __user * name) { @@ -1328,3 +1318,21 @@ long ppc32_timer_create(clockid_t clock, return err; } + +asmlinkage long sys32_add_key(const char __user *_type, + const char __user *_description, + const void __user *_payload, + u32 plen, + u32 ringid) +{ + return sys_add_key(_type, _description, _payload, plen, ringid); +} + +asmlinkage long sys32_request_key(const char __user *_type, + const char __user *_description, + const char __user *_callout_info, + u32 destringid) +{ + return sys_request_key(_type, _description, _callout_info, destringid); +} + diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c index 930b93f3c..365987190 100644 --- a/arch/ppc64/kernel/syscalls.c +++ b/arch/ppc64/kernel/syscalls.c @@ -57,7 +57,8 @@ check_bugs(void) * This is really horribly ugly. */ asmlinkage int -sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fifth) +sys_ipc (uint call, int first, unsigned long second, long third, + void __user *ptr, long fifth) { int version, ret; @@ -67,15 +68,16 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi ret = -ENOSYS; switch (call) { case SEMOP: - ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second, - NULL); + ret = sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, NULL); break; case SEMTIMEDOP: - ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second, + ret = sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, (const struct timespec __user *) fifth); break; case SEMGET: - ret = sys_semget (first, second, third); + ret = sys_semget (first, (int)second, third); break; case SEMCTL: { union semun fourth; @@ -85,11 +87,12 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi break; if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr))) break; - ret = sys_semctl (first, second, third, fourth); + ret = sys_semctl(first, (int)second, third, fourth); break; } case MSGSND: - ret = sys_msgsnd (first, (struct msgbuf __user *) ptr, second, third); + ret = sys_msgsnd(first, (struct msgbuf __user *)ptr, + (size_t)second, third); break; case MSGRCV: switch (version) { @@ -103,27 +106,29 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi (struct ipc_kludge __user *) ptr, sizeof (tmp)) ? -EFAULT : 0)) break; - ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, - third); + ret = sys_msgrcv(first, tmp.msgp, (size_t) second, + tmp.msgtyp, third); break; } default: ret = sys_msgrcv (first, (struct msgbuf __user *) ptr, - second, fifth, third); + (size_t)second, fifth, third); break; } break; case MSGGET: - ret = sys_msgget ((key_t) first, second); + ret = sys_msgget ((key_t)first, (int)second); break; case MSGCTL: - ret = sys_msgctl (first, second, (struct msqid_ds __user *) ptr); + ret = sys_msgctl(first, (int)second, + (struct msqid_ds __user *)ptr); break; case SHMAT: switch (version) { default: { ulong raddr; - ret = do_shmat (first, (char __user *) ptr, second, &raddr); + ret = do_shmat(first, (char __user *) ptr, + (int)second, &raddr); if (ret) break; ret = put_user (raddr, (ulong __user *) third); @@ -133,8 +138,8 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi ret = -EINVAL; if (!segment_eq(get_fs(), get_ds())) break; - ret = do_shmat (first, (char __user *) ptr, second, - (ulong *) third); + ret = do_shmat(first, (char __user *)ptr, + (int)second, (ulong *)third); break; } break; @@ -142,10 +147,11 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi ret = sys_shmdt ((char __user *)ptr); break; case SHMGET: - ret = sys_shmget (first, second, third); + ret = sys_shmget (first, (size_t)second, third); break; case SHMCTL: - ret = sys_shmctl (first, second, (struct shmid_ds __user *) ptr); + ret = sys_shmctl(first, (int)second, + (struct shmid_ds __user *)ptr); break; } diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c index cfc3c0b7b..4eacd4fe4 100644 --- a/arch/ppc64/kernel/sysfs.c +++ b/arch/ppc64/kernel/sysfs.c @@ -6,17 +6,25 @@ #include #include #include +#include +#include +#include + #include #include #include #include #include +#include +#include +#include -/* SMT stuff */ +static DEFINE_PER_CPU(struct cpu, cpu_devices); -#ifndef CONFIG_PPC_ISERIES +/* SMT stuff */ +#ifdef CONFIG_PPC_MULTIPLATFORM /* default to snooze disabled */ DEFINE_PER_CPU(unsigned long, smt_snooze_delay); @@ -92,19 +100,6 @@ static int __init setup_smt_snooze_delay(char *str) } __setup("smt-snooze-delay=", setup_smt_snooze_delay); -#endif - - -/* PMC stuff */ - -#ifdef CONFIG_PPC_ISERIES -void ppc64_enable_pmcs(void) -{ - /* XXX Implement for iseries */ -} -#endif - -#ifdef CONFIG_PPC_MULTIPLATFORM /* * Enabling PMCs will slow partition context switch times so we only do * it the first time we write to the PMCs. @@ -165,10 +160,8 @@ void ppc64_enable_pmcs(void) #ifdef CONFIG_PPC_PSERIES /* instruct hypervisor to maintain PMCs */ - if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { - char *ptr = (char *)&paca[smp_processor_id()].lppaca; - ptr[0xBB] = 1; - } + if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) + get_paca()->lppaca.pmcregs_in_use = 1; /* * On SMT machines we have to set the run latch in the ctrl register @@ -181,6 +174,14 @@ void ppc64_enable_pmcs(void) } #endif /* CONFIG_PPC_PSERIES */ } + +#else + +/* PMC stuff */ +void ppc64_enable_pmcs(void) +{ + /* XXX Implement for iseries */ +} #endif /* CONFIG_PPC_MULTIPLATFORM */ EXPORT_SYMBOL(ppc64_enable_pmcs); @@ -259,8 +260,18 @@ static SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7); static SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8); static SYSDEV_ATTR(purr, 0600, show_purr, NULL); -static void __init register_cpu_pmc(struct sys_device *s) +static void register_cpu_online(unsigned int cpu) { + struct cpu *c = &per_cpu(cpu_devices, cpu); + struct sys_device *s = &c->sysdev; + +#ifndef CONFIG_PPC_ISERIES + if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) + sysdev_create_file(s, &attr_smt_snooze_delay); +#endif + + /* PMC stuff */ + sysdev_create_file(s, &attr_mmcr0); sysdev_create_file(s, &attr_mmcr1); @@ -283,6 +294,65 @@ static void __init register_cpu_pmc(struct sys_device *s) sysdev_create_file(s, &attr_purr); } +#ifdef CONFIG_HOTPLUG_CPU +static void unregister_cpu_online(unsigned int cpu) +{ + struct cpu *c = &per_cpu(cpu_devices, cpu); + struct sys_device *s = &c->sysdev; + + BUG_ON(c->no_control); + +#ifndef CONFIG_PPC_ISERIES + if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) + sysdev_remove_file(s, &attr_smt_snooze_delay); +#endif + + /* PMC stuff */ + + sysdev_remove_file(s, &attr_mmcr0); + sysdev_remove_file(s, &attr_mmcr1); + + if (cur_cpu_spec->cpu_features & CPU_FTR_MMCRA) + sysdev_remove_file(s, &attr_mmcra); + + sysdev_remove_file(s, &attr_pmc1); + sysdev_remove_file(s, &attr_pmc2); + sysdev_remove_file(s, &attr_pmc3); + sysdev_remove_file(s, &attr_pmc4); + sysdev_remove_file(s, &attr_pmc5); + sysdev_remove_file(s, &attr_pmc6); + + if (cur_cpu_spec->cpu_features & CPU_FTR_PMC8) { + sysdev_remove_file(s, &attr_pmc7); + sysdev_remove_file(s, &attr_pmc8); + } + + if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) + sysdev_remove_file(s, &attr_purr); +} +#endif /* CONFIG_HOTPLUG_CPU */ + +static int __devinit sysfs_cpu_notify(struct notifier_block *self, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned int)(long)hcpu; + + switch (action) { + case CPU_ONLINE: + register_cpu_online(cpu); + break; +#ifdef CONFIG_HOTPLUG_CPU + case CPU_DEAD: + unregister_cpu_online(cpu); + break; +#endif + } + return NOTIFY_OK; +} + +static struct notifier_block __devinitdata sysfs_cpu_nb = { + .notifier_call = sysfs_cpu_notify, +}; /* NUMA stuff */ @@ -312,19 +382,15 @@ static void register_nodes(void) } #endif - -/* Only valid if CPU is online. */ +/* Only valid if CPU is present. */ static ssize_t show_physical_id(struct sys_device *dev, char *buf) { struct cpu *cpu = container_of(dev, struct cpu, sysdev); - return sprintf(buf, "%u\n", get_hard_smp_processor_id(cpu->sysdev.id)); + return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id)); } static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL); - -static DEFINE_PER_CPU(struct cpu, cpu_devices); - static int __init topology_init(void) { int cpu; @@ -332,6 +398,8 @@ static int __init topology_init(void) register_nodes(); + register_cpu_notifier(&sysfs_cpu_nb); + for_each_cpu(cpu) { struct cpu *c = &per_cpu(cpu_devices, cpu); @@ -345,19 +413,19 @@ static int __init topology_init(void) * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ +#ifdef CONFIG_HOTPLUG_CPU if (systemcfg->platform != PLATFORM_PSERIES_LPAR) +#endif c->no_control = 1; - register_cpu(c, cpu, parent); + if (cpu_online(cpu) || (c->no_control == 0)) { + register_cpu(c, cpu, parent); - register_cpu_pmc(&c->sysdev); - - sysdev_create_file(&c->sysdev, &attr_physical_id); + sysdev_create_file(&c->sysdev, &attr_physical_id); + } -#ifndef CONFIG_PPC_ISERIES - if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) - sysdev_create_file(&c->sysdev, &attr_smt_snooze_delay); -#endif + if (cpu_online(cpu)) + register_cpu_online(cpu); } return 0; diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index ef44a3ec4..3d88a7086 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -65,8 +66,7 @@ #include #include #include - -void smp_local_timer_interrupt(struct pt_regs *); +#include u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; @@ -91,7 +91,7 @@ unsigned long xtime_sync_interval; unsigned long tb_to_xs; unsigned tb_to_us; unsigned long processor_freq; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); unsigned long tb_to_ns_scale; unsigned long tb_to_ns_shift; @@ -142,16 +142,54 @@ static __inline__ void timer_check_rtc(void) } } +/* + * This version of gettimeofday has microsecond resolution. + */ +static inline void __do_gettimeofday(struct timeval *tv, unsigned long tb_val) +{ + unsigned long sec, usec, tb_ticks; + unsigned long xsec, tb_xsec; + struct gettimeofday_vars * temp_varp; + unsigned long temp_tb_to_xs, temp_stamp_xsec; + + /* + * These calculations are faster (gets rid of divides) + * if done in units of 1/2^20 rather than microseconds. + * The conversion to microseconds at the end is done + * without a divide (and in fact, without a multiply) + */ + tb_ticks = tb_val - do_gtod.tb_orig_stamp; + temp_varp = do_gtod.varp; + temp_tb_to_xs = temp_varp->tb_to_xs; + temp_stamp_xsec = temp_varp->stamp_xsec; + tb_xsec = mulhdu( tb_ticks, temp_tb_to_xs ); + xsec = temp_stamp_xsec + tb_xsec; + sec = xsec / XSEC_PER_SEC; + xsec -= sec * XSEC_PER_SEC; + usec = (xsec * USEC_PER_SEC)/XSEC_PER_SEC; + + tv->tv_sec = sec; + tv->tv_usec = usec; +} + +void do_gettimeofday(struct timeval *tv) +{ + __do_gettimeofday(tv, get_tb()); +} + +EXPORT_SYMBOL(do_gettimeofday); + /* Synchronize xtime with do_gettimeofday */ -static __inline__ void timer_sync_xtime( unsigned long cur_tb ) +static inline void timer_sync_xtime(unsigned long cur_tb) { struct timeval my_tv; - if ( cur_tb > next_xtime_sync_tb ) { + if (cur_tb > next_xtime_sync_tb) { next_xtime_sync_tb = cur_tb + xtime_sync_interval; - do_gettimeofday( &my_tv ); - if ( xtime.tv_sec <= my_tv.tv_sec ) { + __do_gettimeofday(&my_tv, cur_tb); + + if (xtime.tv_sec <= my_tv.tv_sec) { xtime.tv_sec = my_tv.tv_sec; xtime.tv_nsec = my_tv.tv_usec * 1000; } @@ -228,7 +266,7 @@ static void iSeries_tb_recal(void) /* * For iSeries shared processors, we have to let the hypervisor * set the hardware decrementer. We set a virtual decrementer - * in the ItLpPaca and call the hypervisor if the virtual + * in the lppaca and call the hypervisor if the virtual * decrementer is less than the current value in the hardware * decrementer. (almost always the new decrementer value will * be greater than the current hardware decementer so the hypervisor @@ -254,11 +292,9 @@ int timer_interrupt(struct pt_regs * regs) profile_tick(CPU_PROFILING, regs); #endif - lpaca->lppaca.xIntDword.xFields.xDecrInt = 0; + lpaca->lppaca.int_dword.fields.decr_int = 0; while (lpaca->next_jiffy_update_tb <= (cur_tb = get_tb())) { - -#ifdef CONFIG_SMP /* * We cannot disable the decrementer, so in the period * between this cpu's being marked offline in cpu_online_map @@ -267,8 +303,7 @@ int timer_interrupt(struct pt_regs * regs) * is the case. */ if (!cpu_is_offline(cpu)) - smp_local_timer_interrupt(regs); -#endif + update_process_times(user_mode(regs)); /* * No need to check whether cpu is offline here; boot_cpuid * should have been fixed up by now. @@ -277,7 +312,7 @@ int timer_interrupt(struct pt_regs * regs) write_seqlock(&xtime_lock); tb_last_stamp = lpaca->next_jiffy_update_tb; do_timer(regs); - timer_sync_xtime( cur_tb ); + timer_sync_xtime(lpaca->next_jiffy_update_tb); timer_check_rtc(); write_sequnlock(&xtime_lock); if ( adjusting_time && (time_adjust == 0) ) @@ -316,36 +351,6 @@ unsigned long long sched_clock(void) return mulhdu(get_tb(), tb_to_ns_scale) << tb_to_ns_shift; } -/* - * This version of gettimeofday has microsecond resolution. - */ -void do_gettimeofday(struct timeval *tv) -{ - unsigned long sec, usec, tb_ticks; - unsigned long xsec, tb_xsec; - struct gettimeofday_vars * temp_varp; - unsigned long temp_tb_to_xs, temp_stamp_xsec; - - /* These calculations are faster (gets rid of divides) - * if done in units of 1/2^20 rather than microseconds. - * The conversion to microseconds at the end is done - * without a divide (and in fact, without a multiply) */ - tb_ticks = get_tb() - do_gtod.tb_orig_stamp; - temp_varp = do_gtod.varp; - temp_tb_to_xs = temp_varp->tb_to_xs; - temp_stamp_xsec = temp_varp->stamp_xsec; - tb_xsec = mulhdu( tb_ticks, temp_tb_to_xs ); - xsec = temp_stamp_xsec + tb_xsec; - sec = xsec / XSEC_PER_SEC; - xsec -= sec * XSEC_PER_SEC; - usec = (xsec * USEC_PER_SEC)/XSEC_PER_SEC; - - tv->tv_sec = sec; - tv->tv_usec = usec; -} - -EXPORT_SYMBOL(do_gettimeofday); - int do_settimeofday(struct timespec *tv) { time_t wtm_sec, new_sec = tv->tv_sec; @@ -421,56 +426,6 @@ int do_settimeofday(struct timespec *tv) EXPORT_SYMBOL(do_settimeofday); -/* - * This function is a copy of the architecture independent function - * but which calls do_settimeofday rather than setting the xtime - * fields itself. This way, the fields which are used for - * do_settimeofday get updated too. - */ -long ppc64_sys32_stime(int __user * tptr) -{ - int value; - struct timespec myTimeval; - - if (!capable(CAP_SYS_TIME)) - return -EPERM; - - if (get_user(value, tptr)) - return -EFAULT; - - myTimeval.tv_sec = value; - myTimeval.tv_nsec = 0; - - do_settimeofday(&myTimeval); - - return 0; -} - -/* - * This function is a copy of the architecture independent function - * but which calls do_settimeofday rather than setting the xtime - * fields itself. This way, the fields which are used for - * do_settimeofday get updated too. - */ -long ppc64_sys_stime(long __user * tptr) -{ - long value; - struct timespec myTimeval; - - if (!capable(CAP_SYS_TIME)) - return -EPERM; - - if (get_user(value, tptr)) - return -EFAULT; - - myTimeval.tv_sec = value; - myTimeval.tv_nsec = 0; - - do_settimeofday(&myTimeval); - - return 0; -} - void __init time_init(void) { /* This function is only called on the boot processor */ diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c index 90700b414..bc245a22b 100644 --- a/arch/ppc64/kernel/traps.c +++ b/arch/ppc64/kernel/traps.c @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include @@ -37,11 +39,8 @@ #include #include #include - -#ifdef CONFIG_PPC_PSERIES -/* This is true if we are using the firmware NMI handler (typically LPAR) */ -extern int fwnmi_active; -#endif +#include +#include #ifdef CONFIG_DEBUGGER int (*__debugger)(struct pt_regs *regs); @@ -61,11 +60,25 @@ EXPORT_SYMBOL(__debugger_dabr_match); EXPORT_SYMBOL(__debugger_fault_handler); #endif +struct notifier_block *ppc64_die_chain; +static DEFINE_SPINLOCK(die_notifier_lock); + +int register_die_notifier(struct notifier_block *nb) +{ + int err = 0; + unsigned long flags; + + spin_lock_irqsave(&die_notifier_lock, flags); + err = notifier_chain_register(&ppc64_die_chain, nb); + spin_unlock_irqrestore(&die_notifier_lock, flags); + return err; +} + /* * Trap & Exception support */ -static spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(die_lock); int die(const char *str, struct pt_regs *regs, long err) { @@ -115,6 +128,7 @@ int die(const char *str, struct pt_regs *regs, long err) } if (nl) printk("\n"); + print_modules(); show_regs(regs); bust_spinlocks(0); spin_unlock_irq(&die_lock); @@ -124,8 +138,7 @@ int die(const char *str, struct pt_regs *regs, long err) if (panic_on_oops) { printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(5 * HZ); + ssleep(5); panic("Fatal exception"); } do_exit(SIGSEGV); @@ -133,8 +146,7 @@ int die(const char *str, struct pt_regs *regs, long err) return 0; } -static void -_exception(int signr, struct pt_regs *regs, int code, unsigned long addr) +void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) { siginfo_t info; @@ -150,53 +162,11 @@ _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) force_sig_info(signr, &info, current); } -#ifdef CONFIG_PPC_PSERIES -/* Get the error information for errors coming through the - * FWNMI vectors. The pt_regs' r3 will be updated to reflect - * the actual r3 if possible, and a ptr to the error log entry - * will be returned if found. - */ -static struct rtas_error_log *FWNMI_get_errinfo(struct pt_regs *regs) +void system_reset_exception(struct pt_regs *regs) { - unsigned long errdata = regs->gpr[3]; - struct rtas_error_log *errhdr = NULL; - unsigned long *savep; - - if ((errdata >= 0x7000 && errdata < 0x7fff0) || - (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) { - savep = __va(errdata); - regs->gpr[3] = savep[0]; /* restore original r3 */ - errhdr = (struct rtas_error_log *)(savep + 1); - } else { - printk("FWNMI: corrupt r3\n"); - } - return errhdr; -} - -/* Call this when done with the data returned by FWNMI_get_errinfo. - * It will release the saved data area for other CPUs in the - * partition to receive FWNMI errors. - */ -static void FWNMI_release_errinfo(void) -{ - int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL); - if (ret != 0) - printk("FWNMI: nmi-interlock failed: %d\n", ret); -} -#endif - -void -SystemResetException(struct pt_regs *regs) -{ -#ifdef CONFIG_PPC_PSERIES - if (fwnmi_active) { - struct rtas_error_log *errhdr = FWNMI_get_errinfo(regs); - if (errhdr) { - /* XXX Should look at FWNMI information */ - } - FWNMI_release_errinfo(); - } -#endif + /* See if any machine dependent calls */ + if (ppc_md.system_reset_exception) + ppc_md.system_reset_exception(regs); die("System Reset", regs, 0); @@ -207,64 +177,16 @@ SystemResetException(struct pt_regs *regs) /* What should we do here? We could issue a shutdown or hard reset. */ } -#ifdef CONFIG_PPC_PSERIES -/* - * See if we can recover from a machine check exception. - * This is only called on power4 (or above) and only via - * the Firmware Non-Maskable Interrupts (fwnmi) handler - * which provides the error analysis for us. - * - * Return 1 if corrected (or delivered a signal). - * Return 0 if there is nothing we can do. - */ -static int recover_mce(struct pt_regs *regs, struct rtas_error_log err) +void machine_check_exception(struct pt_regs *regs) { - if (err.disposition == RTAS_DISP_FULLY_RECOVERED) { - /* Platform corrected itself */ - return 1; - } else if ((regs->msr & MSR_RI) && - user_mode(regs) && - err.severity == RTAS_SEVERITY_ERROR_SYNC && - err.disposition == RTAS_DISP_NOT_RECOVERED && - err.target == RTAS_TARGET_MEMORY && - err.type == RTAS_TYPE_ECC_UNCORR && - !(current->pid == 0 || current->pid == 1)) { - /* Kill off a user process with an ECC error */ - printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", - current->pid); - /* XXX something better for ECC error? */ - _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); - return 1; - } - return 0; -} -#endif + int recover = 0; -/* - * Handle a machine check. - * - * Note that on Power 4 and beyond Firmware Non-Maskable Interrupts (fwnmi) - * should be present. If so the handler which called us tells us if the - * error was recovered (never true if RI=0). - * - * On hardware prior to Power 4 these exceptions were asynchronous which - * means we can't tell exactly where it occurred and so we can't recover. - */ -void -MachineCheckException(struct pt_regs *regs) -{ -#ifdef CONFIG_PPC_PSERIES - struct rtas_error_log err, *errp; - - if (fwnmi_active) { - errp = FWNMI_get_errinfo(regs); - if (errp) - err = *errp; - FWNMI_release_errinfo(); /* frees errp */ - if (errp && recover_mce(regs, err)) - return; - } -#endif + /* See if any machine dependent calls */ + if (ppc_md.machine_check_exception) + recover = ppc_md.machine_check_exception(regs); + + if (recover) + return; if (debugger_fault_handler(regs)) return; @@ -275,8 +197,7 @@ MachineCheckException(struct pt_regs *regs) panic("Unrecoverable Machine check"); } -void -UnknownException(struct pt_regs *regs) +void unknown_exception(struct pt_regs *regs) { printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n", regs->nip, regs->msr, regs->trap); @@ -284,19 +205,23 @@ UnknownException(struct pt_regs *regs) _exception(SIGTRAP, regs, 0, 0); } -void -InstructionBreakpointException(struct pt_regs *regs) +void instruction_breakpoint_exception(struct pt_regs *regs) { + if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5, + 5, SIGTRAP) == NOTIFY_STOP) + return; if (debugger_iabr_match(regs)) return; _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); } -void -SingleStepException(struct pt_regs *regs) +void single_step_exception(struct pt_regs *regs) { regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ + if (notify_die(DIE_SSTEP, "single_step", regs, 5, + 5, SIGTRAP) == NOTIFY_STOP) + return; if (debugger_sstep(regs)) return; @@ -312,7 +237,7 @@ SingleStepException(struct pt_regs *regs) static inline void emulate_single_step(struct pt_regs *regs) { if (regs->msr & MSR_SE) - SingleStepException(regs); + single_step_exception(regs); } static void parse_fpe(struct pt_regs *regs) @@ -419,7 +344,7 @@ extern struct bug_entry __start___bug_table[], __stop___bug_table[]; #define module_find_bug(x) NULL #endif -static struct bug_entry *find_bug(unsigned long bugaddr) +struct bug_entry *find_bug(unsigned long bugaddr) { struct bug_entry *bug; @@ -429,7 +354,7 @@ static struct bug_entry *find_bug(unsigned long bugaddr) return module_find_bug(bugaddr); } -int +static int check_bug_trap(struct pt_regs *regs) { struct bug_entry *bug; @@ -456,9 +381,11 @@ check_bug_trap(struct pt_regs *regs) return 0; } -void -ProgramCheckException(struct pt_regs *regs) +void program_check_exception(struct pt_regs *regs) { + if (debugger_fault_handler(regs)) + return; + if (regs->msr & 0x100000) { /* IEEE FP exception */ parse_fpe(regs); @@ -470,6 +397,9 @@ ProgramCheckException(struct pt_regs *regs) } else if (regs->msr & 0x20000) { /* trap exception */ + if (notify_die(DIE_BPT, "breakpoint", regs, 5, + 5, SIGTRAP) == NOTIFY_STOP) + return; if (debugger_bpt(regs)) return; @@ -498,14 +428,14 @@ ProgramCheckException(struct pt_regs *regs) } } -void KernelFPUnavailableException(struct pt_regs *regs) +void kernel_fp_unavailable_exception(struct pt_regs *regs) { printk(KERN_EMERG "Unrecoverable FP Unavailable Exception " "%lx at %lx\n", regs->trap, regs->nip); die("Unrecoverable FP Unavailable Exception", regs, SIGABRT); } -void AltivecUnavailableException(struct pt_regs *regs) +void altivec_unavailable_exception(struct pt_regs *regs) { #ifndef CONFIG_ALTIVEC if (user_mode(regs)) { @@ -521,9 +451,6 @@ void AltivecUnavailableException(struct pt_regs *regs) } /* Ensure exceptions are disabled */ -#define MMCR0_PMXE (1UL << (31 - 5)) -#define MMCR0_PMAO (1UL << (31 - 24)) - static void dummy_perf(struct pt_regs *regs) { unsigned int mmcr0 = mfspr(SPRN_MMCR0); @@ -536,14 +463,12 @@ void (*perf_irq)(struct pt_regs *) = dummy_perf; EXPORT_SYMBOL(perf_irq); -void -PerformanceMonitorException(struct pt_regs *regs) +void performance_monitor_exception(struct pt_regs *regs) { perf_irq(regs); } -void -AlignmentException(struct pt_regs *regs) +void alignment_exception(struct pt_regs *regs) { int fixed; @@ -571,8 +496,7 @@ AlignmentException(struct pt_regs *regs) } #ifdef CONFIG_ALTIVEC -void -AltivecAssistException(struct pt_regs *regs) +void altivec_assist_exception(struct pt_regs *regs) { int err; siginfo_t info; diff --git a/arch/ppc64/kernel/u3_iommu.c b/arch/ppc64/kernel/u3_iommu.c index 2bb0b39f6..b6e3bca41 100644 --- a/arch/ppc64/kernel/u3_iommu.c +++ b/arch/ppc64/kernel/u3_iommu.c @@ -91,6 +91,7 @@ static unsigned int *dart; static unsigned int dart_emptyval; static struct iommu_table iommu_table_u3; +static int iommu_table_u3_inited; static int dart_dirty; #define DBG(...) @@ -192,7 +193,6 @@ static int dart_init(struct device_node *dart_node) unsigned int regword; unsigned int i; unsigned long tmp; - struct page *p; if (dart_tablebase == 0 || dart_tablesize == 0) { printk(KERN_INFO "U3-DART: table not allocated, using direct DMA\n"); @@ -209,16 +209,15 @@ static int dart_init(struct device_node *dart_node) * that to work around what looks like a problem with the HT bridge * prefetching into invalid pages and corrupting data */ - tmp = __get_free_pages(GFP_ATOMIC, 1); - if (tmp == 0) - panic("U3-DART: Cannot allocate spare page !"); - dart_emptyval = DARTMAP_VALID | - ((virt_to_abs(tmp) >> PAGE_SHIFT) & DARTMAP_RPNMASK); + tmp = lmb_alloc(PAGE_SIZE, PAGE_SIZE); + if (!tmp) + panic("U3-DART: Cannot allocate spare page!"); + dart_emptyval = DARTMAP_VALID | ((tmp >> PAGE_SHIFT) & DARTMAP_RPNMASK); /* Map in DART registers. FIXME: Use device node to get base address */ dart = ioremap(DART_BASE, 0x7000); if (dart == NULL) - panic("U3-DART: Cannot map registers !"); + panic("U3-DART: Cannot map registers!"); /* Set initial control register contents: table base, * table size and enable bit @@ -227,7 +226,6 @@ static int dart_init(struct device_node *dart_node) ((dart_tablebase >> PAGE_SHIFT) << DARTCNTL_BASE_SHIFT) | (((dart_tablesize >> PAGE_SHIFT) & DARTCNTL_SIZE_MASK) << DARTCNTL_SIZE_SHIFT); - p = virt_to_page(dart_tablebase); dart_vbase = ioremap(virt_to_abs(dart_tablebase), dart_tablesize); /* Fill initial table */ @@ -240,34 +238,67 @@ static int dart_init(struct device_node *dart_node) /* Invalidate DART to get rid of possible stale TLBs */ dart_tlb_invalidate_all(); + printk(KERN_INFO "U3/CPC925 DART IOMMU initialized\n"); + + return 0; +} + +static void iommu_table_u3_setup(void) +{ iommu_table_u3.it_busno = 0; - - /* Units of tce entries */ iommu_table_u3.it_offset = 0; - - /* Set the tce table size - measured in pages */ - iommu_table_u3.it_size = dart_tablesize >> PAGE_SHIFT; + /* it_size is in number of entries */ + iommu_table_u3.it_size = dart_tablesize / sizeof(u32); /* Initialize the common IOMMU code */ iommu_table_u3.it_base = (unsigned long)dart_vbase; iommu_table_u3.it_index = 0; iommu_table_u3.it_blocksize = 1; - iommu_table_u3.it_entrysize = sizeof(u32); iommu_init_table(&iommu_table_u3); /* Reserve the last page of the DART to avoid possible prefetch * past the DART mapped area */ - set_bit(iommu_table_u3.it_mapsize - 1, iommu_table_u3.it_map); + set_bit(iommu_table_u3.it_size - 1, iommu_table_u3.it_map); +} - printk(KERN_INFO "U3/CPC925 DART IOMMU initialized\n"); +static void iommu_dev_setup_u3(struct pci_dev *dev) +{ + struct device_node *dn; - return 0; + /* We only have one iommu table on the mac for now, which makes + * things simple. Setup all PCI devices to point to this table + * + * We must use pci_device_to_OF_node() to make sure that + * we get the real "final" pointer to the device in the + * pci_dev sysdata and not the temporary PHB one + */ + dn = pci_device_to_OF_node(dev); + + if (dn) + dn->iommu_table = &iommu_table_u3; } -void iommu_setup_u3(void) +static void iommu_bus_setup_u3(struct pci_bus *bus) +{ + struct device_node *dn; + + if (!iommu_table_u3_inited) { + iommu_table_u3_inited = 1; + iommu_table_u3_setup(); + } + + dn = pci_bus_to_OF_node(bus); + + if (dn) + dn->iommu_table = &iommu_table_u3; +} + +static void iommu_dev_setup_null(struct pci_dev *dev) { } +static void iommu_bus_setup_null(struct pci_bus *bus) { } + +void iommu_init_early_u3(void) { - struct pci_dev *dev = NULL; struct device_node *dn; /* Find the DART in the device-tree */ @@ -281,26 +312,23 @@ void iommu_setup_u3(void) ppc_md.tce_flush = dart_flush; /* Initialize the DART HW */ - if (dart_init(dn)) - return; - - /* Setup pci_dma ops */ - pci_iommu_init(); - - /* We only have one iommu table on the mac for now, which makes - * things simple. Setup all PCI devices to point to this table - */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - /* We must use pci_device_to_OF_node() to make sure that - * we get the real "final" pointer to the device in the - * pci_dev sysdata and not the temporary PHB one - */ - struct device_node *dn = pci_device_to_OF_node(dev); - if (dn) - dn->iommu_table = &iommu_table_u3; + if (dart_init(dn)) { + /* If init failed, use direct iommu and null setup functions */ + ppc_md.iommu_dev_setup = iommu_dev_setup_null; + ppc_md.iommu_bus_setup = iommu_bus_setup_null; + + /* Setup pci_dma ops */ + pci_direct_iommu_init(); + } else { + ppc_md.iommu_dev_setup = iommu_dev_setup_u3; + ppc_md.iommu_bus_setup = iommu_bus_setup_u3; + + /* Setup pci_dma ops */ + pci_iommu_init(); } } + void __init alloc_u3_dart_table(void) { /* Only reserve DART space if machine has more than 2GB of RAM diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c index 2f0470dbd..d4ccd6f1e 100644 --- a/arch/ppc64/kernel/udbg.c +++ b/arch/ppc64/kernel/udbg.c @@ -11,15 +11,19 @@ #include #define WANT_PPCDBG_TAB /* Only defined here */ +#include +#include #include #include -#include #include #include #include #include #include +extern u8 real_readb(volatile u8 __iomem *addr); +extern void real_writeb(u8 data, volatile u8 __iomem *addr); + struct NS16550 { /* this struct must be packed */ unsigned char rbr; /* 0 */ @@ -47,21 +51,25 @@ struct NS16550 { #define LSR_TEMT 0x40 /* Xmitter empty */ #define LSR_ERR 0x80 /* Error */ -static volatile struct NS16550 *udbg_comport; +static volatile struct NS16550 __iomem *udbg_comport; -void udbg_init_uart(void *comport) +void udbg_init_uart(void __iomem *comport, unsigned int speed) { + u16 dll = speed ? (115200 / speed) : 12; + if (comport) { - udbg_comport = (struct NS16550 *)comport; - udbg_comport->lcr = 0x00; eieio(); - udbg_comport->ier = 0xFF; eieio(); - udbg_comport->ier = 0x00; eieio(); - udbg_comport->lcr = 0x80; eieio(); /* Access baud rate */ - udbg_comport->dll = 12; eieio(); /* 1 = 115200, 2 = 57600, 3 = 38400, 12 = 9600 baud */ - udbg_comport->dlm = 0; eieio(); /* dll >> 8 which should be zero for fast rates; */ - udbg_comport->lcr = 0x03; eieio(); /* 8 data, 1 stop, no parity */ - udbg_comport->mcr = 0x03; eieio(); /* RTS/DTR */ - udbg_comport->fcr = 0x07; eieio(); /* Clear & enable FIFOs */ + udbg_comport = (struct NS16550 __iomem *)comport; + out_8(&udbg_comport->lcr, 0x00); + out_8(&udbg_comport->ier, 0xff); + out_8(&udbg_comport->ier, 0x00); + out_8(&udbg_comport->lcr, 0x80); /* Access baud rate */ + out_8(&udbg_comport->dll, dll & 0xff); /* 1 = 115200, 2 = 57600, + 3 = 38400, 12 = 9600 baud */ + out_8(&udbg_comport->dlm, dll >> 8); /* dll >> 8 which should be zero + for fast rates; */ + out_8(&udbg_comport->lcr, 0x03); /* 8 data, 1 stop, no parity */ + out_8(&udbg_comport->mcr, 0x03); /* RTS/DTR */ + out_8(&udbg_comport->fcr ,0x07); /* Clear & enable FIFOs */ } } @@ -70,7 +78,8 @@ void udbg_init_uart(void *comport) #define SCC_TXRDY 4 #define SCC_RXRDY 1 -static volatile u8 *sccc, *sccd; +static volatile u8 __iomem *sccc; +static volatile u8 __iomem *sccd; static unsigned char scc_inittab[] = { 13, 0, /* set baud rate divisor */ @@ -109,7 +118,7 @@ void udbg_init_scc(struct device_node *np) /* Setup for 57600 8N1 */ addr += 0x20; - sccc = (volatile u8 *) ioremap(addr & PAGE_MASK, PAGE_SIZE) ; + sccc = (volatile u8 * __iomem) ioremap(addr & PAGE_MASK, PAGE_SIZE) ; sccc += addr & ~PAGE_MASK; sccd = sccc + 0x10; @@ -117,13 +126,11 @@ void udbg_init_scc(struct device_node *np) mb(); for (i = 20000; i != 0; --i) - x = *sccc; eieio(); - *sccc = 9; eieio(); /* reset A or B side */ - *sccc = 0xc0; eieio(); - for (i = 0; i < sizeof(scc_inittab); ++i) { - *sccc = scc_inittab[i]; - eieio(); - } + x = in_8(sccc); + out_8(sccc, 0x09); /* reset A or B side */ + out_8(sccc, 0xc0); + for (i = 0; i < sizeof(scc_inittab); ++i) + out_8(sccc, scc_inittab[i]); ppc_md.udbg_putc = udbg_putc; ppc_md.udbg_getc = udbg_getc; @@ -135,9 +142,6 @@ void udbg_init_scc(struct device_node *np) #endif /* CONFIG_PPC_PMAC */ #if CONFIG_PPC_PMAC -extern u8 real_readb(volatile u8 *addr); -extern void real_writeb(u8 data, volatile u8 *addr); - static void udbg_real_putc(unsigned char c) { while ((real_readb(sccc) & SCC_TXRDY) == 0) @@ -149,8 +153,8 @@ static void udbg_real_putc(unsigned char c) void udbg_init_pmac_realmode(void) { - sccc = (volatile u8 *)0x80013020ul; - sccd = (volatile u8 *)0x80013030ul; + sccc = (volatile u8 __iomem *)0x80013020ul; + sccd = (volatile u8 __iomem *)0x80013030ul; ppc_md.udbg_putc = udbg_real_putc; ppc_md.udbg_getc = NULL; @@ -158,25 +162,50 @@ void udbg_init_pmac_realmode(void) } #endif /* CONFIG_PPC_PMAC */ -void udbg_putc(unsigned char c) +#ifdef CONFIG_PPC_MAPLE +void udbg_maple_real_putc(unsigned char c) { if (udbg_comport) { - while ((udbg_comport->lsr & LSR_THRE) == 0) + while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0) /* wait for idle */; - udbg_comport->thr = c; eieio(); + real_writeb(c, &udbg_comport->thr); eieio(); if (c == '\n') { /* Also put a CR. This is for convenience. */ - while ((udbg_comport->lsr & LSR_THRE) == 0) + while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0) /* wait for idle */; - udbg_comport->thr = '\r'; eieio(); + real_writeb('\r', &udbg_comport->thr); eieio(); + } + } +} + +void udbg_init_maple_realmode(void) +{ + udbg_comport = (volatile struct NS16550 __iomem *)0xf40003f8; + + ppc_md.udbg_putc = udbg_maple_real_putc; + ppc_md.udbg_getc = NULL; + ppc_md.udbg_getc_poll = NULL; +} +#endif /* CONFIG_PPC_MAPLE */ + +void udbg_putc(unsigned char c) +{ + if (udbg_comport) { + while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) + /* wait for idle */; + out_8(&udbg_comport->thr, c); + if (c == '\n') { + /* Also put a CR. This is for convenience. */ + while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) + /* wait for idle */; + out_8(&udbg_comport->thr, '\r'); } } #ifdef CONFIG_PPC_PMAC else if (sccc) { - while ((*sccc & SCC_TXRDY) == 0) - eieio(); - *sccd = c; - eieio(); + while ((in_8(sccc) & SCC_TXRDY) == 0) + ; + out_8(sccd, c); if (c == '\n') udbg_putc('\r'); } @@ -186,16 +215,15 @@ void udbg_putc(unsigned char c) int udbg_getc_poll(void) { if (udbg_comport) { - if ((udbg_comport->lsr & LSR_DR) != 0) - return udbg_comport->rbr; + if ((in_8(&udbg_comport->lsr) & LSR_DR) != 0) + return in_8(&udbg_comport->rbr); else return -1; } #ifdef CONFIG_PPC_PMAC else if (sccc) { - eieio(); - if ((*sccc & SCC_RXRDY) != 0) - return *sccd; + if ((in_8(sccc) & SCC_RXRDY) != 0) + return in_8(sccd); else return -1; } @@ -206,16 +234,15 @@ int udbg_getc_poll(void) unsigned char udbg_getc(void) { if (udbg_comport) { - while ((udbg_comport->lsr & LSR_DR) == 0) + while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0) /* wait for char */; - return udbg_comport->rbr; + return in_8(&udbg_comport->rbr); } #ifdef CONFIG_PPC_PMAC else if (sccc) { - eieio(); - while ((*sccc & SCC_RXRDY) == 0) - eieio(); - return *sccd; + while ((in_8(sccc) & SCC_RXRDY) == 0) + ; + return in_8(sccd); } #endif /* CONFIG_PPC_PMAC */ return 0; @@ -295,7 +322,7 @@ void udbg_printf(const char *fmt, ...) /* Special print used by PPCDBG() macro */ void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...) { - unsigned long active_debugs = debug_flags & naca->debug_switch; + unsigned long active_debugs = debug_flags & ppc64_debug_switch; if (active_debugs) { va_list ap; @@ -329,5 +356,5 @@ void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...) unsigned long udbg_ifdebug(unsigned long flags) { - return (flags & naca->debug_switch); + return (flags & ppc64_debug_switch); } diff --git a/arch/ppc64/kernel/vecemu.c b/arch/ppc64/kernel/vecemu.c index 1430ef592..cb207629f 100644 --- a/arch/ppc64/kernel/vecemu.c +++ b/arch/ppc64/kernel/vecemu.c @@ -263,7 +263,7 @@ emulate_altivec(struct pt_regs *regs) unsigned int va, vb, vc, vd; vector128 *vrs; - if (get_user(instr, (unsigned int *) regs->nip)) + if (get_user(instr, (unsigned int __user *) regs->nip)) return -EFAULT; if ((instr >> 26) != 4) return -EINVAL; /* not an altivec instruction */ diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c index 48c4b0a0a..8adddd7ca 100644 --- a/arch/ppc64/kernel/vio.c +++ b/arch/ppc64/kernel/vio.c @@ -158,6 +158,7 @@ void __init iommu_vio_init(void) struct iommu_table *t; struct iommu_table_cb cb; unsigned long cbp; + unsigned long itc_entries; cb.itc_busno = 255; /* Bus 255 is the virtual bus */ cb.itc_virtbus = 0xff; /* Ask for virtual bus */ @@ -165,12 +166,12 @@ void __init iommu_vio_init(void) cbp = virt_to_abs(&cb); HvCallXm_getTceTableParms(cbp); - veth_iommu_table.it_size = cb.itc_size / 2; + itc_entries = cb.itc_size * PAGE_SIZE / sizeof(union tce_entry); + veth_iommu_table.it_size = itc_entries / 2; veth_iommu_table.it_busno = cb.itc_busno; veth_iommu_table.it_offset = cb.itc_offset; veth_iommu_table.it_index = cb.itc_index; veth_iommu_table.it_type = TCE_VB; - veth_iommu_table.it_entrysize = sizeof(union tce_entry); veth_iommu_table.it_blocksize = 1; t = iommu_init_table(&veth_iommu_table); @@ -178,13 +179,12 @@ void __init iommu_vio_init(void) if (!t) printk("Virtual Bus VETH TCE table failed.\n"); - vio_iommu_table.it_size = cb.itc_size - veth_iommu_table.it_size; + vio_iommu_table.it_size = itc_entries - veth_iommu_table.it_size; vio_iommu_table.it_busno = cb.itc_busno; vio_iommu_table.it_offset = cb.itc_offset + - veth_iommu_table.it_size * (PAGE_SIZE/sizeof(union tce_entry)); + veth_iommu_table.it_size; vio_iommu_table.it_index = cb.itc_index; vio_iommu_table.it_type = TCE_VB; - vio_iommu_table.it_entrysize = sizeof(union tce_entry); vio_iommu_table.it_blocksize = 1; t = iommu_init_table(&vio_iommu_table); @@ -511,7 +511,6 @@ static struct iommu_table * vio_build_iommu_table(struct vio_dev *dev) unsigned int *dma_window; struct iommu_table *newTceTable; unsigned long offset; - unsigned long size; int dma_window_property_size; dma_window = (unsigned int *) get_property(dev->dev.platform_data, "ibm,my-dma-window", &dma_window_property_size); @@ -521,38 +520,18 @@ static struct iommu_table * vio_build_iommu_table(struct vio_dev *dev) newTceTable = (struct iommu_table *) kmalloc(sizeof(struct iommu_table), GFP_KERNEL); - /* RPA docs say that #address-cells is always 1 for virtual - devices, but some older boxes' OF returns 2. This should - be removed by GA, unless there is legacy OFs that still - have 2 for #address-cells */ - size = ((dma_window[1+vio_num_address_cells] >> PAGE_SHIFT) << 3) - >> PAGE_SHIFT; - - /* This is just an ugly kludge. Remove as soon as the OF for all - machines actually follow the spec and encodes the offset field - as phys-encode (that is, #address-cells wide)*/ - if (dma_window_property_size == 12) { - size = ((dma_window[1] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT; - } else if (dma_window_property_size == 20) { - size = ((dma_window[4] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT; - } else { - printk(KERN_WARNING "vio_build_iommu_table: Invalid size of ibm,my-dma-window=%i, using 0x80 for size\n", dma_window_property_size); - size = 0x80; - } - /* There should be some code to extract the phys-encoded offset using prom_n_addr_cells(). However, according to a comment on earlier versions, it's always zero, so we don't bother */ offset = dma_window[1] >> PAGE_SHIFT; - /* TCE table size - measured in units of pages of tce table */ - newTceTable->it_size = size; + /* TCE table size - measured in tce entries */ + newTceTable->it_size = dma_window[4] >> PAGE_SHIFT; /* offset for VIO should always be 0 */ newTceTable->it_offset = offset; newTceTable->it_busno = 0; newTceTable->it_index = (unsigned long)dma_window[0]; newTceTable->it_type = TCE_VB; - newTceTable->it_entrysize = sizeof(union tce_entry); return iommu_init_table(newTceTable); } diff --git a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c index 66a810239..74f185ec9 100644 --- a/arch/ppc64/kernel/viopath.c +++ b/arch/ppc64/kernel/viopath.c @@ -64,7 +64,7 @@ static struct viopathStatus { int numberAllocated; } viopathStatus[HVMAXARCHITECTEDLPS]; -static spinlock_t statuslock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(statuslock); /* * For each kind of event we allocate a buffer that is @@ -473,7 +473,7 @@ static int allocateEvents(HvLpIndex remoteLp, int numEvents) parms.used_wait_atomic = 0; parms.sem = &Semaphore; } - mf_allocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */ + mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */ numEvents, &viopath_donealloc, &parms); if (in_atomic()) { while (atomic_read(&wait_atomic)) @@ -582,7 +582,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq) doneAllocParms.used_wait_atomic = 0; doneAllocParms.sem = &Semaphore; - mf_deallocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo, + mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, numReq, &viopath_donealloc, &doneAllocParms); down(&Semaphore); diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index ae15d2215..929dff19c 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -85,13 +84,14 @@ struct xics_ipl { } qirr; }; -static struct xics_ipl *xics_per_cpu[NR_CPUS]; +static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS]; static int xics_irq_8259_cascade = 0; static int xics_irq_8259_cascade_real = 0; static unsigned int default_server = 0xFF; /* also referenced in smp.c... */ unsigned int default_distrib_server = 0; +unsigned int interrupt_server_size = 8; /* * XICS only has a single IPI, so encode the messages per CPU @@ -116,22 +116,22 @@ typedef struct { static int pSeries_xirr_info_get(int n_cpu) { - return xics_per_cpu[n_cpu]->xirr.word; + return in_be32(&xics_per_cpu[n_cpu]->xirr.word); } static void pSeries_xirr_info_set(int n_cpu, int value) { - xics_per_cpu[n_cpu]->xirr.word = value; + out_be32(&xics_per_cpu[n_cpu]->xirr.word, value); } static void pSeries_cppr_info(int n_cpu, u8 value) { - xics_per_cpu[n_cpu]->xirr.bytes[0] = value; + out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value); } static void pSeries_qirr_info(int n_cpu, u8 value) { - xics_per_cpu[n_cpu]->qirr.bytes[0] = value; + out_8(&xics_per_cpu[n_cpu]->qirr.bytes[0], value); } static xics_ops pSeries_ops = { @@ -216,12 +216,15 @@ xics_ops pSeriesLP_ops = { static unsigned int xics_startup(unsigned int virq) { - virq = irq_offset_down(virq); - if (radix_tree_insert(&irq_map, virt_irq_to_real(virq), - &virt_irq_to_real_map[virq]) == -ENOMEM) + unsigned int irq; + + irq = irq_offset_down(virq); + if (radix_tree_insert(&irq_map, virt_irq_to_real(irq), + &virt_irq_to_real_map[irq]) == -ENOMEM) printk(KERN_CRIT "Out of memory creating real -> virtual" " IRQ mapping for irq %u (real 0x%x)\n", - virq, virt_irq_to_real(virq)); + virq, virt_irq_to_real(irq)); + xics_enable_irq(virq); return 0; /* return value is ignored */ } @@ -239,28 +242,24 @@ static unsigned int real_irq_to_virt(unsigned int real_irq) static int get_irq_server(unsigned int irq) { unsigned int server; - -#ifdef CONFIG_IRQ_ALL_CPUS /* For the moment only implement delivery to all cpus or one cpu */ - if (smp_threads_ready) { - cpumask_t cpumask = irq_affinity[irq]; - cpumask_t tmp = CPU_MASK_NONE; - if (cpus_equal(cpumask, CPU_MASK_ALL)) { - server = default_distrib_server; - } else { - cpus_and(tmp, cpu_online_map, cpumask); + cpumask_t cpumask = irq_affinity[irq]; + cpumask_t tmp = CPU_MASK_NONE; - if (cpus_empty(tmp)) - server = default_distrib_server; - else - server = get_hard_smp_processor_id(first_cpu(tmp)); - } + if (!distribute_irqs) + return default_server; + + if (cpus_equal(cpumask, CPU_MASK_ALL)) { + server = default_distrib_server; } else { - server = default_server; + cpus_and(tmp, cpu_online_map, cpumask); + + if (cpus_empty(tmp)) + server = default_distrib_server; + else + server = get_hard_smp_processor_id(first_cpu(tmp)); } -#else - server = default_server; -#endif + return server; } @@ -454,7 +453,7 @@ void xics_init_IRQ(void) struct xics_interrupt_node { unsigned long addr; unsigned long size; - } inodes[NR_CPUS]; + } intnodes[NR_CPUS]; ppc64_boot_msg(0x20, "XICS Init"); @@ -481,13 +480,13 @@ nextnode: panic("xics_init_IRQ: can't find interrupt reg property"); while (ilen) { - inodes[indx].addr = (unsigned long long)*ireg++ << 32; + intnodes[indx].addr = (unsigned long)*ireg++ << 32; ilen -= sizeof(uint); - inodes[indx].addr |= *ireg++; + intnodes[indx].addr |= *ireg++; ilen -= sizeof(uint); - inodes[indx].size = (unsigned long long)*ireg++ << 32; + intnodes[indx].size = (unsigned long)*ireg++ << 32; ilen -= sizeof(uint); - inodes[indx].size |= *ireg++; + intnodes[indx].size |= *ireg++; ilen -= sizeof(uint); indx++; if (indx >= NR_CPUS) break; @@ -501,20 +500,25 @@ nextnode: np; np = of_find_node_by_type(np, "cpu")) { ireg = (uint *)get_property(np, "reg", &ilen); - if (ireg && ireg[0] == hard_smp_processor_id()) { - ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen); + if (ireg && ireg[0] == boot_cpuid_phys) { + ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", + &ilen); i = ilen / sizeof(int); if (ireg && i > 0) { default_server = ireg[0]; default_distrib_server = ireg[i-1]; /* take last element */ } + ireg = (uint *)get_property(np, + "ibm,interrupt-server#-size", NULL); + if (ireg) + interrupt_server_size = *ireg; break; } } of_node_put(np); - intr_base = inodes[0].addr; - intr_size = (ulong)inodes[0].size; + intr_base = intnodes[0].addr; + intr_size = intnodes[0].size; np = of_find_node_by_type(NULL, "interrupt-controller"); if (!np) { @@ -535,16 +539,18 @@ nextnode: if (systemcfg->platform == PLATFORM_PSERIES) { #ifdef CONFIG_SMP for_each_cpu(i) { + int hard_id; + /* FIXME: Do this dynamically! --RR */ if (!cpu_present(i)) continue; - xics_per_cpu[i] = __ioremap((ulong)inodes[get_hard_smp_processor_id(i)].addr, - (ulong)inodes[get_hard_smp_processor_id(i)].size, - _PAGE_NO_CACHE); + + hard_id = get_hard_smp_processor_id(i); + xics_per_cpu[i] = ioremap(intnodes[hard_id].addr, + intnodes[hard_id].size); } #else - xics_per_cpu[0] = __ioremap((ulong)intr_base, intr_size, - _PAGE_NO_CACHE); + xics_per_cpu[0] = ioremap(intr_base, intr_size); #endif /* CONFIG_SMP */ } else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { ops = &pSeriesLP_ops; @@ -569,13 +575,13 @@ nextnode: */ static int __init xics_setup_i8259(void) { - if (naca->interrupt_controller == IC_PPC_XIC && + if (ppc64_interrupt_controller == IC_PPC_XIC && xics_irq_8259_cascade != -1) { if (request_irq(irq_offset_up(xics_irq_8259_cascade), no_action, 0, "8259 cascade", NULL)) printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " "cascade\n"); - i8259_init(); + i8259_init(0); } return 0; } @@ -638,20 +644,16 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) /* Interrupts are disabled. */ void xics_migrate_irqs_away(void) { - int set_indicator = rtas_token("set-indicator"); - const unsigned int giqs = 9005UL; /* Global Interrupt Queue Server */ - int status = 0; + int status; unsigned int irq, virq, cpu = smp_processor_id(); - BUG_ON(set_indicator == RTAS_UNKNOWN_SERVICE); - /* Reject any interrupt that was queued to us... */ ops->cppr_info(cpu, 0); iosync(); - /* Refuse any new interrupts... */ - rtas_call(set_indicator, 3, 1, &status, giqs, - hard_smp_processor_id(), 0); + /* remove ourselves from the global interrupt queue */ + status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, + (1UL << interrupt_server_size) - 1 - default_distrib_server, 0); WARN_ON(status != 0); /* Allow IPIs again... */ diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile index 01924ec67..bf7b5bbfc 100644 --- a/arch/ppc64/lib/Makefile +++ b/arch/ppc64/lib/Makefile @@ -15,3 +15,4 @@ ifdef CONFIG_PPC_ISERIES obj-$(CONFIG_PCI) += e2a.o endif +lib-$(CONFIG_DEBUG_KERNEL) += sstep.o diff --git a/arch/ppc64/lib/dec_and_lock.c b/arch/ppc64/lib/dec_and_lock.c index 84ffb543b..6e8d85917 100644 --- a/arch/ppc64/lib/dec_and_lock.c +++ b/arch/ppc64/lib/dec_and_lock.c @@ -28,7 +28,7 @@ */ #ifndef ATOMIC_DEC_AND_LOCK -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) { int counter; int newcount; @@ -51,5 +51,5 @@ int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) return 0; } -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif /* ATOMIC_DEC_AND_LOCK */ diff --git a/arch/ppc64/lib/locks.c b/arch/ppc64/lib/locks.c index 72d642d7e..ef70ef91a 100644 --- a/arch/ppc64/lib/locks.c +++ b/arch/ppc64/lib/locks.c @@ -34,7 +34,7 @@ void __spin_yield(spinlock_t *lock) holder_cpu = lock_value & 0xffff; BUG_ON(holder_cpu >= NR_CPUS); holder_paca = &paca[holder_cpu]; - yield_count = holder_paca->lppaca.xYieldCount; + yield_count = holder_paca->lppaca.yield_count; if ((yield_count & 1) == 0) return; /* virtual cpu is currently running */ rmb(); @@ -66,7 +66,7 @@ void __rw_yield(rwlock_t *rw) holder_cpu = lock_value & 0xffff; BUG_ON(holder_cpu >= NR_CPUS); holder_paca = &paca[holder_cpu]; - yield_count = holder_paca->lppaca.xYieldCount; + yield_count = holder_paca->lppaca.yield_count; if ((yield_count & 1) == 0) return; /* virtual cpu is currently running */ rmb(); diff --git a/arch/ppc64/lib/sstep.c b/arch/ppc64/lib/sstep.c index ce9ecc6b7..e79123d14 100644 --- a/arch/ppc64/lib/sstep.c +++ b/arch/ppc64/lib/sstep.c @@ -13,7 +13,7 @@ #include #include -extern char SystemCall_common[]; +extern char system_call_common[]; /* Bits in SRR1 that are copied from MSR */ #define MSR_MASK 0xffffffff87c0ffff @@ -76,7 +76,7 @@ int emulate_step(struct pt_regs *regs, unsigned int instr) regs->gpr[11] = regs->nip + 4; regs->gpr[12] = regs->msr & MSR_MASK; regs->gpr[13] = (unsigned long) get_paca(); - regs->nip = (unsigned long) &SystemCall_common; + regs->nip = (unsigned long) &system_call_common; regs->msr = MSR_KERNEL; return 1; case 18: /* b */ diff --git a/arch/ppc64/mm/fault.c b/arch/ppc64/mm/fault.c index b78e7f4ee..2b383974a 100644 --- a/arch/ppc64/mm/fault.c +++ b/arch/ppc64/mm/fault.c @@ -36,6 +36,7 @@ #include #include #include +#include /* * Check whether the instruction at regs->nip is a store using @@ -95,6 +96,10 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, BUG_ON((trap == 0x380) || (trap == 0x480)); + if (notify_die(DIE_PAGE_FAULT, "page_fault", regs, error_code, + 11, SIGSEGV) == NOTIFY_STOP) + return 0; + if (trap == 0x300) { if (debugger_fault_handler(regs)) return 0; @@ -105,6 +110,9 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, return SIGSEGV; if (error_code & 0x00400000) { + if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code, + 11, SIGSEGV) == NOTIFY_STOP) + return 0; if (debugger_dabr_match(regs)) return 0; } diff --git a/arch/ppc64/mm/hash_low.S b/arch/ppc64/mm/hash_low.S index 68dd4b9ad..9a7652bc4 100644 --- a/arch/ppc64/mm/hash_low.S +++ b/arch/ppc64/mm/hash_low.S @@ -139,8 +139,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_COHERENT_ICACHE) std r3,STK_PARM(r4)(r1) /* Get htab_hash_mask */ - ld r4,htab_data@got(2) - ld r27,16(r4) /* htab_data.htab_hash_mask -> r27 */ + ld r4,htab_hash_mask@got(2) + ld r27,0(r4) /* htab_hash_mask -> r27 */ /* Check if we may already be in the hashtable, in this case, we * go to out-of-line code to try to modify the HPTE diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c index 0d8c8ab19..dfd24ad27 100644 --- a/arch/ppc64/mm/hash_native.c +++ b/arch/ppc64/mm/hash_native.c @@ -25,7 +25,7 @@ #define HPTE_LOCK_BIT 3 -static spinlock_t native_tlbie_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(native_tlbie_lock); static inline void native_lock_hpte(HPTE *hptep) { @@ -52,7 +52,7 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va, unsigned long hpteflags, int bolted, int large) { unsigned long arpn = physRpn_to_absRpn(prpn); - HPTE *hptep = htab_data.htab + hpte_group; + HPTE *hptep = htab_address + hpte_group; Hpte_dword0 dw0; HPTE lhpte; int i; @@ -117,7 +117,7 @@ static long native_hpte_remove(unsigned long hpte_group) slot_offset = mftb() & 0x7; for (i = 0; i < HPTES_PER_GROUP; i++) { - hptep = htab_data.htab + hpte_group + slot_offset; + hptep = htab_address + hpte_group + slot_offset; dw0 = hptep->dw0.dw0; if (dw0.v && !dw0.bolted) { @@ -172,9 +172,9 @@ static long native_hpte_find(unsigned long vpn) hash = hpt_hash(vpn, 0); for (j = 0; j < 2; j++) { - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; + slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; for (i = 0; i < HPTES_PER_GROUP; i++) { - hptep = htab_data.htab + slot; + hptep = htab_address + slot; dw0 = hptep->dw0.dw0; if ((dw0.avpn == (vpn >> 11)) && dw0.v && @@ -195,7 +195,7 @@ static long native_hpte_find(unsigned long vpn) static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, unsigned long va, int large, int local) { - HPTE *hptep = htab_data.htab + slot; + HPTE *hptep = htab_address + slot; Hpte_dword0 dw0; unsigned long avpn = va >> 23; int ret = 0; @@ -242,7 +242,7 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, */ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea) { - unsigned long vsid, va, vpn, flags; + unsigned long vsid, va, vpn, flags = 0; long slot; HPTE *hptep; int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE); @@ -254,7 +254,7 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea) slot = native_hpte_find(vpn); if (slot == -1) panic("could not find page to bolt\n"); - hptep = htab_data.htab + slot; + hptep = htab_address + slot; set_pp_bit(newpp, hptep); @@ -269,7 +269,7 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea) static void native_hpte_invalidate(unsigned long slot, unsigned long va, int large, int local) { - HPTE *hptep = htab_data.htab + slot; + HPTE *hptep = htab_address + slot; Hpte_dword0 dw0; unsigned long avpn = va >> 23; unsigned long flags; @@ -336,10 +336,10 @@ static void native_flush_hash_range(unsigned long context, secondary = (pte_val(batch->pte[i]) & _PAGE_SECONDARY) >> 15; if (secondary) hash = ~hash; - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; + slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; slot += (pte_val(batch->pte[i]) & _PAGE_GROUP_IX) >> 12; - hptep = htab_data.htab + slot; + hptep = htab_address + slot; avpn = va >> 23; if (large) @@ -387,33 +387,37 @@ static void native_flush_hash_range(unsigned long context, local_irq_restore(flags); } -void hpte_init_native(void) -{ #ifdef CONFIG_PPC_PSERIES - struct device_node *root; - const char *model; -#endif /* CONFIG_PPC_PSERIES */ +/* Disable TLB batching on nighthawk */ +static inline int tlb_batching_enabled(void) +{ + struct device_node *root = of_find_node_by_path("/"); + int enabled = 1; + + if (root) { + const char *model = get_property(root, "model", NULL); + if (model && !strcmp(model, "IBM,9076-N81")) + enabled = 0; + of_node_put(root); + } + + return enabled; +} +#else +static inline int tlb_batching_enabled(void) +{ + return 1; +} +#endif +void hpte_init_native(void) +{ ppc_md.hpte_invalidate = native_hpte_invalidate; ppc_md.hpte_updatepp = native_hpte_updatepp; ppc_md.hpte_updateboltedpp = native_hpte_updateboltedpp; ppc_md.hpte_insert = native_hpte_insert; ppc_md.hpte_remove = native_hpte_remove; - -#ifdef CONFIG_PPC_PSERIES - /* Disable TLB batching on nighthawk */ - root = of_find_node_by_path("/"); - if (root) { - model = get_property(root, "model", NULL); - if (!strcmp(model, "CHRP IBM,9076-N81")) { - of_node_put(root); - goto bail; - } - of_node_put(root); - } -#endif /* CONFIG_PPC_PSERIES */ - - ppc_md.flush_hash_range = native_flush_hash_range; - bail: + if (tlb_batching_enabled()) + ppc_md.flush_hash_range = native_flush_hash_range; htab_finish_init(); } diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c index 3a8a61380..9b01f6fb6 100644 --- a/arch/ppc64/mm/hash_utils.c +++ b/arch/ppc64/mm/hash_utils.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -75,7 +74,8 @@ extern unsigned long dart_tablebase; #endif /* CONFIG_U3_DART */ -HTAB htab_data = {NULL, 0, 0, 0, 0}; +HPTE *htab_address; +unsigned long htab_hash_mask; extern unsigned long _SDR1; @@ -114,7 +114,7 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end, hash = hpt_hash(vpn, large); - hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP); + hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); #ifdef CONFIG_PPC_PSERIES if (systemcfg->platform & PLATFORM_LPAR) @@ -147,7 +147,7 @@ void __init htab_initialize(void) * Calculate the required size of the htab. We want the number of * PTEGs to equal one half the number of real pages. */ - htab_size_bytes = 1UL << naca->pftSize; + htab_size_bytes = 1UL << ppc64_pft_size; pteg_count = htab_size_bytes >> 7; /* For debug, make the HTAB 1/8 as big as it normally would be. */ @@ -156,12 +156,11 @@ void __init htab_initialize(void) htab_size_bytes = pteg_count << 7; } - htab_data.htab_num_ptegs = pteg_count; - htab_data.htab_hash_mask = pteg_count - 1; + htab_hash_mask = pteg_count - 1; if (systemcfg->platform & PLATFORM_LPAR) { /* Using a hypervisor which owns the htab */ - htab_data.htab = NULL; + htab_address = NULL; _SDR1 = 0; } else { /* Find storage for the HPT. Must be contiguous in @@ -176,7 +175,7 @@ void __init htab_initialize(void) ppc64_terminate_msg(0x20, "hpt space"); loop_forever(); } - htab_data.htab = abs_to_virt(table); + htab_address = abs_to_virt(table); /* htab absolute addr + encoded htabsize */ _SDR1 = table + __ilog2(pteg_count) - 11; @@ -295,12 +294,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) vsid = get_kernel_vsid(ea); break; #if 0 - case EEH_REGION_ID: - /* - * Should only be hit if there is an access to MMIO space - * which is protected by EEH. - * Send the problem up to do_page_fault - */ case KERNEL_REGION_ID: /* * Should never get here - entire 0xC0... region is bolted. @@ -341,9 +334,7 @@ void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte, int local) { unsigned long vsid, vpn, va, hash, secondary, slot; - - /* XXX fix for large ptes */ - unsigned long large = 0; + unsigned long huge = pte_huge(pte); if ((ea >= USER_START) && (ea <= USER_END)) vsid = get_vsid(context, ea); @@ -351,18 +342,18 @@ void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte, vsid = get_kernel_vsid(ea); va = (vsid << 28) | (ea & 0x0fffffff); - if (large) + if (huge) vpn = va >> HPAGE_SHIFT; else vpn = va >> PAGE_SHIFT; - hash = hpt_hash(vpn, large); + hash = hpt_hash(vpn, huge); secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15; if (secondary) hash = ~hash; - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; + slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12; - ppc_md.hpte_invalidate(slot, va, large, local); + ppc_md.hpte_invalidate(slot, va, huge, local); } void flush_hash_range(unsigned long context, unsigned long number, int local) @@ -401,7 +392,7 @@ void low_hash_fault(struct pt_regs *regs, unsigned long address) info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRERR; - info.si_addr = (void *)address; + info.si_addr = (void __user *)address; force_sig_info(SIGBUS, &info, current); return; } diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c index 7e1a9bf28..07fd6ad98 100644 --- a/arch/ppc64/mm/hugetlbpage.c +++ b/arch/ppc64/mm/hugetlbpage.c @@ -27,117 +27,144 @@ #include -/* HugePTE layout: - * - * 31 30 ... 15 14 13 12 10 9 8 7 6 5 4 3 2 1 0 - * PFN>>12..... - - - - - - HASH_IX.... 2ND HASH RW - HG=1 - */ +#define HUGEPGDIR_SHIFT (HPAGE_SHIFT + PAGE_SHIFT - 3) +#define HUGEPGDIR_SIZE (1UL << HUGEPGDIR_SHIFT) +#define HUGEPGDIR_MASK (~(HUGEPGDIR_SIZE-1)) + +#define HUGEPTE_INDEX_SIZE 9 +#define HUGEPGD_INDEX_SIZE 10 + +#define PTRS_PER_HUGEPTE (1 << HUGEPTE_INDEX_SIZE) +#define PTRS_PER_HUGEPGD (1 << HUGEPGD_INDEX_SIZE) -#define HUGEPTE_SHIFT 15 -#define _HUGEPAGE_PFN 0xffff8000 -#define _HUGEPAGE_BAD 0x00007f00 -#define _HUGEPAGE_HASHPTE 0x00000008 -#define _HUGEPAGE_SECONDARY 0x00000010 -#define _HUGEPAGE_GROUP_IX 0x000000e0 -#define _HUGEPAGE_HPTEFLAGS (_HUGEPAGE_HASHPTE | _HUGEPAGE_SECONDARY | \ - _HUGEPAGE_GROUP_IX) -#define _HUGEPAGE_RW 0x00000004 - -typedef struct {unsigned int val;} hugepte_t; -#define hugepte_val(hugepte) ((hugepte).val) -#define __hugepte(x) ((hugepte_t) { (x) } ) -#define hugepte_pfn(x) \ - ((unsigned long)(hugepte_val(x)>>HUGEPTE_SHIFT) << HUGETLB_PAGE_ORDER) -#define mk_hugepte(page,wr) __hugepte( \ - ((page_to_pfn(page)>>HUGETLB_PAGE_ORDER) << HUGEPTE_SHIFT ) \ - | (!!(wr) * _HUGEPAGE_RW) | _PMD_HUGEPAGE ) - -#define hugepte_bad(x) ( !(hugepte_val(x) & _PMD_HUGEPAGE) || \ - (hugepte_val(x) & _HUGEPAGE_BAD) ) -#define hugepte_page(x) pfn_to_page(hugepte_pfn(x)) -#define hugepte_none(x) (!(hugepte_val(x) & _HUGEPAGE_PFN)) - - -static void flush_hash_hugepage(mm_context_t context, unsigned long ea, - hugepte_t pte, int local); - -static inline unsigned int hugepte_update(hugepte_t *p, unsigned int clr, - unsigned int set) +static inline int hugepgd_index(unsigned long addr) { - unsigned int old, tmp; - - __asm__ __volatile__( - "1: lwarx %0,0,%3 # pte_update\n\ - andc %1,%0,%4 \n\ - or %1,%1,%5 \n\ - stwcx. %1,0,%3 \n\ - bne- 1b" - : "=&r" (old), "=&r" (tmp), "=m" (*p) - : "r" (p), "r" (clr), "r" (set), "m" (*p) - : "cc" ); - return old; + return (addr & ~REGION_MASK) >> HUGEPGDIR_SHIFT; } -static inline void set_hugepte(hugepte_t *ptep, hugepte_t pte) +static pgd_t *hugepgd_offset(struct mm_struct *mm, unsigned long addr) { - hugepte_update(ptep, ~_HUGEPAGE_HPTEFLAGS, - hugepte_val(pte) & ~_HUGEPAGE_HPTEFLAGS); + int index; + + if (! mm->context.huge_pgdir) + return NULL; + + + index = hugepgd_index(addr); + BUG_ON(index >= PTRS_PER_HUGEPGD); + return mm->context.huge_pgdir + index; } -static hugepte_t *hugepte_alloc(struct mm_struct *mm, unsigned long addr) +static inline pte_t *hugepte_offset(pgd_t *dir, unsigned long addr) { - pgd_t *pgd; - pmd_t *pmd = NULL; + int index; + + if (pgd_none(*dir)) + return NULL; - BUG_ON(!in_hugepage_area(mm->context, addr)); + index = (addr >> HPAGE_SHIFT) % PTRS_PER_HUGEPTE; + return (pte_t *)pgd_page(*dir) + index; +} - pgd = pgd_offset(mm, addr); - pmd = pmd_alloc(mm, pgd, addr); +static pgd_t *hugepgd_alloc(struct mm_struct *mm, unsigned long addr) +{ + BUG_ON(! in_hugepage_area(mm->context, addr)); - /* We shouldn't find a (normal) PTE page pointer here */ - BUG_ON(!pmd_none(*pmd) && !pmd_hugepage(*pmd)); - - return (hugepte_t *)pmd; + if (! mm->context.huge_pgdir) { + pgd_t *new; + spin_unlock(&mm->page_table_lock); + /* Don't use pgd_alloc(), because we want __GFP_REPEAT */ + new = kmem_cache_alloc(zero_cache, GFP_KERNEL | __GFP_REPEAT); + BUG_ON(memcmp(new, empty_zero_page, PAGE_SIZE)); + spin_lock(&mm->page_table_lock); + + /* + * Because we dropped the lock, we should re-check the + * entry, as somebody else could have populated it.. + */ + if (mm->context.huge_pgdir) + pgd_free(new); + else + mm->context.huge_pgdir = new; + } + return hugepgd_offset(mm, addr); } -static hugepte_t *hugepte_offset(struct mm_struct *mm, unsigned long addr) +static pte_t *hugepte_alloc(struct mm_struct *mm, pgd_t *dir, + unsigned long addr) { - pgd_t *pgd; - pmd_t *pmd = NULL; + if (! pgd_present(*dir)) { + pte_t *new; - BUG_ON(!in_hugepage_area(mm->context, addr)); + spin_unlock(&mm->page_table_lock); + new = kmem_cache_alloc(zero_cache, GFP_KERNEL | __GFP_REPEAT); + BUG_ON(memcmp(new, empty_zero_page, PAGE_SIZE)); + spin_lock(&mm->page_table_lock); + /* + * Because we dropped the lock, we should re-check the + * entry, as somebody else could have populated it.. + */ + if (pgd_present(*dir)) { + if (new) + kmem_cache_free(zero_cache, new); + } else { + struct page *ptepage; + + if (! new) + return NULL; + ptepage = virt_to_page(new); + ptepage->mapping = (void *) mm; + ptepage->index = addr & HUGEPGDIR_MASK; + pgd_populate(mm, dir, new); + } + } - pgd = pgd_offset(mm, addr); - if (pgd_none(*pgd)) - return NULL; + return hugepte_offset(dir, addr); +} - pmd = pmd_offset(pgd, addr); +static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) +{ + pgd_t *pgd; - /* We shouldn't find a (normal) PTE page pointer here */ - BUG_ON(!pmd_none(*pmd) && !pmd_hugepage(*pmd)); + BUG_ON(! in_hugepage_area(mm->context, addr)); + + pgd = hugepgd_offset(mm, addr); + if (! pgd) + return NULL; - return (hugepte_t *)pmd; + return hugepte_offset(pgd, addr); } -static void setup_huge_pte(struct mm_struct *mm, struct page *page, - hugepte_t *ptep, int write_access) +static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) { - hugepte_t entry; - int i; + pgd_t *pgd; - // mm->rss += (HPAGE_SIZE / PAGE_SIZE); - vx_rsspages_sub(mm, HPAGE_SIZE / PAGE_SIZE); - entry = mk_hugepte(page, write_access); - for (i = 0; i < HUGEPTE_BATCH_SIZE; i++) - set_hugepte(ptep+i, entry); + BUG_ON(! in_hugepage_area(mm->context, addr)); + + pgd = hugepgd_alloc(mm, addr); + if (! pgd) + return NULL; + + return hugepte_alloc(mm, pgd, addr); } -static void teardown_huge_pte(hugepte_t *ptep) +static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, + struct page *page, pte_t *ptep, int write_access) { - int i; + pte_t entry; - for (i = 0; i < HUGEPTE_BATCH_SIZE; i++) - pmd_clear((pmd_t *)(ptep+i)); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); + if (write_access) { + entry = + pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); + } else { + entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot)); + } + entry = pte_mkyoung(entry); + entry = pte_mkhuge(entry); + + set_pte(ptep, entry); } /* @@ -214,6 +241,7 @@ static int prepare_low_seg_for_htlb(struct mm_struct *mm, unsigned long seg) } page = pmd_page(*pmd); pmd_clear(pmd); + mm->nr_ptes--; dec_page_state(nr_page_table_pages); pte_free_tlb(tlb, page); } @@ -237,6 +265,10 @@ static int open_low_hpage_segs(struct mm_struct *mm, u16 newsegs) return -EBUSY; mm->context.htlb_segs |= newsegs; + + /* update the paca copy of the context struct */ + get_paca()->context = mm->context; + /* the context change must make it to memory before the flush, * so that further SLB misses do the right thing. */ mb(); @@ -249,7 +281,7 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len) { if (within_hugepage_high_range(addr, len)) return 0; - else if ((addr < 0x100000000) && ((addr+len) < 0x100000000)) { + else if ((addr < 0x100000000UL) && ((addr+len) < 0x100000000UL)) { int err; /* Yes, we need both tests, in case addr+len overflows * 64-bit arithmetic */ @@ -268,35 +300,32 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len) int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { - hugepte_t *src_pte, *dst_pte, entry; + pte_t *src_pte, *dst_pte, entry; struct page *ptepage; unsigned long addr = vma->vm_start; unsigned long end = vma->vm_end; + int err = -ENOMEM; while (addr < end) { - BUG_ON(! in_hugepage_area(src->context, addr)); - BUG_ON(! in_hugepage_area(dst->context, addr)); - - dst_pte = hugepte_alloc(dst, addr); + dst_pte = huge_pte_alloc(dst, addr); if (!dst_pte) - return -ENOMEM; + goto out; - src_pte = hugepte_offset(src, addr); + src_pte = huge_pte_offset(src, addr); entry = *src_pte; - if ((addr % HPAGE_SIZE) == 0) { - /* This is the first hugepte in a batch */ - ptepage = hugepte_page(entry); - get_page(ptepage); - // dst->rss += (HPAGE_SIZE / PAGE_SIZE); - vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); - } - set_hugepte(dst_pte, entry); - + ptepage = pte_page(entry); + get_page(ptepage); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); + set_pte(dst_pte, entry); - addr += PMD_SIZE; + addr += HPAGE_SIZE; } - return 0; + + err = 0; + out: + return err; } int @@ -311,18 +340,16 @@ follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, vpfn = vaddr/PAGE_SIZE; while (vaddr < vma->vm_end && remainder) { - BUG_ON(!in_hugepage_area(mm->context, vaddr)); - if (pages) { - hugepte_t *pte; + pte_t *pte; struct page *page; - pte = hugepte_offset(mm, vaddr); + pte = huge_pte_offset(mm, vaddr); /* hugetlb should be locked, and hence, prefaulted */ - WARN_ON(!pte || hugepte_none(*pte)); + WARN_ON(!pte || pte_none(*pte)); - page = &hugepte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; + page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; WARN_ON(!PageCompound(page)); @@ -348,26 +375,31 @@ follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, struct page * follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) { - return ERR_PTR(-EINVAL); + pte_t *ptep; + struct page *page; + + if (! in_hugepage_area(mm->context, address)) + return ERR_PTR(-EINVAL); + + ptep = huge_pte_offset(mm, address); + page = pte_page(*ptep); + if (page) + page += (address % HPAGE_SIZE) / PAGE_SIZE; + + return page; } int pmd_huge(pmd_t pmd) { - return pmd_hugepage(pmd); + return 0; } struct page * follow_huge_pmd(struct mm_struct *mm, unsigned long address, pmd_t *pmd, int write) { - struct page *page; - - BUG_ON(! pmd_hugepage(*pmd)); - - page = hugepte_page(*(hugepte_t *)pmd); - if (page) - page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); - return page; + BUG(); + return NULL; } void unmap_hugepage_range(struct vm_area_struct *vma, @@ -375,45 +407,39 @@ void unmap_hugepage_range(struct vm_area_struct *vma, { struct mm_struct *mm = vma->vm_mm; unsigned long addr; - hugepte_t *ptep; + pte_t *ptep; struct page *page; - int cpu; - int local = 0; - cpumask_t tmp; WARN_ON(!is_vm_hugetlb_page(vma)); BUG_ON((start % HPAGE_SIZE) != 0); BUG_ON((end % HPAGE_SIZE) != 0); - /* XXX are there races with checking cpu_vm_mask? - Anton */ - cpu = get_cpu(); - tmp = cpumask_of_cpu(cpu); - if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp)) - local = 1; - for (addr = start; addr < end; addr += HPAGE_SIZE) { - hugepte_t pte; - - BUG_ON(!in_hugepage_area(mm->context, addr)); + pte_t pte; - ptep = hugepte_offset(mm, addr); - if (!ptep || hugepte_none(*ptep)) + ptep = huge_pte_offset(mm, addr); + if (!ptep || pte_none(*ptep)) continue; pte = *ptep; - page = hugepte_page(pte); - teardown_huge_pte(ptep); - - if (hugepte_val(pte) & _HUGEPAGE_HASHPTE) - flush_hash_hugepage(mm->context, addr, - pte, local); + page = pte_page(pte); + pte_clear(ptep); put_page(page); } - put_cpu(); - // mm->rss -= (end - start) >> PAGE_SHIFT; vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); + flush_tlb_pending(); +} + +void hugetlb_free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *prev, + unsigned long start, unsigned long end) +{ + /* Because the huge pgtables are only 2 level, they can take + * at most around 4M, much less than one hugepage which the + * process is presumably entitled to use. So we don't bother + * freeing up the pagetables on unmap, and wait until + * destroy_context() to clean up the lot. */ } int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) @@ -429,16 +455,14 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) spin_lock(&mm->page_table_lock); for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) { unsigned long idx; - hugepte_t *pte = hugepte_alloc(mm, addr); + pte_t *pte = huge_pte_alloc(mm, addr); struct page *page; - BUG_ON(!in_hugepage_area(mm->context, addr)); - if (!pte) { ret = -ENOMEM; goto out; } - if (!hugepte_none(*pte)) + if (! pte_none(*pte)) continue; idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) @@ -465,7 +489,7 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) goto out; } } - setup_huge_pte(mm, page, pte, vma->vm_flags & VM_WRITE); + set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE); } out: spin_unlock(&mm->page_table_lock); @@ -719,20 +743,56 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, } } +void hugetlb_mm_free_pgd(struct mm_struct *mm) +{ + int i; + pgd_t *pgdir; + + spin_lock(&mm->page_table_lock); + + pgdir = mm->context.huge_pgdir; + if (! pgdir) + goto out; + + mm->context.huge_pgdir = NULL; + + /* cleanup any hugepte pages leftover */ + for (i = 0; i < PTRS_PER_HUGEPGD; i++) { + pgd_t *pgd = pgdir + i; + + if (! pgd_none(*pgd)) { + pte_t *pte = (pte_t *)pgd_page(*pgd); + struct page *ptepage = virt_to_page(pte); + + ptepage->mapping = NULL; + + BUG_ON(memcmp(pte, empty_zero_page, PAGE_SIZE)); + kmem_cache_free(zero_cache, pte); + } + pgd_clear(pgd); + } + + BUG_ON(memcmp(pgdir, empty_zero_page, PAGE_SIZE)); + kmem_cache_free(zero_cache, pgdir); + + out: + spin_unlock(&mm->page_table_lock); +} + int hash_huge_page(struct mm_struct *mm, unsigned long access, unsigned long ea, unsigned long vsid, int local) { - hugepte_t *ptep; + pte_t *ptep; unsigned long va, vpn; int is_write; - hugepte_t old_pte, new_pte; - unsigned long hpteflags, prpn, flags; + pte_t old_pte, new_pte; + unsigned long hpteflags, prpn; long slot; + int err = 1; + + spin_lock(&mm->page_table_lock); - /* We have to find the first hugepte in the batch, since - * that's the one that will store the HPTE flags */ - ea &= HPAGE_MASK; - ptep = hugepte_offset(mm, ea); + ptep = huge_pte_offset(mm, ea); /* Search the Linux page table for a match with va */ va = (vsid << 28) | (ea & 0x0fffffff); @@ -742,19 +802,18 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, * If no pte found or not present, send the problem up to * do_page_fault */ - if (unlikely(!ptep || hugepte_none(*ptep))) - return 1; + if (unlikely(!ptep || pte_none(*ptep))) + goto out; - BUG_ON(hugepte_bad(*ptep)); +/* BUG_ON(pte_bad(*ptep)); */ /* * Check the user's access rights to the page. If access should be * prevented then send the problem up to do_page_fault. */ is_write = access & _PAGE_RW; - if (unlikely(is_write && !(hugepte_val(*ptep) & _HUGEPAGE_RW))) - return 1; - + if (unlikely(is_write && !(pte_val(*ptep) & _PAGE_RW))) + goto out; /* * At this point, we have a pte (old_pte) which can be used to build * or update an HPTE. There are 2 cases: @@ -767,41 +826,40 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, * page is currently not DIRTY. */ - spin_lock_irqsave(&mm->page_table_lock, flags); old_pte = *ptep; new_pte = old_pte; - hpteflags = 0x2 | (! (hugepte_val(new_pte) & _HUGEPAGE_RW)); + hpteflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW)); /* Check if pte already has an hpte (case 2) */ - if (unlikely(hugepte_val(old_pte) & _HUGEPAGE_HASHPTE)) { + if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) { /* There MIGHT be an HPTE for this pte */ unsigned long hash, slot; hash = hpt_hash(vpn, 1); - if (hugepte_val(old_pte) & _HUGEPAGE_SECONDARY) + if (pte_val(old_pte) & _PAGE_SECONDARY) hash = ~hash; - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; - slot += (hugepte_val(old_pte) & _HUGEPAGE_GROUP_IX) >> 5; + slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; + slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12; if (ppc_md.hpte_updatepp(slot, hpteflags, va, 1, local) == -1) - hugepte_val(old_pte) &= ~_HUGEPAGE_HPTEFLAGS; + pte_val(old_pte) &= ~_PAGE_HPTEFLAGS; } - if (likely(!(hugepte_val(old_pte) & _HUGEPAGE_HASHPTE))) { + if (likely(!(pte_val(old_pte) & _PAGE_HASHPTE))) { unsigned long hash = hpt_hash(vpn, 1); unsigned long hpte_group; - prpn = hugepte_pfn(old_pte); + prpn = pte_pfn(old_pte); repeat: - hpte_group = ((hash & htab_data.htab_hash_mask) * + hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; /* Update the linux pte with the HPTE slot */ - hugepte_val(new_pte) &= ~_HUGEPAGE_HPTEFLAGS; - hugepte_val(new_pte) |= _HUGEPAGE_HASHPTE; + pte_val(new_pte) &= ~_PAGE_HPTEFLAGS; + pte_val(new_pte) |= _PAGE_HASHPTE; /* Add in WIMG bits */ /* XXX We should store these in the pte */ @@ -812,14 +870,14 @@ repeat: /* Primary is full, try the secondary */ if (unlikely(slot == -1)) { - hugepte_val(new_pte) |= _HUGEPAGE_SECONDARY; - hpte_group = ((~hash & htab_data.htab_hash_mask) * + pte_val(new_pte) |= _PAGE_SECONDARY; + hpte_group = ((~hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; slot = ppc_md.hpte_insert(hpte_group, va, prpn, 1, hpteflags, 0, 1); if (slot == -1) { if (mftb() & 0x1) - hpte_group = ((hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; + hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; ppc_md.hpte_remove(hpte_group); goto repeat; @@ -829,39 +887,20 @@ repeat: if (unlikely(slot == -2)) panic("hash_huge_page: pte_insert failed\n"); - hugepte_val(new_pte) |= (slot<<5) & _HUGEPAGE_GROUP_IX; + pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX; /* * No need to use ldarx/stdcx here because all who * might be updating the pte will hold the - * page_table_lock or the hash_table_lock - * (we hold both) + * page_table_lock */ *ptep = new_pte; } - spin_unlock_irqrestore(&mm->page_table_lock, flags); - - return 0; -} - -static void flush_hash_hugepage(mm_context_t context, unsigned long ea, - hugepte_t pte, int local) -{ - unsigned long vsid, vpn, va, hash, slot; - - BUG_ON(hugepte_bad(pte)); - BUG_ON(!in_hugepage_area(context, ea)); - - vsid = get_vsid(context.id, ea); + err = 0; - va = (vsid << 28) | (ea & 0x0fffffff); - vpn = va >> HPAGE_SHIFT; - hash = hpt_hash(vpn, 1); - if (hugepte_val(pte) & _HUGEPAGE_SECONDARY) - hash = ~hash; - slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP; - slot += (hugepte_val(pte) & _HUGEPAGE_GROUP_IX) >> 5; + out: + spin_unlock(&mm->page_table_lock); - ppc_md.hpte_invalidate(slot, va, 1, local); + return err; } diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c index cf0c57a7d..4cb05a070 100644 --- a/arch/ppc64/mm/init.c +++ b/arch/ppc64/mm/init.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -52,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -169,7 +169,7 @@ static void map_io_page(unsigned long ea, unsigned long pa, int flags) hash = hpt_hash(vpn, 0); - hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP); + hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); /* Panic if a pte grpup is full */ if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0, @@ -263,9 +263,10 @@ int __ioremap_explicit(unsigned long pa, unsigned long ea, */ ; } else { - area = im_get_area(ea, size, IM_REGION_UNUSED|IM_REGION_SUBSET); + area = im_get_area(ea, size, + IM_REGION_UNUSED|IM_REGION_SUBSET|IM_REGION_EXISTS); if (area == NULL) { - printk(KERN_ERR "could not obtain imalloc area for ea 0x%lx\n", ea); + /* Expected when PHB-dlpar is in play */ return 1; } if (ea != (unsigned long) area->addr) { @@ -469,7 +470,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -static spinlock_t mmu_context_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mmu_context_lock); static DEFINE_IDR(mmu_context_idr); int init_new_context(struct task_struct *tsk, struct mm_struct *mm) @@ -477,12 +478,18 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) int index; int err; +#ifdef CONFIG_HUGETLB_PAGE + /* We leave htlb_segs as it was, but for a fork, we need to + * clear the huge_pgdir. */ + mm->context.huge_pgdir = NULL; +#endif + again: if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) return -ENOMEM; spin_lock(&mmu_context_lock); - err = idr_get_new(&mmu_context_idr, NULL, &index); + err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index); spin_unlock(&mmu_context_lock); if (err == -EAGAIN) @@ -507,20 +514,9 @@ void destroy_context(struct mm_struct *mm) spin_unlock(&mmu_context_lock); mm->context.id = NO_CONTEXT; -} - -static int __init mmu_context_init(void) -{ - int index; - /* Reserve the first (invalid) context*/ - idr_pre_get(&mmu_context_idr, GFP_KERNEL); - idr_get_new(&mmu_context_idr, NULL, &index); - BUG_ON(0 != index); - - return 0; + hugetlb_mm_free_pgd(mm); } -arch_initcall(mmu_context_init); /* * Do very early mm setup. @@ -707,7 +703,7 @@ void __init mem_init(void) high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); #ifdef CONFIG_DISCONTIGMEM - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { if (NODE_DATA(nid)->node_spanned_pages != 0) { printk("freeing bootmem node %x\n", nid); totalram_pages += @@ -873,14 +869,14 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long ea, local_irq_restore(flags); } -void * reserve_phb_iospace(unsigned long size) +void __iomem * reserve_phb_iospace(unsigned long size) { - void *virt_addr; + void __iomem *virt_addr; if (phbs_io_bot >= IMALLOC_BASE) panic("reserve_phb_iospace(): phb io space overflow\n"); - virt_addr = (void *) phbs_io_bot; + virt_addr = (void __iomem *) phbs_io_bot; phbs_io_bot += size; return virt_addr; diff --git a/arch/ppc64/mm/mmap.c b/arch/ppc64/mm/mmap.c index f90dd1f7a..fe65f522a 100644 --- a/arch/ppc64/mm/mmap.c +++ b/arch/ppc64/mm/mmap.c @@ -37,7 +37,7 @@ static inline unsigned long mmap_base(void) { - unsigned long gap = current->rlim[RLIMIT_STACK].rlim_cur; + unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; if (gap < MIN_GAP) gap = MIN_GAP; @@ -58,7 +58,7 @@ static inline int mmap_is_legacy(void) if (current->personality & ADDR_COMPAT_LAYOUT) return 1; - if (current->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) + if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) return 1; return sysctl_legacy_va_layout; diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c index 977140f78..83d7ec3b7 100644 --- a/arch/ppc64/mm/numa.c +++ b/arch/ppc64/mm/numa.c @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -38,6 +41,7 @@ int nr_cpus_in_node[MAX_NUMNODES] = { [0 ... (MAX_NUMNODES -1)] = 0}; struct pglist_data *node_data[MAX_NUMNODES]; bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES]; static unsigned long node0_io_hole_size; +static int min_common_depth; /* * We need somewhere to store start/span for each node until we have @@ -63,7 +67,24 @@ static inline void map_cpu_to_node(int cpu, int node) } } -static struct device_node * __init find_cpu_node(unsigned int cpu) +#ifdef CONFIG_HOTPLUG_CPU +static void unmap_cpu_from_node(unsigned long cpu) +{ + int node = numa_cpu_lookup_table[cpu]; + + dbg("removing cpu %lu from node %d\n", cpu, node); + + if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) { + cpu_clear(cpu, numa_cpumask_lookup_table[node]); + nr_cpus_in_node[node]--; + } else { + printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n", + cpu, node); + } +} +#endif /* CONFIG_HOTPLUG_CPU */ + +static struct device_node * __devinit find_cpu_node(unsigned int cpu) { unsigned int hw_cpuid = get_hard_smp_processor_id(cpu); struct device_node *cpu_node = NULL; @@ -75,9 +96,11 @@ static struct device_node * __init find_cpu_node(unsigned int cpu) interrupt_server = (unsigned int *)get_property(cpu_node, "ibm,ppc-interrupt-server#s", &len); + len = len / sizeof(u32); + if (interrupt_server && (len > 0)) { while (len--) { - if (interrupt_server[len-1] == hw_cpuid) + if (interrupt_server[len] == hw_cpuid) return cpu_node; } } else { @@ -93,26 +116,21 @@ static struct device_node * __init find_cpu_node(unsigned int cpu) /* must hold reference to node during call */ static int *of_get_associativity(struct device_node *dev) - { - unsigned int *result; - int len; - - result = (unsigned int *)get_property(dev, "ibm,associativity", &len); - - if (len <= 0) - return NULL; - - return result; +{ + return (unsigned int *)get_property(dev, "ibm,associativity", NULL); } -static int of_node_numa_domain(struct device_node *device, int depth) +static int of_node_numa_domain(struct device_node *device) { int numa_domain; unsigned int *tmp; + if (min_common_depth == -1) + return 0; + tmp = of_get_associativity(device); - if (tmp && (tmp[0] >= depth)) { - numa_domain = tmp[depth]; + if (tmp && (tmp[0] >= min_common_depth)) { + numa_domain = tmp[min_common_depth]; } else { dbg("WARNING: no NUMA information for %s\n", device->full_name); @@ -135,7 +153,7 @@ static int of_node_numa_domain(struct device_node *device, int depth) * * - Dave Hansen */ -static int find_min_common_depth(void) +static int __init find_min_common_depth(void) { int depth; unsigned int *ref_points; @@ -182,11 +200,73 @@ static unsigned long read_cell_ul(struct device_node *device, unsigned int **buf return result; } +/* + * Figure out to which domain a cpu belongs and stick it there. + * Return the id of the domain used. + */ +static int numa_setup_cpu(unsigned long lcpu) +{ + int numa_domain = 0; + struct device_node *cpu = find_cpu_node(lcpu); + + if (!cpu) { + WARN_ON(1); + goto out; + } + + numa_domain = of_node_numa_domain(cpu); + + if (numa_domain >= num_online_nodes()) { + /* + * POWER4 LPAR uses 0xffff as invalid node, + * dont warn in this case. + */ + if (numa_domain != 0xffff) + printk(KERN_ERR "WARNING: cpu %ld " + "maps to invalid NUMA node %d\n", + lcpu, numa_domain); + numa_domain = 0; + } +out: + node_set_online(numa_domain); + + map_cpu_to_node(lcpu, numa_domain); + + of_node_put(cpu); + + return numa_domain; +} + +static int cpu_numa_callback(struct notifier_block *nfb, + unsigned long action, + void *hcpu) +{ + unsigned long lcpu = (unsigned long)hcpu; + int ret = NOTIFY_DONE; + + switch (action) { + case CPU_UP_PREPARE: + if (min_common_depth == -1 || !numa_enabled) + map_cpu_to_node(lcpu, 0); + else + numa_setup_cpu(lcpu); + ret = NOTIFY_OK; + break; +#ifdef CONFIG_HOTPLUG_CPU + case CPU_DEAD: + case CPU_UP_CANCELED: + unmap_cpu_from_node(lcpu); + break; + ret = NOTIFY_OK; +#endif + } + return ret; +} + static int __init parse_numa_properties(void) { struct device_node *cpu = NULL; struct device_node *memory = NULL; - int depth; int max_domain = 0; long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT; unsigned long i; @@ -203,43 +283,34 @@ static int __init parse_numa_properties(void) for (i = 0; i < entries ; i++) numa_memory_lookup_table[i] = ARRAY_INITIALISER; - depth = find_min_common_depth(); + min_common_depth = find_min_common_depth(); + + dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth); + if (min_common_depth < 0) + return min_common_depth; - dbg("NUMA associativity depth for CPU/Memory: %d\n", depth); - if (depth < 0) - return depth; + max_domain = numa_setup_cpu(boot_cpuid); + /* + * Even though we connect cpus to numa domains later in SMP init, + * we need to know the maximum node id now. This is because each + * node id must have NODE_DATA etc backing it. + * As a result of hotplug we could still have cpus appear later on + * with larger node ids. In that case we force the cpu into node 0. + */ for_each_cpu(i) { int numa_domain; cpu = find_cpu_node(i); if (cpu) { - numa_domain = of_node_numa_domain(cpu, depth); + numa_domain = of_node_numa_domain(cpu); of_node_put(cpu); - if (numa_domain >= MAX_NUMNODES) { - /* - * POWER4 LPAR uses 0xffff as invalid node, - * dont warn in this case. - */ - if (numa_domain != 0xffff) - printk(KERN_ERR "WARNING: cpu %ld " - "maps to invalid NUMA node %d\n", - i, numa_domain); - numa_domain = 0; - } - } else { - dbg("WARNING: no NUMA information for cpu %ld\n", i); - numa_domain = 0; + if (numa_domain < MAX_NUMNODES && + max_domain < numa_domain) + max_domain = numa_domain; } - - node_set_online(numa_domain); - - if (max_domain < numa_domain) - max_domain = numa_domain; - - map_cpu_to_node(i, numa_domain); } memory = NULL; @@ -264,7 +335,7 @@ new_range: start = _ALIGN_DOWN(start, MEMORY_INCREMENT); size = _ALIGN_UP(size, MEMORY_INCREMENT); - numa_domain = of_node_numa_domain(memory, depth); + numa_domain = of_node_numa_domain(memory); if (numa_domain >= MAX_NUMNODES) { if (numa_domain != 0xffff) @@ -274,8 +345,6 @@ new_range: numa_domain = 0; } - node_set_online(numa_domain); - if (max_domain < numa_domain) max_domain = numa_domain; @@ -290,14 +359,19 @@ new_range: init_node_data[numa_domain].node_start_pfn + init_node_data[numa_domain].node_spanned_pages; if (shouldstart != (start / PAGE_SIZE)) { - printk(KERN_ERR "WARNING: Hole in node, " - "disabling region start %lx " - "length %lx\n", start, size); - continue; + /* Revert to non-numa for now */ + printk(KERN_ERR + "WARNING: Unexpected node layout: " + "region start %lx length %lx\n", + start, size); + printk(KERN_ERR "NUMA is disabled\n"); + goto err; } init_node_data[numa_domain].node_spanned_pages += size / PAGE_SIZE; } else { + node_set_online(numa_domain); + init_node_data[numa_domain].node_start_pfn = start / PAGE_SIZE; init_node_data[numa_domain].node_spanned_pages = @@ -313,9 +387,18 @@ new_range: goto new_range; } - numnodes = max_domain + 1; + for (i = 0; i <= max_domain; i++) + node_set_online(i); return 0; +err: + /* Something has gone wrong; revert any setup we've done */ + for_each_node(i) { + node_set_offline(i); + init_node_data[i].node_start_pfn = 0; + init_node_data[i].node_spanned_pages = 0; + } + return -1; } static void __init setup_nonnuma(void) @@ -338,8 +421,7 @@ static void __init setup_nonnuma(void) numa_memory_lookup_table[i] = ARRAY_INITIALISER; } - for (i = 0; i < NR_CPUS; i++) - map_cpu_to_node(i, 0); + map_cpu_to_node(boot_cpuid, 0); node_set_online(0); @@ -355,42 +437,14 @@ static void __init setup_nonnuma(void) static void __init dump_numa_topology(void) { unsigned int node; - unsigned int cpu, count; + unsigned int count; - for (node = 0; node < MAX_NUMNODES; node++) { - if (!node_online(node)) - continue; - - printk(KERN_INFO "Node %d CPUs:", node); - - count = 0; - /* - * If we used a CPU iterator here we would miss printing - * the holes in the cpumap. - */ - for (cpu = 0; cpu < NR_CPUS; cpu++) { - if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) { - if (count == 0) - printk(" %u", cpu); - ++count; - } else { - if (count > 1) - printk("-%u", cpu - 1); - count = 0; - } - } + if (min_common_depth == -1 || !numa_enabled) + return; - if (count > 1) - printk("-%u", NR_CPUS - 1); - printk("\n"); - } - - for (node = 0; node < MAX_NUMNODES; node++) { + for_each_online_node(node) { unsigned long i; - if (!node_online(node)) - continue; - printk(KERN_INFO "Node %d Memory:", node); count = 0; @@ -411,6 +465,7 @@ static void __init dump_numa_topology(void) printk("-0x%lx", i); printk("\n"); } + return; } /* @@ -457,6 +512,10 @@ static unsigned long careful_allocation(int nid, unsigned long size, void __init do_init_bootmem(void) { int nid; + static struct notifier_block ppc64_numa_nb = { + .notifier_call = cpu_numa_callback, + .priority = 1 /* Must run before sched domains notifier. */ + }; min_low_pfn = 0; max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; @@ -467,7 +526,9 @@ void __init do_init_bootmem(void) else dump_numa_topology(); - for (nid = 0; nid < numnodes; nid++) { + register_cpu_notifier(&ppc64_numa_nb); + + for_each_online_node(nid) { unsigned long start_paddr, end_paddr; int i; unsigned long bootmem_paddr; @@ -567,7 +628,7 @@ void __init paging_init(void) memset(zones_size, 0, sizeof(zones_size)); memset(zholes_size, 0, sizeof(zholes_size)); - for (nid = 0; nid < numnodes; nid++) { + for_each_online_node(nid) { unsigned long start_pfn; unsigned long end_pfn; diff --git a/arch/ppc64/mm/slb.c b/arch/ppc64/mm/slb.c index 7424d8d24..12493cad3 100644 --- a/arch/ppc64/mm/slb.c +++ b/arch/ppc64/mm/slb.c @@ -19,7 +19,6 @@ #include #include #include -#include #include extern void slb_allocate(unsigned long ea); @@ -79,7 +78,7 @@ static void slb_flush_and_rebolt(void) void switch_slb(struct task_struct *tsk, struct mm_struct *mm) { unsigned long offset = get_paca()->slb_cache_ptr; - unsigned long esid_data; + unsigned long esid_data = 0; unsigned long pc = KSTK_EIP(tsk); unsigned long stack = KSTK_ESP(tsk); unsigned long unmapped_base; @@ -98,11 +97,8 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm) } /* Workaround POWER5 < DD2.1 issue */ - if (offset == 1 || offset > SLB_CACHE_ENTRIES) { - /* flush segment in EEH region, we shouldn't ever - * access addresses in this region. */ - asm volatile("slbie %0" : : "r"(EEHREGIONBASE)); - } + if (offset == 1 || offset > SLB_CACHE_ENTRIES) + asm volatile("slbie %0" : : "r" (esid_data)); get_paca()->slb_cache_ptr = 0; get_paca()->context = mm->context; diff --git a/arch/ppc64/mm/stab.c b/arch/ppc64/mm/stab.c index 9b4fe8ac1..38155a255 100644 --- a/arch/ppc64/mm/stab.c +++ b/arch/ppc64/mm/stab.c @@ -17,7 +17,6 @@ #include #include #include -#include #include /* Both the segment table and SLB code uses the following cache */ diff --git a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c index aa2d76ca4..8495c7b5f 100644 --- a/arch/ppc64/mm/tlb.c +++ b/arch/ppc64/mm/tlb.c @@ -85,8 +85,12 @@ void hpte_update(pte_t *ptep, unsigned long pte, int wrprot) ptepage = virt_to_page(ptep); mm = (struct mm_struct *) ptepage->mapping; - addr = ptepage->index + - (((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE); + addr = ptepage->index; + if (pte_huge(pte)) + addr += ((unsigned long)ptep & ~PAGE_MASK) + / sizeof(*ptep) * HPAGE_SIZE; + else + addr += ((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE; if (REGION_ID(addr) == USER_REGION_ID) context = mm->context.id; diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c index bd0dcd2e8..a9a47caa5 100644 --- a/arch/ppc64/oprofile/common.c +++ b/arch/ppc64/oprofile/common.c @@ -112,24 +112,20 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root) oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel); oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user); + oprofilefs_create_ulong(sb, root, "backtrace_spinlocks", + &sys.backtrace_spinlocks); /* Default to tracing both kernel and user */ sys.enable_kernel = 1; sys.enable_user = 1; + /* Turn on backtracing through spinlocks by default */ + sys.backtrace_spinlocks = 1; + return 0; } -static struct oprofile_operations oprof_ppc64_ops = { - .create_files = op_ppc64_create_files, - .setup = op_ppc64_setup, - .shutdown = op_ppc64_shutdown, - .start = op_ppc64_start, - .stop = op_ppc64_stop, - .cpu_type = NULL /* To be filled in below. */ -}; - -int __init oprofile_arch_init(struct oprofile_operations **ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { unsigned int pvr; @@ -140,7 +136,7 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) case PV_630p: model = &op_model_rs64; model->num_counters = 8; - oprof_ppc64_ops.cpu_type = "ppc64/power3"; + ops->cpu_type = "ppc64/power3"; break; case PV_NORTHSTAR: @@ -149,38 +145,42 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) case PV_SSTAR: model = &op_model_rs64; model->num_counters = 8; - oprof_ppc64_ops.cpu_type = "ppc64/rs64"; + ops->cpu_type = "ppc64/rs64"; break; case PV_POWER4: case PV_POWER4p: model = &op_model_power4; model->num_counters = 8; - oprof_ppc64_ops.cpu_type = "ppc64/power4"; + ops->cpu_type = "ppc64/power4"; break; case PV_970: case PV_970FX: model = &op_model_power4; model->num_counters = 8; - oprof_ppc64_ops.cpu_type = "ppc64/970"; + ops->cpu_type = "ppc64/970"; break; case PV_POWER5: case PV_POWER5p: model = &op_model_power4; model->num_counters = 6; - oprof_ppc64_ops.cpu_type = "ppc64/power5"; + ops->cpu_type = "ppc64/power5"; break; default: return -ENODEV; } - *ops = &oprof_ppc64_ops; + ops->create_files = op_ppc64_create_files; + ops->setup = op_ppc64_setup; + ops->shutdown = op_ppc64_shutdown; + ops->start = op_ppc64_start; + ops->stop = op_ppc64_stop; printk(KERN_INFO "oprofile: using %s performance monitoring.\n", - oprof_ppc64_ops.cpu_type); + ops->cpu_type); return 0; } diff --git a/arch/ppc64/oprofile/op_impl.h b/arch/ppc64/oprofile/op_impl.h index c936c5ce6..7fa7eaabc 100644 --- a/arch/ppc64/oprofile/op_impl.h +++ b/arch/ppc64/oprofile/op_impl.h @@ -14,44 +14,6 @@ #define OP_MAX_COUNTER 8 -#define MSR_PMM (1UL << (63 - 61)) - -/* freeze counters. set to 1 on a perfmon exception */ -#define MMCR0_FC (1UL << (31 - 0)) - -/* freeze in supervisor state */ -#define MMCR0_KERNEL_DISABLE (1UL << (31 - 1)) - -/* freeze in problem state */ -#define MMCR0_PROBLEM_DISABLE (1UL << (31 - 2)) - -/* freeze counters while MSR mark = 1 */ -#define MMCR0_FCM1 (1UL << (31 - 3)) - -/* performance monitor exception enable */ -#define MMCR0_PMXE (1UL << (31 - 5)) - -/* freeze counters on enabled condition or event */ -#define MMCR0_FCECE (1UL << (31 - 6)) - -/* PMC1 count enable*/ -#define MMCR0_PMC1INTCONTROL (1UL << (31 - 16)) - -/* PMCn count enable*/ -#define MMCR0_PMCNINTCONTROL (1UL << (31 - 17)) - -/* performance monitor alert has occurred, set to 0 after handling exception */ -#define MMCR0_PMAO (1UL << (31 - 24)) - -/* state of MSR HV when SIAR set */ -#define MMCRA_SIHV (1UL << (63 - 35)) - -/* state of MSR PR when SIAR set */ -#define MMCRA_SIPR (1UL << (63 - 36)) - -/* enable sampling */ -#define MMCRA_SAMPLE_ENABLE (1UL << (63 - 63)) - /* Per-counter configuration as set via oprofilefs. */ struct op_counter_config { unsigned long valid; @@ -71,6 +33,7 @@ struct op_system_config { unsigned long mmcra; unsigned long enable_kernel; unsigned long enable_user; + unsigned long backtrace_spinlocks; }; /* Per-arch configuration */ diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/ppc64/oprofile/op_model_power4.c index b2a512cdb..b1ca798f4 100644 --- a/arch/ppc64/oprofile/op_model_power4.c +++ b/arch/ppc64/oprofile/op_model_power4.c @@ -32,6 +32,13 @@ static u32 mmcr0_val; static u64 mmcr1_val; static u32 mmcra_val; +/* + * Since we do not have an NMI, backtracing through spinlocks is + * only a best guess. In light of this, allow it to be disabled at + * runtime. + */ +static int backtrace_spinlocks; + static void power4_reg_setup(struct op_counter_config *ctr, struct op_system_config *sys, int num_ctrs) @@ -59,6 +66,8 @@ static void power4_reg_setup(struct op_counter_config *ctr, mmcr1_val = sys->mmcr1; mmcra_val = sys->mmcra; + backtrace_spinlocks = sys->backtrace_spinlocks; + for (i = 0; i < num_counters; ++i) reset_value[i] = 0x80000000UL - ctr[i].count; @@ -88,7 +97,7 @@ static void power4_cpu_setup(void *unused) mtspr(SPRN_MMCR0, mmcr0); mmcr0 |= MMCR0_FCM1|MMCR0_PMXE|MMCR0_FCECE; - mmcr0 |= MMCR0_PMC1INTCONTROL|MMCR0_PMCNINTCONTROL; + mmcr0 |= MMCR0_PMC1CE|MMCR0_PMCjCE; mtspr(SPRN_MMCR0, mmcr0); mtspr(SPRN_MMCR1, mmcr1_val); @@ -170,19 +179,38 @@ static void __attribute_used__ kernel_unknown_bucket(void) { } +static unsigned long check_spinlock_pc(struct pt_regs *regs, + unsigned long profile_pc) +{ + unsigned long pc = instruction_pointer(regs); + + /* + * If both the SIAR (sampled instruction) and the perfmon exception + * occurred in a spinlock region then we account the sample to the + * calling function. This isnt 100% correct, we really need soft + * IRQ disable so we always get the perfmon exception at the + * point at which the SIAR is set. + */ + if (backtrace_spinlocks && in_lock_functions(pc) && + in_lock_functions(profile_pc)) + return regs->link; + else + return profile_pc; +} + /* * On GQ and newer the MMCRA stores the HV and PR bits at the time * the SIAR was sampled. We use that to work out if the SIAR was sampled in * the hypervisor, our exception vectors or RTAS. */ -static unsigned long get_pc(void) +static unsigned long get_pc(struct pt_regs *regs) { unsigned long pc = mfspr(SPRN_SIAR); unsigned long mmcra; /* Cant do much about it */ if (!mmcra_has_sihv) - return pc; + return check_spinlock_pc(regs, pc); mmcra = mfspr(SPRN_MMCRA); @@ -196,10 +224,6 @@ static unsigned long get_pc(void) if (mmcra & MMCRA_SIPR) return pc; - /* Were we in our exception vectors? */ - if (pc < 0x4000UL) - return (unsigned long)__va(pc); - #ifdef CONFIG_PPC_PSERIES /* Were we in RTAS? */ if (pc >= rtas.base && pc < (rtas.base + rtas.size)) @@ -207,12 +231,16 @@ static unsigned long get_pc(void) return *((unsigned long *)rtas_bucket); #endif + /* Were we in our exception vectors or SLB real mode miss handler? */ + if (pc < 0x1000000UL) + return (unsigned long)__va(pc); + /* Not sure where we were */ if (pc < KERNELBASE) /* function descriptor madness */ return *((unsigned long *)kernel_unknown_bucket); - return pc; + return check_spinlock_pc(regs, pc); } static int get_kernel(unsigned long pc) @@ -236,10 +264,9 @@ static void power4_handle_interrupt(struct pt_regs *regs, int is_kernel; int val; int i; - unsigned int cpu = smp_processor_id(); unsigned int mmcr0; - pc = get_pc(); + pc = get_pc(regs); is_kernel = get_kernel(pc); /* set the PMM bit (see comment below) */ @@ -249,7 +276,7 @@ static void power4_handle_interrupt(struct pt_regs *regs, val = ctr_read(i); if (val < 0) { if (oprofile_running && ctr[i].enabled) { - oprofile_add_sample(pc, is_kernel, i, cpu); + oprofile_add_pc(pc, is_kernel, i); ctr_write(i, reset_value[i]); } else { ctr_write(i, 0); diff --git a/arch/ppc64/oprofile/op_model_rs64.c b/arch/ppc64/oprofile/op_model_rs64.c index 251fdef43..b3cddb7e0 100644 --- a/arch/ppc64/oprofile/op_model_rs64.c +++ b/arch/ppc64/oprofile/op_model_rs64.c @@ -119,7 +119,7 @@ static void rs64_cpu_setup(void *unused) mmcr0 |= MMCR0_FCM1|MMCR0_PMXE|MMCR0_FCECE; /* Only applies to POWER3, but should be safe on RS64 */ - mmcr0 |= MMCR0_PMC1INTCONTROL|MMCR0_PMCNINTCONTROL; + mmcr0 |= MMCR0_PMC1CE|MMCR0_PMCjCE; mtspr(SPRN_MMCR0, mmcr0); dbg("setup on cpu %d, mmcr0 %lx\n", smp_processor_id(), @@ -180,7 +180,6 @@ static void rs64_handle_interrupt(struct pt_regs *regs, int i; unsigned long pc = mfspr(SPRN_SIAR); int is_kernel = (pc >= KERNELBASE); - unsigned int cpu = smp_processor_id(); /* set the PMM bit (see comment below) */ mtmsrd(mfmsr() | MSR_PMM); @@ -189,7 +188,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs, val = ctr_read(i); if (val < 0) { if (ctr[i].enabled) { - oprofile_add_sample(pc, is_kernel, i, cpu); + oprofile_add_pc(pc, is_kernel, i); ctr_write(i, reset_value[i]); } else { ctr_write(i, 0); diff --git a/arch/ppc64/xmon/start.c b/arch/ppc64/xmon/start.c index c61770ca0..a9265bcc7 100644 --- a/arch/ppc64/xmon/start.c +++ b/arch/ppc64/xmon/start.c @@ -35,12 +35,12 @@ static struct sysrq_key_op sysrq_xmon_op = { .handler = sysrq_handle_xmon, .help_msg = "Xmon", - .action_msg = "Entering xmon\n", + .action_msg = "Entering xmon", }; static int __init setup_xmon_sysrq(void) { - __sysrq_put_key_op('x', &sysrq_xmon_op); + register_sysrq_key('x', &sysrq_xmon_op); return 0; } __initcall(setup_xmon_sysrq); @@ -173,7 +173,7 @@ xmon_fgets(char *str, int nb, void *f) c = xmon_getchar(); if (c == -1) { if (p == str) - return 0; + return NULL; break; } *p++ = c; diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index 6ef0b1ec3..b456e5763 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c @@ -26,11 +26,12 @@ #include #include #include -#include #include #include #include #include +#include +#include #include "nonstdio.h" #include "privinst.h" @@ -39,7 +40,7 @@ #define skipbl xmon_skipbl #ifdef CONFIG_SMP -volatile cpumask_t cpus_in_xmon = CPU_MASK_NONE; +cpumask_t cpus_in_xmon = CPU_MASK_NONE; static unsigned long xmon_taken = 1; static int xmon_owner; static int xmon_gate; @@ -49,6 +50,7 @@ static unsigned long in_xmon = 0; static unsigned long adrs; static int size = 1; +#define MAX_DUMP (128 * 1024) static unsigned long ndump = 64; static unsigned long nidump = 16; static unsigned long ncsum = 4096; @@ -85,9 +87,6 @@ static unsigned bpinstr = 0x7fe00008; /* trap */ #define BP_NUM(bp) ((bp) - bpts + 1) -/* Bits in SRR1 that are copied from MSR */ -#define MSR_MASK 0xffffffff87c0ffff - /* Prototypes */ static int cmds(struct pt_regs *); static int mread(unsigned long, void *, int); @@ -132,7 +131,6 @@ static void csum(void); static void bootcmds(void); void dump_segments(void); static void symbol_lookup(void); -static int emulate_step(struct pt_regs *regs, unsigned int instr); static void xmon_print_symbol(unsigned long address, const char *mid, const char *after); static const char *getvecname(unsigned long vec); @@ -148,9 +146,6 @@ extern int xmon_read_poll(void); extern int setjmp(long *); extern void longjmp(long *, int); extern unsigned long _ASR; -extern char SystemCall_common[]; - -pte_t *find_linux_pte(pgd_t *pgdir, unsigned long va); /* from htab.c */ #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) @@ -232,17 +227,6 @@ extern inline void sync(void) no functions have been called from the current function. */ -/* - * We don't allow single-stepping an mtmsrd that would clear - * MSR_RI, since that would make the exception unrecoverable. - * Since we need to single-step to proceed from a breakpoint, - * we don't allow putting a breakpoint on an mtmsrd instruction. - * Similarly we don't allow breakpoints on rfid instructions. - * These macros tell us if an instruction is a mtmsrd or rfid. - */ -#define IS_MTMSRD(instr) (((instr) & 0xfc0007fe) == 0x7c000164) -#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) - /* * Disable surveillance (the service processor watchdog function) * while we are in xmon. @@ -401,9 +385,11 @@ int xmon_core(struct pt_regs *regs, int fromipi) if (ncpus > 1) { smp_send_debugger_break(MSG_ALL_BUT_SELF); /* wait for other cpus to come in */ - for (timeout = 100000000; timeout != 0; --timeout) + for (timeout = 100000000; timeout != 0; --timeout) { if (cpus_weight(cpus_in_xmon) >= ncpus) break; + barrier(); + } } remove_bpts(); disable_surveillance(); @@ -488,6 +474,9 @@ int xmon_core(struct pt_regs *regs, int fromipi) if (stepped == 0) { regs->nip = (unsigned long) &bp->instr[0]; atomic_inc(&bp->ref_count); + } else if (stepped < 0) { + printf("Couldn't single-step %s instruction\n", + (IS_RFID(bp->instr[0])? "rfid": "mtmsrd")); } } } @@ -635,6 +624,19 @@ int xmon_fault_handler(struct pt_regs *regs) return 0; } +/* On systems with a hypervisor, we can't set the DABR + (data address breakpoint register) directly. */ +static void set_controlled_dabr(unsigned long val) +{ +#ifdef CONFIG_PPC_PSERIES + if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { + int rc = plpar_hcall_norets(H_SET_DABR, val); + if (rc != H_Success) + xmon_printf("Warning: setting DABR failed (%d)\n", rc); + } else +#endif + set_dabr(val); +} static struct bpt *at_breakpoint(unsigned long pc) { @@ -645,7 +647,7 @@ static struct bpt *at_breakpoint(unsigned long pc) for (i = 0; i < NBPTS; ++i, ++bp) if (bp->enabled && pc == bp->address) return bp; - return 0; + return NULL; } static struct bpt *in_breakpoint_table(unsigned long nip, unsigned long *offp) @@ -722,7 +724,7 @@ static void insert_bpts(void) static void insert_cpu_bpts(void) { if (dabr.enabled) - set_dabr(dabr.address | (dabr.enabled & 7)); + set_controlled_dabr(dabr.address | (dabr.enabled & 7)); if (iabr && (cur_cpu_spec->cpu_features & CPU_FTR_IABR)) set_iabr(iabr->address | (iabr->enabled & (BP_IABR|BP_IABR_TE))); @@ -750,113 +752,11 @@ static void remove_bpts(void) static void remove_cpu_bpts(void) { - set_dabr(0); + set_controlled_dabr(0); if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR)) set_iabr(0); } -static int branch_taken(unsigned int instr, struct pt_regs *regs) -{ - unsigned int bo = (instr >> 21) & 0x1f; - unsigned int bi; - - if ((bo & 4) == 0) { - /* decrement counter */ - --regs->ctr; - if (((bo >> 1) & 1) ^ (regs->ctr == 0)) - return 0; - } - if ((bo & 0x10) == 0) { - /* check bit from CR */ - bi = (instr >> 16) & 0x1f; - if (((regs->ccr >> (31 - bi)) & 1) != ((bo >> 3) & 1)) - return 0; - } - return 1; -} - -/* - * Emulate instructions that cause a transfer of control. - * Returns 1 if the step was emulated, 0 if not, - * or -1 if the instruction is one that should not be stepped, - * such as an rfid, or a mtmsrd that would clear MSR_RI. - */ -static int emulate_step(struct pt_regs *regs, unsigned int instr) -{ - unsigned int opcode, rd; - unsigned long int imm; - - opcode = instr >> 26; - switch (opcode) { - case 16: /* bc */ - imm = (signed short)(instr & 0xfffc); - if ((instr & 2) == 0) - imm += regs->nip; - regs->nip += 4; /* XXX check 32-bit mode */ - if (instr & 1) - regs->link = regs->nip; - if (branch_taken(instr, regs)) - regs->nip = imm; - return 1; - case 17: /* sc */ - regs->gpr[9] = regs->gpr[13]; - regs->gpr[11] = regs->nip + 4; - regs->gpr[12] = regs->msr & MSR_MASK; - regs->gpr[13] = (unsigned long) get_paca(); - regs->nip = (unsigned long) &SystemCall_common; - regs->msr = MSR_KERNEL; - return 1; - case 18: /* b */ - imm = instr & 0x03fffffc; - if (imm & 0x02000000) - imm -= 0x04000000; - if ((instr & 2) == 0) - imm += regs->nip; - if (instr & 1) - regs->link = regs->nip + 4; - regs->nip = imm; - return 1; - case 19: - switch (instr & 0x7fe) { - case 0x20: /* bclr */ - case 0x420: /* bcctr */ - imm = (instr & 0x400)? regs->ctr: regs->link; - regs->nip += 4; /* XXX check 32-bit mode */ - if (instr & 1) - regs->link = regs->nip; - if (branch_taken(instr, regs)) - regs->nip = imm; - return 1; - case 0x24: /* rfid, scary */ - printf("Can't single-step an rfid instruction\n"); - return -1; - } - case 31: - rd = (instr >> 21) & 0x1f; - switch (instr & 0x7fe) { - case 0xa6: /* mfmsr */ - regs->gpr[rd] = regs->msr & MSR_MASK; - regs->nip += 4; - return 1; - case 0x164: /* mtmsrd */ - /* only MSR_EE and MSR_RI get changed if bit 15 set */ - /* mtmsrd doesn't change MSR_HV and MSR_ME */ - imm = (instr & 0x10000)? 0x8002: 0xefffffffffffefffUL; - imm = (regs->msr & MSR_MASK & ~imm) - | (regs->gpr[rd] & imm); - if ((imm & MSR_RI) == 0) { - printf("Can't step an instruction that would " - "clear MSR.RI\n"); - return -1; - } - regs->msr = imm; - regs->nip += 4; - return 1; - } - } - return 0; -} - /* Command interpreting routine */ static char *last_cmd; @@ -988,8 +888,11 @@ static int do_step(struct pt_regs *regs) if ((regs->msr & (MSR_SF|MSR_PR|MSR_IR)) == (MSR_SF|MSR_IR)) { if (mread(regs->nip, &instr, 4) == 4) { stepped = emulate_step(regs, instr); - if (stepped < 0) + if (stepped < 0) { + printf("Couldn't single-step %s instruction\n", + (IS_RFID(instr)? "rfid": "mtmsrd")); return 0; + } if (stepped > 0) { regs->trap = 0xd00 | (regs->trap & 1); printf("stepped to "); @@ -1159,8 +1062,8 @@ static char *breakpoint_help_string = "b [cnt] set breakpoint at given instr addr\n" "bc clear all breakpoints\n" "bc clear breakpoint number n or at addr\n" - "bi [cnt] set hardware instr breakpoint (broken?)\n" - "bd [cnt] set hardware data breakpoint (broken?)\n" + "bi [cnt] set hardware instr breakpoint (POWER3/RS64 only)\n" + "bd [cnt] set hardware data breakpoint\n" ""; static void @@ -1430,6 +1333,26 @@ static void backtrace(struct pt_regs *excp) scannl(); } +static void print_bug_trap(struct pt_regs *regs) +{ + struct bug_entry *bug; + unsigned long addr; + + if (regs->msr & MSR_PR) + return; /* not in kernel */ + addr = regs->nip; /* address of trap instruction */ + if (addr < PAGE_OFFSET) + return; + bug = find_bug(regs->nip); + if (bug == NULL) + return; + if (bug->line & BUG_WARNING_TRAP) + return; + + printf("kernel BUG in %s at %s:%d!\n", + bug->function, bug->file, (unsigned int)bug->line); +} + void excprint(struct pt_regs *fp) { unsigned long trap; @@ -1461,6 +1384,9 @@ void excprint(struct pt_regs *fp) printf(" pid = %ld, comm = %s\n", current->pid, current->comm); } + + if (trap == 0x700) + print_bug_trap(fp); } void prregs(struct pt_regs *fp) @@ -1553,7 +1479,17 @@ read_spr(int n) store_inst(instrs+1); code = (unsigned long (*)(void)) opd; - ret = code(); + if (setjmp(bus_error_jmp) == 0) { + catch_memory_errors = 1; + sync(); + + ret = code(); + + sync(); + /* wait a little while to see if we get a machine check */ + __delay(200); + n = size; + } return ret; } @@ -1574,7 +1510,17 @@ write_spr(int n, unsigned long val) store_inst(instrs+1); code = (unsigned long (*)(unsigned long)) opd; - code(val); + if (setjmp(bus_error_jmp) == 0) { + catch_memory_errors = 1; + sync(); + + code(val); + + sync(); + /* wait a little while to see if we get a machine check */ + __delay(200); + n = size; + } } static unsigned long regno; @@ -1582,13 +1528,13 @@ extern char exc_prolog; extern char dec_exc; void -super_regs() +super_regs(void) { int cmd; unsigned long val; #ifdef CONFIG_PPC_ISERIES struct paca_struct *ptrPaca = NULL; - struct ItLpPaca *ptrLpPaca = NULL; + struct lppaca *ptrLpPaca = NULL; struct ItLpRegSave *ptrLpRegSave = NULL; #endif @@ -1612,10 +1558,10 @@ super_regs() printf(" Local Processor Control Area (LpPaca): \n"); ptrLpPaca = ptrPaca->lppaca_ptr; printf(" Saved Srr0=%.16lx Saved Srr1=%.16lx \n", - ptrLpPaca->xSavedSrr0, ptrLpPaca->xSavedSrr1); + ptrLpPaca->saved_srr0, ptrLpPaca->saved_srr1); printf(" Saved Gpr3=%.16lx Saved Gpr4=%.16lx \n", - ptrLpPaca->xSavedGpr3, ptrLpPaca->xSavedGpr4); - printf(" Saved Gpr5=%.16lx \n", ptrLpPaca->xSavedGpr5); + ptrLpPaca->saved_gpr3, ptrLpPaca->saved_gpr4); + printf(" Saved Gpr5=%.16lx \n", ptrLpPaca->saved_gpr5); printf(" Local Processor Register Save Area (LpRegSave): \n"); ptrLpRegSave = ptrPaca->reg_save_ptr; @@ -1816,7 +1762,7 @@ static char *memex_subcmd_help_string = ""; void -memex() +memex(void) { int cmd, inc, i, nslash; unsigned long n; @@ -1967,7 +1913,7 @@ memex() } int -bsesc() +bsesc(void) { int c; @@ -1985,7 +1931,7 @@ bsesc() || ('a' <= (c) && (c) <= 'f') \ || ('A' <= (c) && (c) <= 'F')) void -dump() +dump(void) { int c; @@ -1993,18 +1939,22 @@ dump() if ((isxdigit(c) && c != 'f' && c != 'd') || c == '\n') termch = c; scanhex((void *)&adrs); - if( termch != '\n') + if (termch != '\n') termch = 0; - if( c == 'i' ){ + if (c == 'i') { scanhex(&nidump); - if( nidump == 0 ) + if (nidump == 0) nidump = 16; + else if (nidump > MAX_DUMP) + nidump = MAX_DUMP; adrs += ppc_inst_dump(adrs, nidump, 1); last_cmd = "di\n"; } else { scanhex(&ndump); - if( ndump == 0 ) + if (ndump == 0) ndump = 64; + else if (ndump > MAX_DUMP) + ndump = MAX_DUMP; prdump(adrs, ndump); adrs += ndump; last_cmd = "d\n"; @@ -2150,7 +2100,7 @@ static unsigned mend; static unsigned mask; void -memlocate() +memlocate(void) { unsigned a, n; unsigned char val[4]; @@ -2183,7 +2133,7 @@ static unsigned long mskip = 0x1000; static unsigned long mlim = 0xffffffff; void -memzcan() +memzcan(void) { unsigned char v; unsigned a; @@ -2212,7 +2162,7 @@ memzcan() /* Input scanning routines */ int -skipbl() +skipbl(void) { int c; @@ -2237,8 +2187,7 @@ static char *regnames[N_PTREGS] = { }; int -scanhex(vp) -unsigned long *vp; +scanhex(unsigned long *vp) { int c, d; unsigned long v; @@ -2322,7 +2271,7 @@ unsigned long *vp; } void -scannl() +scannl(void) { int c; @@ -2365,13 +2314,13 @@ static char line[256]; static char *lineptr; void -flush_input() +flush_input(void) { lineptr = NULL; } int -inchar() +inchar(void) { if (lineptr == NULL || *lineptr == 0) { if (fgets(line, sizeof(line), stdin) == NULL) { @@ -2384,8 +2333,7 @@ inchar() } void -take_input(str) -char *str; +take_input(char *str) { lineptr = str; } @@ -2460,9 +2408,9 @@ static void debug_trace(void) if (cmd == '\n') { /* show current state */ unsigned long i; - printf("naca->debug_switch = 0x%lx\n", naca->debug_switch); + printf("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch); for (i = 0; i < PPCDBG_NUM_FLAGS ;i++) { - on = PPCDBG_BITVAL(i) & naca->debug_switch; + on = PPCDBG_BITVAL(i) & ppc64_debug_switch; printf("%02x %s %12s ", i, on ? "on " : "off", trace_names[i] ? trace_names[i] : ""); if (((i+1) % 3) == 0) printf("\n"); @@ -2476,7 +2424,7 @@ static void debug_trace(void) on = (cmd == '+'); cmd = inchar(); if (cmd == ' ' || cmd == '\n') { /* Turn on or off based on + or - */ - naca->debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE; + ppc64_debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE; printf("Setting all values to %s...\n", on ? "on" : "off"); if (cmd == '\n') return; else cmd = skipbl(); @@ -2491,10 +2439,10 @@ static void debug_trace(void) return; } if (on) { - naca->debug_switch |= PPCDBG_BITVAL(val); + ppc64_debug_switch |= PPCDBG_BITVAL(val); printf("enable debug %x %s\n", val, trace_names[val] ? trace_names[val] : ""); } else { - naca->debug_switch &= ~PPCDBG_BITVAL(val); + ppc64_debug_switch &= ~PPCDBG_BITVAL(val); printf("disable debug %x %s\n", val, trace_names[val] ? trace_names[val] : ""); } cmd = skipbl(); diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 432c55b05..3edfcbd10 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -14,6 +14,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config GENERIC_BUST_SPINLOCK bool @@ -81,7 +85,8 @@ config NR_CPUS config HOTPLUG_CPU bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" - depends on SMP && HOTPLUG && EXPERIMENTAL + depends on SMP && EXPERIMENTAL + select HOTPLUG default n help Say Y here to experiment with turning CPUs off and on. CPUs @@ -362,6 +367,13 @@ config VIRT_TIMER This provides a kernel interface for virtual CPU timers. Default is disabled. +config VIRT_CPU_ACCOUNTING + bool "Base user process accounting on virtual cpu timer" + depends on VIRT_TIMER + help + Select this option to use CPU timer deltas to do user + process accounting. + config APPLDATA_BASE bool "Linux - VM Monitor Stream, base infrastructure" depends on PROC_FS && VIRT_TIMER=y diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 6d2c7ebc4..344d30205 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -34,6 +34,7 @@ cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) +# old style option for packed stacks ifeq ($(call cc-option-yn,-mkernel-backchain),y) cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK @@ -44,6 +45,17 @@ STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) ) endif endif +# new style option for packed stacks +ifeq ($(call cc-option-yn,-mpacked-stack),y) +cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK +aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK +cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK +aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK +ifdef CONFIG_SMALL_STACK +STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) ) +endif +endif + ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 3589f48de..01ae1964c 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -128,7 +128,7 @@ static struct ctl_table appldata_dir_table[] = { DEFINE_PER_CPU(struct vtimer_list, appldata_timer); static atomic_t appldata_expire_count = ATOMIC_INIT(0); -static spinlock_t appldata_timer_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(appldata_timer_lock); static int appldata_interval = APPLDATA_CPU_INTERVAL; static int appldata_timer_active; @@ -140,7 +140,7 @@ static struct tasklet_struct appldata_tasklet_struct; /* * Ops list */ -static spinlock_t appldata_ops_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(appldata_ops_lock); static LIST_HEAD(appldata_ops_list); diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index a67fd8afc..4d97eef36 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile @@ -14,5 +14,5 @@ $(obj)/image: vmlinux FORCE $(call if_changed,objcopy) install: $(CONFIGURE) $(obj)/image - sh -x $(obj)/install.sh $(KERNELRELEASE) $(obj)/image \ + sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/image \ System.map Kerntypes "$(INSTALL_PATH)" diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 55def7d33..b200a5173 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig @@ -1,10 +1,11 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc3 -# Fri Oct 8 19:17:35 2004 +# Linux kernel version: 2.6.11-rc2 +# Mon Jan 31 16:27:12 2005 # CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_S390=y CONFIG_UID16=y @@ -13,6 +14,7 @@ CONFIG_UID16=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -26,6 +28,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set @@ -34,12 +37,12 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -49,6 +52,7 @@ CONFIG_MODULES=y # CONFIG_MODULE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # @@ -139,6 +143,7 @@ CONFIG_SCSI_LOGGING=y # # CONFIG_SCSI_SPI_ATTRS is not set CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -151,13 +156,17 @@ CONFIG_CCW=y # # Block devices # +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set # # S/390 block device drivers @@ -171,6 +180,15 @@ CONFIG_DASD_FBA=y CONFIG_DASD_DIAG=y # CONFIG_DASD_CMB is not set +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + # # Multi-device support (RAID and LVM) # @@ -183,6 +201,7 @@ CONFIG_MD_RAID1=m CONFIG_MD_RAID5=m # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # @@ -191,6 +210,11 @@ CONFIG_MD_MULTIPATH=m CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=2048 +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set + # # S/390 character device drivers # @@ -217,6 +241,9 @@ CONFIG_S390_TAPE_BLOCK=y # S/390 tape hardware support # CONFIG_S390_TAPE_34XX=m +# CONFIG_VMLOGRDR is not set +# CONFIG_MONREADER is not set +# CONFIG_DCSS_SHM is not set # # Cryptographic devices @@ -249,6 +276,8 @@ CONFIG_IP_MULTICAST=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +CONFIG_IP_TCPDIAG_IPV6=y CONFIG_IPV6=y # CONFIG_IPV6_PRIVACY is not set # CONFIG_INET6_AH is not set @@ -276,7 +305,6 @@ CONFIG_XFRM=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -395,6 +423,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set @@ -420,6 +449,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -499,13 +529,17 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -532,14 +566,19 @@ CONFIG_CRYPTO=y # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 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_TEST is not set +# +# Hardware crypto devices +# + # # Library routines # # CONFIG_CRC_CCITT is not set -# CONFIG_CRC32 is not set +CONFIG_CRC32=m # CONFIG_LIBCRC32C is not set diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index a19cb59ed..b41e0e199 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -17,7 +17,7 @@ obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_S390_SUPPORT) += compat_linux.o compat_signal.o \ compat_ioctl.o compat_wrapper.o \ - compat_exec.o compat_exec_domain.o + compat_exec_domain.o obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o obj-$(CONFIG_ARCH_S390_31) += entry.o reipl.o diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index 7537972ac..3f7018e9d 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c @@ -22,6 +22,8 @@ int main(void) DEFINE(__THREAD_mm_segment, offsetof(struct task_struct, thread.mm_segment),); BLANK(); + DEFINE(__TASK_pid, offsetof(struct task_struct, pid),); + BLANK(); DEFINE(__PER_atmid, offsetof(per_struct, lowcore.words.perc_atmid),); DEFINE(__PER_address, offsetof(per_struct, lowcore.words.address),); DEFINE(__PER_access_id, offsetof(per_struct, lowcore.words.access_id),); diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c index 01c188c70..03ba5893f 100644 --- a/arch/s390/kernel/binfmt_elf32.c +++ b/arch/s390/kernel/binfmt_elf32.c @@ -56,6 +56,9 @@ #define ELF_CORE_COPY_REGS(pr_reg, regs) dump_regs32(regs, &pr_reg); +#define ELF_CORE_COPY_TASK_REGS(tsk, regs) dump_task_regs32(tsk, regs) + +#define ELF_CORE_COPY_FPREGS(tsk, fpregs) dump_task_fpu(tsk, fpregs) /* This yields a mask that user programs can use to figure out what instruction set this CPU supports. */ @@ -99,13 +102,37 @@ static inline int dump_regs32(struct pt_regs *ptregs, elf_gregset_t *regs) int i; memcpy(®s->psw.mask, &ptregs->psw.mask, 4); - memcpy(®s->psw.addr, &ptregs->psw.addr, 4); + memcpy(®s->psw.addr, (char *)&ptregs->psw.addr + 4, 4); + for (i = 0; i < NUM_GPRS; i++) + regs->gprs[i] = ptregs->gprs[i]; + save_access_regs(regs->acrs); + regs->orig_gpr2 = ptregs->orig_gpr2; + return 1; +} + +static inline int dump_task_regs32(struct task_struct *tsk, elf_gregset_t *regs) +{ + struct pt_regs *ptregs = __KSTK_PTREGS(tsk); + int i; + + memcpy(®s->psw.mask, &ptregs->psw.mask, 4); + memcpy(®s->psw.addr, (char *)&ptregs->psw.addr + 4, 4); for (i = 0; i < NUM_GPRS; i++) regs->gprs[i] = ptregs->gprs[i]; + memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); regs->orig_gpr2 = ptregs->orig_gpr2; return 1; } +static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) +{ + if (tsk == current) + save_fp_regs((s390_fp_regs *) fpregs); + else + memcpy(fpregs, &tsk->thread.fp_regs, sizeof(elf_fpregset_t)); + return 1; +} + #include #include #include @@ -113,8 +140,6 @@ static inline int dump_regs32(struct pt_regs *ptregs, elf_gregset_t *regs) #include #include -int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack); - #define elf_prstatus elf_prstatus32 struct elf_prstatus32 { @@ -164,7 +189,6 @@ struct elf_prpsinfo32 #undef start_thread #define start_thread start_thread31 -#define setup_arg_pages(bprm, exec) setup_arg_pages32(bprm, exec) MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit Linux for S390 binaries," " Copyright 2000 IBM Corporation"); @@ -173,12 +197,13 @@ MODULE_AUTHOR("Gerhard Tonn "); #undef MODULE_DESCRIPTION #undef MODULE_AUTHOR -#define jiffies_to_timeval jiffies_to_compat_timeval +#undef cputime_to_timeval +#define cputime_to_timeval cputime_to_compat_timeval static __inline__ void -jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) +cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { - value->tv_usec = (jiffies % HZ) * (1000000L / HZ); - value->tv_sec = jiffies / HZ; + value->tv_usec = cputime % 1000000; + value->tv_sec = cputime / 1000000; } #include "../../../fs/binfmt_elf.c" diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 5c0a63aff..1bf2951d9 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c @@ -331,7 +331,7 @@ asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr) case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); } @@ -355,136 +355,6 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned return sys_ftruncate(fd, (high << 32) | low); } -/* readdir & getdents */ - -#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de))) -#define ROUND_UP(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1)) - -struct old_linux_dirent32 { - u32 d_ino; - u32 d_offset; - unsigned short d_namlen; - char d_name[1]; -}; - -struct readdir_callback32 { - struct old_linux_dirent32 * dirent; - int count; -}; - -static int fillonedir(void * __buf, const char * name, int namlen, - loff_t offset, ino_t ino, unsigned int d_type) -{ - struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf; - struct old_linux_dirent32 * dirent; - - if (buf->count) - return -EINVAL; - buf->count++; - dirent = buf->dirent; - put_user(ino, &dirent->d_ino); - put_user(offset, &dirent->d_offset); - put_user(namlen, &dirent->d_namlen); - copy_to_user(dirent->d_name, name, namlen); - put_user(0, dirent->d_name + namlen); - return 0; -} - -asmlinkage long old32_readdir(unsigned int fd, struct old_linux_dirent32 *dirent, unsigned int count) -{ - int error = -EBADF; - struct file * file; - struct readdir_callback32 buf; - - file = fget(fd); - if (!file) - goto out; - - buf.count = 0; - buf.dirent = dirent; - - error = vfs_readdir(file, fillonedir, &buf); - if (error < 0) - goto out_putf; - error = buf.count; - -out_putf: - fput(file); -out: - return error; -} - -struct linux_dirent32 { - u32 d_ino; - u32 d_off; - unsigned short d_reclen; - char d_name[1]; -}; - -struct getdents_callback32 { - struct linux_dirent32 * current_dir; - struct linux_dirent32 * previous; - int count; - int error; -}; - -static int filldir(void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, - unsigned int d_type) -{ - struct linux_dirent32 * dirent; - struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf; - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); - - buf->error = -EINVAL; /* only used if we fail.. */ - if (reclen > buf->count) - return -EINVAL; - dirent = buf->previous; - if (dirent) - put_user(offset, &dirent->d_off); - dirent = buf->current_dir; - buf->previous = dirent; - put_user(ino, &dirent->d_ino); - put_user(reclen, &dirent->d_reclen); - copy_to_user(dirent->d_name, name, namlen); - put_user(0, dirent->d_name + namlen); - buf->current_dir = ((void *)dirent) + reclen; - buf->count -= reclen; - return 0; -} - -asmlinkage long sys32_getdents(unsigned int fd, struct linux_dirent32 *dirent, unsigned int count) -{ - struct file * file; - struct linux_dirent32 * lastdirent; - struct getdents_callback32 buf; - int error = -EBADF; - - file = fget(fd); - if (!file) - goto out; - - buf.current_dir = dirent; - buf.previous = NULL; - buf.count = count; - buf.error = 0; - - error = vfs_readdir(file, filldir, &buf); - if (error < 0) - goto out_putf; - lastdirent = buf.previous; - error = buf.error; - if(lastdirent) { - put_user(file->f_pos, &lastdirent->d_off); - error = count - buf.count; - } -out_putf: - fput(file); -out: - return error; -} - -/* end of readdir & getdents */ - int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) { int err; @@ -634,92 +504,8 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, return ret; } -extern int -copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from); - -asmlinkage long -sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo, - struct compat_timespec *uts, size_t sigsetsize) -{ - int ret, sig; - sigset_t these; - compat_sigset_t these32; - struct timespec ts; - siginfo_t info; - long timeout = 0; - - /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset_t)) - return -EINVAL; - - if (copy_from_user (&these32, uthese, sizeof(compat_sigset_t))) - return -EFAULT; - - switch (_NSIG_WORDS) { - case 4: these.sig[3] = these32.sig[6] | (((long)these32.sig[7]) << 32); - case 3: these.sig[2] = these32.sig[4] | (((long)these32.sig[5]) << 32); - case 2: these.sig[1] = these32.sig[2] | (((long)these32.sig[3]) << 32); - case 1: these.sig[0] = these32.sig[0] | (((long)these32.sig[1]) << 32); - } - - /* - * Invert the set of allowed signals to get those we - * want to block. - */ - sigdelsetmask(&these, sigmask(SIGKILL)|sigmask(SIGSTOP)); - signotset(&these); - - if (uts) { - if (get_compat_timespec(&ts, uts)) - return -EINVAL; - if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0 - || ts.tv_sec < 0) - return -EINVAL; - } - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - if (!sig) { - /* None ready -- temporarily unblock those we're interested - in so that we'll be awakened when they arrive. */ - current->real_blocked = current->blocked; - sigandsets(¤t->blocked, ¤t->blocked, &these); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - timeout = MAX_SCHEDULE_TIMEOUT; - if (uts) - timeout = (timespec_to_jiffies(&ts) - + (ts.tv_sec || ts.tv_nsec)); - - current->state = TASK_INTERRUPTIBLE; - timeout = schedule_timeout(timeout); - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - current->blocked = current->real_blocked; - siginitset(¤t->real_blocked, 0); - recalc_sigpending(); - } - spin_unlock_irq(¤t->sighand->siglock); - - if (sig) { - ret = sig; - if (uinfo) { - if (copy_siginfo_to_user32(uinfo, &info)) - ret = -EFAULT; - } - } else { - ret = -EAGAIN; - if (timeout) - ret = -EINTR; - } - - return ret; -} - asmlinkage long -sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo) +sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) { siginfo_t info; int ret; @@ -751,7 +537,9 @@ sys32_execve(struct pt_regs regs) compat_ptr(regs.gprs[4]), ®s); if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); current->thread.fp_regs.fpc=0; __asm__ __volatile__ ("sr 0,0\n\t" @@ -988,6 +776,7 @@ asmlinkage long sys32_adjtimex(struct timex32 *utp) return ret; } +#ifdef CONFIG_SYSCTL struct __sysctl_args32 { u32 name; int nlen; @@ -1035,6 +824,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) } return error; } +#endif struct stat64_emu31 { unsigned long long st_dev; diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index 48209a81a..e95b0761d 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h @@ -34,7 +34,7 @@ typedef union sigval32 { __u32 sival_ptr; } sigval_t32; -typedef struct siginfo32 { +typedef struct compat_siginfo { int si_signo; int si_errno; int si_code; @@ -50,9 +50,10 @@ typedef struct siginfo32 { /* POSIX.1b timers */ struct { - unsigned int _timer1; - unsigned int _timer2; - + timer_t _tid; /* timer id */ + int _overrun; /* overrun count */ + sigval_t _sigval; /* same as below */ + int _sys_private; /* not to be passed to user */ } _timer; /* POSIX.1b signals */ @@ -82,7 +83,7 @@ typedef struct siginfo32 { int _fd; } _sigpoll; } _sifields; -} siginfo_t32; +} compat_siginfo_t; /* * How these fields are to be accessed. @@ -98,6 +99,8 @@ typedef struct siginfo32 { #define si_addr _sifields._sigfault._addr #define si_band _sifields._sigpoll._band #define si_fd _sifields._sigpoll._fd +#define si_tid _sifields._timer._tid +#define si_overrun _sifields._timer._overrun /* asm/sigcontext.h */ typedef union @@ -214,7 +217,4 @@ struct sigevent32 { } _sigev_un; }; -extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from); -extern int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from); - #endif /* _ASM_S390X_S390_H */ diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index f29bcb856..b728e027b 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c @@ -48,17 +48,17 @@ typedef struct { __u8 callee_used_stack[__SIGNAL_FRAMESIZE32]; __u8 retcode[S390_SYSCALL_SIZE]; - struct siginfo32 info; + compat_siginfo_t info; struct ucontext32 uc; } rt_sigframe32; asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); -int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from) +int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) { int err; - if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32))) + if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t))) return -EFAULT; /* If you change siginfo_t structure, please be sure @@ -95,10 +95,14 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from) &to->si_addr); break; case __SI_POLL >> 16: - case __SI_TIMER >> 16: err |= __put_user(from->si_band, &to->si_band); err |= __put_user(from->si_fd, &to->si_fd); break; + case __SI_TIMER >> 16: + err |= __put_user(from->si_tid, &to->si_tid); + err |= __put_user(from->si_overrun, &to->si_overrun); + err |= __put_user(from->si_int, &to->si_int); + break; default: break; } @@ -106,12 +110,12 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from) return err; } -int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from) +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) { int err; u32 tmp; - if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32))) + if (!access_ok (VERIFY_READ, from, sizeof(compat_siginfo_t))) return -EFAULT; err = __get_user(to->si_signo, &from->si_signo); @@ -142,10 +146,14 @@ int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from) to->si_addr = (void *)(u64) (tmp & PSW32_ADDR_INSN); break; case __SI_POLL >> 16: - case __SI_TIMER >> 16: err |= __get_user(to->si_band, &from->si_band); err |= __get_user(to->si_fd, &from->si_fd); break; + case __SI_TIMER >> 16: + err |= __get_user(to->si_tid, &from->si_tid); + err |= __get_user(to->si_overrun, &from->si_overrun); + err |= __get_user(to->si_int, &from->si_int); + break; default: break; } diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 41adc6120..e58213118 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S @@ -64,7 +64,7 @@ sys32_chdir_wrapper: .globl sys32_time_wrapper sys32_time_wrapper: llgtr %r2,%r2 # int * - jg sys_time # branch to system call + jg compat_sys_time # branch to system call .globl sys32_mknod_wrapper sys32_mknod_wrapper: @@ -391,7 +391,7 @@ old32_readdir_wrapper: llgfr %r2,%r2 # unsigned int llgtr %r3,%r3 # void * llgfr %r4,%r4 # unsigned int - jg old32_readdir # branch to system call + jg compat_sys_old_readdir # branch to system call .globl old32_mmap_wrapper old32_mmap_wrapper: @@ -639,7 +639,7 @@ sys32_getdents_wrapper: llgfr %r2,%r2 # unsigned int llgtr %r3,%r3 # void * llgfr %r4,%r4 # unsigned int - jg sys32_getdents # branch to system call + jg compat_sys_getdents # branch to system call .globl compat_sys_select_wrapper compat_sys_select_wrapper: @@ -840,13 +840,13 @@ sys32_rt_sigpending_wrapper: llgfr %r3,%r3 # size_t jg sys32_rt_sigpending # branch to system call - .globl sys32_rt_sigtimedwait_wrapper -sys32_rt_sigtimedwait_wrapper: + .globl compat_sys_rt_sigtimedwait_wrapper +compat_sys_rt_sigtimedwait_wrapper: llgtr %r2,%r2 # const sigset_emu31_t * llgtr %r3,%r3 # siginfo_emu31_t * llgtr %r4,%r4 # const struct compat_timespec * llgfr %r5,%r5 # size_t - jg sys32_rt_sigtimedwait # branch to system call + jg compat_sys_rt_sigtimedwait # branch to system call .globl sys32_rt_sigqueueinfo_wrapper sys32_rt_sigqueueinfo_wrapper: @@ -1076,8 +1076,8 @@ sys32_lstat64_wrapper: .globl sys32_stime_wrapper sys32_stime_wrapper: - llgtr %r2,%r2 # int * - jg sys_stime # branch to system call + llgtr %r2,%r2 # long * + jg compat_sys_stime # branch to system call .globl sys32_sysctl_wrapper sys32_sysctl_wrapper: @@ -1262,19 +1262,19 @@ sys32_fadvise64_64_wrapper: sys32_clock_settime_wrapper: lgfr %r2,%r2 # clockid_t (int) llgtr %r3,%r3 # struct compat_timespec * - jg compat_clock_settime + jg compat_sys_clock_settime .globl sys32_clock_gettime_wrapper sys32_clock_gettime_wrapper: lgfr %r2,%r2 # clockid_t (int) llgtr %r3,%r3 # struct compat_timespec * - jg compat_clock_gettime + jg compat_sys_clock_gettime .globl sys32_clock_getres_wrapper sys32_clock_getres_wrapper: lgfr %r2,%r2 # clockid_t (int) llgtr %r3,%r3 # struct compat_timespec * - jg compat_clock_getres + jg compat_sys_clock_getres .globl sys32_clock_nanosleep_wrapper sys32_clock_nanosleep_wrapper: @@ -1282,7 +1282,7 @@ sys32_clock_nanosleep_wrapper: lgfr %r3,%r3 # int llgtr %r4,%r4 # struct compat_timespec * llgtr %r5,%r5 # struct compat_timespec * - jg compat_clock_nanosleep + jg compat_sys_clock_nanosleep .globl sys32_timer_create_wrapper sys32_timer_create_wrapper: @@ -1297,13 +1297,13 @@ sys32_timer_settime_wrapper: lgfr %r3,%r3 # int llgtr %r4,%r4 # struct compat_itimerspec * llgtr %r5,%r5 # struct compat_itimerspec * - jg compat_timer_settime + jg compat_sys_timer_settime .globl sys32_timer_gettime_wrapper sys32_timer_gettime_wrapper: lgfr %r2,%r2 # timer_t (int) llgtr %r3,%r3 # struct compat_itimerspec * - jg compat_timer_gettime + jg compat_sys_timer_gettime .globl sys32_timer_getoverrun_wrapper sys32_timer_getoverrun_wrapper: @@ -1354,14 +1354,14 @@ compat_sys_statfs64_wrapper: llgtr %r2,%r2 # const char * llgfr %r3,%r3 # compat_size_t llgtr %r4,%r4 # struct compat_statfs64 * - jg compat_statfs64 + jg compat_sys_statfs64 .globl compat_sys_fstatfs64_wrapper compat_sys_fstatfs64_wrapper: llgfr %r2,%r2 # unsigned int fd llgfr %r3,%r3 # compat_size_t llgtr %r4,%r4 # struct compat_statfs64 * - jg compat_fstatfs64 + jg compat_sys_fstatfs64 .globl compat_sys_mq_open_wrapper compat_sys_mq_open_wrapper: diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c index d48351583..44df8dc07 100644 --- a/arch/s390/kernel/cpcmd.c +++ b/arch/s390/kernel/cpcmd.c @@ -4,42 +4,50 @@ * S390 version * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), + * Christian Borntraeger (cborntra@de.ibm.com), */ -#include #include +#include +#include +#include +#include #include #include -#include #include #include -static spinlock_t cpcmd_lock = SPIN_LOCK_UNLOCKED; -static char cpcmd_buf[128]; +static DEFINE_SPINLOCK(cpcmd_lock); +static char cpcmd_buf[240]; -void cpcmd(char *cmd, char *response, int rlen) +/* + * the caller of __cpcmd has to ensure that the response buffer is below 2 GB + */ +void __cpcmd(char *cmd, char *response, int rlen) { - const int mask = 0x40000000L; + const int mask = 0x40000000L; unsigned long flags; - int cmdlen; + int cmdlen; spin_lock_irqsave(&cpcmd_lock, flags); - cmdlen = strlen(cmd); - strcpy(cpcmd_buf, cmd); - ASCEBC(cpcmd_buf, cmdlen); + cmdlen = strlen(cmd); + BUG_ON(cmdlen > 240); + strcpy(cpcmd_buf, cmd); + ASCEBC(cpcmd_buf, cmdlen); - if (response != NULL && rlen > 0) { + if (response != NULL && rlen > 0) { + memset(response, 0, rlen); #ifndef CONFIG_ARCH_S390X - asm volatile ("LRA 2,0(%0)\n\t" + asm volatile ("LRA 2,0(%0)\n\t" "LR 4,%1\n\t" "O 4,%4\n\t" "LRA 3,0(%2)\n\t" "LR 5,%3\n\t" - ".long 0x83240008 # Diagnose 83\n\t" + ".long 0x83240008 # Diagnose X'08'\n\t" : /* no output */ : "a" (cpcmd_buf), "d" (cmdlen), "a" (response), "d" (rlen), "m" (mask) - : "2", "3", "4", "5" ); + : "cc", "2", "3", "4", "5" ); #else /* CONFIG_ARCH_S390X */ asm volatile (" lrag 2,0(%0)\n" " lgr 4,%1\n" @@ -47,19 +55,19 @@ void cpcmd(char *cmd, char *response, int rlen) " lrag 3,0(%2)\n" " lgr 5,%3\n" " sam31\n" - " .long 0x83240008 # Diagnose 83\n" + " .long 0x83240008 # Diagnose X'08'\n" " sam64" : /* no output */ : "a" (cpcmd_buf), "d" (cmdlen), "a" (response), "d" (rlen), "m" (mask) - : "2", "3", "4", "5" ); + : "cc", "2", "3", "4", "5" ); #endif /* CONFIG_ARCH_S390X */ EBCASC(response, rlen); } else { #ifndef CONFIG_ARCH_S390X asm volatile ("LRA 2,0(%0)\n\t" "LR 3,%1\n\t" - ".long 0x83230008 # Diagnose 83\n\t" + ".long 0x83230008 # Diagnose X'08'\n\t" : /* no output */ : "a" (cpcmd_buf), "d" (cmdlen) : "2", "3" ); @@ -67,7 +75,7 @@ void cpcmd(char *cmd, char *response, int rlen) asm volatile (" lrag 2,0(%0)\n" " lgr 3,%1\n" " sam31\n" - " .long 0x83230008 # Diagnose 83\n" + " .long 0x83230008 # Diagnose X'08'\n" " sam64" : /* no output */ : "a" (cpcmd_buf), "d" (cmdlen) @@ -77,3 +85,27 @@ void cpcmd(char *cmd, char *response, int rlen) spin_unlock_irqrestore(&cpcmd_lock, flags); } +EXPORT_SYMBOL(__cpcmd); + +#ifdef CONFIG_ARCH_S390X +void cpcmd(char *cmd, char *response, int rlen) +{ + char *lowbuf; + if ((rlen == 0) || (response == NULL) + || !((unsigned long)response >> 31)) + __cpcmd(cmd, response, rlen); + else { + lowbuf = kmalloc(rlen, GFP_KERNEL | GFP_DMA); + if (!lowbuf) { + printk(KERN_WARNING + "cpcmd: could not allocate response buffer\n"); + return; + } + __cpcmd(cmd, lowbuf, rlen); + memcpy(response, lowbuf, rlen); + kfree(lowbuf); + } +} + +EXPORT_SYMBOL(cpcmd); +#endif /* CONFIG_ARCH_S390X */ diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 8669d6c3e..7cf71af8a 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -708,6 +709,70 @@ extern inline void debug_finish_entry(debug_info_t * id, debug_entry_t* active, proceed_active_area(id); } +static int debug_stoppable=1; +static int debug_active=1; + +#define CTL_S390DBF 5677 +#define CTL_S390DBF_STOPPABLE 5678 +#define CTL_S390DBF_ACTIVE 5679 + +/* + * proc handler for the running debug_active sysctl + * always allow read, allow write only if debug_stoppable is set or + * if debug_active is already off + */ +static int s390dbf_procactive(ctl_table *table, int write, struct file *filp, + void __user *buffer, size_t *lenp, loff_t *ppos) +{ + if (!write || debug_stoppable || !debug_active) + return proc_dointvec(table, write, filp, buffer, lenp, ppos); + else + return 0; +} + + +static struct ctl_table s390dbf_table[] = { + { + .ctl_name = CTL_S390DBF_STOPPABLE, + .procname = "debug_stoppable", + .data = &debug_stoppable, + .maxlen = sizeof(int), + .mode = S_IRUGO | S_IWUSR, + .proc_handler = &proc_dointvec, + .strategy = &sysctl_intvec, + }, + { + .ctl_name = CTL_S390DBF_ACTIVE, + .procname = "debug_active", + .data = &debug_active, + .maxlen = sizeof(int), + .mode = S_IRUGO | S_IWUSR, + .proc_handler = &s390dbf_procactive, + .strategy = &sysctl_intvec, + }, + { .ctl_name = 0 } +}; + +static struct ctl_table s390dbf_dir_table[] = { + { + .ctl_name = CTL_S390DBF, + .procname = "s390dbf", + .maxlen = 0, + .mode = S_IRUGO | S_IXUGO, + .child = s390dbf_table, + }, + { .ctl_name = 0 } +}; + +struct ctl_table_header *s390dbf_sysctl_header; + +void debug_stop_all(void) +{ + if (debug_stoppable) + debug_active = 0; +} + + /* * debug_event_common: * - write debug entry with given size @@ -719,6 +784,8 @@ debug_entry_t *debug_event_common(debug_info_t * id, int level, const void *buf, unsigned long flags; debug_entry_t *active; + if (!debug_active) + return NULL; spin_lock_irqsave(&id->lock, flags); active = get_active_entry(id); memset(DEBUG_DATA(active), 0, id->buf_size); @@ -740,6 +807,8 @@ debug_entry_t *debug_exception_common(debug_info_t * id, int level, unsigned long flags; debug_entry_t *active; + if (!debug_active) + return NULL; spin_lock_irqsave(&id->lock, flags); active = get_active_entry(id); memset(DEBUG_DATA(active), 0, id->buf_size); @@ -780,7 +849,8 @@ debug_entry_t *debug_sprintf_event(debug_info_t* id, if((!id) || (level > id->level)) return NULL; - + if (!debug_active) + return NULL; numargs=debug_count_numargs(string); spin_lock_irqsave(&id->lock, flags); @@ -812,6 +882,8 @@ debug_entry_t *debug_sprintf_exception(debug_info_t* id, if((!id) || (level > id->level)) return NULL; + if (!debug_active) + return NULL; numargs=debug_count_numargs(string); @@ -838,6 +910,7 @@ static int __init debug_init(void) { int rc = 0; + s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table, 1); down(&debug_lock); #ifdef CONFIG_PROC_FS debug_proc_root_entry = proc_mkdir(DEBUG_DIR_ROOT, NULL); @@ -858,7 +931,7 @@ int debug_register_view(debug_info_t * id, struct debug_view *view) int rc = 0; int i; unsigned long flags; - mode_t mode = S_IFREG; + mode_t mode = S_IFREG | S_IRUSR | S_IWUSR; struct proc_dir_entry *pde; if (!id) @@ -1186,6 +1259,7 @@ void __exit debug_exit(void) #ifdef CONFIG_PROC_FS remove_proc_entry(debug_proc_root_entry->name, NULL); #endif /* CONFIG_PROC_FS */ + unregister_sysctl_table(s390dbf_sysctl_header); return; } @@ -1199,6 +1273,7 @@ MODULE_LICENSE("GPL"); EXPORT_SYMBOL(debug_register); EXPORT_SYMBOL(debug_unregister); EXPORT_SYMBOL(debug_set_level); +EXPORT_SYMBOL(debug_stop_all); EXPORT_SYMBOL(debug_register_view); EXPORT_SYMBOL(debug_unregister_view); EXPORT_SYMBOL(debug_event_common); diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 06312d09c..c0e09b33f 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -66,6 +66,27 @@ STACK_SIZE = 1 << STACK_SHIFT * R15 - kernel stack pointer */ + .macro STORE_TIMER lc_offset +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + stpt \lc_offset +#endif + .endm + +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .macro UPDATE_VTIME lc_from,lc_to,lc_sum + lm %r10,%r11,\lc_from + sl %r10,\lc_to + sl %r11,\lc_to+4 + bc 3,BASED(0f) + sl %r10,BASED(.Lc_1) +0: al %r10,\lc_sum + al %r11,\lc_sum+4 + bc 12,BASED(1f) + al %r10,BASED(.Lc_1) +1: stm %r10,%r11,\lc_sum + .endm +#endif + .macro SAVE_ALL_BASE savearea stm %r12,%r15,\savearea l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13 @@ -118,6 +139,7 @@ STACK_SIZE = 1 << STACK_SHIFT ni __LC_RETURN_PSW+1,0xfd # clear wait state bit .endif lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user + STORE_TIMER __LC_EXIT_TIMER lpsw __LC_RETURN_PSW # back to caller .endm @@ -144,6 +166,7 @@ __switch_to_noper: l %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp lm %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task st %r3,__LC_CURRENT # __LC_CURRENT = current task struct + lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 l %r3,__THREAD_info(%r3) # load thread_info from task struct st %r3,__LC_THREAD_INFO ahi %r3,STACK_SIZE @@ -158,9 +181,21 @@ __critical_start: .globl system_call system_call: + STORE_TIMER __LC_SYNC_ENTER_TIMER +sysc_saveall: SAVE_ALL_BASE __LC_SAVE_AREA SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 lh %r7,0x8a # get svc number from lowcore +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +sysc_vtime: + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(sysc_do_svc) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER +sysc_stime: + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER +sysc_update: + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +#endif sysc_do_svc: l %r9,__LC_THREAD_INFO # load pointer to thread_info struct sla %r7,2 # *4 and test for svc 0 @@ -228,6 +263,8 @@ sysc_sigpending: basr %r14,%r1 # call do_signal tm __TI_flags+3(%r9),_TIF_RESTART_SVC bo BASED(sysc_restart) + tm __TI_flags+3(%r9),_TIF_SINGLE_STEP + bo BASED(sysc_singlestep) b BASED(sysc_leave) # out of here, do NOT recheck # @@ -388,10 +425,19 @@ pgm_check_handler: * we just ignore the PER event (FIXME: is there anything we have to do * for LPSW?). */ + STORE_TIMER __LC_SYNC_ENTER_TIMER SAVE_ALL_BASE __LC_SAVE_AREA tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception bnz BASED(pgm_per) # got per exception -> special case SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(pgm_no_vtime) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime: +#endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct l %r3,__LC_PGM_ILC # load program interruption code la %r8,0x7f @@ -422,6 +468,14 @@ pgm_per: # pgm_per_std: SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(pgm_no_vtime2) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime2: +#endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct l %r1,__TI_task(%r9) mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID @@ -439,6 +493,14 @@ pgm_per_std: # pgm_svcper: SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(pgm_no_vtime3) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime3: +#endif lh %r7,0x8a # get svc number from lowcore l %r9,__LC_THREAD_INFO # load pointer to thread_info struct l %r1,__TI_task(%r9) @@ -455,9 +517,18 @@ pgm_svcper: .globl io_int_handler io_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER stck __LC_INT_CLOCK SAVE_ALL_BASE __LC_SAVE_AREA+16 SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+16,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(io_no_vtime) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +io_no_vtime: +#endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ la %r2,SP_PTREGS(%r15) # address of register-save area @@ -546,9 +617,18 @@ io_sigpending: .globl ext_int_handler ext_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER stck __LC_INT_CLOCK SAVE_ALL_BASE __LC_SAVE_AREA+16 SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(ext_no_vtime) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +ext_no_vtime: +#endif l %r9,__LC_THREAD_INFO # load pointer to thread_info struct la %r2,SP_PTREGS(%r15) # address of register-save area lh %r3,__LC_EXT_INT_CODE # get interruption code @@ -562,8 +642,17 @@ ext_int_handler: .globl mcck_int_handler mcck_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER SAVE_ALL_BASE __LC_SAVE_AREA+32 SAVE_ALL __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(mcck_no_vtime) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +mcck_no_vtime: +#endif l %r1,BASED(.Ls390_mcck) basr %r14,%r1 # call machine check handler mcck_return: @@ -658,17 +747,47 @@ cleanup_critical: br %r14 cleanup_system_call: - mvc __LC_RETURN_PSW(4),0(%r12) - clc 4(4,%r12),BASED(cleanup_table_system_call) - bne BASED(0f) + mvc __LC_RETURN_PSW(8),0(%r12) +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+4) + bh BASED(0f) + mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER +0: clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+8) + bhe BASED(cleanup_vtime) +#endif + clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn) + bh BASED(0f) mvc __LC_SAVE_AREA(16),__LC_SAVE_AREA+16 0: st %r13,__LC_SAVE_AREA+20 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 st %r15,__LC_SAVE_AREA+28 lh %r7,0x8a +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +cleanup_vtime: + clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+12) + bhe BASED(cleanup_stime) + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + bz BASED(cleanup_novtime) + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER +cleanup_stime: + clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+16) + bh BASED(cleanup_update) + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER +cleanup_update: + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +cleanup_novtime: +#endif mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_system_call+4) la %r12,__LC_RETURN_PSW br %r14 +cleanup_system_call_insn: + .long sysc_saveall + 0x80000000 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .long system_call + 0x80000000 + .long sysc_vtime + 0x80000000 + .long sysc_stime + 0x80000000 + .long sysc_update + 0x80000000 +#endif cleanup_sysc_return: mvc __LC_RETURN_PSW(4),0(%r12) @@ -677,15 +796,23 @@ cleanup_sysc_return: br %r14 cleanup_sysc_leave: - clc 4(4,%r12),BASED(cleanup_sysc_leave_lpsw) + clc 4(4,%r12),BASED(cleanup_sysc_leave_insn) + be BASED(0f) +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER + clc 4(4,%r12),BASED(cleanup_sysc_leave_insn+4) be BASED(0f) +#endif mvc __LC_RETURN_PSW(8),SP_PSW(%r15) mvc __LC_SAVE_AREA+16(16),SP_R12(%r15) lm %r0,%r11,SP_R0(%r15) l %r15,SP_R15(%r15) 0: la %r12,__LC_RETURN_PSW br %r14 -cleanup_sysc_leave_lpsw: +cleanup_sysc_leave_insn: +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .long sysc_leave + 14 + 0x80000000 +#endif .long sysc_leave + 10 + 0x80000000 /* @@ -701,6 +828,7 @@ cleanup_sysc_leave_lpsw: .L0x028: .short 0x028 .L0x030: .short 0x030 .L0x038: .short 0x038 +.Lc_1: .long 1 /* * Symbol constants diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 10056f2b1..51527ab8c 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S @@ -58,6 +58,21 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED) #define BASED(name) name-system_call(%r13) + .macro STORE_TIMER lc_offset +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + stpt \lc_offset +#endif + .endm + +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .macro UPDATE_VTIME lc_from,lc_to,lc_sum + lg %r10,\lc_from + slg %r10,\lc_to + alg %r10,\lc_sum + stg %r10,\lc_sum + .endm +#endif + /* * Register usage in interrupt handlers: * R9 - pointer to current task structure @@ -117,6 +132,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED) ni __LC_RETURN_PSW+1,0xfd # clear wait state bit .endif lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user + STORE_TIMER __LC_EXIT_TIMER lpswe __LC_RETURN_PSW # back to caller .endm @@ -141,6 +157,7 @@ __switch_to_noper: lg %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp lmg %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task stg %r3,__LC_CURRENT # __LC_CURRENT = current task struct + lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 lg %r3,__THREAD_info(%r3) # load thread_info from task struct stg %r3,__LC_THREAD_INFO aghi %r3,STACK_SIZE @@ -155,9 +172,21 @@ __critical_start: .globl system_call system_call: + STORE_TIMER __LC_SYNC_ENTER_TIMER +sysc_saveall: SAVE_ALL_BASE __LC_SAVE_AREA SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +sysc_vtime: + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz sysc_do_svc + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER +sysc_stime: + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER +sysc_update: + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +#endif sysc_do_svc: lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct slag %r7,%r7,2 # *4 and test for svc 0 @@ -230,6 +259,8 @@ sysc_sigpending: brasl %r14,do_signal # call do_signal tm __TI_flags+7(%r9),_TIF_RESTART_SVC jo sysc_restart + tm __TI_flags+7(%r9),_TIF_SINGLE_STEP + jo sysc_singlestep j sysc_leave # out of here, do NOT recheck # @@ -438,10 +469,19 @@ pgm_check_handler: * we just ignore the PER event (FIXME: is there anything we have to do * for LPSW?). */ + STORE_TIMER __LC_SYNC_ENTER_TIMER SAVE_ALL_BASE __LC_SAVE_AREA tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception jnz pgm_per # got per exception -> special case SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz pgm_no_vtime + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime: +#endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct lgf %r3,__LC_PGM_ILC # load program interruption code lghi %r8,0x7f @@ -472,6 +512,14 @@ pgm_per: # pgm_per_std: SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz pgm_no_vtime2 + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime2: +#endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct lg %r1,__TI_task(%r9) mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID @@ -489,6 +537,14 @@ pgm_per_std: # pgm_svcper: SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz pgm_no_vtime3 + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +pgm_no_vtime3: +#endif llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct lg %r1,__TI_task(%r9) @@ -504,9 +560,18 @@ pgm_svcper: */ .globl io_int_handler io_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER stck __LC_INT_CLOCK SAVE_ALL_BASE __LC_SAVE_AREA+32 SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+32,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz io_no_vtime + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +io_no_vtime: +#endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct la %r2,SP_PTREGS(%r15) # address of register-save area brasl %r14,do_IRQ # call standard irq handler @@ -592,9 +657,18 @@ io_sigpending: */ .globl ext_int_handler ext_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER stck __LC_INT_CLOCK SAVE_ALL_BASE __LC_SAVE_AREA+32 SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz ext_no_vtime + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +ext_no_vtime: +#endif lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct la %r2,SP_PTREGS(%r15) # address of register-save area llgh %r3,__LC_EXT_INT_CODE # get interruption code @@ -606,8 +680,17 @@ ext_int_handler: */ .globl mcck_int_handler mcck_int_handler: + STORE_TIMER __LC_ASYNC_ENTER_TIMER SAVE_ALL_BASE __LC_SAVE_AREA+64 SAVE_ALL __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64,0 +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz mcck_no_vtime + UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER + mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER +mcck_no_vtime: +#endif brasl %r14,s390_do_machine_check mcck_return: RESTORE_ALL 0 @@ -697,17 +780,47 @@ cleanup_critical: br %r14 cleanup_system_call: - mvc __LC_RETURN_PSW(8),0(%r12) - clc 8(8,%r12),BASED(cleanup_table_system_call) - jne 0f + mvc __LC_RETURN_PSW(16),0(%r12) +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+8) + jh 0f + mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER +0: clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+16) + jhe cleanup_vtime +#endif + clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn) + jh 0f mvc __LC_SAVE_AREA(32),__LC_SAVE_AREA+32 0: stg %r13,__LC_SAVE_AREA+40 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 stg %r15,__LC_SAVE_AREA+56 llgh %r7,__LC_SVC_INT_CODE +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +cleanup_vtime: + clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24) + jhe cleanup_stime + tm SP_PSW+1(%r15),0x01 # interrupting from user ? + jz cleanup_novtime + UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER +cleanup_stime: + clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+32) + jh cleanup_update + UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER +cleanup_update: + mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER +cleanup_novtime: +#endif mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_system_call+8) la %r12,__LC_RETURN_PSW br %r14 +cleanup_system_call_insn: + .quad sysc_saveall +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .quad system_call + .quad sysc_vtime + .quad sysc_stime + .quad sysc_update +#endif cleanup_sysc_return: mvc __LC_RETURN_PSW(8),0(%r12) @@ -716,15 +829,23 @@ cleanup_sysc_return: br %r14 cleanup_sysc_leave: - clc 8(8,%r12),BASED(cleanup_sysc_leave_lpsw) + clc 8(8,%r12),BASED(cleanup_sysc_leave_insn) + je 0f +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER + clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8) je 0f +#endif mvc __LC_RETURN_PSW(16),SP_PSW(%r15) mvc __LC_SAVE_AREA+32(32),SP_R12(%r15) lmg %r0,%r11,SP_R0(%r15) lg %r15,SP_R15(%r15) 0: la %r12,__LC_RETURN_PSW br %r14 -cleanup_sysc_leave_lpsw: +cleanup_sysc_leave_insn: +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + .quad sysc_leave + 16 +#endif .quad sysc_leave + 12 /* diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 79a422247..59bfceaba 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -71,6 +71,10 @@ asmlinkage void do_softirq(void) local_irq_save(flags); + account_system_vtime(current); + + local_bh_disable(); + if (local_softirq_pending()) { /* Get current stack pointer. */ asm volatile("la %0,0(15)" : "=a" (old)); @@ -86,13 +90,17 @@ asmlinkage void do_softirq(void) " la 15,0(%1)\n" : : "a" (new), "a" (old), "a" (__do_softirq) - : "0", "1", "2", "3", "4", "5", + : "0", "1", "2", "3", "4", "5", "14", "cc", "memory" ); } else /* We are already on the async stack. */ __do_softirq(); } + account_system_vtime(current); + + __local_bh_enable(); + local_irq_restore(flags); } diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index a15f297dd..607d50668 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c @@ -396,8 +396,7 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - if (me->arch.syminfo) - vfree(me->arch.syminfo); + vfree(me->arch.syminfo); return 0; } diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 5d56e77c7..7aea25d6e 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -159,11 +159,10 @@ void default_idle(void) #endif /* CONFIG_ARCH_S390X */ } -int cpu_idle(void) +void cpu_idle(void) { for (;;) default_idle(); - return 0; } void show_regs(struct pt_regs *regs) @@ -216,8 +215,7 @@ void exit_thread(void) void flush_thread(void) { - - current->used_math = 0; + clear_used_math(); clear_tsk_thread_flag(current, TIF_USEDFPU); } @@ -238,7 +236,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, frame = ((struct fake_frame *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; p->thread.ksp = (unsigned long) frame; - p->set_child_tid = p->clear_child_tid = NULL; /* Store access registers to kernel stack of new process. */ frame->childregs = *regs; frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */ @@ -340,7 +337,9 @@ asmlinkage long sys_execve(struct pt_regs regs) error = do_execve(filename, (char __user * __user *) regs.gprs[3], (char __user * __user *) regs.gprs[4], ®s); if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); current->thread.fp_regs.fpc = 0; if (MACHINE_HAS_IEEE) asm volatile("sfpc %0,%0" : : "d" (0)); diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 6e35d53b4..0e72d23c2 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -559,13 +559,13 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data) case PTRACE_GETSIGINFO: if (child->last_siginfo == NULL) return -EINVAL; - return copy_siginfo_to_user32((siginfo_t32 __user *) data, + return copy_siginfo_to_user32((compat_siginfo_t __user *) data, child->last_siginfo); case PTRACE_SETSIGINFO: if (child->last_siginfo == NULL) return -EINVAL; return copy_siginfo_from_user32(child->last_siginfo, - (siginfo_t32 __user *) data); + (compat_siginfo_t __user *) data); } return ptrace_request(child, request, addr, data); } @@ -626,7 +626,7 @@ do_ptrace(struct task_struct *child, long request, long addr, long data) * perhaps it should be put in the status that it wants to * exit. */ - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ return 0; child->exit_code = SIGKILL; /* make sure the single step bit is not set. */ @@ -640,7 +640,10 @@ do_ptrace(struct task_struct *child, long request, long addr, long data) return -EIO; clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->exit_code = data; - set_single_step(child); + if (data) + set_tsk_thread_flag(child, TIF_SINGLE_STEP); + else + set_single_step(child); /* give it a chance to run. */ wake_up_process(child); return 0; diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c index 1a5ba047e..11fd6d556 100644 --- a/arch/s390/kernel/s390_ksyms.c +++ b/arch/s390/kernel/s390_ksyms.c @@ -63,4 +63,3 @@ EXPORT_SYMBOL(console_mode); EXPORT_SYMBOL(console_devno); EXPORT_SYMBOL(console_irq); EXPORT_SYMBOL(sys_wait4); -EXPORT_SYMBOL(cpcmd); diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 1324fc6ce..c879c40aa 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -76,8 +76,15 @@ extern int _text,_etext, _edata, _end; static char command_line[COMMAND_LINE_SIZE] = { 0, }; -static struct resource code_resource = { "Kernel code", 0x100000, 0 }; -static struct resource data_resource = { "Kernel data", 0, 0 }; +static struct resource code_resource = { + .name = "Kernel code", + .flags = IORESOURCE_BUSY | IORESOURCE_MEM, +}; + +static struct resource data_resource = { + .name = "Kernel data", + .flags = IORESOURCE_BUSY | IORESOURCE_MEM, +}; /* * cpu_init() initializes state that is per-CPU. @@ -96,11 +103,10 @@ void __devinit cpu_init (void) * Force FPU initialization: */ clear_thread_flag(TIF_USEDFPU); - current->used_math = 0; + clear_used_math(); - /* Setup active_mm for idle_task */ - atomic_inc(&init_mm.mm_count); - current->active_mm = &init_mm; + atomic_inc(&init_mm.mm_count); + current->active_mm = &init_mm; if (current->mm) BUG(); enter_lazy_tlb(&init_mm, current); @@ -185,11 +191,11 @@ static void __init conmode_default(void) char *ptr; if (MACHINE_IS_VM) { - cpcmd("QUERY CONSOLE", query_buffer, 1024); + __cpcmd("QUERY CONSOLE", query_buffer, 1024); console_devno = simple_strtoul(query_buffer + 5, NULL, 16); ptr = strstr(query_buffer, "SUBCHANNEL ="); console_irq = simple_strtoul(ptr + 13, NULL, 16); - cpcmd("QUERY TERM", query_buffer, 1024); + __cpcmd("QUERY TERM", query_buffer, 1024); ptr = strstr(query_buffer, "CONMODE"); /* * Set the conmode to 3215 so that the device recognition @@ -198,7 +204,7 @@ static void __init conmode_default(void) * 3215 and the 3270 driver will try to access the console * device (3215 as console and 3270 as normal tty). */ - cpcmd("TERM CONMODE 3215", NULL, 0); + __cpcmd("TERM CONMODE 3215", NULL, 0); if (ptr == NULL) { #if defined(CONFIG_SCLP_CONSOLE) SET_CONSOLE_SCLP; @@ -315,7 +321,6 @@ void __init setup_arch(char **cmdline_p) unsigned long bootmap_size; unsigned long memory_start, memory_end; char c = ' ', cn, *to = command_line, *from = COMMAND_LINE; - struct resource *res; unsigned long start_pfn, end_pfn; static unsigned int smptrap=0; unsigned long delay = 0; @@ -473,6 +478,30 @@ void __init setup_arch(char **cmdline_p) } #endif + for (i = 0; i < 16 && memory_chunk[i].size > 0; i++) { + struct resource *res; + + res = alloc_bootmem_low(sizeof(struct resource)); + res->flags = IORESOURCE_BUSY | IORESOURCE_MEM; + + switch (memory_chunk[i].type) { + case CHUNK_READ_WRITE: + res->name = "System RAM"; + break; + case CHUNK_READ_ONLY: + res->name = "System ROM"; + res->flags |= IORESOURCE_READONLY; + break; + default: + res->name = "reserved"; + } + res->start = memory_chunk[i].addr; + res->end = memory_chunk[i].addr + memory_chunk[i].size - 1; + request_resource(&iomem_resource, res); + request_resource(res, &code_resource); + request_resource(res, &data_resource); + } + /* * Setup lowcore for boot cpu */ @@ -525,14 +554,6 @@ void __init setup_arch(char **cmdline_p) */ paging_init(); - res = alloc_bootmem_low(sizeof(struct resource)); - res->start = 0; - res->end = memory_end; - res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; - request_resource(&iomem_resource, res); - request_resource(res, &code_resource); - request_resource(res, &data_resource); - /* Setup default console */ conmode_default(); } diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index b5c09d144..24550d2ce 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -42,7 +42,6 @@ #include /* prototypes */ -extern int cpu_idle(void * unused); extern volatile int __cpu_logical_map[]; @@ -77,7 +76,7 @@ static void smp_ext_bitcall_others(ec_bit_sig); * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -487,55 +486,45 @@ void smp_ctl_clear_bit(int cr, int bit) { * Lets check how many CPUs we have. */ -#ifdef CONFIG_HOTPLUG_CPU - void __init smp_check_cpus(unsigned int max_cpus) { - int cpu; + int cpu, num_cpus; + __u16 boot_cpu_addr; /* * cpu 0 is the boot cpu. See smp_prepare_boot_cpu. */ - for (cpu = 1; cpu < max_cpus; cpu++) - cpu_set(cpu, cpu_possible_map); -} -#else /* CONFIG_HOTPLUG_CPU */ + boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; + __cpu_logical_map[0] = boot_cpu_addr; + current_thread_info()->cpu = 0; + num_cpus = 1; + for (cpu = 0; cpu <= 65535 && num_cpus < max_cpus; cpu++) { + if ((__u16) cpu == boot_cpu_addr) + continue; + __cpu_logical_map[num_cpus] = (__u16) cpu; + if (signal_processor(num_cpus, sigp_sense) == + sigp_not_operational) + continue; + cpu_set(num_cpus, cpu_present_map); + num_cpus++; + } -void -__init smp_check_cpus(unsigned int max_cpus) -{ - int curr_cpu, num_cpus; - __u16 boot_cpu_addr; + for (cpu = 1; cpu < max_cpus; cpu++) + cpu_set(cpu, cpu_possible_map); - boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; - current_thread_info()->cpu = 0; - num_cpus = 1; - for (curr_cpu = 0; - curr_cpu <= 65535 && num_cpus < max_cpus; curr_cpu++) { - if ((__u16) curr_cpu == boot_cpu_addr) - continue; - __cpu_logical_map[num_cpus] = (__u16) curr_cpu; - if (signal_processor(num_cpus, sigp_sense) == - sigp_not_operational) - continue; - cpu_set(num_cpus, cpu_possible_map); - num_cpus++; - } - printk("Detected %d CPU's\n",(int) num_cpus); - printk("Boot cpu address %2X\n", boot_cpu_addr); + printk("Detected %d CPU's\n",(int) num_cpus); + printk("Boot cpu address %2X\n", boot_cpu_addr); } -#endif /* CONFIG_HOTPLUG_CPU */ - /* * Activate a secondary processor. */ extern void init_cpu_timer(void); extern void init_cpu_vtimer(void); extern int pfault_init(void); -extern int pfault_token(void); +extern void pfault_fini(void); int __devinit start_secondary(void *cpuvoid) { @@ -557,7 +546,8 @@ int __devinit start_secondary(void *cpuvoid) /* Print info about this processor */ print_cpu_info(&S390_lowcore.cpu_data); /* cpu_idle will call schedule for us */ - return cpu_idle(NULL); + cpu_idle(); + return 0; } static void __init smp_create_idle(unsigned int cpu) @@ -576,7 +566,7 @@ static void __init smp_create_idle(unsigned int cpu) /* Reserving and releasing of CPUs */ -static spinlock_t smp_reserve_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(smp_reserve_lock); static int smp_cpu_reserved[NR_CPUS]; int @@ -679,7 +669,8 @@ __cpu_up(unsigned int cpu) eieio(); signal_processor(cpu,sigp_restart); - while (!cpu_online(cpu)); + while (!cpu_online(cpu)) + cpu_relax(); return 0; } @@ -695,6 +686,11 @@ __cpu_disable(void) return -EBUSY; } +#ifdef CONFIG_PFAULT + /* Disable pfault pseudo page faults on this cpu. */ + pfault_fini(); +#endif + /* disable all external interrupts */ cr_parms.start_ctl = 0; @@ -729,13 +725,15 @@ void __cpu_die(unsigned int cpu) { /* Wait until target cpu is down */ - while (!cpu_stopped(cpu)); + while (!cpu_stopped(cpu)) + cpu_relax(); printk("Processor %d spun down\n", cpu); } void cpu_die(void) { + idle_task_exit(); signal_processor(smp_processor_id(), sigp_stop); BUG(); for(;;); @@ -799,6 +797,7 @@ void __devinit smp_prepare_boot_cpu(void) void smp_cpus_done(unsigned int max_cpus) { + cpu_present_map = cpu_possible_map; } /* diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 9ea8becb8..efe6b83b5 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c @@ -145,7 +145,7 @@ asmlinkage long old_select(struct sel_arg_struct __user *arg) * * This is really horribly ugly. */ -asmlinkage long sys_ipc(uint call, int first, int second, +asmlinkage long sys_ipc(uint call, int first, unsigned long second, unsigned long third, void __user *ptr) { struct ipc_kludge tmp; @@ -153,24 +153,25 @@ asmlinkage long sys_ipc(uint call, int first, int second, switch (call) { case SEMOP: - return sys_semtimedop (first, (struct sembuf __user *) ptr, second, - NULL); + return sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, NULL); case SEMTIMEDOP: - return sys_semtimedop (first, (struct sembuf __user *) ptr, second, + return sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, (const struct timespec __user *) third); case SEMGET: - return sys_semget (first, second, third); + return sys_semget(first, (int)second, third); case SEMCTL: { union semun fourth; if (!ptr) return -EINVAL; if (get_user(fourth.__pad, (void __user * __user *) ptr)) return -EFAULT; - return sys_semctl (first, second, third, fourth); + return sys_semctl(first, (int)second, third, fourth); } case MSGSND: return sys_msgsnd (first, (struct msgbuf __user *) ptr, - second, third); + (size_t)second, third); break; case MSGRCV: if (!ptr) @@ -179,15 +180,17 @@ asmlinkage long sys_ipc(uint call, int first, int second, sizeof (struct ipc_kludge))) return -EFAULT; return sys_msgrcv (first, tmp.msgp, - second, tmp.msgtyp, third); + (size_t)second, tmp.msgtyp, third); case MSGGET: - return sys_msgget ((key_t) first, second); + return sys_msgget((key_t)first, (int)second); case MSGCTL: - return sys_msgctl (first, second, (struct msqid_ds __user *) ptr); + return sys_msgctl(first, (int)second, + (struct msqid_ds __user *)ptr); case SHMAT: { ulong raddr; - ret = do_shmat (first, (char __user *) ptr, second, &raddr); + ret = do_shmat(first, (char __user *)ptr, + (int)second, &raddr); if (ret) return ret; return put_user (raddr, (ulong __user *) third); @@ -196,9 +199,9 @@ asmlinkage long sys_ipc(uint call, int first, int second, case SHMDT: return sys_shmdt ((char __user *)ptr); case SHMGET: - return sys_shmget (first, second, third); + return sys_shmget(first, (size_t)second, third); case SHMCTL: - return sys_shmctl (first, second, + return sys_shmctl(first, (int)second, (struct shmid_ds __user *) ptr); default: return -ENOSYS; diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index d17ba7b7c..e616c01b7 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S @@ -185,7 +185,7 @@ SYSCALL(sys_rt_sigreturn_glue,sys_rt_sigreturn_glue,sys32_rt_sigreturn_glue) SYSCALL(sys_rt_sigaction,sys_rt_sigaction,sys32_rt_sigaction_wrapper) SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,sys32_rt_sigprocmask_wrapper) /* 175 */ SYSCALL(sys_rt_sigpending,sys_rt_sigpending,sys32_rt_sigpending_wrapper) -SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,sys32_rt_sigtimedwait_wrapper) +SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait_wrapper) SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,sys32_rt_sigqueueinfo_wrapper) SYSCALL(sys_rt_sigsuspend_glue,sys_rt_sigsuspend_glue,sys32_rt_sigsuspend_glue) SYSCALL(sys_pread64,sys_pread64,sys32_pread64_wrapper) /* 180 */ @@ -283,5 +283,6 @@ SYSCALL(sys_mq_open,sys_mq_open,compat_sys_mq_open_wrapper) SYSCALL(sys_mq_unlink,sys_mq_unlink,sys32_mq_unlink_wrapper) SYSCALL(sys_mq_timedsend,sys_mq_timedsend,compat_sys_mq_timedsend_wrapper) SYSCALL(sys_mq_timedreceive,sys_mq_timedreceive,compat_sys_mq_timedreceive_wrapper) -SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper) +SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper) /* 275 */ SYSCALL(sys_mq_getsetattr,sys_mq_getsetattr,compat_sys_mq_getsetattr_wrapper) +NI_SYSCALL /* reserved for kexec */ diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 8f2794216..995e2cd38 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -150,28 +150,6 @@ int do_settimeofday(struct timespec *tv) EXPORT_SYMBOL(do_settimeofday); -#ifndef CONFIG_ARCH_S390X - -static inline __u32 -__calculate_ticks(__u64 elapsed) -{ - register_pair rp; - - rp.pair = elapsed >> 1; - asm ("dr %0,%1" : "+d" (rp) : "d" (CLK_TICKS_PER_JIFFY >> 1)); - return rp.subreg.odd; -} - -#else /* CONFIG_ARCH_S390X */ - -static inline __u32 -__calculate_ticks(__u64 elapsed) -{ - return elapsed / CLK_TICKS_PER_JIFFY; -} - -#endif /* CONFIG_ARCH_S390X */ - #ifdef CONFIG_PROFILING #define s390_do_profile(regs) profile_tick(CPU_PROFILING, regs) @@ -187,14 +165,14 @@ __calculate_ticks(__u64 elapsed) void account_ticks(struct pt_regs *regs) { __u64 tmp; - __u32 ticks; + __u32 ticks, xticks; /* Calculate how many ticks have passed. */ if (S390_lowcore.int_clock < S390_lowcore.jiffy_timer) return; tmp = S390_lowcore.int_clock - S390_lowcore.jiffy_timer; if (tmp >= 2*CLK_TICKS_PER_JIFFY) { /* more than two ticks ? */ - ticks = __calculate_ticks(tmp) + 1; + ticks = __div(tmp, CLK_TICKS_PER_JIFFY) + 1; S390_lowcore.jiffy_timer += CLK_TICKS_PER_JIFFY * (__u64) ticks; } else if (tmp >= CLK_TICKS_PER_JIFFY) { @@ -216,11 +194,9 @@ void account_ticks(struct pt_regs *regs) */ write_seqlock(&xtime_lock); if (S390_lowcore.jiffy_timer > xtime_cc) { - __u32 xticks; - tmp = S390_lowcore.jiffy_timer - xtime_cc; if (tmp >= 2*CLK_TICKS_PER_JIFFY) { - xticks = __calculate_ticks(tmp); + xticks = __div(tmp, CLK_TICKS_PER_JIFFY); xtime_cc += (__u64) xticks * CLK_TICKS_PER_JIFFY; } else { xticks = 1; @@ -230,12 +206,18 @@ void account_ticks(struct pt_regs *regs) do_timer(regs); } write_sequnlock(&xtime_lock); - while (ticks--) - update_process_times(user_mode(regs)); #else - while (ticks--) + for (xticks = ticks; xticks > 0; xticks--) do_timer(regs); #endif + +#ifdef CONFIG_VIRT_CPU_ACCOUNTING + account_user_vtime(current); +#else + while (ticks--) + update_process_times(user_mode(regs)); +#endif + s390_do_profile(regs); } @@ -258,18 +240,21 @@ static inline void stop_hz_timer(void) if (sysctl_hz_timer != 0) return; + cpu_set(smp_processor_id(), nohz_cpu_mask); + /* * Leave the clock comparator set up for the next timer * tick if either rcu or a softirq is pending. */ - if (rcu_pending(smp_processor_id()) || local_softirq_pending()) + if (rcu_pending(smp_processor_id()) || local_softirq_pending()) { + cpu_clear(smp_processor_id(), nohz_cpu_mask); return; + } /* * This cpu is going really idle. Set up the clock comparator * for the next event. */ - cpu_set(smp_processor_id(), nohz_cpu_mask); timer = (__u64) (next_timer_interrupt() - jiffies) + jiffies_64; timer = jiffies_timer_cc + timer * CLK_TICKS_PER_JIFFY; asm volatile ("SCKC %0" : : "m" (timer)); diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index e67ee2702..8b90e9528 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -38,6 +38,7 @@ #include #include #include +#include /* Called from entry.S only */ extern void handle_per_exception(struct pt_regs *regs); @@ -272,13 +273,15 @@ char *task_show_regs(struct task_struct *task, char *buffer) return buffer; } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); void die(const char * str, struct pt_regs * regs, long err) { static int die_counter; - console_verbose(); - spin_lock_irq(&die_lock); + + debug_stop_all(); + console_verbose(); + spin_lock_irq(&die_lock); bust_spinlocks(1); printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); show_regs(regs); @@ -291,6 +294,20 @@ void die(const char * str, struct pt_regs * regs, long err) do_exit(SIGSEGV); } +static void inline +report_user_fault(long interruption_code, struct pt_regs *regs) +{ +#if defined(CONFIG_SYSCTL) + if (!sysctl_userprocess_debug) + return; +#endif +#if defined(CONFIG_SYSCTL) || defined(CONFIG_PROCESS_DEBUG) + printk("User process fault: interruption code 0x%lX\n", + interruption_code); + show_regs(regs); +#endif +} + static void inline do_trap(long interruption_code, int signr, char *str, struct pt_regs *regs, siginfo_t *info) { @@ -305,23 +322,8 @@ static void inline do_trap(long interruption_code, int signr, char *str, struct task_struct *tsk = current; tsk->thread.trap_no = interruption_code & 0xffff; - if (info) - force_sig_info(signr, info, tsk); - else - force_sig(signr, tsk); -#ifndef CONFIG_SYSCTL -#ifdef CONFIG_PROCESS_DEBUG - printk("User process fault: interruption code 0x%lX\n", - interruption_code); - show_regs(regs); -#endif -#else - if (sysctl_userprocess_debug) { - printk("User process fault: interruption code 0x%lX\n", - interruption_code); - show_regs(regs); - } -#endif + force_sig_info(signr, info, tsk); + report_user_fault(interruption_code, regs); } else { const struct exception_table_entry *fixup; fixup = search_exception_tables(regs->psw.addr & PSW_ADDR_INSN); @@ -343,10 +345,15 @@ void do_single_step(struct pt_regs *regs) force_sig(SIGTRAP, current); } -#define DO_ERROR(signr, str, name) \ -asmlinkage void name(struct pt_regs * regs, long interruption_code) \ -{ \ - do_trap(interruption_code, signr, str, regs, NULL); \ +asmlinkage void +default_trap_handler(struct pt_regs * regs, long interruption_code) +{ + if (regs->psw.mask & PSW_MASK_PSTATE) { + local_irq_enable(); + do_exit(SIGSEGV); + report_user_fault(interruption_code, regs); + } else + die("Unknown program exception", regs, interruption_code); } #define DO_ERROR_INFO(signr, str, name, sicode, siaddr) \ @@ -360,8 +367,6 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \ do_trap(interruption_code, signr, str, regs, &info); \ } -DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler) - DO_ERROR_INFO(SIGILL, "addressing exception", addressing_exception, ILL_ILLADR, get_check_address(regs)) DO_ERROR_INFO(SIGILL, "execute exception", execute_exception, @@ -420,6 +425,7 @@ do_fp_trap(struct pt_regs *regs, void *location, asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) { + siginfo_t info; __u8 opcode[6]; __u16 *location; int signal = 0; @@ -463,12 +469,27 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) } else signal = SIGILL; +#ifdef CONFIG_MATHEMU if (signal == SIGFPE) do_fp_trap(regs, location, current->thread.fp_regs.fpc, interruption_code); - else if (signal) + else if (signal == SIGSEGV) { + info.si_signo = signal; + info.si_errno = 0; + info.si_code = SEGV_MAPERR; + info.si_addr = (void *) location; + do_trap(interruption_code, signal, + "user address fault", regs, &info); + } else +#endif + if (signal) { + info.si_signo = signal; + info.si_errno = 0; + info.si_code = ILL_ILLOPC; + info.si_addr = (void *) location; do_trap(interruption_code, signal, - "illegal operation", regs, NULL); + "illegal operation", regs, &info); + } } @@ -630,6 +651,21 @@ asmlinkage void data_exception(struct pt_regs * regs, long interruption_code) } } +asmlinkage void space_switch_exception(struct pt_regs * regs, long int_code) +{ + siginfo_t info; + + /* Set user psw back to home space mode. */ + if (regs->psw.mask & PSW_MASK_PSTATE) + regs->psw.mask |= PSW_ASC_HOME; + /* Send SIGILL. */ + info.si_signo = SIGILL; + info.si_errno = 0; + info.si_code = ILL_PRVOPC; + info.si_addr = get_check_address(regs); + do_trap(int_code, SIGILL, "space switch event", regs, &info); +} + asmlinkage void kernel_stack_overflow(struct pt_regs * regs) { die("Kernel stack overflow", regs, 0); @@ -673,7 +709,7 @@ void __init trap_init(void) pgm_check_table[0x3B] = &do_dat_exception; #endif /* CONFIG_ARCH_S390X */ pgm_check_table[0x15] = &operand_exception; - pgm_check_table[0x1C] = &privileged_op; + pgm_check_table[0x1C] = &space_switch_exception; pgm_check_table[0x1D] = &hfp_sqrt_exception; pgm_check_table[0x40] = &do_monitor_call; diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 02d2179e4..63cdfec3b 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -25,7 +27,95 @@ static ext_int_info_t ext_int_info_timer; DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); -void start_cpu_timer(void) +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +/* + * Update process times based on virtual cpu times stored by entry.S + * to the lowcore fields user_timer, system_timer & steal_clock. + */ +void account_user_vtime(struct task_struct *tsk) +{ + cputime_t cputime; + __u64 timer, clock; + int rcu_user_flag; + + timer = S390_lowcore.last_update_timer; + clock = S390_lowcore.last_update_clock; + asm volatile (" STPT %0\n" /* Store current cpu timer value */ + " STCK %1" /* Store current tod clock value */ + : "=m" (S390_lowcore.last_update_timer), + "=m" (S390_lowcore.last_update_clock) ); + S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; + S390_lowcore.steal_clock += S390_lowcore.last_update_clock - clock; + + cputime = S390_lowcore.user_timer >> 12; + rcu_user_flag = cputime != 0; + S390_lowcore.user_timer -= cputime << 12; + S390_lowcore.steal_clock -= cputime << 12; + account_user_time(tsk, cputime); + + cputime = S390_lowcore.system_timer >> 12; + S390_lowcore.system_timer -= cputime << 12; + S390_lowcore.steal_clock -= cputime << 12; + account_system_time(tsk, HARDIRQ_OFFSET, cputime); + + cputime = S390_lowcore.steal_clock; + if ((__s64) cputime > 0) { + cputime >>= 12; + S390_lowcore.steal_clock -= cputime << 12; + account_steal_time(tsk, cputime); + } + + run_local_timers(); + if (rcu_pending(smp_processor_id())) + rcu_check_callbacks(smp_processor_id(), rcu_user_flag); + scheduler_tick(); +} + +/* + * Update process times based on virtual cpu times stored by entry.S + * to the lowcore fields user_timer, system_timer & steal_clock. + */ +void account_system_vtime(struct task_struct *tsk) +{ + cputime_t cputime; + __u64 timer; + + timer = S390_lowcore.last_update_timer; + asm volatile (" STPT %0" /* Store current cpu timer value */ + : "=m" (S390_lowcore.last_update_timer) ); + S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; + + cputime = S390_lowcore.system_timer >> 12; + S390_lowcore.system_timer -= cputime << 12; + S390_lowcore.steal_clock -= cputime << 12; + account_system_time(tsk, 0, cputime); +} + +static inline void set_vtimer(__u64 expires) +{ + __u64 timer; + + asm volatile (" STPT %0\n" /* Store current cpu timer value */ + " SPT %1" /* Set new value immediatly afterwards */ + : "=m" (timer) : "m" (expires) ); + S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer; + S390_lowcore.last_update_timer = expires; + + /* store expire time for this CPU timer */ + per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires; +} +#else +static inline void set_vtimer(__u64 expires) +{ + S390_lowcore.last_update_timer = expires; + asm volatile ("SPT %0" : : "m" (S390_lowcore.last_update_timer)); + + /* store expire time for this CPU timer */ + per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires; +} +#endif + +static void start_cpu_timer(void) { struct vtimer_queue *vt_list; @@ -33,7 +123,7 @@ void start_cpu_timer(void) set_vtimer(vt_list->idle); } -void stop_cpu_timer(void) +static void stop_cpu_timer(void) { __u64 done; struct vtimer_queue *vt_list; @@ -71,19 +161,11 @@ void stop_cpu_timer(void) set_vtimer(VTIMER_MAX_SLICE); } -void set_vtimer(__u64 expires) -{ - asm volatile ("SPT %0" : : "m" (expires)); - - /* store expire time for this CPU timer */ - per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires; -} - /* * Sorted add to a list. List is linear searched until first bigger * element is found. */ -void list_add_sorted(struct vtimer_list *timer, struct list_head *head) +static void list_add_sorted(struct vtimer_list *timer, struct list_head *head) { struct vtimer_list *event; @@ -429,11 +511,12 @@ void init_cpu_vtimer(void) { struct vtimer_queue *vt_list; unsigned long cr0; - __u64 timer; /* kick the virtual timer */ - timer = VTIMER_MAX_SLICE; - asm volatile ("SPT %0" : : "m" (timer)); + S390_lowcore.exit_timer = VTIMER_MAX_SLICE; + S390_lowcore.last_update_timer = VTIMER_MAX_SLICE; + asm volatile ("SPT %0" : : "m" (S390_lowcore.last_update_timer)); + asm volatile ("STCK %0" : "=m" (S390_lowcore.last_update_clock)); __ctl_store(cr0, 0, 0); cr0 |= 0x400; __ctl_load(cr0, 0, 0); diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c index 9cf22aa48..8240cc77e 100644 --- a/arch/s390/lib/string.c +++ b/arch/s390/lib/string.c @@ -356,21 +356,6 @@ void *memcpy(void *dest, const void *src, size_t n) } EXPORT_SYMBOL(memcpy); -/** - * bcopy - Copy one area of memory to another - * @src: Where to copy from - * @dest: Where to copy to - * @n: The size of the area. - * - * Note that this is the same as memcpy(), with the arguments reversed. - * memcpy() is the standard, bcopy() is a legacy BSD function. - */ -void bcopy(const void *srcp, void *destp, size_t n) -{ - __builtin_memcpy(destp, srcp, n); -} -EXPORT_SYMBOL(bcopy); - /** * memset - Fill a region of memory with the given value * @s: Pointer to the start of the area. diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index cb2950301..d30cdb424 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -19,7 +19,6 @@ #include #include -#include #include "../../../drivers/s390/net/smsgiucv.h" @@ -124,7 +123,6 @@ cmm_thread(void *dummy) int rc; daemonize("cmmthread"); - set_cpus_allowed(current, cpumask_of_cpu(0)); while (1) { rc = wait_event_interruptible(cmm_thread_wait, (cmm_pages != cmm_pages_target || @@ -408,14 +406,6 @@ struct ctl_table_header *cmm_sysctl_header; static int cmm_init (void) { - int rc; - - /* Prevent logical cpu 0 from being set offline. */ - rc = smp_get_cpu(cpumask_of_cpu(0)); - if (rc) { - printk(KERN_ERR "CMM: unable to reserve cpu 0\n"); - return rc; - } #ifdef CONFIG_CMM_PROC cmm_sysctl_header = register_sysctl_table(cmm_dir_table, 1); #endif @@ -439,8 +429,6 @@ cmm_exit(void) #ifdef CONFIG_CMM_IUCV smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target); #endif - /* Allow logical cpu 0 to be set offline again. */ - smp_put_cpu(0); } module_init(cmm_init); diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c index b0b2714ea..648deed17 100644 --- a/arch/s390/mm/extmem.c +++ b/arch/s390/mm/extmem.c @@ -1,11 +1,10 @@ /* - * File...........: arch/s390/mm/dcss.c - * Author(s)......: Steven Shultz - * Carsten Otte + * File...........: arch/s390/mm/extmem.c + * Author(s)......: Carsten Otte + * Rob M van der Heij + * Steven Shultz * Bugreports.to..: - * thanks to Rob M van der Heij - * - he wrote the diag64 function - * (C) IBM Corporation 2002 + * (C) IBM Corporation 2002-2004 */ #include @@ -41,20 +40,48 @@ #define DCSS_FINDSEG 0x0c #define DCSS_LOADNOLY 0x10 #define DCSS_SEGEXT 0x18 -#define DCSS_QACTV 0x0c +#define DCSS_FINDSEGA 0x0c + +struct qrange { + unsigned int start; // 3byte start address, 1 byte type + unsigned int end; // 3byte end address, 1 byte reserved +}; + +struct qout64 { + int segstart; + int segend; + int segcnt; + int segrcnt; + struct qrange range[6]; +}; + +struct qin64 { + char qopcode; + char rsrv1[3]; + char qrcode; + char rsrv2[3]; + char qname[8]; + unsigned int qoutptr; + short int qoutlen; +}; struct dcss_segment { - struct list_head list; - char dcss_name[8]; - unsigned long start_addr; - unsigned long end; - atomic_t ref_count; - int dcss_attr; - int shared_attr; + struct list_head list; + char dcss_name[8]; + unsigned long start_addr; + unsigned long end; + atomic_t ref_count; + int do_nonshared; + unsigned int vm_segtype; + struct qrange range[6]; + int segcnt; }; -static spinlock_t dcss_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dcss_lock); static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list); +static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC", + "EW/EN-MIXED" }; + extern struct { unsigned long addr, size, type; } memory_chunk[MEMORY_CHUNKS]; @@ -63,20 +90,46 @@ extern struct { * Create the 8 bytes, ebcdic VM segment name from * an ascii name. */ -static void inline dcss_mkname(char *name, char *dcss_name) +static void inline +dcss_mkname(char *name, char *dcss_name) +{ + int i; + + for (i = 0; i < 8; i++) { + if (name[i] == '\0') + break; + dcss_name[i] = toupper(name[i]); + }; + for (; i < 8; i++) + dcss_name[i] = ' '; + ASCEBC(dcss_name, 8); +} + + +/* + * search all segments in dcss_list, and return the one + * namend *name. If not found, return NULL. + */ +static struct dcss_segment * +segment_by_name (char *name) { - int i; - - for (i = 0; i <= 8; i++) { - if (name[i] == '\0') - break; - dcss_name[i] = toupper(name[i]); - }; - for (; i <= 8; i++) - dcss_name[i] = ' '; - ASCEBC(dcss_name, 8); + char dcss_name[9]; + struct list_head *l; + struct dcss_segment *tmp, *retval = NULL; + + assert_spin_locked(&dcss_lock); + dcss_mkname (name, dcss_name); + list_for_each (l, &dcss_list) { + tmp = list_entry (l, struct dcss_segment, list); + if (memcmp(tmp->dcss_name, dcss_name, 8) == 0) { + retval = tmp; + break; + } + } + return retval; } + /* * Perform a function on a dcss segment. */ @@ -84,337 +137,378 @@ static inline int dcss_diag (__u8 func, void *parameter, unsigned long *ret1, unsigned long *ret2) { - unsigned long rx, ry; - int rc; + unsigned long rx, ry; + int rc; - rx = (unsigned long) parameter; - ry = (unsigned long) func; - __asm__ __volatile__( + rx = (unsigned long) parameter; + ry = (unsigned long) func; + __asm__ __volatile__( #ifdef CONFIG_ARCH_S390X - " sam31\n" // switch to 31 bit - " diag %0,%1,0x64\n" - " sam64\n" // switch back to 64 bit + " sam31\n" // switch to 31 bit + " diag %0,%1,0x64\n" + " sam64\n" // switch back to 64 bit #else - " diag %0,%1,0x64\n" + " diag %0,%1,0x64\n" #endif - " ipm %2\n" - " srl %2,28\n" - : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc" ); - *ret1 = rx; - *ret2 = ry; - return rc; + " ipm %2\n" + " srl %2,28\n" + : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc" ); + *ret1 = rx; + *ret2 = ry; + return rc; +} + +static inline int +dcss_diag_translate_rc (int vm_rc) { + if (vm_rc == 44) + return -ENOENT; + return -EIO; +} + + +/* do a diag to get info about a segment. + * fills start_address, end and vm_segtype fields + */ +static int +query_segment_type (struct dcss_segment *seg) +{ + struct qin64 *qin = kmalloc (sizeof(struct qin64), GFP_DMA); + struct qout64 *qout = kmalloc (sizeof(struct qout64), GFP_DMA); + + int diag_cc, rc, i; + unsigned long dummy, vmrc; + + if ((qin == NULL) || (qout == NULL)) { + rc = -ENOMEM; + goto out_free; + } + + /* initialize diag input parameters */ + qin->qopcode = DCSS_FINDSEGA; + qin->qoutptr = (unsigned long) qout; + qin->qoutlen = sizeof(struct qout64); + memcpy (qin->qname, seg->dcss_name, 8); + + diag_cc = dcss_diag (DCSS_SEGEXT, qin, &dummy, &vmrc); + + if (diag_cc > 1) { + rc = dcss_diag_translate_rc (vmrc); + goto out_free; + } + + if (qout->segcnt > 6) { + rc = -ENOTSUPP; + goto out_free; + } + + if (qout->segcnt == 1) { + seg->vm_segtype = qout->range[0].start & 0xff; + } else { + /* multi-part segment. only one type supported here: + - all parts are contiguous + - all parts are either EW or EN type + - maximum 6 parts allowed */ + unsigned long start = qout->segstart >> PAGE_SHIFT; + for (i=0; isegcnt; i++) { + if (((qout->range[i].start & 0xff) != SEG_TYPE_EW) && + ((qout->range[i].start & 0xff) != SEG_TYPE_EN)) { + rc = -ENOTSUPP; + goto out_free; + } + if (start != qout->range[i].start >> PAGE_SHIFT) { + rc = -ENOTSUPP; + goto out_free; + } + start = (qout->range[i].end >> PAGE_SHIFT) + 1; + } + seg->vm_segtype = SEG_TYPE_EWEN; + } + + /* analyze diag output and update seg */ + seg->start_addr = qout->segstart; + seg->end = qout->segend; + + memcpy (seg->range, qout->range, 6*sizeof(struct qrange)); + seg->segcnt = qout->segcnt; + + rc = 0; + + out_free: + if (qin) kfree(qin); + if (qout) kfree(qout); + return rc; +} + +/* + * check if the given segment collides with guest storage. + * returns 1 if this is the case, 0 if no collision was found + */ +static int +segment_overlaps_storage(struct dcss_segment *seg) +{ + int i; + + for (i=0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { + if (memory_chunk[i].type != 0) + continue; + if ((memory_chunk[i].addr >> 20) > (seg->end >> 20)) + continue; + if (((memory_chunk[i].addr + memory_chunk[i].size - 1) >> 20) + < (seg->start_addr >> 20)) + continue; + return 1; + } + return 0; } +/* + * check if segment collides with other segments that are currently loaded + * returns 1 if this is the case, 0 if no collision was found + */ +static int +segment_overlaps_others (struct dcss_segment *seg) +{ + struct list_head *l; + struct dcss_segment *tmp; + + assert_spin_locked(&dcss_lock); + list_for_each(l, &dcss_list) { + tmp = list_entry(l, struct dcss_segment, list); + if ((tmp->start_addr >> 20) > (seg->end >> 20)) + continue; + if ((tmp->end >> 20) < (seg->start_addr >> 20)) + continue; + if (seg == tmp) + continue; + return 1; + } + return 0; +} -/* use to issue "extended" dcss query */ +/* + * check if segment exceeds the kernel mapping range (detected or set via mem=) + * returns 1 if this is the case, 0 if segment fits into the range + */ static inline int -dcss_diag_query(char *name, int *rwattr, int *shattr, unsigned long *segstart, unsigned long *segend) +segment_exceeds_range (struct dcss_segment *seg) { - int i,j,rc; - unsigned long rx, ry; - - typedef struct segentry { - char thisseg[8]; - } segentry; - - struct qout64 { - int segstart; - int segend; - int segcnt; - int segrcnt; - segentry segout[6]; - }; - - struct qin64 { - char qopcode; - char rsrv1[3]; - char qrcode; - char rsrv2[3]; - char qname[8]; - unsigned int qoutptr; - short int qoutlen; - }; - - - struct qin64 *qinarea; - struct qout64 *qoutarea; - - qinarea = (struct qin64*) get_zeroed_page (GFP_DMA); - if (!qinarea) { - rc =-ENOMEM; - goto out; - } - qoutarea = (struct qout64*) get_zeroed_page (GFP_DMA); - if (!qoutarea) { - rc = -ENOMEM; - free_page ((unsigned long) qinarea); - goto out; - } - memset (qinarea,0,PAGE_SIZE); - memset (qoutarea,0,PAGE_SIZE); - - qinarea->qopcode = DCSS_QACTV; /* do a query for active - segments */ - qinarea->qoutptr = (unsigned long) qoutarea; - qinarea->qoutlen = sizeof(struct qout64); - - /* Move segment name into double word aligned - field and pad with blanks to 8 long. - */ - - for (i = j = 0 ; i < 8; i++) { - qinarea->qname[i] = (name[j] == '\0') ? ' ' : name[j++]; - } - - /* name already in EBCDIC */ - /* ASCEBC ((void *)&qinarea.qname, 8); */ - - /* set the assembler variables */ - rx = (unsigned long) qinarea; - ry = DCSS_SEGEXT; /* this is extended function */ - - /* issue diagnose x'64' */ - __asm__ __volatile__( -#ifdef CONFIG_ARCH_S390X - " sam31\n" // switch to 31 bit - " diag %0,%1,0x64\n" - " sam64\n" // switch back to 64 bit -#else - " diag %0,%1,0x64\n" -#endif - " ipm %2\n" - " srl %2,28\n" - : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc" ); - - /* parse the query output area */ - *segstart=qoutarea->segstart; - *segend=qoutarea->segend; - - if (rc > 1) - { - *rwattr = 2; - *shattr = 2; - rc = 0; - goto free; - } - - if (qoutarea->segcnt > 6) - { - *rwattr = 3; - *shattr = 3; - rc = 0; - goto free; - } - - *rwattr = 1; - *shattr = 1; - - for (i=0; i < qoutarea->segrcnt; i++) { - if (qoutarea->segout[i].thisseg[3] == 2 || - qoutarea->segout[i].thisseg[3] == 3 || - qoutarea->segout[i].thisseg[3] == 6 ) - *rwattr = 0; - if (qoutarea->segout[i].thisseg[3] == 1 || - qoutarea->segout[i].thisseg[3] == 3 || - qoutarea->segout[i].thisseg[3] == 5 ) - *shattr = 0; - } /* end of for statement */ - rc = 0; - free: - free_page ((unsigned long) qoutarea); - free_page ((unsigned long) qinarea); + int seg_last_pfn = (seg->end) >> PAGE_SHIFT; + if (seg_last_pfn > max_pfn) + return 1; + return 0; +} + +/* + * get info about a segment + * possible return values: + * -ENOSYS : we are not running on VM + * -EIO : could not perform query diagnose + * -ENOENT : no such segment + * -ENOTSUPP: multi-part segment cannot be used with linux + * -ENOSPC : segment cannot be used (overlaps with storage) + * -ENOMEM : out of memory + * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h + */ +int +segment_type (char* name) +{ + int rc; + struct dcss_segment seg; + + if (!MACHINE_IS_VM) + return -ENOSYS; + + dcss_mkname(name, seg.dcss_name); + rc = query_segment_type (&seg); + if (rc < 0) + return rc; + return seg.vm_segtype; +} + +/* + * real segment loading function, called from segment_load + */ +static int +__segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long *end) +{ + struct dcss_segment *seg = kmalloc(sizeof(struct dcss_segment), + GFP_DMA); + int dcss_command, rc, diag_cc; + + if (seg == NULL) { + rc = -ENOMEM; + goto out; + } + dcss_mkname (name, seg->dcss_name); + rc = query_segment_type (seg); + if (rc < 0) + goto out_free; + if (segment_exceeds_range(seg)) { + PRINT_WARN ("segment_load: not loading segment %s - exceeds" + " kernel mapping range\n",name); + rc = -ERANGE; + goto out_free; + } + if (segment_overlaps_storage(seg)) { + PRINT_WARN ("segment_load: not loading segment %s - overlaps" + " storage\n",name); + rc = -ENOSPC; + goto out_free; + } + if (segment_overlaps_others(seg)) { + PRINT_WARN ("segment_load: not loading segment %s - overlaps" + " other segments\n",name); + rc = -EBUSY; + goto out_free; + } + if (do_nonshared) + dcss_command = DCSS_LOADNSR; + else + dcss_command = DCSS_LOADNOLY; + + diag_cc = dcss_diag(dcss_command, seg->dcss_name, + &seg->start_addr, &seg->end); + if (diag_cc > 1) { + PRINT_WARN ("segment_load: could not load segment %s - " + "diag returned error (%ld)\n",name,seg->end); + rc = dcss_diag_translate_rc (seg->end); + dcss_diag(DCSS_PURGESEG, seg->dcss_name, + &seg->start_addr, &seg->end); + goto out_free; + } + seg->do_nonshared = do_nonshared; + atomic_set(&seg->ref_count, 1); + list_add(&seg->list, &dcss_list); + rc = seg->vm_segtype; + *addr = seg->start_addr; + *end = seg->end; + if (do_nonshared) + PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " + "type %s in non-shared mode\n", name, + (void*)seg->start_addr, (void*)seg->end, + segtype_string[seg->vm_segtype]); + else + PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " + "type %s in shared mode\n", name, + (void*)seg->start_addr, (void*)seg->end, + segtype_string[seg->vm_segtype]); + goto out; + out_free: + kfree (seg); out: - return rc; + return rc; } /* - * Load a DCSS segment via the diag 0x64. + * this function loads a DCSS segment + * name : name of the DCSS + * do_nonshared : 0 indicates that the dcss should be shared with other linux images + * 1 indicates that the dcss should be exclusive for this linux image + * addr : will be filled with start address of the segment + * end : will be filled with end address of the segment + * return values: + * -ENOSYS : we are not running on VM + * -EIO : could not perform query or load diagnose + * -ENOENT : no such segment + * -ENOTSUPP: multi-part segment cannot be used with linux + * -ENOSPC : segment cannot be used (overlaps with storage) + * -EBUSY : segment can temporarily not be used (overlaps with dcss) + * -ERANGE : segment cannot be used (exceeds kernel mapping range) + * -EPERM : segment is currently loaded with incompatible permissions + * -ENOMEM : out of memory + * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h */ -int segment_load(char *name, int segtype, unsigned long *addr, - unsigned long *end) +int +segment_load (char *name, int do_nonshared, unsigned long *addr, + unsigned long *end) { - char dcss_name[8]; - struct list_head *l; - struct dcss_segment *seg, *tmp; - unsigned long dummy; - unsigned long segstart, segend; - int rc = 0,i; - int rwattr, shattr; - - if (!MACHINE_IS_VM) - return -ENOSYS; - dcss_mkname(name, dcss_name); - /* search for the dcss in list of currently loaded segments */ - spin_lock(&dcss_lock); - seg = NULL; - list_for_each(l, &dcss_list) { - tmp = list_entry(l, struct dcss_segment, list); - if (memcmp(tmp->dcss_name, dcss_name, 8) == 0) { - seg = tmp; - break; - } - } - - if (seg == NULL) { - /* find out the attributes of this - shared segment */ - dcss_diag_query(dcss_name, &rwattr, &shattr, &segstart, &segend); - /* does segment collide with main memory? */ - for (i=0; i < MEMORY_CHUNKS; i++) { - if (memory_chunk[i].type != 0) - continue; - if (memory_chunk[i].addr > segend) - continue; - if (memory_chunk[i].addr + memory_chunk[i].size <= segstart) - continue; - spin_unlock(&dcss_lock); - return -ENOENT; - } - /* or does it collide with other (loaded) segments? */ - list_for_each(l, &dcss_list) { - tmp = list_entry(l, struct dcss_segment, list); - if ((segstart <= tmp->end && segstart >= tmp->start_addr) || - (segend <= tmp->end && segend >= tmp->start_addr) || - (segstart <= tmp->start_addr && segend >= tmp->end)) { - PRINT_ERR("Segment Overlap!\n"); - spin_unlock(&dcss_lock); - return -ENOENT; - } - } - - /* do case statement on segtype */ - /* if asking for shared ro, - shared rw works */ - /* if asking for exclusive ro, - exclusive rw works */ - - switch(segtype) { - case SEGMENT_SHARED_RO: - if (shattr > 1 || rwattr > 1) { - spin_unlock(&dcss_lock); - return -ENOENT; - } else { - if (shattr == 0 && rwattr == 0) - rc = SEGMENT_EXCLUSIVE_RO; - if (shattr == 0 && rwattr == 1) - rc = SEGMENT_EXCLUSIVE_RW; - if (shattr == 1 && rwattr == 0) - rc = SEGMENT_SHARED_RO; - if (shattr == 1 && rwattr == 1) - rc = SEGMENT_SHARED_RW; - } - break; - case SEGMENT_SHARED_RW: - if (shattr > 1 || rwattr != 1) { - spin_unlock(&dcss_lock); - return -ENOENT; - } else { - if (shattr == 0) - rc = SEGMENT_EXCLUSIVE_RW; - if (shattr == 1) - rc = SEGMENT_SHARED_RW; - } - break; - - case SEGMENT_EXCLUSIVE_RO: - if (shattr > 0 || rwattr > 1) { - spin_unlock(&dcss_lock); - return -ENOENT; - } else { - if (rwattr == 0) - rc = SEGMENT_EXCLUSIVE_RO; - if (rwattr == 1) - rc = SEGMENT_EXCLUSIVE_RW; - } - break; - - case SEGMENT_EXCLUSIVE_RW: -/* if (shattr != 0 || rwattr != 1) { - spin_unlock(&dcss_lock); - return -ENOENT; - } else { -*/ - rc = SEGMENT_EXCLUSIVE_RW; -// } - break; - - default: - spin_unlock(&dcss_lock); - return -ENOENT; - } /* end switch */ - - seg = kmalloc(sizeof(struct dcss_segment), GFP_DMA); - if (seg != NULL) { - memcpy(seg->dcss_name, dcss_name, 8); - if (rc == SEGMENT_EXCLUSIVE_RW) { - if (dcss_diag(DCSS_LOADNSR, seg->dcss_name, - &seg->start_addr, &seg->end) == 0) { - if (seg->end < max_low_pfn*PAGE_SIZE ) { - atomic_set(&seg->ref_count, 1); - list_add(&seg->list, &dcss_list); - *addr = seg->start_addr; - *end = seg->end; - seg->dcss_attr = rc; - if (shattr == 1 && rwattr == 1) - seg->shared_attr = SEGMENT_SHARED_RW; - else if (shattr == 1 && rwattr == 0) - seg->shared_attr = SEGMENT_SHARED_RO; - else - seg->shared_attr = SEGMENT_EXCLUSIVE_RW; - } else { - dcss_diag(DCSS_PURGESEG, seg->dcss_name, &dummy, &dummy); - kfree (seg); - rc = -ENOENT; - } - } else { - kfree(seg); - rc = -ENOENT; - } - goto out; - } - if (dcss_diag(DCSS_LOADNOLY, seg->dcss_name, - &seg->start_addr, &seg->end) == 0) { - if (seg->end < max_low_pfn*PAGE_SIZE ) { - atomic_set(&seg->ref_count, 1); - list_add(&seg->list, &dcss_list); - *addr = seg->start_addr; - *end = seg->end; - seg->dcss_attr = rc; - seg->shared_attr = rc; - } else { - dcss_diag(DCSS_PURGESEG, seg->dcss_name, &dummy, &dummy); - kfree (seg); - rc = -ENOENT; - } - } else { - kfree(seg); - rc = -ENOENT; - } - } else rc = -ENOMEM; - } else { - /* found */ - if ((segtype == SEGMENT_EXCLUSIVE_RW) && (seg->dcss_attr != SEGMENT_EXCLUSIVE_RW)) { - PRINT_ERR("Segment already loaded in other mode than EXCLUSIVE_RW!\n"); - rc = -EPERM; - goto out; - /* reload segment in exclusive mode */ -/* dcss_diag(DCSS_LOADNSR, seg->dcss_name, - &seg->start_addr, &seg->end); - seg->dcss_attr = SEGMENT_EXCLUSIVE_RW;*/ + struct dcss_segment *seg; + int rc; + + if (!MACHINE_IS_VM) + return -ENOSYS; + + spin_lock (&dcss_lock); + seg = segment_by_name (name); + if (seg == NULL) + rc = __segment_load (name, do_nonshared, addr, end); + else { + if (do_nonshared == seg->do_nonshared) { + atomic_inc(&seg->ref_count); + *addr = seg->start_addr; + *end = seg->end; + rc = seg->vm_segtype; + } else { + *addr = *end = 0; + rc = -EPERM; } - if ((segtype != SEGMENT_EXCLUSIVE_RW) && (seg->dcss_attr == SEGMENT_EXCLUSIVE_RW)) { - PRINT_ERR("Segment already loaded in EXCLUSIVE_RW mode!\n"); - rc = -EPERM; - goto out; - } - atomic_inc(&seg->ref_count); - *addr = seg->start_addr; - *end = seg->end; - rc = seg->dcss_attr; - } -out: - spin_unlock(&dcss_lock); - return rc; + } + spin_unlock (&dcss_lock); + return rc; +} + +/* + * this function modifies the shared state of a DCSS segment. note that + * name : name of the DCSS + * do_nonshared : 0 indicates that the dcss should be shared with other linux images + * 1 indicates that the dcss should be exclusive for this linux image + * return values: + * -EIO : could not perform load diagnose (segment gone!) + * -ENOENT : no such segment (segment gone!) + * -EAGAIN : segment is in use by other exploiters, try later + * -EINVAL : no segment with the given name is currently loaded - name invalid + * 0 : operation succeeded + */ +int +segment_modify_shared (char *name, int do_nonshared) +{ + struct dcss_segment *seg; + unsigned long dummy; + int dcss_command, rc, diag_cc; + + spin_lock (&dcss_lock); + seg = segment_by_name (name); + if (seg == NULL) { + rc = -EINVAL; + goto out_unlock; + } + if (do_nonshared == seg->do_nonshared) { + PRINT_INFO ("segment_modify_shared: not reloading segment %s" + " - already in requested mode\n",name); + rc = 0; + goto out_unlock; + } + if (atomic_read (&seg->ref_count) != 1) { + PRINT_WARN ("segment_modify_shared: not reloading segment %s - " + "segment is in use by other driver(s)\n",name); + rc = -EAGAIN; + goto out_unlock; + } + dcss_diag(DCSS_PURGESEG, seg->dcss_name, + &dummy, &dummy); + if (do_nonshared) + dcss_command = DCSS_LOADNSR; + else + dcss_command = DCSS_LOADNOLY; + diag_cc = dcss_diag(dcss_command, seg->dcss_name, + &seg->start_addr, &seg->end); + if (diag_cc > 1) { + PRINT_WARN ("segment_modify_shared: could not reload segment %s" + " - diag returned error (%ld)\n",name,seg->end); + rc = dcss_diag_translate_rc (seg->end); + goto out_del; + } + seg->do_nonshared = do_nonshared; + rc = 0; + goto out_unlock; + out_del: + list_del(&seg->list); + dcss_diag(DCSS_PURGESEG, seg->dcss_name, + &dummy, &dummy); + kfree (seg); + out_unlock: + spin_unlock(&dcss_lock); + return rc; } /* @@ -422,84 +516,73 @@ out: * it from the address space if nobody is using it * any longer. */ -void segment_unload(char *name) +void +segment_unload(char *name) { - char dcss_name[8]; - unsigned long dummy; - struct list_head *l,*l_tmp; - struct dcss_segment *seg; - - if (!MACHINE_IS_VM) - return; - dcss_mkname(name, dcss_name); - spin_lock(&dcss_lock); - list_for_each_safe(l, l_tmp, &dcss_list) { - seg = list_entry(l, struct dcss_segment, list); - if (memcmp(seg->dcss_name, dcss_name, 8) == 0) { - if (atomic_dec_return(&seg->ref_count) == 0) { - /* Last user of the segment is - gone. */ - list_del(&seg->list); - dcss_diag(DCSS_PURGESEG, seg->dcss_name, - &dummy, &dummy); - kfree(seg); - } - break; - } - } - spin_unlock(&dcss_lock); + unsigned long dummy; + struct dcss_segment *seg; + + if (!MACHINE_IS_VM) + return; + + spin_lock(&dcss_lock); + seg = segment_by_name (name); + if (seg == NULL) { + PRINT_ERR ("could not find segment %s in segment_unload, " + "please report to linux390@de.ibm.com\n",name); + goto out_unlock; + } + if (atomic_dec_return(&seg->ref_count) == 0) { + list_del(&seg->list); + dcss_diag(DCSS_PURGESEG, seg->dcss_name, + &dummy, &dummy); + kfree(seg); + } +out_unlock: + spin_unlock(&dcss_lock); } /* - * Replace an existing DCSS segment, so that machines - * that load it anew will see the new version. + * save segment content permanently */ -void segment_replace(char *name) +void +segment_save(char *name) { - char dcss_name[8]; - struct list_head *l; - struct dcss_segment *seg; - int mybeg = 0; - int myend = 0; - char mybuff1[80]; - char mybuff2[80]; - - if (!MACHINE_IS_VM) - return; - dcss_mkname(name, dcss_name); - - memset (mybuff1, 0, sizeof(mybuff1)); - memset (mybuff2, 0, sizeof(mybuff2)); - - spin_lock(&dcss_lock); - list_for_each(l, &dcss_list) { - seg = list_entry(l, struct dcss_segment, list); - if (memcmp(seg->dcss_name, dcss_name, 8) == 0) { - mybeg = seg->start_addr >> 12; - myend = (seg->end) >> 12; - if (seg->shared_attr == SEGMENT_EXCLUSIVE_RW) - sprintf(mybuff1, "DEFSEG %s %X-%X EW", - name, mybeg, myend); - if (seg->shared_attr == SEGMENT_EXCLUSIVE_RO) - sprintf(mybuff1, "DEFSEG %s %X-%X RO", - name, mybeg, myend); - if (seg->shared_attr == SEGMENT_SHARED_RW) - sprintf(mybuff1, "DEFSEG %s %X-%X SW", - name, mybeg, myend); - if (seg->shared_attr == SEGMENT_SHARED_RO) - sprintf(mybuff1, "DEFSEG %s %X-%X SR", - name, mybeg, myend); - spin_unlock(&dcss_lock); - sprintf(mybuff2, "SAVESEG %s", name); - cpcmd(mybuff1, NULL, 80); - cpcmd(mybuff2, NULL, 80); - break; - } - - } - if (myend == 0) spin_unlock(&dcss_lock); + struct dcss_segment *seg; + int startpfn = 0; + int endpfn = 0; + char cmd1[160]; + char cmd2[80]; + int i; + + if (!MACHINE_IS_VM) + return; + + spin_lock(&dcss_lock); + seg = segment_by_name (name); + + if (seg == NULL) { + PRINT_ERR ("could not find segment %s in segment_save, please report to linux390@de.ibm.com\n",name); + return; + } + + startpfn = seg->start_addr >> PAGE_SHIFT; + endpfn = (seg->end) >> PAGE_SHIFT; + sprintf(cmd1, "DEFSEG %s", name); + for (i=0; isegcnt; i++) { + sprintf(cmd1+strlen(cmd1), " %X-%X %s", + seg->range[i].start >> PAGE_SHIFT, + seg->range[i].end >> PAGE_SHIFT, + segtype_string[seg->range[i].start & 0xff]); + } + sprintf(cmd2, "SAVESEG %s", name); + cpcmd(cmd1, NULL, 0); + cpcmd(cmd2, NULL, 0); + spin_unlock(&dcss_lock); } EXPORT_SYMBOL(segment_load); EXPORT_SYMBOL(segment_unload); -EXPORT_SYMBOL(segment_replace); +EXPORT_SYMBOL(segment_save); +EXPORT_SYMBOL(segment_type); +EXPORT_SYMBOL(segment_modify_shared); diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 1541b8699..7240782d7 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -45,11 +45,24 @@ void diag10(unsigned long addr) if (addr >= 0x7ff00000) return; #ifdef __s390x__ - asm volatile ("sam31\n\t" - "diag %0,%0,0x10\n\t" - "sam64" : : "a" (addr) ); + asm volatile ( + " sam31\n" + " diag %0,%0,0x10\n" + "0: sam64\n" + ".section __ex_table,\"a\"\n" + " .align 8\n" + " .quad 0b, 0b\n" + ".previous\n" + : : "a" (addr)); #else - asm volatile ("diag %0,%0,0x10" : : "a" (addr) ); + asm volatile ( + " diag %0,%0,0x10\n" + "0:\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 0b, 0b\n" + ".previous\n" + : : "a" (addr)); #endif } diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index 1039196ef..fb187e5a5 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c @@ -26,6 +26,7 @@ #include #include +#include /* * Top of mmap area (just below the process stack). @@ -37,7 +38,7 @@ static inline unsigned long mmap_base(void) { - unsigned long gap = current->rlim[RLIMIT_STACK].rlim_cur; + unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; if (gap < MIN_GAP) gap = MIN_GAP; @@ -58,7 +59,7 @@ static inline int mmap_is_legacy(void) #endif return sysctl_legacy_va_layout || (current->personality & ADDR_COMPAT_LAYOUT) || - current->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY; + current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY; } /* @@ -81,3 +82,5 @@ void arch_pick_mmap_layout(struct mm_struct *mm) mm->unmap_area = arch_unmap_area_topdown; } } +EXPORT_SYMBOL_GPL(arch_pick_mmap_layout); + diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 5555bc263..a65ead0e2 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c @@ -12,13 +12,9 @@ #include #include -//extern int irq_init(struct oprofile_operations** ops); -extern void timer_init(struct oprofile_operations** ops); - -int __init oprofile_arch_init(struct oprofile_operations** ops) +int __init oprofile_arch_init(struct oprofile_operations* ops) { - timer_init(ops); - return 0; + return -ENODEV; } void oprofile_arch_exit(void) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 65e0fa1ad..c65cb1691 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -25,6 +25,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + source "init/Kconfig" menu "System type" @@ -37,19 +41,25 @@ config SH_SOLUTION_ENGINE bool "SolutionEngine" help Select SolutionEngine if configuring for a Hitachi SH7709 - or SH7750 evalutation board. + or SH7750 evaluation board. config SH_7751_SOLUTION_ENGINE bool "SolutionEngine7751" help Select 7751 SolutionEngine if configuring for a Hitachi SH7751 - evalutation board. + evaluation board. config SH_7300_SOLUTION_ENGINE bool "SolutionEngine7300" help Select 7300 SolutionEngine if configuring for a Hitachi SH7300(SH-Mobile V) - evalutation board. + evaluation board. + +config SH_73180_SOLUTION_ENGINE + bool "SolutionEngine73180" + help + Select 73180 SolutionEngine if configuring for a Hitachi SH73180(SH-Mobile 3) + evaluation board. config SH_7751_SYSTEMH bool "SystemH7751R" @@ -137,6 +147,16 @@ config SH_ADX config SH_MPC1211 bool "MPC1211" +config SH_SH03 + bool "SH03" + help + CTP/PCI-SH03 is a CPU module computer that produced + by Interface Corporation. + It is compact and excellent in durability. + It will play an active part in your factory or laboratory + as a FA computer. + More information at + config SH_SECUREEDGE5410 bool "SecureEdge5410" help @@ -156,6 +176,15 @@ config SH_RTS7751R2D Select RTS7751R2D if configuring for a Renesas Technology Sales SH-Graphics board. +config SH_EDOSK7705 + bool "EDOSK7705" + +config SH_SH4202_MICRODEV + bool "SH4-202 MicroDev" + help + Select SH4-202 MicroDev if configuring for a SuperH MicroDev board + with an SH4-202 CPU. + config SH_UNKNOWN bool "BareCPU" help @@ -245,6 +274,10 @@ config CPU_SUBTYPE_SH7760 bool "SH7760" depends on CPU_SH4 +config CPU_SUBTYPE_SH73180 + bool "SH73180" + depends on CPU_SH4 + config CPU_SUBTYPE_ST40STB1 bool "ST40STB1 / ST40RA" depends on CPU_SH4 @@ -258,8 +291,17 @@ config CPU_SUBTYPE_ST40GX1 help Select ST40GX1 if you have a ST40GX1 CPU. +config CPU_SUBTYPE_SH4_202 + bool "SH4-202" + depends on CPU_SH4 + endchoice +config SH7705_CACHE_32KB + bool "Enable 32KB cache size for SH7705" + depends on CPU_SUBTYPE_SH7705 + default y + config MMU bool "Support for memory management hardware" depends on !CPU_SH2 @@ -296,8 +338,8 @@ config CMDLINE # Platform-specific memory start and size definitions config MEMORY_START hex "Physical memory start address" if !MEMORY_SET || MEMORY_OVERRIDE - default "0x08000000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || SH_MPC1211 || SH_SECUREEDGE5410 - default "0x0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D) + default "0x08000000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || SH_MPC1211 || SH_SH03 || SH_SECUREEDGE5410 || SH_SH4202_MICRODEV + default "0x0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_73180_SOLUTION_ENGINE || SH_7300_SOLUTION_ENGINE || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D || SH_EDOSK7705) ---help--- Computers built with Hitachi SuperH processors always map the ROM starting at address zero. But the processor @@ -315,10 +357,10 @@ config MEMORY_START config MEMORY_SIZE hex "Physical memory size" if !MEMORY_SET || MEMORY_OVERRIDE default "0x00400000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || !MEMORY_OVERRIDE && (SH_HP600 || SH_BIGSUR || SH_SH2000) - default "0x01000000" if !MEMORY_OVERRIDE && SH_DREAMCAST || SH_SECUREEDGE5410 - default "0x04000000" if !MEMORY_OVERRIDE && (SH_7751_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D) - default "0x02000000" if !MEMORY_OVERRIDE && SH_SOLUTION_ENGINE - default "0x08000000" if SH_MPC1211 + default "0x01000000" if !MEMORY_OVERRIDE && SH_DREAMCAST || SH_SECUREEDGE5410 || SH_EDOSK7705 + default "0x02000000" if !MEMORY_OVERRIDE && (SH_73180_SOLUTION_ENGINE || SH_SOLUTION_ENGINE) + default "0x04000000" if !MEMORY_OVERRIDE && (SH_7300_SOLUTION_ENGINE || SH_7751_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D || SH_SH4202_MICRODEV) + default "0x08000000" if SH_MPC1211 || SH_SH03 help This sets the default memory size assumed by your SH kernel. It can be overridden as normal by the 'mem=' argument on the kernel command @@ -328,7 +370,7 @@ config MEMORY_SIZE config MEMORY_SET bool - depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_SECUREEDGE5410 || SH_HS7751RVOIP || SH_RTS7751R2D) + depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_SH03 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_SECUREEDGE5410 || SH_HS7751RVOIP || SH_RTS7751R2D || SH_SH4202_MICRODEV || SH_EDOSK7705) default y help This is an option about which you will never be asked a question. @@ -343,7 +385,7 @@ config MEMORY_OVERRIDE # XXX: break these out into the board-specific configs below config CF_ENABLER bool "Compact Flash Enabler support" - depends on SH_ADX || SH_SOLUTION_ENGINE || SH_UNKNOWN || SH_CAT68701 + depends on SH_ADX || SH_SOLUTION_ENGINE || SH_UNKNOWN || SH_CAT68701 || SH_SH03 ---help--- Compact Flash is a small, removable mass storage device introduced in 1994 originally as a PCMCIA device. If you say `Y' here, you @@ -387,7 +429,7 @@ config CF_BASE_ADDR # The SH7750 RTC module is disabled in the Dreamcast config SH_RTC bool - depends on !SH_DREAMCAST && !SH_SATURN && !SH_7300_SOLUTION_ENGINE + depends on !SH_DREAMCAST && !SH_SATURN && !SH_7300_SOLUTION_ENGINE && !SH_73180_SOLUTION_ENGINE default y help Selecting this option will allow the Linux kernel to emulate @@ -395,6 +437,16 @@ config SH_RTC If unsure, say N. +config SH_FPU + bool "FPU support" + depends on !CPU_SH3 + default y + help + Selecting this option will enable support for SH processors that + have FPU units (ie, SH77xx). + + This option must be set in order to enable the FPU. + config SH_DSP bool "DSP support" depends on !CPU_SH4 @@ -438,8 +490,8 @@ config DISCONTIGMEM config ZERO_PAGE_OFFSET hex "Zero page offset" - default "0x00001000" if !SH_MPC1211 - default "0x00004000" if SH_MPC1211 + default "0x00001000" if !(SH_MPC1211 || SH_SH03) + default "0x00004000" if SH_MPC1211 || SH_SH03 help This sets the default offset of zero page. @@ -572,7 +624,7 @@ config RTS7751R2D_REV11 config SH_PCLK_CALC bool - default n if CPU_SUBTYPE_SH7300 + default n if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH73180 default y help This option will cause the PCLK value to be probed at run-time. It @@ -581,9 +633,11 @@ config SH_PCLK_CALC config SH_PCLK_FREQ int "Peripheral clock frequency (in Hz)" - default "49876504" if CPU_SUBTYPE_SH7750 - default "60013568" if CPU_SUBTYPE_SH7751 + default "50000000" if CPU_SUBTYPE_SH7750 + default "60000000" if CPU_SUBTYPE_SH7751 default "33333333" if CPU_SUBTYPE_SH7300 + default "27000000" if CPU_SUBTYPE_SH73180 + default "66000000" if CPU_SUBTYPE_SH4_202 default "1193182" help This option is used to specify the peripheral clock frequency. This @@ -595,16 +649,6 @@ config SH_PCLK_FREQ menu "CPU Frequency scaling" -config CPU_FREQ - bool "CPU Frequency scaling" - help - CPU clock scaling allows you to change the clock speed of the - running CPU on the fly. - - For details, take a look at . - - If unsure, say N. - source "drivers/cpufreq/Kconfig" config CPU_FREQ_TABLE @@ -636,7 +680,7 @@ source "arch/sh/cchips/Kconfig" config HEARTBEAT bool "Heartbeat LED" - depends on SH_MPC1211 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_7300_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_RTS7751R2D + depends on SH_MPC1211 || SH_SH03 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_7300_SOLUTION_ENGINE || SH_73180_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_RTS7751R2D || SH_SH4202_MICRODEV help Use the power-on LED on your machine as a load meter. The exact behavior is platform-dependent, but normally the flash frequency is @@ -662,7 +706,7 @@ menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" # PCMCIA outright. -- PFM. config ISA bool - default y if PCMCIA + default y if PCMCIA || SMC91X help Find out whether you have ISA slots on your motherboard. ISA is the name of a bus system, i.e. the way the CPU talks to the other stuff @@ -711,6 +755,7 @@ source "drivers/pci/hotplug/Kconfig" endmenu + menu "Executable file formats" source "fs/Kconfig.binfmt" @@ -729,7 +774,7 @@ config EMBEDDED_RAMDISK_IMAGE default "ramdisk.gz" help This is the filename of the ramdisk image to be built into the - kernel. Relative pathnames are relative to arch/mips/ramdisk/. + kernel. Relative pathnames are relative to arch/sh/ramdisk/. The ramdisk image is not part of the kernel distribution; you must provide one yourself. diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 5d2c028d9..0c520643a 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -14,17 +14,6 @@ # this architecture # -# -# We don't necessarily agree with the top-level Makefile with regards to what -# does and does not qualify as a noconfig_targets rule. In this case, we're -# still dependant on .config settings in order for core-y (machdir-y in -# particular) to resolve the proper directory. So we just manually include it -# if it hasn't been already.. -# -ifndef include_config --include .config -endif - cflags-y := -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml @@ -76,6 +65,7 @@ core-$(CONFIG_EMBEDDED_RAMDISK) += arch/sh/ramdisk/ machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300 +machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 machdir-$(CONFIG_SH_STB1_HARP) := harp machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive machdir-$(CONFIG_SH_HP620) := hp6xx/hp620 @@ -91,10 +81,13 @@ machdir-$(CONFIG_SH_BIGSUR) := bigsur machdir-$(CONFIG_SH_SH2000) := sh2000 machdir-$(CONFIG_SH_ADX) := adx machdir-$(CONFIG_SH_MPC1211) := mpc1211 +machdir-$(CONFIG_SH_SH03) := sh03 machdir-$(CONFIG_SH_SECUREEDGE5410) := snapgear machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh +machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705 +machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev machdir-$(CONFIG_SH_UNKNOWN) := unknown incdir-y := $(notdir $(machdir-y)) @@ -102,9 +95,12 @@ incdir-y := $(notdir $(machdir-y)) incdir-$(CONFIG_SH_SOLUTION_ENGINE) := se incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se7751 incdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se7300 +incdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se73180 incdir-$(CONFIG_SH_HP600) := hp6xx +ifneq ($(machdir-y),) core-y += arch/sh/boards/$(machdir-y)/ +endif # Companion chips core-$(CONFIG_HD64461) += arch/sh/cchips/hd6446x/hd64461/ @@ -124,23 +120,39 @@ boot := arch/sh/boot CPPFLAGS_vmlinux.lds := -traditional -prepare: target_links +# 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. -.PHONY: target_links FORCE +include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/MARKER + @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)' +ifneq ($(KBUILD_SRC),) + $(Q)mkdir -p include/asm-sh + $(Q)ln -fsn $(srctree)/include/asm-sh/$(cpuincdir-y) include/asm-sh/cpu +else + $(Q)ln -fsn $(cpuincdir-y) include/asm-sh/cpu +endif + @touch $@ -all: zImage +include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER + @echo ' SYMLINK include/asm-sh/mach -> include/asm-sh/$(incdir-y)' +ifneq ($(KBUILD_SRC),) + $(Q)mkdir -p include/asm-sh + $(Q)ln -fsn $(srctree)/include/asm-sh/$(incdir-y) include/asm-sh/mach +else + $(Q)ln -fsn $(incdir-y) include/asm-sh/mach +endif + @touch $@ -target_links: - @echo ' Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link' - @rm -f include/asm-sh/cpu - @ln -sf $(cpuincdir-y) include/asm-sh/cpu - @echo ' Making asm-sh/mach -> asm-sh/$(incdir-y) link' - @rm -f include/asm-sh/mach - @ln -sf $(incdir-y) include/asm-sh/mach +prepare: maketools include/asm-sh/.cpu include/asm-sh/.mach +.PHONY: maketools FORCE +maketools: include/asm-sh/asm-offsets.h include/linux/version.h FORCE $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h +all: zImage + zImage: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ @@ -149,6 +161,15 @@ compressed: zImage archclean: $(Q)$(MAKE) $(clean)=$(boot) +CLEAN_FILES += include/asm-sh/machtypes.h include/asm-sh/asm-offsets.h + +arch/sh/kernel/asm-offsets.s: include/asm include/linux/version.h \ + include/asm-sh/.cpu include/asm-sh/.mach + +include/asm-sh/asm-offsets.h: arch/sh/kernel/asm-offsets.s + $(call filechk,gen-asm-offsets) + + define archhelp @echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)' endef diff --git a/arch/sh/boards/bigsur/irq.c b/arch/sh/boards/bigsur/irq.c index 082472448..c188fc32d 100644 --- a/arch/sh/boards/bigsur/irq.c +++ b/arch/sh/boards/bigsur/irq.c @@ -29,10 +29,10 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/arch/sh/boards/bigsur/setup.c b/arch/sh/boards/bigsur/setup.c index 9cb329269..e69be0519 100644 --- a/arch/sh/boards/bigsur/setup.c +++ b/arch/sh/boards/bigsur/setup.c @@ -29,10 +29,10 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/arch/sh/boards/dreamcast/setup.c b/arch/sh/boards/dreamcast/setup.c index c59d1599b..55dece35c 100644 --- a/arch/sh/boards/dreamcast/setup.c +++ b/arch/sh/boards/dreamcast/setup.c @@ -1,15 +1,15 @@ -/* +/* * arch/sh/boards/dreamcast/setup.c * * Hardware support for the Sega Dreamcast. * * Copyright (c) 2001, 2002 M. R. Brown - * Copyright (c) 2002, 2003 Paul Mundt + * Copyright (c) 2002, 2003, 2004 Paul Mundt * * 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 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -34,6 +35,10 @@ extern void (*board_time_init)(void); extern void aica_time_init(void); extern int gapspci_init(void); extern int systemasic_irq_demux(int); + +void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, int); +int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t); + const char *get_system_type(void) { return "Sega Dreamcast"; @@ -43,6 +48,11 @@ struct sh_machine_vector mv_dreamcast __initmv = { .mv_nr_irqs = NR_IRQS, .mv_irq_demux = systemasic_irq_demux, + +#ifdef CONFIG_PCI + .mv_consistent_alloc = dreamcast_consistent_alloc, + .mv_consistent_free = dreamcast_consistent_free, +#endif }; ALIAS_MV(dreamcast) diff --git a/arch/sh/boards/harp/setup.c b/arch/sh/boards/harp/setup.c index 0d64b28b0..05b01b8f4 100644 --- a/arch/sh/boards/harp/setup.c +++ b/arch/sh/boards/harp/setup.c @@ -54,3 +54,38 @@ int __init platform_setup(void) return 0; } + +/* + * pcibios_map_platform_irq + * + * This is board specific and returns the IRQ for a given PCI device. + * It is used by the PCI code (arch/sh/kernel/st40_pci*) + * + */ + +#define HARP_PCI_IRQ 1 +#define HARP_BRIDGE_IRQ 2 +#define OVERDRIVE_SLOT0_IRQ 0 + + +int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) +{ + switch (slot) { +#ifdef CONFIG_SH_STB1_HARP + case 2: /*This is the PCI slot on the */ + return HARP_PCI_IRQ; + case 1: /* this is the bridge */ + return HARP_BRIDGE_IRQ; +#elif defined(CONFIG_SH_STB1_OVERDRIVE) + case 1: + case 2: + case 3: + return slot - 1; +#else +#error Unknown board +#endif + default: + return -1; + } +} + diff --git a/arch/sh/boards/overdrive/pcidma.c b/arch/sh/boards/overdrive/pcidma.c index 275ea1a7e..1c9bfeda0 100644 --- a/arch/sh/boards/overdrive/pcidma.c +++ b/arch/sh/boards/overdrive/pcidma.c @@ -25,7 +25,7 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, printk("BUG: pci_alloc_consistent() called - not yet supported\n"); /* We ALWAYS need DMA memory on the overdrive hardware, - * due to it's extreme wierdness + * due to it's extreme weirdness * Need to flush the cache here as well, since the memory * can still be seen through the cache! */ diff --git a/arch/sh/boards/renesas/hs7751rvoip/io.c b/arch/sh/boards/renesas/hs7751rvoip/io.c index a2ecd2d6a..456753d26 100644 --- a/arch/sh/boards/renesas/hs7751rvoip/io.c +++ b/arch/sh/boards/renesas/hs7751rvoip/io.c @@ -166,7 +166,7 @@ void hs7751rvoip_outb(unsigned char value, unsigned long port) if (PXSEG(port)) *(volatile unsigned char *)port = value; -#if defined(CONFIG_HS7751RVOIP_CIDEC) +#if defined(CONFIG_HS7751RVOIP_CODEC) else if (codec_port(port)) *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; #endif @@ -180,7 +180,7 @@ void hs7751rvoip_outb_p(unsigned char value, unsigned long port) { if (PXSEG(port)) *(volatile unsigned char *)port = value; -#if defined(CONFIG_HS7751RVOIP_CIDEC) +#if defined(CONFIG_HS7751RVOIP_CODEC) else if (codec_port(port)) *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; #endif diff --git a/arch/sh/boards/renesas/rts7751r2d/mach.c b/arch/sh/boards/renesas/rts7751r2d/mach.c index c1ff45407..1efc18e78 100644 --- a/arch/sh/boards/renesas/rts7751r2d/mach.c +++ b/arch/sh/boards/renesas/rts7751r2d/mach.c @@ -24,7 +24,7 @@ extern void *rts7751r2d_ioremap(unsigned long, unsigned long); extern int rts7751r2d_irq_demux(int irq); extern void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, int); -extern void voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t); +extern int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t); /* * The Machine Vector @@ -62,7 +62,9 @@ struct sh_machine_vector mv_rts7751r2d __initmv = { #endif .mv_irq_demux = rts7751r2d_irq_demux, +#ifdef CONFIG_USB_OHCI_HCD .mv_consistent_alloc = voyagergx_consistent_alloc, .mv_consistent_free = voyagergx_consistent_free, +#endif }; ALIAS_MV(rts7751r2d) diff --git a/arch/sh/boards/se/770x/irq.c b/arch/sh/boards/se/770x/irq.c index dff4fbd86..210897b31 100644 --- a/arch/sh/boards/se/770x/irq.c +++ b/arch/sh/boards/se/770x/irq.c @@ -1,5 +1,4 @@ -/* $Id: irq.c,v 1.4 2004/02/22 22:44:36 kkojima Exp $ - * +/* * linux/arch/sh/boards/se/770x/irq.c * * Copyright (C) 2000 Kazumoto Kojima @@ -12,6 +11,7 @@ #include #include #include +#include #include /* @@ -30,6 +30,32 @@ void __init init_se_IRQ(void) * 12: mouse * 14: ide0 */ +#if defined(CONFIG_CPU_SUBTYPE_SH7705) + /* 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); + /* This is default value */ + make_ipr_irq(0xf-0x2, BCR_ILCRA, 2, 0x2); + make_ipr_irq(0xf-0xa, BCR_ILCRA, 1, 0xa); + make_ipr_irq(0xf-0x5, BCR_ILCRB, 0, 0x5); + make_ipr_irq(0xf-0x8, BCR_ILCRC, 1, 0x8); + make_ipr_irq(0xf-0xc, BCR_ILCRC, 0, 0xc); + make_ipr_irq(0xf-0xe, BCR_ILCRD, 3, 0xe); + make_ipr_irq(0xf-0x3, BCR_ILCRD, 1, 0x3); /* LAN */ + make_ipr_irq(0xf-0xd, BCR_ILCRE, 2, 0xd); + make_ipr_irq(0xf-0x9, BCR_ILCRE, 1, 0x9); + make_ipr_irq(0xf-0x1, BCR_ILCRE, 0, 0x1); + make_ipr_irq(0xf-0xf, BCR_ILCRF, 3, 0xf); + make_ipr_irq(0xf-0xb, BCR_ILCRF, 1, 0xb); + make_ipr_irq(0xf-0x7, BCR_ILCRG, 3, 0x7); + make_ipr_irq(0xf-0x6, BCR_ILCRG, 2, 0x6); + make_ipr_irq(0xf-0x4, BCR_ILCRG, 1, 0x4); +#else make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-14); make_ipr_irq(12, BCR_ILCRA, 1, 0x0f-12); make_ipr_irq( 8, BCR_ILCRB, 1, 0x0f- 8); @@ -50,4 +76,5 @@ void __init init_se_IRQ(void) /* NOTE: #2 and #13 are not used on PC */ make_ipr_irq(13, BCR_ILCRG, 1, 0x0f-13); /* SLOTIRQ2 */ make_ipr_irq( 2, BCR_ILCRG, 0, 0x0f- 2); /* SLOTIRQ1 */ +#endif } diff --git a/arch/sh/boards/se/770x/mach.c b/arch/sh/boards/se/770x/mach.c index aa5dde2f5..f9b4c56cc 100644 --- a/arch/sh/boards/se/770x/mach.c +++ b/arch/sh/boards/se/770x/mach.c @@ -33,6 +33,8 @@ struct sh_machine_vector mv_se __initmv = { .mv_nr_irqs = 32, #elif defined(CONFIG_CPU_SUBTYPE_SH7709) .mv_nr_irqs = 61, +#elif defined(CONFIG_CPU_SUBTYPE_SH7705) + .mv_nr_irqs = 86, #endif .mv_inb = se_inb, diff --git a/arch/sh/boards/se/7751/io.c b/arch/sh/boards/se/7751/io.c index 224a5e37d..99041b269 100644 --- a/arch/sh/boards/se/7751/io.c +++ b/arch/sh/boards/se/7751/io.c @@ -18,7 +18,7 @@ #include #include -#include +#include "../../../drivers/pci/pci-sh7751.h" #if 0 /****************************************************************** diff --git a/arch/sh/boards/se/7751/pci.c b/arch/sh/boards/se/7751/pci.c index 2f8682ebc..1f273efd2 100644 --- a/arch/sh/boards/se/7751/pci.c +++ b/arch/sh/boards/se/7751/pci.c @@ -19,7 +19,7 @@ #include #include -#include +#include "../../../drivers/pci/pci-sh7751.h" #define PCIMCR_MRSET_OFF 0xBFFFFFFF #define PCIMCR_RFSH_OFF 0xFFFFFFFB diff --git a/arch/sh/cchips/voyagergx/consistent.c b/arch/sh/cchips/voyagergx/consistent.c index 95a309d14..5b92585a3 100644 --- a/arch/sh/cchips/voyagergx/consistent.c +++ b/arch/sh/cchips/voyagergx/consistent.c @@ -23,7 +23,7 @@ struct voya_alloc_entry { unsigned long len; }; -static spinlock_t voya_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(voya_list_lock); static LIST_HEAD(voya_alloc_list); #define OHCI_SRAM_START 0xb0000000 @@ -49,13 +49,13 @@ void *voyagergx_consistent_alloc(struct device *dev, size_t size, if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || (dev->bus == &sh_bus_types[SH_BUS_VIRT] && shdev->dev_id != SH_DEV_ID_USB_OHCI)) - return consistent_alloc(flag, size, handle); + return NULL; start = OHCI_SRAM_START + OHCI_HCCA_SIZE; entry = kmalloc(sizeof(struct voya_alloc_entry), GFP_ATOMIC); if (!entry) - return NULL; + return ERR_PTR(-ENOMEM); entry->len = (size + 15) & ~15; @@ -91,11 +91,11 @@ out: kfree(entry); spin_unlock_irqrestore(&voya_list_lock, flags); - return NULL; + return ERR_PTR(-EINVAL); } -void voyagergx_consistent_free(struct device *dev, size_t size, - void *vaddr, dma_addr_t handle) +int voyagergx_consistent_free(struct device *dev, size_t size, + void *vaddr, dma_addr_t handle) { struct voya_alloc_entry *entry; struct sh_dev *shdev = to_sh_dev(dev); @@ -103,10 +103,8 @@ void voyagergx_consistent_free(struct device *dev, size_t size, if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || (dev->bus == &sh_bus_types[SH_BUS_VIRT] && - shdev->dev_id != SH_DEV_ID_USB_OHCI)) { - consistent_free(vaddr, size); - return; - } + shdev->dev_id != SH_DEV_ID_USB_OHCI)) + return -EINVAL; spin_lock_irqsave(&voya_list_lock, flags); list_for_each_entry(entry, &voya_alloc_list, list) { @@ -119,6 +117,8 @@ void voyagergx_consistent_free(struct device *dev, size_t size, break; } spin_unlock_irqrestore(&voya_list_lock, flags); + + return 0; } EXPORT_SYMBOL(voyagergx_consistent_alloc); diff --git a/arch/sh/configs/rts7751r2d_defconfig b/arch/sh/configs/rts7751r2d_defconfig index b724a5192..34fd8d1d4 100644 --- a/arch/sh/configs/rts7751r2d_defconfig +++ b/arch/sh/configs/rts7751r2d_defconfig @@ -18,9 +18,12 @@ CONFIG_BROKEN_ON_SMP=y # CONFIG_SWAP=y CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 +CONFIG_HOTPLUG=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y @@ -29,6 +32,8 @@ CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # # Loadable module support @@ -44,6 +49,7 @@ CONFIG_OBSOLETE_MODPARM=y # # 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_7751_SYSTEMH is not set # CONFIG_SH_STB1_HARP is not set # CONFIG_SH_STB1_OVERDRIVE is not set @@ -61,6 +67,7 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_SH_ADX is not set # CONFIG_SH_MPC1211 is not set # CONFIG_SH_SECUREEDGE5410 is not set +# CONFIG_SH_HS7751RVOIP is not set CONFIG_SH_RTS7751R2D=y # CONFIG_SH_UNKNOWN is not set # CONFIG_CPU_SH2 is not set @@ -68,6 +75,7 @@ CONFIG_SH_RTS7751R2D=y CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7604 is not set # CONFIG_CPU_SUBTYPE_SH7300 is not set +# CONFIG_CPU_SUBTYPE_SH7705 is not set # CONFIG_CPU_SUBTYPE_SH7707 is not set # CONFIG_CPU_SUBTYPE_SH7708 is not set # CONFIG_CPU_SUBTYPE_SH7709 is not set @@ -75,6 +83,7 @@ CONFIG_CPU_SH4=y CONFIG_CPU_SUBTYPE_SH7751=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_ST40STB1 is not set +# CONFIG_CPU_SUBTYPE_ST40GX1 is not set CONFIG_MMU=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="mem=64M console=ttySC0,115200 root=/dev/hda1" @@ -92,14 +101,29 @@ CONFIG_CPU_LITTLE_ENDIAN=y # CONFIG_SH_OCRAM is not set # CONFIG_SH_STORE_QUEUES is not set # CONFIG_SMP is not set -CONFIG_VOYAGERGX=y CONFIG_RTS7751R2D_REV11=y +CONFIG_SH_PCLK_CALC=y CONFIG_SH_PCLK_FREQ=60000000 + +# +# CPU Frequency scaling +# # CONFIG_CPU_FREQ is not set + +# +# DMA support +# CONFIG_SH_DMA=y CONFIG_NR_ONCHIP_DMA_CHANNELS=8 # CONFIG_NR_DMA_CHANNELS_BOOL is not set -# CONFIG_DMA_PAGE_OPS is not set + +# +# Companion Chips +# +CONFIG_VOYAGERGX=y +# CONFIG_HD6446X_SERIES is not set +CONFIG_HEARTBEAT=y +CONFIG_RTC_9701JE=y # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) @@ -109,15 +133,14 @@ CONFIG_PCI=y CONFIG_SH_PCIDMA_NONCOHERENT=y CONFIG_PCI_AUTO=y CONFIG_PCI_AUTO_UPDATE_RESOURCES=y -CONFIG_PCI_DMA=y # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y -CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=m +# CONFIG_PCMCIA_DEBUG is not set CONFIG_YENTA=m CONFIG_CARDBUS=y # CONFIG_I82092 is not set @@ -131,6 +154,8 @@ CONFIG_PCMCIA_PROBE=y CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_PCIE is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set # # Executable file formats @@ -139,6 +164,10 @@ CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_FLAT is not set # CONFIG_BINFMT_MISC is not set +# +# Device Drivers +# + # # Generic Driver Options # @@ -154,6 +183,11 @@ CONFIG_BINFMT_ELF=y # # CONFIG_PARPORT is not set +# +# Plug and Play support +# +# CONFIG_PNP is not set + # # Block devices # @@ -165,6 +199,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_CARMEL is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set @@ -174,6 +209,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y +CONFIG_IDE_MAX_HWIFS=4 CONFIG_BLK_DEV_IDE=y # @@ -181,7 +217,6 @@ CONFIG_BLK_DEV_IDE=y # CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set -# CONFIG_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECS=m # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set @@ -192,11 +227,13 @@ CONFIG_BLK_DEV_IDECS=m # # IDE chipset support/bugfixes # +CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_IDEPCI is not set +CONFIG_IDE_SH=y +# CONFIG_IDE_ARM is not set # CONFIG_IDE_CHIPSETS is not set # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set -# CONFIG_DMA_NONPCI is not set # CONFIG_BLK_DEV_HD is not set # @@ -215,10 +252,19 @@ CONFIG_BLK_DEV_IDECS=m # CONFIG_MD is not set # -# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# Fusion MPT device support +# + +# +# IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set +# +# I2O device support +# +# CONFIG_I2O is not set + # # Networking support # @@ -239,23 +285,21 @@ CONFIG_INET=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_IPV6 is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set # CONFIG_NETFILTER is not set # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set @@ -264,6 +308,7 @@ CONFIG_IPV6_SCTP__=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # @@ -275,16 +320,21 @@ CONFIG_IPV6_SCTP__=y # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set # # Ethernet (10 or 100Mbit) @@ -325,6 +375,7 @@ CONFIG_NET_PCI=y # 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 @@ -355,7 +406,6 @@ CONFIG_8139TOO=y # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set -# CONFIG_SIS190 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set @@ -363,10 +413,12 @@ CONFIG_8139TOO=y # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set # # Wireless LAN (non-hamradio) @@ -395,27 +447,20 @@ CONFIG_HERMES=m # CONFIG_PLX_HERMES is not set # CONFIG_TMD_HERMES is not set # CONFIG_PCI_HERMES is not set +# CONFIG_ATMEL is not set # # Wireless 802.11b Pcmcia/Cardbus cards support # CONFIG_PCMCIA_HERMES=m # CONFIG_AIRO_CS is not set -# CONFIG_PCMCIA_ATMEL is not set # CONFIG_PCMCIA_WL3501 is not set -CONFIG_NET_WIRELESS=y # -# Token Ring devices +# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # -# CONFIG_TR is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set +# CONFIG_PRISM54 is not set +CONFIG_NET_WIRELESS=y # # PCMCIA network device support @@ -423,24 +468,20 @@ CONFIG_NET_WIRELESS=y # CONFIG_NET_PCMCIA is not set # -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# -# Bluetooth support +# Wan interfaces # -# CONFIG_BT 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 # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set +# CONFIG_ISDN is not set # # Telephony Support @@ -472,28 +513,7 @@ CONFIG_SOUND_GAMEPORT=y # Character devices # # CONFIG_VT is not set -# CONFIG_SERIAL is not set -CONFIG_SH_SCI=y -CONFIG_SERIAL_CONSOLE=y -CONFIG_RTC_9701JE=y - -# -# Unix 98 PTY support -# -# CONFIG_UNIX98_PTYS is not set -CONFIG_HEARTBEAT=y -# CONFIG_PSMOUSE is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -# CONFIG_RTC is not set - -# -# PCMCIA character devices -# -# CONFIG_SYNCLINK_CS is not set +# CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers @@ -504,142 +524,47 @@ CONFIG_HEARTBEAT=y # Non-8250 serial port support # # CONFIG_SERIAL_SH_SCI is not set +# CONFIG_UNIX98_PTYS is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_QIC02_TAPE is not set # -# I2C support -# -# CONFIG_I2C is not set - -# -# I2C Algorithms -# - -# -# I2C Hardware Bus support -# - -# -# I2C Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -CONFIG_MINIX_FS=y -# CONFIG_ROMFS_FS is not set -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems +# IPMI # -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -# CONFIG_NTFS_FS is not set +# CONFIG_IPMI_HANDLER is not set # -# Pseudo filesystems +# Watchdog Cards # -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -# CONFIG_DEVFS_FS is not set -# CONFIG_TMPFS is not set -# CONFIG_HUGETLB_PAGE is not set -CONFIG_RAMFS=y +# CONFIG_WATCHDOG is not set +# CONFIG_RTC is not set +# CONFIG_GEN_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set # -# Miscellaneous filesystems +# Ftape, the floppy tape device driver # -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set # -# Network File Systems +# PCMCIA character devices # -# CONFIG_NFS_FS is not set -# CONFIG_NFSD is not set -# CONFIG_EXPORTFS is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set -# CONFIG_AFS_FS is not set +# CONFIG_SYNCLINK_CS is not set +# CONFIG_RAW_DRIVER is not set # -# Partition Types +# I2C support # -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_NLS=y +# CONFIG_I2C is not set # -# Native Language Support +# Misc devices # -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -CONFIG_NLS_CODEPAGE_932=y -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set # # Multimedia devices @@ -665,14 +590,21 @@ CONFIG_SOUND=y # Advanced Linux Sound Architecture # CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m # CONFIG_SND_SEQUENCER is not set -# CONFIG_SND_OSSEMUL is not set +# CONFIG_SND_MIXER_OSS is not set +# CONFIG_SND_PCM_OSS is not set # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # +CONFIG_SND_MPU401_UART=m +CONFIG_SND_OPL3_LIB=m # CONFIG_SND_DUMMY is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set @@ -707,12 +639,19 @@ CONFIG_SND=m # # PCI devices # +CONFIG_SND_AC97_CODEC=m # CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set # CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BT87X is not set # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS4281 is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_KORG1212 is not set +# CONFIG_SND_MIXART is not set # CONFIG_SND_NM256 is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set @@ -731,6 +670,7 @@ CONFIG_SND_YMFPCI=m # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_VIA82XX is not set # CONFIG_SND_VX222 is not set @@ -740,6 +680,7 @@ CONFIG_SND_YMFPCI=m # # CONFIG_SND_VXPOCKET is not set # CONFIG_SND_VXP440 is not set +# CONFIG_SND_PDAUDIOCF is not set # # Open Sound System @@ -747,10 +688,6 @@ CONFIG_SND_YMFPCI=m CONFIG_SOUND_PRIME=m # CONFIG_SOUND_BT878 is not set CONFIG_SOUND_CMPCI=m -# CONFIG_SOUND_CMPCI_FM is not set -# CONFIG_SOUND_CMPCI_MIDI is not set -# CONFIG_SOUND_CMPCI_JOYSTICK is not set -# CONFIG_SOUND_CMPCI_CM8738 is not set # CONFIG_SOUND_EMU10K1 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set @@ -776,19 +713,146 @@ CONFIG_SOUND_VOYAGERGX=m # USB support # # CONFIG_USB is not set + +# +# USB Gadget Support +# # CONFIG_USB_GADGET is not set +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +CONFIG_MINIX_FS=y +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_TMPFS is not set +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +# CONFIG_NFS_FS is not set +# CONFIG_NFSD is not set +# CONFIG_EXPORTFS is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +CONFIG_NLS_CODEPAGE_932=y +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + # # Profiling support # -# CONFIG_PROFILING is not set +CONFIG_PROFILING=y +CONFIG_OPROFILE=y # # Kernel hacking # # CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_INFO is not set # CONFIG_SH_STANDARD_BIOS is not set +# CONFIG_EARLY_SCIF_CONSOLE is not set # CONFIG_KGDB is not set # CONFIG_FRAME_POINTER is not set @@ -806,3 +870,4 @@ CONFIG_SOUND_VOYAGERGX=m # Library routines # CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set diff --git a/arch/sh/configs/se7751_defconfig b/arch/sh/configs/se7751_defconfig index 4162d3d6d..6501d94ff 100644 --- a/arch/sh/configs/se7751_defconfig +++ b/arch/sh/configs/se7751_defconfig @@ -284,6 +284,7 @@ CONFIG_IPV6_SCTP__=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c index 3fc34e1cf..96e3036ec 100644 --- a/arch/sh/drivers/dma/dma-api.c +++ b/arch/sh/drivers/dma/dma-api.c @@ -17,7 +17,7 @@ #include #include -spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dma_spin_lock); static LIST_HEAD(registered_dmac_list); /* @@ -211,8 +211,9 @@ int __init register_dmac(struct dma_info *info) INIT_LIST_HEAD(&info->list); - printk(KERN_INFO "DMA: Registering %s handler (%d channels).\n", - info->name, info->nr_channels); + printk(KERN_INFO "DMA: Registering %s handler (%d channel%s).\n", + info->name, info->nr_channels, + info->nr_channels > 1 ? "s" : ""); BUG_ON((info->flags & DMAC_CHANNELS_CONFIGURED) && !info->channels); @@ -282,7 +283,6 @@ MODULE_LICENSE("GPL"); EXPORT_SYMBOL(request_dma); EXPORT_SYMBOL(free_dma); EXPORT_SYMBOL(register_dmac); -EXPORT_SYMBOL(unregister_dmac); EXPORT_SYMBOL(get_dma_residue); EXPORT_SYMBOL(get_dma_info); EXPORT_SYMBOL(get_dma_channel); diff --git a/arch/sh/drivers/dma/dma-g2.c b/arch/sh/drivers/dma/dma-g2.c index f369e6c25..231e3f6fb 100644 --- a/arch/sh/drivers/dma/dma-g2.c +++ b/arch/sh/drivers/dma/dma-g2.c @@ -3,7 +3,7 @@ * * G2 bus DMA support * - * Copyright (C) 2003 Paul Mundt + * 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 @@ -59,104 +59,102 @@ static struct irqaction g2_dma_irq = { .flags = SA_INTERRUPT, }; -static int g2_enable_dma(struct dma_info *info) +static int g2_enable_dma(struct dma_channel *chan) { - unsigned int chan = info->chan; + unsigned int chan_nr = chan->chan; - g2_dma->channel[chan].chan_enable = 1; - g2_dma->channel[chan].xfer_enable = 1; + g2_dma->channel[chan_nr].chan_enable = 1; + g2_dma->channel[chan_nr].xfer_enable = 1; return 0; } -static int g2_disable_dma(struct dma_info *info) +static int g2_disable_dma(struct dma_channel *chan) { - unsigned int chan = info->chan; + unsigned int chan_nr = chan->chan; - g2_dma->channel[chan].chan_enable = 0; - g2_dma->channel[chan].xfer_enable = 0; + g2_dma->channel[chan_nr].chan_enable = 0; + g2_dma->channel[chan_nr].xfer_enable = 0; return 0; } -static int g2_xfer_dma(struct dma_info *info) +static int g2_xfer_dma(struct dma_channel *chan) { - unsigned int chan = info->chan; + unsigned int chan_nr = chan->chan; - if (info->sar & 31) { - printk("g2dma: unaligned source 0x%lx\n", info->sar); + if (chan->sar & 31) { + printk("g2dma: unaligned source 0x%lx\n", chan->sar); return -EINVAL; } - if (info->dar & 31) { - printk("g2dma: unaligned dest 0x%lx\n", info->dar); + if (chan->dar & 31) { + printk("g2dma: unaligned dest 0x%lx\n", chan->dar); return -EINVAL; } /* Align the count */ - if (info->count & 31) - info->count = (info->count + (32 - 1)) & ~(32 - 1); + if (chan->count & 31) + chan->count = (chan->count + (32 - 1)) & ~(32 - 1); /* Fixup destination */ - info->dar += 0xa0800000; + chan->dar += 0xa0800000; /* Fixup direction */ - info->mode = !info->mode; + chan->mode = !chan->mode; - flush_icache_range((unsigned long)info->sar, info->count); + flush_icache_range((unsigned long)chan->sar, chan->count); - g2_disable_dma(info); + g2_disable_dma(chan); - g2_dma->channel[chan].g2_addr = info->dar & 0x1fffffe0; - g2_dma->channel[chan].root_addr = info->sar & 0x1fffffe0; - g2_dma->channel[chan].size = (info->count & ~31) | 0x80000000; - g2_dma->channel[chan].direction = info->mode; + g2_dma->channel[chan_nr].g2_addr = chan->dar & 0x1fffffe0; + g2_dma->channel[chan_nr].root_addr = chan->sar & 0x1fffffe0; + g2_dma->channel[chan_nr].size = (chan->count & ~31) | 0x80000000; + g2_dma->channel[chan_nr].direction = chan->mode; /* * bit 0 - ??? * bit 1 - if set, generate a hardware event on transfer completion * bit 2 - ??? something to do with suspend? */ - g2_dma->channel[chan].ctrl = 5; /* ?? */ + g2_dma->channel[chan_nr].ctrl = 5; /* ?? */ + + g2_enable_dma(chan); - g2_enable_dma(info); - /* debug cruft */ pr_debug("count, sar, dar, mode, ctrl, chan, xfer: %ld, 0x%08lx, " "0x%08lx, %ld, %ld, %ld, %ld\n", - g2_dma->channel[chan].size, - g2_dma->channel[chan].root_addr, - g2_dma->channel[chan].g2_addr, - g2_dma->channel[chan].direction, - g2_dma->channel[chan].ctrl, - g2_dma->channel[chan].chan_enable, - g2_dma->channel[chan].xfer_enable); + g2_dma->channel[chan_nr].size, + g2_dma->channel[chan_nr].root_addr, + g2_dma->channel[chan_nr].g2_addr, + g2_dma->channel[chan_nr].direction, + g2_dma->channel[chan_nr].ctrl, + g2_dma->channel[chan_nr].chan_enable, + g2_dma->channel[chan_nr].xfer_enable); return 0; } static struct dma_ops g2_dma_ops = { - .name = "G2 DMA", .xfer = g2_xfer_dma, }; +static struct dma_info g2_dma_info = { + .name = "G2 DMA", + .nr_channels = 4, + .ops = &g2_dma_ops, + .flags = DMAC_CHANNELS_TEI_CAPABLE, +}; + static int __init g2_dma_init(void) { - int i, base; - setup_irq(HW_EVENT_G2_DMA, &g2_dma_irq); /* Magic */ g2_dma->wait_state = 27; g2_dma->magic = 0x4659404f; - /* G2 channels come after on-chip and pvr2 */ - base = ONCHIP_NR_DMA_CHANNELS + PVR2_NR_DMA_CHANNELS; - - for (i = 0; i < G2_NR_DMA_CHANNELS; i++) - dma_info[base + i].ops = &g2_dma_ops; - - return register_dmac(&g2_dma_ops); + return register_dmac(&g2_dma_info); } static void __exit g2_dma_exit(void) diff --git a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c index ee54adae2..2e1d58f2d 100644 --- a/arch/sh/drivers/dma/dma-pvr2.c +++ b/arch/sh/drivers/dma/dma-pvr2.c @@ -3,7 +3,7 @@ * * NEC PowerVR 2 (Dreamcast) DMA support * - * Copyright (C) 2003 Paul Mundt + * 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 @@ -38,7 +38,7 @@ static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id, struct pt_regs *reg return IRQ_HANDLED; } -static int pvr2_request_dma(struct dma_info *info) +static int pvr2_request_dma(struct dma_channel *chan) { if (ctrl_inl(PVR2_DMA_MODE) != 0) return -EBUSY; @@ -48,21 +48,21 @@ static int pvr2_request_dma(struct dma_info *info) return 0; } -static int pvr2_get_dma_residue(struct dma_info *info) +static int pvr2_get_dma_residue(struct dma_channel *chan) { return xfer_complete == 0; } -static int pvr2_xfer_dma(struct dma_info *info) +static int pvr2_xfer_dma(struct dma_channel *chan) { - if (info->sar || !info->dar) + if (chan->sar || !chan->dar) return -EINVAL; xfer_complete = 0; - ctrl_outl(info->dar, PVR2_DMA_ADDR); - ctrl_outl(info->count, PVR2_DMA_COUNT); - ctrl_outl(info->mode & DMA_MODE_MASK, PVR2_DMA_MODE); + ctrl_outl(chan->dar, PVR2_DMA_ADDR); + ctrl_outl(chan->count, PVR2_DMA_COUNT); + ctrl_outl(chan->mode & DMA_MODE_MASK, PVR2_DMA_MODE); return 0; } @@ -74,26 +74,24 @@ static struct irqaction pvr2_dma_irq = { }; static struct dma_ops pvr2_dma_ops = { - .name = "PowerVR 2 DMA", .request = pvr2_request_dma, .get_residue = pvr2_get_dma_residue, .xfer = pvr2_xfer_dma, }; +static struct dma_info pvr2_dma_info = { + .name = "PowerVR 2 DMA", + .nr_channels = 1, + .ops = &pvr2_dma_ops, + .flags = DMAC_CHANNELS_TEI_CAPABLE, +}; + static int __init pvr2_dma_init(void) { - int i, base; - setup_irq(HW_EVENT_PVR2_DMA, &pvr2_dma_irq); request_dma(PVR2_CASCADE_CHAN, "pvr2 cascade"); - /* PVR2 cascade comes after on-chip DMAC */ - base = ONCHIP_NR_DMA_CHANNELS; - - for (i = 0; i < PVR2_NR_DMA_CHANNELS; i++) - dma_info[base + i].ops = &pvr2_dma_ops; - - return register_dmac(&pvr2_dma_ops); + return register_dmac(&pvr2_dma_info); } static void __exit pvr2_dma_exit(void) diff --git a/arch/sh/drivers/pci/Kconfig b/arch/sh/drivers/pci/Kconfig index 184cb8a56..6d1cbbe67 100644 --- a/arch/sh/drivers/pci/Kconfig +++ b/arch/sh/drivers/pci/Kconfig @@ -3,8 +3,7 @@ config PCI help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside - your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or - VESA. If you have PCI, say Y, otherwise N. + your box. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from , contains valuable diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index 4923bbf5e..365bc16a4 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile @@ -13,4 +13,4 @@ obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o obj-$(CONFIG_SH_BIGSUR) += ops-bigsur.o obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o - +obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o diff --git a/arch/sh/drivers/pci/dma-dreamcast.c b/arch/sh/drivers/pci/dma-dreamcast.c index ff6169720..83de7ef4e 100644 --- a/arch/sh/drivers/pci/dma-dreamcast.c +++ b/arch/sh/drivers/pci/dma-dreamcast.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -30,18 +32,21 @@ static int gapspci_dma_used = 0; -void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t * dma_handle) +void *dreamcast_consistent_alloc(struct device *dev, size_t size, + dma_addr_t *dma_handle, int flag) { unsigned long buf; - if (gapspci_dma_used+size > GAPSPCI_DMA_SIZE) + if (dev && dev->bus != &pci_bus_type) return NULL; - buf = GAPSPCI_DMA_BASE+gapspci_dma_used; + if (gapspci_dma_used + size > GAPSPCI_DMA_SIZE) + return ERR_PTR(-EINVAL); + + buf = GAPSPCI_DMA_BASE + gapspci_dma_used; gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size); - + *dma_handle = (dma_addr_t)buf; buf = P2SEGADDR(buf); @@ -52,10 +57,15 @@ void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size, return (void *)buf; } -void __pci_free_consistent(struct pci_dev *hwdev, size_t size, +int dreamcast_consistent_free(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) { + if (dev && dev->bus != &pci_bus_type) + return -EINVAL; + /* XXX */ gapspci_dma_used = 0; + + return 0; } diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c index d07572bfc..cf30e2fa5 100644 --- a/arch/sh/drivers/pci/fixups-dreamcast.c +++ b/arch/sh/drivers/pci/fixups-dreamcast.c @@ -62,7 +62,7 @@ void __init pcibios_fixup_irqs(void) { struct pci_dev *dev = 0; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { /* * The interrupt routing semantics here are quite trivial. * diff --git a/arch/sh/drivers/pci/fixups-rts7751r2d.c b/arch/sh/drivers/pci/fixups-rts7751r2d.c index 7b5dbe157..0c590fc7a 100644 --- a/arch/sh/drivers/pci/fixups-rts7751r2d.c +++ b/arch/sh/drivers/pci/fixups-rts7751r2d.c @@ -18,15 +18,26 @@ int pci_fixup_pcic(void) { - unsigned long mcr; + unsigned long bcr1, mcr; - outl(0xfb900047, SH7751_PCICONF1); - outl(0xab000001, SH7751_PCICONF4); + bcr1 = inl(SH7751_BCR1); + bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ + outl(bcr1, PCI_REG(SH7751_PCIBCR1)); + + /* Enable all interrupts, so we known what to fix */ + outl(0x0000c3ff, PCI_REG(SH7751_PCIINTM)); + outl(0x0000380f, PCI_REG(SH7751_PCIAINTM)); + + outl(0xfb900047, PCI_REG(SH7751_PCICONF1)); + outl(0xab000001, PCI_REG(SH7751_PCICONF4)); mcr = inl(SH7751_MCR); mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; - outl(mcr, SH7751_PCIMCR); + outl(mcr, PCI_REG(SH7751_PCIMCR)); + outl(0x0c000000, PCI_REG(SH7751_PCICONF5)); + outl(0xd0000000, PCI_REG(SH7751_PCICONF6)); + outl(0x0c000000, PCI_REG(SH7751_PCILAR0)); + outl(0x00000000, PCI_REG(SH7751_PCILAR1)); return 0; } - diff --git a/arch/sh/drivers/pci/ops-rts7751r2d.c b/arch/sh/drivers/pci/ops-rts7751r2d.c index 2bceb43c9..beafa11f4 100644 --- a/arch/sh/drivers/pci/ops-rts7751r2d.c +++ b/arch/sh/drivers/pci/ops-rts7751r2d.c @@ -61,7 +61,12 @@ EXPORT_SYMBOL(board_pci_channels); static struct sh7751_pci_address_map sh7751_pci_map = { .window0 = { .base = SH7751_CS3_BASE_ADDR, - .size = 0x03f00000, + .size = 0x04000000, + }, + + .window1 = { + .base = 0x00000000, /* Unused */ + .size = 0x00000000, /* Unused */ }, .flags = SH7751_PCIC_NO_RESET, diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c index 2ad70d499..4cef4d1d8 100644 --- a/arch/sh/drivers/pci/pci-auto.c +++ b/arch/sh/drivers/pci/pci-auto.c @@ -524,8 +524,10 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus) PCI_COMMAND, cmdstat | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); +#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D) early_write_config_byte(hose, top_bus, current_bus, pci_devfn, PCI_LATENCY_TIMER, 0x80); +#endif /* Allocate PCI I/O and/or memory space */ pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_5); diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c index 1a5a883ad..6d4c9f2b3 100644 --- a/arch/sh/drivers/pci/pci-sh7751.c +++ b/arch/sh/drivers/pci/pci-sh7751.c @@ -33,6 +33,8 @@ static unsigned int pci_probe = PCI_PROBE_CONF1; extern int pci_fixup_pcic(void); +void pcibios_fixup_irqs(void) __attribute__ ((weak)); + /* * Direct access to PCI hardware... */ @@ -158,7 +160,6 @@ static int __init pci_check_direct(void) * Handle bus scanning and fixups .... */ -#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D) static void __init pci_fixup_ide_bases(struct pci_dev *d) { int i; @@ -256,7 +257,7 @@ int __init sh7751_pcic_init(struct sh7751_pci_address_map *map) outl(0, PCI_REG(SH7751_PCICLKR)); /* Clear Powerdown IRQ's (not done in reset) */ word = SH7751_PCIPINT_D3 | SH7751_PCIPINT_D0; - outl(word, PCI_REG(SH7751_PCICLKR)); + outl(word, PCI_REG(SH7751_PCIPINT)); /* * This code is unused for some boards as it is done in the @@ -361,7 +362,7 @@ int __init sh7751_pcic_init(struct sh7751_pci_address_map *map) * TODO: add support for the internal error interrupts and * DMA interrupts... */ - + #ifdef CONFIG_SH_RTS7751R2D pci_fixup_pcic(); #endif diff --git a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c index 4be02f627..2688f4159 100644 --- a/arch/sh/drivers/pci/pci-st40.c +++ b/arch/sh/drivers/pci/pci-st40.c @@ -18,6 +18,7 @@ #include #include #include +#include /* irqreturn_t */ #include "pci-st40.h" @@ -28,24 +29,22 @@ #define ST40PCI_REG_ADDRESS (ST40PCI_BASE_ADDRESS+0x07000000) #define ST40PCI_REG(x) (ST40PCI_REG_ADDRESS+(ST40PCI_##x)) +#define ST40PCI_REG_INDEXED(reg, index) \ + (ST40PCI_REG(reg##0) + \ + ((ST40PCI_REG(reg##1) - ST40PCI_REG(reg##0))*index)) #define ST40PCI_WRITE(reg,val) writel((val),ST40PCI_REG(reg)) #define ST40PCI_WRITE_SHORT(reg,val) writew((val),ST40PCI_REG(reg)) #define ST40PCI_WRITE_BYTE(reg,val) writeb((val),ST40PCI_REG(reg)) +#define ST40PCI_WRITE_INDEXED(reg, index, val) \ + writel((val), ST40PCI_REG_INDEXED(reg, index)); #define ST40PCI_READ(reg) readl(ST40PCI_REG(reg)) #define ST40PCI_READ_SHORT(reg) readw(ST40PCI_REG(reg)) #define ST40PCI_READ_BYTE(reg) readb(ST40PCI_REG(reg)) -#define ST40PCI_SERR_IRQ 64 -#define ST40PCI_SERR_INT_GROUP 0 -#define ST40PCI_SERR_INT_POS 0 -#define ST40PCI_SERR_INT_PRI 15 - -#define ST40PCI_ERR_IRQ 65 -#define ST40PCI_ERR_INT_GROUP 1 -#define ST40PCI_ERR_INT_POS 1 -#define ST40PCI_ERR_INT_PRI 14 +#define ST40PCI_SERR_IRQ 64 +#define ST40PCI_ERR_IRQ 65 /* Macros to extract PLL params */ @@ -69,47 +68,143 @@ #define PLL_25MHZ 0x793c8512 #define PLL_33MHZ PLL_SET(18,88,3,295) +static void pci_set_rbar_region(unsigned int region, unsigned long localAddr, + unsigned long pciOffset, unsigned long regionSize); + +/* + * The pcibios_map_platform_irq function is defined in the appropriate + * board specific code and referenced here + */ +extern int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin); static __init void SetPCIPLL(void) { - /* Stop the PLL */ - writel(0, PLLPCICR); + { + /* Lets play with the PLL values */ + unsigned long pll1cr1; + unsigned long mdiv, ndiv, pdiv; + unsigned long muxcr; + unsigned int muxcr_ratios[4] = { 8, 16, 21, 1 }; + unsigned int freq; + +#define CLKGENA 0xbb040000 +#define CLKGENA_PLL2_MUXCR CLKGENA + 0x48 + pll1cr1 = ctrl_inl(PLLPCICR); + printk("PLL1CR1 %08lx\n", pll1cr1); + mdiv = PLL_MDIV(pll1cr1); + ndiv = PLL_NDIV(pll1cr1); + pdiv = PLL_PDIV(pll1cr1); + printk("mdiv %02lx ndiv %02lx pdiv %02lx\n", mdiv, ndiv, pdiv); + freq = ((2*27*ndiv)/mdiv) / (1 << pdiv); + printk("PLL freq %dMHz\n", freq); + muxcr = ctrl_inl(CLKGENA_PLL2_MUXCR); + printk("PCI freq %dMhz\n", freq / muxcr_ratios[muxcr & 3]); + } +} - /* Always run at 33Mhz. The PCI clock is totally async - * to the rest of the system - */ - writel(PLL_33MHZ | PLLPCICR_POWERON, PLLPCICR); - printk("ST40PCI: Waiting for PCI PLL to lock\n"); - while ((readl(PLLPCICR) & PLLPCICR_LOCK) == 0); - writel(readl(PLLPCICR) | PLLPCICR_OUT_EN, PLLPCICR); +struct pci_err { + unsigned mask; + const char *error_string; +}; + +static struct pci_err int_error[]={ + { INT_MNLTDIM,"MNLTDIM: Master non-lock transfer"}, + { INT_TTADI, "TTADI: Illegal byte enable in I/O transfer"}, + { INT_TMTO, "TMTO: Target memory read/write timeout"}, + { INT_MDEI, "MDEI: Master function disable error"}, + { INT_APEDI, "APEDI: Address parity error"}, + { INT_SDI, "SDI: SERR detected"}, + { INT_DPEITW, "DPEITW: Data parity error target write"}, + { INT_PEDITR, "PEDITR: PERR detected"}, + { INT_TADIM, "TADIM: Target abort detected"}, + { INT_MADIM, "MADIM: Master abort detected"}, + { INT_MWPDI, "MWPDI: PERR from target at data write"}, + { INT_MRDPEI, "MRDPEI: Master read data parity error"} +}; +#define NUM_PCI_INT_ERRS (sizeof(int_error)/sizeof(struct pci_err)) + +static struct pci_err aint_error[]={ + { AINT_MBI, "MBI: Master broken"}, + { AINT_TBTOI, "TBTOI: Target bus timeout"}, + { AINT_MBTOI, "MBTOI: Master bus timeout"}, + { AINT_TAI, "TAI: Target abort"}, + { AINT_MAI, "MAI: Master abort"}, + { AINT_RDPEI, "RDPEI: Read data parity"}, + { AINT_WDPE, "WDPE: Write data parity"} +}; + +#define NUM_PCI_AINT_ERRS (sizeof(aint_error)/sizeof(struct pci_err)) + +static void print_pci_errors(unsigned reg,struct pci_err *error,int num_errors) +{ + int i; + + for(i=0;i1) return IRQ_HANDLED; + + printk("** PCI ERROR **\n"); - pci_int = ST40PCI_READ(INT); - pci_cir = ST40PCI_READ(CIR); - pci_air = ST40PCI_READ(AIR); + if(pci_int) { + printk("** INT register status\n"); + print_pci_errors(pci_int,int_error,NUM_PCI_INT_ERRS); + } - if (pci_int) { - printk("PCI INTERRUPT!\n"); - printk("PCI INT -> 0x%x\n", pci_int & 0xffff); - printk("PCI AIR -> 0x%x\n", pci_air); - printk("PCI CIR -> 0x%x\n", pci_cir); - ST40PCI_WRITE(INT, ~0); + if(pci_aint) { + printk("** AINT register status\n"); + print_pci_errors(pci_aint,aint_error,NUM_PCI_AINT_ERRS); } - pci_aint = ST40PCI_READ(AINT); - if (pci_aint) { - printk("PCI ARB INTERRUPT!\n"); - printk("PCI AINT -> 0x%x\n", pci_aint); - printk("PCI AIR -> 0x%x\n", pci_air); - printk("PCI CIR -> 0x%x\n", pci_cir); - ST40PCI_WRITE(AINT, ~0); + printk("** Address and command info\n"); + + printk("** Command %s : Address 0x%x\n", + pci_commands[pci_cir&0xf],pci_air); + + if(pci_cir&CIR_PIOTEM) { + printk("CIR_PIOTEM:PIO transfer error for master\n"); + } + if(pci_cir&CIR_RWTET) { + printk("CIR_RWTET:Read/Write transfer error for target\n"); } return IRQ_HANDLED; @@ -119,7 +214,7 @@ static irqreturn_t st40_pci_irq(int irq, void *dev_instance, struct pt_regs *reg /* Rounds a number UP to the nearest power of two. Used for * sizing the PCI window. */ -static u32 __init r2p2(u32 num) +static u32 r2p2(u32 num) { int i = 31; u32 tmp = num; @@ -179,12 +274,16 @@ int __init st40pci_init(unsigned memStart, unsigned memSize) /* Loop while core resets */ while (ST40PCI_READ(CR) & CR_SOFT_RESET); + /* Switch off interrupts */ + ST40PCI_WRITE(INTM, 0); + ST40PCI_WRITE(AINT, 0); + /* Now, lets reset all the cards on the bus with extreme prejudice */ ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_RSTCTL); udelay(250); /* Set bus active, take it out of reset */ - ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_CFINT | CR_PFCS | CR_PFE); + ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_BMAM | CR_CFINT | CR_PFCS | CR_PFE); /* The PCI spec says that no access must be made to the bus until 1 second * after reset. This seem ludicrously long, but some delay is needed here @@ -219,37 +318,20 @@ int __init st40pci_init(unsigned memStart, unsigned memSize) /* Set up the 64K window */ ST40PCI_WRITE(IOBMR, 0x0); - /* Now we set up the mbars so the PCI bus can see the memory of the machine */ + /* Now we set up the mbars so the PCI bus can see the local memory */ + /* Expose a 256M window starting at PCI address 0... */ + ST40PCI_WRITE(CSR_MBAR0, 0); + ST40PCI_WRITE(LSR0, 0x0fff0001); - if (memSize < (64 * 1024)) { - printk("Ridiculous memory size of 0x%x?\n",memSize); - return 0; - } - - lsr0 = - (memSize > - (512 * 1024 * 1024)) ? 0x1fff0001 : ((r2p2(memSize) - - 0x10000) | 0x1); - - ST40PCI_WRITE(LSR0, lsr0); - - ST40PCI_WRITE(CSR_MBAR0, memStart); - ST40PCI_WRITE(LAR0, memStart); + /* ... and set up the initial incomming window to expose all of RAM */ + pci_set_rbar_region(7, memStart, memStart, memSize); /* Maximise timeout values */ ST40PCI_WRITE_BYTE(CSR_TRDY, 0xff); ST40PCI_WRITE_BYTE(CSR_RETRY, 0xff); ST40PCI_WRITE_BYTE(CSR_MIT, 0xff); - - /* Install the pci interrupt handlers */ - make_intc2_irq(ST40PCI_SERR_IRQ, INTC2_BASE0, - ST40PCI_SERR_INT_GROUP, ST40PCI_SERR_INT_POS, - ST40PCI_SERR_INT_PRI); - - make_intc2_irq(ST40PCI_ERR_IRQ, INTC2_BASE0, ST40PCI_ERR_INT_GROUP, - ST40PCI_ERR_INT_POS, ST40PCI_ERR_INT_PRI); - + ST40PCI_WRITE_BYTE(PERF,PERF_MASTER_WRITE_POSTING); return 1; } @@ -332,7 +414,7 @@ static int st40pci_write(struct pci_bus *bus, unsigned int devfn, int where, int return PCIBIOS_SUCCESSFUL; } -static struct pci_ops pci_config_ops = { +struct pci_ops st40pci_config_ops = { .read = st40pci_read, .write = st40pci_write, }; @@ -348,36 +430,12 @@ static u8 __init no_swizzle(struct pci_dev *dev, u8 * pin) } -/* This needs to be shunted out of here into the board specific bit */ -#define HARP_PCI_IRQ 1 -#define HARP_BRIDGE_IRQ 2 -#define OVERDRIVE_SLOT0_IRQ 0 - -static int __init map_harp_irq(struct pci_dev *dev, u8 slot, u8 pin) -{ - switch (slot) { -#ifdef CONFIG_SH_STB1_HARP - case 2: /*This is the PCI slot on the */ - return HARP_PCI_IRQ; - case 1: /* this is the bridge */ - return HARP_BRIDGE_IRQ; -#elif defined(CONFIG_SH_STB1_OVERDRIVE) - case 1: - case 2: - case 3: - return slot - 1; -#else -#error Unknown board -#endif - default: - return -1; - } -} - -void __init pcibios_init(void) +static int __init pcibios_init(void) { extern unsigned long memory_start, memory_end; + printk(KERN_ALERT "pci-st40.c: pcibios_init\n"); + if (sh_mv.mv_init_pci != NULL) { sh_mv.mv_init_pci(); } @@ -392,7 +450,7 @@ void __init pcibios_init(void) if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, SA_INTERRUPT, "st40pci", NULL)) { printk(KERN_ERR "st40pci: Cannot hook interrupt\n"); - return; + return -EIO; } /* Enable the PCI interrupts on the device */ @@ -406,12 +464,46 @@ void __init pcibios_init(void) #endif /* ok, do the scan man */ - pci_root_bus = pci_scan_bus(0, &pci_config_ops, NULL); + pci_root_bus = pci_scan_bus(0, &st40pci_config_ops, NULL); pci_assign_unassigned_resources(); - pci_fixup_irqs(no_swizzle, map_harp_irq); + pci_fixup_irqs(no_swizzle, pcibios_map_platform_irq); + return 0; } +subsys_initcall(pcibios_init); + void __init pcibios_fixup_bus(struct pci_bus *bus) { } + +/* + * Publish a region of local address space over the PCI bus + * to other devices. + */ +static void pci_set_rbar_region(unsigned int region, unsigned long localAddr, + unsigned long pciOffset, unsigned long regionSize) +{ + unsigned long mask; + + if (region > 7) + return; + + if (regionSize > (512 * 1024 * 1024)) + return; + + mask = r2p2(regionSize) - 0x10000; + + /* Diable the region (in case currently in use, should never happen) */ + ST40PCI_WRITE_INDEXED(RSR, region, 0); + + /* Start of local address space to publish */ + ST40PCI_WRITE_INDEXED(RLAR, region, PHYSADDR(localAddr) ); + + /* Start of region in PCI address space as an offset from MBAR0 */ + ST40PCI_WRITE_INDEXED(RBAR, region, pciOffset); + + /* Size of region */ + ST40PCI_WRITE_INDEXED(RSR, region, mask | 1); +} + diff --git a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h index 2e3451a97..d729e0c2d 100644 --- a/arch/sh/drivers/pci/pci-st40.h +++ b/arch/sh/drivers/pci/pci-st40.h @@ -33,13 +33,36 @@ #define ST40PCI_LAR0 0x1c #define ST40PCI_INT 0x24 +#define INT_MNLTDIM (1<<15) +#define INT_TTADI (1<<14) +#define INT_TMTO (1<<9) +#define INT_MDEI (1<<8) +#define INT_APEDI (1<<7) +#define INT_SDI (1<<6) +#define INT_DPEITW (1<<5) +#define INT_PEDITR (1<<4) +#define INT_TADIM (1<<3) #define INT_MADIM (1<<2) +#define INT_MWPDI (1<<1) +#define INT_MRDPEI (1<<0) #define ST40PCI_INTM 0x28 #define ST40PCI_AIR 0x2c + #define ST40PCI_CIR 0x30 +#define CIR_PIOTEM (1<<31) +#define CIR_RWTET (1<<26) + #define ST40PCI_AINT 0x40 +#define AINT_MBI (1<<13) +#define AINT_TBTOI (1<<12) +#define AINT_MBTOI (1<<11) +#define AINT_TAI (1<<3) +#define AINT_MAI (1<<2) +#define AINT_RDPEI (1<<1) +#define AINT_WDPE (1<<0) + #define ST40PCI_AINTM 0x44 #define ST40PCI_BMIR 0x48 #define ST40PCI_PAR 0x4c @@ -51,6 +74,53 @@ #define ST40PCI_IOBMR 0x74 #define ST40PCI_PDR 0x78 +/* H8 specific registers start here */ +#define ST40PCI_WCBAR 0x7c +#define ST40PCI_LOCCFG_UNLOCK 0x34 + +#define ST40PCI_RBAR0 0x100 +#define ST40PCI_RSR0 0x104 +#define ST40PCI_RLAR0 0x108 + +#define ST40PCI_RBAR1 0x110 +#define ST40PCI_RSR1 0x114 +#define ST40PCI_RLAR1 0x118 + + +#define ST40PCI_RBAR2 0x120 +#define ST40PCI_RSR2 0x124 +#define ST40PCI_RLAR2 0x128 + +#define ST40PCI_RBAR3 0x130 +#define ST40PCI_RSR3 0x134 +#define ST40PCI_RLAR3 0x138 + +#define ST40PCI_RBAR4 0x140 +#define ST40PCI_RSR4 0x144 +#define ST40PCI_RLAR4 0x148 + +#define ST40PCI_RBAR5 0x150 +#define ST40PCI_RSR5 0x154 +#define ST40PCI_RLAR5 0x158 + +#define ST40PCI_RBAR6 0x160 +#define ST40PCI_RSR6 0x164 +#define ST40PCI_RLAR6 0x168 + +#define ST40PCI_RBAR7 0x170 +#define ST40PCI_RSR7 0x174 +#define ST40PCI_RLAR7 0x178 + + +#define ST40PCI_RBAR(n) (0x100+(0x10*(n))) +#define ST40PCI_RSR(n) (0x104+(0x10*(n))) +#define ST40PCI_RLAR(n) (0x108+(0x10*(n))) + +#define ST40PCI_PERF 0x80 +#define PERF_MASTER_WRITE_POSTING (1<<4) +/* H8 specific registers end here */ + + /* These are configs space registers */ #define ST40PCI_CSR_VID 0x10000 #define ST40PCI_CSR_DID 0x10002 diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 4bf35336d..363bc839b 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -106,6 +106,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) pci_read_config_word(dev, PCI_COMMAND, &cmd); old_cmd = cmd; for(idx=0; idx<6; idx++) { + if (!(mask & (1 << idx))) + continue; r = &dev->resource[idx]; if (!r->start && r->end) { printk(KERN_ERR "PCI: Device %s not available because " diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index 975103f34..cf94e8ef1 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c @@ -24,8 +24,8 @@ extern void detect_cpu_and_cache_system(void); * Generic wrapper for command line arguments to disable on-chip * peripherals (nofpu, nodsp, and so forth). */ -#define onchip_setup(x) \ -static int x##_disabled __initdata = 0; \ +#define onchip_setup(x) \ +static int x##_disabled __initdata = 0; \ \ static int __init x##_setup(char *opts) \ { \ @@ -88,7 +88,7 @@ static void __init cache_init(void) } while (--ways); } - /* + /* * Default CCR values .. enable the caches * and invalidate them immediately.. */ @@ -160,7 +160,7 @@ static void __init dsp_init(void) } #endif /* CONFIG_SH_DSP */ -/* +/** * sh_cpu_init * * This is our initial entry point for each CPU, and is invoked on the boot @@ -194,13 +194,13 @@ asmlinkage void __init sh_cpu_init(void) /* FPU initialization */ if ((cpu_data->flags & CPU_HAS_FPU)) { clear_thread_flag(TIF_USEDFPU); - current->used_math = 0; + clear_used_math(); } #ifdef CONFIG_SH_DSP /* Probe for DSP */ dsp_init(); - + /* Disable the DSP */ if (dsp_disabled) { printk("DSP Disabled\n"); diff --git a/arch/sh/kernel/cpu/irq_imask.c b/arch/sh/kernel/cpu/irq_imask.c index be2c82385..f76901e73 100644 --- a/arch/sh/kernel/cpu/irq_imask.c +++ b/arch/sh/kernel/cpu/irq_imask.c @@ -18,10 +18,10 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/arch/sh/kernel/cpu/irq_ipr.c b/arch/sh/kernel/cpu/irq_ipr.c index daae02e6b..7ea3d2d03 100644 --- a/arch/sh/kernel/cpu/irq_ipr.c +++ b/arch/sh/kernel/cpu/irq_ipr.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -41,7 +42,7 @@ static void mask_and_ack_ipr(unsigned int); static void end_ipr_irq(unsigned int irq); static unsigned int startup_ipr_irq(unsigned int irq) -{ +{ enable_ipr_irq(irq); return 0; /* never anything pending */ } @@ -281,6 +282,10 @@ void __init init_IRQ(void) #endif /* !CONFIG_CPU_SUBTYPE_SH7300 */ #endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 || CONFIG_CPU_SUBTYPE_SH7300*/ +#ifdef CONFIG_CPU_SUBTYPE_ST40 + init_IRQ_intc2(); +#endif + /* Perform the machine specific initialisation */ if (sh_mv.mv_init_irq != NULL) { sh_mv.mv_init_irq(); @@ -329,3 +334,6 @@ int ipr_irq_demux(int irq) return irq; } #endif + +EXPORT_SYMBOL(make_ipr_irq); + diff --git a/arch/sh/kernel/cpu/sh2/Makefile b/arch/sh/kernel/cpu/sh2/Makefile index eb38f91d1..389353fba 100644 --- a/arch/sh/kernel/cpu/sh2/Makefile +++ b/arch/sh/kernel/cpu/sh2/Makefile @@ -2,3 +2,5 @@ # Makefile for the Linux/SuperH SH-2 backends. # +obj-y := probe.o + diff --git a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile index 196c5f07e..a64532e4d 100644 --- a/arch/sh/kernel/cpu/sh3/Makefile +++ b/arch/sh/kernel/cpu/sh3/Makefile @@ -2,5 +2,5 @@ # Makefile for the Linux/SuperH SH-3 backends. # -obj-y := ex.o +obj-y := ex.o probe.o diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile index fd5976143..ead1071ea 100644 --- a/arch/sh/kernel/cpu/sh4/Makefile +++ b/arch/sh/kernel/cpu/sh4/Makefile @@ -2,8 +2,9 @@ # Makefile for the Linux/SuperH SH-4 backends. # -obj-y := fpu.o ex.o +obj-y := ex.o probe.o +obj-$(CONFIG_SH_FPU) += fpu.o obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += irq_intc2.o obj-$(CONFIG_SH_STORE_QUEUES) += sq.o diff --git a/arch/sh/kernel/cpu/sh4/ex.S b/arch/sh/kernel/cpu/sh4/ex.S index 2cc32adfe..8221e9d15 100644 --- a/arch/sh/kernel/cpu/sh4/ex.S +++ b/arch/sh/kernel/cpu/sh4/ex.S @@ -37,8 +37,11 @@ ENTRY(exception_handling_table) .long exception_error ! address error load .long exception_error ! address error store /* 100 */ #endif - +#if defined(CONFIG_SH_FPU) .long do_fpu_error /* 120 */ +#else + .long exception_error /* 120 */ +#endif .long exception_error /* 140 */ .long system_call ! Unconditional Trap /* 160 */ .long exception_error ! reserved_instruction (filled by trap_init) /* 180 */ @@ -126,8 +129,13 @@ ENTRY(interrupt_table) .long exception_error ! 46 .long exception_error ! 47 #endif +#if defined(CONFIG_SH_FPU) .long do_fpu_state_restore ! 48 /* 800 */ .long do_fpu_state_restore ! 49 /* 820 */ +#else + .long exception_error + .long exception_error +#endif #if defined(CONFIG_CPU_SUBTYPE_SH7751) .long exception_error /* 840 */ .long exception_error @@ -217,6 +225,66 @@ ENTRY(interrupt_table) .long exception_error .long do_IRQ ! ADC adi .long do_IRQ ! CMT cmti /* FA0 */ +#elif defined(CONFIG_CPU_SUBTYPE_SH73180) + .long do_IRQ ! 50 0x840 + .long do_IRQ ! 51 0x860 + .long do_IRQ ! 52 0x880 + .long do_IRQ ! 53 0x8a0 + .long do_IRQ ! 54 0x8c0 + .long do_IRQ ! 55 0x8e0 + .long do_IRQ ! 56 0x900 + .long do_IRQ ! 57 0x920 + .long do_IRQ ! 58 0x940 + .long do_IRQ ! 59 0x960 + .long do_IRQ ! 60 0x980 + .long do_IRQ ! 61 0x9a0 + .long do_IRQ ! 62 0x9c0 + .long do_IRQ ! 63 0x9e0 + .long do_IRQ ! 64 0xa00 + .long do_IRQ ! 65 0xa20 + .long do_IRQ ! 66 0xa40 + .long do_IRQ ! 67 0xa60 + .long do_IRQ ! 68 0xa80 + .long do_IRQ ! 69 0xaa0 + .long do_IRQ ! 70 0xac0 + .long do_IRQ ! 71 0xae0 + .long do_IRQ ! 72 0xb00 + .long do_IRQ ! 73 0xb20 + .long do_IRQ ! 74 0xb40 + .long do_IRQ ! 75 0xb60 + .long do_IRQ ! 76 0xb80 + .long do_IRQ ! 77 0xba0 + .long do_IRQ ! 78 0xbc0 + .long do_IRQ ! 79 0xbe0 + .long do_IRQ ! 80 0xc00 + .long do_IRQ ! 81 0xc20 + .long do_IRQ ! 82 0xc40 + .long do_IRQ ! 83 0xc60 + .long do_IRQ ! 84 0xc80 + .long do_IRQ ! 85 0xca0 + .long do_IRQ ! 86 0xcc0 + .long do_IRQ ! 87 0xce0 + .long do_IRQ ! 88 0xd00 + .long do_IRQ ! 89 0xd20 + .long do_IRQ ! 90 0xd40 + .long do_IRQ ! 91 0xd60 + .long do_IRQ ! 92 0xd80 + .long do_IRQ ! 93 0xda0 + .long do_IRQ ! 94 0xdc0 + .long do_IRQ ! 95 0xde0 + .long do_IRQ ! 96 0xe00 + .long do_IRQ ! 97 0xe20 + .long do_IRQ ! 98 0xe40 + .long do_IRQ ! 99 0xe60 + .long do_IRQ ! 100 0xe80 + .long do_IRQ ! 101 0xea0 + .long do_IRQ ! 102 0xec0 + .long do_IRQ ! 103 0xee0 + .long do_IRQ ! 104 0xf00 + .long do_IRQ ! 105 0xf20 + .long do_IRQ ! 106 0xf40 + .long do_IRQ ! 107 0xf60 + .long do_IRQ ! 108 0xf80 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) .long exception_error ! 50 0x840 .long exception_error ! 51 0x860 diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index fccc85eaf..f486c07e1 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c @@ -323,13 +323,13 @@ do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6, return; } - if (tsk->used_math) { + if (used_math()) { /* Using the FPU again. */ restore_fpu(tsk); } else { /* First time FPU user. */ fpu_init(); - tsk->used_math = 1; + set_used_math(); } set_tsk_thread_flag(tsk, TIF_USEDFPU); } diff --git a/arch/sh/kernel/cpu/sh4/irq_intc2.c b/arch/sh/kernel/cpu/sh4/irq_intc2.c index ec99f4cc4..099ebbf89 100644 --- a/arch/sh/kernel/cpu/sh4/irq_intc2.c +++ b/arch/sh/kernel/cpu/sh4/irq_intc2.c @@ -22,8 +22,11 @@ struct intc2_data { - unsigned int addr; /* Address of Interrupt Priority Register */ - int mask; /*Mask to apply */ + unsigned char msk_offset; + unsigned char msk_shift; +#ifdef CONFIG_CPU_SUBTYPE_ST40 + int (*clear_irq) (int); +#endif }; @@ -56,33 +59,34 @@ static struct hw_interrupt_type intc2_irq_type = { static void disable_intc2_irq(unsigned int irq) { - unsigned addr; - int offset=irq-INTC2_FIRST_IRQ; - unsigned val,flags; + int irq_offset = irq - INTC2_FIRST_IRQ; + int msk_shift, msk_offset; // Sanity check - if(offset<0 || offset>=NR_INTC2_IRQS) return; - - addr=intc2_data[offset].addr+INTC2_INTMSK_OFFSET; + if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS)) + return; - local_irq_save(flags); - val=ctrl_inl(addr); - val|=intc2_data[offset].mask; - ctrl_outl(val,addr); + msk_shift = intc2_data[irq_offset].msk_shift; + msk_offset = intc2_data[irq_offset].msk_offset; - local_irq_restore(flags); + ctrl_outl(1<=NR_INTC2_IRQS) return; + /* Sanity check */ + if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS)) + return; - ctrl_outl(intc2_data[offset].mask, - intc2_data[offset].addr+INTC2_INTMSKCLR_OFFSET); + msk_shift = intc2_data[irq_offset].msk_shift; + msk_offset = intc2_data[irq_offset].msk_offset; + ctrl_outl(1<=NR_INTC2_IRQS) { + if((irq_offset<0) || (irq_offset>=NR_INTC2_IRQS)) return; - } disable_irq_nosync(irq); + /* Fill the data we need */ - intc2_data[offset].addr=addr; - intc2_data[offset].mask=1<irq, p->ipr_offset, p->ipr_shift, + p-> msk_offset, p->msk_shift, 13); + } +} + +/* Adds a termination callback to the interrupt */ +void intc2_add_clear_irq(int irq, int (*fn)(int)) +{ + if (irq < INTC2_FIRST_IRQ) + return; + + intc2_data[irq - INTC2_FIRST_IRQ].clear_irq = fn; +} +#endif /* CONFIG_CPU_SUBTYPE_ST40 */ diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index 3dfe1741d..8ab1855ff 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -32,11 +32,10 @@ #include static LIST_HEAD(sq_mapping_list); -static spinlock_t sq_mapping_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sq_mapping_lock); /** * sq_flush - Flush (prefetch) the store queue cache - * * @addr: the store queue address to flush * * Executes a prefetch instruction on the specified store queue cache, @@ -49,7 +48,6 @@ inline void sq_flush(void *addr) /** * sq_flush_range - Flush (prefetch) a specific SQ range - * * @start: the store queue address to start flushing from * @len: the length to flush * @@ -99,7 +97,7 @@ static unsigned long __sq_get_next_addr(void) { if (!list_empty(&sq_mapping_list)) { struct list_head *pos, *tmp; - + /* * Read one off the list head, as it will have the highest * mapped allocation. Set the next one up right above it. @@ -126,11 +124,10 @@ static unsigned long __sq_get_next_addr(void) /** * __sq_remap - Perform a translation from the SQ to a phys addr + * @map: sq mapping containing phys and store queue addresses. * - * @phys: Physical address to map store queues too. - * @virt: Associated store queue address. - * - * Maps the store queue address @virt to the physical address @phys. + * Maps the store queue address specified in the mapping to the physical + * address specified in the mapping. */ static struct sq_mapping *__sq_remap(struct sq_mapping *map) { @@ -210,7 +207,6 @@ static struct sq_mapping *__sq_remap(struct sq_mapping *map) /** * sq_remap - Map a physical address through the Store Queues - * * @phys: Physical address of mapping. * @size: Length of mapping. * @name: User invoking mapping. @@ -254,7 +250,6 @@ struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *n /** * sq_unmap - Unmap a Store Queue allocation - * * @map: Pre-allocated Store Queue mapping. * * Unmaps the store queue allocation @map that was previously created by @@ -272,7 +267,6 @@ void sq_unmap(struct sq_mapping *map) /** * sq_clear - Clear a store queue range - * * @addr: Address to start clearing from. * @len: Length to clear. * @@ -282,7 +276,7 @@ void sq_unmap(struct sq_mapping *map) void sq_clear(unsigned long addr, unsigned int len) { int i; - + /* Clear out both queues linearly */ for (i = 0; i < 8; i++) { ctrl_outl(0, addr + i + 0); @@ -294,7 +288,6 @@ void sq_clear(unsigned long addr, unsigned int len) /** * sq_vma_unmap - Unmap a VMA range - * * @area: VMA containing range. * @addr: Start of range. * @len: Length of range. @@ -314,25 +307,24 @@ static void sq_vma_unmap(struct vm_area_struct *area, entry = list_entry(pos, typeof(*entry), list); if (entry->sq_addr == addr) { - /* + /* * We could probably get away without doing the tlb flush * here, as generic code should take care of most of this * when unmapping the rest of the VMA range for us. Leave * it in for added sanity for the time being.. */ __flush_tlb_page(get_asid(), entry->sq_addr & PAGE_MASK); - + list_del(&entry->list); kfree(entry); return; - } + } } } /** * sq_vma_sync - Sync a VMA range - * * @area: VMA containing range. * @start: Start of range. * @len: Length of range. @@ -359,7 +351,6 @@ static struct vm_operations_struct sq_vma_ops = { /** * sq_mmap - mmap() for /dev/cpu/sq - * * @file: unused. * @vma: VMA to remap. * @@ -373,7 +364,7 @@ static int sq_mmap(struct file *file, struct vm_area_struct *vma) unsigned long size = vma->vm_end - vma->vm_start; struct sq_mapping *map; - /* + /* * We're not interested in any arbitrary virtual address that has * been stuck in the VMA, as we already know what addresses we * want. Save off the size, and reposition the VMA to begin at @@ -391,7 +382,7 @@ static int sq_mmap(struct file *file, struct vm_area_struct *vma) if (io_remap_page_range(vma, map->sq_addr, map->addr, size, vma->vm_page_prot)) return -EAGAIN; - + vma->vm_ops = &sq_vma_ops; return 0; @@ -406,7 +397,7 @@ static int sq_mapping_read_proc(char *buf, char **start, off_t off, list_for_each_prev(pos, &sq_mapping_list) { struct sq_mapping *entry; - + entry = list_entry(pos, typeof(*entry), list); p += sprintf(p, "%08lx-%08lx [%08lx]: %s\n", entry->sq_addr, diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c index 8c2769c0d..1378db375 100644 --- a/arch/sh/kernel/early_printk.c +++ b/arch/sh/kernel/early_printk.c @@ -3,6 +3,7 @@ * * Copyright (C) 1999, 2000 Niibe Yutaka * Copyright (C) 2002 M. R. Brown + * 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 @@ -109,7 +110,8 @@ void scif_sercon_init(int baud) ctrl_outw(0, SCIF_REG); /* Set baud rate */ - ctrl_outb((50000000 / (32 * baud)) - 1, SCIF_REG + 4); + ctrl_outb((CONFIG_SH_PCLK_FREQ + 16 * baud) / + (32 * baud) - 1, SCIF_REG + 4); ctrl_outw(12, SCIF_REG + 24); ctrl_outw(8, SCIF_REG + 24); diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index 05dcc2e01..6615e4838 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -1139,5 +1140,10 @@ ENTRY(sys_call_table) .long sys_mq_timedreceive /* 280 */ .long sys_mq_notify .long sys_mq_getsetattr + .long sys_ni_syscall /* Reserved for kexec */ + .long sys_waitid + .long sys_add_key /* 285 */ + .long sys_request_key + .long sys_keyctl /* End of entry.S */ diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 73ec3365d..9a7d93626 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -31,10 +31,10 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index c9a43c8df..3d024590c 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -68,7 +68,7 @@ void default_idle(void) } } -void cpu_idle(void *unused) +void cpu_idle(void) { default_idle(); } @@ -199,7 +199,7 @@ void exit_thread(void) void flush_thread(void) { -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_SH_FPU) struct task_struct *tsk = current; struct pt_regs *regs = (struct pt_regs *) ((unsigned long)tsk->thread_info @@ -208,7 +208,7 @@ void flush_thread(void) /* Forget lazy FPU state */ clear_fpu(tsk, regs); - tsk->used_math = 0; + clear_used_math(); #endif } @@ -222,10 +222,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) { int fpvalid = 0; -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_SH_FPU) struct task_struct *tsk = current; - fpvalid = tsk->used_math; + fpvalid = !!tsk_used_math(tsk); if (fpvalid) { unlazy_fpu(tsk, regs); memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); @@ -259,8 +259,8 @@ dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *fpu) { int fpvalid = 0; -#if defined(CONFIG_CPU_SH4) - fpvalid = tsk->used_math; +#if defined(CONFIG_SH_FPU) + fpvalid = !!tsk_used_math(tsk); if (fpvalid) { struct pt_regs *regs = (struct pt_regs *) ((unsigned long)tsk->thread_info @@ -281,12 +281,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, struct task_struct *p, struct pt_regs *regs) { struct pt_regs *childregs; -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_SH_FPU) struct task_struct *tsk = current; unlazy_fpu(tsk, regs); p->thread.fpu = tsk->thread.fpu; - p->used_math = tsk->used_math; + copy_to_stopped_child_used_math(p); #endif childregs = ((struct pt_regs *) @@ -306,7 +306,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, childregs->gbr = childregs->regs[0]; } childregs->regs[0] = 0; /* Set return value for child */ - p->set_child_tid = p->clear_child_tid = NULL; p->thread.sp = (unsigned long) childregs; p->thread.pc = (unsigned long) ret_from_fork; @@ -363,7 +362,7 @@ ubc_set_tracing(int asid, unsigned long pc) */ struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next) { -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_SH_FPU) struct pt_regs *regs = (struct pt_regs *) ((unsigned long)prev->thread_info + THREAD_SIZE - sizeof(struct pt_regs) @@ -481,8 +480,11 @@ asmlinkage int sys_execve(char *ufilename, char **uargv, (char __user * __user *)uargv, (char __user * __user *)uenvp, ®s); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: return error; diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index bfdfa7489..bdb3c4e04 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c @@ -152,7 +152,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) tmp = get_stack_long(child, addr); else if (addr >= (long) &dummy->fpu && addr < (long) &dummy->u_fpvalid) { - if (!child->used_math) { + if (!tsk_used_math(child)) { if (addr == (long)&dummy->fpu.fpscr) tmp = FPSCR_INIT; else @@ -161,7 +161,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) tmp = ((long *)&child->thread.fpu) [(addr - (long)&dummy->fpu) >> 2]; } else if (addr == (long) &dummy->u_fpvalid) - tmp = child->used_math; + tmp = !!tsk_used_math(child); else tmp = 0; ret = put_user(tmp, (unsigned long *)data); @@ -187,12 +187,12 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ret = put_stack_long(child, addr, data); else if (addr >= (long) &dummy->fpu && addr < (long) &dummy->u_fpvalid) { - child->used_math = 1; + set_stopped_child_used_math(child); ((long *)&child->thread.fpu) [(addr - (long)&dummy->fpu) >> 2] = data; ret = 0; } else if (addr == (long) &dummy->u_fpvalid) { - child->used_math = data?1:0; + conditional_stopped_child_used_math(data, child); ret = 0; } break; @@ -219,7 +219,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index ca2105907..16694472e 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -443,6 +443,7 @@ static const char *cpu_name[] = { [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", [CPU_SH7760] = "SH7760", + [CPU_SH73180] = "SH73180", [CPU_ST40RA] = "ST40RA", [CPU_ST40GX1] = "ST40GX1", [CPU_SH4_202] = "SH4-202", @@ -457,7 +458,7 @@ const char *get_cpu_subtype(void) #ifdef CONFIG_PROC_FS static const char *cpu_flags[] = { - "none", "fpu", "p2flush", "mmuassoc", "dsp", + "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", }; static void show_cpuflags(struct seq_file *m) diff --git a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c index 9d176936c..5b53e10bb 100644 --- a/arch/sh/kernel/sh_bios.c +++ b/arch/sh/kernel/sh_bios.c @@ -1,5 +1,4 @@ -/* $Id: sh_bios.c,v 1.2 2003/05/04 19:29:53 lethal Exp $ - * +/* * linux/arch/sh/kernel/sh_bios.c * C interface for trapping into the standard LinuxSH BIOS. * diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c index 5e5cdd7f2..4f371f647 100644 --- a/arch/sh/kernel/sh_ksyms.c +++ b/arch/sh/kernel/sh_ksyms.c @@ -19,6 +19,7 @@ #include #include #include +#include extern void dump_thread(struct pt_regs *, struct user *); extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); @@ -86,6 +87,8 @@ EXPORT_SYMBOL(__udelay); EXPORT_SYMBOL(__ndelay); EXPORT_SYMBOL(__const_udelay); +EXPORT_SYMBOL(__div64_32); + #define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL(name) /* These symbols are generated by the compiler itself */ @@ -97,8 +100,9 @@ DECLARE_EXPORT(__ashldi3); DECLARE_EXPORT(__lshrdi3); DECLARE_EXPORT(__movstr); +EXPORT_SYMBOL(strcpy); + #ifdef CONFIG_CPU_SH4 - DECLARE_EXPORT(__movstr_i4_even); DECLARE_EXPORT(__movstr_i4_odd); DECLARE_EXPORT(__movstrSI12_i4); @@ -109,6 +113,14 @@ EXPORT_SYMBOL(flush_cache_range); EXPORT_SYMBOL(flush_dcache_page); EXPORT_SYMBOL(__flush_purge_region); #endif + +#if defined(CONFIG_SH7705_CACHE_32KB) +EXPORT_SYMBOL(flush_cache_all); +EXPORT_SYMBOL(flush_cache_range); +EXPORT_SYMBOL(flush_dcache_page); +EXPORT_SYMBOL(__flush_purge_region); +#endif + EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(__down_trylock); @@ -117,4 +129,6 @@ EXPORT_SYMBOL(synchronize_irq); #endif EXPORT_SYMBOL(csum_partial); +EXPORT_SYMBOL(csum_ipv6_magic); EXPORT_SYMBOL(consistent_sync); +EXPORT_SYMBOL(clear_page); diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index fc5ef9960..22e150187 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.20 2004/01/13 05:52:11 kkojima Exp $ +/* $Id: signal.c,v 1.21 2004/06/28 13:18:44 doyu Exp $ * * linux/arch/sh/kernel/signal.c * @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -155,7 +154,7 @@ struct rt_sigframe u16 retcode[8]; }; -#ifdef CONFIG_CPU_SH4 +#ifdef CONFIG_SH_FPU static inline int restore_sigcontext_fpu(struct sigcontext __user *sc) { struct task_struct *tsk = current; @@ -163,7 +162,7 @@ static inline int restore_sigcontext_fpu(struct sigcontext __user *sc) if (!(cpu_data->flags & CPU_HAS_FPU)) return 0; - tsk->used_math = 1; + set_used_math(); return __copy_from_user(&tsk->thread.fpu.hard, &sc->sc_fpregs[0], sizeof(long)*(16*2+2)); } @@ -176,7 +175,7 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc, if (!(cpu_data->flags & CPU_HAS_FPU)) return 0; - if (!tsk->used_math) { + if (!used_math()) { __put_user(0, &sc->sc_ownedfp); return 0; } @@ -186,13 +185,13 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc, /* This will cause a "finit" to be triggered by the next attempted FPU operation by the 'current' process. */ - tsk->used_math = 0; + clear_used_math(); unlazy_fpu(tsk, regs); return __copy_to_user(&sc->sc_fpregs[0], &tsk->thread.fpu.hard, sizeof(long)*(16*2+2)); } -#endif /* CONFIG_CPU_SH4 */ +#endif /* CONFIG_SH_FPU */ static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p) @@ -213,14 +212,14 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p COPY(sr); COPY(pc); #undef COPY -#ifdef CONFIG_CPU_SH4 +#ifdef CONFIG_SH_FPU if (cpu_data->flags & CPU_HAS_FPU) { int owned_fp; struct task_struct *tsk = current; regs->sr |= SR_FD; /* Release FPU */ clear_fpu(tsk, regs); - tsk->used_math = 0; + clear_used_math(); __get_user (owned_fp, &sc->sc_ownedfp); if (owned_fp) err |= restore_sigcontext_fpu(sc); @@ -326,7 +325,7 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, COPY(sr); COPY(pc); #undef COPY -#ifdef CONFIG_CPU_SH4 +#ifdef CONFIG_SH_FPU err |= save_sigcontext_fpu(sc, regs); #endif @@ -493,14 +492,12 @@ give_sigsegv: /* * OK, we're invoking a handler - */ + */ static void -handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, - struct pt_regs * regs) +handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, + sigset_t *oldset, struct pt_regs *regs) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - /* Are we from a system call? */ if (regs->tra >= 0) { /* If so, check system call restarting.. */ @@ -570,6 +567,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) { siginfo_t info; int signr; + struct k_sigaction ka; /* * We want the common case to go fast, which @@ -580,18 +578,16 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) if (!user_mode(regs)) return 1; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs, NULL); + signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ - handle_signal(signr, &info, oldset, regs); + handle_signal(signr, &ka, &info, oldset, regs); return 1; } diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 6ff83edf8..ec6d54f05 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c @@ -37,7 +37,6 @@ int smp_threads_ready = 0; struct sh_cpuinfo cpu_data[NR_CPUS]; -extern int cpu_idle(void *unused); extern void per_cpu_trap_init(void); cpumask_t cpu_possible_map; @@ -124,7 +123,8 @@ int start_secondary(void *unused) atomic_inc(&cpus_booted); - return cpu_idle(0); + cpu_idle(); + return 0; } void __init smp_cpus_done(unsigned int max_cpus) diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 75ed2b870..c417c8479 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -1,6 +1,5 @@ -/* $Id: time.c,v 1.21 2004/04/21 00:09:15 lethal Exp $ - * - * linux/arch/sh/kernel/time.c +/* + * arch/sh/kernel/time.c * * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka * Copyright (C) 2000 Philipp Rumpf @@ -84,7 +83,7 @@ extern unsigned long wall_jiffies; #define TICK_SIZE (tick_nsec / 1000) -spinlock_t tmu0_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(tmu0_lock); u64 jiffies_64 = INITIAL_JIFFIES; @@ -96,8 +95,8 @@ EXPORT_SYMBOL(jiffies_64); void (*rtc_get_time)(struct timespec *) = sh_rtc_gettimeofday; int (*rtc_set_time)(const time_t) = sh_rtc_settimeofday; #else -void (*rtc_get_time)(struct timespec *) = 0; -int (*rtc_set_time)(const time_t) = 0; +void (*rtc_get_time)(struct timespec *); +int (*rtc_set_time)(const time_t); #endif #if defined(CONFIG_CPU_SUBTYPE_SH7300) @@ -113,12 +112,21 @@ static int ifc_values[] = { 0, 1, 4, 2, 0, 0, 0, 0 }; static int pfc_divisors[] = { 1, 2, 3, 4, 6, 1, 1, 1 }; static int pfc_values[] = { 0, 1, 4, 2, 5, 0, 0, 0 }; #elif defined(CONFIG_CPU_SH4) +#if defined(CONFIG_CPU_SUBTYPE_SH73180) +static int ifc_divisors[] = { 1, 2, 3, 4, 6, 8, 12, 16 }; +static int ifc_values[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; +#define bfc_divisors ifc_divisors /* Same */ +#define bfc_values ifc_values +#define pfc_divisors ifc_divisors /* Same */ +#define pfc_values ifc_values +#else static int ifc_divisors[] = { 1, 2, 3, 4, 6, 8, 1, 1 }; static int ifc_values[] = { 0, 1, 2, 3, 0, 4, 0, 5 }; #define bfc_divisors ifc_divisors /* Same */ #define bfc_values ifc_values static int pfc_divisors[] = { 2, 3, 4, 6, 8, 2, 2, 2 }; static int pfc_values[] = { 0, 0, 1, 2, 0, 3, 0, 4 }; +#endif #else #error "Unknown ifc/bfc/pfc/stc values for this processor" #endif @@ -140,7 +148,7 @@ static unsigned long do_gettimeoffset(void) static unsigned long jiffies_p = 0; /* - * cache volatile jiffies temporarily; we have IRQs turned off. + * cache volatile jiffies temporarily; we have IRQs turned off. */ unsigned long jiffies_t; @@ -148,7 +156,7 @@ static unsigned long do_gettimeoffset(void) /* timer count may underflow right here */ count = ctrl_inl(TMU0_TCNT); /* read the latched count */ - jiffies_t = jiffies; + jiffies_t = jiffies; /* * avoiding timer inconsistencies (they are rare, but they happen)... @@ -162,7 +170,7 @@ static unsigned long do_gettimeoffset(void) if(ctrl_inw(TMU0_TCR) & 0x100) { /* Check UNF bit */ /* - * We cannot detect lost timer interrupts ... + * We cannot detect lost timer interrupts ... * well, that's why we call them lost, don't we? :) * [hmm, on the Pentium and Alpha we can ... sort of] */ @@ -192,7 +200,7 @@ void do_gettimeofday(struct timeval *tv) do { seq = read_seqbegin(&xtime_lock); usec = do_gettimeoffset(); - + lost = jiffies - wall_jiffies; if (lost) usec += lost * (1000000 / HZ); @@ -258,6 +266,9 @@ static long last_rtc_update; static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT @@ -363,8 +374,8 @@ static unsigned int __init get_timer_frequency(void) return freq * factor; } -void (*board_time_init)(void) = 0; -void (*board_timer_setup)(struct irqaction *irq) = 0; +void (*board_time_init)(void); +void (*board_timer_setup)(struct irqaction *irq); static unsigned int sh_pclk_freq __initdata = CONFIG_SH_PCLK_FREQ; @@ -408,10 +419,16 @@ void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsign *pfc = pfc_divisors[tmp]; #endif #elif defined(CONFIG_CPU_SH4) +#if defined(CONFIG_CPU_SUBTYPE_SH73180) + *ifc = ifc_divisors[(frqcr>> 20) & 0x0007]; + *bfc = bfc_divisors[(frqcr>> 12) & 0x0007]; + *pfc = pfc_divisors[frqcr & 0x0007]; +#else *ifc = ifc_divisors[(frqcr >> 6) & 0x0007]; *bfc = bfc_divisors[(frqcr >> 3) & 0x0007]; *pfc = pfc_divisors[frqcr & 0x0007]; #endif +#endif } /* @@ -419,7 +436,7 @@ void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsign * the divisors and the physical values. */ #define _FREQ_TABLE(x) \ - unsigned int get_##x##_divisor(unsigned int value) \ + unsigned int get_##x##_divisor(unsigned int value) \ { return x##_divisors[value]; } \ \ unsigned int get_##x##_value(unsigned int divisor) \ @@ -431,109 +448,120 @@ _FREQ_TABLE(pfc); #ifdef CONFIG_CPU_SUBTYPE_ST40STB1 -/* The ST40 divisors are totally different so we set the cpu data -** clocks using a different algorithm -** -** I've just plugged this from the 2.4 code - Alex Bennee -*/ +/* + * The ST40 divisors are totally different so we set the cpu data + * clocks using a different algorithm + * + * I've just plugged this from the 2.4 code + * - Alex Bennee + */ #define CCN_PVR_CHIP_SHIFT 24 #define CCN_PVR_CHIP_MASK 0xff #define CCN_PVR_CHIP_ST40STB1 0x4 struct frqcr_data { - unsigned short frqcr; - struct { - unsigned char multiplier; - unsigned char divisor; - } factor[3]; + unsigned short frqcr; + + struct { + unsigned char multiplier; + unsigned char divisor; + } factor[3]; }; static struct frqcr_data st40_frqcr_table[] = { - { 0x000, {{1,1}, {1,1}, {1,2}}}, - { 0x002, {{1,1}, {1,1}, {1,4}}}, - { 0x004, {{1,1}, {1,1}, {1,8}}}, - { 0x008, {{1,1}, {1,2}, {1,2}}}, - { 0x00A, {{1,1}, {1,2}, {1,4}}}, - { 0x00C, {{1,1}, {1,2}, {1,8}}}, - { 0x011, {{1,1}, {2,3}, {1,6}}}, - { 0x013, {{1,1}, {2,3}, {1,3}}}, - { 0x01A, {{1,1}, {1,2}, {1,4}}}, - { 0x01C, {{1,1}, {1,2}, {1,8}}}, - { 0x023, {{1,1}, {2,3}, {1,3}}}, - { 0x02C, {{1,1}, {1,2}, {1,8}}}, - { 0x048, {{1,2}, {1,2}, {1,4}}}, - { 0x04A, {{1,2}, {1,2}, {1,6}}}, - { 0x04C, {{1,2}, {1,2}, {1,8}}}, - { 0x05A, {{1,2}, {1,3}, {1,6}}}, - { 0x05C, {{1,2}, {1,3}, {1,6}}}, - { 0x063, {{1,2}, {1,4}, {1,4}}}, - { 0x06C, {{1,2}, {1,4}, {1,8}}}, - { 0x091, {{1,3}, {1,3}, {1,6}}}, - { 0x093, {{1,3}, {1,3}, {1,6}}}, - { 0x0A3, {{1,3}, {1,6}, {1,6}}}, - { 0x0DA, {{1,4}, {1,4}, {1,8}}}, - { 0x0DC, {{1,4}, {1,4}, {1,8}}}, - { 0x0EC, {{1,4}, {1,8}, {1,8}}}, - { 0x123, {{1,4}, {1,4}, {1,8}}}, - { 0x16C, {{1,4}, {1,8}, {1,8}}}, + { 0x000, {{1,1}, {1,1}, {1,2}}}, + { 0x002, {{1,1}, {1,1}, {1,4}}}, + { 0x004, {{1,1}, {1,1}, {1,8}}}, + { 0x008, {{1,1}, {1,2}, {1,2}}}, + { 0x00A, {{1,1}, {1,2}, {1,4}}}, + { 0x00C, {{1,1}, {1,2}, {1,8}}}, + { 0x011, {{1,1}, {2,3}, {1,6}}}, + { 0x013, {{1,1}, {2,3}, {1,3}}}, + { 0x01A, {{1,1}, {1,2}, {1,4}}}, + { 0x01C, {{1,1}, {1,2}, {1,8}}}, + { 0x023, {{1,1}, {2,3}, {1,3}}}, + { 0x02C, {{1,1}, {1,2}, {1,8}}}, + { 0x048, {{1,2}, {1,2}, {1,4}}}, + { 0x04A, {{1,2}, {1,2}, {1,6}}}, + { 0x04C, {{1,2}, {1,2}, {1,8}}}, + { 0x05A, {{1,2}, {1,3}, {1,6}}}, + { 0x05C, {{1,2}, {1,3}, {1,6}}}, + { 0x063, {{1,2}, {1,4}, {1,4}}}, + { 0x06C, {{1,2}, {1,4}, {1,8}}}, + { 0x091, {{1,3}, {1,3}, {1,6}}}, + { 0x093, {{1,3}, {1,3}, {1,6}}}, + { 0x0A3, {{1,3}, {1,6}, {1,6}}}, + { 0x0DA, {{1,4}, {1,4}, {1,8}}}, + { 0x0DC, {{1,4}, {1,4}, {1,8}}}, + { 0x0EC, {{1,4}, {1,8}, {1,8}}}, + { 0x123, {{1,4}, {1,4}, {1,8}}}, + { 0x16C, {{1,4}, {1,8}, {1,8}}}, }; struct memclk_data { - unsigned char multiplier; - unsigned char divisor; + unsigned char multiplier; + unsigned char divisor; }; + static struct memclk_data st40_memclk_table[8] = { - {1,1}, // 000 - {1,2}, // 001 - {1,3}, // 010 - {2,3}, // 011 - {1,4}, // 100 - {1,6}, // 101 - {1,8}, // 110 - {1,8} // 111 + {1,1}, // 000 + {1,2}, // 001 + {1,3}, // 010 + {2,3}, // 011 + {1,4}, // 100 + {1,6}, // 101 + {1,8}, // 110 + {1,8} // 111 }; static void st40_specific_time_init(unsigned int module_clock, unsigned short frqcr) { - unsigned int cpu_clock, master_clock, bus_clock, memory_clock; - struct frqcr_data *d; - int a; - unsigned long memclkcr; - struct memclk_data *e; - - for (a=0; afrqcr == (frqcr & 0x1ff)) - break; - } - if (a == ARRAY_SIZE(st40_frqcr_table)) { - d = st40_frqcr_table; - printk("ERROR: Unrecognised FRQCR value (0x%x), using default multipliers\n",frqcr); - } - - memclkcr = ctrl_inl(CLOCKGEN_MEMCLKCR); - e = &st40_memclk_table[memclkcr & MEMCLKCR_RATIO_MASK]; - - printk("Clock multipliers: CPU: %d/%d Bus: %d/%d Mem: %d/%d Periph: %d/%d\n", - d->factor[0].multiplier, d->factor[0].divisor, - d->factor[1].multiplier, d->factor[1].divisor, - e->multiplier, e->divisor, - d->factor[2].multiplier, d->factor[2].divisor); - - master_clock = module_clock * d->factor[2].divisor / d->factor[2].multiplier; - bus_clock = master_clock * d->factor[1].multiplier / d->factor[1].divisor; - memory_clock = master_clock * e->multiplier / e->divisor; - cpu_clock = master_clock * d->factor[0].multiplier / d->factor[0].divisor; - - current_cpu_data.cpu_clock = cpu_clock; - current_cpu_data.master_clock = master_clock; - current_cpu_data.bus_clock = bus_clock; - current_cpu_data.memory_clock = memory_clock; - current_cpu_data.module_clock = module_clock; + unsigned int cpu_clock, master_clock, bus_clock, memory_clock; + struct frqcr_data *d; + int a; + unsigned long memclkcr; + struct memclk_data *e; -} + for (a = 0; a < ARRAY_SIZE(st40_frqcr_table); a++) { + d = &st40_frqcr_table[a]; + + if (d->frqcr == (frqcr & 0x1ff)) + break; + } + + if (a == ARRAY_SIZE(st40_frqcr_table)) { + d = st40_frqcr_table; + + printk("ERROR: Unrecognised FRQCR value (0x%x), " + "using default multipliers\n", frqcr); + } + memclkcr = ctrl_inl(CLOCKGEN_MEMCLKCR); + e = &st40_memclk_table[memclkcr & MEMCLKCR_RATIO_MASK]; + + printk(KERN_INFO "Clock multipliers: CPU: %d/%d Bus: %d/%d " + "Mem: %d/%d Periph: %d/%d\n", + d->factor[0].multiplier, d->factor[0].divisor, + d->factor[1].multiplier, d->factor[1].divisor, + e->multiplier, e->divisor, + d->factor[2].multiplier, d->factor[2].divisor); + + master_clock = module_clock * d->factor[2].divisor + / d->factor[2].multiplier; + bus_clock = master_clock * d->factor[1].multiplier + / d->factor[1].divisor; + memory_clock = master_clock * e->multiplier + / e->divisor; + cpu_clock = master_clock * d->factor[0].multiplier + / d->factor[0].divisor; + + current_cpu_data.cpu_clock = cpu_clock; + current_cpu_data.master_clock = master_clock; + current_cpu_data.bus_clock = bus_clock; + current_cpu_data.memory_clock = memory_clock; + current_cpu_data.module_clock = module_clock; +} #endif void __init time_init(void) @@ -549,7 +577,6 @@ void __init time_init(void) if (board_time_init) board_time_init(); - /* * If we don't have an RTC (such as with the SH7300), don't attempt to * probe the timer frequency. Rely on an either hardcoded peripheral @@ -564,15 +591,10 @@ void __init time_init(void) { unsigned int freq; - /* + /* * If we've specified a peripheral clock frequency, and we have * an RTC, compare it against the autodetected value. Complain * if there's a mismatch. - * - * Note: We should allow for some high and low watermarks for - * the frequency here (compensating for potential drift), as - * otherwise we'll likely end up triggering this essentially - * on every boot. */ timer_freq = get_timer_frequency(); freq = timer_freq * 4; @@ -587,20 +609,22 @@ void __init time_init(void) #endif #ifdef CONFIG_CPU_SUBTYPE_ST40STB1 + /* XXX: Update ST40 code to use board_time_init() */ pvr = ctrl_inl(CCN_PVR); frqcr = ctrl_inw(FRQCR); printk("time.c ST40 Probe: PVR %08lx, FRQCR %04hx\n", pvr, frqcr); - if (((pvr >>CCN_PVR_CHIP_SHIFT) & CCN_PVR_CHIP_MASK) == CCN_PVR_CHIP_ST40STB1) - st40_specific_time_init(current_cpu_data.module_clock, frqcr); + + if (((pvr >> CCN_PVR_CHIP_SHIFT) & CCN_PVR_CHIP_MASK) == CCN_PVR_CHIP_ST40STB1) + st40_specific_time_init(current_cpu_data.module_clock, frqcr); else #endif - get_current_frequency_divisors(&ifc, &bfc, &pfc); + get_current_frequency_divisors(&ifc, &bfc, &pfc); - if (rtc_get_time) + if (rtc_get_time) { rtc_get_time(&xtime); - else { - xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0); - xtime.tv_nsec = 0; + } else { + xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0); + xtime.tv_nsec = 0; } set_normalized_timespec(&wall_to_monotonic, @@ -613,9 +637,9 @@ void __init time_init(void) } /* - ** for ST40 chips the current_cpu_data should already be set - ** so not having valid pfc/bfc/ifc shouldn't be a problem - */ + * for ST40 chips the current_cpu_data should already be set + * so not having valid pfc/bfc/ifc shouldn't be a problem + */ if (!current_cpu_data.master_clock) current_cpu_data.master_clock = current_cpu_data.module_clock * pfc; if (!current_cpu_data.bus_clock) @@ -637,11 +661,8 @@ void __init time_init(void) printk("Module clock: %d.%02dMHz\n", (current_cpu_data.module_clock / 1000000), (current_cpu_data.module_clock % 1000000)/10000); -#if defined(CONFIG_SH_HS7751RVOIP) || defined(CONFIG_SH_RTS7751R2D) - interval = ((current_cpu_data.module_clock/4 + HZ/2) / HZ) - 1; -#else + interval = (current_cpu_data.module_clock/4 + HZ/2) / HZ; -#endif printk("Interval = %ld\n", interval); diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index da5721f4a..7eb06719d 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c @@ -438,7 +438,7 @@ static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) case 0x0F00: /* bf/s lab */ ret = handle_unaligned_delayslot(regs); if (ret==0) { -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) if ((regs->sr & 0x00000001) != 0) regs->pc += 4; /* next after slot */ else @@ -451,7 +451,7 @@ static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) case 0x0D00: /* bt/s lab */ ret = handle_unaligned_delayslot(regs); if (ret==0) { -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) if ((regs->sr & 0x00000001) == 0) regs->pc += 4; /* next after slot */ else diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 3ed8e7cda..b5681e3f9 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -2,6 +2,12 @@ # Makefile for SuperH-specific library files.. # -lib-y = delay.o memcpy.o memset.o memmove.o memchr.o \ +lib-y = delay.o memset.o memmove.o memchr.o \ checksum.o strcasecmp.o strlen.o div64.o udivdi3.o \ div64-generic.o + +memcpy-y := memcpy.o +memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o + +lib-y += $(memcpy-y) + diff --git a/arch/sh/lib/delay.c b/arch/sh/lib/delay.c index 550454649..50b36037d 100644 --- a/arch/sh/lib/delay.c +++ b/arch/sh/lib/delay.c @@ -24,7 +24,7 @@ inline void __const_udelay(unsigned long xloops) __asm__("dmulu.l %0, %2\n\t" "sts mach, %0" : "=r" (xloops) - : "0" (xloops), "r" (current_cpu_data.loops_per_jiffy) + : "0" (xloops), "r" (cpu_data[_smp_processor_id()].loops_per_jiffy) : "macl", "mach"); __delay(xloops * HZ); } diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index 38e004cff..9489a1424 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile @@ -19,5 +19,7 @@ obj-y += $(mmu-y) ifdef CONFIG_MMU obj-$(CONFIG_CPU_SH3) += tlb-sh3.o obj-$(CONFIG_CPU_SH4) += tlb-sh4.o ioremap.o +obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o endif +obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c index ee5b452b1..2689cb24e 100644 --- a/arch/sh/mm/cache-sh2.c +++ b/arch/sh/mm/cache-sh2.c @@ -24,7 +24,7 @@ unsigned long __get_oc_addr(unsigned long set, unsigned long way) { unsigned long ccr; - + /* * On SH-2 the way bit isn't tracked in the address field * if we're doing address array access .. instead, we need @@ -48,25 +48,3 @@ unsigned long __get_oc_addr(unsigned long set, unsigned long way) return CACHE_OC_ADDRESS_ARRAY | (set << cpu_data->dcache.entry_shift); } -int __init detect_cpu_and_cache_system(void) -{ - /* - * For now, assume SH7604 .. fix this later. - */ - cpu_data->type = CPU_SH7604; - cpu_data->dcache.ways = 4; - cpu_data->dcache.way_shift = 6; - cpu_data->dcache.sets = 64; - cpu_data->dcache.entry_shift = 4; - cpu_data->dcache.linesz = L1_CACHE_BYTES; - cpu_data->dcache.flags = 0; - - /* - * SH-2 doesn't have separate caches - */ - cpu_data->dcache.flags |= SH_CACHE_COMBINED; - cpu_data->icache = cpu_data->dcache; - - return 0; -} - diff --git a/arch/sh/mm/cache-sh3.c b/arch/sh/mm/cache-sh3.c index b03d5e441..838731fc6 100644 --- a/arch/sh/mm/cache-sh3.c +++ b/arch/sh/mm/cache-sh3.c @@ -1,9 +1,10 @@ -/* $Id: cache-sh3.c,v 1.9 2004/05/02 01:46:30 sugioka Exp $ - * - * linux/arch/sh/mm/cache-sh3.c +/* + * arch/sh/mm/cache-sh3.c * * Copyright (C) 1999, 2000 Niibe Yutaka * Copyright (C) 2002 Paul Mundt + * + * Released under the terms of the GNU GPL v2.0. */ #include @@ -21,72 +22,6 @@ #include #include -int __init detect_cpu_and_cache_system(void) -{ - unsigned long addr0, addr1, data0, data1, data2, data3; - - jump_to_P2(); - /* - * Check if the entry shadows or not. - * When shadowed, it's 128-entry system. - * Otherwise, it's 256-entry system. - */ - addr0 = CACHE_OC_ADDRESS_ARRAY + (3 << 12); - addr1 = CACHE_OC_ADDRESS_ARRAY + (1 << 12); - - /* First, write back & invalidate */ - data0 = ctrl_inl(addr0); - ctrl_outl(data0&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr0); - data1 = ctrl_inl(addr1); - ctrl_outl(data1&~(SH_CACHE_VALID|SH_CACHE_UPDATED), addr1); - - /* Next, check if there's shadow or not */ - data0 = ctrl_inl(addr0); - data0 ^= SH_CACHE_VALID; - ctrl_outl(data0, addr0); - data1 = ctrl_inl(addr1); - data2 = data1 ^ SH_CACHE_VALID; - ctrl_outl(data2, addr1); - data3 = ctrl_inl(addr0); - - /* Lastly, invaliate them. */ - ctrl_outl(data0&~SH_CACHE_VALID, addr0); - ctrl_outl(data2&~SH_CACHE_VALID, addr1); - - back_to_P1(); - - cpu_data->dcache.ways = 4; - cpu_data->dcache.entry_shift = 4; - cpu_data->dcache.linesz = L1_CACHE_BYTES; - cpu_data->dcache.flags = 0; - - /* - * 7709A/7729 has 16K cache (256-entry), while 7702 has only - * 2K(direct) 7702 is not supported (yet) - */ - if (data0 == data1 && data2 == data3) { /* Shadow */ - cpu_data->dcache.way_incr = (1 << 11); - cpu_data->dcache.entry_mask = 0x7f0; - cpu_data->dcache.sets = 128; - cpu_data->type = CPU_SH7708; - - cpu_data->flags |= CPU_HAS_MMU_PAGE_ASSOC; - } else { /* 7709A or 7729 */ - cpu_data->dcache.way_incr = (1 << 12); - cpu_data->dcache.entry_mask = 0xff0; - cpu_data->dcache.sets = 256; - cpu_data->type = CPU_SH7729; - } - - /* - * SH-3 doesn't have separate caches - */ - cpu_data->dcache.flags |= SH_CACHE_COMBINED; - cpu_data->icache = cpu_data->dcache; - - return 0; -} - /* * Write back the dirty D-caches, but not invalidate them. * @@ -116,7 +51,7 @@ void __flush_wback_region(void *start, int size) addr = addrstart | (v & cpu_data->dcache.entry_mask); local_irq_save(flags); data = ctrl_inl(addr); - + if ((data & CACHE_PHYSADDR_MASK) == (p & CACHE_PHYSADDR_MASK)) { data &= ~SH_CACHE_UPDATED; diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index adb99d833..a877087d0 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c @@ -1,10 +1,13 @@ -/* $Id: cache-sh4.c,v 1.26 2004/02/19 12:47:24 lethal Exp $ - * - * linux/arch/sh/mm/cache-sh4.c +/* + * arch/sh/mm/cache-sh4.c * * Copyright (C) 1999, 2000, 2002 Niibe Yutaka * Copyright (C) 2001, 2002, 2003, 2004 Paul Mundt * Copyright (C) 2003 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 @@ -28,126 +31,6 @@ static void __flush_cache_4096_all_ex(unsigned long start); extern void __flush_dcache_all(void); static void __flush_dcache_all_ex(void); -int __init detect_cpu_and_cache_system(void) -{ - unsigned long pvr, prr, cvr; - unsigned long size; - - static unsigned long sizes[16] = { - [1] = (1 << 12), - [2] = (1 << 13), - [4] = (1 << 14), - [8] = (1 << 15), - [9] = (1 << 16) - }; - - pvr = (ctrl_inl(CCN_PVR) >> 8) & 0xffff; - prr = (ctrl_inl(CCN_PRR) >> 4) & 0xff; - cvr = (ctrl_inl(CCN_CVR)); - - /* - * Setup some sane SH-4 defaults for the icache - */ - cpu_data->icache.way_incr = (1 << 13); - cpu_data->icache.entry_shift = 5; - cpu_data->icache.entry_mask = 0x1fe0; - cpu_data->icache.sets = 256; - cpu_data->icache.ways = 1; - cpu_data->icache.linesz = L1_CACHE_BYTES; - - /* - * And again for the dcache .. - */ - cpu_data->dcache.way_incr = (1 << 14); - cpu_data->dcache.entry_shift = 5; - cpu_data->dcache.entry_mask = 0x3fe0; - cpu_data->dcache.sets = 512; - cpu_data->dcache.ways = 1; - cpu_data->dcache.linesz = L1_CACHE_BYTES; - - /* Set the FPU flag, virtually all SH-4's have one */ - cpu_data->flags |= CPU_HAS_FPU; - - /* - * Probe the underlying processor version/revision and - * adjust cpu_data setup accordingly. - */ - switch (pvr) { - case 0x205: - cpu_data->type = CPU_SH7750; - cpu_data->flags |= CPU_HAS_P2_FLUSH_BUG; - break; - case 0x206: - cpu_data->type = CPU_SH7750S; - - /* - * FIXME: This is needed for 7750, but do we need it for the - * 7750S too? For now, assume we do.. -- PFM - */ - cpu_data->flags |= CPU_HAS_P2_FLUSH_BUG; - - break; - case 0x1100: - cpu_data->type = CPU_SH7751; - break; - case 0x8000: - cpu_data->type = CPU_ST40RA; - break; - case 0x8100: - cpu_data->type = CPU_ST40GX1; - break; - case 0x700: - cpu_data->type = CPU_SH4_501; - cpu_data->icache.ways = 2; - cpu_data->dcache.ways = 2; - - /* No FPU on the SH4-500 series.. */ - cpu_data->flags &= ~CPU_HAS_FPU; - break; - case 0x600: - cpu_data->type = CPU_SH4_202; - cpu_data->icache.ways = 2; - cpu_data->dcache.ways = 2; - break; - case 0x500 ... 0x501: - switch (prr) { - case 0x10: cpu_data->type = CPU_SH7750R; break; - case 0x11: cpu_data->type = CPU_SH7751R; break; - case 0x50: cpu_data->type = CPU_SH7760; break; - } - - cpu_data->icache.ways = 2; - cpu_data->dcache.ways = 2; - - break; - default: - cpu_data->type = CPU_SH_NONE; - break; - } - - /* - * On anything that's not a direct-mapped cache, look to the CVR - * for I/D-cache specifics. - */ - if (cpu_data->icache.ways > 1) { - size = sizes[(cvr >> 20) & 0xf]; - cpu_data->icache.way_incr = size / cpu_data->icache.ways; - cpu_data->icache.sets = (size >> 6); - cpu_data->icache.entry_mask = - ((size / cpu_data->icache.ways) - (1 << 5)); - } - - if (cpu_data->dcache.ways > 1) { - size = sizes[(cvr >> 16) & 0xf]; - cpu_data->dcache.way_incr = size / cpu_data->dcache.ways; - cpu_data->dcache.sets = (size >> 6); - cpu_data->dcache.entry_mask = - ((size / cpu_data->dcache.ways) - (1 << 5)); - } - - return 0; -} - /* * SH-4 has virtually indexed and physically tagged cache. */ diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 789bacf1a..1f7af0c73 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c @@ -78,4 +78,8 @@ void consistent_sync(void *vaddr, size_t size, int direction) BUG(); } } + +EXPORT_SYMBOL(consistent_alloc); +EXPORT_SYMBOL(consistent_free); EXPORT_SYMBOL(consistent_sync); + diff --git a/arch/sh/mm/extable.c b/arch/sh/mm/extable.c index 994d9280d..505ede7c2 100644 --- a/arch/sh/mm/extable.c +++ b/arch/sh/mm/extable.c @@ -1,5 +1,4 @@ -/* $Id: extable.c,v 1.3 2003/05/06 23:28:50 lethal Exp $ - * +/* * linux/arch/sh/mm/extable.c * Taken from: * linux/arch/i386/mm/extable.c diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index aaa8e871c..9f490c274 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -1,5 +1,4 @@ -/* $Id: ioremap.c,v 1.9 2004/02/25 04:59:10 lethal Exp $ - * +/* * arch/sh/mm/ioremap.c * * Re-map IO memory to kernel address space so that we can access it. diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index 4bffcf59c..7a0d5c10b 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c @@ -39,6 +39,16 @@ void update_mmu_cache(struct vm_area_struct * vma, if (vma && current->active_mm != vma->vm_mm) return; +#if defined(CONFIG_SH7705_CACHE_32KB) + struct page *page; + page = pte_page(pte); + if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) { + unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; + __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); + __set_bit(PG_mapped, &page->flags); + } +#endif + local_irq_save(flags); /* Set PTEH register */ diff --git a/arch/sh/oprofile/Makefile b/arch/sh/oprofile/Makefile index 2b68bb584..686738d4a 100644 --- a/arch/sh/oprofile/Makefile +++ b/arch/sh/oprofile/Makefile @@ -7,7 +7,7 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ timer_int.o ) profdrvr-y := op_model_null.o -profdrvr-$(CONFIG_SH_DREAMCAST) := op_model_dreamcast.o +profdrvr-$(CONFIG_CPU_SUBTYPE_SH7750) := op_model_sh7750.o oprofile-y := $(DRIVER_OBJS) $(profdrvr-y) diff --git a/arch/sh/oprofile/op_model_null.c b/arch/sh/oprofile/op_model_null.c index f1c795fe9..a845b088e 100644 --- a/arch/sh/oprofile/op_model_null.c +++ b/arch/sh/oprofile/op_model_null.c @@ -12,7 +12,7 @@ #include #include -int __init oprofile_arch_init(struct oprofile_operations **ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { return -ENODEV; } diff --git a/arch/sh/oprofile/op_model_sh7750.c b/arch/sh/oprofile/op_model_sh7750.c index de09ba767..5ec9ddcc4 100644 --- a/arch/sh/oprofile/op_model_sh7750.c +++ b/arch/sh/oprofile/op_model_sh7750.c @@ -112,14 +112,9 @@ static struct op_counter_config ctr[NR_CNTRS]; */ static int sh7750_timer_notify(struct notifier_block *self, - unsigned long val, void *data) + unsigned long val, void *regs) { - struct pt_regs *regs = data; - unsigned long pc; - - pc = instruction_pointer(regs); - oprofile_add_sample(pc, !user_mode(regs), 0, smp_processor_id()); - + oprofile_add_sample((struct pt_regs *)regs, 0); return 0; } diff --git a/arch/sh/ramdisk/Makefile b/arch/sh/ramdisk/Makefile index a22d86bf0..99e1c6867 100644 --- a/arch/sh/ramdisk/Makefile +++ b/arch/sh/ramdisk/Makefile @@ -12,8 +12,9 @@ img := $(subst $(src)//,/,$(src)/$(img)) quiet_cmd_ramdisk = LD $@ define cmd_ramdisk - $(LD) -T $(src)/ld.script -b binary --oformat $(O_FORMAT) -o $@ $(img) + $(LD) -T $(srctree)/$(src)/ld.script -b binary --oformat $(O_FORMAT) \ + -o $@ $(img) endef -$(obj)/ramdisk.o: $(img) $(src)/ld.script +$(obj)/ramdisk.o: $(img) $(srctree)/$(src)/ld.script $(call cmd,ramdisk) diff --git a/arch/sh/tools/Makefile b/arch/sh/tools/Makefile index 268bf3efc..3c370a113 100644 --- a/arch/sh/tools/Makefile +++ b/arch/sh/tools/Makefile @@ -10,7 +10,6 @@ # Shamelessly cloned from ARM. # -include/asm-sh/machtypes.h: $(obj)/machgen.sh $(obj)/mach-types +include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types @echo ' Generating $@' - @$(CONFIG_SHELL) $(obj)/machgen.sh $(obj)/mach-types > $@ - + $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types index faf6d9e38..0693fbd1f 100644 --- a/arch/sh/tools/mach-types +++ b/arch/sh/tools/mach-types @@ -8,6 +8,7 @@ SE SH_SOLUTION_ENGINE 7751SE SH_7751_SOLUTION_ENGINE 7300SE SH_7300_SOLUTION_ENGINE +73180SE SH_73180_SOLUTION_ENGINE 7751SYSTEMH SH_7751_SYSTEMH HP600 SH_HP600 HP620 SH_HP620 @@ -24,4 +25,7 @@ MPC1211 SH_MPC1211 SNAPGEAR SH_SECUREEDGE5410 HS7751RVOIP SH_HS7751RVOIP RTS7751R2D SH_RTS7751R2D +EDOSK7705 SH_EDOSK7705 +SH4202_MICRODEV SH_SH4202_MICRODEV +SH03 SH_SH03 diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig index 551ba9a20..1fb7691e9 100644 --- a/arch/sh64/Kconfig +++ b/arch/sh64/Kconfig @@ -25,6 +25,10 @@ config RWSEM_GENERIC_SPINLOCK bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + config LOG_BUF_SHIFT int default 14 diff --git a/arch/sh64/kernel/fpu.c b/arch/sh64/kernel/fpu.c index 175c88a5d..8ad4ed6a6 100644 --- a/arch/sh64/kernel/fpu.c +++ b/arch/sh64/kernel/fpu.c @@ -158,12 +158,12 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs) fpsave(&last_task_used_math->thread.fpu.hard); } last_task_used_math = current; - if (current->used_math) { + if (used_math()) { fpload(¤t->thread.fpu.hard); } else { /* First time FPU user. */ fpload(&init_fpuregs.hard); - current->used_math = 1; + set_used_math(); } release_fpu(); } diff --git a/arch/sh64/kernel/irq.c b/arch/sh64/kernel/irq.c index 7d0f422e1..b0f138f54 100644 --- a/arch/sh64/kernel/irq.c +++ b/arch/sh64/kernel/irq.c @@ -30,9 +30,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/arch/sh64/kernel/irq_intc.c b/arch/sh64/kernel/irq_intc.c index 4062ae55e..43f88f3a7 100644 --- a/arch/sh64/kernel/irq_intc.c +++ b/arch/sh64/kernel/irq_intc.c @@ -20,12 +20,12 @@ #include #include #include +#include /* this includes also #include -#include /* this includes also #include #include diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c index 842a24373..368cab7a9 100644 --- a/arch/sh64/kernel/pci_sh5.c +++ b/arch/sh64/kernel/pci_sh5.c @@ -517,7 +517,7 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) bus->resource[0]->flags |= IORESOURCE_IO; bus->resource[1]->flags |= IORESOURCE_MEM; - /* For now, propogate host limits to the bus; + /* For now, propagate host limits to the bus; * we'll adjust them later. */ #if 1 diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c index 13cec3579..e3f509ea6 100644 --- a/arch/sh64/kernel/process.c +++ b/arch/sh64/kernel/process.c @@ -338,7 +338,7 @@ void default_idle(void) } } -void cpu_idle(void *unused) +void cpu_idle(void) { default_idle(); } @@ -688,7 +688,7 @@ void flush_thread(void) last_task_used_math = NULL; } /* Force FPU state to be reinitialised after exec */ - current->used_math = 0; + clear_used_math(); #endif /* if we are a kernel thread, about to change to user thread, @@ -713,7 +713,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) int fpvalid; struct task_struct *tsk = current; - fpvalid = tsk->used_math; + fpvalid = !!tsk_used_math(tsk); if (fpvalid) { if (current == last_task_used_math) { grab_fpu(); @@ -765,9 +765,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, childregs->regs[9] = 0; /* Set return value for child */ childregs->sr |= SR_FD; /* Invalidate FPU flag */ - /* From sh */ - p->set_child_tid = p->clear_child_tid = NULL; - p->thread.sp = (unsigned long) childregs; p->thread.pc = (unsigned long) ret_from_fork; @@ -862,8 +859,11 @@ asmlinkage int sys_execve(char *ufilename, char **uargv, (char __user * __user *)uargv, (char __user * __user *)uenvp, pregs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); out: unlock_kernel(); diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh64/kernel/ptrace.c index c48bc4a27..27c1a32cc 100644 --- a/arch/sh64/kernel/ptrace.c +++ b/arch/sh64/kernel/ptrace.c @@ -63,7 +63,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr) struct pt_regs *regs; regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1; - if (!task->used_math) { + if (!tsk_used_math(task)) { if (addr == offsetof(struct user_fpu_struct, fpscr)) { tmp = FPSCR_INIT; } else { @@ -105,9 +105,9 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1; - if (!task->used_math) { + if (!tsk_used_math(task)) { fpinit(&task->thread.fpu.hard); - task->used_math = 1; + set_stopped_child_used_math(task); } else if (last_task_used_math == task) { grab_fpu(); fpsave(&task->thread.fpu.hard); @@ -187,7 +187,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) (addr < offsetof(struct user, u_fpvalid))) { tmp = get_fpu_long(child, addr - offsetof(struct user, fpu)); } else if (addr == offsetof(struct user, u_fpvalid)) { - tmp = child->used_math; + tmp = !!tsk_used_math(child); } else { break; } @@ -257,7 +257,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); diff --git a/arch/sh64/kernel/signal.c b/arch/sh64/kernel/signal.c index a848fbdb1..608f6796a 100644 --- a/arch/sh64/kernel/signal.c +++ b/arch/sh64/kernel/signal.c @@ -186,7 +186,7 @@ restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) int fpvalid; err |= __get_user (fpvalid, &sc->sc_fpvalid); - current->used_math = fpvalid; + conditional_used_math(fpvalid); if (! fpvalid) return err; @@ -207,7 +207,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) int err = 0; int fpvalid; - fpvalid = current->used_math; + fpvalid = !!used_math(); err |= __put_user(fpvalid, &sc->sc_fpvalid); if (! fpvalid) return err; @@ -222,7 +222,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc) err |= __copy_to_user(&sc->sc_fpregs[0], ¤t->thread.fpu.hard, (sizeof(long long) * 32) + (sizeof(int) * 1)); - current->used_math = 0; + clear_used_math(); return err; } @@ -701,10 +701,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) if (!user_mode(regs)) return 1; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c index b3738ed37..9d73104f6 100644 --- a/arch/sh64/kernel/time.c +++ b/arch/sh64/kernel/time.c @@ -309,6 +309,9 @@ static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *reg ctc_last_interrupt = (unsigned long) current_ctc; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT diff --git a/arch/sh64/lib/c-checksum.c b/arch/sh64/lib/c-checksum.c index 327595472..a82d8f1a7 100644 --- a/arch/sh64/lib/c-checksum.c +++ b/arch/sh64/lib/c-checksum.c @@ -136,7 +136,7 @@ unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum) /* Copy while checksumming, otherwise like csum_partial. */ unsigned int -csum_partial_copy(const char *src, char *dst, int len, unsigned int sum) +csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { sum = csum_partial(src, len, sum); memcpy(dst, src, len); @@ -147,7 +147,7 @@ csum_partial_copy(const char *src, char *dst, int len, unsigned int sum) /* Copy from userspace and compute checksum. If we catch an exception then zero the rest of the buffer. */ unsigned int -csum_partial_copy_from_user(const char *src, char *dst, int len, +csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { int missing; @@ -168,7 +168,7 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, /* Copy to userspace and compute checksum. */ unsigned int -csum_partial_copy_to_user(const char *src, char *dst, int len, +csum_partial_copy_to_user(const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { sum = csum_partial(src, len, sum); @@ -221,7 +221,7 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr, // Post SIM: unsigned int -csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum) +csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { // unsigned dummy; pr_debug("csum_partial_copy_nocheck src %p dst %p len %d\n", src, dst, diff --git a/arch/sh64/mm/hugetlbpage.c b/arch/sh64/mm/hugetlbpage.c index 50b25735f..edbbc4317 100644 --- a/arch/sh64/mm/hugetlbpage.c +++ b/arch/sh64/mm/hugetlbpage.c @@ -62,8 +62,8 @@ static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long i; pte_t entry; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); - + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); if (write_access) entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); @@ -115,7 +115,8 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, pte_val(entry) += PAGE_SIZE; dst_pte++; } - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); addr += HPAGE_SIZE; } return 0; @@ -206,7 +207,8 @@ void unmap_hugepage_range(struct vm_area_struct *vma, pte++; } } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); flush_tlb_range(vma, start, end); } diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index d39216dc5..acbeb5152 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -27,6 +27,7 @@ menu "General machine setup" config VT bool + select INPUT default y ---help--- If you say Y here, you will get support for terminal devices with @@ -85,8 +86,8 @@ config SMP depends on BROKEN ---help--- This enables support for systems with more than one CPU. If you have - a system with only one CPU, like most personal computers, say N. If - you have a system with more than one CPU, say Y. + a system with only one CPU, say N. If you have a system with more + than one CPU, say Y. If you say N here, the kernel will run on single and multiprocessor machines, but will use only one CPU of a multiprocessor machine. If @@ -94,17 +95,11 @@ config SMP singleprocessor machines. On a singleprocessor machine, the kernel will run faster if you say N here. - Note that if you say Y here and choose architecture "586" or - "Pentium" under "Processor family", the kernel will not work on 486 - architectures. Similarly, multiprocessor kernels for the "PPro" - architecture may not work on all Pentium based boards. - People using multiprocessor machines who say Y here should also say Y to "Enhanced Real Time Clock Support", below. The "Advanced Power Management" code will be disabled if you say Y here. See also the , - , and the SMP-HOWTO available at . @@ -188,10 +183,10 @@ config SERIAL_CONSOLE (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyS1". (Try "man bootparam" or see the documentation of - your boot loader (lilo or loadlin) about how to pass options to the - kernel at boot time.) + your boot loader (silo) about how to pass options to the kernel at + boot time.) - If you don't have a VGA card installed and you say Y here, the + If you don't have a graphics card installed and you say Y here, the kernel will automatically use the first serial line, /dev/ttyS0, as system console. @@ -212,6 +207,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config SUN_PM bool default y @@ -222,6 +221,7 @@ config SUN_PM config SUN4 bool "Support for SUN4 machines (disables SUN4[CDM] support)" depends on !SMP + default n help Say Y here if, and only if, your machine is a sun4. Note that a kernel compiled with this option will run only on sun4. @@ -248,7 +248,10 @@ config SUN_OPENPROMFS -t openpromfs none /proc/openprom". To compile the /proc/openprom support as a module, choose M here: the - module will be called openpromfs. If unsure, choose M. + module will be called openpromfs. + + Only choose N if you know in advance that you will not need to modify + OpenPROM settings on the running system. source "fs/Kconfig.binfmt" @@ -281,9 +284,9 @@ config PRINTER If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" - or see the documentation of your boot loader (lilo or loadlin) about - how to pass options to the kernel at boot time.) The syntax of the - "lp" command line option can be found in . + or see the documentation of your boot loader (silo) about how to pass + options to the kernel at boot time.) The syntax of the "lp" command + line option can be found in . If you have more than 8 printers, you need to increase the LP_NO macro in lp.c and the PARPORT_MAX macro in parport.h. @@ -377,6 +380,8 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" +source "drivers/infiniband/Kconfig" + source "drivers/char/watchdog/Kconfig" source "arch/sparc/Kconfig.debug" diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index d01b6cc66..406dd94af 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c @@ -28,7 +28,7 @@ #define APC_OBPNAME "power-management" #define APC_DEVNAME "apc" -volatile static u8 *regs; +volatile static u8 __iomem *regs; static int apc_regsize; static int apc_no_idle __initdata = 0; @@ -70,7 +70,7 @@ void apc_swift_idle(void) static inline void apc_free(void) { - sbus_iounmap((unsigned long)regs, apc_regsize); + sbus_iounmap(regs, apc_regsize); } static int apc_open(struct inode *inode, struct file *f) @@ -155,9 +155,9 @@ sbus_done: } apc_regsize = sdev->reg_addrs[0].reg_size; - regs = (u8*) sbus_ioremap(&sdev->resource[0], 0, + regs = sbus_ioremap(&sdev->resource[0], 0, apc_regsize, APC_OBPNAME); - if(NULL == regs) { + if(!regs) { printk(KERN_ERR "%s: unable to map registers\n", APC_DEVNAME); return -ENODEV; } diff --git a/arch/sparc/kernel/auxio.c b/arch/sparc/kernel/auxio.c index 44b6dd75e..d3b364836 100644 --- a/arch/sparc/kernel/auxio.c +++ b/arch/sparc/kernel/auxio.c @@ -17,8 +17,8 @@ /* auxio_register is not static because it is referenced * in entry.S::floppy_tdone */ -unsigned long auxio_register = 0UL; -static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED; +void __iomem *auxio_register = NULL; +static DEFINE_SPINLOCK(auxio_lock); void __init auxio_probe(void) { @@ -53,7 +53,8 @@ void __init auxio_probe(void) #endif } } - prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs)); + if(prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs)) <= 0) + return; prom_apply_obio_ranges(auxregs, 0x1); /* Map the register both read and write */ r.flags = auxregs[0].which_io & 0xF; @@ -63,7 +64,7 @@ void __init auxio_probe(void) /* Fix the address on sun4m and sun4c. */ if((((unsigned long) auxregs[0].phys_addr) & 3) == 3 || sparc_cpu_model == sun4c) - auxio_register |= 3; + auxio_register += (3 - ((unsigned long)auxio_register & 3)); set_auxio(AUXIO_LED, 0); } @@ -121,7 +122,8 @@ void __init auxio_power_probe(void) return; /* Map the power control register. */ - prom_getproperty(node, "reg", (char *)®s, sizeof(regs)); + if (prom_getproperty(node, "reg", (char *)®s, sizeof(regs)) <= 0) + return; prom_apply_obio_ranges(®s, 1); memset(&r, 0, sizeof(r)); r.flags = regs.which_io & 0xF; diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c index 8ae7e5d3c..1754192c6 100644 --- a/arch/sparc/kernel/ebus.c +++ b/arch/sparc/kernel/ebus.c @@ -275,7 +275,7 @@ void __init ebus_init(void) } } - pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); + pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); if (!pdev) { return; } @@ -342,7 +342,7 @@ void __init ebus_init(void) } next_ebus: - pdev = pci_find_device(PCI_VENDOR_ID_SUN, + pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, pdev); if (!pdev) break; @@ -356,4 +356,6 @@ void __init ebus_init(void) ebus->next = 0; ++num_ebus; } + if (pdev) + pci_dev_put(pdev); } diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 624e2a6ed..b448166f5 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S @@ -38,7 +38,7 @@ #define curptr g6 -#define NR_SYSCALLS 283 /* Each OS is different... */ +#define NR_SYSCALLS 284 /* Each OS is different... */ /* These are just handy. */ #define _SV save %sp, -STACKFRAME_SZ, %sp @@ -1508,7 +1508,7 @@ syscall_is_too_hard: .globl ret_sys_call ret_sys_call: ld [%curptr + TI_FLAGS], %l6 - cmp %o0, -ENOIOCTLCMD + cmp %o0, -ERESTART_RESTARTBLOCK ld [%sp + STACKFRAME_SZ + PT_PSR], %g3 set PSR_C, %g2 bgeu 1f @@ -1587,7 +1587,7 @@ solaris_syscall: st %o0, [%sp + STACKFRAME_SZ + PT_I0] set PSR_C, %g2 - cmp %o0, -ENOIOCTLCMD + cmp %o0, -ERESTART_RESTARTBLOCK bgeu 1f ld [%sp + STACKFRAME_SZ + PT_PSR], %g3 @@ -1678,7 +1678,7 @@ bsd_is_too_hard: st %o0, [%sp + STACKFRAME_SZ + PT_I0] set PSR_C, %g2 - cmp %o0, -ENOIOCTLCMD + cmp %o0, -ERESTART_RESTARTBLOCK bgeu 1f ld [%sp + STACKFRAME_SZ + PT_PSR], %g3 diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c index 1279715fe..2e1b0f6e9 100644 --- a/arch/sparc/kernel/idprom.c +++ b/arch/sparc/kernel/idprom.c @@ -53,13 +53,12 @@ static void __init display_system_type(unsigned char machtype) for (i = 0; i < NUM_SUN_MACHINES; i++) { if(Sun_Machines[i].id_machtype == machtype) { - if (machtype != (SM_SUN4M_OBP | 0x00)) + if (machtype != (SM_SUN4M_OBP | 0x00) || + prom_getproperty(prom_root_node, "banner-name", + sysname, sizeof(sysname)) <= 0) printk("TYPE: %s\n", Sun_Machines[i].name); - else { - prom_getproperty(prom_root_node, "banner-name", - sysname, sizeof(sysname)); + else printk("TYPE: %s\n", sysname); - } return; } } diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 5b4a0e194..21e4e6f84 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -47,8 +47,8 @@ struct resource *_sparc_find_resource(struct resource *r, unsigned long); -static void *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz); -static void *_sparc_alloc_io(unsigned int busno, unsigned long phys, +static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz); +static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys, unsigned long size, char *name); static void _sparc_free_io(struct resource *res); @@ -103,7 +103,7 @@ static void xres_free(struct xresource *xrp) { * * Bus type is always zero on IIep. */ -void *ioremap(unsigned long offset, unsigned long size) +void __iomem *ioremap(unsigned long offset, unsigned long size) { char name[14]; @@ -114,7 +114,7 @@ void *ioremap(unsigned long offset, unsigned long size) /* * Comlimentary to ioremap(). */ -void iounmap(void *virtual) +void iounmap(volatile void __iomem *virtual) { unsigned long vaddr = (unsigned long) virtual & PAGE_MASK; struct resource *res; @@ -134,24 +134,24 @@ void iounmap(void *virtual) /* */ -unsigned long sbus_ioremap(struct resource *phyres, unsigned long offset, +void __iomem *sbus_ioremap(struct resource *phyres, unsigned long offset, unsigned long size, char *name) { - return (unsigned long) _sparc_alloc_io(phyres->flags & 0xF, + return _sparc_alloc_io(phyres->flags & 0xF, phyres->start + offset, size, name); } /* */ -void sbus_iounmap(unsigned long addr, unsigned long size) +void sbus_iounmap(volatile void __iomem *addr, unsigned long size) { - iounmap((void *)addr); + iounmap(addr); } /* * Meat of mapping */ -static void *_sparc_alloc_io(unsigned int busno, unsigned long phys, +static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys, unsigned long size, char *name) { static int printed_full; @@ -159,7 +159,7 @@ static void *_sparc_alloc_io(unsigned int busno, unsigned long phys, struct resource *res; char *tack; int tlen; - void *va; /* P3 diag */ + void __iomem *va; /* P3 diag */ if (name == NULL) name = "???"; @@ -189,7 +189,7 @@ static void *_sparc_alloc_io(unsigned int busno, unsigned long phys, /* */ -static void * +static void __iomem * _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) { unsigned long offset = ((unsigned long) pa) & (~PAGE_MASK); @@ -206,7 +206,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) pa &= PAGE_MASK; sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1); - return (void *) (res->start + offset); + return (void __iomem *) (res->start + offset); } /* diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index 4e0ed320d..410b9a72a 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c @@ -159,7 +159,7 @@ struct irqaction *irq_action[NR_IRQS] = { }; /* Used to protect the IRQ action lists */ -spinlock_t irq_action_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(irq_action_lock); int show_interrupts(struct seq_file *p, void *v) { diff --git a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c index 36a78a9f2..37b9a4942 100644 --- a/arch/sparc/kernel/muldiv.c +++ b/arch/sparc/kernel/muldiv.c @@ -4,6 +4,9 @@ * * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * + * 2004-12-25 Krzysztof Helt (krzysztof.h1@wp.pl) + * - fixed registers constrains in inline assembly declarations */ #include @@ -132,7 +135,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc) "mov %%o0, %0\n\t" "mov %%o1, %1\n\t" : "=r" (rs1), "=r" (rs2) - : + : "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc"); #ifdef DEBUG_MULDIV printk ("0x%x%08x\n", rs2, rs1); @@ -152,7 +155,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc) "mov %%o0, %0\n\t" "mov %%o1, %1\n\t" : "=r" (rs1), "=r" (rs2) - : + : "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc"); #ifdef DEBUG_MULDIV printk ("0x%x%08x\n", rs2, rs1); @@ -181,7 +184,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc) "mov %%o1, %0\n\t" "mov %%o0, %1\n\t" : "=r" (rs1), "=r" (rs2) - : "r" (regs->y) + : "r" (regs->y), "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "cc"); #ifdef DEBUG_MULDIV @@ -210,7 +213,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc) "mov %%o1, %0\n\t" "mov %%o0, %1\n\t" : "=r" (rs1), "=r" (rs2) - : "r" (regs->y) + : "r" (regs->y), "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "cc"); #ifdef DEBUG_MULDIV diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index c982473d1..597d3ff6a 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -161,7 +161,7 @@ static struct pcic_sn2list pcic_known_sysnames[] = { static int pcic0_up; static struct linux_pcic pcic0; -unsigned int pcic_regs; +void * __iomem pcic_regs; volatile int pcic_speculative; volatile int pcic_trapped; @@ -313,8 +313,7 @@ int __init pcic_probe(void) pcic0_up = 1; pcic->pcic_res_regs.name = "pcic_registers"; - pcic->pcic_regs = (unsigned long) - ioremap(regs[0].phys_addr, regs[0].reg_size); + pcic->pcic_regs = ioremap(regs[0].phys_addr, regs[0].reg_size); if (!pcic->pcic_regs) { prom_printf("PCIC: Error, cannot map PCIC registers.\n"); prom_halt(); @@ -328,7 +327,7 @@ int __init pcic_probe(void) } pcic->pcic_res_cfg_addr.name = "pcic_cfg_addr"; - if ((pcic->pcic_config_space_addr = (unsigned long) + if ((pcic->pcic_config_space_addr = ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == 0) { prom_printf("PCIC: Error, cannot map" "PCI Configuration Space Address.\n"); @@ -340,7 +339,7 @@ int __init pcic_probe(void) * must be the same. Thus, we need adjust size of data. */ pcic->pcic_res_cfg_data.name = "pcic_cfg_data"; - if ((pcic->pcic_config_space_data = (unsigned long) + if ((pcic->pcic_config_space_data = ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == 0) { prom_printf("PCIC: Error, cannot map" "PCI Configuration Space Data.\n"); @@ -603,7 +602,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node) */ void __init pcibios_fixup_bus(struct pci_bus *bus) { - struct list_head *walk; + struct pci_dev *dev; int i, has_io, has_mem; unsigned int cmd; struct linux_pcic *pcic; @@ -625,9 +624,7 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) return; } - walk = &bus->devices; - for (walk = walk->next; walk != &bus->devices; walk = walk->next) { - struct pci_dev *dev = pci_dev_b(walk); + list_for_each_entry(dev, &bus->devices, bus_list) { /* * Comment from i386 branch: @@ -716,6 +713,9 @@ static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs) write_seqlock(&xtime_lock); /* Dummy, to show that we remember */ pcic_clear_clock_irq(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -975,60 +975,66 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource) * We do not use horroble macroses here because we want to * advance pointer by sizeof(size). */ -void outsb(unsigned long addr, const void *src, unsigned long count) { +void outsb(unsigned long addr, const void *src, unsigned long count) +{ while (count) { count -= 1; - writeb(*(const char *)src, addr); + outb(*(const char *)src, addr); src += 1; - addr += 1; + /* addr += 1; */ } } -void outsw(unsigned long addr, const void *src, unsigned long count) { +void outsw(unsigned long addr, const void *src, unsigned long count) +{ while (count) { count -= 2; - writew(*(const short *)src, addr); + outw(*(const short *)src, addr); src += 2; - addr += 2; + /* addr += 2; */ } } -void outsl(unsigned long addr, const void *src, unsigned long count) { +void outsl(unsigned long addr, const void *src, unsigned long count) +{ while (count) { count -= 4; - writel(*(const long *)src, addr); + outl(*(const long *)src, addr); src += 4; - addr += 4; + /* addr += 4; */ } } -void insb(unsigned long addr, void *dst, unsigned long count) { +void insb(unsigned long addr, void *dst, unsigned long count) +{ while (count) { count -= 1; - *(unsigned char *)dst = readb(addr); + *(unsigned char *)dst = inb(addr); dst += 1; - addr += 1; + /* addr += 1; */ } } -void insw(unsigned long addr, void *dst, unsigned long count) { +void insw(unsigned long addr, void *dst, unsigned long count) +{ while (count) { count -= 2; - *(unsigned short *)dst = readw(addr); + *(unsigned short *)dst = inw(addr); dst += 2; - addr += 2; + /* addr += 2; */ } } -void insl(unsigned long addr, void *dst, unsigned long count) { +void insl(unsigned long addr, void *dst, unsigned long count) +{ while (count) { count -= 4; /* * XXX I am sure we are in for an unaligned trap here. */ - *(unsigned long *)dst = readl(addr); + *(unsigned long *)dst = inl(addr); dst += 4; - addr += 4; + /* addr += 4; */ } } diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c index 869c2f13b..7eca8871f 100644 --- a/arch/sparc/kernel/pmc.c +++ b/arch/sparc/kernel/pmc.c @@ -30,7 +30,7 @@ #define PMC_IDLE_REG 0x00 #define PMC_IDLE_ON 0x01 -volatile static u8 *regs; +volatile static u8 __iomem *regs; static int pmc_regsize; #define pmc_readb(offs) (sbus_readb(regs+offs)) @@ -55,7 +55,7 @@ void pmc_swift_idle(void) static inline void pmc_free(void) { - sbus_iounmap((unsigned long)regs, pmc_regsize); + sbus_iounmap(regs, pmc_regsize); } static int __init pmc_probe(void) @@ -76,9 +76,9 @@ sbus_done: } pmc_regsize = sdev->reg_addrs[0].reg_size; - regs = (u8*) sbus_ioremap(&sdev->resource[0], 0, + regs = sbus_ioremap(&sdev->resource[0], 0, pmc_regsize, PMC_OBPNAME); - if(NULL == regs) { + if (!regs) { printk(KERN_ERR "%s: unable to map registers\n", PMC_DEVNAME); return -ENODEV; } diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 1dc918135..143fe2f3c 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -45,7 +45,7 @@ /* * Power management idle function - * Set in pm platform drivers + * Set in pm platform drivers (apc.c and pmc.c) */ void (*pm_idle)(void); @@ -81,10 +81,8 @@ void default_idle(void) /* * the idle loop on a Sparc... ;) */ -int cpu_idle(void) +void cpu_idle(void) { - int ret = -EPERM; - if (current->pid != 0) goto out; @@ -122,21 +120,20 @@ int cpu_idle(void) } while((!need_resched()) && pm_idle) { - (*pm_idle)(); /* XXX Huh? On sparc?! */ + (*pm_idle)(); } schedule(); check_pgt_cache(); } - ret = 0; out: - return ret; + return; } #else /* This is being executed in task 0 'user space'. */ -int cpu_idle(void) +void cpu_idle(void) { /* endless idle loop with no priority at all */ while(1) { @@ -201,7 +198,7 @@ void machine_power_off(void) EXPORT_SYMBOL(machine_power_off); -static spinlock_t sparc_backtrace_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sparc_backtrace_lock); void __show_backtrace(unsigned long fp) { @@ -480,8 +477,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, #endif } - p->set_child_tid = p->clear_child_tid = NULL; - /* * p->thread_info new_stack childregs * ! ! ! {if(PSR_PS) } @@ -554,6 +549,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, } } +#ifdef CONFIG_SMP + /* FPU must be disabled on SMP. */ + childregs->psr &= ~PSR_EF; +#endif + /* Set the return value for the child. */ childregs->u_regs[UREG_I0] = current->pid; childregs->u_regs[UREG_I1] = 1; @@ -604,7 +604,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump) */ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs) { - if (current->used_math == 0) { + if (used_math()) { memset(fpregs, 0, sizeof(*fpregs)); fpregs->pr_q_entrysize = 8; return 1; @@ -670,8 +670,11 @@ asmlinkage int sparc_execve(struct pt_regs *regs) (char __user * __user *)regs->u_regs[base + UREG_I2], regs); putname(filename); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } out: return error; } diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index d39739182..6081e350a 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c @@ -48,9 +48,9 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value) } static void -pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) +pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long __user *addr) { - if (put_user(value, (long __user *) addr)) { + if (put_user(value, addr)) { pt_error_return(regs, EFAULT); return; } @@ -61,7 +61,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) } static void -pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) +pt_os_succ_return (struct pt_regs *regs, unsigned long val, long __user *addr) { if (current->personality == PER_SUNOS) pt_succ_return (regs, val); @@ -71,7 +71,7 @@ pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) /* Fuck me gently with a chainsaw... */ static inline void read_sunos_user(struct pt_regs *regs, unsigned long offset, - struct task_struct *tsk, long *addr) + struct task_struct *tsk, long __user *addr) { struct pt_regs *cregs = tsk->thread.kregs; struct thread_info *t = tsk->thread_info; @@ -349,14 +349,14 @@ asmlinkage void do_ptrace(struct pt_regs *regs) if (access_process_vm(child, addr, &tmp, sizeof(tmp), 0) == sizeof(tmp)) - pt_os_succ_return(regs, tmp, (long *)data); + pt_os_succ_return(regs, tmp, (long __user *)data); else pt_error_return(regs, EIO); goto out_tsk; } case PTRACE_PEEKUSR: - read_sunos_user(regs, addr, child, (long *) data); + read_sunos_user(regs, addr, child, (long __user *) data); goto out_tsk; case PTRACE_POKEUSR: @@ -571,7 +571,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) * exit. */ case PTRACE_KILL: { - if (child->state == TASK_ZOMBIE) { /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) { /* already dead */ pt_succ_return(regs, 0); goto out_tsk; } diff --git a/arch/sparc/kernel/semaphore.c b/arch/sparc/kernel/semaphore.c index 77e63b92c..0c37c1a7c 100644 --- a/arch/sparc/kernel/semaphore.c +++ b/arch/sparc/kernel/semaphore.c @@ -44,7 +44,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index 276860da5..ec74a93e6 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c @@ -20,9 +20,9 @@ #include #include #include /* do_coredum */ +#include #include -#include #include #include #include @@ -202,7 +202,7 @@ restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) regs->psr &= ~PSR_EF; } #endif - current->used_math = 1; + set_used_math(); clear_tsk_thread_flag(current, TIF_USEDFPU); if (verify_area(VERIFY_READ, fpu, sizeof(*fpu))) @@ -535,7 +535,7 @@ setup_frame(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *old sig_address = NULL; } } - err |= __put_user((long)sig_address, &sframep->sig_address); + err |= __put_user((unsigned long)sig_address, &sframep->sig_address); err |= __put_user(sig_code, &sframep->sig_code); err |= __put_user(sc, &sframep->sig_scptr); if (err) @@ -584,7 +584,7 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) ¤t->thread.fpqueue[0], ((sizeof(unsigned long) + (sizeof(unsigned long *)))*16)); - current->used_math = 0; + clear_used_math(); return err; } @@ -599,7 +599,7 @@ new_setup_frame(struct k_sigaction *ka, struct pt_regs *regs, synchronize_user_stack(); sigframe_size = NF_ALIGNEDSZ; - if (!current->used_math) + if (!used_math()) sigframe_size -= sizeof(__siginfo_fpu_t); sf = (struct new_signal_frame __user *) @@ -616,7 +616,7 @@ new_setup_frame(struct k_sigaction *ka, struct pt_regs *regs, err |= __put_user(0, &sf->extra_size); - if (current->used_math) { + if (used_math()) { err |= save_fpu_state(regs, &sf->fpu_state); err |= __put_user(&sf->fpu_state, &sf->fpu_save); } else { @@ -677,7 +677,7 @@ new_setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, synchronize_user_stack(); sigframe_size = RT_ALIGNEDSZ; - if (!current->used_math) + if (!used_math()) sigframe_size -= sizeof(__siginfo_fpu_t); sf = (struct rt_signal_frame __user *) get_sigframe(&ka->sa, regs, sigframe_size); @@ -690,7 +690,7 @@ new_setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, err |= __put_user(regs->npc, &sf->regs.npc); err |= __put_user(regs->y, &sf->regs.y); psr = regs->psr; - if (current->used_math) + if (used_math()) psr |= PSR_EF; err |= __put_user(psr, &sf->regs.psr); err |= __copy_to_user(&sf->regs.u_regs, regs->u_regs, sizeof(regs->u_regs)); @@ -832,7 +832,7 @@ setup_svr4_frame(struct sigaction *sa, unsigned long pc, unsigned long npc, * to flush the user windows. */ for (window = 0; window < tp->w_saved; window++) { - err |= __put_user((int *) &(gw->win[window]), &gw->winptr[window]); + err |= __put_user((int __user *) &(gw->win[window]), &gw->winptr[window]); err |= __copy_to_user(&gw->win[window], &tp->reg_window[window], sizeof(svr4_rwindow_t)); @@ -1016,6 +1016,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs) sigsegv_and_return: force_sig(SIGSEGV, current); + return -EFAULT; } static inline void diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c index f11dd14db..6cd0307a6 100644 --- a/arch/sparc/kernel/smp.c +++ b/arch/sparc/kernel/smp.c @@ -234,7 +234,7 @@ void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) extern unsigned int lvl14_resolution; /* /proc/profile writes can call this, don't __init it please. */ -static spinlock_t prof_setup_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(prof_setup_lock); int setup_profiling_timer(unsigned int multiplier) { diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 7282bc3ee..a7df400e9 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -75,7 +75,6 @@ extern void *__memscan_generic(void *, int, size_t); extern int __memcmp(const void *, const void *, __kernel_size_t); extern int __strncmp(const char *, const char *, __kernel_size_t); -extern void bcopy (const char *, char *, int); extern int __ashrdi3(int, int); extern int __ashldi3(int, int); extern int __lshrdi3(int, int); @@ -203,6 +202,10 @@ EXPORT_SYMBOL(sbus_ioremap); #endif #ifdef CONFIG_PCI EXPORT_SYMBOL(ebus_chain); +EXPORT_SYMBOL(insb); +EXPORT_SYMBOL(outsb); +EXPORT_SYMBOL(insw); +EXPORT_SYMBOL(outsw); EXPORT_SYMBOL(insl); EXPORT_SYMBOL(outsl); EXPORT_SYMBOL(pci_alloc_consistent); @@ -261,7 +264,6 @@ EXPORT_SYMBOL(__prom_getchild); EXPORT_SYMBOL(__prom_getsibling); /* sparc library symbols */ -EXPORT_SYMBOL(bcopy); EXPORT_SYMBOL(memchr); EXPORT_SYMBOL(memscan); EXPORT_SYMBOL(strlen); diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index 96ca38871..3d6a99073 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c @@ -217,13 +217,18 @@ void __init sun4c_init_IRQ(void) panic("Cannot find /interrupt-enable node"); /* Depending on the "address" property is bad news... */ - prom_getproperty(ie_node, "reg", (char *) int_regs, sizeof(int_regs)); - memset(&phyres, 0, sizeof(struct resource)); - phyres.flags = int_regs[0].which_io; - phyres.start = int_regs[0].phys_addr; - interrupt_enable = (char *) sbus_ioremap(&phyres, 0, - int_regs[0].reg_size, "sun4c_intr"); + interrupt_enable = NULL; + if (prom_getproperty(ie_node, "reg", (char *) int_regs, + sizeof(int_regs)) != -1) { + memset(&phyres, 0, sizeof(struct resource)); + phyres.flags = int_regs[0].which_io; + phyres.start = int_regs[0].phys_addr; + interrupt_enable = (char *) sbus_ioremap(&phyres, 0, + int_regs[0].reg_size, "sun4c_intr"); + } } + if (!interrupt_enable) + panic("Cannot map interrupt_enable"); BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 81223f882..52621348a 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c @@ -72,7 +72,7 @@ static int sbus_to_pil[] = { static int nsbi; #ifdef CONFIG_SMP -spinlock_t sun4d_imsk_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(sun4d_imsk_lock); #endif int show_sun4d_interrupts(struct seq_file *p, void *v) diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 1de4c8a39..ea209f056 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -122,8 +122,7 @@ void __init smp4d_callin(void) /* Fix idle thread fields. */ __asm__ __volatile__("ld [%0], %%g6\n\t" - "sta %%g6, [%%g0] %1\n\t" - : : "r" (¤t_set[cpuid]), "i" (ASI_M_VIKING_TMP2) + : : "r" (¤t_set[cpuid]) : "memory" /* paranoid */); cpu_leds[cpuid] = 0x9; @@ -146,7 +145,6 @@ void __init smp4d_callin(void) spin_unlock_irqrestore(&sun4d_imsk_lock, flags); } -extern int cpu_idle(void *unused); extern void init_IRQ(void); extern void cpu_panic(void); @@ -302,7 +300,7 @@ static struct smp_funcall { unsigned char processors_out[NR_CPUS]; /* Set when ipi exited. */ } ccall_info __attribute__((aligned(8))); -static spinlock_t cross_call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cross_call_lock); /* Cross calls must be serialized, at least currently. */ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, @@ -399,7 +397,7 @@ void smp4d_message_pass(int target, int msg, unsigned long data, int wait) SMP_PRINTK(("smp4d_message_pass %d %d %08lx %d\n", target, msg, data, wait)); if (msg == MSG_STOP_CPU && target == MSG_ALL_BUT_SELF) { unsigned long flags; - static spinlock_t stop_cpu_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(stop_cpu_lock); spin_lock_irqsave(&stop_cpu_lock, flags); smp4d_stop_cpu_sender = me; smp4d_cross_call((smpfunc_t)smp4d_stop_cpu, 0, 0, 0, 0, 0); @@ -460,25 +458,18 @@ void __init smp4d_blackbox_id(unsigned *addr) void __init smp4d_blackbox_current(unsigned *addr) { - /* We have a nice Linux current register :) */ - int rd = addr[1] & 0x3e000000; + int rd = *addr & 0x3e000000; - addr[0] = 0x10800006; /* b .+24 */ - addr[1] = 0xc0800820 | rd; /* lda [%g0] ASI_M_VIKING_TMP2, reg */ + addr[0] = 0xc0800800 | rd; /* lda [%g0] ASI_M_VIKING_TMP1, reg */ + addr[2] = 0x81282002 | rd | (rd >> 11); /* sll reg, 2, reg */ + addr[4] = 0x01000000; /* nop */ } void __init sun4d_init_smp(void) { int i; - extern unsigned int patchme_store_new_current[]; extern unsigned int t_nmi[], linux_trap_ipi15_sun4d[], linux_trap_ipi15_sun4m[]; - /* Store current into Linux current register :) */ - __asm__ __volatile__("sta %%g6, [%%g0] %0" : : "i"(ASI_M_VIKING_TMP2)); - - /* Patch switch_to */ - patchme_store_new_current[0] = (patchme_store_new_current[0] & 0x3e000000) | 0xc0a00820; - /* Patch ipi15 trap table */ t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m); diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 100433e05..8e10d9502 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c @@ -121,7 +121,6 @@ void __init smp4m_callin(void) local_irq_enable(); } -extern int cpu_idle(void *unused); extern void init_IRQ(void); extern void cpu_panic(void); @@ -322,7 +321,7 @@ static struct smp_funcall { unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */ } ccall_info; -static spinlock_t cross_call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cross_call_lock); /* Cross calls must be serialized, at least currently. */ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c index 07879079a..4b5df5e2c 100644 --- a/arch/sparc/kernel/sys_sparc.c +++ b/arch/sparc/kernel/sys_sparc.c @@ -198,8 +198,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user goto out; } case 1: /* iBCS2 emulator entry point */ - err = do_shmat (first, (char __user *) ptr, - second, (ulong *) third); + err = -EINVAL; goto out; } case SHMDT: diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index b248f0576..ad049c1f3 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -178,7 +178,7 @@ asmlinkage int sunos_brk(unsigned long brk) * Check against rlimit and stack.. */ retval = -ENOMEM; - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim >= RLIM_INFINITY) rlim = ~0; if (brk - current->mm->end_code > rlim) diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index 5af2fc5bc..847a4ca63 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S @@ -75,7 +75,7 @@ sys_call_table: /*265*/ .long sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy /*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink /*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid -/*280*/ .long sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl #ifdef CONFIG_SUNOS_EMUL /* Now the SunOS syscall table. */ @@ -181,5 +181,6 @@ sunos_sys_table: .long sunos_nosys, sunos_nosys, sunos_nosys .long sunos_nosys /*280*/ .long sunos_nosys, sunos_nosys, sunos_nosys + .long sunos_nosys #endif diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 60507d394..6486cbf2e 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -50,10 +50,10 @@ u64 jiffies_64 = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); enum sparc_clock_type sp_clock_typ; -spinlock_t mostek_lock = SPIN_LOCK_UNLOCKED; -unsigned long mstk48t02_regs = 0UL; +DEFINE_SPINLOCK(mostek_lock); +void __iomem *mstk48t02_regs = NULL; static struct mostek48t08 *mstk48t08_regs = NULL; static int set_rtc_mmss(unsigned long); static int sbus_do_settimeofday(struct timespec *tv); @@ -134,6 +134,10 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) clear_clock_irq(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif + /* Determine when to update the Mostek clock. */ if ((time_status & STA_UNSYNC) == 0 && @@ -346,7 +350,7 @@ static __inline__ void clock_probe(void) mstk48t08_regs = (struct mostek48t08 *) sbus_ioremap(&r, 0, sizeof(struct mostek48t08), "mk48t08"); - mstk48t02_regs = (unsigned long)&mstk48t08_regs->regs; + mstk48t02_regs = &mstk48t08_regs->regs; } else { prom_printf("CLOCK: Unknown model name '%s'\n",model); prom_halt(); diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c index ceb4a8f29..3f451ae66 100644 --- a/arch/sparc/kernel/traps.c +++ b/arch/sparc/kernel/traps.c @@ -246,17 +246,17 @@ void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, &fptask->thread.fpqueue[0], &fptask->thread.fpqdepth); } last_task_used_math = current; - if(current->used_math) { + if(used_math()) { fpload(¤t->thread.float_regs[0], ¤t->thread.fsr); } else { /* Set initial sane state. */ fpload(&init_fregs[0], &init_fsr); - current->used_math = 1; + set_used_math(); } #else - if(!current->used_math) { + if(!used_math()) { fpload(&init_fregs[0], &init_fsr); - current->used_math = 1; + set_used_math(); } else { fpload(¤t->thread.float_regs[0], ¤t->thread.fsr); } diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c index e28a6af2a..19724c580 100644 --- a/arch/sparc/lib/atomic32.c +++ b/arch/sparc/lib/atomic32.c @@ -20,8 +20,9 @@ spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = { #else /* SMP */ +static spinlock_t dummy = SPIN_LOCK_UNLOCKED; #define ATOMIC_HASH_SIZE 1 -#define ATOMIC_HASH(a) 0 +#define ATOMIC_HASH(a) (&dummy) #endif /* SMP */ diff --git a/arch/sparc/lib/bitext.c b/arch/sparc/lib/bitext.c index f375c8e36..94b05e8c9 100644 --- a/arch/sparc/lib/bitext.c +++ b/arch/sparc/lib/bitext.c @@ -10,9 +10,9 @@ */ #include +#include #include -#include /** * bit_map_string_get - find and set a bit string in bit map. @@ -29,10 +29,17 @@ int bit_map_string_get(struct bit_map *t, int len, int align) int offset, count; /* siamese twins */ int off_new; int align1; - int i; + int i, color; - if (align == 0) - align = 1; + if (t->num_colors) { + /* align is overloaded to be the page color */ + color = align; + align = t->num_colors; + } else { + color = 0; + if (align == 0) + align = 1; + } align1 = align - 1; if ((align & align1) != 0) BUG(); @@ -40,6 +47,7 @@ int bit_map_string_get(struct bit_map *t, int len, int align) BUG(); if (len <= 0 || len > t->size) BUG(); + color &= align1; spin_lock(&t->lock); if (len < t->last_size) @@ -49,7 +57,7 @@ int bit_map_string_get(struct bit_map *t, int len, int align) count = 0; for (;;) { off_new = find_next_zero_bit(t->map, t->size, offset); - off_new = (off_new + align1) & ~align1; + off_new = ((off_new + align1) & ~align1) + color; count += off_new - offset; offset = off_new; if (offset >= t->size) @@ -121,6 +129,4 @@ void bit_map_init(struct bit_map *t, unsigned long *map, int size) spin_lock_init(&t->lock); t->map = map; t->size = size; - t->last_size = 0; - t->first_free = 0; } diff --git a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S index eb6a9e759..ce10bc869 100644 --- a/arch/sparc/lib/memcpy.S +++ b/arch/sparc/lib/memcpy.S @@ -1,5 +1,5 @@ -/* memcpy.S: Sparc optimized memcpy, bcopy and memmove code - * Hand optimized from GNU libc's memcpy, bcopy and memmove +/* memcpy.S: Sparc optimized memcpy and memmove code + * Hand optimized from GNU libc's memcpy and memmove * Copyright (C) 1991,1996 Free Software Foundation * Copyright (C) 1995 Linus Torvalds (Linus.Torvalds@helsinki.fi) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -192,13 +192,6 @@ x: retl nop ! Only bcopy returns here and it retuns void... -FUNC(bcopy) - mov %o0, %o3 - mov %o1, %o0 - mov %o3, %o1 - tst %o2 - bcs 0b - /* Do the cmp in the delay slot */ #ifdef __KERNEL__ FUNC(amemmove) FUNC(__memmove) diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c index dde63e16c..37f4107ba 100644 --- a/arch/sparc/mm/fault.c +++ b/arch/sparc/mm/fault.c @@ -294,16 +294,17 @@ good_area: * the fault. */ switch (handle_mm_fault(mm, vma, address, write)) { - case 1: - current->min_flt++; - break; - case 2: + case VM_FAULT_SIGBUS: + goto do_sigbus; + case VM_FAULT_OOM: + goto out_of_memory; + case VM_FAULT_MAJOR: current->maj_flt++; break; - case 0: - goto do_sigbus; + case VM_FAULT_MINOR: default: - goto out_of_memory; + current->min_flt++; + break; } up_read(&mm->mmap_sem); return; @@ -535,8 +536,11 @@ good_area: if(!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } - if (!handle_mm_fault(mm, vma, address, write)) + switch (handle_mm_fault(mm, vma, address, write)) { + case VM_FAULT_SIGBUS: + case VM_FAULT_OOM: goto do_sigbus; + } up_read(&mm->mmap_sem); return; bad_area: diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c index 6d2febb04..f4c6851b5 100644 --- a/arch/sparc/mm/generic.c +++ b/arch/sparc/mm/generic.c @@ -41,7 +41,7 @@ static inline void forget_pte(pte_t page) #endif } -/* Remap IO memory, the same way as remap_page_range(), but use +/* Remap IO memory, the same way as remap_pfn_range(), but use * the obio memory space. * * They use a pgprot that sets PAGE_IO and does not check the diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index 8f9eb0454..c85d4923d 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c @@ -36,7 +36,7 @@ void *kmap_atomic(struct page *page, enum km_type type) /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ inc_preempt_count(); - if (page < highmem_start_page) + if (!PageHighMem(page)) return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c index cdc04590d..5249a377a 100644 --- a/arch/sparc/mm/init.c +++ b/arch/sparc/mm/init.c @@ -402,8 +402,6 @@ void __init mem_init(void) int reservedpages = 0; int i; - highmem_start_page = pfn_to_page(highstart_pfn); - if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) { prom_printf("BUG: fixmap and pkmap areas overlap\n"); prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n", diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 7eddc56b7..eefffa1dc 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -11,6 +11,7 @@ #include #include #include /* pte_offset_map => kmap_atomic */ +#include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -52,13 +52,15 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) iounit->rotor[1] = IOUNIT_BMAP2_START; iounit->rotor[2] = IOUNIT_BMAPM_START; - prom_getproperty(sbi_node, "reg", (void *) iommu_promregs, - sizeof(iommu_promregs)); - prom_apply_generic_ranges(io_node, 0, iommu_promregs, 3); - memset(&r, 0, sizeof(r)); - r.flags = iommu_promregs[2].which_io; - r.start = iommu_promregs[2].phys_addr; - xpt = (iopte_t *) sbus_ioremap(&r, 0, PAGE_SIZE * 16, "XPT"); + xpt = NULL; + if(prom_getproperty(sbi_node, "reg", (void *) iommu_promregs, + sizeof(iommu_promregs)) != -1) { + prom_apply_generic_ranges(io_node, 0, iommu_promregs, 3); + memset(&r, 0, sizeof(r)); + r.flags = iommu_promregs[2].which_io; + r.start = iommu_promregs[2].phys_addr; + xpt = (iopte_t *) sbus_ioremap(&r, 0, PAGE_SIZE * 16, "XPT"); + } if(!xpt) panic("Cannot map External Page Table."); sbus->iommu = (struct iommu_struct *)iounit; @@ -196,7 +198,7 @@ static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, in pte_t *ptep; long i; - pgdp = pgd_offset(init_task.mm, addr); + pgdp = pgd_offset(&init_mm, addr); pmdp = pmd_offset(pgdp, addr); ptep = pte_offset_map(pmdp, addr); diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index b661ca03a..489bf68d5 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -71,14 +71,16 @@ iommu_init(int iommund, struct sbus_bus *sbus) prom_printf("Unable to allocate iommu structure\n"); prom_halt(); } - prom_getproperty(iommund, "reg", (void *) iommu_promregs, - sizeof(iommu_promregs)); - memset(&r, 0, sizeof(r)); - r.flags = iommu_promregs[0].which_io; - r.start = iommu_promregs[0].phys_addr; - iommu->regs = (struct iommu_regs *) - sbus_ioremap(&r, 0, PAGE_SIZE * 3, "iommu_regs"); - if(!iommu->regs) { + iommu->regs = NULL; + if (prom_getproperty(iommund, "reg", (void *) iommu_promregs, + sizeof(iommu_promregs)) != -1) { + memset(&r, 0, sizeof(r)); + r.flags = iommu_promregs[0].which_io; + r.start = iommu_promregs[0].phys_addr; + iommu->regs = (struct iommu_regs *) + sbus_ioremap(&r, 0, PAGE_SIZE * 3, "iommu_regs"); + } + if (!iommu->regs) { prom_printf("Cannot map IOMMU registers\n"); prom_halt(); } @@ -119,6 +121,13 @@ iommu_init(int iommund, struct sbus_bus *sbus) prom_halt(); } bit_map_init(&iommu->usemap, bitmap, IOMMU_NPTES); + /* To be coherent on HyperSparc, the page color of DVMA + * and physical addresses must match. + */ + if (srmmu_modtype == HyperSparc) + iommu->usemap.num_colors = vac_cache_size >> PAGE_SHIFT; + else + iommu->usemap.num_colors = 1; printk("IOMMU: impl %d vers %d table 0x%p[%d B] map [%d b]\n", impl, vers, iommu->page_table, @@ -128,7 +137,9 @@ iommu_init(int iommund, struct sbus_bus *sbus) } /* This begs to be btfixup-ed by srmmu. */ -static void iommu_viking_flush_iotlb(iopte_t *iopte, unsigned int niopte) +/* Flush the iotlb entries to ram. */ +/* This could be better if we didn't have to flush whole pages. */ +static void iommu_flush_iotlb(iopte_t *iopte, unsigned int niopte) { unsigned long start; unsigned long end; @@ -145,6 +156,11 @@ static void iommu_viking_flush_iotlb(iopte_t *iopte, unsigned int niopte) viking_flush_page(start); start += PAGE_SIZE; } + } else { + while(start < end) { + __flush_page_to_ram(start); + start += PAGE_SIZE; + } } } @@ -156,7 +172,8 @@ static u32 iommu_get_one(struct page *page, int npages, struct sbus_bus *sbus) unsigned int busa, busa0; int i; - ioptex = bit_map_string_get(&iommu->usemap, npages, 1); + /* page color = pfn of page */ + ioptex = bit_map_string_get(&iommu->usemap, npages, page_to_pfn(page)); if (ioptex < 0) panic("iommu out"); busa0 = iommu->start + (ioptex << PAGE_SHIFT); @@ -172,7 +189,7 @@ static u32 iommu_get_one(struct page *page, int npages, struct sbus_bus *sbus) page++; } - iommu_viking_flush_iotlb(iopte0, npages); + iommu_flush_iotlb(iopte0, npages); return busa0; } @@ -327,7 +344,9 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va, if ((addr & ~PAGE_MASK) != 0) BUG(); if ((len & ~PAGE_MASK) != 0) BUG(); - ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT, 1); + /* page color = physical address */ + ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT, + addr >> PAGE_SHIFT); if (ioptex < 0) panic("iommu out"); @@ -371,7 +390,7 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va, * to handle the latter case as well. */ flush_cache_all(); - iommu_viking_flush_iotlb(first, len >> PAGE_SHIFT); + iommu_flush_iotlb(first, len >> PAGE_SHIFT); flush_tlb_all(); iommu_invalidate(iommu->regs); diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index d5593b5d2..533946c57 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -88,7 +88,7 @@ ctxd_t *srmmu_ctx_table_phys; ctxd_t *srmmu_context_table; int viking_mxcc_present; -static spinlock_t srmmu_context_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(srmmu_context_spinlock); int is_hypersparc; @@ -133,11 +133,12 @@ static struct bit_map srmmu_nocache_map; static unsigned long srmmu_pte_pfn(pte_t pte) { if (srmmu_device_memory(pte_val(pte))) { - /* XXX Anton obviously had something in mind when he did this. - * But what? + /* Just return something that will cause + * pfn_valid() to return false. This makes + * copy_one_pte() to just directly copy to + * PTE over. */ - /* return (struct page *)~0; */ - BUG(); + return ~0UL; } return (pte_val(pte) & SRMMU_PTE_PMASK) >> (PAGE_SHIFT-4); } @@ -1463,6 +1464,7 @@ static void __init poke_hypersparc(void) static void __init init_hypersparc(void) { srmmu_name = "ROSS HyperSparc"; + srmmu_modtype = HyperSparc; init_vac_layout(); @@ -2196,6 +2198,7 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(free_pgd_fast, srmmu_free_pgd_fast, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(get_pgd_fast, srmmu_get_pgd_fast, BTFIXUPCALL_NORM); + BTFIXUPSET_HALF(pte_readi, SRMMU_NOREAD); BTFIXUPSET_HALF(pte_writei, SRMMU_WRITE); BTFIXUPSET_HALF(pte_dirtyi, SRMMU_DIRTY); BTFIXUPSET_HALF(pte_youngi, SRMMU_REF); diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index fd85c7b01..6f91a3e2b 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -511,7 +511,8 @@ void __init sun4c_probe_memerr_reg(void) node = prom_searchsiblings(prom_root_node, "memory-error"); if (!node) return; - prom_getproperty(node, "reg", (char *)regs, sizeof(regs)); + if (prom_getproperty(node, "reg", (char *)regs, sizeof(regs)) <= 0) + return; /* hmm I think regs[0].which_io is zero here anyways */ sun4c_memerr_reg = ioremap(regs[0].phys_addr, regs[0].reg_size); } @@ -2225,6 +2226,7 @@ void __init ld_mmu_sun4c(void) BTFIXUPSET_CALL(free_pgd_fast, sun4c_free_pgd_fast, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(get_pgd_fast, sun4c_get_pgd_fast, BTFIXUPCALL_NORM); + BTFIXUPSET_HALF(pte_readi, _SUN4C_PAGE_READ); BTFIXUPSET_HALF(pte_writei, _SUN4C_PAGE_WRITE); BTFIXUPSET_HALF(pte_dirtyi, _SUN4C_PAGE_MODIFIED); BTFIXUPSET_HALF(pte_youngi, _SUN4C_PAGE_ACCESSED); diff --git a/arch/sparc/prom/console.c b/arch/sparc/prom/console.c index d54a51efe..4e6e41d32 100644 --- a/arch/sparc/prom/console.c +++ b/arch/sparc/prom/console.c @@ -111,6 +111,7 @@ prom_query_input_device(void) int st_p; char propb[64]; char *p; + int propl; switch(prom_vers) { case PROM_V0: @@ -139,14 +140,16 @@ prom_query_input_device(void) if(strncmp(propb, "serial", sizeof("serial"))) return PROMDEV_I_UNK; } - prom_getproperty(prom_root_node, "stdin-path", propb, sizeof(propb)); - p = propb; - while(*p) p++; p -= 2; - if(p[0] == ':') { - if(p[1] == 'a') - return PROMDEV_ITTYA; - else if(p[1] == 'b') - return PROMDEV_ITTYB; + propl = prom_getproperty(prom_root_node, "stdin-path", propb, sizeof(propb)); + if(propl > 2) { + p = propb; + while(*p) p++; p -= 2; + if(p[0] == ':') { + if(p[1] == 'a') + return PROMDEV_ITTYA; + else if(p[1] == 'b') + return PROMDEV_ITTYB; + } } return PROMDEV_I_UNK; } @@ -179,7 +182,7 @@ prom_query_output_device(void) restore_current(); spin_unlock_irqrestore(&prom_lock, flags); propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb)); - if (propl >= 0 && propl == sizeof("display") && + if (propl == sizeof("display") && strncmp("display", propb, sizeof("display")) == 0) { return PROMDEV_OSCREEN; @@ -188,16 +191,20 @@ prom_query_output_device(void) if(propl >= 0 && strncmp("serial", propb, sizeof("serial")) != 0) return PROMDEV_O_UNK; - prom_getproperty(prom_root_node, "stdout-path", propb, sizeof(propb)); - if(strncmp(propb, con_name_jmc, CON_SIZE_JMC) == 0) + propl = prom_getproperty(prom_root_node, "stdout-path", + propb, sizeof(propb)); + if(propl == CON_SIZE_JMC && + strncmp(propb, con_name_jmc, CON_SIZE_JMC) == 0) return PROMDEV_OTTYA; - p = propb; - while(*p) p++; p -= 2; - if(p[0]==':') { - if(p[1] == 'a') - return PROMDEV_OTTYA; - else if(p[1] == 'b') - return PROMDEV_OTTYB; + if(propl > 2) { + p = propb; + while(*p) p++; p-= 2; + if(p[0]==':') { + if(p[1] == 'a') + return PROMDEV_OTTYA; + else if(p[1] == 'b') + return PROMDEV_OTTYB; + } } } else { switch(*romvec->pv_stdin) { diff --git a/arch/sparc/prom/misc.c b/arch/sparc/prom/misc.c index 5c7aa0c97..c840c2062 100644 --- a/arch/sparc/prom/misc.c +++ b/arch/sparc/prom/misc.c @@ -16,7 +16,7 @@ extern void restore_current(void); -spinlock_t prom_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(prom_lock); /* Reset and reboot the machine with the command 'bcommand'. */ void diff --git a/arch/sparc/prom/ranges.c b/arch/sparc/prom/ranges.c index 96e3a342b..a2920323c 100644 --- a/arch/sparc/prom/ranges.c +++ b/arch/sparc/prom/ranges.c @@ -34,7 +34,7 @@ prom_adjust_regs(struct linux_prom_registers *regp, int nregs, } } -static void +void prom_adjust_ranges(struct linux_prom_ranges *ranges1, int nranges1, struct linux_prom_ranges *ranges2, int nranges2) { diff --git a/arch/sparc/prom/tree.c b/arch/sparc/prom/tree.c index adfe6e75a..2bf03ee8c 100644 --- a/arch/sparc/prom/tree.c +++ b/arch/sparc/prom/tree.c @@ -176,8 +176,11 @@ void prom_getstring(int node, char *prop, char *user_buf, int ubuf_size) */ int prom_nodematch(int node, char *name) { + int error; + static char namebuf[128]; - prom_getproperty(node, "name", namebuf, sizeof(namebuf)); + error = prom_getproperty(node, "name", namebuf, sizeof(namebuf)); + if (error == -1) return 0; if(strcmp(namebuf, name) == 0) return 1; return 0; } diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index 0bcd075f2..5b0c737d4 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig @@ -18,6 +18,11 @@ config TIME_INTERPOLATION source "init/Kconfig" +config SYSVIPC_COMPAT + bool + depends on COMPAT && SYSVIPC + default y + menu "General machine setup" config BBC_I2C @@ -92,8 +97,8 @@ config SMP bool "Symmetric multi-processing support" ---help--- This enables support for systems with more than one CPU. If you have - a system with only one CPU, like most personal computers, say N. If - you have a system with more than one CPU, say Y. + a system with only one CPU, say N. If you have a system with more than + one CPU, say Y. If you say N here, the kernel will run on single and multiprocessor machines, but will use only one CPU of a multiprocessor machine. If @@ -101,17 +106,11 @@ config SMP singleprocessor machines. On a singleprocessor machine, the kernel will run faster if you say N here. - Note that if you say Y here and choose architecture "586" or - "Pentium" under "Processor family", the kernel will not work on 486 - architectures. Similarly, multiprocessor kernels for the "PPro" - architecture may not work on all Pentium based boards. - People using multiprocessor machines who say Y here should also say Y to "Enhanced Real Time Clock Support", below. The "Advanced Power Management" code will be disabled if you say Y here. See also the , - , and the SMP-HOWTO available at . @@ -135,16 +134,7 @@ config NR_CPUS depends on SMP default "32" -config CPU_FREQ - bool "CPU Frequency scaling" - help - Clock scaling allows you to change the clock speed of CPUs on the - fly. Currently there are only sparc64 drivers for UltraSPARC-III - and UltraSPARC-IIe processors. - - For details, take a look at . - - If in doubt, say N. +source "drivers/cpufreq/Kconfig" config CPU_FREQ_TABLE tristate "CPU frequency table helpers" @@ -176,8 +166,6 @@ config US2E_FREQ If in doubt, say N. -source "drivers/cpufreq/Kconfig" - # Identify this as a Sparc64 build config SPARC64 bool @@ -197,6 +185,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + choice prompt "SPARC64 Huge TLB Page Size" depends on HUGETLB_PAGE @@ -567,7 +559,7 @@ config DRM config DRM_FFB tristate "Creator/Creator3D" - depends on DRM + depends on DRM && BROKEN help Choose this option if you have one of Sun's Creator3D-based graphics and frame buffer cards. Product page at @@ -602,6 +594,8 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" +source "drivers/infiniband/Kconfig" + source "drivers/char/watchdog/Kconfig" source "arch/sparc64/oprofile/Kconfig" diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile index 58d4c91ca..61724880f 100644 --- a/arch/sparc64/Makefile +++ b/arch/sparc64/Makefile @@ -8,7 +8,7 @@ # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) # -CHECKFLAGS += -D__sparc__ -D__sparc_v9__ +CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -m64 CPPFLAGS_vmlinux.lds += -Usparc diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 1b2f3c2cb..edf1c6b06 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc3 -# Sun Oct 3 14:28:53 2004 +# Linux kernel version: 2.6.11-rc4 +# Thu Feb 17 15:32:19 2005 # CONFIG_64BIT=y CONFIG_MMU=y @@ -12,6 +12,7 @@ CONFIG_TIME_INTERPOLATION=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -25,6 +26,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y @@ -32,12 +34,12 @@ CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -48,8 +50,10 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y # # General machine setup @@ -62,19 +66,21 @@ CONFIG_SMP=y # CONFIG_PREEMPT is not set CONFIG_NR_CPUS=4 CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_TABLE=y -CONFIG_US3_FREQ=m -CONFIG_US2E_FREQ=m -CONFIG_CPU_FREQ_PROC_INTF=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=m CONFIG_CPU_FREQ_GOV_ONDEMAND=m -# CONFIG_CPU_FREQ_24_API is not set +CONFIG_CPU_FREQ_TABLE=y +CONFIG_US3_FREQ=m +CONFIG_US2E_FREQ=m CONFIG_SPARC64=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HUGETLB_PAGE_SIZE_4MB=y # CONFIG_HUGETLB_PAGE_SIZE_512K is not set # CONFIG_HUGETLB_PAGE_SIZE_64K is not set @@ -126,6 +132,7 @@ CONFIG_FW_LOADER=m # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y # CONFIG_FB_CIRRUS is not set CONFIG_FB_PM2=y # CONFIG_FB_PM2_FIFO_DISCONNECT is not set @@ -141,8 +148,10 @@ CONFIG_FB_CG6=y # CONFIG_FB_ATY128 is not set CONFIG_FB_ATY=y CONFIG_FB_ATY_CT=y -CONFIG_FB_ATY_GX=y +# CONFIG_FB_ATY_GENERIC_LCD is not set # CONFIG_FB_ATY_XL_INIT is not set +CONFIG_FB_ATY_GX=y +# CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set @@ -181,6 +190,7 @@ CONFIG_LOGO=y # CONFIG_LOGO_LINUX_VGA16 is not set # CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_LOGO_SUN_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Serial drivers @@ -220,12 +230,27 @@ CONFIG_OBP_FLASH=m # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_SX8=m CONFIG_BLK_DEV_UB=m # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +CONFIG_CDROM_PKTCDVD_WCACHE=y + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -244,7 +269,6 @@ CONFIG_BLK_DEV_IDETAPE=m # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes @@ -317,6 +341,7 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=m +CONFIG_SCSI_ISCSI_ATTRS=m # # SCSI low-level drivers @@ -338,6 +363,7 @@ CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y +CONFIG_SCSI_SATA_AHCI=m CONFIG_SCSI_SATA_SVW=m CONFIG_SCSI_ATA_PIIX=m CONFIG_SCSI_SATA_NV=m @@ -345,12 +371,14 @@ CONFIG_SCSI_SATA_PROMISE=m CONFIG_SCSI_SATA_SX4=m CONFIG_SCSI_SATA_SIL=m CONFIG_SCSI_SATA_SIS=m +CONFIG_SCSI_SATA_ULI=m CONFIG_SCSI_SATA_VIA=m CONFIG_SCSI_SATA_VITESSE=m CONFIG_SCSI_DMX3191D=m CONFIG_SCSI_EATA_PIO=m # CONFIG_SCSI_FUTURE_DOMAIN is not set CONFIG_SCSI_IPS=m +CONFIG_SCSI_INITIO=m CONFIG_SCSI_INIA100=m CONFIG_SCSI_PPA=m CONFIG_SCSI_IMM=m @@ -373,7 +401,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set CONFIG_SCSI_DC395x=m # CONFIG_SCSI_DC390T is not set CONFIG_SCSI_DEBUG=m @@ -408,6 +435,7 @@ CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m @@ -482,6 +510,8 @@ CONFIG_INET_AH=y CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_TUNNEL=y +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration @@ -532,6 +562,7 @@ CONFIG_BRIDGE_NETFILTER=y # CONFIG_IP_NF_CONNTRACK=m CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m @@ -562,6 +593,8 @@ CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m CONFIG_IP_NF_MATCH_SCTP=m CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m @@ -573,7 +606,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -585,13 +617,13 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m -CONFIG_IP_NF_COMPAT_IPCHAINS=m -CONFIG_IP_NF_COMPAT_IPFWADM=m # # IPv6: Netfilter Configuration @@ -645,6 +677,7 @@ CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -667,7 +700,6 @@ CONFIG_ATM_BR2684_IPFILTER=y CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m CONFIG_DECNET=m -CONFIG_DECNET_SIOCGIFCONF=y CONFIG_DECNET_ROUTER=y CONFIG_DECNET_ROUTE_FWMARK=y CONFIG_LLC=m @@ -681,7 +713,6 @@ CONFIG_LAPB=m CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -713,12 +744,16 @@ CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_CLS_U32_PERF=y CONFIG_NET_CLS_IND=y +CONFIG_CLS_U32_MARK=y CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_GACT=m CONFIG_GACT_PROB=y +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_PEDIT=m # # Network testing @@ -811,6 +846,7 @@ CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_BCSP_TXCRC=y CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m CONFIG_NETDEVICES=y @@ -862,7 +898,6 @@ CONFIG_B44=m CONFIG_FORCEDETH=m CONFIG_DGRS=m CONFIG_EEPRO100=m -# CONFIG_EEPRO100_PIO is not set CONFIG_E100=m CONFIG_E100_NAPI=y CONFIG_FEALNX=m @@ -880,7 +915,6 @@ CONFIG_SUNDANCE=m CONFIG_SUNDANCE_MMIO=y CONFIG_VIA_RHINE=m # CONFIG_VIA_RHINE_MMIO is not set -CONFIG_VIA_VELOCITY=m # # Ethernet (1000 Mbit) @@ -896,7 +930,9 @@ CONFIG_HAMACHI=m CONFIG_YELLOWFIN=m CONFIG_R8169=m CONFIG_R8169_NAPI=y +CONFIG_R8169_VLAN=y CONFIG_SK98LIN=m +CONFIG_VIA_VELOCITY=m CONFIG_TIGON3=m # @@ -906,6 +942,7 @@ CONFIG_IXGB=m CONFIG_IXGB_NAPI=y CONFIG_S2IO=m CONFIG_S2IO_NAPI=y +CONFIG_2BUFF_MODE=y # # Token Ring devices @@ -1014,6 +1051,11 @@ CONFIG_ISDN_CAPI_CAPI20=m # Active AVM cards # CONFIG_CAPI_AVM=y +CONFIG_ISDN_DRV_AVMB1_B1PCI=m +CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m +CONFIG_ISDN_DRV_AVMB1_T1PCI=m +CONFIG_ISDN_DRV_AVMB1_C4=m # # Active Eicon DIVA Server cards @@ -1042,7 +1084,6 @@ CONFIG_UNIX98_PTY_COUNT=256 # XFree86 DRI support # CONFIG_DRM=y -CONFIG_DRM_FFB=m CONFIG_DRM_TDFX=m # CONFIG_DRM_R128 is not set @@ -1073,13 +1114,14 @@ CONFIG_SOUND_GAMEPORT=m # CONFIG_GAMEPORT_EMU10K1 is not set # CONFIG_GAMEPORT_VORTEX is not set # CONFIG_GAMEPORT_FM801 is not set -# CONFIG_GAMEPORT_CS461x is not set +CONFIG_GAMEPORT_CS461X=m CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set CONFIG_SERIO_PCIPS2=m +CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_RAW=m # @@ -1121,6 +1163,7 @@ CONFIG_I2C_ALI1535=m CONFIG_I2C_ALI1563=m CONFIG_I2C_ALI15X3=m CONFIG_I2C_AMD756=m +# CONFIG_I2C_AMD756_S4882 is not set CONFIG_I2C_AMD8111=m CONFIG_I2C_I801=m CONFIG_I2C_I810=m @@ -1134,6 +1177,7 @@ CONFIG_SCx200_ACB=m CONFIG_I2C_SIS5595=m CONFIG_I2C_SIS630=m CONFIG_I2C_SIS96X=m +CONFIG_I2C_STUB=m CONFIG_I2C_VIA=m CONFIG_I2C_VIAPRO=m CONFIG_I2C_VOODOO3=m @@ -1145,20 +1189,25 @@ CONFIG_I2C_PCA_ISA=m CONFIG_I2C_SENSOR=m CONFIG_SENSORS_ADM1021=m CONFIG_SENSORS_ADM1025=m +CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ASB100=m CONFIG_SENSORS_DS1621=m CONFIG_SENSORS_FSCHER=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_IT87=m +CONFIG_SENSORS_LM63=m CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM77=m CONFIG_SENSORS_LM78=m CONFIG_SENSORS_LM80=m CONFIG_SENSORS_LM83=m CONFIG_SENSORS_LM85=m +CONFIG_SENSORS_LM87=m CONFIG_SENSORS_LM90=m CONFIG_SENSORS_MAX1619=m +CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_SMSC47B397=m CONFIG_SENSORS_SMSC47M1=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m @@ -1194,10 +1243,16 @@ CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_FS_POSIX_ACL=y + +# +# XFS support +# CONFIG_XFS_FS=m +CONFIG_XFS_EXPORT=y # CONFIG_XFS_RT is not set CONFIG_XFS_QUOTA=y CONFIG_XFS_SECURITY=y @@ -1206,6 +1261,7 @@ CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m # CONFIG_QUOTA is not set CONFIG_QUOTACTL=y +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m @@ -1240,6 +1296,8 @@ CONFIG_DEVFS_MOUNT=y CONFIG_DEVPTS_FS_XATTR=y # CONFIG_DEVPTS_FS_SECURITY is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -1260,7 +1318,6 @@ CONFIG_CRAMFS=m CONFIG_VXFS_FS=m CONFIG_HPFS_FS=m CONFIG_QNX4FS_FS=m -# CONFIG_QNX4FS_RW is not set CONFIG_SYSV_FS=m CONFIG_UFS_FS=m CONFIG_UFS_FS_WRITE=y @@ -1288,7 +1345,7 @@ CONFIG_SMB_FS=m CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set -CONFIG_CIFS_POSIX=y +# CONFIG_CIFS_EXPERIMENTAL is not set CONFIG_NCP_FS=m # CONFIG_NCPFS_PACKET_SIGNING is not set # CONFIG_NCPFS_IOCTL_LOCKING is not set @@ -1378,7 +1435,7 @@ CONFIG_VIDEO_SAA5249=m CONFIG_TUNER_3036=m # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set -CONFIG_VIDEO_SAA7134=m +# CONFIG_VIDEO_SAA7134 is not set CONFIG_VIDEO_MXB=m CONFIG_VIDEO_DPC=m CONFIG_VIDEO_HEXIUM_ORION=m @@ -1399,26 +1456,6 @@ CONFIG_RADIO_MAESTRO=m CONFIG_DVB=y CONFIG_DVB_CORE=m -# -# Supported Frontend Modules -# -CONFIG_DVB_TWINHAN_DST=m -CONFIG_DVB_STV0299=m -CONFIG_DVB_SP887X=m -CONFIG_DVB_SP887X_FIRMWARE_FILE="/etc/dvb/sc_main.mc" -CONFIG_DVB_ALPS_TDLB7=m -CONFIG_DVB_ALPS_TDMB7=m -CONFIG_DVB_ATMEL_AT76C651=m -CONFIG_DVB_CX24110=m -CONFIG_DVB_GRUNDIG_29504_491=m -CONFIG_DVB_GRUNDIG_29504_401=m -CONFIG_DVB_MT312=m -CONFIG_DVB_VES1820=m -CONFIG_DVB_VES1X93=m -CONFIG_DVB_TDA1004X=m -CONFIG_DVB_TDA1004X_FIRMWARE_FILE="/usr/lib/hotplug/firmware/tda1004x.bin" -CONFIG_DVB_NXT6000=m - # # Supported SAA7146 based PCI Adapters # @@ -1434,16 +1471,67 @@ CONFIG_DVB_BUDGET_PATCH=m # # CONFIG_DVB_TTUSB_BUDGET is not set CONFIG_DVB_TTUSB_DEC=m +CONFIG_DVB_DIBUSB=m +# CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES is not set +CONFIG_DVB_DIBCOM_DEBUG=y +CONFIG_DVB_CINERGYT2=m +# CONFIG_DVB_CINERGYT2_TUNING is not set # # Supported FlexCopII (B2C2) Adapters # CONFIG_DVB_B2C2_SKYSTAR=m +CONFIG_DVB_B2C2_USB=m # # Supported BT878 Adapters # CONFIG_DVB_BT8XX=m + +# +# Supported DVB Frontends +# + +# +# Customise DVB Frontends +# + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_STV0299=m +CONFIG_DVB_CX24110=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA80XX=m +CONFIG_DVB_MT312=m +CONFIG_DVB_VES1X93=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_ATMEL_AT76C651=m +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terresterial DTV) frontends +# +CONFIG_DVB_NXT2002=m CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m @@ -1451,6 +1539,7 @@ CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m +CONFIG_VIDEO_TVEEPROM=m # # Sound @@ -1500,10 +1589,13 @@ CONFIG_SND_AU8820=m CONFIG_SND_AU8830=m CONFIG_SND_AZT3328=m CONFIG_SND_BT87X=m +# CONFIG_SND_BT87X_OVERCLOCK is not set CONFIG_SND_CS46XX=m # CONFIG_SND_CS46XX_NEW_DSP is not set CONFIG_SND_CS4281=m CONFIG_SND_EMU10K1=m +CONFIG_SND_EMU10K1X=m +CONFIG_SND_CA0106=m CONFIG_SND_KORG1212=m CONFIG_SND_MIXART=m CONFIG_SND_NM256=m @@ -1528,13 +1620,13 @@ CONFIG_SND_INTEL8X0=m CONFIG_SND_INTEL8X0M=m CONFIG_SND_SONICVIBES=m # CONFIG_SND_VIA82XX is not set +CONFIG_SND_VIA82XX_MODEM=m CONFIG_SND_VX222=m # -# ALSA USB devices +# USB devices # # CONFIG_SND_USB_AUDIO is not set -CONFIG_SND_USB_USX2Y=m # # ALSA Sparc devices @@ -1555,6 +1647,8 @@ CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -1564,6 +1658,7 @@ CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=y CONFIG_USB_UHCI_HCD=m +CONFIG_USB_SL811_HCD=m # # USB Device Class drivers @@ -1576,6 +1671,10 @@ CONFIG_USB_UHCI_HCD=m # CONFIG_USB_MIDI is not set CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_RW_DETECT=y @@ -1589,7 +1688,7 @@ CONFIG_USB_STORAGE_SDDR55=y # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -1609,7 +1708,6 @@ CONFIG_USB_ATI_REMOTE=m # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m -CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices @@ -1626,7 +1724,7 @@ CONFIG_USB_SN9C102=m CONFIG_USB_W9968CF=m # -# USB Network adaptors +# USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m @@ -1643,6 +1741,7 @@ CONFIG_USB_BELKIN=y CONFIG_USB_GENESYS=y CONFIG_USB_NET1080=y CONFIG_USB_PL2301=y +CONFIG_USB_KC2190=y # # Intelligent USB Devices/Gadgets @@ -1669,6 +1768,7 @@ CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CYPRESS_M8=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m # CONFIG_USB_SERIAL_VISOR is not set @@ -1676,6 +1776,8 @@ CONFIG_USB_SERIAL_IPAQ=m # CONFIG_USB_SERIAL_IR is not set CONFIG_USB_SERIAL_EDGEPORT=m # CONFIG_USB_SERIAL_EDGEPORT_TI is not set +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m # CONFIG_USB_SERIAL_KEYSPAN_MPR is not set @@ -1695,6 +1797,7 @@ CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_TI=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m @@ -1705,22 +1808,37 @@ CONFIG_USB_EZUSB=y # CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m -# CONFIG_USB_TIGL is not set CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m CONFIG_USB_CYTHERM=m -CONFIG_USB_SPEEDTOUCH=m +CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m CONFIG_USB_TEST=m +# +# USB ATM/DSL drivers +# +CONFIG_USB_ATM=m +CONFIG_USB_SPEEDTOUCH=m + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# InfiniBand support +# +CONFIG_INFINIBAND=m +CONFIG_INFINIBAND_MTHCA=m +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set + # # Watchdog Cards # @@ -1757,11 +1875,14 @@ CONFIG_OPROFILE=m # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y # CONFIG_DEBUG_STACK_USAGE is not set CONFIG_KPROBES=y # CONFIG_DEBUG_DCFLUSH is not set @@ -1772,6 +1893,8 @@ CONFIG_HAVE_DEC_LOCK=y # # Security options # +CONFIG_KEYS=y +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set # CONFIG_SECURITY is not set # @@ -1796,11 +1919,16 @@ CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_TEST=m +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/sparc64/kernel/auxio.c b/arch/sparc64/kernel/auxio.c index 11672d2d3..a0716ccc2 100644 --- a/arch/sparc64/kernel/auxio.c +++ b/arch/sparc64/kernel/auxio.c @@ -17,7 +17,7 @@ #include /* This cannot be static, as it is referenced in entry.S */ -void __iomem *auxio_register = 0UL; +void __iomem *auxio_register = NULL; enum auxio_type { AUXIO_TYPE_NODEV, @@ -26,7 +26,7 @@ enum auxio_type { }; static enum auxio_type auxio_devtype = AUXIO_TYPE_NODEV; -static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(auxio_lock); static void __auxio_sbus_set(u8 bits_on, u8 bits_off) { diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c index ae92b7776..ca0eb3149 100644 --- a/arch/sparc64/kernel/binfmt_aout32.c +++ b/arch/sparc64/kernel/binfmt_aout32.c @@ -50,7 +50,9 @@ static void set_brk(unsigned long start, unsigned long end) end = PAGE_ALIGN(end); if (end <= start) return; + down_write(¤t->mm->mmap_sem); do_brk(start, end - start); + up_write(¤t->mm->mmap_sem); } /* @@ -96,19 +98,19 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file) set_fs(KERNEL_DS); has_dumped = 1; current->flags |= PF_DUMPCORE; - strncpy(dump.u_comm, current->comm, sizeof(current->comm)); + strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm)); dump.signal = signr; dump_thread(regs, &dump); /* If the size of the dump file exceeds the rlimit, then see what would happen if we wrote the stack, but not the data area. */ if ((dump.u_dsize+dump.u_ssize) > - current->rlim[RLIMIT_CORE].rlim_cur) + current->signal->rlim[RLIMIT_CORE].rlim_cur) dump.u_dsize = 0; /* Make sure we have enough room to write the stack and data areas. */ if ((dump.u_ssize) > - current->rlim[RLIMIT_CORE].rlim_cur) + current->signal->rlim[RLIMIT_CORE].rlim_cur) dump.u_ssize = 0; /* make sure we actually have a data and stack area to dump */ @@ -219,7 +221,7 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) * size limits imposed on them by creating programs with large * arrays in the data or bss. */ - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim >= RLIM_INFINITY) rlim = ~0; if (ex.a_data + ex.a_bss > rlim) @@ -248,10 +250,14 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (N_MAGIC(ex) == NMAGIC) { loff_t pos = fd_offset; /* Fuck me plenty... */ + down_write(¤t->mm->mmap_sem); error = do_brk(N_TXTADDR(ex), ex.a_text); + up_write(¤t->mm->mmap_sem); bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex), ex.a_text, &pos); + down_write(¤t->mm->mmap_sem); error = do_brk(N_DATADDR(ex), ex.a_data); + up_write(¤t->mm->mmap_sem); bprm->file->f_op->read(bprm->file, (char __user *)N_DATADDR(ex), ex.a_data, &pos); goto beyond_if; @@ -259,8 +265,10 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (N_MAGIC(ex) == OMAGIC) { loff_t pos = fd_offset; + down_write(¤t->mm->mmap_sem); do_brk(N_TXTADDR(ex) & PAGE_MASK, ex.a_text+ex.a_data + PAGE_SIZE - 1); + up_write(¤t->mm->mmap_sem); bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex), ex.a_text+ex.a_data, &pos); } else { @@ -274,7 +282,9 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (!bprm->file->f_op->mmap) { loff_t pos = fd_offset; + down_write(¤t->mm->mmap_sem); do_brk(0, ex.a_text+ex.a_data); + up_write(¤t->mm->mmap_sem); bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex), ex.a_text+ex.a_data, &pos); @@ -313,7 +323,7 @@ beyond_if: orig_thr_flags = current_thread_info()->flags; current_thread_info()->flags |= _TIF_32BIT; - retval = setup_arg_pages(bprm, EXSTACK_DEFAULT); + retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT); if (retval < 0) { current_thread_info()->flags = orig_thr_flags; @@ -325,9 +335,8 @@ beyond_if: current->mm->start_stack = (unsigned long) create_aout32_tables((char __user *)bprm->p, bprm); if (!(orig_thr_flags & _TIF_32BIT)) { - unsigned long pgd_cache; + unsigned long pgd_cache = get_pgd_cache(current->mm->pgd); - pgd_cache = ((unsigned long)current->mm->pgd[0])<<11UL; __asm__ __volatile__("stxa\t%0, [%1] %2\n\t" "membar #Sync" : /* no outputs */ @@ -391,7 +400,9 @@ static int load_aout32_library(struct file *file) len = PAGE_ALIGN(ex.a_text + ex.a_data); bss = ex.a_text + ex.a_data + ex.a_bss; if (bss > len) { + down_write(¤t->mm->mmap_sem); error = do_brk(start_addr + len, bss - len); + up_write(¤t->mm->mmap_sem); retval = error; if (error != start_addr + len) goto out; diff --git a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c index fb3e3b780..a1a12d2aa 100644 --- a/arch/sparc64/kernel/binfmt_elf32.c +++ b/arch/sparc64/kernel/binfmt_elf32.c @@ -79,7 +79,7 @@ typedef struct { #define elf_check_arch(x) (((x)->e_machine == EM_SPARC) || ((x)->e_machine == EM_SPARC32PLUS)) -#define ELF_ET_DYN_BASE 0x08000000 +#define ELF_ET_DYN_BASE 0x70000000 #include @@ -132,10 +132,12 @@ struct elf_prpsinfo32 #include -#define jiffies_to_timeval jiffies_to_compat_timeval +#undef cputime_to_timeval +#define cputime_to_timeval cputime_to_compat_timeval static __inline__ void -jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) +cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { + unsigned long jiffies = cputime_to_jiffies(cputime); value->tv_usec = (jiffies % HZ) * (1000000L / HZ); value->tv_sec = jiffies / HZ; } diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c index 559b6d753..d710274e5 100644 --- a/arch/sparc64/kernel/devices.c +++ b/arch/sparc64/kernel/devices.c @@ -24,7 +24,7 @@ /* Used to synchronize acceses to NatSemi SUPER I/O chip configure * operations in asm/ns87303.h */ -spinlock_t ns87303_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(ns87303_lock); extern void cpu_probe(void); extern void central_probe(void); diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index 1462b2460..c4b705d0e 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -26,7 +26,7 @@ #define curptr g6 -#define NR_SYSCALLS 283 /* Each OS is different... */ +#define NR_SYSCALLS 284 /* Each OS is different... */ .text .align 32 @@ -1778,7 +1778,7 @@ ret_sys_call: stx %l0, [%curptr + TI_FLAGS] 1: - cmp %o0, -ENOIOCTLCMD + cmp %o0, -ERESTART_RESTARTBLOCK bgeu,pn %xcc, 1f andcc %l0, _TIF_SYSCALL_TRACE, %l6 80: diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 3162b2ed1..52f7bf905 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c @@ -101,7 +101,7 @@ struct irqaction *irq_action[NR_IRQS+1] = { * read things in the table. IRQ handler processing orders * its' accesses such that no locking is needed. */ -static spinlock_t irq_action_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_action_lock); static void register_irq_proc (unsigned int irq); diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c index 8ad507779..30862abee 100644 --- a/arch/sparc64/kernel/isa.c +++ b/arch/sparc64/kernel/isa.c @@ -262,7 +262,7 @@ void __init isa_init(void) device = PCI_DEVICE_ID_AL_M1533; pdev = NULL; - while ((pdev = pci_find_device(vendor, device, pdev)) != NULL) { + while ((pdev = pci_get_device(vendor, device, pdev)) != NULL) { struct pcidev_cookie *pdev_cookie; struct pci_pbm_info *pbm; struct sparc_isa_bridge *isa_br; diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c index bc5cc1d17..7d97138f5 100644 --- a/arch/sparc64/kernel/kprobes.c +++ b/arch/sparc64/kernel/kprobes.c @@ -15,7 +15,7 @@ * traps. The top-level scheme is similar to that used * in the x86 kprobes implementation. * - * In the kprobe->insn[] array we store the original + * In the kprobe->ainsn.insn[] array we store the original * instruction at index zero and a break instruction at * index one. * @@ -24,12 +24,12 @@ * - Remember "regs->tnpc" and interrupt level stored in * "regs->tstate" so we can restore them later * - Disable PIL interrupts - * - Set regs->tpc to point to kprobe->insn[0] - * - Set regs->tnpc to point to kprobe->insn[1] + * - Set regs->tpc to point to kprobe->ainsn.insn[0] + * - Set regs->tnpc to point to kprobe->ainsn.insn[1] * - Mark that we are actively in a kprobe * * At this point we wait for the second breakpoint at - * kprobe->insn[1] to hit. When it does we: + * kprobe->ainsn.insn[1] to hit. When it does we: * - Run the post-handler * - Set regs->tpc to "remembered" regs->tnpc stored above, * restore the PIL interrupt level in "regs->tstate" as well @@ -38,10 +38,19 @@ * - Mark that we are no longer actively in a kprobe. */ -void arch_prepare_kprobe(struct kprobe *p) +int arch_prepare_kprobe(struct kprobe *p) +{ + return 0; +} + +void arch_copy_kprobe(struct kprobe *p) +{ + p->ainsn.insn[0] = *p->addr; + p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; +} + +void arch_remove_kprobe(struct kprobe *p) { - p->insn[0] = *p->addr; - p->insn[1] = BREAKPOINT_INSTRUCTION_2; } /* kprobe_status settings */ @@ -59,8 +68,8 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) current_kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); regs->tstate |= TSTATE_PIL; - regs->tpc = (unsigned long) &p->insn[0]; - regs->tnpc = (unsigned long) &p->insn[1]; + regs->tpc = (unsigned long) &p->ainsn.insn[0]; + regs->tnpc = (unsigned long) &p->ainsn.insn[1]; } static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs) @@ -199,19 +208,19 @@ static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc) * instruction. To avoid the SMP problems that can occur when we * temporarily put back the original opcode to single-step, we * single-stepped a copy of the instruction. The address of this - * copy is p->insn. + * copy is p->ainsn.insn. * * This function prepares to return from the post-single-step * breakpoint trap. */ static void resume_execution(struct kprobe *p, struct pt_regs *regs) { - u32 insn = p->insn[0]; + u32 insn = p->ainsn.insn[0]; regs->tpc = current_kprobe_orig_tnpc; regs->tnpc = relbranch_fixup(insn, (unsigned long) p->addr, - (unsigned long) &p->insn[0], + (unsigned long) &p->ainsn.insn[0], regs->tnpc); retpc_fixup(regs, insn, (unsigned long) p->addr); diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 75032d0e2..2ffd1efef 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c @@ -56,7 +56,7 @@ volatile int pci_poke_in_progress; volatile int pci_poke_cpu = -1; volatile int pci_poke_faulted; -static spinlock_t pci_poke_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pci_poke_lock); void pci_config_read8(u8 *addr, u8 *ret) { @@ -725,7 +725,7 @@ static int __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vm static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state) { - vma->vm_flags |= (VM_SHM | VM_LOCKED); + vma->vm_flags |= (VM_IO | VM_RESERVED); } /* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c index 94a52983c..292983413 100644 --- a/arch/sparc64/kernel/pci_iommu.c +++ b/arch/sparc64/kernel/pci_iommu.c @@ -814,7 +814,7 @@ static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit) /* ALI sound chips generate 31-bits of DMA, a special register * determines what bit 31 is emitted as. */ - ali_isa_bridge = pci_find_device(PCI_VENDOR_ID_AL, + ali_isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); @@ -824,6 +824,7 @@ static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit) else val &= ~0x01; pci_write_config_byte(ali_isa_bridge, 0x7e, val); + pci_dev_put(ali_isa_bridge); } int pci_dma_supported(struct pci_dev *pdev, u64 device_mask) diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index 2dacbd780..41fe09913 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c @@ -433,7 +433,7 @@ enum psycho_error_type { #define PSYCHO_STCLINE_VALID 0x0000000000000002UL /* Valid */ #define PSYCHO_STCLINE_FOFN 0x0000000000000001UL /* Fetch Outstanding / Flush Necessary */ -static spinlock_t stc_buf_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(stc_buf_lock); static unsigned long stc_error_buf[128]; static unsigned long stc_tag_buf[16]; static unsigned long stc_line_buf[16]; @@ -453,9 +453,9 @@ static void __psycho_check_one_stc(struct pci_controller_info *p, tag_base = regbase + PSYCHO_STC_TAG_A; line_base = regbase + PSYCHO_STC_LINE_A; } else { - err_base = regbase + PSYCHO_STC_ERR_A; - tag_base = regbase + PSYCHO_STC_TAG_A; - line_base = regbase + PSYCHO_STC_LINE_A; + err_base = regbase + PSYCHO_STC_ERR_B; + tag_base = regbase + PSYCHO_STC_TAG_B; + line_base = regbase + PSYCHO_STC_LINE_B; } spin_lock(&stc_buf_lock); diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c index f72da320b..9f0a34f6d 100644 --- a/arch/sparc64/kernel/pci_schizo.c +++ b/arch/sparc64/kernel/pci_schizo.c @@ -377,7 +377,7 @@ enum schizo_error_type { UE_ERR, CE_ERR, PCI_ERR, SAFARI_ERR }; -static spinlock_t stc_buf_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(stc_buf_lock); static unsigned long stc_error_buf[128]; static unsigned long stc_tag_buf[16]; static unsigned long stc_line_buf[16]; diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index f3e3c657e..26d3ec41d 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c @@ -60,10 +60,10 @@ void default_idle(void) /* * the idle loop on a Sparc... ;) */ -int cpu_idle(void) +void cpu_idle(void) { if (current->pid != 0) - return -EPERM; + return; /* endless idle loop with no priority at all */ for (;;) { @@ -80,7 +80,7 @@ int cpu_idle(void) schedule(); check_pgt_cache(); } - return 0; + return; } #else @@ -90,7 +90,7 @@ int cpu_idle(void) */ #define idle_me_harder() (cpu_data(smp_processor_id()).idle_volume += 1) #define unidle_me() (cpu_data(smp_processor_id()).idle_volume = 0) -int cpu_idle(void) +void cpu_idle(void) { set_thread_flag(TIF_POLLING_NRFLAG); while(1) { @@ -167,7 +167,7 @@ static void show_regwindow32(struct pt_regs *regs) mm_segment_t old_fs; __asm__ __volatile__ ("flushw"); - rw = (struct reg_window32 __user *)((long)(unsigned)regs->u_regs[14]); + rw = compat_ptr((unsigned)regs->u_regs[14]); old_fs = get_fs(); set_fs (USER_DS); if (copy_from_user (&r_w, rw, sizeof(r_w))) { @@ -282,7 +282,7 @@ void show_stackframe32(struct sparc_stackf32 *sf) } #ifdef CONFIG_SMP -static spinlock_t regdump_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(regdump_lock); #endif void __show_regs(struct pt_regs * regs) @@ -434,14 +434,13 @@ void flush_thread(void) if (test_thread_flag(TIF_32BIT)) { struct mm_struct *mm = t->task->mm; pgd_t *pgd0 = &mm->pgd[0]; + pud_t *pud0 = pud_offset(pgd0, 0); - if (pgd_none(*pgd0)) { - pmd_t *page = pmd_alloc_one_fast(NULL, 0); - if (!page) - page = pmd_alloc_one(NULL, 0); - pgd_set(pgd0, page); + if (pud_none(*pud0)) { + pmd_t *page = pmd_alloc_one(mm, 0); + pud_set(pud0, page); } - pgd_cache = ((unsigned long) pgd_val(*pgd0)) << 11UL; + pgd_cache = get_pgd_cache(pgd0); } __asm__ __volatile__("stxa %0, [%1] %2\n\t" "membar #Sync" @@ -621,8 +620,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, p->thread.smp_lock_pc = 0; #endif - p->set_child_tid = p->clear_child_tid = NULL; - /* Calculate offset to stack_frame & pt_regs */ child_trap_frame = ((char *)t) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ)); memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); @@ -829,7 +826,9 @@ asmlinkage int sparc_execve(struct pt_regs *regs) current_thread_info()->xfsr[0] = 0; current_thread_info()->fpsaved[0] = 0; regs->tstate &= ~TSTATE_PEF; + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); } out: return error; diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index f6073b01d..1e091ddab 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c @@ -50,7 +50,7 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value) } static inline void -pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) +pt_succ_return_linux(struct pt_regs *regs, unsigned long value, void __user *addr) { if (test_thread_flag(TIF_32BIT)) { if (put_user(value, (unsigned int __user *) addr)) { @@ -70,7 +70,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) } static void -pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) +pt_os_succ_return (struct pt_regs *regs, unsigned long val, void __user *addr) { if (current->personality == PER_SUNOS) pt_succ_return (regs, val); @@ -230,7 +230,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) if (res < 0) pt_error_return(regs, -res); else - pt_os_succ_return(regs, tmp64, (long *) data); + pt_os_succ_return(regs, tmp64, (void __user *) data); goto flush_and_out; } @@ -563,7 +563,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) * exit. */ case PTRACE_KILL: { - if (child->state == TASK_ZOMBIE) { /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) { /* already dead */ pt_succ_return(regs, 0); goto out_tsk; } diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 51e762bcd..0c9ce2bb5 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c @@ -151,6 +151,7 @@ int prom_callback(long *args) struct task_struct *p; struct mm_struct *mm = NULL; pgd_t *pgdp; + pud_t *pudp; pmd_t *pmdp; pte_t *ptep; @@ -166,7 +167,10 @@ int prom_callback(long *args) pgdp = pgd_offset(mm, va); if (pgd_none(*pgdp)) goto done; - pmdp = pmd_offset(pgdp, va); + pudp = pud_offset(pgdp, va); + if (pud_none(*pudp)) + goto done; + pmdp = pmd_offset(pudp, va); if (pmd_none(*pmdp)) goto done; @@ -208,6 +212,7 @@ int prom_callback(long *args) * vmalloc or prom_inherited mapping. */ pgd_t *pgdp; + pud_t *pudp; pmd_t *pmdp; pte_t *ptep; int error; @@ -221,7 +226,10 @@ int prom_callback(long *args) pgdp = pgd_offset_k(va); if (pgd_none(*pgdp)) goto done; - pmdp = pmd_offset(pgdp, va); + pudp = pud_offset(pgdp, va); + if (pud_none(*pudp)) + goto done; + pmdp = pmd_offset(pudp, va); if (pmd_none(*pmdp)) goto done; diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index d81bfab51..aa298d31d 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -23,9 +23,9 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 63d9cec39..4b060cacf 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c @@ -20,9 +20,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -86,7 +86,7 @@ struct new_signal_frame32 { __siginfo_fpu_t fpu_state; }; -struct siginfo32 { +typedef struct compat_siginfo{ int si_signo; int si_errno; int si_code; @@ -136,11 +136,11 @@ struct siginfo32 { int _fd; } _sigpoll; } _sifields; -}; +}compat_siginfo_t; struct rt_signal_frame32 { struct sparc_stackf32 ss; - struct siginfo32 info; + compat_siginfo_t info; struct pt_regs32 regs; compat_sigset_t mask; /* __siginfo_fpu32_t * */ u32 fpu_save; @@ -157,11 +157,11 @@ struct rt_signal_frame32 { #define NF_ALIGNEDSZ (((sizeof(struct new_signal_frame32) + 7) & (~7))) #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) -int copy_siginfo_to_user32(struct siginfo32 __user *to, siginfo_t *from) +int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) { int err; - if (!access_ok(VERIFY_WRITE, to, sizeof(struct siginfo32))) + if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t))) return -EFAULT; /* If you change siginfo_t structure, please be sure @@ -194,7 +194,7 @@ int copy_siginfo_to_user32(struct siginfo32 __user *to, siginfo_t *from) case __SI_FAULT >> 16: case __SI_POLL >> 16: err |= __put_user(from->si_trapno, &to->si_trapno); - err |= __put_user((long)from->si_addr, &to->si_addr); + err |= __put_user((unsigned long)from->si_addr, &to->si_addr); break; case __SI_RT >> 16: /* This is not generated by the kernel as of now. */ case __SI_MESGQ >> 16: @@ -210,9 +210,9 @@ int copy_siginfo_to_user32(struct siginfo32 __user *to, siginfo_t *from) /* CAUTION: This is just a very minimalist implementation for the * sake of compat_sys_rt_sigqueueinfo() */ -int copy_siginfo_to_kernel32(siginfo_t *to, struct siginfo32 __user *from) +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) { - if (!access_ok(VERIFY_WRITE, from, sizeof(struct siginfo32))) + if (!access_ok(VERIFY_WRITE, from, sizeof(compat_siginfo_t))) return -EFAULT; if (copy_from_user(to, from, 3*sizeof(int)) || @@ -275,7 +275,7 @@ asmlinkage void do_rt_sigsuspend32(u32 uset, size_t sigsetsize, struct pt_regs * regs->u_regs[UREG_I0] = EINVAL; return; } - if (copy_from_user(&set32, (void __user *)(long)uset, sizeof(set32))) { + if (copy_from_user(&set32, compat_ptr(uset), sizeof(set32))) { regs->tstate |= TSTATE_ICARRY; regs->u_regs[UREG_I0] = EFAULT; return; @@ -720,9 +720,9 @@ setup_frame32(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *o sig_address = NULL; } } - err |= __put_user((long)sig_address, &sframep->sig_address); + err |= __put_user(ptr_to_compat(sig_address), &sframep->sig_address); err |= __put_user(sig_code, &sframep->sig_code); - err |= __put_user((u64)sc, &sframep->sig_scptr); + err |= __put_user(ptr_to_compat(sc), &sframep->sig_scptr); if (err) goto sigsegv; @@ -857,7 +857,8 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, /* Flush instruction space. */ unsigned long address = ((unsigned long)&(sf->insns[0])); pgd_t *pgdp = pgd_offset(current->mm, address); - pmd_t *pmdp = pmd_offset(pgdp, address); + pud_t *pudp = pud_offset(pgdp, address); + pmd_t *pmdp = pmd_offset(pudp, address); pte_t *ptep; regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); @@ -967,7 +968,7 @@ setup_svr4_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc, /* Save the currently window file: */ /* 1. Link sfp->uc->gwins to our windows */ - err |= __put_user((u32)(long)gw, &mc->gwin); + err |= __put_user(ptr_to_compat(gw), &mc->gwin); /* 2. Number of windows to restore at setcontext (): */ err |= __put_user(get_thread_wsaved(), &gw->count); @@ -1268,7 +1269,8 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, /* Flush instruction space. */ unsigned long address = ((unsigned long)&(sf->insns[0])); pgd_t *pgdp = pgd_offset(current->mm, address); - pmd_t *pmdp = pmd_offset(pgdp, address); + pud_t *pudp = pud_offset(pgdp, address); + pmd_t *pmdp = pmd_offset(pudp, address); pte_t *ptep; regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); @@ -1446,10 +1448,12 @@ asmlinkage long do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp) u32 u_ss_sp = 0; int ret; mm_segment_t old_fs; + stack_t32 __user *uss32 = compat_ptr(ussa); + stack_t32 __user *uoss32 = compat_ptr(uossa); - if (ussa && (get_user(u_ss_sp, &((stack_t32 __user *)(long)ussa)->ss_sp) || - __get_user(uss.ss_flags, &((stack_t32 __user *)(long)ussa)->ss_flags) || - __get_user(uss.ss_size, &((stack_t32 __user *)(long)ussa)->ss_size))) + if (ussa && (get_user(u_ss_sp, &uss32->ss_sp) || + __get_user(uss.ss_flags, &uss32->ss_flags) || + __get_user(uss.ss_size, &uss32->ss_size))) return -EFAULT; uss.ss_sp = compat_ptr(u_ss_sp); old_fs = get_fs(); @@ -1457,9 +1461,9 @@ asmlinkage long do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp) ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL, uossa ? (stack_t __user *) &uoss : NULL, sp); set_fs(old_fs); - if (!ret && uossa && (put_user((long)uoss.ss_sp, &((stack_t32 __user *)(long)uossa)->ss_sp) || - __put_user(uoss.ss_flags, &((stack_t32 __user *)(long)uossa)->ss_flags) || - __put_user(uoss.ss_size, &((stack_t32 __user *)(long)uossa)->ss_size))) + if (!ret && uossa && (put_user(ptr_to_compat(uoss.ss_sp), &uoss32->ss_sp) || + __put_user(uoss.ss_flags, &uoss32->ss_flags) || + __put_user(uoss.ss_size, &uoss32->ss_size))) return -EFAULT; return ret; } diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index f2bbaafd8..474c4edd4 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -103,15 +103,6 @@ extern void inherit_locked_prom_mappings(int save_p); void __init smp_callin(void) { int cpuid = hard_smp_processor_id(); - extern int bigkernel; - extern unsigned long kern_locked_tte_data; - - if (bigkernel) { - prom_dtlb_load(sparc64_highest_locked_tlbent()-1, - kern_locked_tte_data + 0x400000, KERNBASE + 0x400000); - prom_itlb_load(sparc64_highest_locked_tlbent()-1, - kern_locked_tte_data + 0x400000, KERNBASE + 0x400000); - } inherit_locked_prom_mappings(0); @@ -163,7 +154,7 @@ static unsigned long current_tick_offset; #define NUM_ROUNDS 64 /* magic value */ #define NUM_ITERS 5 /* likewise */ -static spinlock_t itc_sync_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(itc_sync_lock); static unsigned long go[SLAVE + 1]; #define DEBUG_TICK_SYNC 0 @@ -555,7 +546,7 @@ struct call_data_struct { int wait; }; -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); static struct call_data_struct *call_data; extern unsigned long xcall_call_function; @@ -903,9 +894,8 @@ static unsigned long penguins_are_doing_time; void smp_capture(void) { - int result = __atomic_add(1, &smp_capture_depth); + int result = atomic_add_ret(1, &smp_capture_depth); - membar("#StoreStore | #LoadStore"); if (result == 1) { int ncpus = num_online_cpus(); @@ -1155,7 +1145,7 @@ report: } /* /proc/profile writes can call this, don't __init it please. */ -static spinlock_t prof_setup_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(prof_setup_lock); int setup_profiling_timer(unsigned int multiplier) { diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index 3864b4b6e..686e45899 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c @@ -86,7 +86,7 @@ extern int svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs); extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs); extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); -extern long sparc32_open(const char * filename, int flags, int mode); +extern long sparc32_open(const char __user * filename, int flags, int mode); extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space); extern void (*prom_palette)(int); @@ -172,18 +172,25 @@ EXPORT_SYMBOL(down_interruptible); EXPORT_SYMBOL(up); /* Atomic counter implementation. */ -EXPORT_SYMBOL(__atomic_add); -EXPORT_SYMBOL(__atomic_sub); -EXPORT_SYMBOL(__atomic64_add); -EXPORT_SYMBOL(__atomic64_sub); +EXPORT_SYMBOL(atomic_add); +EXPORT_SYMBOL(atomic_add_ret); +EXPORT_SYMBOL(atomic_sub); +EXPORT_SYMBOL(atomic_sub_ret); +EXPORT_SYMBOL(atomic64_add); +EXPORT_SYMBOL(atomic64_add_ret); +EXPORT_SYMBOL(atomic64_sub); +EXPORT_SYMBOL(atomic64_sub_ret); #ifdef CONFIG_SMP -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif /* Atomic bit operations. */ -EXPORT_SYMBOL(___test_and_set_bit); -EXPORT_SYMBOL(___test_and_clear_bit); -EXPORT_SYMBOL(___test_and_change_bit); +EXPORT_SYMBOL(test_and_set_bit); +EXPORT_SYMBOL(test_and_clear_bit); +EXPORT_SYMBOL(test_and_change_bit); +EXPORT_SYMBOL(set_bit); +EXPORT_SYMBOL(clear_bit); +EXPORT_SYMBOL(change_bit); /* Bit searching */ EXPORT_SYMBOL(find_next_bit); diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index f978c13f5..5a95e98c5 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S @@ -84,9 +84,9 @@ SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) SIGN1(sys32_mlockall, sys_mlockall, %o0) SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0) -SIGN1(sys32_clock_settime, compat_clock_settime, %o1) -SIGN1(sys32_clock_nanosleep, compat_clock_nanosleep, %o1) -SIGN1(sys32_timer_settime, compat_timer_settime, %o1) +SIGN1(sys32_clock_settime, compat_sys_clock_settime, %o1) +SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) +SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) SIGN1(sys32_select, compat_sys_select, %o0) diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 3d6fd1ea1..04177d8b0 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -200,7 +200,8 @@ out: * This is really horribly ugly. */ -asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long third, void __user *ptr, long fifth) +asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, + unsigned long third, void __user *ptr, long fifth) { int err; @@ -208,14 +209,15 @@ asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long if (call <= SEMCTL) { switch (call) { case SEMOP: - err = sys_semtimedop(first, ptr, second, NULL); + err = sys_semtimedop(first, ptr, + (unsigned)second, NULL); goto out; case SEMTIMEDOP: - err = sys_semtimedop(first, ptr, second, + err = sys_semtimedop(first, ptr, (unsigned)second, (const struct timespec __user *) fifth); goto out; case SEMGET: - err = sys_semget(first, second, (int)third); + err = sys_semget(first, (int)second, (int)third); goto out; case SEMCTL: { union semun fourth; @@ -226,7 +228,7 @@ asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long if (get_user(fourth.__pad, (void __user * __user *) ptr)) goto out; - err = sys_semctl(first, second | IPC_64, + err = sys_semctl(first, (int)second | IPC_64, (int)third, fourth); goto out; } @@ -238,17 +240,18 @@ asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long if (call <= MSGCTL) { switch (call) { case MSGSND: - err = sys_msgsnd(first, ptr, second, (int)third); + err = sys_msgsnd(first, ptr, (size_t)second, + (int)third); goto out; case MSGRCV: - err = sys_msgrcv(first, ptr, second, fifth, + err = sys_msgrcv(first, ptr, (size_t)second, fifth, (int)third); goto out; case MSGGET: - err = sys_msgget((key_t) first, second); + err = sys_msgget((key_t)first, (int)second); goto out; case MSGCTL: - err = sys_msgctl(first, second | IPC_64, ptr); + err = sys_msgctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; @@ -259,7 +262,7 @@ asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long switch (call) { case SHMAT: { ulong raddr; - err = do_shmat(first, ptr, second, &raddr); + err = do_shmat(first, ptr, (int)second, &raddr); if (!err) { if (put_user(raddr, (ulong __user *) third)) @@ -271,10 +274,10 @@ asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long err = sys_shmdt(ptr); goto out; case SHMGET: - err = sys_shmget(first, second, (int)third); + err = sys_shmget(first, (size_t)second, (int)third); goto out; case SHMCTL: - err = sys_shmctl(first, second | IPC_64, ptr); + err = sys_shmctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index b81f15521..fdf3fea34 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -242,7 +242,7 @@ asmlinkage long sys32_getegid16(void) static long get_tv32(struct timeval *o, struct compat_timeval __user *i) { - return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) || + return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); } @@ -254,602 +254,70 @@ static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i) __put_user(i->tv_usec, &o->tv_usec))); } -struct msgbuf32 { s32 mtype; char mtext[1]; }; - -struct ipc_perm32 { - key_t key; - compat_uid_t uid; - compat_gid_t gid; - compat_uid_t cuid; - compat_gid_t cgid; - compat_mode_t mode; - unsigned short seq; -}; - -struct semid_ds32 { - struct ipc_perm32 sem_perm; /* permissions .. see ipc.h */ - compat_time_t sem_otime; /* last semop time */ - compat_time_t sem_ctime; /* last change time */ - u32 sem_base; /* ptr to first semaphore in array */ - u32 sem_pending; /* pending operations to be processed */ - u32 sem_pending_last; /* last pending operation */ - u32 undo; /* undo requests on this array */ - unsigned short sem_nsems; /* no. of semaphores in array */ -}; - -struct semid64_ds32 { - struct ipc64_perm sem_perm; /* this structure is the same on sparc32 and sparc64 */ - unsigned int __pad1; - compat_time_t sem_otime; - unsigned int __pad2; - compat_time_t sem_ctime; - u32 sem_nsems; - u32 __unused1; - u32 __unused2; -}; - -struct msqid_ds32 -{ - struct ipc_perm32 msg_perm; - u32 msg_first; - u32 msg_last; - compat_time_t msg_stime; - compat_time_t msg_rtime; - compat_time_t msg_ctime; - u32 wwait; - u32 rwait; - unsigned short msg_cbytes; - unsigned short msg_qnum; - unsigned short msg_qbytes; - compat_ipc_pid_t msg_lspid; - compat_ipc_pid_t msg_lrpid; -}; - -struct msqid64_ds32 { - struct ipc64_perm msg_perm; - unsigned int __pad1; - compat_time_t msg_stime; - unsigned int __pad2; - compat_time_t msg_rtime; - unsigned int __pad3; - compat_time_t msg_ctime; - unsigned int msg_cbytes; - unsigned int msg_qnum; - unsigned int msg_qbytes; - compat_pid_t msg_lspid; - compat_pid_t msg_lrpid; - unsigned int __unused1; - unsigned int __unused2; -}; - - -struct shmid_ds32 { - struct ipc_perm32 shm_perm; - int shm_segsz; - compat_time_t shm_atime; - compat_time_t shm_dtime; - compat_time_t shm_ctime; - compat_ipc_pid_t shm_cpid; - compat_ipc_pid_t shm_lpid; - unsigned short shm_nattch; -}; - -struct shmid64_ds32 { - struct ipc64_perm shm_perm; - unsigned int __pad1; - compat_time_t shm_atime; - unsigned int __pad2; - compat_time_t shm_dtime; - unsigned int __pad3; - compat_time_t shm_ctime; - compat_size_t shm_segsz; - compat_pid_t shm_cpid; - compat_pid_t shm_lpid; - unsigned int shm_nattch; - unsigned int __unused1; - unsigned int __unused2; -}; - - -/* - * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation.. - * - * This is really horribly ugly. - */ -#define IPCOP_MASK(__x) (1UL << ((__x)&~IPC_64)) -static int do_sys32_semctl(int first, int second, int third, - compat_uptr_t __user *uptr) -{ - union semun fourth; - compat_uptr_t pad; - int err = -EINVAL; - - if (!uptr) - goto out; - err = -EFAULT; - if (get_user(pad, uptr)) - goto out; - if ((third & ~IPC_64) == SETVAL) - fourth.val = (int)pad; - else - fourth.__pad = compat_ptr(pad); - if (IPCOP_MASK (third) & - (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SEM_INFO) | IPCOP_MASK (GETVAL) | - IPCOP_MASK (GETPID) | IPCOP_MASK (GETNCNT) | IPCOP_MASK (GETZCNT) | - IPCOP_MASK (GETALL) | IPCOP_MASK (SETALL) | IPCOP_MASK (IPC_RMID))) { - err = sys_semctl (first, second, third, fourth); - } else if (third & IPC_64) { - struct semid64_ds s; - struct semid64_ds32 __user *usp = compat_ptr(pad); - mm_segment_t old_fs; - int need_back_translation; - - if (third == (IPC_SET|IPC_64)) { - err = get_user (s.sem_perm.uid, &usp->sem_perm.uid); - err |= __get_user (s.sem_perm.gid, &usp->sem_perm.gid); - err |= __get_user (s.sem_perm.mode, &usp->sem_perm.mode); - if (err) - goto out; - fourth.__pad = (void __user *) &s; - } - need_back_translation = - (IPCOP_MASK (third) & - (IPCOP_MASK (SEM_STAT) | IPCOP_MASK (IPC_STAT))) != 0; - if (need_back_translation) - fourth.__pad = (void __user *) &s; - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_semctl (first, second, third, fourth); - set_fs (old_fs); - if (need_back_translation) { - int err2 = copy_to_user (&usp->sem_perm, &s.sem_perm, sizeof(struct ipc64_perm) + 2*sizeof(time_t)); - err2 |= __put_user (s.sem_nsems, &usp->sem_nsems); - if (err2) err = -EFAULT; - } - } else { - struct semid_ds s; - struct semid_ds32 __user *usp = compat_ptr(pad); - mm_segment_t old_fs; - int need_back_translation; - - if (third == IPC_SET) { - err = get_user (s.sem_perm.uid, &usp->sem_perm.uid); - err |= __get_user (s.sem_perm.gid, &usp->sem_perm.gid); - err |= __get_user (s.sem_perm.mode, &usp->sem_perm.mode); - if (err) - goto out; - fourth.__pad = (void __user *) &s; - } - need_back_translation = - (IPCOP_MASK (third) & - (IPCOP_MASK (SEM_STAT) | IPCOP_MASK (IPC_STAT))) != 0; - if (need_back_translation) - fourth.__pad = (void __user *) &s; - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_semctl (first, second, third, fourth); - set_fs (old_fs); - if (need_back_translation) { - int err2 = put_user (s.sem_perm.key, &usp->sem_perm.key); - err2 |= __put_user (high2lowuid(s.sem_perm.uid), &usp->sem_perm.uid); - err2 |= __put_user (high2lowgid(s.sem_perm.gid), &usp->sem_perm.gid); - err2 |= __put_user (high2lowuid(s.sem_perm.cuid), &usp->sem_perm.cuid); - err2 |= __put_user (high2lowgid(s.sem_perm.cgid), &usp->sem_perm.cgid); - err2 |= __put_user (s.sem_perm.mode, &usp->sem_perm.mode); - err2 |= __put_user (s.sem_perm.seq, &usp->sem_perm.seq); - err2 |= __put_user (s.sem_otime, &usp->sem_otime); - err2 |= __put_user (s.sem_ctime, &usp->sem_ctime); - err2 |= __put_user (s.sem_nsems, &usp->sem_nsems); - if (err2) err = -EFAULT; - } - } -out: - return err; -} - -static int do_sys32_msgsnd(int first, int second, int third, - void __user *uptr) -{ - struct msgbuf32 __user *up = uptr; - struct msgbuf *p; - mm_segment_t old_fs; - int err; - - p = kmalloc(second + sizeof (struct msgbuf), GFP_USER); - if (!p) - return -ENOMEM; - err = -EFAULT; - if (get_user (p->mtype, &up->mtype) || - __copy_from_user (p->mtext, &up->mtext, second)) - goto out; - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_msgsnd (first, (struct msgbuf __user *) p, - second, third); - set_fs (old_fs); -out: - kfree (p); - return err; -} - -static int do_sys32_msgrcv(int first, int second, int msgtyp, int third, - int version, void __user *uptr) -{ - struct msgbuf32 __user *up; - struct msgbuf *p; - mm_segment_t old_fs; - int err; - - if (!version) { - struct ipc_kludge __user *uipck = uptr; - struct ipc_kludge ipck; - - err = -EINVAL; - if (!uptr) - goto out; - err = -EFAULT; - if (copy_from_user (&ipck, uipck, - sizeof (struct ipc_kludge))) - goto out; - uptr = compat_ptr(ipck.msgp); - msgtyp = ipck.msgtyp; - } - err = -ENOMEM; - p = kmalloc(second + sizeof (struct msgbuf), GFP_USER); - if (!p) - goto out; - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_msgrcv (first, (struct msgbuf __user *) p, second, - msgtyp, third); - set_fs (old_fs); - if (err < 0) - goto free_then_out; - up = uptr; - if (put_user (p->mtype, &up->mtype) || - __copy_to_user (&up->mtext, p->mtext, err)) - err = -EFAULT; -free_then_out: - kfree (p); -out: - return err; -} - -static int do_sys32_msgctl(int first, int second, void __user *uptr) -{ - int err; - - if (IPCOP_MASK (second) & - (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (MSG_INFO) | - IPCOP_MASK (IPC_RMID))) { - err = sys_msgctl (first, second, uptr); - } else if (second & IPC_64) { - struct msqid64_ds m; - struct msqid64_ds32 __user *up = uptr; - mm_segment_t old_fs; - - if (second == (IPC_SET|IPC_64)) { - err = get_user (m.msg_perm.uid, - &up->msg_perm.uid); - err |= __get_user (m.msg_perm.gid, - &up->msg_perm.gid); - err |= __get_user (m.msg_perm.mode, - &up->msg_perm.mode); - err |= __get_user (m.msg_qbytes, - &up->msg_qbytes); - if (err) - goto out; - } - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_msgctl(first, second, - (struct msqid_ds __user *)&m); - set_fs (old_fs); - if (IPCOP_MASK (second) & - (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) { - int err2 = copy_to_user(&up->msg_perm, - &m.msg_perm, - (sizeof(struct ipc64_perm) + 3*sizeof(time_t))); - err2 |= __put_user (m.msg_cbytes, - &up->msg_cbytes); - err2 |= __put_user (m.msg_qnum, &up->msg_qnum); - err2 |= __put_user (m.msg_qbytes, - &up->msg_qbytes); - err2 |= __put_user (m.msg_lspid, &up->msg_lspid); - err2 |= __put_user (m.msg_lrpid, &up->msg_lrpid); - if (err2) - err = -EFAULT; - } - } else { - struct msqid_ds m; - struct msqid_ds32 __user *up = uptr; - mm_segment_t old_fs; - - if (second == IPC_SET) { - err = get_user(m.msg_perm.uid, - &up->msg_perm.uid); - err |= __get_user(m.msg_perm.gid, - &up->msg_perm.gid); - err |= __get_user(m.msg_perm.mode, - &up->msg_perm.mode); - err |= __get_user(m.msg_qbytes, - &up->msg_qbytes); - if (err) - goto out; - } - old_fs = get_fs (); - set_fs (KERNEL_DS); - err = sys_msgctl(first, second, - (struct msqid_ds __user *) &m); - set_fs (old_fs); - if (IPCOP_MASK (second) & - (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) { - int err2 = put_user(m.msg_perm.key, - &up->msg_perm.key); - err2 |= __put_user(high2lowuid(m.msg_perm.uid), - &up->msg_perm.uid); - err2 |= __put_user(high2lowgid(m.msg_perm.gid), - &up->msg_perm.gid); - err2 |= __put_user(high2lowuid(m.msg_perm.cuid), - &up->msg_perm.cuid); - err2 |= __put_user(high2lowgid(m.msg_perm.cgid), - &up->msg_perm.cgid); - err2 |= __put_user(m.msg_perm.mode, - &up->msg_perm.mode); - err2 |= __put_user(m.msg_perm.seq, - &up->msg_perm.seq); - err2 |= __put_user(m.msg_stime, &up->msg_stime); - err2 |= __put_user(m.msg_rtime, &up->msg_rtime); - err2 |= __put_user(m.msg_ctime, &up->msg_ctime); - err2 |= __put_user(m.msg_cbytes, - &up->msg_cbytes); - err2 |= __put_user(m.msg_qnum, &up->msg_qnum); - err2 |= __put_user(m.msg_qbytes, - &up->msg_qbytes); - err2 |= __put_user(m.msg_lspid, &up->msg_lspid); - err2 |= __put_user(m.msg_lrpid, &up->msg_lrpid); - if (err2) - err = -EFAULT; - } - } - -out: - return err; -} - -static int do_sys32_shmat (int first, int second, int third, int version, void __user *uptr) -{ - unsigned long raddr; - u32 __user *uaddr = compat_ptr((compat_uptr_t)third); - int err = -EINVAL; - - if (version == 1) - goto out; - err = do_shmat (first, uptr, second, &raddr); - if (err) - goto out; - err = put_user (raddr, uaddr); -out: - return err; -} - -static int do_sys32_shmctl(int first, int second, void __user *uptr) +#ifdef CONFIG_SYSVIPC +asmlinkage long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, u32 fifth) { - int err; - - if (IPCOP_MASK (second) & - (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SHM_LOCK) | - IPCOP_MASK (SHM_UNLOCK) | IPCOP_MASK (IPC_RMID))) { - if (second == (IPC_INFO|IPC_64)) { - /* So that we don't have to translate it */ - second = IPC_INFO; - } - err = sys_shmctl(first, second, uptr); - } else if ((second & IPC_64) && second != (SHM_INFO|IPC_64)) { - struct shmid64_ds s; - struct shmid64_ds32 __user *up = uptr; - mm_segment_t old_fs; - - if (second == (IPC_SET|IPC_64)) { - err = get_user(s.shm_perm.uid, - &up->shm_perm.uid); - err |= __get_user(s.shm_perm.gid, - &up->shm_perm.gid); - err |= __get_user(s.shm_perm.mode, - &up->shm_perm.mode); - if (err) - goto out; - } - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_shmctl(first, second, - (struct shmid_ds __user *)&s); - set_fs(old_fs); - if (err < 0) - goto out; - - /* Mask it even in this case so it becomes a CSE. */ - if (IPCOP_MASK (second) & - (IPCOP_MASK (SHM_STAT) | IPCOP_MASK (IPC_STAT))) { - int err2 = copy_to_user(&up->shm_perm, - &s.shm_perm, - sizeof(struct ipc64_perm) + 3*sizeof(time_t)); - err2 |= __put_user(s.shm_segsz, &up->shm_segsz); - err2 |= __put_user(s.shm_nattch,&up->shm_nattch); - err2 |= __put_user(s.shm_cpid, &up->shm_cpid); - err2 |= __put_user(s.shm_lpid, &up->shm_lpid); - if (err2) - err = -EFAULT; - } - } else { - struct shmid_ds s; - struct shmid_ds32 __user *up = uptr; - mm_segment_t old_fs; - - second &= ~IPC_64; - if (second == IPC_SET) { - err = get_user(s.shm_perm.uid, - &up->shm_perm.uid); - err |= __get_user(s.shm_perm.gid, - &up->shm_perm.gid); - err |= __get_user(s.shm_perm.mode, - &up->shm_perm.mode); - if (err) - goto out; - } - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_shmctl(first, second, - (struct shmid_ds __user *) &s); - set_fs(old_fs); - if (err < 0) - goto out; - - /* Mask it even in this case so it becomes a CSE. */ - if (second == SHM_INFO) { - struct shm_info32 { - int used_ids; - u32 shm_tot, shm_rss, shm_swp; - u32 swap_attempts, swap_successes; - }; - struct shm_info32 __user *uip = uptr; - struct shm_info *kp = (struct shm_info *) &s; - int err2 = put_user(kp->used_ids, - &uip->used_ids); - err2 |= __put_user(kp->shm_tot, &uip->shm_tot); - err2 |= __put_user(kp->shm_rss, &uip->shm_rss); - err2 |= __put_user(kp->shm_swp, &uip->shm_swp); - err2 |= __put_user(kp->swap_attempts, - &uip->swap_attempts); - err2 |= __put_user(kp->swap_successes, - &uip->swap_successes); - if (err2) - err = -EFAULT; - } else if (IPCOP_MASK (second) & - (IPCOP_MASK (SHM_STAT) | - IPCOP_MASK (IPC_STAT))) { - int err2; - - err2 = put_user(s.shm_perm.key, - &up->shm_perm.key); - err2 |= __put_user(high2lowuid(s.shm_perm.uid), - &up->shm_perm.uid); - err2 |= __put_user(high2lowuid(s.shm_perm.gid), - &up->shm_perm.gid); - err2 |= __put_user(high2lowuid(s.shm_perm.cuid), - &up->shm_perm.cuid); - err2 |= __put_user(high2lowuid(s.shm_perm.cgid), - &up->shm_perm.cgid); - err2 |= __put_user(s.shm_perm.mode, - &up->shm_perm.mode); - err2 |= __put_user(s.shm_perm.seq, - &up->shm_perm.seq); - err2 |= __put_user(s.shm_atime, &up->shm_atime); - err2 |= __put_user(s.shm_dtime, &up->shm_dtime); - err2 |= __put_user(s.shm_ctime, &up->shm_ctime); - err2 |= __put_user(s.shm_segsz, &up->shm_segsz); - err2 |= __put_user(s.shm_nattch,&up->shm_nattch); - err2 |= __put_user(s.shm_cpid, &up->shm_cpid); - err2 |= __put_user(s.shm_lpid, &up->shm_lpid); - if (err2) - err = -EFAULT; - } - } -out: - return err; -} - -static int sys32_semtimedop(int semid, struct sembuf __user *tsems, - int nsems, - const struct compat_timespec __user *timeout32) -{ - struct compat_timespec t32; - struct timespec __user *t64; - - t64 = compat_alloc_user_space(sizeof(*t64)); - if (copy_from_user(&t32, timeout32, sizeof(t32))) - return -EFAULT; - - if (put_user(t32.tv_sec, &t64->tv_sec) || - put_user(t32.tv_nsec, &t64->tv_nsec)) - return -EFAULT; - - return sys_semtimedop(semid, tsems, nsems, t64); -} - -asmlinkage long compat_sys_ipc(u32 call, int first, int second, int third, compat_uptr_t __ptr, u32 fifth) -{ - int version, err; - void __user *ptr = compat_ptr(__ptr); + int version; version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; - if (call <= SEMCTL) { - switch (call) { - case SEMOP: - /* struct sembuf is the same on 32 and 64 :)) */ - err = sys_semtimedop (first, ptr, second, NULL); - goto out; - case SEMTIMEDOP: - err = sys32_semtimedop(first, ptr, second, - compat_ptr(fifth)); - case SEMGET: - err = sys_semget(first, second, third); - goto out; - case SEMCTL: - err = do_sys32_semctl(first, second, third, ptr); - goto out; - default: - err = -ENOSYS; - goto out; - }; - } - if (call <= MSGCTL) { - switch (call) { - case MSGSND: - err = do_sys32_msgsnd(first, second, third, ptr); - goto out; - case MSGRCV: - err = do_sys32_msgrcv(first, second, fifth, - third, version, ptr); - goto out; - case MSGGET: - err = sys_msgget((key_t) first, second); - goto out; - case MSGCTL: - err = do_sys32_msgctl(first, second, ptr); - goto out; - default: - err = -ENOSYS; - goto out; - }; - } - if (call <= SHMCTL) { - switch (call) { - case SHMAT: - err = do_sys32_shmat(first, second, third, - version, ptr); - goto out; - case SHMDT: - err = sys_shmdt(ptr); - goto out; - case SHMGET: - err = sys_shmget(first, second, third); - goto out; - case SHMCTL: - err = do_sys32_shmctl(first, second, ptr); - goto out; - default: - err = -ENOSYS; - goto out; - }; - } - err = -ENOSYS; + switch (call) { + case SEMTIMEDOP: + if (third) + /* sign extend semid */ + return compat_sys_semtimedop((int)first, + compat_ptr(ptr), second, + compat_ptr(third)); + /* else fall through for normal semop() */ + case SEMOP: + /* struct sembuf is the same on 32 and 64bit :)) */ + /* sign extend semid */ + return sys_semtimedop((int)first, compat_ptr(ptr), second, + NULL); + case SEMGET: + /* sign extend key, nsems */ + return sys_semget((int)first, (int)second, third); + case SEMCTL: + /* sign extend semid, semnum */ + return compat_sys_semctl((int)first, (int)second, third, + compat_ptr(ptr)); + + case MSGSND: + /* sign extend msqid */ + return compat_sys_msgsnd((int)first, (int)second, third, + compat_ptr(ptr)); + case MSGRCV: + /* sign extend msqid, msgtyp */ + return compat_sys_msgrcv((int)first, second, (int)fifth, + third, version, compat_ptr(ptr)); + case MSGGET: + /* sign extend key */ + return sys_msgget((int)first, second); + case MSGCTL: + /* sign extend msqid */ + return compat_sys_msgctl((int)first, second, compat_ptr(ptr)); + + case SHMAT: + /* sign extend shmid */ + return compat_sys_shmat((int)first, second, third, version, + compat_ptr(ptr)); + case SHMDT: + return sys_shmdt(compat_ptr(ptr)); + case SHMGET: + /* sign extend key_t */ + return sys_shmget((int)first, second, third); + case SHMCTL: + /* sign extend shmid */ + return compat_sys_shmctl((int)first, second, compat_ptr(ptr)); + + default: + return -ENOSYS; + }; -out: - return err; + return -ENOSYS; } +#endif asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) { @@ -1044,99 +512,14 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, return ret; } -asmlinkage long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, - struct siginfo32 __user *uinfo, - struct compat_timespec __user *uts, - compat_size_t sigsetsize) -{ - int ret, sig; - sigset_t these; - compat_sigset_t these32; - struct timespec ts; - siginfo_t info; - long timeout = 0; - - /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset_t)) - return -EINVAL; - - if (copy_from_user (&these32, uthese, sizeof(compat_sigset_t))) - return -EFAULT; - - switch (_NSIG_WORDS) { - case 4: these.sig[3] = these32.sig[6] | (((long)these32.sig[7]) << 32); - case 3: these.sig[2] = these32.sig[4] | (((long)these32.sig[5]) << 32); - case 2: these.sig[1] = these32.sig[2] | (((long)these32.sig[3]) << 32); - case 1: these.sig[0] = these32.sig[0] | (((long)these32.sig[1]) << 32); - } - - /* - * Invert the set of allowed signals to get those we - * want to block. - */ - sigdelsetmask(&these, sigmask(SIGKILL)|sigmask(SIGSTOP)); - signotset(&these); - - if (uts) { - if (get_compat_timespec(&ts, uts)) - return -EINVAL; - if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0 - || ts.tv_sec < 0) - return -EINVAL; - } - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - if (!sig) { - timeout = MAX_SCHEDULE_TIMEOUT; - if (uts) - timeout = (timespec_to_jiffies(&ts) - + (ts.tv_sec || ts.tv_nsec)); - - if (timeout) { - /* None ready -- temporarily unblock those we're - * interested while we are sleeping in so that we'll - * be awakened when they arrive. */ - current->real_blocked = current->blocked; - sigandsets(¤t->blocked, ¤t->blocked, &these); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - current->state = TASK_INTERRUPTIBLE; - timeout = schedule_timeout(timeout); - - spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(current, &these, &info); - current->blocked = current->real_blocked; - siginitset(¤t->real_blocked, 0); - recalc_sigpending(); - } - } - spin_unlock_irq(¤t->sighand->siglock); - - if (sig) { - ret = sig; - if (uinfo) { - if (copy_siginfo_to_user32(uinfo, &info)) - ret = -EFAULT; - } - } else { - ret = -EAGAIN; - if (timeout) - ret = -EINTR; - } - - return ret; -} - asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig, - struct siginfo32 __user *uinfo) + struct compat_siginfo __user *uinfo) { siginfo_t info; int ret; mm_segment_t old_fs = get_fs(); - if (copy_siginfo_to_kernel32(&info, uinfo)) + if (copy_siginfo_from_user32(&info, uinfo)) return -EFAULT; set_fs (KERNEL_DS); @@ -1175,8 +558,8 @@ asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { - ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); - ret |= __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer); + ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); + ret |= __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer); ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); ret |= __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); } @@ -1232,10 +615,10 @@ asmlinkage long compat_sys_rt_sigaction(int sig, case 2: set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32); set32.sig[2] = old_ka.sa.sa_mask.sig[1]; case 1: set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); set32.sig[0] = old_ka.sa.sa_mask.sig[0]; } - ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); + ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)); ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); - ret |= __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer); + ret |= __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer); if (ret) ret = -EFAULT; } @@ -1274,7 +657,9 @@ asmlinkage long sparc32_execve(struct pt_regs *regs) current_thread_info()->xfsr[0] = 0; current_thread_info()->fpsaved[0] = 0; regs->tstate &= ~TSTATE_PEF; + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); } out: return error; @@ -1681,7 +1066,8 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp)) error = -EFAULT; } - copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); + if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) + error = -EFAULT; } return error; #endif @@ -1737,8 +1123,8 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32, } asmlinkage long compat_sys_waitid(u32 which, u32 pid, - struct siginfo32 __user *uinfo, u32 options, - struct compat_rusage __user *uru) + struct compat_siginfo __user *uinfo, + u32 options, struct compat_rusage __user *uru) { siginfo_t info; struct rusage ru; diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index ace96ee27..d0592ed54 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -142,7 +142,7 @@ asmlinkage int sunos_brk(u32 baddr) } /* Check against rlimit and stack.. */ retval = -ENOMEM; - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim >= RLIM_INFINITY) rlim = ~0; if (brk - current->mm->end_code > rlim) @@ -291,7 +291,8 @@ static int sunos_filldir(void * __buf, const char * name, int namlen, put_user(ino, &dirent->d_ino); put_user(namlen, &dirent->d_namlen); put_user(reclen, &dirent->d_reclen); - copy_to_user(dirent->d_name, name, namlen); + if (copy_to_user(dirent->d_name, name, namlen)) + return -EFAULT; put_user(0, dirent->d_name + namlen); dirent = (void __user *) dirent + reclen; buf->curr = dirent; @@ -371,7 +372,8 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen, put_user(ino, &dirent->d_ino); put_user(namlen, &dirent->d_namlen); put_user(reclen, &dirent->d_reclen); - copy_to_user(dirent->d_name, name, namlen); + if (copy_to_user(dirent->d_name, name, namlen)) + return -EFAULT; put_user(0, dirent->d_name + namlen); dirent = (void __user *) dirent + reclen; buf->curr = dirent; @@ -1175,11 +1177,11 @@ asmlinkage int sunos_shmsys(int op, u32 arg1, u32 arg2, u32 arg3) return rval; } -extern asmlinkage long sparc32_open(const char * filename, int flags, int mode); +extern asmlinkage long sparc32_open(const char __user * filename, int flags, int mode); asmlinkage int sunos_open(u32 fname, int flags, int mode) { - const char *filename = (const char *)(long)fname; + const char __user *filename = compat_ptr(fname); return sparc32_open(filename, flags, mode); } @@ -1292,7 +1294,7 @@ asmlinkage int sunos_sigaction (int sig, if (!ret && oact) { old_ka.sa.sa_flags ^= SUNOS_SV_INTERRUPT; - if (put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) || + if (put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler) || __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) return -EFAULT; __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index 1c6807c78..cf8301fed 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S @@ -25,7 +25,7 @@ sys_call_table32: /*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys32_chown16, sys32_mknod /*15*/ .word sys_chmod, sys32_lchown16, sparc_brk, sys32_perfctr, sys32_lseek /*20*/ .word sys_getpid, sys_capget, sys_capset, sys32_setuid16, sys32_getuid16 -/*25*/ .word sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause +/*25*/ .word compat_sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid @@ -41,7 +41,7 @@ sys_call_table32: /*90*/ .word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid .word sys_fsync, sys32_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall /*100*/ .word sys32_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending - .word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid + .word compat_sys_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid /*110*/ .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall .word sys32_getgroups, sys32_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd /*120*/ .word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod @@ -60,23 +60,23 @@ sys_call_table32: .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname /*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl .word sys32_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask -/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_old_readdir +/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64 /*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo .word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex /*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 -/*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, compat_statfs64 - .word compat_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall +/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64 + .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl - .word sys_ni_syscall, sys32_clock_settime, compat_clock_gettime, compat_clock_getres, sys32_clock_nanosleep -/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_timer_gettime, sys_timer_getoverrun + .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep +/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun .word sys_timer_delete, sys32_timer_create, sys_vserver, compat_sys_io_setup, sys_io_destroy /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid -/*280*/ .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl #endif /* CONFIG_COMPAT */ @@ -142,7 +142,7 @@ sys_call_table: .word sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy /*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid -/*280*/ .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ defined(CONFIG_SOLARIS_EMUL_MODULE) @@ -247,5 +247,5 @@ sunos_sys_table: .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys - + .word sunos_nosys #endif diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index b50e16d49..5c341ece0 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -46,8 +46,8 @@ #include #include -spinlock_t mostek_lock = SPIN_LOCK_UNLOCKED; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(mostek_lock); +DEFINE_SPINLOCK(rtc_lock); unsigned long mstk48t02_regs = 0UL; #ifdef CONFIG_PCI unsigned long ds1287_regs = 0UL; @@ -64,7 +64,16 @@ static unsigned long mstk48t59_regs = 0UL; static int set_rtc_mmss(unsigned long); -struct sparc64_tick_ops *tick_ops; +static __init unsigned long dummy_get_tick(void) +{ + return 0; +} + +static __initdata struct sparc64_tick_ops dummy_tick_ops = { + .get_tick = dummy_get_tick, +}; + +struct sparc64_tick_ops *tick_ops = &dummy_tick_ops; #define TICK_PRIV_BIT (1UL << 63) @@ -462,6 +471,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) do { #ifndef CONFIG_SMP profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(regs)); #endif do_timer(regs); @@ -1036,6 +1046,7 @@ static struct notifier_block sparc64_cpufreq_notifier_block = { static struct time_interpolator sparc64_cpu_interpolator = { .source = TIME_SOURCE_CPU, .shift = 16, + .mask = 0xffffffffffffffffLL }; /* The quotient formula is taken from the IA64 port. */ diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S index 28fe12b23..f1d764b2d 100644 --- a/arch/sparc64/kernel/trampoline.S +++ b/arch/sparc64/kernel/trampoline.S @@ -90,7 +90,9 @@ startup_continue: sllx %g2, 32, %g2 wr %g2, 0, %tick_cmpr - /* Call OBP by hand to lock KERNBASE into i/d tlbs. */ + /* Call OBP by hand to lock KERNBASE into i/d tlbs. + * We lock 2 consequetive entries if we are 'bigkernel'. + */ mov %o0, %l0 sethi %hi(prom_entry_lock), %g2 @@ -136,6 +138,46 @@ startup_continue: call %o1 add %sp, (2047 + 128), %o0 + sethi %hi(bigkernel), %g2 + lduw [%g2 + %lo(bigkernel)], %g2 + cmp %g2, 0 + be,pt %icc, do_dtlb + nop + + sethi %hi(call_method), %g2 + or %g2, %lo(call_method), %g2 + stx %g2, [%sp + 2047 + 128 + 0x00] + mov 5, %g2 + stx %g2, [%sp + 2047 + 128 + 0x08] + mov 1, %g2 + stx %g2, [%sp + 2047 + 128 + 0x10] + sethi %hi(itlb_load), %g2 + or %g2, %lo(itlb_load), %g2 + stx %g2, [%sp + 2047 + 128 + 0x18] + sethi %hi(mmu_ihandle_cache), %g2 + lduw [%g2 + %lo(mmu_ihandle_cache)], %g2 + stx %g2, [%sp + 2047 + 128 + 0x20] + sethi %hi(KERNBASE + 0x400000), %g2 + stx %g2, [%sp + 2047 + 128 + 0x28] + sethi %hi(kern_locked_tte_data), %g2 + ldx [%g2 + %lo(kern_locked_tte_data)], %g2 + sethi %hi(0x400000), %g1 + add %g2, %g1, %g2 + stx %g2, [%sp + 2047 + 128 + 0x30] + + mov 14, %g2 + BRANCH_IF_ANY_CHEETAH(g1,g5,1f) + + mov 62, %g2 +1: + stx %g2, [%sp + 2047 + 128 + 0x38] + sethi %hi(p1275buf), %g2 + or %g2, %lo(p1275buf), %g2 + ldx [%g2 + 0x08], %o1 + call %o1 + add %sp, (2047 + 128), %o0 + +do_dtlb: sethi %hi(call_method), %g2 or %g2, %lo(call_method), %g2 stx %g2, [%sp + 2047 + 128 + 0x00] @@ -168,6 +210,47 @@ startup_continue: call %o1 add %sp, (2047 + 128), %o0 + sethi %hi(bigkernel), %g2 + lduw [%g2 + %lo(bigkernel)], %g2 + cmp %g2, 0 + be,pt %icc, do_unlock + nop + + sethi %hi(call_method), %g2 + or %g2, %lo(call_method), %g2 + stx %g2, [%sp + 2047 + 128 + 0x00] + mov 5, %g2 + stx %g2, [%sp + 2047 + 128 + 0x08] + mov 1, %g2 + stx %g2, [%sp + 2047 + 128 + 0x10] + sethi %hi(dtlb_load), %g2 + or %g2, %lo(dtlb_load), %g2 + stx %g2, [%sp + 2047 + 128 + 0x18] + sethi %hi(mmu_ihandle_cache), %g2 + lduw [%g2 + %lo(mmu_ihandle_cache)], %g2 + stx %g2, [%sp + 2047 + 128 + 0x20] + sethi %hi(KERNBASE + 0x400000), %g2 + stx %g2, [%sp + 2047 + 128 + 0x28] + sethi %hi(kern_locked_tte_data), %g2 + ldx [%g2 + %lo(kern_locked_tte_data)], %g2 + sethi %hi(0x400000), %g1 + add %g2, %g1, %g2 + stx %g2, [%sp + 2047 + 128 + 0x30] + + mov 14, %g2 + BRANCH_IF_ANY_CHEETAH(g1,g5,1f) + + mov 62, %g2 +1: + + stx %g2, [%sp + 2047 + 128 + 0x38] + sethi %hi(p1275buf), %g2 + or %g2, %lo(p1275buf), %g2 + ldx [%g2 + 0x08], %o1 + call %o1 + add %sp, (2047 + 128), %o0 + +do_unlock: sethi %hi(prom_entry_lock), %g2 stb %g0, [%g2 + %lo(prom_entry_lock)] membar #StoreStore | #StoreLoad diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 7519f39c5..7d0e96f00 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c @@ -42,7 +42,7 @@ #endif struct notifier_block *sparc64die_chain; -static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(die_notifier_lock); int register_die_notifier(struct notifier_block *nb) { diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 646a788fa..8a9d3b6bf 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c @@ -19,8 +19,8 @@ #include #include #include +#include #include -#include /* #define DEBUG_MNA */ diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile index 7dd001f52..3cf408cb1 100644 --- a/arch/sparc64/lib/Makefile +++ b/arch/sparc64/lib/Makefile @@ -12,7 +12,9 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \ U1memcpy.o U1copy_from_user.o U1copy_to_user.o \ U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \ copy_in_user.o user_fixup.o memmove.o \ - mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o iomap.o + mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o + +obj-y += iomap.o diff --git a/arch/sparc64/lib/U1memcpy.S b/arch/sparc64/lib/U1memcpy.S index 06a5bd262..fffec2e3c 100644 --- a/arch/sparc64/lib/U1memcpy.S +++ b/arch/sparc64/lib/U1memcpy.S @@ -119,6 +119,9 @@ .globl FUNC_NAME .type FUNC_NAME,#function FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ + srlx %o2, 31, %g2 + cmp %g2, 0 + tne %xcc, 5 PREAMBLE mov %o0, %g5 cmp %o2, 0 diff --git a/arch/sparc64/lib/U3memcpy.S b/arch/sparc64/lib/U3memcpy.S index 5cde95446..8fe195a10 100644 --- a/arch/sparc64/lib/U3memcpy.S +++ b/arch/sparc64/lib/U3memcpy.S @@ -80,6 +80,9 @@ .globl FUNC_NAME .type FUNC_NAME,#function FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ + srlx %o2, 31, %g2 + cmp %g2, 0 + tne %xcc, 5 PREAMBLE mov %o0, %g5 cmp %o2, 0 diff --git a/arch/sparc64/lib/atomic.S b/arch/sparc64/lib/atomic.S index 26463d8a4..41be4131f 100644 --- a/arch/sparc64/lib/atomic.S +++ b/arch/sparc64/lib/atomic.S @@ -4,59 +4,136 @@ * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ +#include #include + /* On SMP we need to use memory barriers to ensure + * correct memory operation ordering, nop these out + * for uniprocessor. + */ +#ifdef CONFIG_SMP +#define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad +#define ATOMIC_POST_BARRIER membar #StoreLoad | #StoreStore +#else +#define ATOMIC_PRE_BARRIER nop +#define ATOMIC_POST_BARRIER nop +#endif + .text - .align 64 - .globl __atomic_add - .type __atomic_add,#function -__atomic_add: /* %o0 = increment, %o1 = atomic_ptr */ - lduw [%o1], %g5 + /* Two versions of the atomic routines, one that + * does not return a value and does not perform + * memory barriers, and a second which returns + * a value and does the barriers. + */ + .globl atomic_add + .type atomic_add,#function +atomic_add: /* %o0 = increment, %o1 = atomic_ptr */ +1: lduw [%o1], %g5 + add %g5, %o0, %g7 + cas [%o1], %g5, %g7 + cmp %g5, %g7 + bne,pn %icc, 1b + nop + retl + nop + .size atomic_add, .-atomic_add + + .globl atomic_sub + .type atomic_sub,#function +atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */ +1: lduw [%o1], %g5 + sub %g5, %o0, %g7 + cas [%o1], %g5, %g7 + cmp %g5, %g7 + bne,pn %icc, 1b + nop + retl + nop + .size atomic_sub, .-atomic_sub + + .globl atomic_add_ret + .type atomic_add_ret,#function +atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ + ATOMIC_PRE_BARRIER +1: lduw [%o1], %g5 add %g5, %o0, %g7 cas [%o1], %g5, %g7 cmp %g5, %g7 - bne,pn %icc, __atomic_add - membar #StoreLoad | #StoreStore + bne,pn %icc, 1b + add %g7, %o0, %g7 + ATOMIC_POST_BARRIER retl - add %g7, %o0, %o0 - .size __atomic_add, .-__atomic_add + sra %g7, 0, %o0 + .size atomic_add_ret, .-atomic_add_ret - .globl __atomic_sub - .type __atomic_sub,#function -__atomic_sub: /* %o0 = increment, %o1 = atomic_ptr */ - lduw [%o1], %g5 + .globl atomic_sub_ret + .type atomic_sub_ret,#function +atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */ + ATOMIC_PRE_BARRIER +1: lduw [%o1], %g5 sub %g5, %o0, %g7 cas [%o1], %g5, %g7 cmp %g5, %g7 - bne,pn %icc, __atomic_sub - membar #StoreLoad | #StoreStore + bne,pn %icc, 1b + sub %g7, %o0, %g7 + ATOMIC_POST_BARRIER + retl + sra %g7, 0, %o0 + .size atomic_sub_ret, .-atomic_sub_ret + + .globl atomic64_add + .type atomic64_add,#function +atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */ +1: ldx [%o1], %g5 + add %g5, %o0, %g7 + casx [%o1], %g5, %g7 + cmp %g5, %g7 + bne,pn %xcc, 1b + nop + retl + nop + .size atomic64_add, .-atomic64_add + + .globl atomic64_sub + .type atomic64_sub,#function +atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */ +1: ldx [%o1], %g5 + sub %g5, %o0, %g7 + casx [%o1], %g5, %g7 + cmp %g5, %g7 + bne,pn %xcc, 1b + nop retl - sub %g7, %o0, %o0 - .size __atomic_sub, .-__atomic_sub + nop + .size atomic64_sub, .-atomic64_sub - .globl __atomic64_add - .type __atomic64_add,#function -__atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */ - ldx [%o1], %g5 + .globl atomic64_add_ret + .type atomic64_add_ret,#function +atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ + ATOMIC_PRE_BARRIER +1: ldx [%o1], %g5 add %g5, %o0, %g7 casx [%o1], %g5, %g7 cmp %g5, %g7 - bne,pn %xcc, __atomic64_add - membar #StoreLoad | #StoreStore + bne,pn %xcc, 1b + add %g7, %o0, %g7 + ATOMIC_POST_BARRIER retl - add %g7, %o0, %o0 - .size __atomic64_add, .-__atomic64_add + mov %g7, %o0 + .size atomic64_add_ret, .-atomic64_add_ret - .globl __atomic64_sub - .type __atomic64_sub,#function -__atomic64_sub: /* %o0 = increment, %o1 = atomic_ptr */ - ldx [%o1], %g5 + .globl atomic64_sub_ret + .type atomic64_sub_ret,#function +atomic64_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */ + ATOMIC_PRE_BARRIER +1: ldx [%o1], %g5 sub %g5, %o0, %g7 casx [%o1], %g5, %g7 cmp %g5, %g7 - bne,pn %xcc, __atomic64_sub - membar #StoreLoad | #StoreStore + bne,pn %xcc, 1b + sub %g7, %o0, %g7 + ATOMIC_POST_BARRIER retl - sub %g7, %o0, %o0 - .size __atomic64_sub, .-__atomic64_sub + mov %g7, %o0 + .size atomic64_sub_ret, .-atomic64_sub_ret diff --git a/arch/sparc64/lib/bitops.S b/arch/sparc64/lib/bitops.S index c1e370068..fd20171ec 100644 --- a/arch/sparc64/lib/bitops.S +++ b/arch/sparc64/lib/bitops.S @@ -4,69 +4,142 @@ * Copyright (C) 2000 David S. Miller (davem@redhat.com) */ +#include #include + /* On SMP we need to use memory barriers to ensure + * correct memory operation ordering, nop these out + * for uniprocessor. + */ +#ifdef CONFIG_SMP +#define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad +#define BITOP_POST_BARRIER membar #StoreLoad | #StoreStore +#else +#define BITOP_PRE_BARRIER nop +#define BITOP_POST_BARRIER nop +#endif + .text - .align 64 - .globl ___test_and_set_bit - .type ___test_and_set_bit,#function -___test_and_set_bit: /* %o0=nr, %o1=addr */ + + .globl test_and_set_bit + .type test_and_set_bit,#function +test_and_set_bit: /* %o0=nr, %o1=addr */ + BITOP_PRE_BARRIER + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 +1: ldx [%o1], %g7 + or %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,pn %xcc, 1b + and %g7, %g5, %g2 + BITOP_POST_BARRIER + clr %o0 + retl + movrne %g2, 1, %o0 + .size test_and_set_bit, .-test_and_set_bit + + .globl test_and_clear_bit + .type test_and_clear_bit,#function +test_and_clear_bit: /* %o0=nr, %o1=addr */ + BITOP_PRE_BARRIER + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 +1: ldx [%o1], %g7 + andn %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,pn %xcc, 1b + and %g7, %g5, %g2 + BITOP_POST_BARRIER + clr %o0 + retl + movrne %g2, 1, %o0 + .size test_and_clear_bit, .-test_and_clear_bit + + .globl test_and_change_bit + .type test_and_change_bit,#function +test_and_change_bit: /* %o0=nr, %o1=addr */ + BITOP_PRE_BARRIER + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 +1: ldx [%o1], %g7 + xor %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,pn %xcc, 1b + and %g7, %g5, %g2 + BITOP_POST_BARRIER + clr %o0 + retl + movrne %g2, 1, %o0 + .size test_and_change_bit, .-test_and_change_bit + + .globl set_bit + .type set_bit,#function +set_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 and %o0, 63, %g2 sllx %g5, %g2, %g5 add %o1, %g3, %o1 - ldx [%o1], %g7 -1: andcc %g7, %g5, %o0 - bne,pn %xcc, 2f - xor %g7, %g5, %g1 +1: ldx [%o1], %g7 + or %g7, %g5, %g1 casx [%o1], %g7, %g1 cmp %g7, %g1 - bne,a,pn %xcc, 1b - ldx [%o1], %g7 -2: retl - membar #StoreLoad | #StoreStore - .size ___test_and_set_bit, .-___test_and_set_bit + bne,pn %xcc, 1b + nop + retl + nop + .size set_bit, .-set_bit - .globl ___test_and_clear_bit - .type ___test_and_clear_bit,#function -___test_and_clear_bit: /* %o0=nr, %o1=addr */ + .globl clear_bit + .type clear_bit,#function +clear_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 and %o0, 63, %g2 sllx %g5, %g2, %g5 add %o1, %g3, %o1 - ldx [%o1], %g7 -1: andcc %g7, %g5, %o0 - be,pn %xcc, 2f - xor %g7, %g5, %g1 +1: ldx [%o1], %g7 + andn %g7, %g5, %g1 casx [%o1], %g7, %g1 cmp %g7, %g1 - bne,a,pn %xcc, 1b - ldx [%o1], %g7 -2: retl - membar #StoreLoad | #StoreStore - .size ___test_and_clear_bit, .-___test_and_clear_bit + bne,pn %xcc, 1b + nop + retl + nop + .size clear_bit, .-clear_bit - .globl ___test_and_change_bit - .type ___test_and_change_bit,#function -___test_and_change_bit: /* %o0=nr, %o1=addr */ + .globl change_bit + .type change_bit,#function +change_bit: /* %o0=nr, %o1=addr */ srlx %o0, 6, %g1 mov 1, %g5 sllx %g1, 3, %g3 and %o0, 63, %g2 sllx %g5, %g2, %g5 add %o1, %g3, %o1 - ldx [%o1], %g7 -1: and %g7, %g5, %o0 +1: ldx [%o1], %g7 xor %g7, %g5, %g1 casx [%o1], %g7, %g1 cmp %g7, %g1 - bne,a,pn %xcc, 1b - ldx [%o1], %g7 -2: retl - membar #StoreLoad | #StoreStore - nop - .size ___test_and_change_bit, .-___test_and_change_bit + bne,pn %xcc, 1b + nop + retl + nop + .size change_bit, .-change_bit diff --git a/arch/sparc64/lib/debuglocks.c b/arch/sparc64/lib/debuglocks.c index 9fb4dedc8..46e5ebfb4 100644 --- a/arch/sparc64/lib/debuglocks.c +++ b/arch/sparc64/lib/debuglocks.c @@ -172,6 +172,7 @@ void _do_read_unlock (rwlock_t *rw, char *str) runlock_again: /* Spin trying to decrement the counter using casx. */ __asm__ __volatile__( +" membar #StoreLoad | #LoadLoad\n" " ldx [%0], %%g5\n" " sub %%g5, 1, %%g7\n" " casx [%0], %%g5, %%g7\n" @@ -290,6 +291,7 @@ void _do_write_unlock(rwlock_t *rw) current->thread.smp_lock_count--; wlock_again: __asm__ __volatile__( +" membar #StoreLoad | #LoadLoad\n" " mov 1, %%g3\n" " sllx %%g3, 63, %%g3\n" " ldx [%0], %%g5\n" diff --git a/arch/sparc64/lib/dec_and_lock.S b/arch/sparc64/lib/dec_and_lock.S index 399c13509..e86906744 100644 --- a/arch/sparc64/lib/dec_and_lock.S +++ b/arch/sparc64/lib/dec_and_lock.S @@ -25,8 +25,8 @@ * } */ - .globl atomic_dec_and_lock -atomic_dec_and_lock: /* %o0 = counter, %o1 = lock */ + .globl _atomic_dec_and_lock +_atomic_dec_and_lock: /* %o0 = counter, %o1 = lock */ loop1: lduw [%o0], %g5 subcc %g5, 1, %g7 be,pn %icc, start_to_zero diff --git a/arch/sparc64/lib/delay.c b/arch/sparc64/lib/delay.c index f55f528a7..f6b4c784d 100644 --- a/arch/sparc64/lib/delay.c +++ b/arch/sparc64/lib/delay.c @@ -31,7 +31,7 @@ void __const_udelay(unsigned long n) { n *= 4; - n *= (cpu_data(smp_processor_id()).udelay_val * (HZ/4)); + n *= (cpu_data(_smp_processor_id()).udelay_val * (HZ/4)); n >>= 32; __delay(n + 1); diff --git a/arch/sparc64/lib/find_bit.c b/arch/sparc64/lib/find_bit.c index 585261449..605955706 100644 --- a/arch/sparc64/lib/find_bit.c +++ b/arch/sparc64/lib/find_bit.c @@ -1,4 +1,4 @@ -#include +#include /** * find_next_bit - find the next set bit in a memory region @@ -50,9 +50,10 @@ found_middle: * on Linus's ALPHA routines, which are pretty portable BTW. */ -unsigned long find_next_zero_bit(unsigned long *addr, unsigned long size, unsigned long offset) +unsigned long find_next_zero_bit(const unsigned long *addr, + unsigned long size, unsigned long offset) { - unsigned long *p = addr + (offset >> 6); + const unsigned long *p = addr + (offset >> 6); unsigned long result = offset & ~63UL; unsigned long tmp; diff --git a/arch/sparc64/lib/memmove.S b/arch/sparc64/lib/memmove.S index ca8781d0b..1c1ebbbdf 100644 --- a/arch/sparc64/lib/memmove.S +++ b/arch/sparc64/lib/memmove.S @@ -8,18 +8,16 @@ .align 32 .globl memmove .type memmove,#function -memmove: +memmove: /* o0=dst o1=src o2=len */ mov %o0, %g1 cmp %o0, %o1 - blu,pt %xcc, memcpy - sub %o0, %o1, %g5 - add %o1, %o2, %g3 - cmp %g3, %o0 bleu,pt %xcc, memcpy add %o1, %o2, %g5 - add %o0, %o2, %o5 - + cmp %g5, %o0 + bleu,pt %xcc, memcpy + add %o0, %o2, %o5 sub %g5, 1, %o1 + sub %o5, 1, %o0 1: ldub [%o1], %g5 subcc %o2, 1, %o2 diff --git a/arch/sparc64/lib/user_fixup.c b/arch/sparc64/lib/user_fixup.c index 58ec56050..0278e3412 100644 --- a/arch/sparc64/lib/user_fixup.c +++ b/arch/sparc64/lib/user_fixup.c @@ -20,11 +20,12 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned l char *dst = to; const char __user *src = from; - while (size--) { + while (size) { if (__get_user(*dst, src)) break; dst++; src++; + size--; } if (size) @@ -38,11 +39,12 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned lon char __user *dst = to; const char *src = from; - while (size--) { + while (size) { if (__put_user(*src, dst)) break; dst++; src++; + size--; } return size; @@ -53,7 +55,7 @@ unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned lo char __user *dst = to; char __user *src = from; - while (size--) { + while (size) { char tmp; if (__get_user(tmp, src)) @@ -62,6 +64,7 @@ unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned lo break; dst++; src++; + size--; } return size; diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index 63b989f3f..45edb9459 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c @@ -175,6 +175,7 @@ static void bad_kernel_pc(struct pt_regs *regs) static unsigned int get_user_insn(unsigned long tpc) { pgd_t *pgdp = pgd_offset(current->mm, tpc); + pud_t *pudp; pmd_t *pmdp; pte_t *ptep, pte; unsigned long pa; @@ -183,7 +184,10 @@ static unsigned int get_user_insn(unsigned long tpc) if (pgd_none(*pgdp)) goto outret; - pmdp = pmd_offset(pgdp, tpc); + pudp = pud_offset(pgdp, tpc); + if (pud_none(*pudp)) + goto outret; + pmdp = pmd_offset(pudp, tpc); if (pmd_none(*pmdp)) goto outret; @@ -352,7 +356,7 @@ asmlinkage void do_sparc64_fault(struct pt_regs *regs) * If we're in an interrupt or have no user * context, we must not take the fault.. */ - if (in_interrupt() || !mm) + if (in_atomic() || !mm) goto intr_or_no_mm; if (test_thread_flag(TIF_32BIT)) { @@ -361,7 +365,15 @@ asmlinkage void do_sparc64_fault(struct pt_regs *regs) address &= 0xffffffff; } - down_read(&mm->mmap_sem); + if (!down_read_trylock(&mm->mmap_sem)) { + if ((regs->tstate & TSTATE_PRIV) && + !search_exception_tables(regs->tpc)) { + insn = get_fault_insn(regs, insn); + goto handle_kernel_fault; + } + down_read(&mm->mmap_sem); + } + vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -446,16 +458,18 @@ good_area: } switch (handle_mm_fault(mm, vma, address, (fault_code & FAULT_CODE_WRITE))) { - case 1: + case VM_FAULT_MINOR: current->min_flt++; break; - case 2: + case VM_FAULT_MAJOR: current->maj_flt++; break; - case 0: + case VM_FAULT_SIGBUS: goto do_sigbus; - default: + case VM_FAULT_OOM: goto out_of_memory; + default: + BUG(); } up_read(&mm->mmap_sem); diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index 149dc1b4c..4f61c0a5a 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c @@ -15,15 +15,7 @@ #include #include -static inline void forget_pte(pte_t page) -{ - if (!pte_none(page)) { - printk("forget_pte: old mapping existed!\n"); - BUG(); - } -} - -/* Remap IO memory, the same way as remap_page_range(), but use +/* Remap IO memory, the same way as remap_pfn_range(), but use * the obio memory space. * * They use a pgprot that sets PAGE_IO and does not check the @@ -43,7 +35,6 @@ static inline void io_remap_pte_range(pte_t * pte, unsigned long address, unsign if (end > PMD_SIZE) end = PMD_SIZE; do { - pte_t oldpage; pte_t entry; unsigned long curend = address + PAGE_SIZE; @@ -75,10 +66,8 @@ static inline void io_remap_pte_range(pte_t * pte, unsigned long address, unsign if (offset & 0x1UL) pte_val(entry) &= ~(_PAGE_E); do { - oldpage = *pte; - pte_clear(pte); + BUG_ON(!pte_none(*pte)); set_pte(pte, entry); - forget_pte(oldpage); address += PAGE_SIZE; pte++; } while (address < curend); @@ -107,6 +96,27 @@ static inline int io_remap_pmd_range(pmd_t * pmd, unsigned long address, unsigne return 0; } +static inline int io_remap_pud_range(pud_t * pud, unsigned long address, unsigned long size, + unsigned long offset, pgprot_t prot, int space) +{ + unsigned long end; + + address &= ~PUD_MASK; + end = address + size; + if (end > PUD_SIZE) + end = PUD_SIZE; + offset -= address; + do { + pmd_t *pmd = pmd_alloc(current->mm, pud, address); + if (!pud) + return -ENOMEM; + io_remap_pmd_range(pmd, address, end - address, address + offset, prot, space); + address = (address + PUD_SIZE) & PUD_MASK; + pud++; + } while (address < end); + return 0; +} + int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space) { int error = 0; @@ -122,18 +132,18 @@ int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned spin_lock(&mm->page_table_lock); while (from < end) { - pmd_t *pmd = pmd_alloc(current->mm, dir, from); + pud_t *pud = pud_alloc(current->mm, dir, from); error = -ENOMEM; - if (!pmd) + if (!pud) break; - error = io_remap_pmd_range(pmd, from, end - from, offset + from, prot, space); + error = io_remap_pud_range(pud, from, end - from, offset + from, prot, space); if (error) break; from = (from + PGDIR_SIZE) & PGDIR_MASK; dir++; } + flush_tlb_range(vma, beg, end); spin_unlock(&mm->page_table_lock); - flush_tlb_range(vma, beg, end); return error; } diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c index c9954c2ec..60760d041 100644 --- a/arch/sparc64/mm/hugetlbpage.c +++ b/arch/sparc64/mm/hugetlbpage.c @@ -24,14 +24,18 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; pgd = pgd_offset(mm, addr); if (pgd) { - pmd = pmd_alloc(mm, pgd, addr); - if (pmd) - pte = pte_alloc_map(mm, pmd, addr); + pud = pud_offset(pgd, addr); + if (pud) { + pmd = pmd_alloc(mm, pud, addr); + if (pmd) + pte = pte_alloc_map(mm, pmd, addr); + } } return pte; } @@ -39,14 +43,18 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; pgd = pgd_offset(mm, addr); if (pgd) { - pmd = pmd_offset(pgd, addr); - if (pmd) - pte = pte_offset_map(pmd, addr); + pud = pud_offset(pgd, addr); + if (pud) { + pmd = pmd_offset(pud, addr); + if (pmd) + pte = pte_offset_map(pmd, addr); + } } return pte; } diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index a82492650..5dc8b353b 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -59,7 +59,7 @@ unsigned long pfn_base; static unsigned long bootmap_base; /* get_new_mmu_context() uses "cache + 1". */ -spinlock_t ctx_alloc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(ctx_alloc_lock); unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1; #define CTX_BMAP_SLOTS (1UL << (CTX_VERSION_SHIFT - 6)) unsigned long mmu_context_bmap[CTX_BMAP_SLOTS]; @@ -1462,7 +1462,8 @@ void __init paging_init(void) memset(swapper_pmd_dir, 0, sizeof(swapper_pmd_dir)); /* Now can init the kernel/bad page tables. */ - pgd_set(&swapper_pg_dir[0], swapper_pmd_dir + (shift / sizeof(pgd_t))); + pud_set(pud_offset(&swapper_pg_dir[0], 0), + swapper_pmd_dir + (shift / sizeof(pgd_t))); sparc64_vpte_patchme1[0] |= (((unsigned long)pgd_val(init_mm.pgd[0])) >> 10); @@ -1687,13 +1688,12 @@ void __init mem_init(void) * Set up the zero page, mark it reserved, so that page count * is not manipulated when freeing the page from user ptes. */ - mem_map_zero = alloc_pages(GFP_KERNEL, 0); + mem_map_zero = alloc_pages(GFP_KERNEL|__GFP_ZERO, 0); if (mem_map_zero == NULL) { prom_printf("paging_init: Cannot alloc zero page.\n"); prom_halt(); } SetPageReserved(mem_map_zero); - clear_page(page_address(mem_map_zero)); codepages = (((unsigned long) _etext) - ((unsigned long) _start)); codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT; @@ -1745,6 +1745,7 @@ void free_initmem (void) page = (addr + ((unsigned long) __va(kern_base)) - ((unsigned long) KERNBASE)); + memset((void *)addr, 0xcc, PAGE_SIZE); p = virt_to_page(page); ClearPageReserved(p); diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c index e2d79fc14..f900be7be 100644 --- a/arch/sparc64/mm/tlb.c +++ b/arch/sparc64/mm/tlb.c @@ -118,11 +118,9 @@ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long */ BUG_ON(s > e); -#if 0 - /* Currently free_pgtables guarantees this. */ s &= PMD_MASK; e = (e + PMD_SIZE - 1) & PMD_MASK; -#endif + vpte_base = (tlb_type == spitfire ? VPTE_BASE_SPITFIRE : VPTE_BASE_CHEETAH); diff --git a/arch/sparc64/oprofile/init.c b/arch/sparc64/oprofile/init.c index b49fe60c0..9ab815b95 100644 --- a/arch/sparc64/oprofile/init.c +++ b/arch/sparc64/oprofile/init.c @@ -12,9 +12,7 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops); - -int __init oprofile_arch_init(struct oprofile_operations ** ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { return -ENODEV; } diff --git a/arch/sparc64/prom/Makefile b/arch/sparc64/prom/Makefile index 9651ffec7..8f2420d9e 100644 --- a/arch/sparc64/prom/Makefile +++ b/arch/sparc64/prom/Makefile @@ -7,4 +7,4 @@ EXTRA_AFLAGS := -ansi EXTRA_CFLAGS := -Werror lib-y := bootstr.o devops.o init.o memory.o misc.o \ - tree.o console.o printf.o p1275.o map.o + tree.o console.o printf.o p1275.o map.o cif.o diff --git a/arch/sparc64/prom/memory.c b/arch/sparc64/prom/memory.c index 224821f62..f4a8143e0 100644 --- a/arch/sparc64/prom/memory.c +++ b/arch/sparc64/prom/memory.c @@ -45,9 +45,9 @@ prom_sortmemlist(struct linux_mlist_p1275 *thislist) unsigned long tmpaddr, tmpsize; unsigned long lowest; - for(i=0; thislist[i].theres_more != 0; i++) { + for(i=0; thislist[i].theres_more; i++) { lowest = thislist[i].start_adr; - for(mitr = i+1; thislist[mitr-1].theres_more != 0; mitr++) + for(mitr = i+1; thislist[mitr-1].theres_more; mitr++) if(thislist[mitr].start_adr < lowest) { lowest = thislist[mitr].start_adr; swapi = mitr; @@ -83,7 +83,7 @@ void __init prom_meminit(void) prom_phys_avail[iter].theres_more = &prom_phys_avail[iter+1]; } - prom_phys_avail[iter-1].theres_more = 0x0; + prom_phys_avail[iter-1].theres_more = NULL; num_regs = prom_getproperty(node, "reg", (char *) prom_reg_memlist, @@ -97,7 +97,7 @@ void __init prom_meminit(void) prom_phys_total[iter].theres_more = &prom_phys_total[iter+1]; } - prom_phys_total[iter-1].theres_more = 0x0; + prom_phys_total[iter-1].theres_more = NULL; node = prom_finddevice("/virtual-memory"); num_regs = prom_getproperty(node, "available", @@ -116,7 +116,7 @@ void __init prom_meminit(void) prom_prom_taken[iter].theres_more = &prom_prom_taken[iter+1]; } - prom_prom_taken[iter-1].theres_more = 0x0; + prom_prom_taken[iter-1].theres_more = NULL; prom_sortmemlist(prom_prom_taken); diff --git a/arch/sparc64/prom/p1275.c b/arch/sparc64/prom/p1275.c index eaa6ab19f..9eab4421e 100644 --- a/arch/sparc64/prom/p1275.c +++ b/arch/sparc64/prom/p1275.c @@ -27,231 +27,14 @@ struct { extern void prom_world(int); -void prom_cif_interface (void) -{ - __asm__ __volatile__ ( -" mov %0, %%o0\n" -" ldx [%%o0 + 0x010], %%o1 ! prom_cif_stack\n" -" save %%o1, -0x190, %%sp\n" -" ldx [%%i0 + 0x008], %%l2 ! prom_cif_handler\n" -" rdpr %%pstate, %%l4\n" -" wrpr %%g0, 0x15, %%pstate ! save alternate globals\n" -" stx %%g1, [%%sp + 2047 + 0x0b0]\n" -" stx %%g2, [%%sp + 2047 + 0x0b8]\n" -" stx %%g3, [%%sp + 2047 + 0x0c0]\n" -" stx %%g4, [%%sp + 2047 + 0x0c8]\n" -" stx %%g5, [%%sp + 2047 + 0x0d0]\n" -" stx %%g6, [%%sp + 2047 + 0x0d8]\n" -" stx %%g7, [%%sp + 2047 + 0x0e0]\n" -" wrpr %%g0, 0x814, %%pstate ! save interrupt globals\n" -" stx %%g1, [%%sp + 2047 + 0x0e8]\n" -" stx %%g2, [%%sp + 2047 + 0x0f0]\n" -" stx %%g3, [%%sp + 2047 + 0x0f8]\n" -" stx %%g4, [%%sp + 2047 + 0x100]\n" -" stx %%g5, [%%sp + 2047 + 0x108]\n" -" stx %%g6, [%%sp + 2047 + 0x110]\n" -" stx %%g7, [%%sp + 2047 + 0x118]\n" -" wrpr %%g0, 0x14, %%pstate ! save normal globals\n" -" stx %%g1, [%%sp + 2047 + 0x120]\n" -" stx %%g2, [%%sp + 2047 + 0x128]\n" -" stx %%g3, [%%sp + 2047 + 0x130]\n" -" stx %%g4, [%%sp + 2047 + 0x138]\n" -" stx %%g5, [%%sp + 2047 + 0x140]\n" -" stx %%g6, [%%sp + 2047 + 0x148]\n" -" stx %%g7, [%%sp + 2047 + 0x150]\n" -" wrpr %%g0, 0x414, %%pstate ! save mmu globals\n" -" stx %%g1, [%%sp + 2047 + 0x158]\n" -" stx %%g2, [%%sp + 2047 + 0x160]\n" -" stx %%g3, [%%sp + 2047 + 0x168]\n" -" stx %%g4, [%%sp + 2047 + 0x170]\n" -" stx %%g5, [%%sp + 2047 + 0x178]\n" -" stx %%g6, [%%sp + 2047 + 0x180]\n" -" stx %%g7, [%%sp + 2047 + 0x188]\n" -" mov %%g1, %%l0 ! also save to locals, so we can handle\n" -" mov %%g2, %%l1 ! tlb faults later on, when accessing\n" -" mov %%g3, %%l3 ! the stack.\n" -" mov %%g7, %%l5\n" -" wrpr %%l4, %1, %%pstate ! turn off interrupts\n" -" call %%l2\n" -" add %%i0, 0x018, %%o0 ! prom_args\n" -" wrpr %%g0, 0x414, %%pstate ! restore mmu globals\n" -" mov %%l0, %%g1\n" -" mov %%l1, %%g2\n" -" mov %%l3, %%g3\n" -" mov %%l5, %%g7\n" -" wrpr %%g0, 0x14, %%pstate ! restore normal globals\n" -" ldx [%%sp + 2047 + 0x120], %%g1\n" -" ldx [%%sp + 2047 + 0x128], %%g2\n" -" ldx [%%sp + 2047 + 0x130], %%g3\n" -" ldx [%%sp + 2047 + 0x138], %%g4\n" -" ldx [%%sp + 2047 + 0x140], %%g5\n" -" ldx [%%sp + 2047 + 0x148], %%g6\n" -" ldx [%%sp + 2047 + 0x150], %%g7\n" -" wrpr %%g0, 0x814, %%pstate ! restore interrupt globals\n" -" ldx [%%sp + 2047 + 0x0e8], %%g1\n" -" ldx [%%sp + 2047 + 0x0f0], %%g2\n" -" ldx [%%sp + 2047 + 0x0f8], %%g3\n" -" ldx [%%sp + 2047 + 0x100], %%g4\n" -" ldx [%%sp + 2047 + 0x108], %%g5\n" -" ldx [%%sp + 2047 + 0x110], %%g6\n" -" ldx [%%sp + 2047 + 0x118], %%g7\n" -" wrpr %%g0, 0x15, %%pstate ! restore alternate globals\n" -" ldx [%%sp + 2047 + 0x0b0], %%g1\n" -" ldx [%%sp + 2047 + 0x0b8], %%g2\n" -" ldx [%%sp + 2047 + 0x0c0], %%g3\n" -" ldx [%%sp + 2047 + 0x0c8], %%g4\n" -" ldx [%%sp + 2047 + 0x0d0], %%g5\n" -" ldx [%%sp + 2047 + 0x0d8], %%g6\n" -" ldx [%%sp + 2047 + 0x0e0], %%g7\n" -" wrpr %%l4, 0, %%pstate ! restore original pstate\n" -" ret\n" -" restore\n" -" " : : "r" (&p1275buf), "i" (PSTATE_IE)); -} - -void prom_cif_callback(void) -{ - __asm__ __volatile__ ( -" mov %0, %%o1\n" -" save %%sp, -0x270, %%sp\n" -" rdpr %%pstate, %%l4\n" -" wrpr %%g0, 0x15, %%pstate ! save PROM alternate globals\n" -" stx %%g1, [%%sp + 2047 + 0x0b0]\n" -" stx %%g2, [%%sp + 2047 + 0x0b8]\n" -" stx %%g3, [%%sp + 2047 + 0x0c0]\n" -" stx %%g4, [%%sp + 2047 + 0x0c8]\n" -" stx %%g5, [%%sp + 2047 + 0x0d0]\n" -" stx %%g6, [%%sp + 2047 + 0x0d8]\n" -" stx %%g7, [%%sp + 2047 + 0x0e0]\n" -" ! restore Linux alternate globals\n" -" ldx [%%sp + 2047 + 0x190], %%g1\n" -" ldx [%%sp + 2047 + 0x198], %%g2\n" -" ldx [%%sp + 2047 + 0x1a0], %%g3\n" -" ldx [%%sp + 2047 + 0x1a8], %%g4\n" -" ldx [%%sp + 2047 + 0x1b0], %%g5\n" -" ldx [%%sp + 2047 + 0x1b8], %%g6\n" -" ldx [%%sp + 2047 + 0x1c0], %%g7\n" -" wrpr %%g0, 0x814, %%pstate ! save PROM interrupt globals\n" -" stx %%g1, [%%sp + 2047 + 0x0e8]\n" -" stx %%g2, [%%sp + 2047 + 0x0f0]\n" -" stx %%g3, [%%sp + 2047 + 0x0f8]\n" -" stx %%g4, [%%sp + 2047 + 0x100]\n" -" stx %%g5, [%%sp + 2047 + 0x108]\n" -" stx %%g6, [%%sp + 2047 + 0x110]\n" -" stx %%g7, [%%sp + 2047 + 0x118]\n" -" ! restore Linux interrupt globals\n" -" ldx [%%sp + 2047 + 0x1c8], %%g1\n" -" ldx [%%sp + 2047 + 0x1d0], %%g2\n" -" ldx [%%sp + 2047 + 0x1d8], %%g3\n" -" ldx [%%sp + 2047 + 0x1e0], %%g4\n" -" ldx [%%sp + 2047 + 0x1e8], %%g5\n" -" ldx [%%sp + 2047 + 0x1f0], %%g6\n" -" ldx [%%sp + 2047 + 0x1f8], %%g7\n" -" wrpr %%g0, 0x14, %%pstate ! save PROM normal globals\n" -" stx %%g1, [%%sp + 2047 + 0x120]\n" -" stx %%g2, [%%sp + 2047 + 0x128]\n" -" stx %%g3, [%%sp + 2047 + 0x130]\n" -" stx %%g4, [%%sp + 2047 + 0x138]\n" -" stx %%g5, [%%sp + 2047 + 0x140]\n" -" stx %%g6, [%%sp + 2047 + 0x148]\n" -" stx %%g7, [%%sp + 2047 + 0x150]\n" -" ! restore Linux normal globals\n" -" ldx [%%sp + 2047 + 0x200], %%g1\n" -" ldx [%%sp + 2047 + 0x208], %%g2\n" -" ldx [%%sp + 2047 + 0x210], %%g3\n" -" ldx [%%sp + 2047 + 0x218], %%g4\n" -" ldx [%%sp + 2047 + 0x220], %%g5\n" -" ldx [%%sp + 2047 + 0x228], %%g6\n" -" ldx [%%sp + 2047 + 0x230], %%g7\n" -" wrpr %%g0, 0x414, %%pstate ! save PROM mmu globals\n" -" stx %%g1, [%%sp + 2047 + 0x158]\n" -" stx %%g2, [%%sp + 2047 + 0x160]\n" -" stx %%g3, [%%sp + 2047 + 0x168]\n" -" stx %%g4, [%%sp + 2047 + 0x170]\n" -" stx %%g5, [%%sp + 2047 + 0x178]\n" -" stx %%g6, [%%sp + 2047 + 0x180]\n" -" stx %%g7, [%%sp + 2047 + 0x188]\n" -" ! restore Linux mmu globals\n" -" ldx [%%sp + 2047 + 0x238], %%o0\n" -" ldx [%%sp + 2047 + 0x240], %%o1\n" -" ldx [%%sp + 2047 + 0x248], %%l2\n" -" ldx [%%sp + 2047 + 0x250], %%l3\n" -" ldx [%%sp + 2047 + 0x258], %%l5\n" -" ldx [%%sp + 2047 + 0x260], %%l6\n" -" ldx [%%sp + 2047 + 0x268], %%l7\n" -" ! switch to Linux tba\n" -" sethi %%hi(sparc64_ttable_tl0), %%l1\n" -" rdpr %%tba, %%l0 ! save PROM tba\n" -" mov %%o0, %%g1\n" -" mov %%o1, %%g2\n" -" mov %%l2, %%g3\n" -" mov %%l3, %%g4\n" -" mov %%l5, %%g5\n" -" mov %%l6, %%g6\n" -" mov %%l7, %%g7\n" -" wrpr %%l1, %%tba ! install Linux tba\n" -" wrpr %%l4, 0, %%pstate ! restore PSTATE\n" -" call prom_world\n" -" mov %%g0, %%o0\n" -" ldx [%%i1 + 0x000], %%l2\n" -" call %%l2\n" -" mov %%i0, %%o0\n" -" mov %%o0, %%l1\n" -" call prom_world\n" -" or %%g0, 1, %%o0\n" -" wrpr %%g0, 0x14, %%pstate ! interrupts off\n" -" ! restore PROM mmu globals\n" -" ldx [%%sp + 2047 + 0x158], %%o0\n" -" ldx [%%sp + 2047 + 0x160], %%o1\n" -" ldx [%%sp + 2047 + 0x168], %%l2\n" -" ldx [%%sp + 2047 + 0x170], %%l3\n" -" ldx [%%sp + 2047 + 0x178], %%l5\n" -" ldx [%%sp + 2047 + 0x180], %%l6\n" -" ldx [%%sp + 2047 + 0x188], %%l7\n" -" wrpr %%g0, 0x414, %%pstate ! restore PROM mmu globals\n" -" mov %%o0, %%g1\n" -" mov %%o1, %%g2\n" -" mov %%l2, %%g3\n" -" mov %%l3, %%g4\n" -" mov %%l5, %%g5\n" -" mov %%l6, %%g6\n" -" mov %%l7, %%g7\n" -" wrpr %%l0, %%tba ! restore PROM tba\n" -" wrpr %%g0, 0x14, %%pstate ! restore PROM normal globals\n" -" ldx [%%sp + 2047 + 0x120], %%g1\n" -" ldx [%%sp + 2047 + 0x128], %%g2\n" -" ldx [%%sp + 2047 + 0x130], %%g3\n" -" ldx [%%sp + 2047 + 0x138], %%g4\n" -" ldx [%%sp + 2047 + 0x140], %%g5\n" -" ldx [%%sp + 2047 + 0x148], %%g6\n" -" ldx [%%sp + 2047 + 0x150], %%g7\n" -" wrpr %%g0, 0x814, %%pstate ! restore PROM interrupt globals\n" -" ldx [%%sp + 2047 + 0x0e8], %%g1\n" -" ldx [%%sp + 2047 + 0x0f0], %%g2\n" -" ldx [%%sp + 2047 + 0x0f8], %%g3\n" -" ldx [%%sp + 2047 + 0x100], %%g4\n" -" ldx [%%sp + 2047 + 0x108], %%g5\n" -" ldx [%%sp + 2047 + 0x110], %%g6\n" -" ldx [%%sp + 2047 + 0x118], %%g7\n" -" wrpr %%g0, 0x15, %%pstate ! restore PROM alternate globals\n" -" ldx [%%sp + 2047 + 0x0b0], %%g1\n" -" ldx [%%sp + 2047 + 0x0b8], %%g2\n" -" ldx [%%sp + 2047 + 0x0c0], %%g3\n" -" ldx [%%sp + 2047 + 0x0c8], %%g4\n" -" ldx [%%sp + 2047 + 0x0d0], %%g5\n" -" ldx [%%sp + 2047 + 0x0d8], %%g6\n" -" ldx [%%sp + 2047 + 0x0e0], %%g7\n" -" wrpr %%l4, 0, %%pstate\n" -" ret\n" -" restore %%l1, 0, %%o0\n" -" " : : "r" (&p1275buf), "i" (PSTATE_PRIV)); -} +extern void prom_cif_interface(void); +extern void prom_cif_callback(void); /* * This provides SMP safety on the p1275buf. prom_callback() drops this lock * to allow recursuve acquisition. */ -spinlock_t prom_entry_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(prom_entry_lock); long p1275_cmd (char *service, long fmt, ...) { diff --git a/arch/sparc64/solaris/entry64.S b/arch/sparc64/solaris/entry64.S index ba0453023..0cc9dad75 100644 --- a/arch/sparc64/solaris/entry64.S +++ b/arch/sparc64/solaris/entry64.S @@ -109,7 +109,7 @@ ret_from_solaris: sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 - cmp %o0, -ENOIOCTLCMD + cmp %o0, -ERESTART_RESTARTBLOCK sllx %g2, 32, %g2 bgeu,pn %xcc, 1f andcc %l6, _TIF_SYSCALL_TRACE, %l6 diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index a237c68ac..d7c99fa89 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c @@ -600,23 +600,23 @@ asmlinkage int solaris_ulimit(int cmd, int val) { switch (cmd) { case 1: /* UL_GETFSIZE - in 512B chunks */ - return current->rlim[RLIMIT_FSIZE].rlim_cur >> 9; + return current->signal->rlim[RLIMIT_FSIZE].rlim_cur >> 9; case 2: /* UL_SETFSIZE */ if ((unsigned long)val > (LONG_MAX>>9)) return -ERANGE; val <<= 9; - lock_kernel(); - if (val > current->rlim[RLIMIT_FSIZE].rlim_max) { + task_lock(current->group_leader); + if (val > current->signal->rlim[RLIMIT_FSIZE].rlim_max) { if (!capable(CAP_SYS_RESOURCE)) { - unlock_kernel(); + task_unlock(current->group_leader); return -EPERM; } - current->rlim[RLIMIT_FSIZE].rlim_max = val; + current->signal->rlim[RLIMIT_FSIZE].rlim_max = val; } - current->rlim[RLIMIT_FSIZE].rlim_cur = val; - unlock_kernel(); + current->signal->rlim[RLIMIT_FSIZE].rlim_cur = val; + task_unlock(current->group_leader); return 0; case 3: /* UL_GMEMLIM */ - return current->rlim[RLIMIT_DATA].rlim_cur; + return current->signal->rlim[RLIMIT_DATA].rlim_cur; case 4: /* UL_GDESLIM */ return NR_OPEN; } diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c index b0d12032b..cac0a1cf0 100644 --- a/arch/sparc64/solaris/ioctl.c +++ b/arch/sparc64/solaris/ioctl.c @@ -298,7 +298,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) if (! current->files->fd[fd] || ! current->files->fd[fd]->f_dentry || ! (ino = current->files->fd[fd]->f_dentry->d_inode) || - ! ino->i_sock) { + ! S_ISSOCK(ino->i_mode)) { spin_unlock(¤t->files->file_lock); return TBADF; } @@ -478,7 +478,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd struct module_info *mi; ino = filp->f_dentry->d_inode; - if (! ino->i_sock) + if (!S_ISSOCK(ino->i_mode)) return -EBADF; sock = filp->private_data; if (! sock) { diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index e16e64d8a..d7c1c7658 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -150,7 +150,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) unsigned int mask = 0; ino=filp->f_dentry->d_inode; - if (ino && ino->i_sock) { + if (ino && S_ISSOCK(ino->i_mode)) { struct sol_socket_struct *sock; sock = (struct sol_socket_struct*)filp->private_data; if (sock && sock->pfirst) { diff --git a/arch/sparc64/solaris/systbl.S b/arch/sparc64/solaris/systbl.S index 853afe9d1..d25667eea 100644 --- a/arch/sparc64/solaris/systbl.S +++ b/arch/sparc64/solaris/systbl.S @@ -295,4 +295,20 @@ solaris_sys_table: .word solaris_unimplemented /* 265 */ .word solaris_unimplemented /* 266 */ .word solaris_unimplemented /* 267 */ + .word solaris_unimplemented /* 268 */ + .word solaris_unimplemented /* 269 */ + .word solaris_unimplemented /* 270 */ + .word solaris_unimplemented /* 271 */ + .word solaris_unimplemented /* 272 */ + .word solaris_unimplemented /* 273 */ + .word solaris_unimplemented /* 274 */ + .word solaris_unimplemented /* 275 */ + .word solaris_unimplemented /* 276 */ + .word solaris_unimplemented /* 277 */ + .word solaris_unimplemented /* 278 */ + .word solaris_unimplemented /* 279 */ + .word solaris_unimplemented /* 280 */ + .word solaris_unimplemented /* 281 */ + .word solaris_unimplemented /* 282 */ + .word solaris_unimplemented /* 283 */ diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c index 24de50620..022c80f43 100644 --- a/arch/sparc64/solaris/timod.c +++ b/arch/sparc64/solaris/timod.c @@ -29,7 +29,7 @@ asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg); -static spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(timod_pagelock); static char * page = NULL ; #ifndef DEBUG_SOLARIS_KMALLOC @@ -853,9 +853,7 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) if(!filp) goto out; ino = filp->f_dentry->d_inode; - if (!ino) goto out; - - if (!ino->i_sock) + if (!ino || !S_ISSOCK(ino->i_mode)) goto out; ctlptr = (struct strbuf __user *)A(arg1); @@ -923,7 +921,7 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) ino = filp->f_dentry->d_inode; if (!ino) goto out; - if (!ino->i_sock && + if (!S_ISSOCK(ino->i_mode) && (imajor(ino) != 30 || iminor(ino) != 1)) goto out; diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 98915ada2..298c0185b 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig @@ -1,3 +1,8 @@ +# UML uses the generic IRQ sugsystem +config GENERIC_HARDIRQS + bool + default y + config USERMODE bool default y @@ -26,6 +31,10 @@ config RWSEM_GENERIC_SPINLOCK bool default y +config GENERIC_CALIBRATE_DELAY + bool + default y + menu "UML-specific options" config MODE_TT @@ -59,6 +68,18 @@ config MODE_SKAS to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this option will shrink the UML binary slightly. +source "arch/um/Kconfig_arch" + +config LD_SCRIPT_STATIC + bool + default y + depends on MODE_TT || STATIC_LINK + +config LD_SCRIPT_DYN + bool + default y + depends on !LD_SCRIPT_STATIC + config NET bool "Networking support" help @@ -69,7 +90,7 @@ config NET should consider updating your networking tools too because changes in the kernel and the tools often go hand in hand. The tools are contained in the package net-tools, the location and version number - of which are given in Documentation/Changes. + of which are given in . For a general introduction to Linux networking, it is highly recommended to read the NET-HOWTO, available from @@ -100,7 +121,8 @@ config HOSTFS say Y or M here; otherwise say N. config HPPFS - tristate "HoneyPot ProcFS" + tristate "HoneyPot ProcFS (EXPERIMENTAL)" + depends on BROKEN help hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc entries to be overridden, removed, or fabricated from the host. @@ -108,13 +130,17 @@ config HPPFS by removing or changing anything in /proc which gives away the identity of a UML. - See http://user-mode-linux.sf.net/hppfs.html for more information. + See for more information. You only need this if you are setting up a UML honeypot. Otherwise, it is safe to say 'N' here. + If you are actively using it, please ask for it to be fixed. In this + moment, it does not work on 2.6 (it works somehow on 2.4). + config MCONSOLE bool "Management console" + default y help The user mode linux management console is a low-level interface to the kernel, somewhat like the i386 SysRq interface. Since there is @@ -129,21 +155,61 @@ config MCONSOLE It is safe to say 'Y' here. +config MAGIC_SYSRQ + bool "Magic SysRq key" + depends on MCONSOLE + ---help--- + If you say Y here, you will have some control over the system even + if the system crashes for example during kernel debugging (e.g., you + will be able to flush the buffer cache to disk, reboot the system + immediately or dump some status information). A key for each of the + possible requests is provided. + + This is the feature normally accomplished by pressing a key + while holding SysRq (Alt+PrintScreen). + + On UML, this is accomplished by sending a "sysrq" command with + mconsole, followed by the letter for the requested command. + + The keys are documented in . Don't say Y + unless you really know what this hack does. + config HOST_2G_2G bool "2G/2G host address space split" + default n + help + This is needed when the host on which you run has a 2G/2G memory + split, instead of the customary 3G/1G. + + Note that to enable such a host + configuration, which makes sense only in some cases, you need special + host patches. + + So, if you do not know what to do here, say 'N'. config SMP - bool "Symmetric multi-processing support" + bool "Symmetric multi-processing support (EXPERIMENTAL)" default n + depends on MODE_TT && EXPERIMENTAL help - This option enables UML SMP support. UML implements virtual SMP by - allowing as many processes to run simultaneously on the host as - there are virtual processors configured. Obviously, if the host is - a uniprocessor, those processes will timeshare, but, inside UML, - will appear to be running simultaneously. If the host is a - multiprocessor, then UML processes may run simultaneously, depending - on the host scheduler. - It is safe to leave this unchanged. + This option enables UML SMP support. + It is NOT related to having a real SMP box. Not directly, at least. + + UML implements virtual SMP by allowing as many processes to run + simultaneously on the host as there are virtual processors configured. + + Obviously, if the host is a uniprocessor, those processes will + timeshare, but, inside UML, will appear to be running simultaneously. + If the host is a multiprocessor, then UML processes may run + simultaneously, depending on the host scheduler. + + This, however, is supported only in TT mode. So, if you use the SKAS + patch on your host, switching to TT mode and enabling SMP usually gives + you worse performances. + Also, since the support for SMP has been under-developed, there could + be some bugs being exposed by enabling SMP. + + If you don't know what to do, say N. config NR_CPUS int "Maximum number of CPUs (2-32)" @@ -207,7 +273,7 @@ source "drivers/base/Kconfig" source "arch/um/Kconfig_char" -source "arch/um/Kconfig_block" +source "drivers/block/Kconfig" config NETDEVICES bool @@ -249,4 +315,9 @@ if BROKEN source "drivers/mtd/Kconfig" endif +#This is just to shut up some Kconfig warnings, so no prompt. +config INPUT + bool + default n + source "arch/um/Kconfig.debug" diff --git a/arch/um/Kconfig_char b/arch/um/Kconfig_char index 09f47388c..fa34a9698 100644 --- a/arch/um/Kconfig_char +++ b/arch/um/Kconfig_char @@ -1,6 +1,12 @@ menu "Character Devices" +config STDERR_CONSOLE + bool "stderr console" + default y + help + console driver which dumps all printk messages to stderr. + config STDIO_CONSOLE bool default y @@ -17,15 +23,6 @@ config SSL Unless you have a specific reason for disabling this, say Y. -config FD_CHAN - bool "file descriptor channel support" - help - This option enables support for attaching UML consoles and serial - lines to already set up file descriptors. Generally, the main - console is attached to file descriptors 0 and 1 (stdin and stdout), - so it would be wise to leave this enabled unless you intend to - attach it to some other host device. - config NULL_CHAN bool "null channel support" help @@ -74,7 +71,7 @@ config XTERM_CHAN config NOCONFIG_CHAN bool - default !(XTERM_CHAN && TTY_CHAN && PTY_CHAN && PORT_CHAN && FD_CHAN && NULL_CHAN) + default !(XTERM_CHAN && TTY_CHAN && PTY_CHAN && PORT_CHAN && NULL_CHAN) config CON_ZERO_CHAN string "Default main console channel initialization" diff --git a/arch/um/Makefile b/arch/um/Makefile index 0406c1a90..df06d63a9 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -3,39 +3,53 @@ # Licensed under the GPL # -ARCH_DIR = arch/um +ARCH_DIR := arch/um OS := $(shell uname -s) -#We require it or things break. +# We require bash because the vmlinux link and loader script cpp use bash +# features. SHELL := /bin/bash filechk_gen_header = $< core-y += $(ARCH_DIR)/kernel/ \ $(ARCH_DIR)/drivers/ \ - $(ARCH_DIR)/sys-$(SUBARCH)/ + $(ARCH_DIR)/os-$(OS)/ # Have to precede the include because the included Makefiles reference them. -SYMLINK_HEADERS = archparam.h system.h sigcontext.h processor.h ptrace.h \ - arch-signal.h module.h +SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \ + arch-signal.h module.h vm-flags.h SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header)) +# XXX: The "os" symlink is only used by arch/um/include/os.h, which includes +# ../os/include/file.h +# +# These are cleaned up during mrproper. Please DO NOT fix it again, this is +# the Correct Thing(tm) to do! ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h -MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt -MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas +um-modes-$(CONFIG_MODE_TT) += tt +um-modes-$(CONFIG_MODE_SKAS) += skas + +MODE_INCLUDE += $(foreach mode,$(um-modes-y),\ + -I$(srctree)/$(ARCH_DIR)/kernel/$(mode)/include) -ifneq ($(MAKEFILE-y),) - include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y)) +MAKEFILES-INCL += $(foreach mode,$(um-modes-y),\ + $(srctree)/$(ARCH_DIR)/Makefile-$(mode)) + +ifneq ($(MAKEFILES-INCL),) + include $(MAKEFILES-INCL) endif ARCH_INCLUDE := -I$(ARCH_DIR)/include SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) -include $(ARCH_DIR)/Makefile-$(SUBARCH) -include $(ARCH_DIR)/Makefile-os-$(OS) +include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) + +core-y += $(SUBARCH_CORE) +libs-y += $(SUBARCH_LIBS) # -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common @@ -43,12 +57,16 @@ include $(ARCH_DIR)/Makefile-os-$(OS) # errnos. CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ - -D_LARGEFILE64_SOURCE $(ARCH_INCLUDE) -Derrno=kernel_errno \ - -Dsigprocmask=kernel_sigprocmask $(MODE_INCLUDE) + $(ARCH_INCLUDE) $(MODE_INCLUDE) +USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) +USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ + $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) +CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask CFLAGS += $(call cc-option,-fno-unit-at-a-time,) -LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc +#This will adjust *FLAGS accordingly to the platform. +include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) # These are needed for clean and mrproper, since in that case .config is not # included; the values here are meaningless @@ -62,31 +80,32 @@ ifeq ($(CONFIG_MODE_SKAS), y) $(SYS_HEADERS) : $(ARCH_DIR)/include/skas_ptregs.h endif +.PHONY: linux + +all: linux + +linux: vmlinux + ln -f $< $@ + +define archhelp + echo '* linux - Binary kernel image (./linux) - for backward' + echo ' compatibility only, this creates a hard link to the' + echo ' real kernel binary, the the "vmlinux" binary you' + echo ' find in the kernel root.' +endef + +$(shell cd $(ARCH_DIR) && ln -sf Kconfig_$(SUBARCH) Kconfig_arch) + prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \ $(ARCH_DIR)/kernel/vmlinux.lds.S -# These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT + -# CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. - -LINK_TT = -static -LD_SCRIPT_TT := uml.lds.S - -ifeq ($(CONFIG_STATIC_LINK),y) - LINK-y += $(LINK_TT) - LD_SCRIPT-y := $(LD_SCRIPT_TT) -else -ifeq ($(CONFIG_MODE_TT),y) - LINK-y += $(LINK_TT) - LD_SCRIPT-y := $(LD_SCRIPT_TT) -else -ifeq ($(CONFIG_MODE_SKAS),y) - LINK-y += $(LINK_SKAS) - LD_SCRIPT-y := $(LD_SCRIPT_SKAS) -endif -endif -endif +LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static +LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib -CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT) +LD_SCRIPT-$(CONFIG_LD_SCRIPT_STATIC) := uml.lds.S +LD_SCRIPT-$(CONFIG_LD_SCRIPT_DYN) := dyn.lds.S + +CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT CONFIG_KERNEL_STACK_ORDER ?= 2 STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) @@ -96,37 +115,30 @@ endif CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ - -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ + -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \ -DKERNEL_STACK_SIZE=$(STACK_SIZE)) +#The wrappers will select whether using "malloc" or the kernel allocator. +LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc + CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) define cmd_vmlinux__ $(CC) $(CFLAGS_vmlinux) -o $@ \ -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ -L/usr/lib -lutil \ - $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^) + $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) \ + FORCE ,$^) ; rm -f linux endef -USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) -USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) -USER_CFLAGS := $(patsubst -Dsigprocmask=kernel_sigprocmask,,$(USER_CFLAGS)) -USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ - $(MODE_INCLUDE) - -# To get a definition of F_SETSIG -USER_CFLAGS += -D_GNU_SOURCE - #When cleaning we don't include .config, so we don't include #TT or skas makefiles and don't clean skas_ptregs.h. CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ - $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os - -archmrproper: - @: + $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os \ + $(ARCH_DIR)/Kconfig_arch archclean: $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util @@ -134,11 +146,13 @@ archclean: -o -name '*.gcov' \) -type f -print | xargs rm -f #We need to re-preprocess this when the symlink dest changes. -#So we touch it. +#So we touch it when needed. $(ARCH_DIR)/kernel/vmlinux.lds.S: FORCE - @echo ' SYMLINK $@' - $(Q)ln -sf $(LD_SCRIPT-y) $@ - $(Q)touch $@ + $(Q)if [ "$(shell readlink $@)" != "$(LD_SCRIPT-y)" ]; then \ + echo ' SYMLINK $@'; \ + ln -sf $(LD_SCRIPT-y) $@; \ + touch $@; \ + fi; $(SYMLINK_HEADERS): @echo ' SYMLINK $@' diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 9a6cf6e5b..97b223bfa 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 @@ -1,8 +1,6 @@ -ifeq ($(CONFIG_HOST_2G_2G), y) -TOP_ADDR := 0x80000000 -else -TOP_ADDR := 0xc0000000 -endif +SUBARCH_CORE := arch/um/sys-i386/ + +TOP_ADDR := $(CONFIG_TOP_ADDR) ifeq ($(CONFIG_MODE_SKAS),y) ifneq ($(CONFIG_MODE_TT),y) @@ -11,6 +9,7 @@ ifeq ($(CONFIG_MODE_SKAS),y) endif CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) +ARCH_USER_CFLAGS := ifneq ($(CONFIG_GPROF),y) ARCH_CFLAGS += -DUM_FASTCALL diff --git a/arch/um/Makefile-os-Linux b/arch/um/Makefile-os-Linux index 6315133d3..0c0f9a1cb 100644 --- a/arch/um/Makefile-os-Linux +++ b/arch/um/Makefile-os-Linux @@ -3,4 +3,6 @@ # Licensed under the GPL # -core-y += $(ARCH_DIR)/os-$(OS)/ +# To get a definition of F_SETSIG +USER_CFLAGS += -D_GNU_SOURCE -D_LARGEFILE64_SOURCE +CFLAGS += -D_LARGEFILE64_SOURCE diff --git a/arch/um/Makefile-skas b/arch/um/Makefile-skas index fb3050ff9..3c7d2a300 100644 --- a/arch/um/Makefile-skas +++ b/arch/um/Makefile-skas @@ -9,9 +9,4 @@ CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage CFLAGS-$(CONFIG_GPROF) += $(PROFILE) LINK-$(CONFIG_GPROF) += $(PROFILE) -MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/kernel/skas/include - -LINK_SKAS = -Wl,-rpath,/lib -LD_SCRIPT_SKAS = dyn.lds.S - GEN_HEADERS += $(ARCH_DIR)/include/skas_ptregs.h diff --git a/arch/um/Makefile-tt b/arch/um/Makefile-tt index eed367d9c..03f7b10cf 100644 --- a/arch/um/Makefile-tt +++ b/arch/um/Makefile-tt @@ -3,4 +3,3 @@ # Licensed under the GPL # -MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/kernel/tt/include diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 705df7345..9638cac93 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -1 +1,36 @@ +# Copyright 2003 - 2004 Pathscale, Inc +# Released under the GPL + +SUBARCH_LIBS := arch/um/sys-x86_64/ +START := 0x60000000 + +CFLAGS += -U__$(SUBARCH)__ -fno-builtin ARCH_USER_CFLAGS := -D__x86_64__ + +ELF_ARCH := i386:x86-64 +ELF_FORMAT := elf64-x86-64 + +SYS_UTIL_DIR := $(ARCH_DIR)/sys-x86_64/util +SYS_DIR := $(ARCH_DIR)/include/sysdep-x86_64 + +SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h + +prepare: $(SYS_HEADERS) + +$(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc + $(call filechk,gen_header) + +$(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread + $(call filechk,gen_header) + +$(SYS_UTIL_DIR)/mk_sc: scripts_basic FORCE + $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ + +$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE + $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ + +CLEAN_FILES += $(SYS_HEADERS) + +LIBC_DIR := /usr/lib64 + +export LIBC_DIR diff --git a/arch/um/defconfig b/arch/um/defconfig index 84547f12f..66f902a99 100644 --- a/arch/um/defconfig +++ b/arch/um/defconfig @@ -1,23 +1,27 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2-mm1 -# Thu Sep 16 23:44:48 2004 +# Linux kernel version: 2.6.10-rc2-mm4 +# Wed Dec 1 13:45:40 2004 # +CONFIG_GENERIC_HARDIRQS=y CONFIG_USERMODE=y CONFIG_MMU=y +# CONFIG_64_BIT is not set +CONFIG_TOP_ADDR=0xc0000000 CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y # # UML-specific options # CONFIG_MODE_TT=y CONFIG_MODE_SKAS=y +# CONFIG_3_LEVEL_PGTABLES is not set CONFIG_NET=y CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_MISC=y +CONFIG_BINFMT_MISC=m CONFIG_HOSTFS=y -CONFIG_HPPFS=y CONFIG_MCONSOLE=y # CONFIG_HOST_2G_2G is not set # CONFIG_SMP is not set @@ -40,7 +44,7 @@ CONFIG_BROKEN_ON_SMP=y CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set +CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y @@ -48,25 +52,32 @@ CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_KALLSYMS_EXTRA_PASS=y CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # -# CONFIG_MODULES is not set +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y # # Generic Driver Options @@ -78,14 +89,15 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Character Devices # +CONFIG_STDERR_CONSOLE=y CONFIG_STDIO_CONSOLE=y CONFIG_SSL=y -CONFIG_FD_CHAN=y CONFIG_NULL_CHAN=y CONFIG_PORT_CHAN=y CONFIG_PTY_CHAN=y CONFIG_TTY_CHAN=y CONFIG_XTERM_CHAN=y +CONFIG_NOCONFIG_CHAN=y CONFIG_CON_ZERO_CHAN="fd:0,fd:1" CONFIG_CON_CHAN="xterm" CONFIG_SSL_CHAN="pty" @@ -93,22 +105,28 @@ CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set -CONFIG_UML_SOUND=y -CONFIG_SOUND=y -CONFIG_HOSTAUDIO=y +CONFIG_UML_SOUND=m +CONFIG_SOUND=m +CONFIG_HOSTAUDIO=m # # Block Devices # CONFIG_BLK_DEV_UBD=y -# CONFIG_BLK_DEV_UBD_SYNC is not set +CONFIG_BLK_DEV_UBD_SYNC=y CONFIG_BLK_DEV_COW_COMMON=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_SIZE=4096 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_MMAPPER is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_RAM is not set +CONFIG_INITRAMFS_SOURCE="" + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_NETDEVICES=y # @@ -120,7 +138,6 @@ CONFIG_UML_NET_TUNTAP=y CONFIG_UML_NET_SLIP=y CONFIG_UML_NET_DAEMON=y CONFIG_UML_NET_MCAST=y -# CONFIG_UML_NET_PCAP is not set CONFIG_UML_NET_SLIRP=y # @@ -147,6 +164,8 @@ CONFIG_INET=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -166,7 +185,6 @@ CONFIG_INET=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -186,10 +204,10 @@ CONFIG_INET=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -CONFIG_DUMMY=y +CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set -CONFIG_TUN=y +CONFIG_TUN=m # # Ethernet (10 or 100Mbit) @@ -217,7 +235,7 @@ CONFIG_TUN=y # Wan interfaces # # CONFIG_WAN is not set -CONFIG_PPP=y +CONFIG_PPP=m # CONFIG_PPP_MULTILINK is not set # CONFIG_PPP_FILTER is not set # CONFIG_PPP_ASYNC is not set @@ -225,7 +243,7 @@ CONFIG_PPP=y # CONFIG_PPP_DEFLATE is not set # CONFIG_PPP_BSDCOMP is not set # CONFIG_PPPOE is not set -CONFIG_SLIP=y +CONFIG_SLIP=m # CONFIG_SLIP_COMPRESSED is not set # CONFIG_SLIP_SMART is not set # CONFIG_SLIP_MODE_SLIP6 is not set @@ -237,47 +255,45 @@ CONFIG_SLIP=y # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -CONFIG_REISER4_FS=y -CONFIG_REISER4_LARGE_KEY=y -# CONFIG_REISER4_CHECK is not set +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +# CONFIG_REISER4_FS is not set CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set -CONFIG_MINIX_FS=y +# CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set # CONFIG_QFMT_V2 is not set CONFIG_QUOTACTL=y -CONFIG_AUTOFS_FS=y -CONFIG_AUTOFS4_FS=y +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m # # Caches # -# CONFIG_CACHEFS is not set +# CONFIG_FSCACHE is not set # # CD-ROM/DVD Filesystems # -CONFIG_ISO9660_FS=y -# CONFIG_JOLIET is not set +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y # CONFIG_ZISOFS is not set # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -286,11 +302,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y -CONFIG_DEVFS_FS=y -CONFIG_DEVFS_MOUNT=y -# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -304,10 +319,6 @@ CONFIG_RAMFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set -CONFIG_JFFS_FS=y -CONFIG_JFFS_FS_VERBOSE=0 -# CONFIG_JFFS_PROC_FS is not set -# CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set @@ -395,83 +406,22 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_CRC32 is not set # CONFIG_LIBCRC32C is not set -# -# SCSI support -# -# CONFIG_SCSI is not set - # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set - -# -# Memory Technology Devices (MTD) -# -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_PARTITIONS is not set -# CONFIG_MTD_CONCAT is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set - -# -# RAM/ROM/Flash chip drivers -# -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -CONFIG_MTD_BLKMTD=y - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set - -# -# NAND Flash Device Drivers -# -# CONFIG_MTD_NAND is not set +# CONFIG_INPUT is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y CONFIG_FRAME_POINTER=y CONFIG_PT_PROXY=y diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile index 127bb4d07..e94da95ff 100644 --- a/arch/um/drivers/Makefile +++ b/arch/um/drivers/Makefile @@ -20,8 +20,10 @@ ubd-objs := ubd_kern.o ubd_user.o port-objs := port_kern.o port_user.o harddog-objs := harddog_kern.o harddog_user.o -obj-y = -obj-$(CONFIG_SSL) += ssl.o +obj-y := stdio_console.o fd.o $(CHAN_OBJS) +obj-$(CONFIG_SSL) += ssl.o +obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o + obj-$(CONFIG_UML_NET_SLIP) += slip.o obj-$(CONFIG_UML_NET_SLIRP) += slirp.o obj-$(CONFIG_UML_NET_DAEMON) += daemon.o @@ -32,7 +34,6 @@ obj-$(CONFIG_MCONSOLE) += mconsole.o obj-$(CONFIG_MMAPPER) += mmapper_kern.o obj-$(CONFIG_BLK_DEV_UBD) += ubd.o obj-$(CONFIG_HOSTAUDIO) += hostaudio.o -obj-$(CONFIG_FD_CHAN) += fd.o obj-$(CONFIG_NULL_CHAN) += null.o obj-$(CONFIG_PORT_CHAN) += port.o obj-$(CONFIG_PTY_CHAN) += pty.o @@ -41,7 +42,6 @@ obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o obj-$(CONFIG_UML_WATCHDOG) += harddog.o obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o -obj-y += stdio_console.o $(CHAN_OBJS) USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),$($(f)-objs)) diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 7a8d75086..f30ae1b0b 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -189,7 +189,7 @@ int open_chan(struct list_head *chans) return(err); } -void chan_enable_winch(struct list_head *chans, void *line) +void chan_enable_winch(struct list_head *chans, struct tty_struct *tty) { struct list_head *ele; struct chan *chan; @@ -197,13 +197,13 @@ void chan_enable_winch(struct list_head *chans, void *line) list_for_each(ele, chans){ chan = list_entry(ele, struct chan, list); if(chan->primary && chan->output && chan->ops->winch){ - register_winch(chan->fd, line); + register_winch(chan->fd, tty); return; } } } -void enable_chan(struct list_head *chans, void *data) +void enable_chan(struct list_head *chans, struct tty_struct *tty) { struct list_head *ele; struct chan *chan; @@ -212,7 +212,7 @@ void enable_chan(struct list_head *chans, void *data) chan = list_entry(ele, struct chan, list); if(!chan->opened) continue; - line_setup_irq(chan->fd, chan->input, chan->output, data); + line_setup_irq(chan->fd, chan->input, chan->output, tty); } } @@ -240,18 +240,20 @@ int write_chan(struct list_head *chans, const char *buf, int len, int write_irq) { struct list_head *ele; - struct chan *chan; + struct chan *chan = NULL; int n, ret = 0; - list_for_each(ele, chans){ + list_for_each(ele, chans) { chan = list_entry(ele, struct chan, list); - if(!chan->output || (chan->ops->write == NULL)) continue; + if (!chan->output || (chan->ops->write == NULL)) + continue; n = chan->ops->write(chan->fd, buf, len, chan->data); - if(chan->primary){ + if (chan->primary) { ret = n; - if((ret == -EAGAIN) || ((ret >= 0) && (ret < len))){ + if ((ret == -EAGAIN) || ((ret >= 0) && (ret < len))){ reactivate_fd(chan->fd, write_irq); - if(ret == -EAGAIN) ret = 0; + if (ret == -EAGAIN) + ret = 0; } } } @@ -274,6 +276,20 @@ int console_write_chan(struct list_head *chans, const char *buf, int len) return(ret); } +int console_open_chan(struct line *line, struct console *co, struct chan_opts *opts) +{ + if (!list_empty(&line->chan_list)) + return 0; + + if (0 != parse_chan_pair(line->init_str, &line->chan_list, + line->init_pri, co->index, opts)) + return -1; + if (0 != open_chan(&line->chan_list)) + return -1; + printk("Console initialized on /dev/%s%d\n",co->name,co->index); + return 0; +} + int chan_window_size(struct list_head *chans, unsigned short *rows_out, unsigned short *cols_out) { @@ -383,11 +399,7 @@ struct chan_type { }; struct chan_type chan_table[] = { -#ifdef CONFIG_FD_CHAN { "fd", &fd_ops }, -#else - { "fd", ¬_configged_ops }, -#endif #ifdef CONFIG_NULL_CHAN { "null", &null_ops }, @@ -516,7 +528,7 @@ int chan_out_fd(struct list_head *chans) } void chan_interrupt(struct list_head *chans, struct work_struct *task, - struct tty_struct *tty, int irq, void *dev) + struct tty_struct *tty, int irq) { struct list_head *ele, *next; struct chan *chan; @@ -542,7 +554,7 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task, if(chan->primary){ if(tty != NULL) tty_hangup(tty); - line_disable(dev, irq); + line_disable(tty, irq); close_chan(chans); free_chan(chans); return; diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 8a5180a77..583b8e137 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -27,16 +27,46 @@ int generic_console_write(int fd, const char *buf, int n, void *unused) int err; if(isatty(fd)){ - tcgetattr(fd, &save); + CATCH_EINTR(err = tcgetattr(fd, &save)); + if (err) + goto error; new = save; + /* The terminal becomes a bit less raw, to handle \n also as + * "Carriage Return", not only as "New Line". Otherwise, the new + * line won't start at the first column.*/ new.c_oflag |= OPOST; - tcsetattr(fd, TCSAFLUSH, &new); + CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &new)); + if (err) + goto error; } err = generic_write(fd, buf, n, NULL); - if(isatty(fd)) tcsetattr(fd, TCSAFLUSH, &save); + /* Restore raw mode, in any case; we *must* ignore any error apart + * EINTR, except for debug.*/ + if(isatty(fd)) + CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); return(err); +error: + return(-errno); } +/* + * UML SIGWINCH handling + * + * The point of this is to handle SIGWINCH on consoles which have host ttys and + * relay them inside UML to whatever might be running on the console and cares + * about the window size (since SIGWINCH notifies about terminal size changes). + * + * So, we have a separate thread for each host tty attached to a UML device + * (side-issue - I'm annoyed that one thread can't have multiple controlling + * ttys for purposed of handling SIGWINCH, but I imagine there are other reasons + * that doesn't make any sense). + * + * SIGWINCH can't be received synchronously, so you have to set up to receive it + * as a signal. That being the case, if you are going to wait for it, it is + * convenient to sit in a pause() and wait for the signal to bounce you out of + * it (see below for how we make sure to exit only on SIGWINCH). + */ + static void winch_handler(int sig) { } @@ -63,9 +93,14 @@ static int winch_thread(void *arg) printk("winch_thread : failed to write synchronization " "byte, err = %d\n", -count); + /* We are not using SIG_IGN on purpose, so don't fix it as I thought to + * do! If using SIG_IGN, the pause() call below would not stop on + * SIGWINCH. */ + signal(SIGWINCH, winch_handler); sigfillset(&sigs); sigdelset(&sigs, SIGWINCH); + /* Block anything else than SIGWINCH. */ if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){ printk("winch_thread : sigprocmask failed, errno = %d\n", errno); @@ -83,12 +118,18 @@ static int winch_thread(void *arg) exit(1); } + /* These are synchronization calls between various UML threads on the + * host - since they are not different kernel threads, we cannot use + * kernel semaphores. We don't use SysV semaphores because they are + * persistant. */ count = os_read_file(pipe_fd, &c, sizeof(c)); if(count != sizeof(c)) printk("winch_thread : failed to read synchronization byte, " "err = %d\n", -count); while(1){ + /* This will be interrupted by SIGWINCH only, since other signals + * are blocked.*/ pause(); count = os_write_file(pipe_fd, &c, sizeof(c)); @@ -98,7 +139,7 @@ static int winch_thread(void *arg) } } -static int winch_tramp(int fd, void *device_data, int *fd_out) +static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) { struct winch_data data; unsigned long stack; @@ -132,7 +173,7 @@ static int winch_tramp(int fd, void *device_data, int *fd_out) return(pid); } -void register_winch(int fd, void *device_data) +void register_winch(int fd, struct tty_struct *tty) { int pid, thread, thread_fd; int count; @@ -143,10 +184,10 @@ void register_winch(int fd, void *device_data) pid = tcgetpgrp(fd); if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, - device_data) && (pid == -1)){ - thread = winch_tramp(fd, device_data, &thread_fd); + tty) && (pid == -1)){ + thread = winch_tramp(fd, tty, &thread_fd); if(fd != -1){ - register_winch_irq(thread_fd, fd, thread, device_data); + register_winch_irq(thread_fd, fd, thread, tty); count = os_write_file(thread_fd, &c, sizeof(c)); if(count != sizeof(c)) diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h index 19517312a..4fcbe8b1b 100644 --- a/arch/um/drivers/cow.h +++ b/arch/um/drivers/cow.h @@ -21,11 +21,12 @@ extern int file_reader(__u64 offset, char *buf, int len, void *arg); extern int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, __u32 *version_out, char **backing_file_out, time_t *mtime_out, - __u64 *size_out, int *sectorsize_out, + unsigned long long *size_out, int *sectorsize_out, __u32 *align_out, int *bitmap_offset_out); extern int write_cow_header(char *cow_file, int fd, char *backing_file, - int sectorsize, int alignment, long long *size); + int sectorsize, int alignment, + unsigned long long *size); extern void cow_sizes(int version, __u64 size, int sectorsize, int align, int bitmap_offset, unsigned long *bitmap_len_out, diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h index ce251f083..c83fc5d68 100644 --- a/arch/um/drivers/cow_sys.h +++ b/arch/um/drivers/cow_sys.h @@ -23,12 +23,12 @@ static inline char *cow_strdup(char *str) return(uml_strdup(str)); } -static inline int cow_seek_file(int fd, __u64 offset) +static inline int cow_seek_file(int fd, unsigned long long offset) { return(os_seek_file(fd, offset)); } -static inline int cow_file_size(char *file, __u64 *size_out) +static inline int cow_file_size(char *file, unsigned long long *size_out) { return(os_file_size(file, size_out)); } diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index d3fad2486..c43425c1e 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c @@ -67,7 +67,7 @@ struct cow_header_v2 { struct cow_header_v3 { __u32 magic; __u32 version; - time_t mtime; + __u32 mtime; __u64 size; __u32 sectorsize; __u32 alignment; @@ -159,7 +159,7 @@ static int absolutize(char *to, int size, char *from) } int write_cow_header(char *cow_file, int fd, char *backing_file, - int sectorsize, int alignment, long long *size) + int sectorsize, int alignment, unsigned long long *size) { struct cow_header_v3 *header; unsigned long modtime; @@ -236,7 +236,7 @@ int file_reader(__u64 offset, char *buf, int len, void *arg) int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, __u32 *version_out, char **backing_file_out, - time_t *mtime_out, __u64 *size_out, + time_t *mtime_out, unsigned long long *size_out, int *sectorsize_out, __u32 *align_out, int *bitmap_offset_out) { @@ -329,7 +329,7 @@ int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize, int alignment, int *bitmap_offset_out, unsigned long *bitmap_len_out, int *data_offset_out) { - __u64 size, offset; + unsigned long long size, offset; char zero = 0; int err; diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index c6b77fccd..d4286de17 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -6,6 +6,7 @@ #include "linux/sched.h" #include "linux/slab.h" #include "linux/list.h" +#include "linux/kd.h" #include "linux/interrupt.h" #include "linux/devfs_fs_kernel.h" #include "asm/uaccess.h" @@ -22,30 +23,33 @@ static irqreturn_t line_interrupt(int irq, void *data, struct pt_regs *unused) { - struct line *dev = data; + struct tty_struct *tty = data; + struct line *line = tty->driver_data; - if(dev->count > 0) - chan_interrupt(&dev->chan_list, &dev->task, dev->tty, irq, - dev); + if (line) + chan_interrupt(&line->chan_list, &line->task, tty, irq); return IRQ_HANDLED; } static void line_timer_cb(void *arg) { - struct line *dev = arg; + struct tty_struct *tty = arg; + struct line *line = tty->driver_data; - line_interrupt(dev->driver->read_irq, dev, NULL); + line_interrupt(line->driver->read_irq, arg, NULL); } static int write_room(struct line *dev) { int n; - if(dev->buffer == NULL) return(LINE_BUFSIZE - 1); + if (dev->buffer == NULL) + return (LINE_BUFSIZE - 1); n = dev->head - dev->tail; - if(n <= 0) n = LINE_BUFSIZE + n; - return(n - 1); + if (n <= 0) + n = LINE_BUFSIZE + n; + return (n - 1); } static int buffer_data(struct line *line, const char *buf, int len) @@ -54,7 +58,7 @@ static int buffer_data(struct line *line, const char *buf, int len) if(line->buffer == NULL){ line->buffer = kmalloc(LINE_BUFSIZE, GFP_ATOMIC); - if(line->buffer == NULL){ + if (line->buffer == NULL) { printk("buffer_data - atomic allocation failed\n"); return(0); } @@ -84,14 +88,17 @@ static int flush_buffer(struct line *line) { int n, count; - if((line->buffer == NULL) || (line->head == line->tail)) return(1); + if ((line->buffer == NULL) || (line->head == line->tail)) + return(1); - if(line->tail < line->head){ + if (line->tail < line->head) { count = line->buffer + LINE_BUFSIZE - line->head; n = write_chan(&line->chan_list, line->head, count, line->driver->write_irq); - if(n < 0) return(n); - if(n == count) line->head = line->buffer; + if (n < 0) + return(n); + if (n == count) + line->head = line->buffer; else { line->head += n; return(0); @@ -107,41 +114,22 @@ static int flush_buffer(struct line *line) return(line->head == line->tail); } -int line_write(struct line *lines, struct tty_struct *tty, int from_user, - const char *buf, int len) +int line_write(struct tty_struct *tty, const unsigned char *buf, int len) { - struct line *line; - char *new; + struct line *line = tty->driver_data; unsigned long flags; - int n, err, i, ret = 0; + int n, err, ret = 0; if(tty->stopped) return 0; - if(from_user){ - new = kmalloc(len, GFP_KERNEL); - if(new == NULL) - return(0); - n = copy_from_user(new, buf, len); - buf = new; - if(n == len){ - len = -EFAULT; - goto out_free; - } - - len -= n; - } - - i = tty->index; - line = &lines[i]; - down(&line->sem); if(line->head != line->tail){ local_irq_save(flags); - ret += buffer_data(line, buf, len); + ret = buffer_data(line, buf, len); err = flush_buffer(line); local_irq_restore(flags); if(err <= 0) - goto out_up; + ret = err; } else { n = write_chan(&line->chan_list, buf, len, @@ -158,25 +146,126 @@ int line_write(struct line *lines, struct tty_struct *tty, int from_user, } out_up: up(&line->sem); - out_free: - if(from_user) - kfree(buf); + return(ret); +} + +void line_put_char(struct tty_struct *tty, unsigned char ch) +{ + line_write(tty, &ch, sizeof(ch)); +} + +void line_set_termios(struct tty_struct *tty, struct termios * old) +{ + /* nothing */ +} + +int line_chars_in_buffer(struct tty_struct *tty) +{ + return 0; +} + +static struct { + int cmd; + char *level; + char *name; +} tty_ioctls[] = { + /* don't print these, they flood the log ... */ + { TCGETS, NULL, "TCGETS" }, + { TCSETS, NULL, "TCSETS" }, + { TCSETSW, NULL, "TCSETSW" }, + { TCFLSH, NULL, "TCFLSH" }, + { TCSBRK, NULL, "TCSBRK" }, + + /* general tty stuff */ + { TCSETSF, KERN_DEBUG, "TCSETSF" }, + { TCGETA, KERN_DEBUG, "TCGETA" }, + { TIOCMGET, KERN_DEBUG, "TIOCMGET" }, + { TCSBRKP, KERN_DEBUG, "TCSBRKP" }, + { TIOCMSET, KERN_DEBUG, "TIOCMSET" }, + + /* linux-specific ones */ + { TIOCLINUX, KERN_INFO, "TIOCLINUX" }, + { KDGKBMODE, KERN_INFO, "KDGKBMODE" }, + { KDGKBTYPE, KERN_INFO, "KDGKBTYPE" }, + { KDSIGACCEPT, KERN_INFO, "KDSIGACCEPT" }, +}; + +int line_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg) +{ + int ret; + int i; + + ret = 0; + switch(cmd) { +#ifdef TIOCGETP + case TIOCGETP: + case TIOCSETP: + case TIOCSETN: +#endif +#ifdef TIOCGETC + case TIOCGETC: + case TIOCSETC: +#endif +#ifdef TIOCGLTC + case TIOCGLTC: + case TIOCSLTC: +#endif + case TCGETS: + case TCSETSF: + case TCSETSW: + case TCSETS: + case TCGETA: + case TCSETAF: + case TCSETAW: + case TCSETA: + case TCXONC: + case TCFLSH: + case TIOCOUTQ: + case TIOCINQ: + case TIOCGLCKTRMIOS: + case TIOCSLCKTRMIOS: + case TIOCPKT: + case TIOCGSOFTCAR: + case TIOCSSOFTCAR: + return -ENOIOCTLCMD; +#if 0 + case TCwhatever: + /* do something */ + break; +#endif + default: + for (i = 0; i < ARRAY_SIZE(tty_ioctls); i++) + if (cmd == tty_ioctls[i].cmd) + break; + if (i < ARRAY_SIZE(tty_ioctls)) { + if (NULL != tty_ioctls[i].level) + printk("%s%s: %s: ioctl %s called\n", + tty_ioctls[i].level, __FUNCTION__, + tty->name, tty_ioctls[i].name); + } else { + printk(KERN_ERR "%s: %s: unknown ioctl: 0x%x\n", + __FUNCTION__, tty->name, cmd); + } + ret = -ENOIOCTLCMD; + break; + } return(ret); } static irqreturn_t line_write_interrupt(int irq, void *data, struct pt_regs *unused) { - struct line *dev = data; - struct tty_struct *tty = dev->tty; + struct tty_struct *tty = data; + struct line *line = tty->driver_data; int err; - err = flush_buffer(dev); + err = flush_buffer(line); if(err == 0) return(IRQ_NONE); else if(err < 0){ - dev->head = dev->buffer; - dev->tail = dev->buffer; + line->head = line->buffer; + line->tail = line->buffer; } if(tty == NULL) @@ -197,36 +286,43 @@ static irqreturn_t line_write_interrupt(int irq, void *data, return(IRQ_HANDLED); } -int line_setup_irq(int fd, int input, int output, void *data) +int line_setup_irq(int fd, int input, int output, struct tty_struct *tty) { - struct line *line = data; + struct line *line = tty->driver_data; struct line_driver *driver = line->driver; int err = 0, flags = SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM; if(input) err = um_request_irq(driver->read_irq, fd, IRQ_READ, line_interrupt, flags, - driver->read_irq_name, line); + driver->read_irq_name, tty); if(err) return(err); if(output) err = um_request_irq(driver->write_irq, fd, IRQ_WRITE, line_write_interrupt, flags, - driver->write_irq_name, line); + driver->write_irq_name, tty); line->have_irq = 1; return(err); } -void line_disable(struct line *line, int current_irq) +void line_disable(struct tty_struct *tty, int current_irq) { - if(!line->have_irq) return; + struct line *line = tty->driver_data; + + if(!line->have_irq) + return; if(line->driver->read_irq == current_irq) - free_irq_later(line->driver->read_irq, line); - else - free_irq(line->driver->read_irq, line); + free_irq_later(line->driver->read_irq, tty); + else { + free_irq_by_irq_and_dev(line->driver->read_irq, tty); + free_irq(line->driver->read_irq, tty); + } if(line->driver->write_irq == current_irq) - free_irq_later(line->driver->write_irq, line); - else - free_irq(line->driver->write_irq, line); + free_irq_later(line->driver->write_irq, tty); + else { + free_irq_by_irq_and_dev(line->driver->write_irq, tty); + free_irq(line->driver->write_irq, tty); + } line->have_irq = 0; } @@ -235,73 +331,51 @@ int line_open(struct line *lines, struct tty_struct *tty, struct chan_opts *opts) { struct line *line; - int n, err = 0; + int err = 0; - if(tty == NULL) n = 0; - else n = tty->index; - line = &lines[n]; + line = &lines[tty->index]; + tty->driver_data = line; down(&line->sem); - if(line->count == 0){ - if(!line->valid){ + if (tty->count == 1) { + if (!line->valid) { err = -ENODEV; goto out; } - if(list_empty(&line->chan_list)){ + if (list_empty(&line->chan_list)) { err = parse_chan_pair(line->init_str, &line->chan_list, - line->init_pri, n, opts); + line->init_pri, tty->index, opts); if(err) goto out; err = open_chan(&line->chan_list); if(err) goto out; } - enable_chan(&line->chan_list, line); - INIT_WORK(&line->task, line_timer_cb, line); + enable_chan(&line->chan_list, tty); + INIT_WORK(&line->task, line_timer_cb, tty); } if(!line->sigio){ - chan_enable_winch(&line->chan_list, line); + chan_enable_winch(&line->chan_list, tty); line->sigio = 1; } - - /* This is outside the if because the initial console is opened - * with tty == NULL - */ - line->tty = tty; - - if(tty != NULL){ - tty->driver_data = line; - chan_window_size(&line->chan_list, &tty->winsize.ws_row, - &tty->winsize.ws_col); - } - + chan_window_size(&line->chan_list, &tty->winsize.ws_row, + &tty->winsize.ws_col); line->count++; - out: + +out: up(&line->sem); return(err); } -void line_close(struct line *lines, struct tty_struct *tty) +void line_close(struct tty_struct *tty, struct file * filp) { - struct line *line; - int n; - - if(tty == NULL) n = 0; - else n = tty->index; - line = &lines[n]; + struct line *line = tty->driver_data; down(&line->sem); line->count--; - - /* I don't like this, but I can't think of anything better. What's - * going on is that the tty is in the process of being closed for - * the last time. Its count hasn't been dropped yet, so it's still - * at 1. This may happen when line->count != 0 because of the initial - * console open (without a tty) bumping it up to 1. - */ - if((line->tty != NULL) && (line->tty->count == 1)) - line->tty = NULL; - if(line->count == 0) - line_disable(line, -1); + if (tty->count == 1) { + line_disable(tty, -1); + tty->driver_data = NULL; + } up(&line->sem); } @@ -334,14 +408,15 @@ int line_setup(struct line *lines, int num, char *init, int all_allowed) n, num - 1); return(0); } - else if(n >= 0){ - if(lines[n].count > 0){ + else if (n >= 0){ + if (lines[n].count > 0) { printk("line_setup - device %d is open\n", n); return(0); } - if(lines[n].init_pri <= INIT_ONE){ + if (lines[n].init_pri <= INIT_ONE){ lines[n].init_pri = INIT_ONE; - if(!strcmp(init, "none")) lines[n].valid = 0; + if (!strcmp(init, "none")) + lines[n].valid = 0; else { lines[n].init_str = init; lines[n].valid = 1; @@ -421,8 +496,15 @@ int line_remove(struct line *lines, int num, char *str) int line_write_room(struct tty_struct *tty) { struct line *dev = tty->driver_data; - - return(write_room(dev)); + int room; + + if (tty->stopped) + return 0; + room = write_room(dev); + if (0 == room) + printk(KERN_DEBUG "%s: %s: no room left in buffer\n", + __FUNCTION__,tty->name); + return room; } struct tty_driver *line_register_devfs(struct lines *set, @@ -430,8 +512,7 @@ struct tty_driver *line_register_devfs(struct lines *set, struct tty_operations *ops, struct line *lines, int nlines) { - int err, i; - char *from, *to; + int i; struct tty_driver *driver = alloc_tty_driver(nlines); if (!driver) @@ -448,14 +529,12 @@ struct tty_driver *line_register_devfs(struct lines *set, driver->init_termios = tty_std_termios; tty_set_operations(driver, ops); - if (tty_register_driver(driver)) - panic("line_register_devfs : Couldn't register driver\n"); - - from = line_driver->symlink_from; - to = line_driver->symlink_to; - err = devfs_mk_symlink(from, to); - if(err) printk("Symlink creation from /dev/%s to /dev/%s " - "returned %d\n", from, to, err); + if (tty_register_driver(driver)) { + printk("%s: can't register %s driver\n", + __FUNCTION__,line_driver->name); + put_tty_driver(driver); + return NULL; + } for(i = 0; i < nlines; i++){ if(!lines[i].valid) @@ -489,13 +568,14 @@ struct winch { int fd; int tty_fd; int pid; - struct line *line; + struct tty_struct *tty; }; irqreturn_t winch_interrupt(int irq, void *data, struct pt_regs *unused) { struct winch *winch = data; struct tty_struct *tty; + struct line *line; int err; char c; @@ -512,9 +592,10 @@ irqreturn_t winch_interrupt(int irq, void *data, struct pt_regs *unused) goto out; } } - tty = winch->line->tty; - if(tty != NULL){ - chan_window_size(&winch->line->chan_list, + tty = winch->tty; + if (tty != NULL) { + line = tty->driver_data; + chan_window_size(&line->chan_list, &tty->winsize.ws_row, &tty->winsize.ws_col); kill_pg(tty->pgrp, SIGWINCH, 1); @@ -528,13 +609,13 @@ irqreturn_t winch_interrupt(int irq, void *data, struct pt_regs *unused) DECLARE_MUTEX(winch_handler_sem); LIST_HEAD(winch_handlers); -void register_winch_irq(int fd, int tty_fd, int pid, void *line) +void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty) { struct winch *winch; down(&winch_handler_sem); winch = kmalloc(sizeof(*winch), GFP_KERNEL); - if(winch == NULL){ + if (winch == NULL) { printk("register_winch_irq - kmalloc failed\n"); goto out; } @@ -542,7 +623,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, void *line) .fd = fd, .tty_fd = tty_fd, .pid = pid, - .line = line }); + .tty = tty }); list_add(&winch->list, &winch_handlers); if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, @@ -567,7 +648,6 @@ static void winch_cleanup(void) os_kill_process(winch->pid, 1); } } - __uml_exitcall(winch_cleanup); char *add_xterm_umid(char *base) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 9076c0603..d7c7adcc0 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -19,6 +19,7 @@ #include "linux/fs.h" #include "linux/namei.h" #include "linux/proc_fs.h" +#include "linux/syscalls.h" #include "asm/irq.h" #include "asm/uaccess.h" #include "user_util.h" @@ -72,11 +73,12 @@ DECLARE_WORK(mconsole_work, mc_work_proc, NULL); static irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - int fd; + /* long to avoid size mismatch warnings from gcc */ + long fd; struct mconsole_entry *new; struct mc_request req; - fd = (int) dev_id; + fd = (long) dev_id; while (mconsole_get_request(fd, &req)){ if(req.cmd->context == MCONSOLE_INTR) (*req.cmd->handler)(&req); @@ -118,6 +120,11 @@ void mconsole_log(struct mc_request *req) mconsole_reply(req, "", 0, 0); } +/* This is a more convoluted version of mconsole_proc, which has some stability + * problems; however, we need it fixed, because it is expected that UML users + * mount HPPFS instead of procfs on /proc. And we want mconsole_proc to still + * show the real procfs content, not the ones from hppfs.*/ +#if 0 void mconsole_proc(struct mc_request *req) { struct nameidata nd; @@ -149,6 +156,9 @@ void mconsole_proc(struct mc_request *req) nd.flags = O_RDONLY + 1; nd.last_type = LAST_ROOT; + /* START: it was experienced that the stability problems are closed + * if commenting out these two calls + the below read cycle. To + * make UML crash again, it was enough to readd either one.*/ err = link_path_walk(ptr, &nd); if(err){ mconsole_reply(req, "Failed to look up file", 1, 0); @@ -160,6 +170,7 @@ void mconsole_proc(struct mc_request *req) mconsole_reply(req, "Failed to open file", 1, 0); goto out_kill; } + /*END*/ buf = kmalloc(PAGE_SIZE, GFP_KERNEL); if(buf == NULL){ @@ -192,6 +203,62 @@ void mconsole_proc(struct mc_request *req) deactivate_super(super); out: ; } +#endif + +void mconsole_proc(struct mc_request *req) +{ + char path[64]; + char *buf; + int len; + int fd; + int first_chunk = 1; + char *ptr = req->request.data; + + ptr += strlen("proc"); + while(isspace(*ptr)) ptr++; + snprintf(path, sizeof(path), "/proc/%s", ptr); + + fd = sys_open(path, 0, 0); + if (fd < 0) { + mconsole_reply(req, "Failed to open file", 1, 0); + printk("open %s: %d\n",path,fd); + goto out; + } + + buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + if(buf == NULL){ + mconsole_reply(req, "Failed to allocate buffer", 1, 0); + goto out_close; + } + + for (;;) { + len = sys_read(fd, buf, PAGE_SIZE-1); + if (len < 0) { + mconsole_reply(req, "Read of file failed", 1, 0); + goto out_free; + } + /*Begin the file content on his own line.*/ + if (first_chunk) { + mconsole_reply(req, "\n", 0, 1); + first_chunk = 0; + } + if (len == PAGE_SIZE-1) { + buf[len] = '\0'; + mconsole_reply(req, buf, 0, 1); + } else { + buf[len] = '\0'; + mconsole_reply(req, buf, 0, 0); + break; + } + } + + out_free: + kfree(buf); + out_close: + sys_close(fd); + out: + /* nothing */; +} #define UML_MCONSOLE_HELPTEXT \ "Commands: \n\ @@ -391,7 +458,9 @@ static char *notify_socket = NULL; int mconsole_init(void) { - int err, sock; + /* long to avoid size mismatch warnings from gcc */ + long sock; + int err; char file[256]; if(umid_file_name("mconsole", file, sizeof(file))) return(-1); @@ -430,7 +499,7 @@ int mconsole_init(void) __initcall(mconsole_init); -static int write_proc_mconsole(struct file *file, const char *buffer, +static int write_proc_mconsole(struct file *file, const char __user *buffer, unsigned long count, void *data) { char *buf; @@ -469,7 +538,7 @@ static int create_proc_mconsole(void) return(0); } -static spinlock_t notify_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(notify_spinlock); void lock_notify(void) { diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index 1862691b9..a63231dff 100644 --- a/arch/um/drivers/mmapper_kern.c +++ b/arch/um/drivers/mmapper_kern.c @@ -8,6 +8,8 @@ * Greg Lonnon glonnon@ridgerun.com or info@ridgerun.com * */ + +#include #include #include #include @@ -81,10 +83,10 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma) size = vma->vm_end - vma->vm_start; if(size > mmapper_size) return(-EFAULT); - /* XXX A comment above remap_page_range says it should only be + /* XXX A comment above remap_pfn_range says it should only be * called when the mm semaphore is held */ - if (remap_page_range(vma, vma->vm_start, p_buf, size, + if (remap_pfn_range(vma, vma->vm_start, p_buf >> PAGE_SHIFT, size, vma->vm_page_prot)) goto out; ret = 0; @@ -128,7 +130,6 @@ static int __init mmapper_init(void) p_buf = __pa(v_buf); devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper"); - devfs_mk_symlink("mmapper0", "mmapper"); return(0); } diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index c686a39ea..fe1e79a46 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -30,7 +30,9 @@ #include "irq_user.h" #include "irq_kern.h" -static spinlock_t opened_lock = SPIN_LOCK_UNLOCKED; +#define DRIVER_NAME "uml-netdev" + +static DEFINE_SPINLOCK(opened_lock); LIST_HEAD(opened); static int uml_net_rx(struct net_device *dev) @@ -126,10 +128,6 @@ static int uml_net_open(struct net_device *dev) lp->tl.data = (unsigned long) &lp->user; netif_start_queue(dev); - spin_lock(&opened_lock); - list_add(&lp->list, &opened); - spin_unlock(&opened_lock); - /* clear buffer - it can happen that the host side of the interface * is full when we get here. In this case, new data is never queued, * SIGIOs never arrive, and the net never works. @@ -148,12 +146,11 @@ static int uml_net_close(struct net_device *dev) netif_stop_queue(dev); spin_lock(&lp->lock); + free_irq_by_irq_and_dev(dev->irq, dev); free_irq(dev->irq, dev); - if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user); + if(lp->close != NULL) + (*lp->close)(lp->fd, &lp->user); lp->fd = -1; - spin_lock(&opened_lock); - list_del(&lp->list); - spin_unlock(&opened_lock); spin_unlock(&lp->lock); return 0; @@ -251,7 +248,7 @@ static int uml_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { static const struct ethtool_drvinfo info = { .cmd = ETHTOOL_GDRVINFO, - .driver = "uml virtual ethernet", + .driver = DRIVER_NAME, .version = "42", }; void *useraddr; @@ -285,9 +282,15 @@ void uml_net_user_timer_expire(unsigned long _conn) #endif } -static spinlock_t devices_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(devices_lock); static struct list_head devices = LIST_HEAD_INIT(devices); +static struct device_driver uml_net_driver = { + .name = DRIVER_NAME, + .bus = &platform_bus_type, +}; +static int driver_registered; + static int eth_configure(int n, void *init, char *mac, struct transport *transport) { @@ -329,6 +332,16 @@ static int eth_configure(int n, void *init, char *mac, return 1; } + /* sysfs register */ + if (!driver_registered) { + driver_register(¨_net_driver); + driver_registered = 1; + } + device->pdev.id = n; + device->pdev.name = DRIVER_NAME; + platform_device_register(&device->pdev); + SET_NETDEV_DEV(dev,&device->pdev.dev); + /* If this name ends up conflicting with an existing registered * netdevice, that is OK, register_netdev{,ice}() will notice this * and fail. @@ -396,6 +409,11 @@ static int eth_configure(int n, void *init, char *mac, if (device->have_mac) set_ether_mac(dev, device->mac); + + spin_lock(&opened_lock); + list_add(&lp->list, &opened); + spin_unlock(&opened_lock); + return(0); } @@ -559,6 +577,7 @@ __uml_help(eth_setup, " Configure a network device.\n\n" ); +#if 0 static int eth_init(void) { struct list_head *ele, *next; @@ -573,8 +592,8 @@ static int eth_init(void) return(1); } - __initcall(eth_init); +#endif static int net_config(char *str) { @@ -615,6 +634,7 @@ static int net_remove(char *str) if(lp->fd > 0) return(-1); if(lp->remove != NULL) (*lp->remove)(&lp->user); unregister_netdev(dev); + platform_device_unregister(&device->pdev); list_del(&device->list); kfree(device); @@ -704,7 +724,7 @@ __initcall(uml_net_init); static void close_devices(void) { struct list_head *ele; - struct uml_net_private *lp; + struct uml_net_private *lp; list_for_each(ele, &opened){ lp = list_entry(ele, struct uml_net_private, list); diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index 2e4e1d49f..47229fe4a 100644 --- a/arch/um/drivers/net_user.c +++ b/arch/um/drivers/net_user.c @@ -173,10 +173,12 @@ static int change_tramp(char **argv, char *output, int output_len) pe_data.stdout = fds[1]; pid = run_helper(change_pre_exec, &pe_data, argv, NULL); - os_close_file(fds[1]); read_output(fds[0], output, output_len); + os_close_file(fds[0]); + os_close_file(fds[1]); - CATCH_EINTR(err = waitpid(pid, NULL, 0)); + if (pid > 0) + CATCH_EINTR(err = waitpid(pid, NULL, 0)); return(pid); } diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 4044053cd..14f66da4d 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -242,6 +242,7 @@ int port_wait(void *data) * connection. Then we loop here throwing out failed * connections until a good one is found. */ + free_irq_by_irq_and_dev(TELNETD_IRQ, conn); free_irq(TELNETD_IRQ, conn); if(conn->fd >= 0) break; diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c index 1e8592ec1..996e817f3 100644 --- a/arch/um/drivers/port_user.c +++ b/arch/um/drivers/port_user.c @@ -123,12 +123,18 @@ struct chan_ops port_ops = { int port_listen_fd(int port) { struct sockaddr_in addr; - int fd, err; + int fd, err, arg; fd = socket(PF_INET, SOCK_STREAM, 0); if(fd == -1) return(-errno); + arg = 1; + if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0){ + err = -errno; + goto out; + } + addr.sin_family = AF_INET; addr.sin_port = htons(port); addr.sin_addr.s_addr = htonl(INADDR_ANY); diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c index c4634b500..b5777e7b1 100644 --- a/arch/um/drivers/pty.c +++ b/arch/um/drivers/pty.c @@ -58,7 +58,8 @@ int pts_open(int input, int output, int primary, void *d, char **dev_out) dev = ptsname(fd); sprintf(data->dev_name, "%s", dev); *dev_out = data->dev_name; - if(data->announce) (*data->announce)(dev, data->dev); + if (data->announce) + (*data->announce)(dev, data->dev); return(fd); } diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 4a3586f0d..c5839c314 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -54,7 +54,7 @@ static int ssl_remove(char *str); static struct line_driver driver = { .name = "UML serial line", - .device_name = "ttS", + .device_name = "ttyS", .devfs_name = "tts/", .major = TTY_MAJOR, .minor_start = 64, @@ -103,30 +103,10 @@ static int ssl_remove(char *str) int ssl_open(struct tty_struct *tty, struct file *filp) { - return(line_open(serial_lines, tty, &opts)); -} - -static void ssl_close(struct tty_struct *tty, struct file * filp) -{ - line_close(serial_lines, tty); -} - -static int ssl_write(struct tty_struct * tty, int from_user, - const unsigned char *buf, int count) -{ - return(line_write(serial_lines, tty, from_user, buf, count)); -} - -static void ssl_put_char(struct tty_struct *tty, unsigned char ch) -{ - line_write(serial_lines, tty, 0, &ch, sizeof(ch)); -} - -static void ssl_flush_chars(struct tty_struct *tty) -{ - return; + return line_open(serial_lines, tty, &opts); } +#if 0 static int ssl_chars_in_buffer(struct tty_struct *tty) { return(0); @@ -137,34 +117,6 @@ static void ssl_flush_buffer(struct tty_struct *tty) return; } -static int ssl_ioctl(struct tty_struct *tty, struct file * file, - unsigned int cmd, unsigned long arg) -{ - int ret; - - ret = 0; - switch(cmd){ - case TCGETS: - case TCSETS: - case TCFLSH: - case TCSETSF: - case TCSETSW: - case TCGETA: - case TIOCMGET: - case TCSBRK: - case TCSBRKP: - case TIOCMSET: - ret = -ENOIOCTLCMD; - break; - default: - printk(KERN_ERR - "Unimplemented ioctl in ssl_ioctl : 0x%x\n", cmd); - ret = -ENOIOCTLCMD; - break; - } - return(ret); -} - static void ssl_throttle(struct tty_struct * tty) { printk(KERN_ERR "Someone should implement ssl_throttle\n"); @@ -175,11 +127,6 @@ static void ssl_unthrottle(struct tty_struct * tty) printk(KERN_ERR "Someone should implement ssl_unthrottle\n"); } -static void ssl_set_termios(struct tty_struct *tty, - struct termios *old_termios) -{ -} - static void ssl_stop(struct tty_struct *tty) { printk(KERN_ERR "Someone should implement ssl_stop\n"); @@ -193,23 +140,26 @@ static void ssl_start(struct tty_struct *tty) void ssl_hangup(struct tty_struct *tty) { } +#endif static struct tty_operations ssl_ops = { .open = ssl_open, - .close = ssl_close, - .write = ssl_write, - .put_char = ssl_put_char, + .close = line_close, + .write = line_write, + .put_char = line_put_char, + .write_room = line_write_room, + .chars_in_buffer = line_chars_in_buffer, + .set_termios = line_set_termios, + .ioctl = line_ioctl, +#if 0 .flush_chars = ssl_flush_chars, - .chars_in_buffer = ssl_chars_in_buffer, .flush_buffer = ssl_flush_buffer, - .ioctl = ssl_ioctl, .throttle = ssl_throttle, .unthrottle = ssl_unthrottle, - .set_termios = ssl_set_termios, .stop = ssl_stop, .start = ssl_start, .hangup = ssl_hangup, - .write_room = line_write_room, +#endif }; /* Changed by ssl_init and referenced by ssl_exit, which are both serialized @@ -221,11 +171,10 @@ static void ssl_console_write(struct console *c, const char *string, unsigned len) { struct line *line = &serial_lines[c->index]; - if(ssl_init_done) - down(&line->sem); + + down(&line->sem); console_write_chan(&line->chan_list, string, len); - if(ssl_init_done) - up(&line->sem); + up(&line->sem); } static struct tty_driver *ssl_console_device(struct console *c, int *index) @@ -236,16 +185,18 @@ static struct tty_driver *ssl_console_device(struct console *c, int *index) static int ssl_console_setup(struct console *co, char *options) { - return(0); + struct line *line = &serial_lines[co->index]; + + return console_open_chan(line,co,&opts); } static struct console ssl_cons = { - name: "ttyS", - write: ssl_console_write, - device: ssl_console_device, - setup: ssl_console_setup, - flags: CON_PRINTBUFFER, - index: -1, + .name = "ttyS", + .write = ssl_console_write, + .device = ssl_console_device, + .setup = ssl_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, }; int ssl_init(void) @@ -254,22 +205,30 @@ int ssl_init(void) printk(KERN_INFO "Initializing software serial port version %d\n", ssl_version); - ssl_driver = line_register_devfs(&lines, &driver, &ssl_ops, - serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0])); + serial_lines, ARRAY_SIZE(serial_lines)); lines_init(serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0])); new_title = add_xterm_umid(opts.xterm_title); - if(new_title != NULL) opts.xterm_title = new_title; + if (new_title != NULL) + opts.xterm_title = new_title; - register_console(&ssl_cons); ssl_init_done = 1; + register_console(&ssl_cons); return(0); } - late_initcall(ssl_init); +static void ssl_exit(void) +{ + if (!ssl_init_done) + return; + close_lines(serial_lines, + sizeof(serial_lines)/sizeof(serial_lines[0])); +} +__uml_exitcall(ssl_exit); + static int ssl_chan_setup(char *str) { return(line_setup(serial_lines, @@ -280,15 +239,6 @@ static int ssl_chan_setup(char *str) __setup("ssl", ssl_chan_setup); __channel_help(ssl_chan_setup, "ssl"); -static void ssl_exit(void) -{ - if(!ssl_init_done) return; - close_lines(serial_lines, - sizeof(serial_lines)/sizeof(serial_lines[0])); -} - -__uml_exitcall(ssl_exit); - /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 54e6a57c8..e604d7c87 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c @@ -30,7 +30,9 @@ #include "init.h" #include "2_5compat.h" -#define MAX_TTYS (8) +#define MAX_TTYS (16) + +/* ----------------------------------------------------------------------------- */ /* Referenced only by tty_driver below - presumably it's locked correctly * by the tty driver. @@ -38,31 +40,6 @@ static struct tty_driver *console_driver; -static struct chan_ops init_console_ops = { - .type = "you shouldn't see this", - .init = NULL, - .open = NULL, - .close = NULL, - .read = NULL, - .write = NULL, - .console_write = generic_write, - .window_size = NULL, - .free = NULL, - .winch = 0, -}; - -static struct chan init_console_chan = { - .list = { }, - .primary = 1, - .input = 0, - .output = 1, - .opened = 1, - .fd = 1, - .pri = INIT_STATIC, - .ops = &init_console_ops, - .data = NULL -}; - void stdio_announce(char *dev_name, int dev) { printk(KERN_INFO "Virtual console %d assigned device '%s'\n", dev, @@ -128,79 +105,31 @@ static int con_remove(char *str) return(line_remove(vts, sizeof(vts)/sizeof(vts[0]), str)); } -static int open_console(struct tty_struct *tty) -{ - return(line_open(vts, tty, &opts)); -} - static int con_open(struct tty_struct *tty, struct file *filp) { - return(open_console(tty)); -} - -static void con_close(struct tty_struct *tty, struct file *filp) -{ - line_close(vts, tty); -} - -static int con_write(struct tty_struct *tty, int from_user, - const unsigned char *buf, int count) -{ - return(line_write(vts, tty, from_user, buf, count)); -} - -static void set_termios(struct tty_struct *tty, struct termios * old) -{ -} - -static int chars_in_buffer(struct tty_struct *tty) -{ - return(0); + return line_open(vts, tty, &opts); } static int con_init_done = 0; static struct tty_operations console_ops = { .open = con_open, - .close = con_close, - .write = con_write, - .chars_in_buffer = chars_in_buffer, - .set_termios = set_termios, - .write_room = line_write_room, + .close = line_close, + .write = line_write, + .write_room = line_write_room, + .chars_in_buffer = line_chars_in_buffer, + .set_termios = line_set_termios, + .ioctl = line_ioctl, }; -int stdio_init(void) -{ - char *new_title; - - printk(KERN_INFO "Initializing stdio console driver\n"); - - console_driver = line_register_devfs(&console_lines, &driver, - &console_ops, vts, - sizeof(vts)/sizeof(vts[0])); - - lines_init(vts, sizeof(vts)/sizeof(vts[0])); - - new_title = add_xterm_umid(opts.xterm_title); - if(new_title != NULL) opts.xterm_title = new_title; - - open_console(NULL); - con_init_done = 1; - return(0); -} - -late_initcall(stdio_init); - static void uml_console_write(struct console *console, const char *string, unsigned len) { struct line *line = &vts[console->index]; - if(con_init_done) - down(&line->sem); + down(&line->sem); console_write_chan(&line->chan_list, string, len); - if(con_init_done) - up(&line->sem); + up(&line->sem); } static struct tty_driver *uml_console_device(struct console *c, int *index) @@ -211,44 +140,59 @@ static struct tty_driver *uml_console_device(struct console *c, int *index) static int uml_console_setup(struct console *co, char *options) { - return(0); + struct line *line = &vts[co->index]; + + return console_open_chan(line,co,&opts); } static struct console stdiocons = { - name: "tty", - write: uml_console_write, - device: uml_console_device, - setup: uml_console_setup, - flags: CON_PRINTBUFFER, - index: -1, + .name = "tty", + .write = uml_console_write, + .device = uml_console_device, + .setup = uml_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, + .data = &vts, }; -static int __init stdio_console_init(void) +int stdio_init(void) { - INIT_LIST_HEAD(&vts[0].chan_list); - list_add(&init_console_chan.list, &vts[0].chan_list); + char *new_title; + + console_driver = line_register_devfs(&console_lines, &driver, + &console_ops, vts, + ARRAY_SIZE(vts)); + if (NULL == console_driver) + return -1; + printk(KERN_INFO "Initialized stdio console driver\n"); + + lines_init(vts, sizeof(vts)/sizeof(vts[0])); + + new_title = add_xterm_umid(opts.xterm_title); + if(new_title != NULL) + opts.xterm_title = new_title; + + con_init_done = 1; register_console(&stdiocons); return(0); } +late_initcall(stdio_init); -console_initcall(stdio_console_init); +static void console_exit(void) +{ + if (!con_init_done) + return; + close_lines(vts, sizeof(vts)/sizeof(vts[0])); +} +__uml_exitcall(console_exit); static int console_chan_setup(char *str) { return(line_setup(vts, sizeof(vts)/sizeof(vts[0]), str, 1)); } - __setup("con", console_chan_setup); __channel_help(console_chan_setup, "con"); -static void console_exit(void) -{ - if(!con_init_done) return; - close_lines(vts, sizeof(vts)/sizeof(vts[0])); -} - -__uml_exitcall(console_exit); - /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 53fba09ad..9b4820ec9 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -53,9 +53,65 @@ #include "os.h" #include "mem.h" #include "mem_kern.h" +#include "cow.h" + +enum ubd_req { UBD_READ, UBD_WRITE, UBD_MMAP }; + +struct io_thread_req { + enum ubd_req op; + int fds[2]; + unsigned long offsets[2]; + unsigned long long offset; + unsigned long length; + char *buffer; + int sectorsize; + unsigned long sector_mask; + unsigned long long cow_offset; + unsigned long bitmap_words[2]; + int map_fd; + unsigned long long map_offset; + int error; +}; + +extern int open_ubd_file(char *file, struct openflags *openflags, + char **backing_file_out, int *bitmap_offset_out, + unsigned long *bitmap_len_out, int *data_offset_out, + int *create_cow_out); +extern int create_cow_file(char *cow_file, char *backing_file, + struct openflags flags, int sectorsize, + int alignment, int *bitmap_offset_out, + unsigned long *bitmap_len_out, + int *data_offset_out); +extern int read_cow_bitmap(int fd, void *buf, int offset, int len); +extern void do_io(struct io_thread_req *req); + +static inline int ubd_test_bit(__u64 bit, unsigned char *data) +{ + __u64 n; + int bits, off; + + bits = sizeof(data[0]) * 8; + n = bit / bits; + off = bit % bits; + return((data[n] & (1 << off)) != 0); +} + +static inline void ubd_set_bit(__u64 bit, unsigned char *data) +{ + __u64 n; + int bits, off; + + bits = sizeof(data[0]) * 8; + n = bit / bits; + off = bit % bits; + data[n] |= (1 << off); +} +/*End stuff from ubd_user.h*/ -static spinlock_t ubd_io_lock = SPIN_LOCK_UNLOCKED; -static spinlock_t ubd_lock = SPIN_LOCK_UNLOCKED; +#define DRIVER_NAME "uml-blkdev" + +static DEFINE_SPINLOCK(ubd_io_lock); +static DEFINE_SPINLOCK(ubd_lock); static void (*do_ubd)(void); @@ -117,6 +173,7 @@ struct ubd { struct openflags openflags; int no_cow; struct cow cow; + struct platform_device pdev; int map_writes; int map_reads; @@ -169,7 +226,7 @@ static struct proc_dir_entry *proc_ide = NULL; static void make_proc_ide(void) { - proc_ide_root = proc_mkdir("ide", 0); + proc_ide_root = proc_mkdir("ide", NULL); proc_ide = proc_mkdir("ide0", proc_ide_root); } @@ -247,7 +304,7 @@ static int ubd_setup_common(char *str, int *index_out) struct ubd *dev; struct openflags flags = global_openflags; char *backing_file; - int n, err; + int n, err, i; if(index_out) *index_out = -1; n = *str; @@ -264,7 +321,7 @@ static int ubd_setup_common(char *str, int *index_out) } if(!strcmp(str, "sync")){ - global_openflags.s = 1; + global_openflags = of_sync(global_openflags); return(0); } major = simple_strtoul(str, &end, 0); @@ -309,31 +366,47 @@ static int ubd_setup_common(char *str, int *index_out) dev = &ubd_dev[n]; if(dev->file != NULL){ printk(KERN_ERR "ubd_setup : device already configured\n"); - goto out2; + goto out; } - if(index_out) *index_out = n; - - if (*str == 'r'){ - flags.w = 0; - str++; - } - if (*str == 's'){ - flags.s = 1; - str++; - } - if (*str == 'd'){ - dev->no_cow = 1; + if (index_out) + *index_out = n; + + for (i = 0; i < 4; i++) { + switch (*str) { + case 'r': + flags.w = 0; + break; + case 's': + flags.s = 1; + break; + case 'd': + dev->no_cow = 1; + break; + case '=': + str++; + goto break_loop; + default: + printk(KERN_ERR "ubd_setup : Expected '=' or flag letter (r,s or d)\n"); + goto out; + } str++; } - if(*str++ != '='){ + if (*str == '=') + printk(KERN_ERR "ubd_setup : Too many flags specified\n"); + else printk(KERN_ERR "ubd_setup : Expected '='\n"); - goto out2; - } + goto out; +break_loop: err = 0; backing_file = strchr(str, ','); + + if (!backing_file) { + backing_file = strchr(str, ':'); + } + if(backing_file){ if(dev->no_cow) printk(KERN_ERR "Can't specify both 'd' and a " @@ -346,7 +419,7 @@ static int ubd_setup_common(char *str, int *index_out) dev->file = str; dev->cow.file = backing_file; dev->boot_openflags = flags; - out2: +out: spin_unlock(&ubd_lock); return(err); } @@ -359,17 +432,25 @@ static int ubd_setup(char *str) __setup("ubd", ubd_setup); __uml_help(ubd_setup, -"ubd=\n" +"ubd=[(:|,)]\n" " This is used to associate a device with a file in the underlying\n" -" filesystem. Usually, there is a filesystem in the file, but \n" +" filesystem. When specifying two filenames, the first one is the\n" +" COW name and the second is the backing file name. As separator you can\n" +" use either a ':' or a ',': the first one allows writing things like;\n" +" ubd0=~/Uml/root_cow:~/Uml/root_backing_file\n" +" while with a ',' the shell would not expand the 2nd '~'.\n" +" When using only one filename, UML will detect whether to thread it like\n" +" a COW file or a backing file. To override this detection, add the 'd'\n" +" flag:\n" +" ubd0d=BackingFile\n" +" Usually, there is a filesystem in the file, but \n" " that's not required. Swap devices containing swap files can be\n" " specified like this. Also, a file which doesn't contain a\n" " filesystem can have its contents read in the virtual \n" -" machine by running dd on the device. n must be in the range\n" +" machine by running 'dd' on the device. must be in the range\n" " 0 to 7. Appending an 'r' to the number will cause that device\n" " to be mounted read-only. For example ubd1r=./ext_fs. Appending\n" -" an 's' (has to be _after_ 'r', if there is one) will cause data\n" -" to be written to disk on the host immediately.\n\n" +" an 's' will cause data to be written to disk on the host immediately.\n\n" ); static int fakehd_set = 0; @@ -430,7 +511,7 @@ static void ubd_handler(void) do_ubd = NULL; intr_count++; - n = read_ubd_fs(thread_fd, &req, sizeof(req)); + n = os_read_file(thread_fd, &req, sizeof(req)); if(n != sizeof(req)){ printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " "err = %d\n", os_getpid(), -n); @@ -585,6 +666,14 @@ static int ubd_new_disk(int major, u64 size, int unit, sprintf(disk->devfs_name, "ubd_fake/disc%d", unit); } + /* sysfs register (not for ide fake devices) */ + if (major == MAJOR_NR) { + ubd_dev[unit].pdev.id = unit; + ubd_dev[unit].pdev.name = DRIVER_NAME; + platform_device_register(&ubd_dev[unit].pdev); + disk->driverfs_dev = &ubd_dev[unit].pdev.dev; + } + disk->private_data = &ubd_dev[unit]; disk->queue = ubd_queue; add_disk(disk); @@ -593,6 +682,8 @@ static int ubd_new_disk(int major, u64 size, int unit, return 0; } +#define ROUND_BLOCK(n) ((n + ((1 << 9) - 1)) & (-1 << 9)) + static int ubd_add(int n) { struct ubd *dev = &ubd_dev[n]; @@ -608,6 +699,8 @@ static int ubd_add(int n) if(err < 0) return(err); + dev->size = ROUND_BLOCK(dev->size); + err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); if(err) return(err); @@ -718,6 +811,7 @@ static int ubd_remove(char *str) fake_gendisk[n] = NULL; } + platform_device_unregister(&dev->pdev); *dev = ((struct ubd) DEFAULT_UBD); err = 0; out: @@ -740,6 +834,11 @@ static int ubd_mc_init(void) __initcall(ubd_mc_init); +static struct device_driver ubd_driver = { + .name = DRIVER_NAME, + .bus = &platform_bus_type, +}; + int ubd_init(void) { int i; @@ -762,6 +861,7 @@ int ubd_init(void) if (register_blkdev(fake_major, "ubd")) return -1; } + driver_register(&ubd_driver); for (i = 0; i < MAX_DEV; i++) ubd_add(i); return 0; @@ -1057,7 +1157,7 @@ static void do_ubd_request(request_queue_t *q) err = prepare_request(req, &io_req); if(!err){ do_ubd = ubd_handler; - n = write_ubd_fs(thread_fd, (char *) &io_req, + n = os_write_file(thread_fd, (char *) &io_req, sizeof(io_req)); if(n != sizeof(io_req)) printk("write to io thread failed, " @@ -1069,7 +1169,7 @@ static void do_ubd_request(request_queue_t *q) static int ubd_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg) { - struct hd_geometry *loc = (struct hd_geometry *) arg; + struct hd_geometry __user *loc = (struct hd_geometry __user *) arg; struct ubd *dev = inode->i_bdev->bd_disk->private_data; struct hd_driveid ubd_id = { .cyls = 0, @@ -1090,19 +1190,19 @@ static int ubd_ioctl(struct inode * inode, struct file * file, case HDIO_GET_IDENTITY: ubd_id.cyls = dev->size / (128 * 32 * 512); - if(copy_to_user((char *) arg, (char *) &ubd_id, + if(copy_to_user((char __user *) arg, (char *) &ubd_id, sizeof(ubd_id))) return(-EFAULT); return(0); case CDROMVOLREAD: - if(copy_from_user(&volume, (char *) arg, sizeof(volume))) + if(copy_from_user(&volume, (char __user *) arg, sizeof(volume))) return(-EFAULT); volume.channel0 = 255; volume.channel1 = 255; volume.channel2 = 255; volume.channel3 = 255; - if(copy_to_user((char *) arg, &volume, sizeof(volume))) + if(copy_to_user((char __user *) arg, &volume, sizeof(volume))) return(-EFAULT); return(0); } @@ -1245,6 +1345,304 @@ static int ubd_remapper_setup(void) __initcall(ubd_remapper_setup); +static int same_backing_files(char *from_cmdline, char *from_cow, char *cow) +{ + struct uml_stat buf1, buf2; + int err; + + if(from_cmdline == NULL) return(1); + if(!strcmp(from_cmdline, from_cow)) return(1); + + err = os_stat_file(from_cmdline, &buf1); + if(err < 0){ + printk("Couldn't stat '%s', err = %d\n", from_cmdline, -err); + return(1); + } + err = os_stat_file(from_cow, &buf2); + if(err < 0){ + printk("Couldn't stat '%s', err = %d\n", from_cow, -err); + return(1); + } + if((buf1.ust_dev == buf2.ust_dev) && (buf1.ust_ino == buf2.ust_ino)) + return(1); + + printk("Backing file mismatch - \"%s\" requested,\n" + "\"%s\" specified in COW header of \"%s\"\n", + from_cmdline, from_cow, cow); + return(0); +} + +static int backing_file_mismatch(char *file, __u64 size, time_t mtime) +{ + unsigned long modtime; + long long actual; + int err; + + err = os_file_modtime(file, &modtime); + if(err < 0){ + printk("Failed to get modification time of backing file " + "\"%s\", err = %d\n", file, -err); + return(err); + } + + err = os_file_size(file, &actual); + if(err < 0){ + printk("Failed to get size of backing file \"%s\", " + "err = %d\n", file, -err); + return(err); + } + + if(actual != size){ + /*__u64 can be a long on AMD64 and with %lu GCC complains; so + * the typecast.*/ + printk("Size mismatch (%llu vs %llu) of COW header vs backing " + "file\n", (unsigned long long) size, actual); + return(-EINVAL); + } + if(modtime != mtime){ + printk("mtime mismatch (%ld vs %ld) of COW header vs backing " + "file\n", mtime, modtime); + return(-EINVAL); + } + return(0); +} + +int read_cow_bitmap(int fd, void *buf, int offset, int len) +{ + int err; + + err = os_seek_file(fd, offset); + if(err < 0) + return(err); + + err = os_read_file(fd, buf, len); + if(err < 0) + return(err); + + return(0); +} + +int open_ubd_file(char *file, struct openflags *openflags, + char **backing_file_out, int *bitmap_offset_out, + unsigned long *bitmap_len_out, int *data_offset_out, + int *create_cow_out) +{ + time_t mtime; + unsigned long long size; + __u32 version, align; + char *backing_file; + int fd, err, sectorsize, same, mode = 0644; + + fd = os_open_file(file, *openflags, mode); + if(fd < 0){ + if((fd == -ENOENT) && (create_cow_out != NULL)) + *create_cow_out = 1; + if(!openflags->w || + ((fd != -EROFS) && (fd != -EACCES))) return(fd); + openflags->w = 0; + fd = os_open_file(file, *openflags, mode); + if(fd < 0) + return(fd); + } + + err = os_lock_file(fd, openflags->w); + if(err < 0){ + printk("Failed to lock '%s', err = %d\n", file, -err); + goto out_close; + } + + if(backing_file_out == NULL) return(fd); + + err = read_cow_header(file_reader, &fd, &version, &backing_file, &mtime, + &size, §orsize, &align, bitmap_offset_out); + if(err && (*backing_file_out != NULL)){ + printk("Failed to read COW header from COW file \"%s\", " + "errno = %d\n", file, -err); + goto out_close; + } + if(err) return(fd); + + if(backing_file_out == NULL) return(fd); + + same = same_backing_files(*backing_file_out, backing_file, file); + + if(!same && !backing_file_mismatch(*backing_file_out, size, mtime)){ + printk("Switching backing file to '%s'\n", *backing_file_out); + err = write_cow_header(file, fd, *backing_file_out, + sectorsize, align, &size); + if(err){ + printk("Switch failed, errno = %d\n", -err); + return(err); + } + } + else { + *backing_file_out = backing_file; + err = backing_file_mismatch(*backing_file_out, size, mtime); + if(err) goto out_close; + } + + cow_sizes(version, size, sectorsize, align, *bitmap_offset_out, + bitmap_len_out, data_offset_out); + + return(fd); + out_close: + os_close_file(fd); + return(err); +} + +int create_cow_file(char *cow_file, char *backing_file, struct openflags flags, + int sectorsize, int alignment, int *bitmap_offset_out, + unsigned long *bitmap_len_out, int *data_offset_out) +{ + int err, fd; + + flags.c = 1; + fd = open_ubd_file(cow_file, &flags, NULL, NULL, NULL, NULL, NULL); + if(fd < 0){ + err = fd; + printk("Open of COW file '%s' failed, errno = %d\n", cow_file, + -err); + goto out; + } + + err = init_cow_file(fd, cow_file, backing_file, sectorsize, alignment, + bitmap_offset_out, bitmap_len_out, + data_offset_out); + if(!err) + return(fd); + os_close_file(fd); + out: + return(err); +} + +static int update_bitmap(struct io_thread_req *req) +{ + int n; + + if(req->cow_offset == -1) + return(0); + + n = os_seek_file(req->fds[1], req->cow_offset); + if(n < 0){ + printk("do_io - bitmap lseek failed : err = %d\n", -n); + return(1); + } + + n = os_write_file(req->fds[1], &req->bitmap_words, + sizeof(req->bitmap_words)); + if(n != sizeof(req->bitmap_words)){ + printk("do_io - bitmap update failed, err = %d fd = %d\n", -n, + req->fds[1]); + return(1); + } + + return(0); +} + +void do_io(struct io_thread_req *req) +{ + char *buf; + unsigned long len; + int n, nsectors, start, end, bit; + int err; + __u64 off; + + if(req->op == UBD_MMAP){ + /* Touch the page to force the host to do any necessary IO to + * get it into memory + */ + n = *((volatile int *) req->buffer); + req->error = update_bitmap(req); + return; + } + + nsectors = req->length / req->sectorsize; + start = 0; + do { + bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask); + end = start; + while((end < nsectors) && + (ubd_test_bit(end, (unsigned char *) + &req->sector_mask) == bit)) + end++; + + off = req->offset + req->offsets[bit] + + start * req->sectorsize; + len = (end - start) * req->sectorsize; + buf = &req->buffer[start * req->sectorsize]; + + err = os_seek_file(req->fds[bit], off); + if(err < 0){ + printk("do_io - lseek failed : err = %d\n", -err); + req->error = 1; + return; + } + if(req->op == UBD_READ){ + n = 0; + do { + buf = &buf[n]; + len -= n; + n = os_read_file(req->fds[bit], buf, len); + if (n < 0) { + printk("do_io - read failed, err = %d " + "fd = %d\n", -n, req->fds[bit]); + req->error = 1; + return; + } + } while((n < len) && (n != 0)); + if (n < len) memset(&buf[n], 0, len - n); + } + else { + n = os_write_file(req->fds[bit], buf, len); + if(n != len){ + printk("do_io - write failed err = %d " + "fd = %d\n", -n, req->fds[bit]); + req->error = 1; + return; + } + } + + start = end; + } while(start < nsectors); + + req->error = update_bitmap(req); +} + +/* Changed in start_io_thread, which is serialized by being called only + * from ubd_init, which is an initcall. + */ +int kernel_fd = -1; + +/* Only changed by the io thread */ +int io_count = 0; + +int io_thread(void *arg) +{ + struct io_thread_req req; + int n; + + ignore_sigwinch_sig(); + while(1){ + n = os_read_file(kernel_fd, &req, sizeof(req)); + if(n != sizeof(req)){ + if(n < 0) + printk("io_thread - read failed, fd = %d, " + "err = %d\n", kernel_fd, -n); + else { + printk("io_thread - short read, fd = %d, " + "length = %d\n", kernel_fd, n); + } + continue; + } + io_count++; + do_io(&req); + n = os_write_file(kernel_fd, &req, sizeof(req)); + if(n != sizeof(req)) + printk("io_thread - write failed, fd = %d, err = %d\n", + kernel_fd, -n); + } +} + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index 882d2f7c1..b94d2bc4f 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -26,311 +26,9 @@ #include #include -static int same_backing_files(char *from_cmdline, char *from_cow, char *cow) +void ignore_sigwinch_sig(void) { - struct uml_stat buf1, buf2; - int err; - - if(from_cmdline == NULL) return(1); - if(!strcmp(from_cmdline, from_cow)) return(1); - - err = os_stat_file(from_cmdline, &buf1); - if(err < 0){ - printk("Couldn't stat '%s', err = %d\n", from_cmdline, -err); - return(1); - } - err = os_stat_file(from_cow, &buf2); - if(err < 0){ - printk("Couldn't stat '%s', err = %d\n", from_cow, -err); - return(1); - } - if((buf1.ust_dev == buf2.ust_dev) && (buf1.ust_ino == buf2.ust_ino)) - return(1); - - printk("Backing file mismatch - \"%s\" requested,\n" - "\"%s\" specified in COW header of \"%s\"\n", - from_cmdline, from_cow, cow); - return(0); -} - -static int backing_file_mismatch(char *file, __u64 size, time_t mtime) -{ - unsigned long modtime; - long long actual; - int err; - - err = os_file_modtime(file, &modtime); - if(err < 0){ - printk("Failed to get modification time of backing file " - "\"%s\", err = %d\n", file, -err); - return(err); - } - - err = os_file_size(file, &actual); - if(err < 0){ - printk("Failed to get size of backing file \"%s\", " - "err = %d\n", file, -err); - return(err); - } - - if(actual != size){ - printk("Size mismatch (%ld vs %ld) of COW header vs backing " - "file\n", size, actual); - return(-EINVAL); - } - if(modtime != mtime){ - printk("mtime mismatch (%ld vs %ld) of COW header vs backing " - "file\n", mtime, modtime); - return(-EINVAL); - } - return(0); -} - -int read_cow_bitmap(int fd, void *buf, int offset, int len) -{ - int err; - - err = os_seek_file(fd, offset); - if(err < 0) - return(err); - - err = os_read_file(fd, buf, len); - if(err < 0) - return(err); - - return(0); -} - -int open_ubd_file(char *file, struct openflags *openflags, - char **backing_file_out, int *bitmap_offset_out, - unsigned long *bitmap_len_out, int *data_offset_out, - int *create_cow_out) -{ - time_t mtime; - __u64 size; - __u32 version, align; - char *backing_file; - int fd, err, sectorsize, same, mode = 0644; - - fd = os_open_file(file, *openflags, mode); - if(fd < 0){ - if((fd == -ENOENT) && (create_cow_out != NULL)) - *create_cow_out = 1; - if(!openflags->w || - ((errno != EROFS) && (errno != EACCES))) return(-errno); - openflags->w = 0; - fd = os_open_file(file, *openflags, mode); - if(fd < 0) - return(fd); - } - - err = os_lock_file(fd, openflags->w); - if(err < 0){ - printk("Failed to lock '%s', err = %d\n", file, -err); - goto out_close; - } - - if(backing_file_out == NULL) return(fd); - - err = read_cow_header(file_reader, &fd, &version, &backing_file, &mtime, - &size, §orsize, &align, bitmap_offset_out); - if(err && (*backing_file_out != NULL)){ - printk("Failed to read COW header from COW file \"%s\", " - "errno = %d\n", file, -err); - goto out_close; - } - if(err) return(fd); - - if(backing_file_out == NULL) return(fd); - - same = same_backing_files(*backing_file_out, backing_file, file); - - if(!same && !backing_file_mismatch(*backing_file_out, size, mtime)){ - printk("Switching backing file to '%s'\n", *backing_file_out); - err = write_cow_header(file, fd, *backing_file_out, - sectorsize, align, &size); - if(err){ - printk("Switch failed, errno = %d\n", -err); - return(err); - } - } - else { - *backing_file_out = backing_file; - err = backing_file_mismatch(*backing_file_out, size, mtime); - if(err) goto out_close; - } - - cow_sizes(version, size, sectorsize, align, *bitmap_offset_out, - bitmap_len_out, data_offset_out); - - return(fd); - out_close: - os_close_file(fd); - return(err); -} - -int create_cow_file(char *cow_file, char *backing_file, struct openflags flags, - int sectorsize, int alignment, int *bitmap_offset_out, - unsigned long *bitmap_len_out, int *data_offset_out) -{ - int err, fd; - - flags.c = 1; - fd = open_ubd_file(cow_file, &flags, NULL, NULL, NULL, NULL, NULL); - if(fd < 0){ - err = fd; - printk("Open of COW file '%s' failed, errno = %d\n", cow_file, - -err); - goto out; - } - - err = init_cow_file(fd, cow_file, backing_file, sectorsize, alignment, - bitmap_offset_out, bitmap_len_out, - data_offset_out); - if(!err) - return(fd); - os_close_file(fd); - out: - return(err); -} - -/* XXX Just trivial wrappers around os_read_file and os_write_file */ -int read_ubd_fs(int fd, void *buffer, int len) -{ - return(os_read_file(fd, buffer, len)); -} - -int write_ubd_fs(int fd, char *buffer, int len) -{ - return(os_write_file(fd, buffer, len)); -} - -static int update_bitmap(struct io_thread_req *req) -{ - int n; - - if(req->cow_offset == -1) - return(0); - - n = os_seek_file(req->fds[1], req->cow_offset); - if(n < 0){ - printk("do_io - bitmap lseek failed : err = %d\n", -n); - return(1); - } - - n = os_write_file(req->fds[1], &req->bitmap_words, - sizeof(req->bitmap_words)); - if(n != sizeof(req->bitmap_words)){ - printk("do_io - bitmap update failed, err = %d fd = %d\n", -n, - req->fds[1]); - return(1); - } - - return(0); -} - -void do_io(struct io_thread_req *req) -{ - char *buf; - unsigned long len; - int n, nsectors, start, end, bit; - int err; - __u64 off; - - if(req->op == UBD_MMAP){ - /* Touch the page to force the host to do any necessary IO to - * get it into memory - */ - n = *((volatile int *) req->buffer); - req->error = update_bitmap(req); - return; - } - - nsectors = req->length / req->sectorsize; - start = 0; - do { - bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask); - end = start; - while((end < nsectors) && - (ubd_test_bit(end, (unsigned char *) - &req->sector_mask) == bit)) - end++; - - off = req->offset + req->offsets[bit] + - start * req->sectorsize; - len = (end - start) * req->sectorsize; - buf = &req->buffer[start * req->sectorsize]; - - err = os_seek_file(req->fds[bit], off); - if(err < 0){ - printk("do_io - lseek failed : err = %d\n", -err); - req->error = 1; - return; - } - if(req->op == UBD_READ){ - n = 0; - do { - buf = &buf[n]; - len -= n; - n = os_read_file(req->fds[bit], buf, len); - if (n < 0) { - printk("do_io - read failed, err = %d " - "fd = %d\n", -n, req->fds[bit]); - req->error = 1; - return; - } - } while((n < len) && (n != 0)); - if (n < len) memset(&buf[n], 0, len - n); - } - else { - n = os_write_file(req->fds[bit], buf, len); - if(n != len){ - printk("do_io - write failed err = %d " - "fd = %d\n", -n, req->fds[bit]); - req->error = 1; - return; - } - } - - start = end; - } while(start < nsectors); - - req->error = update_bitmap(req); -} - -/* Changed in start_io_thread, which is serialized by being called only - * from ubd_init, which is an initcall. - */ -int kernel_fd = -1; - -/* Only changed by the io thread */ -int io_count = 0; - -int io_thread(void *arg) -{ - struct io_thread_req req; - int n; - signal(SIGWINCH, SIG_IGN); - while(1){ - n = os_read_file(kernel_fd, &req, sizeof(req)); - if(n != sizeof(req)){ - if(n < 0) - printk("io_thread - read failed, fd = %d, " - "err = %d\n", kernel_fd, -n); - else { - printk("io_thread - short read, fd = %d, " - "length = %d\n", kernel_fd, n); - } - continue; - } - io_count++; - do_io(&req); - n = os_write_file(kernel_fd, &req, sizeof(req)); - if(n != sizeof(req)) - printk("io_thread - write failed, fd = %d, err = %d\n", - kernel_fd, -n); - } } int start_io_thread(unsigned long sp, int *fd_out) diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c index f417b3b66..c1c22e5fc 100644 --- a/arch/um/drivers/xterm.c +++ b/arch/um/drivers/xterm.c @@ -97,6 +97,13 @@ int xterm_open(int input, int output, int primary, void *d, char **dev_out) if(os_access(argv[4], OS_ACC_X_OK) < 0) argv[4] = "port-helper"; + /* Check that DISPLAY is set, this doesn't guarantee the xterm + * will work but w/o it we can be pretty sure it won't. */ + if (!getenv("DISPLAY")) { + printk("xterm_open: $DISPLAY not set.\n"); + return -ENODEV; + } + fd = mkstemp(file); if(fd < 0){ printk("xterm_open : mkstemp failed, errno = %d\n", errno); @@ -126,9 +133,9 @@ int xterm_open(int input, int output, int primary, void *d, char **dev_out) if(data->stack == 0) free_stack(stack, 0); - if(data->direct_rcv) + if (data->direct_rcv) { new = os_rcv_fd(fd, &data->helper_pid); - else { + } else { err = os_set_fd_block(fd, 0); if(err < 0){ printk("xterm_open : failed to set descriptor " diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c index a94813fce..afce46fa6 100644 --- a/arch/um/drivers/xterm_kern.c +++ b/arch/um/drivers/xterm_kern.c @@ -46,6 +46,8 @@ int xterm_fd(int socket, int *pid_out) printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n"); return(-ENOMEM); } + + /* This is a locked semaphore... */ *data = ((struct xterm_wait) { .sem = __SEMAPHORE_INITIALIZER(data->sem, 0), .fd = socket, @@ -55,14 +57,20 @@ int xterm_fd(int socket, int *pid_out) err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "xterm", data); - if(err){ + if (err){ printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, " "err = %d\n", err); ret = err; goto out; } + + /* ... so here we wait for an xterm interrupt. + * + * XXX Note, if the xterm doesn't work for some reason (eg. DISPLAY + * isn't set) this will hang... */ down(&data->sem); + free_irq_by_irq_and_dev(XTERM_IRQ, data); free_irq(XTERM_IRQ, data); ret = data->new_fd; diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index d2cd02a03..da9a6717e 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h @@ -8,7 +8,9 @@ #include "linux/tty.h" #include "linux/list.h" +#include "linux/console.h" #include "chan_user.h" +#include "line.h" struct chan { struct list_head list; @@ -24,7 +26,7 @@ struct chan { }; extern void chan_interrupt(struct list_head *chans, struct work_struct *task, - struct tty_struct *tty, int irq, void *dev); + struct tty_struct *tty, int irq); extern int parse_chan_pair(char *str, struct list_head *chans, int pri, int device, struct chan_opts *opts); extern int open_chan(struct list_head *chans); @@ -32,9 +34,11 @@ extern int write_chan(struct list_head *chans, const char *buf, int len, int write_irq); extern int console_write_chan(struct list_head *chans, const char *buf, int len); +extern int console_open_chan(struct line *line, struct console *co, + struct chan_opts *opts); extern void close_chan(struct list_head *chans); -extern void chan_enable_winch(struct list_head *chans, void *line); -extern void enable_chan(struct list_head *chans, void *data); +extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); +extern void enable_chan(struct list_head *chans, struct tty_struct *tty); extern int chan_window_size(struct list_head *chans, unsigned short *rows_out, unsigned short *cols_out); diff --git a/arch/um/include/chan_user.h b/arch/um/include/chan_user.h index 9414c1a44..f77d9aa4c 100644 --- a/arch/um/include/chan_user.h +++ b/arch/um/include/chan_user.h @@ -42,8 +42,9 @@ extern int generic_window_size(int fd, void *unused, unsigned short *rows_out, unsigned short *cols_out); extern void generic_free(void *data); -extern void register_winch(int fd, void *device_data); -extern void register_winch_irq(int fd, int tty_fd, int pid, void *line); +struct tty_struct; +extern void register_winch(int fd, struct tty_struct *tty); +extern void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty); #define __channel_help(fn, prefix) \ __uml_help(fn, prefix "[0-9]*=\n" \ diff --git a/arch/um/include/frame_kern.h b/arch/um/include/frame_kern.h index 21becc6fc..ce9514f57 100644 --- a/arch/um/include/frame_kern.h +++ b/arch/um/include/frame_kern.h @@ -6,17 +6,15 @@ #ifndef __FRAME_KERN_H_ #define __FRAME_KERN_H_ -#include "frame.h" -#include "sysdep/frame_kern.h" +#define _S(nr) (1<<((nr)-1)) +#define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP))) extern int setup_signal_stack_sc(unsigned long stack_top, int sig, - unsigned long handler, - void (*restorer)(void), + struct k_sigaction *ka, struct pt_regs *regs, sigset_t *mask); extern int setup_signal_stack_si(unsigned long stack_top, int sig, - unsigned long handler, - void (*restorer)(void), + struct k_sigaction *ka, struct pt_regs *regs, siginfo_t *info, sigset_t *mask); diff --git a/arch/um/include/init.h b/arch/um/include/init.h index f1d82e025..55c2693f8 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -40,9 +40,18 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -#define __init __attribute__ ((__section__ (".text.init"))) -#define __exit __attribute__ ((unused, __section__(".text.exit"))) -#define __initdata __attribute__ ((__section__ (".data.init"))) +/* These are for everybody (although not all archs will actually + discard it in modules) */ +#define __init __attribute__ ((__section__ (".init.text"))) +#define __initdata __attribute__ ((__section__ (".init.data"))) +#define __exitdata __attribute__ ((__section__(".exit.data"))) +#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) + +#ifdef MODULE +#define __exit __attribute__ ((__section__(".exit.text"))) +#else +#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) +#endif #endif @@ -94,11 +103,20 @@ extern struct uml_param __uml_setup_start, __uml_setup_end; * Mark functions and data as being only used at initialization * or exit time. */ -#define __uml_init_setup __attribute__ ((unused,__section__ (".uml.setup.init"))) -#define __uml_setup_help __attribute__ ((unused,__section__ (".uml.help.init"))) -#define __uml_init_call __attribute__ ((unused,__section__ (".uml.initcall.init"))) -#define __uml_postsetup_call __attribute__ ((unused,__section__ (".uml.postsetup.init"))) -#define __uml_exit_call __attribute__ ((unused,__section__ (".uml.exitcall.exit"))) +#define __uml_init_setup __attribute_used__ __attribute__ ((__section__ (".uml.setup.init"))) +#define __uml_setup_help __attribute_used__ __attribute__ ((__section__ (".uml.help.init"))) +#define __uml_init_call __attribute_used__ __attribute__ ((__section__ (".uml.initcall.init"))) +#define __uml_postsetup_call __attribute_used__ __attribute__ ((__section__ (".uml.postsetup.init"))) +#define __uml_exit_call __attribute_used__ __attribute__ ((__section__ (".uml.exitcall.exit"))) + +#ifndef __KERNEL__ + +#define __initcall(fn) static initcall_t __initcall_##fn __init_call = fn +#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn + +#define __init_call __attribute__ ((unused,__section__ (".initcall.init"))) + +#endif #endif /* _LINUX_UML_INIT_H */ diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h index 0df4076ac..f724b7172 100644 --- a/arch/um/include/irq_user.h +++ b/arch/um/include/irq_user.h @@ -10,7 +10,7 @@ enum { IRQ_READ, IRQ_WRITE }; extern void sigio_handler(int sig, union uml_pt_regs *regs); extern int activate_fd(int irq, int fd, int type, void *dev_id); -extern void free_irq_by_irq_and_dev(int irq, void *dev_id); +extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id); extern void free_irq_by_fd(int fd); extern void reactivate_fd(int fd, int irqnum); extern void deactivate_fd(int fd, int irqnum); diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index eace6b208..15389c886 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h @@ -29,7 +29,7 @@ extern int kernel_thread_proc(void *data); extern void syscall_segv(int sig); extern int current_pid(void); extern unsigned long alloc_stack(int order, int atomic); -extern int do_signal(int error); +extern int do_signal(void); extern int is_stack_fault(unsigned long sp); extern unsigned long segv(unsigned long address, unsigned long ip, int is_write, int is_user, void *sc); @@ -41,7 +41,7 @@ extern int is_tracing(void *task); extern int segv_syscall(void); extern void kern_finish_exec(void *task, int new_pid, unsigned long stack); extern int page_size(void); -extern int page_mask(void); +extern unsigned long page_mask(void); extern int need_finish_fork(void); extern void free_stack(unsigned long stack, int order); extern void add_input_request(int op, void (*proc)(int), void *arg); @@ -110,7 +110,6 @@ extern void arch_switch(void); extern void free_irq(unsigned int, void *); extern int um_in_interrupt(void); extern int cpu(void); -extern unsigned long long time_stamp(void); #endif diff --git a/arch/um/include/line.h b/arch/um/include/line.h index 31911329f..6d81ecc17 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h @@ -37,7 +37,6 @@ struct line { struct list_head chan_list; int valid; int count; - struct tty_struct *tty; struct semaphore sem; char *buffer; char *head; @@ -53,8 +52,6 @@ struct line { init_pri : INIT_STATIC, \ chan_list : { }, \ valid : 1, \ - count : 0, \ - tty : NULL, \ sem : { }, \ buffer : NULL, \ head : NULL, \ @@ -69,18 +66,22 @@ struct lines { #define LINES_INIT(n) { num : n } -extern void line_close(struct line *lines, struct tty_struct *tty); +extern void line_close(struct tty_struct *tty, struct file * filp); extern int line_open(struct line *lines, struct tty_struct *tty, struct chan_opts *opts); extern int line_setup(struct line *lines, int num, char *init, int all_allowed); -extern int line_write(struct line *line, struct tty_struct *tty, int from_user, - const char *buf, int len); +extern int line_write(struct tty_struct *tty, const unsigned char *buf, int len); +extern void line_put_char(struct tty_struct *tty, unsigned char ch); +extern void line_set_termios(struct tty_struct *tty, struct termios * old); +extern int line_chars_in_buffer(struct tty_struct *tty); extern int line_write_room(struct tty_struct *tty); +extern int line_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg); extern char *add_xterm_umid(char *base); -extern int line_setup_irq(int fd, int input, int output, void *data); +extern int line_setup_irq(int fd, int input, int output, struct tty_struct *tty); extern void line_close_chan(struct line *line); -extern void line_disable(struct line *line, int current_irq); +extern void line_disable(struct tty_struct *tty, int current_irq); extern struct tty_driver * line_register_devfs(struct lines *set, struct line_driver *line_driver, struct tty_operations *driver, diff --git a/arch/um/include/mem_user.h b/arch/um/include/mem_user.h index f530ac3f8..d6404bb64 100644 --- a/arch/um/include/mem_user.h +++ b/arch/um/include/mem_user.h @@ -67,6 +67,7 @@ extern void map_memory(unsigned long virt, unsigned long phys, extern int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x, int must_succeed); extern unsigned long get_kmem_end(void); +extern void check_tmpexec(void); #endif diff --git a/arch/um/include/mode.h b/arch/um/include/mode.h index 23b95f999..786cf563e 100644 --- a/arch/um/include/mode.h +++ b/arch/um/include/mode.h @@ -9,11 +9,11 @@ #include "uml-config.h" #ifdef UML_CONFIG_MODE_TT -#include "../kernel/tt/include/mode.h" +#include "mode-tt.h" #endif #ifdef UML_CONFIG_MODE_SKAS -#include "../kernel/skas/include/mode.h" +#include "mode-skas.h" #endif #endif diff --git a/arch/um/include/mode_kern.h b/arch/um/include/mode_kern.h index 562174bf4..2d88afd0c 100644 --- a/arch/um/include/mode_kern.h +++ b/arch/um/include/mode_kern.h @@ -9,11 +9,11 @@ #include "linux/config.h" #ifdef CONFIG_MODE_TT -#include "../kernel/tt/include/mode_kern.h" +#include "mode_kern-tt.h" #endif #ifdef CONFIG_MODE_SKAS -#include "../kernel/skas/include/mode_kern.h" +#include "mode_kern-skas.h" #endif #endif diff --git a/arch/um/include/net_kern.h b/arch/um/include/net_kern.h index de793e9bf..1c07949a1 100644 --- a/arch/um/include/net_kern.h +++ b/arch/um/include/net_kern.h @@ -14,6 +14,7 @@ struct uml_net { struct list_head list; struct net_device *dev; + struct platform_device pdev; int index; unsigned char mac[ETH_ALEN]; int have_mac; diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 8c4011265..07340c8cf 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h @@ -157,6 +157,7 @@ extern unsigned long os_process_pc(int pid); extern int os_process_parent(int pid); extern void os_stop_process(int pid); extern void os_kill_process(int pid, int reap_child); +extern void os_kill_ptraced_process(int pid, int reap_child); extern void os_usr1_process(int pid); extern int os_getpid(void); diff --git a/arch/um/include/process.h b/arch/um/include/process.h index 07af21857..5af9157ff 100644 --- a/arch/um/include/process.h +++ b/arch/um/include/process.h @@ -6,7 +6,7 @@ #ifndef __PROCESS_H__ #define __PROCESS_H__ -#include +#include extern void sig_handler(int sig, struct sigcontext sc); extern void alarm_handler(int sig, struct sigcontext sc); diff --git a/arch/um/include/ptrace_user.h b/arch/um/include/ptrace_user.h index ad35d0c2b..f3450e6bc 100644 --- a/arch/um/include/ptrace_user.h +++ b/arch/um/include/ptrace_user.h @@ -11,8 +11,50 @@ extern int ptrace_getregs(long pid, unsigned long *regs_out); extern int ptrace_setregs(long pid, unsigned long *regs_in); extern int ptrace_getfpregs(long pid, unsigned long *regs_out); +extern int ptrace_setfpregs(long pid, unsigned long *regs); extern void arch_enter_kernel(void *task, int pid); extern void arch_leave_kernel(void *task, int pid); extern void ptrace_pokeuser(unsigned long addr, unsigned long data); + +/* syscall emulation path in ptrace */ + +#ifndef PTRACE_SYSEMU +#define PTRACE_SYSEMU 31 +#endif +#ifndef PTRACE_SYSEMU_SINGLESTEP +#define PTRACE_SYSEMU_SINGLESTEP 32 +#endif + +/* On architectures, that started to support PTRACE_O_TRACESYSGOOD + * in linux 2.4, there are two different definitions of + * PTRACE_SETOPTIONS: linux 2.4 uses 21 while linux 2.6 uses 0x4200. + * For binary compatibility, 2.6 also supports the old "21", named + * PTRACE_OLDSETOPTION. On these architectures, UML always must use + * "21", to ensure the kernel runs on 2.4 and 2.6 host without + * recompilation. So, we use PTRACE_OLDSETOPTIONS in UML. + * We also want to be able to build the kernel on 2.4, which doesn't + * have PTRACE_OLDSETOPTIONS. So, if it is missing, we declare + * PTRACE_OLDSETOPTIONS to to be the same as PTRACE_SETOPTIONS. + * + * On architectures, that start to support PTRACE_O_TRACESYSGOOD on + * linux 2.6, PTRACE_OLDSETOPTIONS never is defined, and also isn't + * supported by the host kernel. In that case, our trick lets us use + * the new 0x4200 with the name PTRACE_OLDSETOPTIONS. + */ +#ifndef PTRACE_OLDSETOPTIONS +#define PTRACE_OLDSETOPTIONS PTRACE_SETOPTIONS +#endif + +void set_using_sysemu(int value); +int get_using_sysemu(void); +extern int sysemu_supported; + +#define SELECT_PTRACE_OPERATION(sysemu_mode, singlestep_mode) \ + (((int[3][3] ) { \ + { PTRACE_SYSCALL, PTRACE_SYSCALL, PTRACE_SINGLESTEP }, \ + { PTRACE_SYSEMU, PTRACE_SYSEMU, PTRACE_SINGLESTEP }, \ + { PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, PTRACE_SYSEMU_SINGLESTEP }}) \ + [sysemu_mode][singlestep_mode]) + #endif diff --git a/arch/um/include/syscall_user.h b/arch/um/include/syscall_user.h index bc7be6293..811d0ec24 100644 --- a/arch/um/include/syscall_user.h +++ b/arch/um/include/syscall_user.h @@ -7,7 +7,7 @@ #define __SYSCALL_USER_H extern int record_syscall_start(int syscall); -extern void record_syscall_end(int index, int result); +extern void record_syscall_end(int index, long result); #endif diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h index bb6b343f1..28032d6cd 100644 --- a/arch/um/include/sysdep-i386/checksum.h +++ b/arch/um/include/sysdep-i386/checksum.h @@ -31,10 +31,10 @@ unsigned int csum_partial(const unsigned char * buff, int len, * better 64-bit) boundary */ -unsigned int csum_partial_copy_to(const char *src, char *dst, int len, - int sum, int *err_ptr); -unsigned int csum_partial_copy_from(const char *src, char *dst, int len, - int sum, int *err_ptr); +unsigned int csum_partial_copy_to(const unsigned char *src, unsigned char *dst, + int len, int sum, int *err_ptr); +unsigned int csum_partial_copy_from(const unsigned char *src, unsigned char *dst, + int len, int sum, int *err_ptr); /* * Note: when you get a NULL pointer exception here this means someone @@ -45,7 +45,7 @@ unsigned int csum_partial_copy_from(const char *src, char *dst, int len, */ static __inline__ -unsigned int csum_partial_copy_nocheck(const char *src, char *dst, +unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, int sum) { memcpy(dst, src, len); @@ -53,7 +53,7 @@ unsigned int csum_partial_copy_nocheck(const char *src, char *dst, } static __inline__ -unsigned int csum_partial_copy_from_user(const char *src, char *dst, +unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int len, int sum, int *err_ptr) { return csum_partial_copy_from(src, dst, len, sum, err_ptr); @@ -67,7 +67,7 @@ unsigned int csum_partial_copy_from_user(const char *src, char *dst, */ #define csum_partial_copy_fromuser csum_partial_copy_from_user -unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum); +unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, int sum); /* * This is a version of ip_compute_csum() optimized for IP headers, @@ -192,9 +192,9 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, * Copy and checksum to user */ #define HAVE_CSUM_COPY_USER -static __inline__ unsigned int csum_and_copy_to_user(const char *src, - char *dst, int len, - int sum, int *err_ptr) +static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, + unsigned char *dst, + int len, int sum, int *err_ptr) { if (access_ok(VERIFY_WRITE, dst, len)) return(csum_partial_copy_to(src, dst, len, sum, err_ptr)); diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h index 432b82a38..dc126e5e2 100644 --- a/arch/um/include/sysdep-i386/ptrace.h +++ b/arch/um/include/sysdep-i386/ptrace.h @@ -9,11 +9,55 @@ #include "uml-config.h" #ifdef UML_CONFIG_MODE_TT -#include "ptrace-tt.h" +#include "sysdep/sc.h" #endif #ifdef UML_CONFIG_MODE_SKAS -#include "ptrace-skas.h" + +/* syscall emulation path in ptrace */ + +#ifndef PTRACE_SYSEMU +#define PTRACE_SYSEMU 31 +#endif + +void set_using_sysemu(int value); +int get_using_sysemu(void); +extern int sysemu_supported; + +#include "skas_ptregs.h" + +#define HOST_FRAME_SIZE 17 + +#define REGS_IP(r) ((r)[HOST_IP]) +#define REGS_SP(r) ((r)[HOST_SP]) +#define REGS_EFLAGS(r) ((r)[HOST_EFLAGS]) +#define REGS_EAX(r) ((r)[HOST_EAX]) +#define REGS_EBX(r) ((r)[HOST_EBX]) +#define REGS_ECX(r) ((r)[HOST_ECX]) +#define REGS_EDX(r) ((r)[HOST_EDX]) +#define REGS_ESI(r) ((r)[HOST_ESI]) +#define REGS_EDI(r) ((r)[HOST_EDI]) +#define REGS_EBP(r) ((r)[HOST_EBP]) +#define REGS_CS(r) ((r)[HOST_CS]) +#define REGS_SS(r) ((r)[HOST_SS]) +#define REGS_DS(r) ((r)[HOST_DS]) +#define REGS_ES(r) ((r)[HOST_ES]) +#define REGS_FS(r) ((r)[HOST_FS]) +#define REGS_GS(r) ((r)[HOST_GS]) + +#define REGS_SET_SYSCALL_RETURN(r, res) REGS_EAX(r) = (res) + +#define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) + +#define REGS_SEGV_IS_FIXABLE(r) SEGV_IS_FIXABLE((r)->trap_type) + +#define REGS_FAULT_ADDR(r) ((r)->fault_addr) + +#define REGS_FAULT_WRITE(r) FAULT_WRITE((r)->fault_type) + +#endif +#ifndef PTRACE_SYSEMU_SINGLESTEP +#define PTRACE_SYSEMU_SINGLESTEP 32 #endif #include "choose-mode.h" diff --git a/arch/um/include/sysdep-i386/ptrace_user.h b/arch/um/include/sysdep-i386/ptrace_user.h index 42ea22ffb..271d9d794 100644 --- a/arch/um/include/sysdep-i386/ptrace_user.h +++ b/arch/um/include/sysdep-i386/ptrace_user.h @@ -33,6 +33,9 @@ #define FP_FRAME_SIZE (27) #define FPX_FRAME_SIZE (128) +#define MAX_REG_OFFSET (FRAME_SIZE_OFFSET) +#define MAX_REG_NR (FRAME_SIZE) + #ifdef PTRACE_GETREGS #define UM_HAVE_GETREGS #endif diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h index 47687dcf2..36d9beec4 100644 --- a/arch/um/include/sysdep-i386/syscalls.h +++ b/arch/um/include/sysdep-i386/syscalls.h @@ -8,11 +8,70 @@ typedef long syscall_handler_t(struct pt_regs); +/* Not declared on x86, incompatible declarations on x86_64, so these have + * to go here rather than in sys_call_table.c + */ +extern syscall_handler_t sys_ptrace; +extern syscall_handler_t sys_rt_sigaction; + +extern syscall_handler_t old_mmap_i386; + #define EXECUTE_SYSCALL(syscall, regs) \ ((long (*)(struct syscall_args)) (*sys_call_table[syscall]))(SYSCALL_ARGS(®s->regs)) +extern long sys_mmap2(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff); + #define ARCH_SYSCALLS \ + [ __NR_waitpid ] = (syscall_handler_t *) sys_waitpid, \ + [ __NR_break ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_oldstat ] = (syscall_handler_t *) sys_stat, \ + [ __NR_umount ] = (syscall_handler_t *) sys_oldumount, \ + [ __NR_stime ] = um_stime, \ + [ __NR_oldfstat ] = (syscall_handler_t *) sys_fstat, \ + [ __NR_stty ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_gtty ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_nice ] = (syscall_handler_t *) sys_nice, \ + [ __NR_ftime ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_prof ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_signal ] = (syscall_handler_t *) sys_signal, \ + [ __NR_lock ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_mpx ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_ulimit ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_oldolduname ] = (syscall_handler_t *) sys_olduname, \ + [ __NR_sigaction ] = (syscall_handler_t *) sys_sigaction, \ + [ __NR_sgetmask ] = (syscall_handler_t *) sys_sgetmask, \ + [ __NR_ssetmask ] = (syscall_handler_t *) sys_ssetmask, \ + [ __NR_sigsuspend ] = (syscall_handler_t *) sys_sigsuspend, \ + [ __NR_sigpending ] = (syscall_handler_t *) sys_sigpending, \ + [ __NR_oldlstat ] = (syscall_handler_t *) sys_lstat, \ + [ __NR_readdir ] = old_readdir, \ + [ __NR_profil ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_socketcall ] = (syscall_handler_t *) sys_socketcall, \ + [ __NR_olduname ] = (syscall_handler_t *) sys_uname, \ + [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_idle ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_ipc ] = (syscall_handler_t *) sys_ipc, \ + [ __NR_sigreturn ] = (syscall_handler_t *) sys_sigreturn, \ + [ __NR_sigprocmask ] = (syscall_handler_t *) sys_sigprocmask, \ + [ __NR_bdflush ] = (syscall_handler_t *) sys_bdflush, \ + [ __NR__llseek ] = (syscall_handler_t *) sys_llseek, \ + [ __NR__newselect ] = (syscall_handler_t *) sys_select, \ + [ __NR_vm86 ] = (syscall_handler_t *) sys_ni_syscall, \ [ __NR_mmap ] = (syscall_handler_t *) old_mmap_i386, \ + [ __NR_ugetrlimit ] = (syscall_handler_t *) sys_getrlimit, \ + [ __NR_mmap2 ] = (syscall_handler_t *) sys_mmap2, \ + [ __NR_truncate64 ] = (syscall_handler_t *) sys_truncate64, \ + [ __NR_ftruncate64 ] = (syscall_handler_t *) sys_ftruncate64, \ + [ __NR_stat64 ] = (syscall_handler_t *) sys_stat64, \ + [ __NR_lstat64 ] = (syscall_handler_t *) sys_lstat64, \ + [ __NR_fstat64 ] = (syscall_handler_t *) sys_fstat64, \ + [ __NR_fcntl64 ] = (syscall_handler_t *) sys_fcntl64, \ + [ __NR_sendfile64 ] = (syscall_handler_t *) sys_sendfile64, \ + [ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64, \ + [ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64, \ + [ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64, \ [ __NR_select ] = (syscall_handler_t *) old_select, \ [ __NR_vm86old ] = (syscall_handler_t *) sys_ni_syscall, \ [ __NR_modify_ldt ] = (syscall_handler_t *) sys_modify_ldt, \ @@ -38,11 +97,19 @@ typedef long syscall_handler_t(struct pt_regs); [ __NR_pivot_root ] = (syscall_handler_t *) sys_pivot_root, \ [ __NR_mincore ] = (syscall_handler_t *) sys_mincore, \ [ __NR_madvise ] = (syscall_handler_t *) sys_madvise, \ - [ 222 ] = (syscall_handler_t *) sys_ni_syscall, + [ 222 ] = (syscall_handler_t *) sys_ni_syscall, \ + [ 223 ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \ + [ 251 ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages, \ + [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \ + [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall, /* 222 doesn't yet have a name in include/asm-i386/unistd.h */ -#define LAST_ARCH_SYSCALL 222 +#define LAST_ARCH_SYSCALL __NR_vserver /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/arch/um/include/sysdep-ppc/syscalls.h b/arch/um/include/sysdep-ppc/syscalls.h index d703d0d12..679df351e 100644 --- a/arch/um/include/sysdep-ppc/syscalls.h +++ b/arch/um/include/sysdep-ppc/syscalls.h @@ -34,9 +34,12 @@ int old_mmap(unsigned long addr, unsigned long len, [ __NR_multiplexer ] = sys_ni_syscall, \ [ __NR_mmap ] = old_mmap, \ [ __NR_madvise ] = sys_madvise, \ - [ __NR_mincore ] = sys_mincore, + [ __NR_mincore ] = sys_mincore, \ + [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \ + [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, -#define LAST_ARCH_SYSCALL __NR_mincore +#define LAST_ARCH_SYSCALL __NR_fadvise64 /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/arch/um/include/sysdep-x86_64/syscalls.h b/arch/um/include/sysdep-x86_64/syscalls.h index b187a4157..65fd49442 100644 --- a/arch/um/include/sysdep-x86_64/syscalls.h +++ b/arch/um/include/sysdep-x86_64/syscalls.h @@ -71,7 +71,12 @@ extern syscall_handler_t sys_arch_prctl; [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \ [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \ [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages, \ [ __NR_semtimedop ] = (syscall_handler_t *) sys_semtimedop, \ + [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \ + [ 223 ] = (syscall_handler_t *) sys_ni_syscall, \ + [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \ + [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall, \ [ 251 ] = (syscall_handler_t *) sys_ni_syscall, #define LAST_ARCH_SYSCALL 251 diff --git a/arch/um/include/ubd_user.h b/arch/um/include/ubd_user.h index 9bac59c4c..bb66517f0 100644 --- a/arch/um/include/ubd_user.h +++ b/arch/um/include/ubd_user.h @@ -7,63 +7,10 @@ #ifndef __UM_UBD_USER_H #define __UM_UBD_USER_H -#include "os.h" - -enum ubd_req { UBD_READ, UBD_WRITE, UBD_MMAP }; - -struct io_thread_req { - enum ubd_req op; - int fds[2]; - unsigned long offsets[2]; - unsigned long long offset; - unsigned long length; - char *buffer; - int sectorsize; - unsigned long sector_mask; - unsigned long long cow_offset; - unsigned long bitmap_words[2]; - int map_fd; - unsigned long long map_offset; - int error; -}; - -extern int open_ubd_file(char *file, struct openflags *openflags, - char **backing_file_out, int *bitmap_offset_out, - unsigned long *bitmap_len_out, int *data_offset_out, - int *create_cow_out); -extern int create_cow_file(char *cow_file, char *backing_file, - struct openflags flags, int sectorsize, - int alignment, int *bitmap_offset_out, - unsigned long *bitmap_len_out, - int *data_offset_out); -extern int read_cow_bitmap(int fd, void *buf, int offset, int len); -extern int read_ubd_fs(int fd, void *buffer, int len); -extern int write_ubd_fs(int fd, char *buffer, int len); +extern void ignore_sigwinch_sig(void); extern int start_io_thread(unsigned long sp, int *fds_out); -extern void do_io(struct io_thread_req *req); - -static inline int ubd_test_bit(__u64 bit, unsigned char *data) -{ - __u64 n; - int bits, off; - - bits = sizeof(data[0]) * 8; - n = bit / bits; - off = bit % bits; - return((data[n] & (1 << off)) != 0); -} - -static inline void ubd_set_bit(__u64 bit, unsigned char *data) -{ - __u64 n; - int bits, off; - - bits = sizeof(data[0]) * 8; - n = bit / bits; - off = bit % bits; - data[n] |= (1 << off); -} - +extern int io_thread(void *arg); +extern int kernel_fd; #endif diff --git a/arch/um/include/um_mmu.h b/arch/um/include/um_mmu.h index 3c5660ff9..5243f455f 100644 --- a/arch/um/include/um_mmu.h +++ b/arch/um/include/um_mmu.h @@ -10,11 +10,11 @@ #include "choose-mode.h" #ifdef CONFIG_MODE_TT -#include "../kernel/tt/include/mmu.h" +#include "mmu-tt.h" #endif #ifdef CONFIG_MODE_SKAS -#include "../kernel/skas/include/mmu.h" +#include "mmu-skas.h" #endif typedef union { diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h index c9b3574c6..4eb302cbf 100644 --- a/arch/um/include/um_uaccess.h +++ b/arch/um/include/um_uaccess.h @@ -10,29 +10,29 @@ #include "choose-mode.h" #ifdef CONFIG_MODE_TT -#include "../kernel/tt/include/uaccess.h" +#include "uaccess-tt.h" #endif #ifdef CONFIG_MODE_SKAS -#include "../kernel/skas/include/uaccess.h" +#include "uaccess-skas.h" #endif #define access_ok(type, addr, size) \ CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size) -static inline int verify_area(int type, const void * addr, unsigned long size) +static inline int verify_area(int type, const void __user *addr, unsigned long size) { - return(CHOOSE_MODE_PROC(verify_area_tt, verify_area_skas, type, addr, + return (CHOOSE_MODE_PROC(verify_area_tt, verify_area_skas, type, addr, size)); } -static inline int copy_from_user(void *to, const void *from, int n) +static inline int copy_from_user(void *to, const void __user *from, int n) { return(CHOOSE_MODE_PROC(copy_from_user_tt, copy_from_user_skas, to, from, n)); } -static inline int copy_to_user(void *to, const void *from, int n) +static inline int copy_to_user(void __user *to, const void *from, int n) { return(CHOOSE_MODE_PROC(copy_to_user_tt, copy_to_user_skas, to, from, n)); @@ -57,7 +57,7 @@ static inline int copy_to_user(void *to, const void *from, int n) * and returns @count. */ -static inline int strncpy_from_user(char *dst, const char *src, int count) +static inline int strncpy_from_user(char *dst, const char __user *src, int count) { return(CHOOSE_MODE_PROC(strncpy_from_user_tt, strncpy_from_user_skas, dst, src, count)); @@ -89,7 +89,7 @@ static inline int __clear_user(void *mem, int len) * Returns number of bytes that could not be cleared. * On success, this will be zero. */ -static inline int clear_user(void *mem, int len) +static inline int clear_user(void __user *mem, int len) { return(CHOOSE_MODE_PROC(clear_user_tt, clear_user_skas, mem, len)); } @@ -105,7 +105,7 @@ static inline int clear_user(void *mem, int len) * On exception, returns 0. * If the string is too long, returns a value greater than @n. */ -static inline int strnlen_user(const void *str, int len) +static inline int strnlen_user(const void __user *str, long len) { return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len)); } diff --git a/arch/um/include/uml_uaccess.h b/arch/um/include/uml_uaccess.h index 785ccd51b..f77eb6428 100644 --- a/arch/um/include/uml_uaccess.h +++ b/arch/um/include/uml_uaccess.h @@ -7,7 +7,7 @@ #define __UML_UACCESS_H__ extern int __do_copy_to_user(void *to, const void *from, int n, - void **fault_addr, void **fault_catcher); + void **fault_addr, void **fault_catcher); extern unsigned long __do_user_copy(void *to, const void *from, int n, void **fault_addr, void **fault_catcher, void (*op)(void *to, const void *from, diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index ab089d7a7..4fc088eb7 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h @@ -8,7 +8,7 @@ #include "sysdep/ptrace.h" -#define CATCH_EINTR(expr) while (((expr) < 0) && (errno == EINTR)) +#define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) extern int mode_tt; diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index 9fa9711ec..d3b16f2a4 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile @@ -6,7 +6,7 @@ extra-y := vmlinux.lds clean-files := vmlinux.lds.S -obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ +obj-y = checksum.o config.o exec_kern.o exitcode.o \ helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ physmem.o process.o process_kern.o ptrace.o reboot.o resource.o \ sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \ diff --git a/arch/um/kernel/checksum.c b/arch/um/kernel/checksum.c index fa50a9b81..b2fe269a6 100644 --- a/arch/um/kernel/checksum.c +++ b/arch/um/kernel/checksum.c @@ -2,17 +2,17 @@ #include "linux/errno.h" #include "linux/module.h" -extern unsigned int arch_csum_partial(const char *buff, int len, int sum); +unsigned int arch_csum_partial(const unsigned char *buff, int len, int sum); -extern unsigned int csum_partial(char *buff, int len, int sum) +unsigned int csum_partial(unsigned char *buff, int len, int sum) { - return(arch_csum_partial(buff, len, sum)); + return arch_csum_partial(buff, len, sum); } EXPORT_SYMBOL(csum_partial); -unsigned int csum_partial_copy_to(const char *src, char *dst, int len, - int sum, int *err_ptr) +unsigned int csum_partial_copy_to(const unsigned char *src, char __user *dst, + int len, int sum, int *err_ptr) { if(copy_to_user(dst, src, len)){ *err_ptr = -EFAULT; @@ -22,15 +22,15 @@ unsigned int csum_partial_copy_to(const char *src, char *dst, int len, return(arch_csum_partial(src, len, sum)); } -unsigned int csum_partial_copy_from(const char *src, char *dst, int len, - int sum, int *err_ptr) +unsigned int csum_partial_copy_from(const unsigned char __user *src, char *dst, + int len, int sum, int *err_ptr) { if(copy_from_user(dst, src, len)){ *err_ptr = -EFAULT; return(-1); } - return(arch_csum_partial(dst, len, sum)); + return arch_csum_partial(dst, len, sum); } /* diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S index ee1642119..715b0838a 100644 --- a/arch/um/kernel/dyn.lds.S +++ b/arch/um/kernel/dyn.lds.S @@ -7,8 +7,11 @@ jiffies = jiffies_64; SECTIONS { + PROVIDE (__executable_start = START); . = START + SIZEOF_HEADERS; .interp : { *(.interp) } + /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start + * is remapped.*/ __binary_start = .; . = ALIGN(4096); /* Init code and data */ _stext = .; @@ -59,6 +62,8 @@ SECTIONS .text : { *(.text) SCHED_TEXT + LOCK_TEXT + *(.fixup) *(.stub .text.* .gnu.linkonce.t.*) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) diff --git a/arch/um/kernel/exec_kern.c b/arch/um/kernel/exec_kern.c index a5f21283d..49ddabe69 100644 --- a/arch/um/kernel/exec_kern.c +++ b/arch/um/kernel/exec_kern.c @@ -34,38 +34,42 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) extern void log_exec(char **argv, void *tty); -static int execve1(char *file, char **argv, char **env) +static long execve1(char *file, char __user * __user *argv, + char *__user __user *env) { - int error; + long error; #ifdef CONFIG_TTY_LOG log_exec(argv, current->tty); #endif error = do_execve(file, argv, env, ¤t->thread.regs); if (error == 0){ + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); set_cmdline(current_cmd()); } return(error); } -int um_execve(char *file, char **argv, char **env) +long um_execve(char *file, char __user *__user *argv, char __user *__user *env) { - int err; + long err; err = execve1(file, argv, env); - if(!err) + if(!err) do_longjmp(current->thread.exec_buf, 1); return(err); } -int sys_execve(char *file, char **argv, char **env) +long sys_execve(char *file, char __user *__user *argv, + char __user *__user *env) { - int error; + long error; char *filename; lock_kernel(); - filename = getname((char *) file); + filename = getname((char __user *) file); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; error = execve1(filename, argv, env); diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c index 14a748e2e..0ea87f24b 100644 --- a/arch/um/kernel/exitcode.c +++ b/arch/um/kernel/exitcode.c @@ -27,7 +27,7 @@ static int read_proc_exitcode(char *page, char **start, off_t off, return(len); } -static int write_proc_exitcode(struct file *file, const char *buffer, +static int write_proc_exitcode(struct file *file, const char __user *buffer, unsigned long count, void *data) { char *end, buf[sizeof("nnnnn\0")]; diff --git a/arch/um/kernel/helper.c b/arch/um/kernel/helper.c index 0e3d409d9..13b1f5c2f 100644 --- a/arch/um/kernel/helper.c +++ b/arch/um/kernel/helper.c @@ -49,14 +49,14 @@ static int helper_child(void *arg) return(0); } -/* XXX The alloc_stack here breaks if this is called in the tracing thread */ - +/* Returns either the pid of the child process we run or -E* on failure. + * XXX The alloc_stack here breaks if this is called in the tracing thread */ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, unsigned long *stack_out) { struct helper_data data; unsigned long stack, sp; - int pid, fds[2], err, n; + int pid, fds[2], ret, n; if((stack_out != NULL) && (*stack_out != 0)) stack = *stack_out; @@ -64,16 +64,16 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, if(stack == 0) return(-ENOMEM); - err = os_pipe(fds, 1, 0); - if(err < 0){ - printk("run_helper : pipe failed, err = %d\n", -err); + ret = os_pipe(fds, 1, 0); + if(ret < 0){ + printk("run_helper : pipe failed, ret = %d\n", -ret); goto out_free; } - err = os_set_exec_close(fds[1], 1); - if(err < 0){ - printk("run_helper : setting FD_CLOEXEC failed, err = %d\n", - -err); + ret = os_set_exec_close(fds[1], 1); + if(ret < 0){ + printk("run_helper : setting FD_CLOEXEC failed, ret = %d\n", + -ret); goto out_close; } @@ -85,34 +85,36 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data); if(pid < 0){ printk("run_helper : clone failed, errno = %d\n", errno); - err = -errno; + ret = -errno; goto out_close; } os_close_file(fds[1]); - n = os_read_file(fds[0], &err, sizeof(err)); + fds[1] = -1; + + /*Read the errno value from the child.*/ + n = os_read_file(fds[0], &ret, sizeof(ret)); if(n < 0){ - printk("run_helper : read on pipe failed, err = %d\n", -n); - err = n; - goto out_kill; + printk("run_helper : read on pipe failed, ret = %d\n", -n); + ret = n; + os_kill_process(pid, 1); } else if(n != 0){ CATCH_EINTR(n = waitpid(pid, NULL, 0)); - pid = -errno; + ret = -errno; + } else { + ret = pid; } - if(stack_out == NULL) free_stack(stack, 0); - else *stack_out = stack; - return(pid); - - out_kill: - os_kill_process(pid, 1); - out_close: +out_close: + if (fds[1] != -1) + os_close_file(fds[1]); os_close_file(fds[0]); - os_close_file(fds[1]); - out_free: - free_stack(stack, 0); - return(err); +out_free: + if(stack_out == NULL) + free_stack(stack, 0); + else *stack_out = stack; + return(ret); } int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, @@ -143,7 +145,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, "0x%x\n", status); free_stack(stack, stack_order); } - else *stack_out = stack; + else *stack_out = stack; return(pid); } diff --git a/arch/um/kernel/initrd_user.c b/arch/um/kernel/initrd_user.c index 57d5b41db..cb90681e1 100644 --- a/arch/um/kernel/initrd_user.c +++ b/arch/um/kernel/initrd_user.c @@ -29,6 +29,8 @@ int load_initrd(char *filename, void *buf, int size) filename, -n); return(-1); } + + os_close_file(fd); return(0); } diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 2b8250955..d71e8f008 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -32,58 +32,6 @@ #include "irq_user.h" #include "irq_kern.h" -static void register_irq_proc (unsigned int irq); - -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -/* - * Generic no controller code - */ - -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) -{ -/* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. - */ -#ifdef CONFIG_X86 - printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq); -#ifdef CONFIG_X86_LOCAL_APIC - /* - * Currently unexpected vectors happen only on SMP and APIC. - * We _must_ ack these because every local APIC has only N - * irq slots per priority level, and a 'hanging, unacked' IRQ - * holds up an irq slot - in excessive cases (when multiple - * unexpected vectors occur) that might lock up the APIC - * completely. - */ - ack_APIC_irq(); -#endif -#endif -} - -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none - -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; /* * Generic, controller-independent functions: @@ -97,9 +45,8 @@ int show_interrupts(struct seq_file *p, void *v) if (i == 0) { seq_printf(p, " "); - for (j=0; jtypename); seq_printf(p, " %s", action->name); @@ -126,306 +72,25 @@ int show_interrupts(struct seq_file *p, void *v) skip: spin_unlock_irqrestore(&irq_desc[i].lock, flags); } else if (i == NR_IRQS) { - seq_printf(p, "NMI: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", nmi_count(j)); seq_putc(p, '\n'); } return 0; } -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, - struct irqaction * action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret, retval = 0; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - retval |= ret; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - - local_irq_disable(); - - return retval; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function may be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -#ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - /* is there anything to synchronize with? */ - if (!irq_desc[irq].action) - return; - - while (irq_desc[irq].status & IRQ_INPROGRESS) - cpu_relax(); -} -#endif - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables of an interrupt - * stack. That is for two disables you need two enables. This - * function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - disable_irq_nosync(irq); - synchronize_irq(irq); -} - -/** - * enable_irq - enable interrupt handling on an irq - * @irq: Interrupt to enable - * - * Re-enables the processing of interrupts on this IRQ line - * providing no disable_irq calls are now in effect. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk(KERN_ERR "enable_irq() unbalanced from %p\n", - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific * handlers). */ unsigned int do_IRQ(int irq, union uml_pt_regs *regs) -{ - /* - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; - unsigned int status; - - irq_enter(); - kstat_this_cpu.irqs[irq]++; - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ - - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (!action) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - spin_unlock(&desc->lock); - handle_IRQ_event(irq, (struct pt_regs *) regs, action); - spin_lock(&desc->lock); - - if (!(desc->status & IRQ_PENDING)) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - desc->handler->end(irq); - spin_unlock(&desc->lock); - - irq_exit(); - - return 1; -} - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) { - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk(KERN_ERR "Bad boy: %s (at 0x%x) called us " - "without a dev_id!\n", devname, (&irq)[-1]); - } -#endif - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; + irq_enter(); + __do_IRQ(irq, (struct pt_regs *) regs); + irq_exit(); + return 1; } -EXPORT_SYMBOL(request_irq); - int um_request_irq(unsigned int irq, int fd, int type, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, @@ -444,223 +109,7 @@ int um_request_irq(unsigned int irq, int fd, int type, EXPORT_SYMBOL(um_request_irq); EXPORT_SYMBOL(reactivate_fd); -/* this was setup_x86_irq but it seems pretty generic */ -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_desc + irq; - - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - old = *p; - if (old != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~IRQ_DISABLED; - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function may be called from interrupt context. - * - * Bugs: Attempting to free an irq in a handler for the same irq hangs - * the machine. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - free_irq_by_irq_and_dev(irq, dev_id); - spin_unlock_irqrestore(&desc->lock,flags); - - /* Wait to make sure it's not being used on another CPU */ - synchronize_irq(irq); - kfree(action); - return; - } - printk(KERN_ERR "Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - -/* These are initialized by sysctl_init, which is called from init/main.c */ -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; - -/* These are read and written as longs, so a read won't see a partial write - * even during a race. - */ -static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; - -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, const char *buffer, - unsigned long count, void *data) -{ - int irq = (long) data, full_count = count, err; - cpumask_t new_value; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - if(err) - return(err); - -#ifdef CONFIG_SMP - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - { cpumask_t tmp; - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - } -#endif - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, new_value); - - return full_count; -} - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - struct proc_dir_entry *entry; - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || - irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - - smp_affinity_entry[irq] = entry; -} - -void __init init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", 0); - - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) - register_irq_proc(i); -} - -static spinlock_t irq_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_spinlock); unsigned long irq_lock(void) { @@ -675,90 +124,27 @@ void irq_unlock(unsigned long flags) spin_unlock_irqrestore(&irq_spinlock, flags); } -unsigned long probe_irq_on(void) -{ - return(0); -} - -EXPORT_SYMBOL(probe_irq_on); - -int probe_irq_off(unsigned long val) -{ - return(0); -} - -EXPORT_SYMBOL(probe_irq_off); - -static unsigned int startup_SIGIO_irq(unsigned int irq) -{ - return(0); -} - -static void shutdown_SIGIO_irq(unsigned int irq) -{ -} - -static void enable_SIGIO_irq(unsigned int irq) -{ -} - -static void disable_SIGIO_irq(unsigned int irq) -{ -} - -static void mask_and_ack_SIGIO(unsigned int irq) -{ -} - -static void end_SIGIO_irq(unsigned int irq) -{ -} - -static unsigned int startup_SIGVTALRM_irq(unsigned int irq) -{ - return(0); -} - -static void shutdown_SIGVTALRM_irq(unsigned int irq) -{ -} - -static void enable_SIGVTALRM_irq(unsigned int irq) -{ -} - -static void disable_SIGVTALRM_irq(unsigned int irq) -{ -} - -static void mask_and_ack_SIGVTALRM(unsigned int irq) -{ -} - -static void end_SIGVTALRM_irq(unsigned int irq) +/* presently hw_interrupt_type must define (startup || enable) && + * disable && end */ +static void dummy(unsigned int irq) { } static struct hw_interrupt_type SIGIO_irq_type = { - "SIGIO", - startup_SIGIO_irq, - shutdown_SIGIO_irq, - enable_SIGIO_irq, - disable_SIGIO_irq, - mask_and_ack_SIGIO, - end_SIGIO_irq, - NULL + .typename = "SIGIO", + .disable = dummy, + .enable = dummy, + .ack = dummy, + .end = dummy }; static struct hw_interrupt_type SIGVTALRM_irq_type = { - "SIGVTALRM", - startup_SIGVTALRM_irq, - shutdown_SIGVTALRM_irq, - enable_SIGVTALRM_irq, - disable_SIGVTALRM_irq, - mask_and_ack_SIGVTALRM, - end_SIGVTALRM_irq, - NULL + .typename = "SIGVTALRM", + .shutdown = dummy, /* never called */ + .disable = dummy, + .enable = dummy, + .ack = dummy, + .end = dummy }; void __init init_IRQ(void) @@ -766,13 +152,13 @@ void __init init_IRQ(void) int i; irq_desc[TIMER_IRQ].status = IRQ_DISABLED; - irq_desc[TIMER_IRQ].action = 0; + irq_desc[TIMER_IRQ].action = NULL; irq_desc[TIMER_IRQ].depth = 1; irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type; enable_irq(TIMER_IRQ); for(i=1;inext; - if(irq_fd->freed) + if(irq_fd->freed){ free_irq(irq_fd->irq, irq_fd->id); + free_irq_by_irq_and_dev(irq_fd->irq, + irq_fd->id); + } } } } @@ -263,7 +266,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) return((irq->irq == data->irq) && (irq->id == data->dev)); } -void free_irq_by_irq_and_dev(int irq, void *dev) +void free_irq_by_irq_and_dev(unsigned int irq, void *dev) { struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq, .dev = dev }); @@ -374,6 +377,8 @@ int deactivate_all_fds(void) if(err) return(err); } + /* If there is a signal already queued, after unblocking ignore it */ + set_handler(SIGIO, SIG_IGN, 0, -1); return(0); } diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index a867e18c6..b41d3397d 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c @@ -48,6 +48,7 @@ EXPORT_SYMBOL(to_virt); EXPORT_SYMBOL(mode_tt); EXPORT_SYMBOL(handle_page_fault); EXPORT_SYMBOL(find_iomem); +EXPORT_SYMBOL(end_iomem); #ifdef CONFIG_MODE_TT EXPORT_SYMBOL(strncpy_from_user_tt); diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c index e1fd2c583..a17c49703 100644 --- a/arch/um/kernel/main.c +++ b/arch/um/kernel/main.c @@ -17,11 +17,16 @@ #include "kern_util.h" #include "mem_user.h" #include "signal_user.h" +#include "time_user.h" +#include "irq_user.h" #include "user.h" #include "init.h" #include "mode.h" #include "choose-mode.h" #include "uml-config.h" +#include "irq_user.h" +#include "time_user.h" +#include "os.h" /* Set in set_stklim, which is called from main and __wrap_malloc. * __wrap_malloc only calls it if main hasn't started. @@ -76,6 +81,8 @@ static void last_ditch_exit(int sig) extern int uml_exitcode; +extern void scan_elf_aux( char **envp); + int main(int argc, char **argv, char **envp) { char **new_argv; @@ -142,26 +149,38 @@ int main(int argc, char **argv, char **envp) set_handler(SIGTERM, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); set_handler(SIGHUP, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); + scan_elf_aux( envp); + do_uml_initcalls(); ret = linux_main(argc, argv); + /* Disable SIGPROF - I have no idea why libc doesn't do this or turn + * off the profiling time, but UML dies with a SIGPROF just before + * exiting when profiling is active. + */ + change_sig(SIGPROF, 0); + /* Reboot */ if(ret){ int err; printf("\n"); - /* Let any pending signals fire, then disable them. This - * ensures that they won't be delivered after the exec, when - * they are definitely not expected. - */ - unblock_signals(); + /* stop timers and set SIG*ALRM to be ignored */ disable_timer(); + + /* disable SIGIO for the fds and set SIGIO to be ignored */ err = deactivate_all_fds(); if(err) printf("deactivate_all_fds failed, errno = %d\n", -err); + /* Let any pending signals fire now. This ensures + * that they won't be delivered after the exec, when + * they are definitely not expected. + */ + unblock_signals(); + execvp(new_argv[0], new_argv); perror("Failed to exec kernel"); ret = 1; @@ -171,7 +190,7 @@ int main(int argc, char **argv, char **envp) } #define CAN_KMALLOC() \ - (kmalloc_ok && CHOOSE_MODE((getpid() != tracing_pid), 1)) + (kmalloc_ok && CHOOSE_MODE((os_getpid() != tracing_pid), 1)) extern void *__real_malloc(int); @@ -217,13 +236,16 @@ void __wrap_free(void *ptr) * physical memory - kmalloc/kfree * kernel virtual memory - vmalloc/vfree * anywhere else - malloc/free - * If kmalloc is not yet possible, then the kernel memory regions - * may not be set up yet, and the variables not initialized. So, - * free is called. + * If kmalloc is not yet possible, then either high_physmem and/or + * end_vm are still 0 (as at startup), in which case we call free, or + * we have set them, but anyway addr has not been allocated from those + * areas. So, in both cases __real_free is called. * * CAN_KMALLOC is checked because it would be bad to free a buffer * with kmalloc/vmalloc after they have been turned off during * shutdown. + * XXX: However, we sometimes shutdown CAN_KMALLOC temporarily, so + * there is a possibility for memory leaks. */ if((addr >= uml_physmem) && (addr < high_physmem)){ diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 09add571c..7a69ef0ae 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -25,7 +25,7 @@ extern char __binary_start; /* Changed during early boot */ unsigned long *empty_zero_page = NULL; unsigned long *empty_bad_page = NULL; -pgd_t swapper_pg_dir[1024]; +pgd_t swapper_pg_dir[PTRS_PER_PGD]; unsigned long highmem; int kmalloc_ok = 0; @@ -49,8 +49,6 @@ static void setup_highmem(unsigned long highmem_start, unsigned long highmem_pfn; int i; - highmem_start_page = virt_to_page(highmem_start); - highmem_pfn = __pa(highmem_start) >> PAGE_SHIFT; for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){ page = &mem_map[highmem_pfn + i]; @@ -67,9 +65,6 @@ void mem_init(void) unsigned long start; max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; -#ifdef CONFIG_HIGHMEM - highmem_start_page = phys_page(__pa(high_physmem)); -#endif /* clear the zero-page */ memset((void *) empty_zero_page, 0, PAGE_SIZE); @@ -84,7 +79,7 @@ void mem_init(void) uml_reserved = brk_end; /* Fill in any hole at the start of the binary */ - start = (unsigned long) &__binary_start; + start = (unsigned long) &__binary_start & PAGE_MASK; if(uml_physmem != start){ map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem, 1, 1, 0); @@ -135,12 +130,13 @@ static void __init fixrange_init(unsigned long start, unsigned long end, } } -#if CONFIG_HIGHMEM +#ifdef CONFIG_HIGHMEM pte_t *kmap_pte; pgprot_t kmap_prot; #define kmap_get_fixmap_pte(vaddr) \ - pte_offset(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) + pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\ + (vaddr)), (vaddr)) void __init kmap_init(void) { @@ -156,6 +152,7 @@ void __init kmap_init(void) static void init_highmem(void) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; unsigned long vaddr; @@ -167,7 +164,8 @@ static void init_highmem(void) fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir); pgd = swapper_pg_dir + pgd_index(vaddr); - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); pte = pte_offset_kernel(pmd, vaddr); pkmap_page_table = pte; @@ -175,6 +173,33 @@ static void init_highmem(void) } #endif /* CONFIG_HIGHMEM */ +static void __init fixaddr_user_init( void) +{ +#if CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA + long size = FIXADDR_USER_END - FIXADDR_USER_START; + pgd_t *pgd; + pud_t *pud; + pmd_t *pmd; + pte_t *pte; + unsigned long paddr, vaddr = FIXADDR_USER_START; + + if ( ! size ) + return; + + fixrange_init( FIXADDR_USER_START, FIXADDR_USER_END, swapper_pg_dir); + paddr = (unsigned long)alloc_bootmem_low_pages( size); + memcpy( (void *)paddr, (void *)FIXADDR_USER_START, size); + paddr = __pa(paddr); + for ( ; size > 0; size-=PAGE_SIZE, vaddr+=PAGE_SIZE, paddr+=PAGE_SIZE){ + pgd = swapper_pg_dir + pgd_index(vaddr); + pud = pud_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); + pte = pte_offset_kernel(pmd, vaddr); + pte_set_val( (*pte), paddr, PAGE_READONLY); + } +#endif +} + void paging_init(void) { unsigned long zones_size[MAX_NR_ZONES], vaddr; @@ -195,6 +220,8 @@ void paging_init(void) vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; fixrange_init(vaddr, FIXADDR_TOP, swapper_pg_dir); + fixaddr_user_init(); + #ifdef CONFIG_HIGHMEM init_highmem(); #endif @@ -212,7 +239,7 @@ struct page *arch_validate(struct page *page, int mask, int order) addr = (unsigned long) page_address(page); for(i = 0; i < (1 << order); i++){ current->thread.fault_addr = (void *) addr; - if(__do_copy_to_user((void *) addr, &zero, + if(__do_copy_to_user((void __user *) addr, &zero, sizeof(zero), ¤t->thread.fault_addr, ¤t->thread.fault_catcher)){ @@ -221,6 +248,7 @@ struct page *arch_validate(struct page *page, int mask, int order) } addr += PAGE_SIZE; } + if(i == (1 << order)) return(page); page = alloc_pages(mask, order); goto again; @@ -307,9 +335,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { pte_t *pte; - pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); - if (pte) - clear_page(pte); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); return pte; } @@ -317,9 +343,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { struct page *pte; - pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); - if (pte) - clear_highpage(pte); + pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); return pte; } diff --git a/arch/um/kernel/mem_user.c b/arch/um/kernel/mem_user.c index ec15ba43d..4a663fd43 100644 --- a/arch/um/kernel/mem_user.c +++ b/arch/um/kernel/mem_user.c @@ -48,8 +48,6 @@ #include "tempfile.h" #include "kern_constants.h" -extern struct mem_region physmem_region; - #define TEMPNAME_TEMPLATE "vm_file-XXXXXX" static int create_tmp_file(unsigned long len) @@ -83,6 +81,28 @@ static int create_tmp_file(unsigned long len) return(fd); } +void check_tmpexec(void) +{ + void *addr; + int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE); + + addr = mmap(NULL, UM_KERN_PAGE_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); + printf("Checking PROT_EXEC mmap in /tmp..."); + fflush(stdout); + if(addr == MAP_FAILED){ + err = errno; + perror("failed"); + if(err == EPERM) + printf("/tmp must be not mounted noexec\n"); + exit(1); + } + printf("OK\n"); + munmap(addr, UM_KERN_PAGE_SIZE); + + os_close_file(fd); +} + static int have_devanon = 0; void check_devanon(void) @@ -111,9 +131,9 @@ static int create_anon_file(unsigned long len) exit(1); } - addr = mmap(NULL, len, PROT_READ | PROT_WRITE , MAP_PRIVATE, fd, 0); + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); if(addr == MAP_FAILED){ - os_print_error((int) addr, "mapping physmem file"); + perror("mapping physmem file"); exit(1); } munmap(addr, len); @@ -208,6 +228,39 @@ int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x, return(0); } +#if 0 +/* Debugging facility for dumping stuff out to the host, avoiding the timing + * problems that come with printf and breakpoints. + * Enable in case of emergency. + */ + +int logging = 1; +int logging_fd = -1; + +int logging_line = 0; +char logging_buf[512]; + +void log(char *fmt, ...) +{ + va_list ap; + struct timeval tv; + struct openflags flags; + + if(logging == 0) return; + if(logging_fd < 0){ + flags = of_create(of_trunc(of_rdwr(OPENFLAGS()))); + logging_fd = os_open_file("log", flags, 0644); + } + gettimeofday(&tv, NULL); + sprintf(logging_buf, "%d\t %u.%u ", logging_line++, tv.tv_sec, + tv.tv_usec); + va_start(ap, fmt); + vsprintf(&logging_buf[strlen(logging_buf)], fmt, ap); + va_end(ap); + write(logging_fd, logging_buf, strlen(logging_buf)); +} +#endif + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 3253bc0e3..285302865 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -309,7 +309,7 @@ struct page *__virt_to_page(const unsigned long virt) return(&mem_map[__pa(virt) >> PAGE_SHIFT]); } -unsigned long page_to_phys(struct page *page) +phys_t page_to_phys(struct page *page) { return((page - mem_map) << PAGE_SHIFT); } @@ -318,8 +318,9 @@ pte_t mk_pte(struct page *page, pgprot_t pgprot) { pte_t pte; - pte_val(pte) = page_to_phys(page) + pgprot_val(pgprot); - if(pte_present(pte)) pte_mknewprot(pte_mknewpage(pte)); + pte_set_val(pte, page_to_phys(page), pgprot); + if(pte_present(pte)) + pte_mknewprot(pte_mknewpage(pte)); return(pte); } diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 4468f2440..7a2be31a9 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -13,13 +13,14 @@ #include #include #include + +/*Userspace header, must be after sys/ptrace.h, and both must be included. */ +#include + #include #include -#include -#include #include #include -#include #include "user_util.h" #include "kern_util.h" #include "user.h" @@ -27,6 +28,7 @@ #include "signal_kern.h" #include "signal_user.h" #include "sysdep/ptrace.h" +#include "sysdep/ptrace_user.h" #include "sysdep/sigcontext.h" #include "irq_user.h" #include "ptrace_user.h" @@ -39,6 +41,7 @@ #ifdef UML_CONFIG_MODE_SKAS #include "skas.h" #include "skas_ptrace.h" +#include "registers.h" #endif void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) @@ -137,14 +140,31 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack, static int ptrace_child(void *arg) { - int pid = os_getpid(); + int ret; + int pid = os_getpid(), ppid = getppid(); + int sc_result; if(ptrace(PTRACE_TRACEME, 0, 0, 0) < 0){ perror("ptrace"); os_kill_process(pid, 0); } os_stop_process(pid); - _exit(os_getpid() == pid); + + /*This syscall will be intercepted by the parent. Don't call more than + * once, please.*/ + sc_result = os_getpid(); + + if (sc_result == pid) + ret = 1; /*Nothing modified by the parent, we are running + normally.*/ + else if (sc_result == ppid) + ret = 0; /*Expected in check_ptrace and check_sysemu when they + succeed in modifying the stack frame*/ + else + ret = 2; /*Serious trouble! This could be caused by a bug in + host 2.6 SKAS3/2.6 patch before release -V6, together + with a bug in the UML code itself.*/ + _exit(ret); } static int start_ptraced_child(void **stack_out) @@ -172,18 +192,36 @@ static int start_ptraced_child(void **stack_out) return(pid); } -static void stop_ptraced_child(int pid, void *stack, int exitcode) +/* When testing for SYSEMU support, if it is one of the broken versions, we must + * just avoid using sysemu, not panic, but only if SYSEMU features are broken. + * So only for SYSEMU features we test mustpanic, while normal host features + * must work anyway!*/ +static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic) { - int status, n; + int status, n, ret = 0; if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) panic("check_ptrace : ptrace failed, errno = %d", errno); CATCH_EINTR(n = waitpid(pid, &status, 0)); - if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) - panic("check_ptrace : child exited with status 0x%x", status); + if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { + int exit_with = WEXITSTATUS(status); + if (exit_with == 2) + printk("check_ptrace : child exited with status 2. " + "Serious trouble happening! Try updating your " + "host skas patch!\nDisabling SYSEMU support."); + printk("check_ptrace : child exited with exitcode %d, while " + "expecting %d; status 0x%x", exit_with, + exitcode, status); + if (mustpanic) + panic("\n"); + else + printk("\n"); + ret = -1; + } if(munmap(stack, PAGE_SIZE) < 0) panic("check_ptrace : munmap failed, errno = %d", errno); + return ret; } static int force_sysemu_disabled = 0; @@ -200,50 +238,80 @@ __uml_setup("nosysemu", nosysemu_cmd_param, " SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n" " behaviour of ptrace() and helps reducing host context switch rate.\n" " To make it working, you need a kernel patch for your host, too.\n" - " See http://perso.wanadoo.fr/laurent.vivier/UML/ for further information.\n"); + " See http://perso.wanadoo.fr/laurent.vivier/UML/ for further information.\n\n"); static void __init check_sysemu(void) { void *stack; - int pid, n, status; - - if (mode_tt) - return; + int pid, syscall, n, status, count=0; printk("Checking syscall emulation patch for ptrace..."); sysemu_supported = 0; pid = start_ptraced_child(&stack); - if(ptrace(PTRACE_SYSEMU, pid, 0, 0) >= 0) { - struct user_regs_struct regs; + if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) + goto fail; + + CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); + if (n < 0) + panic("check_sysemu : wait failed, errno = %d", errno); + if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) + panic("check_sysemu : expected SIGTRAP, " + "got status = %d", status); + + n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, + os_getpid()); + if(n < 0) + panic("check_sysemu : failed to modify system " + "call return, errno = %d", errno); + + if (stop_ptraced_child(pid, stack, 0, 0) < 0) + goto fail_stopped; + + sysemu_supported = 1; + printk("OK\n"); + set_using_sysemu(!force_sysemu_disabled); + + printk("Checking advanced syscall emulation patch for ptrace..."); + pid = start_ptraced_child(&stack); + while(1){ + count++; + if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) + goto fail; CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); - if (n < 0) + if(n < 0) panic("check_ptrace : wait failed, errno = %d", errno); if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) - panic("check_ptrace : expected SIGTRAP, " + panic("check_ptrace : expected (SIGTRAP|SYSCALL_TRAP), " "got status = %d", status); - if (ptrace(PTRACE_GETREGS, pid, 0, ®s) < 0) - panic("check_ptrace : failed to read child " - "registers, errno = %d", errno); - regs.orig_eax = pid; - if (ptrace(PTRACE_SETREGS, pid, 0, ®s) < 0) - panic("check_ptrace : failed to modify child " - "registers, errno = %d", errno); + syscall = ptrace(PTRACE_PEEKUSER, pid, PT_SYSCALL_NR_OFFSET, + 0); + if(syscall == __NR_getpid){ + if (!count) + panic("check_ptrace : SYSEMU_SINGLESTEP doesn't singlestep"); + n = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_RET_OFFSET, + os_getpid()); + if(n < 0) + panic("check_sysemu : failed to modify system " + "call return, errno = %d", errno); + break; + } + } + if (stop_ptraced_child(pid, stack, 0, 0) < 0) + goto fail_stopped; - stop_ptraced_child(pid, stack, 0); + sysemu_supported = 2; + printk("OK\n"); - sysemu_supported = 1; - printk("found\n"); - } - else - { - stop_ptraced_child(pid, stack, 1); - sysemu_supported = 0; - printk("missing\n"); - } + if ( !force_sysemu_disabled ) + set_using_sysemu(sysemu_supported); + return; - set_using_sysemu(!force_sysemu_disabled); +fail: + stop_ptraced_child(pid, stack, 1, 0); +fail_stopped: + printk("missing\n"); } void __init check_ptrace(void) @@ -254,6 +322,9 @@ void __init check_ptrace(void) printk("Checking that ptrace can change system call numbers..."); pid = start_ptraced_child(&stack); + if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) + panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno); + while(1){ if(ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) panic("check_ptrace : ptrace failed, errno = %d", @@ -261,8 +332,8 @@ void __init check_ptrace(void) CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); if(n < 0) panic("check_ptrace : wait failed, errno = %d", errno); - if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) - panic("check_ptrace : expected SIGTRAP, " + if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP + 0x80)) + panic("check_ptrace : expected SIGTRAP + 0x80, " "got status = %d", status); syscall = ptrace(PTRACE_PEEKUSER, pid, PT_SYSCALL_NR_OFFSET, @@ -276,7 +347,7 @@ void __init check_ptrace(void) break; } } - stop_ptraced_child(pid, stack, 0); + stop_ptraced_child(pid, stack, 0, 1); printk("OK\n"); check_sysemu(); } @@ -304,9 +375,9 @@ void forward_pending_sigio(int target) kill(target, SIGIO); } -int can_do_skas(void) -{ #ifdef UML_CONFIG_MODE_SKAS +static inline int check_skas3_ptrace_support(void) +{ struct ptrace_faultinfo fi; void *stack; int pid, n, ret = 1; @@ -315,37 +386,43 @@ int can_do_skas(void) pid = start_ptraced_child(&stack); n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); - if(n < 0){ + if (n < 0) { if(errno == EIO) printf("not found\n"); - else printf("No (unexpected errno - %d)\n", errno); + else { + perror("not found"); + } ret = 0; + } else { + printf("found\n"); } - else printf("found\n"); init_registers(pid); - stop_ptraced_child(pid, stack, 1); + stop_ptraced_child(pid, stack, 1, 1); + + return(ret); +} + +int can_do_skas(void) +{ + int ret = 1; printf("Checking for /proc/mm..."); - if(os_access("/proc/mm", OS_ACC_W_OK) < 0){ + if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { printf("not found\n"); ret = 0; + goto out; + } else { + printf("found\n"); } - else printf("found\n"); - return(ret); + ret = check_skas3_ptrace_support(); +out: + return ret; +} #else +int can_do_skas(void) +{ return(0); -#endif } - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ +#endif diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index c571d5fcf..e4d400b2d 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Licensed under the GPL */ @@ -18,6 +19,8 @@ #include "linux/capability.h" #include "linux/vmalloc.h" #include "linux/spinlock.h" +#include "linux/proc_fs.h" +#include "linux/ptrace.h" #include "linux/vs_cvirt.h" #include "asm/unistd.h" @@ -140,7 +143,7 @@ void *_switch_to(void *prev, void *next, void *last) void interrupt_end(void) { if(need_resched()) schedule(); - if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal(0); + if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal(); } void release_thread(struct task_struct *task) @@ -208,7 +211,6 @@ void default_idle(void) * although we are an idle CPU, we do not want to * get into the scheduler unnecessarily. */ - irq_stat[smp_processor_id()].idle_timestamp = jiffies; if(need_resched()) schedule(); @@ -226,7 +228,7 @@ int page_size(void) return(PAGE_SIZE); } -int page_mask(void) +unsigned long page_mask(void) { return(PAGE_MASK); } @@ -235,18 +237,28 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr, pte_t *pte_out) { pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; if(task->mm == NULL) return(ERR_PTR(-EINVAL)); pgd = pgd_offset(task->mm, addr); - pmd = pmd_offset(pgd, addr); + if(!pgd_present(*pgd)) + return(ERR_PTR(-EINVAL)); + + pud = pud_offset(pgd, addr); + if(!pud_present(*pud)) + return(ERR_PTR(-EINVAL)); + + pmd = pmd_offset(pud, addr); if(!pmd_present(*pmd)) return(ERR_PTR(-EINVAL)); + pte = pte_offset_kernel(pmd, addr); if(!pte_present(*pte)) return(ERR_PTR(-EINVAL)); + if(pte_out != NULL) *pte_out = *pte; return((void *) (pte_val(*pte) & PAGE_MASK) + (addr & ~PAGE_MASK)); @@ -291,8 +303,6 @@ void disable_hlt(void) EXPORT_SYMBOL(disable_hlt); -extern int signal_frame_size; - void *um_kmalloc(int size) { return(kmalloc(size, GFP_KERNEL)); @@ -360,22 +370,22 @@ void *get_init_task(void) return(&init_thread_union.thread_info.task); } -int copy_to_user_proc(void *to, void *from, int size) +int copy_to_user_proc(void __user *to, void *from, int size) { return(copy_to_user(to, from, size)); } -int copy_from_user_proc(void *to, void *from, int size) +int copy_from_user_proc(void *to, void __user *from, int size) { return(copy_from_user(to, from, size)); } -int clear_user_proc(void *buf, int size) +int clear_user_proc(void __user *buf, int size) { return(clear_user(buf, size)); } -int strlen_user_proc(char *str) +int strlen_user_proc(char __user *str) { return(strlen_user(str)); } @@ -401,6 +411,76 @@ int cpu(void) return(current_thread->cpu); } +static atomic_t using_sysemu = ATOMIC_INIT(0); +int sysemu_supported; + +void set_using_sysemu(int value) +{ + if (value > sysemu_supported) + return; + atomic_set(&using_sysemu, value); +} + +int get_using_sysemu(void) +{ + return atomic_read(&using_sysemu); +} + +static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int *eof, void *data) +{ + if (snprintf(buf, size, "%d\n", get_using_sysemu()) < size) /*No overflow*/ + *eof = 1; + + return strlen(buf); +} + +static int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data) +{ + char tmp[2]; + + if (copy_from_user(tmp, buf, 1)) + return -EFAULT; + + if (tmp[0] >= '0' && tmp[0] <= '2') + set_using_sysemu(tmp[0] - '0'); + return count; /*We use the first char, but pretend to write everything*/ +} + +int __init make_proc_sysemu(void) +{ + struct proc_dir_entry *ent; + if (!sysemu_supported) + return 0; + + ent = create_proc_entry("sysemu", 0600, &proc_root); + + if (ent == NULL) + { + printk("Failed to register /proc/sysemu\n"); + return(0); + } + + ent->read_proc = proc_read_sysemu; + ent->write_proc = proc_write_sysemu; + + return 0; +} + +late_initcall(make_proc_sysemu); + +int singlestepping(void * t) +{ + struct task_struct *task = t ? t : current; + + if ( ! (task->ptrace & PT_DTRACE) ) + return(0); + + if (task->thread.singlestep_syscall) + return(1); + + return 2; +} + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 0005a9b84..033202989 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c @@ -16,15 +16,18 @@ #include "asm/uaccess.h" #include "kern_util.h" #include "ptrace_user.h" +#include "skas_ptrace.h" /* * Called by kernel/ptrace.c when detaching.. */ void ptrace_disable(struct task_struct *child) { + child->ptrace &= ~PT_DTRACE; + child->thread.singlestep_syscall = 0; } -int sys_ptrace(long request, long pid, long addr, long data) +long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int i, ret; @@ -80,7 +83,7 @@ int sys_ptrace(long request, long pid, long addr, long data) copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); if (copied != sizeof(tmp)) break; - ret = put_user(tmp,(unsigned long *) data); + ret = put_user(tmp, (unsigned long __user *) data); break; } @@ -93,7 +96,7 @@ int sys_ptrace(long request, long pid, long addr, long data) break; tmp = 0; /* Default return condition */ - if(addr < FRAME_SIZE_OFFSET){ + if(addr < MAX_REG_OFFSET){ tmp = getreg(child, addr); } else if((addr >= offsetof(struct user, u_debugreg[0])) && @@ -102,7 +105,7 @@ int sys_ptrace(long request, long pid, long addr, long data) addr = addr >> 2; tmp = child->thread.arch.debugregs[addr]; } - ret = put_user(tmp, (unsigned long *) data); + ret = put_user(tmp, (unsigned long __user *) data); break; } @@ -121,10 +124,11 @@ int sys_ptrace(long request, long pid, long addr, long data) if ((addr & 3) || addr < 0) break; - if (addr < FRAME_SIZE_OFFSET) { + if (addr < MAX_REG_OFFSET) { ret = putreg(child, addr, data); break; } +#if 0 /* XXX x86_64 */ else if((addr >= offsetof(struct user, u_debugreg[0])) && (addr <= offsetof(struct user, u_debugreg[7]))){ addr -= offsetof(struct user, u_debugreg[0]); @@ -133,6 +137,7 @@ int sys_ptrace(long request, long pid, long addr, long data) child->thread.arch.debugregs[addr] = data; ret = 0; } +#endif break; @@ -141,6 +146,9 @@ int sys_ptrace(long request, long pid, long addr, long data) ret = -EIO; if ((unsigned long) data > _NSIG) break; + + child->ptrace &= ~PT_DTRACE; + child->thread.singlestep_syscall = 0; if (request == PTRACE_SYSCALL) { set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); } @@ -160,8 +168,11 @@ int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: { ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; + + child->ptrace &= ~PT_DTRACE; + child->thread.singlestep_syscall = 0; child->exit_code = SIGKILL; wake_up_process(child); break; @@ -173,6 +184,7 @@ int sys_ptrace(long request, long pid, long addr, long data) break; clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->ptrace |= PT_DTRACE; + child->thread.singlestep_syscall = 0; child->exit_code = data; /* give it a chance to run. */ wake_up_process(child); @@ -188,12 +200,13 @@ int sys_ptrace(long request, long pid, long addr, long data) #ifdef PTRACE_GETREGS case PTRACE_GETREGS: { /* Get all gp regs from the child. */ if (!access_ok(VERIFY_WRITE, (unsigned long *)data, - FRAME_SIZE_OFFSET)) { + MAX_REG_OFFSET)) { ret = -EIO; break; } - for ( i = 0; i < FRAME_SIZE_OFFSET; i += sizeof(long) ) { - __put_user(getreg(child, i), (unsigned long *) data); + for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) { + __put_user(getreg(child, i), + (unsigned long __user *) data); data += sizeof(long); } ret = 0; @@ -204,12 +217,12 @@ int sys_ptrace(long request, long pid, long addr, long data) case PTRACE_SETREGS: { /* Set all gp regs in the child. */ unsigned long tmp = 0; if (!access_ok(VERIFY_READ, (unsigned *)data, - FRAME_SIZE_OFFSET)) { + MAX_REG_OFFSET)) { ret = -EIO; break; } - for ( i = 0; i < FRAME_SIZE_OFFSET; i += sizeof(long) ) { - __get_user(tmp, (unsigned long *) data); + for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) { + __get_user(tmp, (unsigned long __user *) data); putreg(child, i, tmp); data += sizeof(long); } @@ -243,14 +256,14 @@ int sys_ptrace(long request, long pid, long addr, long data) fault = ((struct ptrace_faultinfo) { .is_write = child->thread.err, .addr = child->thread.cr2 }); - ret = copy_to_user((unsigned long *) data, &fault, + ret = copy_to_user((unsigned long __user *) data, &fault, sizeof(fault)); if(ret) break; break; } case PTRACE_SIGPENDING: - ret = copy_to_user((unsigned long *) data, + ret = copy_to_user((unsigned long __user *) data, &child->pending.signal, sizeof(child->pending.signal)); break; @@ -258,7 +271,7 @@ int sys_ptrace(long request, long pid, long addr, long data) case PTRACE_LDT: { struct ptrace_ldt ldt; - if(copy_from_user(&ldt, (unsigned long *) data, + if(copy_from_user(&ldt, (unsigned long __user *) data, sizeof(ldt))){ ret = -EIO; break; @@ -299,8 +312,30 @@ int sys_ptrace(long request, long pid, long addr, long data) return ret; } +void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, + int error_code) +{ + struct siginfo info; + + memset(&info, 0, sizeof(info)); + info.si_signo = SIGTRAP; + info.si_code = TRAP_BRKPT; + + /* User-mode eip? */ + info.si_addr = UPT_IS_USER(regs) ? (void __user *) UPT_IP(regs) : NULL; + + /* Send us the fakey SIGTRAP */ + force_sig_info(SIGTRAP, &info, tsk); +} + +/* XXX Check PT_DTRACE vs TIF_SINGLESTEP for singlestepping check and + * PT_PTRACED vs TIF_SYSCALL_TRACE for syscall tracing check + */ void syscall_trace(union uml_pt_regs *regs, int entryexit) { + int is_singlestep = (current->ptrace & PT_DTRACE) && entryexit; + int tracesysgood; + if (unlikely(current->audit_context)) { if (!entryexit) audit_syscall_entry(current, regs->orig_eax, @@ -310,18 +345,25 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit) audit_syscall_exit(current, regs->eax); } + /* Fake a debug trap */ + if (is_singlestep) + send_sigtrap(current, regs, 0); + if (!test_thread_flag(TIF_SYSCALL_TRACE)) return; + if (!(current->ptrace & PT_PTRACED)) return; /* the 0x80 provides a way for the tracing parent to distinguish between a syscall stop and SIGTRAP delivery */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) - ? 0x80 : 0)); + tracesysgood = (current->ptrace & PT_TRACESYSGOOD); + ptrace_notify(SIGTRAP | (tracesysgood ? 0x80 : 0)); + + if (entryexit) /* force do_signal() --> is_syscall() */ + set_thread_flag(TIF_SIGPENDING); - /* - * this isn't the same as continuing with a signal, but it will do + /* this isn't the same as continuing with a signal, but it will do * for normal use. strace only continues with a signal if the * stopping signal is not SIGTRAP. -brl */ diff --git a/arch/um/kernel/sigio_kern.c b/arch/um/kernel/sigio_kern.c index fbffae415..229988463 100644 --- a/arch/um/kernel/sigio_kern.c +++ b/arch/um/kernel/sigio_kern.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com) * Licensed under the GPL */ @@ -28,7 +28,7 @@ int write_sigio_irq(int fd) int err; err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt, - SA_INTERRUPT | SA_SAMPLE_RANDOM, "write sigio", + SA_INTERRUPT | SA_SAMPLE_RANDOM, "write sigio", NULL); if(err){ printk("write_sigio_irq : um_request_irq failed, err = %d\n", @@ -39,7 +39,7 @@ int write_sigio_irq(int fd) return(0); } -static spinlock_t sigio_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sigio_spinlock); void sigio_lock(void) { diff --git a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal_kern.c index 23aefcbea..7807a3e8c 100644 --- a/arch/um/kernel/signal_kern.c +++ b/arch/um/kernel/signal_kern.c @@ -38,53 +38,57 @@ EXPORT_SYMBOL(unblock_signals); /* * OK, we're invoking a handler */ -static int handle_signal(struct pt_regs *regs, unsigned long signr, - struct k_sigaction *ka, siginfo_t *info, - sigset_t *oldset, int error) +static int handle_signal(struct pt_regs *regs, unsigned long signr, + struct k_sigaction *ka, siginfo_t *info, + sigset_t *oldset) { - __sighandler_t handler; - void (*restorer)(void); unsigned long sp; - sigset_t save; - int err, ret; + int err; - ret = 0; /* Always make any pending restarted system calls return -EINTR */ current_thread_info()->restart_block.fn = do_no_restart_syscall; - switch(error){ - case -ERESTART_RESTARTBLOCK: - case -ERESTARTNOHAND: - ret = -EINTR; - break; - case -ERESTARTSYS: - if (!(ka->sa.sa_flags & SA_RESTART)) { - ret = -EINTR; + /* Did we come from a system call? */ + if(PT_REGS_SYSCALL_NR(regs) >= 0){ + /* If so, check system call restarting.. */ + switch(PT_REGS_SYSCALL_RET(regs)){ + case -ERESTART_RESTARTBLOCK: + case -ERESTARTNOHAND: + PT_REGS_SYSCALL_RET(regs) = -EINTR; break; - } - /* fallthrough */ - case -ERESTARTNOINTR: - PT_REGS_RESTART_SYSCALL(regs); - PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs); - /* This is because of the UM_SET_SYSCALL_RETURN and the fact - * that on i386 the system call number and return value are - * in the same register. When the system call restarts, %eax - * had better have the system call number in it. Since the - * return value doesn't matter (except that it shouldn't be - * -ERESTART*), we'll stick the system call number there. - */ - ret = PT_REGS_SYSCALL_NR(regs); - break; + case -ERESTARTSYS: + if (!(ka->sa.sa_flags & SA_RESTART)) { + PT_REGS_SYSCALL_RET(regs) = -EINTR; + break; + } + /* fallthrough */ + case -ERESTARTNOINTR: + PT_REGS_RESTART_SYSCALL(regs); + PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs); + break; + } } - handler = ka->sa.sa_handler; - save = *oldset; + sp = PT_REGS_SP(regs); + if((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0)) + sp = current->sas_ss_sp + current->sas_ss_size; - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; +#ifdef CONFIG_ARCH_HAS_SC_SIGNALS + if(!(ka->sa.sa_flags & SA_SIGINFO)) + err = setup_signal_stack_sc(sp, signr, ka, regs, oldset); + else +#endif + err = setup_signal_stack_si(sp, signr, ka, regs, info, oldset); - if (!(ka->sa.sa_flags & SA_NODEFER)) { + if(err){ + spin_lock_irq(¤t->sighand->siglock); + current->blocked = *oldset; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + force_sigsegv(signr, current); + } + else if(!(ka->sa.sa_flags & SA_NODEFER)){ spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); @@ -93,50 +97,24 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr, spin_unlock_irq(¤t->sighand->siglock); } - sp = PT_REGS_SP(regs); - - if((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0)) - sp = current->sas_ss_sp + current->sas_ss_size; - - if(error != 0) PT_REGS_SET_SYSCALL_RETURN(regs, ret); - - if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; - else restorer = NULL; - - if(ka->sa.sa_flags & SA_SIGINFO) - err = setup_signal_stack_si(sp, signr, (unsigned long) handler, - restorer, regs, info, &save); - else - err = setup_signal_stack_sc(sp, signr, (unsigned long) handler, - restorer, regs, &save); - if(err) goto segv; - - return(0); - segv: - force_sigsegv(signr, current); - return(1); + return err; } -static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error) +static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset) { struct k_sigaction ka_copy; siginfo_t info; - int err, sig; - - if (!oldset) - oldset = ¤t->blocked; + int sig, handled_sig = 0; - sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL); - if(sig == 0) - return(0); - - /* Whee! Actually deliver the signal. */ - err = handle_signal(regs, sig, &ka_copy, &info, oldset, error); - if(!err) - return(1); + while((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0){ + handled_sig = 1; + /* Whee! Actually deliver the signal. */ + if(!handle_signal(regs, sig, &ka_copy, &info, oldset)) + break; + } /* Did we come from a system call? */ - if(PT_REGS_SYSCALL_NR(regs) >= 0){ + if(!handled_sig && (PT_REGS_SYSCALL_NR(regs) >= 0)){ /* Restart the system call - no handlers present */ if(PT_REGS_SYSCALL_RET(regs) == -ERESTARTNOHAND || PT_REGS_SYSCALL_RET(regs) == -ERESTARTSYS || @@ -157,21 +135,21 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error) * on the host. The tracing thread will check this flag and * PTRACE_SYSCALL if necessary. */ - if((current->ptrace & PT_DTRACE) && - is_syscall(PT_REGS_IP(¤t->thread.regs))) - (void) CHOOSE_MODE(current->thread.mode.tt.singlestep_syscall = 1, 0); - return(0); + if(current->ptrace & PT_DTRACE) + current->thread.singlestep_syscall = + is_syscall(PT_REGS_IP(¤t->thread.regs)); + return(handled_sig); } -int do_signal(int error) +int do_signal(void) { - return(kern_do_signal(¤t->thread.regs, NULL, error)); + return(kern_do_signal(¤t->thread.regs, ¤t->blocked)); } /* * Atomically swap in the new signal mask, and wait for a signal. */ -int sys_sigsuspend(int history0, int history1, old_sigset_t mask) +long sys_sigsuspend(int history0, int history1, old_sigset_t mask) { sigset_t saveset; @@ -182,15 +160,16 @@ int sys_sigsuspend(int history0, int history1, old_sigset_t mask) recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); + PT_REGS_SYSCALL_RET(¤t->thread.regs) = -EINTR; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if(kern_do_signal(¤t->thread.regs, &saveset, -EINTR)) + if(kern_do_signal(¤t->thread.regs, &saveset)) return(-EINTR); } } -int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) +long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) { sigset_t saveset, newset; @@ -208,97 +187,20 @@ int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); + PT_REGS_SYSCALL_RET(¤t->thread.regs) = -EINTR; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (kern_do_signal(¤t->thread.regs, &saveset, -EINTR)) + if (kern_do_signal(¤t->thread.regs, &saveset)) return(-EINTR); } } -int sys_sigaction(int sig, const struct old_sigaction __user *act, - struct old_sigaction __user *oact) -{ - struct k_sigaction new_ka, old_ka; - int ret; - - if (act) { - old_sigset_t mask; - if (verify_area(VERIFY_READ, act, sizeof(*act)) || - __get_user(new_ka.sa.sa_handler, &act->sa_handler) || - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) - return -EFAULT; - __get_user(new_ka.sa.sa_flags, &act->sa_flags); - __get_user(mask, &act->sa_mask); - siginitset(&new_ka.sa.sa_mask, mask); - } - - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); - - if (!ret && oact) { - if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) - return -EFAULT; - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); - } - - return ret; -} - -int sys_sigaltstack(const stack_t *uss, stack_t *uoss) +long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) { return(do_sigaltstack(uss, uoss, PT_REGS_SP(¤t->thread.regs))); } -extern int userspace_pid[]; - -static int copy_sc_from_user(struct pt_regs *to, void *from, - struct arch_frame_data *arch) -{ - int ret; - - ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from, arch), - copy_sc_from_user_skas(userspace_pid[0], - &to->regs, from)); - return(ret); -} - -int sys_sigreturn(struct pt_regs regs) -{ - void __user *sc = sp_to_sc(PT_REGS_SP(¤t->thread.regs)); - void __user *mask = sp_to_mask(PT_REGS_SP(¤t->thread.regs)); - int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); - - spin_lock_irq(¤t->sighand->siglock); - copy_from_user(¤t->blocked.sig[0], sc_sigmask(sc), - sizeof(current->blocked.sig[0])); - copy_from_user(¤t->blocked.sig[1], mask, sig_size); - sigdelsetmask(¤t->blocked, ~_BLOCKABLE); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - copy_sc_from_user(¤t->thread.regs, sc, - &signal_frame_sc.common.arch); - return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); -} - -int sys_rt_sigreturn(struct pt_regs regs) -{ - unsigned long sp = PT_REGS_SP(¤t->thread.regs); - struct ucontext __user *uc = sp_to_uc(sp); - int sig_size = _NSIG_WORDS * sizeof(unsigned long); - - spin_lock_irq(¤t->sighand->siglock); - copy_from_user(¤t->blocked, &uc->uc_sigmask, sig_size); - sigdelsetmask(¤t->blocked, ~_BLOCKABLE); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext, - &signal_frame_si.common.arch); - return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); -} - /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/kernel/signal_user.c b/arch/um/kernel/signal_user.c index 74a69e491..62f457835 100644 --- a/arch/um/kernel/signal_user.c +++ b/arch/um/kernel/signal_user.c @@ -41,6 +41,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...) while((mask = va_arg(ap, int)) != -1){ sigaddset(&action.sa_mask, mask); } + va_end(ap); action.sa_flags = flags; action.sa_restorer = NULL; if(sigaction(sig, &action, NULL) < 0) @@ -57,6 +58,10 @@ int change_sig(int signal, int on) return(!sigismember(&old, signal)); } +/* Both here and in set/get_signal we don't touch SIGPROF, because we must not + * disable profiling; it's safe because the profiling code does not interact + * with the kernel code at all.*/ + static void change_signals(int type) { sigset_t mask; @@ -65,7 +70,6 @@ static void change_signals(int type) sigaddset(&mask, SIGVTALRM); sigaddset(&mask, SIGALRM); sigaddset(&mask, SIGIO); - sigaddset(&mask, SIGPROF); if(sigprocmask(type, &mask, NULL) < 0) panic("Failed to change signal mask - errno = %d", errno); } diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index 37d3f7e97..867dff072 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile @@ -1,16 +1,15 @@ # -# Copyright (C) 2002 Jeff Dike (jdike@karaya.com) +# Copyright (C) 2002 - 2004 Jeff Dike (jdike@addtoit.com) # Licensed under the GPL # -obj-y := exec_kern.o exec_user.o mem.o mem_user.o mmu.o process.o \ - process_kern.o syscall_kern.o syscall_user.o time.o tlb.o trap_user.o \ - uaccess.o sys-$(SUBARCH)/ - -subdir-y := util +obj-y := exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ + syscall_kern.o syscall_user.o time.o tlb.o trap_user.o uaccess.o \ USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< + +subdir- := util diff --git a/arch/um/kernel/skas/exec_kern.c b/arch/um/kernel/skas/exec_kern.c index 49356d26a..c6b4d5dba 100644 --- a/arch/um/kernel/skas/exec_kern.c +++ b/arch/um/kernel/skas/exec_kern.c @@ -12,7 +12,7 @@ #include "asm/mmu_context.h" #include "tlb.h" #include "skas.h" -#include "mmu.h" +#include "um_mmu.h" #include "os.h" void flush_thread_skas(void) diff --git a/arch/um/kernel/skas/include/mode-skas.h b/arch/um/kernel/skas/include/mode-skas.h index f19838880..c1e33bd78 100644 --- a/arch/um/kernel/skas/include/mode-skas.h +++ b/arch/um/kernel/skas/include/mode-skas.h @@ -14,11 +14,6 @@ extern unsigned long exec_fpx_regs[]; extern int have_fpx_regs; extern void user_time_init_skas(void); -extern int copy_sc_from_user_skas(int pid, union uml_pt_regs *regs, - void *from_ptr); -extern int copy_sc_to_user_skas(int pid, void *to_ptr, void *fp, - union uml_pt_regs *regs, - unsigned long fault_addr, int fault_type); extern void sig_handler_common_skas(int sig, void *sc_ptr); extern void halt_skas(void); extern void reboot_skas(void); diff --git a/arch/um/kernel/skas/include/skas.h b/arch/um/kernel/skas/include/skas.h index 0bbc97540..1c7fcd3ef 100644 --- a/arch/um/kernel/skas/include/skas.h +++ b/arch/um/kernel/skas/include/skas.h @@ -28,12 +28,8 @@ extern int unmap(int fd, void *addr, int len); extern int protect(int fd, unsigned long addr, unsigned long len, int r, int w, int x, int must_succeed); extern void user_signal(int sig, union uml_pt_regs *regs); -extern int singlestepping_skas(void); extern int new_mm(int from); -extern void save_registers(union uml_pt_regs *regs); -extern void restore_registers(union uml_pt_regs *regs); extern void start_userspace(int cpu); -extern void init_registers(int pid); #endif diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/kernel/skas/include/uaccess-skas.h index da9c52ce4..11986c9b9 100644 --- a/arch/um/kernel/skas/include/uaccess-skas.h +++ b/arch/um/kernel/skas/include/uaccess-skas.h @@ -7,11 +7,16 @@ #define __SKAS_UACCESS_H #include "asm/errno.h" +#include "asm/fixmap.h" #define access_ok_skas(type, addr, size) \ ((segment_eq(get_fs(), KERNEL_DS)) || \ (((unsigned long) (addr) < TASK_SIZE) && \ - ((unsigned long) (addr) + (size) <= TASK_SIZE))) + ((unsigned long) (addr) + (size) <= TASK_SIZE)) || \ + ((type == VERIFY_READ ) && \ + ((unsigned long) (addr) >= FIXADDR_USER_START) && \ + ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ + ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) static inline int verify_area_skas(int type, const void * addr, unsigned long size) diff --git a/arch/um/kernel/skas/mem.c b/arch/um/kernel/skas/mem.c index ec169a86c..438db2f43 100644 --- a/arch/um/kernel/skas/mem.c +++ b/arch/um/kernel/skas/mem.c @@ -13,8 +13,13 @@ unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, /* Round up to the nearest 4M */ unsigned long top = ROUND_4M((unsigned long) &arg); +#ifdef CONFIG_HOST_TASK_SIZE + *host_size_out = CONFIG_HOST_TASK_SIZE; + *task_size_out = CONFIG_HOST_TASK_SIZE; +#else *host_size_out = top; *task_size_out = top; +#endif return(((unsigned long) set_task_sizes_skas) & ~0xffffff); } diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index cb748f85d..db53368ec 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -27,23 +28,17 @@ #include "skas_ptrace.h" #include "chan_user.h" #include "signal_user.h" +#include "registers.h" int is_skas_winch(int pid, int fd, void *data) { - if(pid != getpid()) + if(pid != os_getpid()) return(0); register_winch_irq(-1, fd, -1, data); return(1); } -/* These are set once at boot time and not changed thereafter */ - -unsigned long exec_regs[FRAME_SIZE]; -unsigned long exec_fp_regs[HOST_FP_SIZE]; -unsigned long exec_fpx_regs[HOST_XFP_SIZE]; -int have_fpx_regs = 1; - static void handle_segv(int pid) { struct ptrace_faultinfo fault; @@ -60,14 +55,10 @@ static void handle_segv(int pid) /*To use the same value of using_sysemu as the caller, ask it that value (in local_using_sysemu)*/ static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu) { - int err, syscall_nr, status; + int err, status; - syscall_nr = PT_SYSCALL_NR(regs->skas.regs); - UPT_SYSCALL_NR(regs) = syscall_nr; - if(syscall_nr < 1){ - relay_signal(SIGTRAP, regs); - return; - } + /* Mark this as a syscall */ + UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->skas.regs); if (!local_using_sysemu) { @@ -82,7 +73,8 @@ static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu "errno = %d\n", errno); CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); - if((err < 0) || !WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) + if((err < 0) || !WIFSTOPPED(status) || + (WSTOPSIG(status) != SIGTRAP + 0x80)) panic("handle_trap - failed to wait at end of syscall, " "errno = %d, status = %d\n", errno, status); } @@ -100,6 +92,7 @@ static int userspace_tramp(void *arg) } /* Each element set once, and only accessed by a single processor anyway */ +#undef NR_CPUS #define NR_CPUS 1 int userspace_pid[NR_CPUS]; @@ -131,6 +124,10 @@ void start_userspace(int cpu) panic("start_userspace : expected SIGSTOP, got status = %d", status); + if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, (void *)PTRACE_O_TRACESYSGOOD) < 0) + panic("start_userspace : PTRACE_SETOPTIONS failed, errno=%d\n", + errno); + if(munmap(stack, PAGE_SIZE) < 0) panic("start_userspace : munmap failed, errno = %d\n", errno); @@ -142,14 +139,13 @@ void userspace(union uml_pt_regs *regs) int err, status, op, pid = userspace_pid[0]; int local_using_sysemu; /*To prevent races if using_sysemu changes under us.*/ - restore_registers(regs); + restore_registers(pid, regs); local_using_sysemu = get_using_sysemu(); - if (local_using_sysemu) - err = ptrace(PTRACE_SYSEMU, pid, 0, 0); - else - err = ptrace(PTRACE_SYSCALL, pid, 0, 0); + op = local_using_sysemu ? PTRACE_SYSEMU : PTRACE_SYSCALL; + err = ptrace(op, pid, 0, 0); + if(err) panic("userspace - PTRACE_%s failed, errno = %d\n", local_using_sysemu ? "SYSEMU" : "SYSCALL", errno); @@ -160,16 +156,20 @@ void userspace(union uml_pt_regs *regs) errno); regs->skas.is_user = 1; - save_registers(regs); + save_registers(pid, regs); + UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ if(WIFSTOPPED(status)){ switch(WSTOPSIG(status)){ case SIGSEGV: handle_segv(pid); break; - case SIGTRAP: + case SIGTRAP + 0x80: handle_trap(pid, regs, local_using_sysemu); break; + case SIGTRAP: + relay_signal(SIGTRAP, regs); + break; case SIGIO: case SIGVTALRM: case SIGILL: @@ -183,19 +183,17 @@ void userspace(union uml_pt_regs *regs) "%d\n", WSTOPSIG(status)); } interrupt_end(); + + /* Avoid -ERESTARTSYS handling in host */ + PT_SYSCALL_NR(regs->skas.regs) = -1; } - restore_registers(regs); + restore_registers(pid, regs); /*Now we ended the syscall, so re-read local_using_sysemu.*/ local_using_sysemu = get_using_sysemu(); - if (local_using_sysemu) - op = singlestepping_skas() ? PTRACE_SINGLESTEP : - PTRACE_SYSEMU; - else - op = singlestepping_skas() ? PTRACE_SINGLESTEP : - PTRACE_SYSCALL; + op = SELECT_PTRACE_OPERATION(local_using_sysemu, singlestepping(NULL)); err = ptrace(op, pid, 0, 0); if(err) @@ -226,9 +224,10 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, block_signals(); if(sigsetjmp(fork_buf, 1) == 0) new_thread_proc(stack, handler); - set_signals(flags); remove_sigstack(); + + set_signals(flags); } void thread_wait(void *sw, void *fb) @@ -241,58 +240,6 @@ void thread_wait(void *sw, void *fb) siglongjmp(*fork_buf, 1); } -static int move_registers(int pid, int int_op, int fp_op, - union uml_pt_regs *regs, unsigned long *fp_regs) -{ - if(ptrace(int_op, pid, 0, regs->skas.regs) < 0) - return(-errno); - if(ptrace(fp_op, pid, 0, fp_regs) < 0) - return(-errno); - return(0); -} - -void save_registers(union uml_pt_regs *regs) -{ - unsigned long *fp_regs; - int err, fp_op; - - if(have_fpx_regs){ - fp_op = PTRACE_GETFPXREGS; - fp_regs = regs->skas.xfp; - } - else { - fp_op = PTRACE_GETFPREGS; - fp_regs = regs->skas.fp; - } - - err = move_registers(userspace_pid[0], PTRACE_GETREGS, fp_op, regs, - fp_regs); - if(err) - panic("save_registers - saving registers failed, errno = %d\n", - -err); -} - -void restore_registers(union uml_pt_regs *regs) -{ - unsigned long *fp_regs; - int err, fp_op; - - if(have_fpx_regs){ - fp_op = PTRACE_SETFPXREGS; - fp_regs = regs->skas.xfp; - } - else { - fp_op = PTRACE_SETFPREGS; - fp_regs = regs->skas.fp; - } - - err = move_registers(userspace_pid[0], PTRACE_SETREGS, fp_op, regs, - fp_regs); - if(err) - panic("restore_registers - saving registers failed, " - "errno = %d\n", -err); -} - void switch_threads(void *me, void *next) { sigjmp_buf my_buf, **me_ptr = me, *next_buf = next; @@ -389,30 +336,7 @@ void switch_mm_skas(int mm_fd) void kill_off_processes_skas(void) { #warning need to loop over userspace_pids in kill_off_processes_skas - os_kill_process(userspace_pid[0], 1); -} - -void init_registers(int pid) -{ - int err; - - if(ptrace(PTRACE_GETREGS, pid, 0, exec_regs) < 0) - panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", - errno); - - err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); - if(!err) - return; - - have_fpx_regs = 0; - if(errno != EIO) - panic("check_ptrace : PTRACE_GETFPXREGS failed, errno = %d", - errno); - - err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); - if(err) - panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", - errno); + os_kill_ptraced_process(userspace_pid[0], 1); } /* diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c index 5418f0862..5d096ea63 100644 --- a/arch/um/kernel/skas/process_kern.c +++ b/arch/um/kernel/skas/process_kern.c @@ -19,73 +19,10 @@ #include "os.h" #include "user_util.h" #include "tlb.h" -#include "frame.h" #include "kern.h" #include "mode.h" #include "proc_mm.h" - -static atomic_t using_sysemu; -int sysemu_supported; - -void set_using_sysemu(int value) -{ - atomic_set(&using_sysemu, sysemu_supported && value); -} - -int get_using_sysemu(void) -{ - return atomic_read(&using_sysemu); -} - -int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int *eof, void *data) -{ - if (snprintf(buf, size, "%d\n", get_using_sysemu()) < size) /*No overflow*/ - *eof = 1; - - return strlen(buf); -} - -int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data) -{ - char tmp[2]; - - if (copy_from_user(tmp, buf, 1)) - return -EFAULT; - - if (tmp[0] == '0' || tmp[0] == '1') - set_using_sysemu(tmp[0] - '0'); - return count; /*We use the first char, but pretend to write everything*/ -} - -int __init make_proc_sysemu(void) -{ - struct proc_dir_entry *ent; - if (mode_tt || !sysemu_supported) - return 0; - - ent = create_proc_entry("sysemu", 0600, &proc_root); - - if (ent == NULL) - { - printk("Failed to register /proc/sysemu\n"); - return(0); - } - - ent->read_proc = proc_read_sysemu; - ent->write_proc = proc_write_sysemu; - - return 0; -} - -late_initcall(make_proc_sysemu); - -int singlestepping_skas(void) -{ - int ret = current->ptrace & PT_DTRACE; - - current->ptrace &= ~PT_DTRACE; - return(ret); -} +#include "registers.h" void *switch_to_skas(void *prev, void *next) { @@ -182,12 +119,7 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp, handler = fork_handler; } else { - memcpy(p->thread.regs.regs.skas.regs, exec_regs, - sizeof(p->thread.regs.regs.skas.regs)); - memcpy(p->thread.regs.regs.skas.fp, exec_fp_regs, - sizeof(p->thread.regs.regs.skas.fp)); - memcpy(p->thread.regs.regs.skas.xfp, exec_fpx_regs, - sizeof(p->thread.regs.regs.skas.xfp)); + init_thread_registers(&p->thread.regs.regs); p->thread.request.u.thread = current->thread.request.u.thread; handler = new_thread_handler; } @@ -246,7 +178,6 @@ static int start_kernel_proc(void *unused) int start_uml_skas(void) { start_userspace(0); - capture_signal_stack(); init_new_thread_signals(1); uml_idle_timer(); diff --git a/arch/um/kernel/skas/syscall_kern.c b/arch/um/kernel/skas/syscall_kern.c index 1d7eca5a8..bdf040ce5 100644 --- a/arch/um/kernel/skas/syscall_kern.c +++ b/arch/um/kernel/skas/syscall_kern.c @@ -4,6 +4,7 @@ */ #include "linux/sys.h" +#include "linux/ptrace.h" #include "asm/errno.h" #include "asm/unistd.h" #include "asm/ptrace.h" diff --git a/arch/um/kernel/skas/syscall_user.c b/arch/um/kernel/skas/syscall_user.c index 34fd5f94e..b7fd594eb 100644 --- a/arch/um/kernel/skas/syscall_user.c +++ b/arch/um/kernel/skas/syscall_user.c @@ -10,10 +10,6 @@ #include "sysdep/ptrace.h" #include "sysdep/sigcontext.h" -/* XXX Bogus */ -#define ERESTARTSYS 512 -#define ERESTARTNOINTR 513 -#define ERESTARTNOHAND 514 void handle_syscall(union uml_pt_regs *regs) { @@ -22,15 +18,12 @@ void handle_syscall(union uml_pt_regs *regs) index = record_syscall_start(UPT_SYSCALL_NR(regs)); - syscall_trace(regs, 1); + syscall_trace(regs, 0); result = execute_syscall(regs); REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); - if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || - (result == -ERESTARTNOINTR)) - do_signal(result); - syscall_trace(regs, 0); + syscall_trace(regs, 1); record_syscall_end(index, result); } diff --git a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c index 02e3e06bb..956fb0102 100644 --- a/arch/um/kernel/skas/tlb.c +++ b/arch/um/kernel/skas/tlb.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Licensed under the GPL */ @@ -18,52 +19,86 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr, unsigned long end_addr, int force) { pgd_t *npgd; + pud_t *npud; pmd_t *npmd; pte_t *npte; - unsigned long addr; + unsigned long addr, end; int r, w, x, err, fd; if(mm == NULL) return; fd = mm->context.skas.mm_fd; for(addr = start_addr; addr < end_addr;){ npgd = pgd_offset(mm, addr); - npmd = pmd_offset(npgd, addr); - if(pmd_present(*npmd)){ - npte = pte_offset_kernel(npmd, addr); - r = pte_read(*npte); - w = pte_write(*npte); - x = pte_exec(*npte); - if(!pte_dirty(*npte)) w = 0; - if(!pte_young(*npte)){ - r = 0; - w = 0; - } - if(force || pte_newpage(*npte)){ - err = unmap(fd, (void *) addr, PAGE_SIZE); + if(!pgd_present(*npgd)){ + if(force || pgd_newpage(*npgd)){ + end = addr + PGDIR_SIZE; + if(end > end_addr) + end = end_addr; + err = unmap(fd, (void *) addr, end - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); - if(pte_present(*npte)) - map(fd, addr, - pte_val(*npte) & PAGE_MASK, - PAGE_SIZE, r, w, x); + pgd_mkuptodate(*npgd); } - else if(pte_newprot(*npte)){ - protect(fd, addr, PAGE_SIZE, r, w, x, 1); + addr += PGDIR_SIZE; + continue; + } + + npud = pud_offset(npgd, addr); + if(!pud_present(*npud)){ + if(force || pud_newpage(*npud)){ + end = addr + PUD_SIZE; + if(end > end_addr) + end = end_addr; + err = unmap(fd, (void *) addr, end - addr); + if(err < 0) + panic("munmap failed, errno = %d\n", + -err); + pud_mkuptodate(*npud); } - *npte = pte_mkuptodate(*npte); - addr += PAGE_SIZE; + addr += PUD_SIZE; + continue; } - else { + + npmd = pmd_offset(npud, addr); + if(!pmd_present(*npmd)){ if(force || pmd_newpage(*npmd)){ - err = unmap(fd, (void *) addr, PMD_SIZE); + end = addr + PMD_SIZE; + if(end > end_addr) + end = end_addr; + err = unmap(fd, (void *) addr, end - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); pmd_mkuptodate(*npmd); } addr += PMD_SIZE; + continue; + } + + npte = pte_offset_kernel(npmd, addr); + r = pte_read(*npte); + w = pte_write(*npte); + x = pte_exec(*npte); + if(!pte_dirty(*npte)) + w = 0; + if(!pte_young(*npte)){ + r = 0; + w = 0; + } + if(force || pte_newpage(*npte)){ + err = unmap(fd, (void *) addr, PAGE_SIZE); + if(err < 0) + panic("munmap failed, errno = %d\n", -err); + if(pte_present(*npte)) + map(fd, addr, pte_val(*npte) & PAGE_MASK, + PAGE_SIZE, r, w, x); } + else if(pte_newprot(*npte)) + protect(fd, addr, PAGE_SIZE, r, w, x, 1); + + *npte = pte_mkuptodate(*npte); + addr += PAGE_SIZE; } } @@ -71,45 +106,82 @@ void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end) { struct mm_struct *mm; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; - unsigned long addr; + unsigned long addr, last; int updated = 0, err; mm = &init_mm; for(addr = start; addr < end;){ pgd = pgd_offset(mm, addr); - pmd = pmd_offset(pgd, addr); - if(pmd_present(*pmd)){ - pte = pte_offset_kernel(pmd, addr); - if(!pte_present(*pte) || pte_newpage(*pte)){ + pud = pud_offset(pgd, addr); + pmd = pmd_offset(pud, addr); + if(!pgd_present(*pgd)){ + if(pgd_newpage(*pgd)){ updated = 1; + last = addr + PGDIR_SIZE; + if(last > end) + last = end; err = os_unmap_memory((void *) addr, - PAGE_SIZE); + last - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); - if(pte_present(*pte)) - map_memory(addr, - pte_val(*pte) & PAGE_MASK, - PAGE_SIZE, 1, 1, 1); } - else if(pte_newprot(*pte)){ + addr += PGDIR_SIZE; + continue; + } + + pud = pud_offset(pgd, addr); + if(!pud_present(*pud)){ + if(pud_newpage(*pud)){ updated = 1; - protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); + last = addr + PUD_SIZE; + if(last > end) + last = end; + err = os_unmap_memory((void *) addr, + last - addr); + if(err < 0) + panic("munmap failed, errno = %d\n", + -err); } - addr += PAGE_SIZE; + addr += PUD_SIZE; + continue; } - else { + + pmd = pmd_offset(pud, addr); + if(!pmd_present(*pmd)){ if(pmd_newpage(*pmd)){ updated = 1; - err = os_unmap_memory((void *) addr, PMD_SIZE); + last = addr + PMD_SIZE; + if(last > end) + last = end; + err = os_unmap_memory((void *) addr, + last - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); } addr += PMD_SIZE; + continue; + } + + pte = pte_offset_kernel(pmd, addr); + if(!pte_present(*pte) || pte_newpage(*pte)){ + updated = 1; + err = os_unmap_memory((void *) addr, PAGE_SIZE); + if(err < 0) + panic("munmap failed, errno = %d\n", -err); + if(pte_present(*pte)) + map_memory(addr, pte_val(*pte) & PAGE_MASK, + PAGE_SIZE, 1, 1, 1); } + else if(pte_newprot(*pte)){ + updated = 1; + protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); + } + addr += PAGE_SIZE; } } diff --git a/arch/um/kernel/skas/trap_user.c b/arch/um/kernel/skas/trap_user.c index 96593709a..8e9b46d47 100644 --- a/arch/um/kernel/skas/trap_user.c +++ b/arch/um/kernel/skas/trap_user.c @@ -5,7 +5,6 @@ #include #include -#include #include "sysdep/ptrace.h" #include "signal_user.h" #include "user_util.h" @@ -21,6 +20,14 @@ void sig_handler_common_skas(int sig, void *sc_ptr) int save_errno = errno; int save_user; + /* This is done because to allow SIGSEGV to be delivered inside a SEGV + * handler. This can happen in copy_user, and if SEGV is disabled, + * the process will die. + * XXX Figure out why this is better than SA_NODEFER + */ + if(sig == SIGSEGV) + change_sig(SIGSEGV, 1); + r = &TASK_REGS(get_current())->skas; save_user = r->is_user; r->is_user = 0; diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c index 77048cd67..7575ec489 100644 --- a/arch/um/kernel/skas/uaccess.c +++ b/arch/um/kernel/skas/uaccess.c @@ -54,15 +54,24 @@ static int do_op(unsigned long addr, int len, int is_write, static void do_buffer_op(void *jmpbuf, void *arg_ptr) { - va_list args = *((va_list *) arg_ptr); - unsigned long addr = va_arg(args, unsigned long); - int len = va_arg(args, int); - int is_write = va_arg(args, int); - int (*op)(unsigned long, int, void *) = va_arg(args, void *); - void *arg = va_arg(args, void *); - int *res = va_arg(args, int *); - int size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len); - int remain = len, n; + va_list args; + unsigned long addr; + int len, is_write, size, remain, n; + int (*op)(unsigned long, int, void *); + void *arg; + int *res; + + /* Some old gccs recognize __va_copy, but not va_copy */ + __va_copy(args, *(va_list *)arg_ptr); + addr = va_arg(args, unsigned long); + len = va_arg(args, int); + is_write = va_arg(args, int); + op = va_arg(args, void *); + arg = va_arg(args, void *); + res = va_arg(args, int *); + va_end(args); + size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len); + remain = len; current->thread.fault_catcher = jmpbuf; n = do_op(addr, size, is_write, op, arg); @@ -124,10 +133,10 @@ static int copy_chunk_from_user(unsigned long from, int len, void *arg) return(0); } -int copy_from_user_skas(void *to, const void *from, int n) +int copy_from_user_skas(void *to, const void __user *from, int n) { if(segment_eq(get_fs(), KERNEL_DS)){ - memcpy(to, from, n); + memcpy(to, (__force void*)from, n); return(0); } @@ -145,10 +154,10 @@ static int copy_chunk_to_user(unsigned long to, int len, void *arg) return(0); } -int copy_to_user_skas(void *to, const void *from, int n) +int copy_to_user_skas(void __user *to, const void *from, int n) { if(segment_eq(get_fs(), KERNEL_DS)){ - memcpy(to, from, n); + memcpy((__force void*)to, from, n); return(0); } @@ -171,13 +180,13 @@ static int strncpy_chunk_from_user(unsigned long from, int len, void *arg) return(0); } -int strncpy_from_user_skas(char *dst, const char *src, int count) +int strncpy_from_user_skas(char *dst, const char __user *src, int count) { int n; char *ptr = dst; if(segment_eq(get_fs(), KERNEL_DS)){ - strncpy(dst, src, count); + strncpy(dst, (__force void*)src, count); return(strnlen(dst, count)); } @@ -197,15 +206,15 @@ static int clear_chunk(unsigned long addr, int len, void *unused) return(0); } -int __clear_user_skas(void *mem, int len) +int __clear_user_skas(void __user *mem, int len) { return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL)); } -int clear_user_skas(void *mem, int len) +int clear_user_skas(void __user *mem, int len) { if(segment_eq(get_fs(), KERNEL_DS)){ - memset(mem, 0, len); + memset((__force void*)mem, 0, len); return(0); } @@ -225,12 +234,12 @@ static int strnlen_chunk(unsigned long str, int len, void *arg) return(0); } -int strnlen_user_skas(const void *str, int len) +int strnlen_user_skas(const void __user *str, int len) { int count = 0, n; if(segment_eq(get_fs(), KERNEL_DS)) - return(strnlen(str, len) + 1); + return(strnlen((__force char*)str, len) + 1); n = buffer_op((unsigned long) str, len, 0, strnlen_chunk, &count); if(n == 0) diff --git a/arch/um/kernel/skas/util/Makefile b/arch/um/kernel/skas/util/Makefile index a26e0c34a..17f5909d6 100644 --- a/arch/um/kernel/skas/util/Makefile +++ b/arch/um/kernel/skas/util/Makefile @@ -1,2 +1,4 @@ hostprogs-y := mk_ptregs always := $(hostprogs-y) + +mk_ptregs-objs := mk_ptregs-$(SUBARCH).o diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c index b5e66b291..e91639138 100644 --- a/arch/um/kernel/smp.c +++ b/arch/um/kernel/smp.c @@ -216,7 +216,7 @@ int hard_smp_processor_id(void) return(pid_to_processor_id(os_getpid())); } -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); static atomic_t scf_started; static atomic_t scf_finished; static void (*func)(void *info); @@ -247,10 +247,8 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic, func = _func; info = _info; - for (i=0;icpu) && - cpu_isset(i, cpu_online_map)) - os_write_file(cpu_data[i].ipi_pipe[1], "C", 1); + for_each_online_cpu(i) + os_write_file(cpu_data[i].ipi_pipe[1], "C", 1); while (atomic_read(&scf_started) != cpus) barrier(); diff --git a/arch/um/kernel/sys_call_table.c b/arch/um/kernel/sys_call_table.c index f1ad68ecc..eda45b820 100644 --- a/arch/um/kernel/sys_call_table.c +++ b/arch/um/kernel/sys_call_table.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Licensed under the GPL */ @@ -19,7 +20,7 @@ #define NFSSERVCTL sys_ni_syscall #endif -#define LAST_GENERIC_SYSCALL __NR_vserver +#define LAST_GENERIC_SYSCALL __NR_keyctl #if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL #define LAST_SYSCALL LAST_GENERIC_SYSCALL @@ -32,7 +33,6 @@ extern syscall_handler_t sys_execve; extern syscall_handler_t um_time; extern syscall_handler_t um_mount; extern syscall_handler_t um_stime; -extern syscall_handler_t sys_ptrace; extern syscall_handler_t sys_pipe; extern syscall_handler_t sys_olduname; extern syscall_handler_t sys_sigaction; @@ -43,283 +43,238 @@ extern syscall_handler_t sys_ipc; extern syscall_handler_t sys_sigreturn; extern syscall_handler_t sys_clone; extern syscall_handler_t sys_rt_sigreturn; -extern syscall_handler_t sys_rt_sigaction; extern syscall_handler_t sys_sigaltstack; extern syscall_handler_t sys_vfork; -extern syscall_handler_t sys_mmap2; -extern syscall_handler_t old_mmap_i386; extern syscall_handler_t old_select; extern syscall_handler_t sys_modify_ldt; extern syscall_handler_t sys_rt_sigsuspend; extern syscall_handler_t sys_vserver; +extern syscall_handler_t sys_mbind; +extern syscall_handler_t sys_get_mempolicy; +extern syscall_handler_t sys_set_mempolicy; +extern syscall_handler_t sys_sys_setaltroot; syscall_handler_t *sys_call_table[] = { [ __NR_restart_syscall ] = (syscall_handler_t *) sys_restart_syscall, - [ __NR_exit ] (syscall_handler_t *) sys_exit, - [ __NR_fork ] (syscall_handler_t *) sys_fork, + [ __NR_exit ] = (syscall_handler_t *) sys_exit, + [ __NR_fork ] = (syscall_handler_t *) sys_fork, [ __NR_read ] = (syscall_handler_t *) sys_read, [ __NR_write ] = (syscall_handler_t *) sys_write, /* These three are declared differently in asm/unistd.h */ [ __NR_open ] = (syscall_handler_t *) sys_open, [ __NR_close ] = (syscall_handler_t *) sys_close, - [ __NR_waitpid ] = (syscall_handler_t *) sys_waitpid, - [ __NR_creat ] (syscall_handler_t *) sys_creat, - [ __NR_link ] (syscall_handler_t *) sys_link, - [ __NR_unlink ] (syscall_handler_t *) sys_unlink, + [ __NR_creat ] = (syscall_handler_t *) sys_creat, + [ __NR_link ] = (syscall_handler_t *) sys_link, + [ __NR_unlink ] = (syscall_handler_t *) sys_unlink, [ __NR_execve ] = (syscall_handler_t *) sys_execve, /* declared differently in kern_util.h */ - [ __NR_chdir ] (syscall_handler_t *) sys_chdir, + [ __NR_chdir ] = (syscall_handler_t *) sys_chdir, [ __NR_time ] = um_time, - [ __NR_mknod ] (syscall_handler_t *) sys_mknod, - [ __NR_chmod ] (syscall_handler_t *) sys_chmod, - [ __NR_lchown ] (syscall_handler_t *) sys_lchown16, - [ __NR_break ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_oldstat ] (syscall_handler_t *) sys_stat, + [ __NR_mknod ] = (syscall_handler_t *) sys_mknod, + [ __NR_chmod ] = (syscall_handler_t *) sys_chmod, + [ __NR_lchown ] = (syscall_handler_t *) sys_lchown16, [ __NR_lseek ] = (syscall_handler_t *) sys_lseek, - [ __NR_getpid ] (syscall_handler_t *) sys_getpid, + [ __NR_getpid ] = (syscall_handler_t *) sys_getpid, [ __NR_mount ] = um_mount, - [ __NR_umount ] (syscall_handler_t *) sys_oldumount, - [ __NR_setuid ] (syscall_handler_t *) sys_setuid16, - [ __NR_getuid ] (syscall_handler_t *) sys_getuid16, - [ __NR_stime ] = um_stime, - [ __NR_ptrace ] (syscall_handler_t *) sys_ptrace, - [ __NR_alarm ] (syscall_handler_t *) sys_alarm, - [ __NR_oldfstat ] (syscall_handler_t *) sys_fstat, - [ __NR_pause ] (syscall_handler_t *) sys_pause, - [ __NR_utime ] (syscall_handler_t *) sys_utime, - [ __NR_stty ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_gtty ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_access ] (syscall_handler_t *) sys_access, - [ __NR_nice ] (syscall_handler_t *) sys_nice, - [ __NR_ftime ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_sync ] (syscall_handler_t *) sys_sync, - [ __NR_kill ] (syscall_handler_t *) sys_kill, - [ __NR_rename ] (syscall_handler_t *) sys_rename, - [ __NR_mkdir ] (syscall_handler_t *) sys_mkdir, - [ __NR_rmdir ] (syscall_handler_t *) sys_rmdir, + [ __NR_setuid ] = (syscall_handler_t *) sys_setuid16, + [ __NR_getuid ] = (syscall_handler_t *) sys_getuid16, + [ __NR_ptrace ] = (syscall_handler_t *) sys_ptrace, + [ __NR_alarm ] = (syscall_handler_t *) sys_alarm, + [ __NR_pause ] = (syscall_handler_t *) sys_pause, + [ __NR_utime ] = (syscall_handler_t *) sys_utime, + [ __NR_access ] = (syscall_handler_t *) sys_access, + [ __NR_sync ] = (syscall_handler_t *) sys_sync, + [ __NR_kill ] = (syscall_handler_t *) sys_kill, + [ __NR_rename ] = (syscall_handler_t *) sys_rename, + [ __NR_mkdir ] = (syscall_handler_t *) sys_mkdir, + [ __NR_rmdir ] = (syscall_handler_t *) sys_rmdir, /* Declared differently in asm/unistd.h */ [ __NR_dup ] = (syscall_handler_t *) sys_dup, - [ __NR_pipe ] (syscall_handler_t *) sys_pipe, - [ __NR_times ] (syscall_handler_t *) sys_times, - [ __NR_prof ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_brk ] (syscall_handler_t *) sys_brk, - [ __NR_setgid ] (syscall_handler_t *) sys_setgid16, - [ __NR_getgid ] (syscall_handler_t *) sys_getgid16, - [ __NR_signal ] (syscall_handler_t *) sys_signal, - [ __NR_geteuid ] (syscall_handler_t *) sys_geteuid16, - [ __NR_getegid ] (syscall_handler_t *) sys_getegid16, - [ __NR_acct ] (syscall_handler_t *) sys_acct, - [ __NR_umount2 ] (syscall_handler_t *) sys_umount, - [ __NR_lock ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_ioctl ] (syscall_handler_t *) sys_ioctl, - [ __NR_fcntl ] (syscall_handler_t *) sys_fcntl, - [ __NR_mpx ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_setpgid ] (syscall_handler_t *) sys_setpgid, - [ __NR_ulimit ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_oldolduname ] (syscall_handler_t *) sys_olduname, - [ __NR_umask ] (syscall_handler_t *) sys_umask, - [ __NR_chroot ] (syscall_handler_t *) sys_chroot, - [ __NR_ustat ] (syscall_handler_t *) sys_ustat, - [ __NR_dup2 ] (syscall_handler_t *) sys_dup2, - [ __NR_getppid ] (syscall_handler_t *) sys_getppid, - [ __NR_getpgrp ] (syscall_handler_t *) sys_getpgrp, + [ __NR_pipe ] = (syscall_handler_t *) sys_pipe, + [ __NR_times ] = (syscall_handler_t *) sys_times, + [ __NR_brk ] = (syscall_handler_t *) sys_brk, + [ __NR_setgid ] = (syscall_handler_t *) sys_setgid16, + [ __NR_getgid ] = (syscall_handler_t *) sys_getgid16, + [ __NR_geteuid ] = (syscall_handler_t *) sys_geteuid16, + [ __NR_getegid ] = (syscall_handler_t *) sys_getegid16, + [ __NR_acct ] = (syscall_handler_t *) sys_acct, + [ __NR_umount2 ] = (syscall_handler_t *) sys_umount, + [ __NR_ioctl ] = (syscall_handler_t *) sys_ioctl, + [ __NR_fcntl ] = (syscall_handler_t *) sys_fcntl, + [ __NR_setpgid ] = (syscall_handler_t *) sys_setpgid, + [ __NR_umask ] = (syscall_handler_t *) sys_umask, + [ __NR_chroot ] = (syscall_handler_t *) sys_chroot, + [ __NR_ustat ] = (syscall_handler_t *) sys_ustat, + [ __NR_dup2 ] = (syscall_handler_t *) sys_dup2, + [ __NR_getppid ] = (syscall_handler_t *) sys_getppid, + [ __NR_getpgrp ] = (syscall_handler_t *) sys_getpgrp, [ __NR_setsid ] = (syscall_handler_t *) sys_setsid, - [ __NR_sigaction ] (syscall_handler_t *) sys_sigaction, - [ __NR_sgetmask ] (syscall_handler_t *) sys_sgetmask, - [ __NR_ssetmask ] (syscall_handler_t *) sys_ssetmask, - [ __NR_setreuid ] (syscall_handler_t *) sys_setreuid16, - [ __NR_setregid ] (syscall_handler_t *) sys_setregid16, - [ __NR_sigsuspend ] (syscall_handler_t *) sys_sigsuspend, - [ __NR_sigpending ] (syscall_handler_t *) sys_sigpending, - [ __NR_sethostname ] (syscall_handler_t *) sys_sethostname, - [ __NR_setrlimit ] (syscall_handler_t *) sys_setrlimit, - [ __NR_getrlimit ] (syscall_handler_t *) sys_old_getrlimit, - [ __NR_getrusage ] (syscall_handler_t *) sys_getrusage, - [ __NR_gettimeofday ] (syscall_handler_t *) sys_gettimeofday, - [ __NR_settimeofday ] (syscall_handler_t *) sys_settimeofday, - [ __NR_getgroups ] (syscall_handler_t *) sys_getgroups16, - [ __NR_setgroups ] (syscall_handler_t *) sys_setgroups16, - [ __NR_symlink ] (syscall_handler_t *) sys_symlink, - [ __NR_oldlstat ] (syscall_handler_t *) sys_lstat, - [ __NR_readlink ] (syscall_handler_t *) sys_readlink, - [ __NR_uselib ] (syscall_handler_t *) sys_uselib, + [ __NR_setreuid ] = (syscall_handler_t *) sys_setreuid16, + [ __NR_setregid ] = (syscall_handler_t *) sys_setregid16, + [ __NR_sethostname ] = (syscall_handler_t *) sys_sethostname, + [ __NR_setrlimit ] = (syscall_handler_t *) sys_setrlimit, + [ __NR_getrlimit ] = (syscall_handler_t *) sys_old_getrlimit, + [ __NR_getrusage ] = (syscall_handler_t *) sys_getrusage, + [ __NR_gettimeofday ] = (syscall_handler_t *) sys_gettimeofday, + [ __NR_settimeofday ] = (syscall_handler_t *) sys_settimeofday, + [ __NR_getgroups ] = (syscall_handler_t *) sys_getgroups16, + [ __NR_setgroups ] = (syscall_handler_t *) sys_setgroups16, + [ __NR_symlink ] = (syscall_handler_t *) sys_symlink, + [ __NR_readlink ] = (syscall_handler_t *) sys_readlink, + [ __NR_uselib ] = (syscall_handler_t *) sys_uselib, [ __NR_swapon ] = (syscall_handler_t *) sys_swapon, - [ __NR_reboot ] (syscall_handler_t *) sys_reboot, - [ __NR_readdir ] = old_readdir, - [ __NR_munmap ] (syscall_handler_t *) sys_munmap, - [ __NR_truncate ] (syscall_handler_t *) sys_truncate, - [ __NR_ftruncate ] (syscall_handler_t *) sys_ftruncate, - [ __NR_fchmod ] (syscall_handler_t *) sys_fchmod, - [ __NR_fchown ] (syscall_handler_t *) sys_fchown16, - [ __NR_getpriority ] (syscall_handler_t *) sys_getpriority, - [ __NR_setpriority ] (syscall_handler_t *) sys_setpriority, - [ __NR_profil ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_statfs ] (syscall_handler_t *) sys_statfs, - [ __NR_fstatfs ] (syscall_handler_t *) sys_fstatfs, - [ __NR_ioperm ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_socketcall ] (syscall_handler_t *) sys_socketcall, - [ __NR_syslog ] (syscall_handler_t *) sys_syslog, - [ __NR_setitimer ] (syscall_handler_t *) sys_setitimer, - [ __NR_getitimer ] (syscall_handler_t *) sys_getitimer, - [ __NR_stat ] (syscall_handler_t *) sys_newstat, - [ __NR_lstat ] (syscall_handler_t *) sys_newlstat, - [ __NR_fstat ] (syscall_handler_t *) sys_newfstat, - [ __NR_olduname ] (syscall_handler_t *) sys_uname, - [ __NR_iopl ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_vhangup ] (syscall_handler_t *) sys_vhangup, - [ __NR_idle ] (syscall_handler_t *) sys_ni_syscall, + [ __NR_reboot ] = (syscall_handler_t *) sys_reboot, + [ __NR_munmap ] = (syscall_handler_t *) sys_munmap, + [ __NR_truncate ] = (syscall_handler_t *) sys_truncate, + [ __NR_ftruncate ] = (syscall_handler_t *) sys_ftruncate, + [ __NR_fchmod ] = (syscall_handler_t *) sys_fchmod, + [ __NR_fchown ] = (syscall_handler_t *) sys_fchown16, + [ __NR_getpriority ] = (syscall_handler_t *) sys_getpriority, + [ __NR_setpriority ] = (syscall_handler_t *) sys_setpriority, + [ __NR_statfs ] = (syscall_handler_t *) sys_statfs, + [ __NR_fstatfs ] = (syscall_handler_t *) sys_fstatfs, + [ __NR_ioperm ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_syslog ] = (syscall_handler_t *) sys_syslog, + [ __NR_setitimer ] = (syscall_handler_t *) sys_setitimer, + [ __NR_getitimer ] = (syscall_handler_t *) sys_getitimer, + [ __NR_stat ] = (syscall_handler_t *) sys_newstat, + [ __NR_lstat ] = (syscall_handler_t *) sys_newlstat, + [ __NR_fstat ] = (syscall_handler_t *) sys_newfstat, + [ __NR_vhangup ] = (syscall_handler_t *) sys_vhangup, [ __NR_wait4 ] = (syscall_handler_t *) sys_wait4, [ __NR_swapoff ] = (syscall_handler_t *) sys_swapoff, - [ __NR_sysinfo ] (syscall_handler_t *) sys_sysinfo, - [ __NR_ipc ] (syscall_handler_t *) sys_ipc, - [ __NR_fsync ] (syscall_handler_t *) sys_fsync, - [ __NR_sigreturn ] (syscall_handler_t *) sys_sigreturn, - [ __NR_clone ] (syscall_handler_t *) sys_clone, - [ __NR_setdomainname ] (syscall_handler_t *) sys_setdomainname, - [ __NR_uname ] (syscall_handler_t *) sys_newuname, - [ __NR_adjtimex ] (syscall_handler_t *) sys_adjtimex, - [ __NR_mprotect ] (syscall_handler_t *) sys_mprotect, - [ __NR_sigprocmask ] (syscall_handler_t *) sys_sigprocmask, - [ __NR_create_module ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_init_module ] (syscall_handler_t *) sys_init_module, - [ __NR_delete_module ] (syscall_handler_t *) sys_delete_module, - [ __NR_get_kernel_syms ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_quotactl ] (syscall_handler_t *) sys_quotactl, - [ __NR_getpgid ] (syscall_handler_t *) sys_getpgid, - [ __NR_fchdir ] (syscall_handler_t *) sys_fchdir, - [ __NR_bdflush ] (syscall_handler_t *) sys_bdflush, - [ __NR_sysfs ] (syscall_handler_t *) sys_sysfs, - [ __NR_personality ] (syscall_handler_t *) sys_personality, - [ __NR_afs_syscall ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_setfsuid ] (syscall_handler_t *) sys_setfsuid16, - [ __NR_setfsgid ] (syscall_handler_t *) sys_setfsgid16, - [ __NR__llseek ] (syscall_handler_t *) sys_llseek, - [ __NR_getdents ] (syscall_handler_t *) sys_getdents, - [ __NR__newselect ] = (syscall_handler_t *) sys_select, - [ __NR_flock ] (syscall_handler_t *) sys_flock, - [ __NR_msync ] (syscall_handler_t *) sys_msync, - [ __NR_readv ] (syscall_handler_t *) sys_readv, - [ __NR_writev ] (syscall_handler_t *) sys_writev, - [ __NR_getsid ] (syscall_handler_t *) sys_getsid, - [ __NR_fdatasync ] (syscall_handler_t *) sys_fdatasync, + [ __NR_sysinfo ] = (syscall_handler_t *) sys_sysinfo, + [ __NR_fsync ] = (syscall_handler_t *) sys_fsync, + [ __NR_clone ] = (syscall_handler_t *) sys_clone, + [ __NR_setdomainname ] = (syscall_handler_t *) sys_setdomainname, + [ __NR_uname ] = (syscall_handler_t *) sys_newuname, + [ __NR_adjtimex ] = (syscall_handler_t *) sys_adjtimex, + [ __NR_mprotect ] = (syscall_handler_t *) sys_mprotect, + [ __NR_create_module ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_init_module ] = (syscall_handler_t *) sys_init_module, + [ __NR_delete_module ] = (syscall_handler_t *) sys_delete_module, + [ __NR_get_kernel_syms ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_quotactl ] = (syscall_handler_t *) sys_quotactl, + [ __NR_getpgid ] = (syscall_handler_t *) sys_getpgid, + [ __NR_fchdir ] = (syscall_handler_t *) sys_fchdir, + [ __NR_sysfs ] = (syscall_handler_t *) sys_sysfs, + [ __NR_personality ] = (syscall_handler_t *) sys_personality, + [ __NR_afs_syscall ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_setfsuid ] = (syscall_handler_t *) sys_setfsuid16, + [ __NR_setfsgid ] = (syscall_handler_t *) sys_setfsgid16, + [ __NR_getdents ] = (syscall_handler_t *) sys_getdents, + [ __NR_flock ] = (syscall_handler_t *) sys_flock, + [ __NR_msync ] = (syscall_handler_t *) sys_msync, + [ __NR_readv ] = (syscall_handler_t *) sys_readv, + [ __NR_writev ] = (syscall_handler_t *) sys_writev, + [ __NR_getsid ] = (syscall_handler_t *) sys_getsid, + [ __NR_fdatasync ] = (syscall_handler_t *) sys_fdatasync, [ __NR__sysctl ] = (syscall_handler_t *) sys_sysctl, - [ __NR_mlock ] (syscall_handler_t *) sys_mlock, - [ __NR_munlock ] (syscall_handler_t *) sys_munlock, - [ __NR_mlockall ] (syscall_handler_t *) sys_mlockall, - [ __NR_munlockall ] (syscall_handler_t *) sys_munlockall, - [ __NR_sched_setparam ] (syscall_handler_t *) sys_sched_setparam, - [ __NR_sched_getparam ] (syscall_handler_t *) sys_sched_getparam, - [ __NR_sched_setscheduler ] (syscall_handler_t *) sys_sched_setscheduler, - [ __NR_sched_getscheduler ] (syscall_handler_t *) sys_sched_getscheduler, + [ __NR_mlock ] = (syscall_handler_t *) sys_mlock, + [ __NR_munlock ] = (syscall_handler_t *) sys_munlock, + [ __NR_mlockall ] = (syscall_handler_t *) sys_mlockall, + [ __NR_munlockall ] = (syscall_handler_t *) sys_munlockall, + [ __NR_sched_setparam ] = (syscall_handler_t *) sys_sched_setparam, + [ __NR_sched_getparam ] = (syscall_handler_t *) sys_sched_getparam, + [ __NR_sched_setscheduler ] = (syscall_handler_t *) sys_sched_setscheduler, + [ __NR_sched_getscheduler ] = (syscall_handler_t *) sys_sched_getscheduler, [ __NR_sched_yield ] = (syscall_handler_t *) yield, - [ __NR_sched_get_priority_max ] (syscall_handler_t *) sys_sched_get_priority_max, - [ __NR_sched_get_priority_min ] (syscall_handler_t *) sys_sched_get_priority_min, - [ __NR_sched_rr_get_interval ] (syscall_handler_t *) sys_sched_rr_get_interval, - [ __NR_nanosleep ] (syscall_handler_t *) sys_nanosleep, - [ __NR_mremap ] (syscall_handler_t *) sys_mremap, - [ __NR_setresuid ] (syscall_handler_t *) sys_setresuid16, - [ __NR_getresuid ] (syscall_handler_t *) sys_getresuid16, - [ __NR_vm86 ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_query_module ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_poll ] (syscall_handler_t *) sys_poll, + [ __NR_sched_get_priority_max ] = (syscall_handler_t *) sys_sched_get_priority_max, + [ __NR_sched_get_priority_min ] = (syscall_handler_t *) sys_sched_get_priority_min, + [ __NR_sched_rr_get_interval ] = (syscall_handler_t *) sys_sched_rr_get_interval, + [ __NR_nanosleep ] = (syscall_handler_t *) sys_nanosleep, + [ __NR_mremap ] = (syscall_handler_t *) sys_mremap, + [ __NR_setresuid ] = (syscall_handler_t *) sys_setresuid16, + [ __NR_getresuid ] = (syscall_handler_t *) sys_getresuid16, + [ __NR_query_module ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_poll ] = (syscall_handler_t *) sys_poll, [ __NR_nfsservctl ] = (syscall_handler_t *) NFSSERVCTL, - [ __NR_setresgid ] (syscall_handler_t *) sys_setresgid16, - [ __NR_getresgid ] (syscall_handler_t *) sys_getresgid16, - [ __NR_prctl ] (syscall_handler_t *) sys_prctl, - [ __NR_rt_sigreturn ] (syscall_handler_t *) sys_rt_sigreturn, - [ __NR_rt_sigaction ] (syscall_handler_t *) sys_rt_sigaction, - [ __NR_rt_sigprocmask ] (syscall_handler_t *) sys_rt_sigprocmask, - [ __NR_rt_sigpending ] (syscall_handler_t *) sys_rt_sigpending, - [ __NR_rt_sigtimedwait ] (syscall_handler_t *) sys_rt_sigtimedwait, - [ __NR_rt_sigqueueinfo ] (syscall_handler_t *) sys_rt_sigqueueinfo, - [ __NR_rt_sigsuspend ] (syscall_handler_t *) sys_rt_sigsuspend, - [ __NR_pread64 ] (syscall_handler_t *) sys_pread64, - [ __NR_pwrite64 ] (syscall_handler_t *) sys_pwrite64, - [ __NR_chown ] (syscall_handler_t *) sys_chown16, - [ __NR_getcwd ] (syscall_handler_t *) sys_getcwd, - [ __NR_capget ] (syscall_handler_t *) sys_capget, - [ __NR_capset ] (syscall_handler_t *) sys_capset, - [ __NR_sigaltstack ] (syscall_handler_t *) sys_sigaltstack, - [ __NR_sendfile ] (syscall_handler_t *) sys_sendfile, - [ __NR_getpmsg ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_putpmsg ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_vfork ] (syscall_handler_t *) sys_vfork, - [ __NR_ugetrlimit ] (syscall_handler_t *) sys_getrlimit, - [ __NR_mmap2 ] (syscall_handler_t *) sys_mmap2, - [ __NR_truncate64 ] (syscall_handler_t *) sys_truncate64, - [ __NR_ftruncate64 ] (syscall_handler_t *) sys_ftruncate64, - [ __NR_stat64 ] (syscall_handler_t *) sys_stat64, - [ __NR_lstat64 ] (syscall_handler_t *) sys_lstat64, - [ __NR_fstat64 ] (syscall_handler_t *) sys_fstat64, - [ __NR_getdents64 ] (syscall_handler_t *) sys_getdents64, - [ __NR_fcntl64 ] (syscall_handler_t *) sys_fcntl64, - [ 223 ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_gettid ] (syscall_handler_t *) sys_gettid, - [ __NR_readahead ] (syscall_handler_t *) sys_readahead, - [ __NR_setxattr ] (syscall_handler_t *) sys_setxattr, - [ __NR_lsetxattr ] (syscall_handler_t *) sys_lsetxattr, - [ __NR_fsetxattr ] (syscall_handler_t *) sys_fsetxattr, - [ __NR_getxattr ] (syscall_handler_t *) sys_getxattr, - [ __NR_lgetxattr ] (syscall_handler_t *) sys_lgetxattr, - [ __NR_fgetxattr ] (syscall_handler_t *) sys_fgetxattr, - [ __NR_listxattr ] (syscall_handler_t *) sys_listxattr, - [ __NR_llistxattr ] (syscall_handler_t *) sys_llistxattr, - [ __NR_flistxattr ] (syscall_handler_t *) sys_flistxattr, - [ __NR_removexattr ] (syscall_handler_t *) sys_removexattr, - [ __NR_lremovexattr ] (syscall_handler_t *) sys_lremovexattr, - [ __NR_fremovexattr ] (syscall_handler_t *) sys_fremovexattr, - [ __NR_tkill ] (syscall_handler_t *) sys_tkill, - [ __NR_sendfile64 ] (syscall_handler_t *) sys_sendfile64, - [ __NR_futex ] (syscall_handler_t *) sys_futex, - [ __NR_sched_setaffinity ] (syscall_handler_t *) sys_sched_setaffinity, - [ __NR_sched_getaffinity ] (syscall_handler_t *) sys_sched_getaffinity, - [ __NR_set_thread_area ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_get_thread_area ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_io_setup ] (syscall_handler_t *) sys_io_setup, - [ __NR_io_destroy ] (syscall_handler_t *) sys_io_destroy, - [ __NR_io_getevents ] (syscall_handler_t *) sys_io_getevents, - [ __NR_io_submit ] (syscall_handler_t *) sys_io_submit, - [ __NR_io_cancel ] (syscall_handler_t *) sys_io_cancel, - [ __NR_fadvise64 ] (syscall_handler_t *) sys_fadvise64, - [ 251 ] (syscall_handler_t *) sys_ni_syscall, - [ __NR_exit_group ] (syscall_handler_t *) sys_exit_group, - [ __NR_lookup_dcookie ] (syscall_handler_t *) sys_lookup_dcookie, - [ __NR_epoll_create ] (syscall_handler_t *) sys_epoll_create, - [ __NR_epoll_ctl ] (syscall_handler_t *) sys_epoll_ctl, - [ __NR_epoll_wait ] (syscall_handler_t *) sys_epoll_wait, - [ __NR_remap_file_pages ] (syscall_handler_t *) sys_remap_file_pages, - [ __NR_set_tid_address ] (syscall_handler_t *) sys_set_tid_address, - [ __NR_timer_create ] (syscall_handler_t *) sys_timer_create, - [ __NR_timer_settime ] (syscall_handler_t *) sys_timer_settime, - [ __NR_timer_gettime ] (syscall_handler_t *) sys_timer_gettime, - [ __NR_timer_getoverrun ] (syscall_handler_t *) sys_timer_getoverrun, - [ __NR_timer_delete ] (syscall_handler_t *) sys_timer_delete, - [ __NR_clock_settime ] (syscall_handler_t *) sys_clock_settime, - [ __NR_clock_gettime ] (syscall_handler_t *) sys_clock_gettime, - [ __NR_clock_getres ] (syscall_handler_t *) sys_clock_getres, - [ __NR_clock_nanosleep ] (syscall_handler_t *) sys_clock_nanosleep, - [ __NR_statfs64 ] (syscall_handler_t *) sys_statfs64, - [ __NR_fstatfs64 ] (syscall_handler_t *) sys_fstatfs64, - [ __NR_tgkill ] (syscall_handler_t *) sys_tgkill, - [ __NR_utimes ] (syscall_handler_t *) sys_utimes, - [ __NR_fadvise64_64 ] (syscall_handler_t *) sys_fadvise64_64, - [ __NR_vserver ] (syscall_handler_t *) sys_vserver, + [ __NR_setresgid ] = (syscall_handler_t *) sys_setresgid16, + [ __NR_getresgid ] = (syscall_handler_t *) sys_getresgid16, + [ __NR_prctl ] = (syscall_handler_t *) sys_prctl, + [ __NR_rt_sigreturn ] = (syscall_handler_t *) sys_rt_sigreturn, + [ __NR_rt_sigaction ] = (syscall_handler_t *) sys_rt_sigaction, + [ __NR_rt_sigprocmask ] = (syscall_handler_t *) sys_rt_sigprocmask, + [ __NR_rt_sigpending ] = (syscall_handler_t *) sys_rt_sigpending, + [ __NR_rt_sigtimedwait ] = (syscall_handler_t *) sys_rt_sigtimedwait, + [ __NR_rt_sigqueueinfo ] = (syscall_handler_t *) sys_rt_sigqueueinfo, + [ __NR_rt_sigsuspend ] = (syscall_handler_t *) sys_rt_sigsuspend, + [ __NR_pread64 ] = (syscall_handler_t *) sys_pread64, + [ __NR_pwrite64 ] = (syscall_handler_t *) sys_pwrite64, + [ __NR_chown ] = (syscall_handler_t *) sys_chown16, + [ __NR_getcwd ] = (syscall_handler_t *) sys_getcwd, + [ __NR_capget ] = (syscall_handler_t *) sys_capget, + [ __NR_capset ] = (syscall_handler_t *) sys_capset, + [ __NR_sigaltstack ] = (syscall_handler_t *) sys_sigaltstack, + [ __NR_sendfile ] = (syscall_handler_t *) sys_sendfile, + [ __NR_getpmsg ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_putpmsg ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_vfork ] = (syscall_handler_t *) sys_vfork, + [ __NR_getdents64 ] = (syscall_handler_t *) sys_getdents64, + [ __NR_gettid ] = (syscall_handler_t *) sys_gettid, + [ __NR_readahead ] = (syscall_handler_t *) sys_readahead, + [ __NR_setxattr ] = (syscall_handler_t *) sys_setxattr, + [ __NR_lsetxattr ] = (syscall_handler_t *) sys_lsetxattr, + [ __NR_fsetxattr ] = (syscall_handler_t *) sys_fsetxattr, + [ __NR_getxattr ] = (syscall_handler_t *) sys_getxattr, + [ __NR_lgetxattr ] = (syscall_handler_t *) sys_lgetxattr, + [ __NR_fgetxattr ] = (syscall_handler_t *) sys_fgetxattr, + [ __NR_listxattr ] = (syscall_handler_t *) sys_listxattr, + [ __NR_llistxattr ] = (syscall_handler_t *) sys_llistxattr, + [ __NR_flistxattr ] = (syscall_handler_t *) sys_flistxattr, + [ __NR_removexattr ] = (syscall_handler_t *) sys_removexattr, + [ __NR_lremovexattr ] = (syscall_handler_t *) sys_lremovexattr, + [ __NR_fremovexattr ] = (syscall_handler_t *) sys_fremovexattr, + [ __NR_tkill ] = (syscall_handler_t *) sys_tkill, + [ __NR_futex ] = (syscall_handler_t *) sys_futex, + [ __NR_sched_setaffinity ] = (syscall_handler_t *) sys_sched_setaffinity, + [ __NR_sched_getaffinity ] = (syscall_handler_t *) sys_sched_getaffinity, + [ __NR_io_setup ] = (syscall_handler_t *) sys_io_setup, + [ __NR_io_destroy ] = (syscall_handler_t *) sys_io_destroy, + [ __NR_io_getevents ] = (syscall_handler_t *) sys_io_getevents, + [ __NR_io_submit ] = (syscall_handler_t *) sys_io_submit, + [ __NR_io_cancel ] = (syscall_handler_t *) sys_io_cancel, + [ __NR_exit_group ] = (syscall_handler_t *) sys_exit_group, + [ __NR_lookup_dcookie ] = (syscall_handler_t *) sys_lookup_dcookie, + [ __NR_epoll_create ] = (syscall_handler_t *) sys_epoll_create, + [ __NR_epoll_ctl ] = (syscall_handler_t *) sys_epoll_ctl, + [ __NR_epoll_wait ] = (syscall_handler_t *) sys_epoll_wait, + [ __NR_set_tid_address ] = (syscall_handler_t *) sys_set_tid_address, + [ __NR_timer_create ] = (syscall_handler_t *) sys_timer_create, + [ __NR_timer_settime ] = (syscall_handler_t *) sys_timer_settime, + [ __NR_timer_gettime ] = (syscall_handler_t *) sys_timer_gettime, + [ __NR_timer_getoverrun ] = (syscall_handler_t *) sys_timer_getoverrun, + [ __NR_timer_delete ] = (syscall_handler_t *) sys_timer_delete, + [ __NR_clock_settime ] = (syscall_handler_t *) sys_clock_settime, + [ __NR_clock_gettime ] = (syscall_handler_t *) sys_clock_gettime, + [ __NR_clock_getres ] = (syscall_handler_t *) sys_clock_getres, + [ __NR_clock_nanosleep ] = (syscall_handler_t *) sys_clock_nanosleep, + [ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64, + [ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64, + [ __NR_tgkill ] = (syscall_handler_t *) sys_tgkill, + [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, + [ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64, + [ __NR_vserver ] = (syscall_handler_t *) sys_vserver, + [ __NR_mbind ] = (syscall_handler_t *) sys_mbind, + [ __NR_get_mempolicy ] = (syscall_handler_t *) sys_get_mempolicy, + [ __NR_set_mempolicy ] = (syscall_handler_t *) sys_set_mempolicy, + [ __NR_mq_open ] = (syscall_handler_t *) sys_mq_open, + [ __NR_mq_unlink ] = (syscall_handler_t *) sys_mq_unlink, + [ __NR_mq_timedsend ] = (syscall_handler_t *) sys_mq_timedsend, + [ __NR_mq_timedreceive ] = (syscall_handler_t *) sys_mq_timedreceive, + [ __NR_mq_notify ] = (syscall_handler_t *) sys_mq_notify, + [ __NR_mq_getsetattr ] = (syscall_handler_t *) sys_mq_getsetattr, + [ __NR_sys_kexec_load ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_waitid ] = (syscall_handler_t *) sys_waitid, + [ 285 ] = (syscall_handler_t *) sys_ni_syscall, + [ __NR_add_key ] = (syscall_handler_t *) sys_add_key, + [ __NR_request_key ] = (syscall_handler_t *) sys_request_key, + [ __NR_keyctl ] = (syscall_handler_t *) sys_keyctl, ARCH_SYSCALLS [ LAST_SYSCALL + 1 ... NR_syscalls ] = (syscall_handler_t *) sys_ni_syscall }; - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/syscall_kern.c b/arch/um/kernel/syscall_kern.c index 6094be04b..296686bbf 100644 --- a/arch/um/kernel/syscall_kern.c +++ b/arch/um/kernel/syscall_kern.c @@ -29,10 +29,9 @@ /* Unlocked, I don't care if this is a bit off */ int nsyscalls = 0; -long um_mount(char * dev_name, char * dir_name, char * type, - unsigned long new_flags, void * data) +long um_mount(char __user * dev_name, char __user * dir_name, + char __user * type, unsigned long new_flags, void __user * data) { - if(type == NULL) type = ""; return(sys_mount(dev_name, dir_name, type, new_flags, data)); } @@ -58,12 +57,11 @@ long sys_vfork(void) } /* common code for old and new mmaps */ -static inline long do_mmap2( - unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) +long sys_mmap2(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff) { - int error = -EBADF; + long error = -EBADF; struct file * file = NULL; flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); @@ -83,38 +81,15 @@ static inline long do_mmap2( return error; } -long sys_mmap2(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) +long old_mmap(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long offset) { - return do_mmap2(addr, len, prot, flags, fd, pgoff); -} - -/* - * Perform the select(nd, in, out, ex, tv) and mmap() system - * calls. Linux/i386 didn't use to be able to handle more than - * 4 system call parameters, so these system calls used a memory - * block for parameter passing.. - */ - -struct mmap_arg_struct { - unsigned long addr; - unsigned long len; - unsigned long prot; - unsigned long flags; - unsigned long fd; - unsigned long offset; -}; - -int old_mmap(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long offset) -{ - int err = -EINVAL; + long err = -EINVAL; if (offset & ~PAGE_MASK) goto out; - err = do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); + err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); out: return err; } @@ -122,10 +97,10 @@ int old_mmap(unsigned long addr, unsigned long len, * sys_pipe() is the normal C calling standard for creating * a pipe. It's not the way unix traditionally does this, though. */ -int sys_pipe(unsigned long * fildes) +long sys_pipe(unsigned long __user * fildes) { int fd[2]; - int error; + long error; error = do_pipe(fd); if (!error) { @@ -135,94 +110,10 @@ int sys_pipe(unsigned long * fildes) return error; } -/* - * sys_ipc() is the de-multiplexer for the SysV IPC calls.. - * - * This is really horribly ugly. - */ -int sys_ipc (uint call, int first, int second, - int third, void *ptr, long fifth) -{ - int version, ret; - - version = call >> 16; /* hack for backward compatibility */ - call &= 0xffff; - - switch (call) { - case SEMOP: - return sys_semtimedop(first, (struct sembuf *) ptr, second, - NULL); - case SEMTIMEDOP: - return sys_semtimedop(first, (struct sembuf *) ptr, second, - (const struct timespec *) fifth); - case SEMGET: - return sys_semget (first, second, third); - case SEMCTL: { - union semun fourth; - if (!ptr) - return -EINVAL; - if (get_user(fourth.__pad, (void **) ptr)) - return -EFAULT; - return sys_semctl (first, second, third, fourth); - } - - case MSGSND: - return sys_msgsnd (first, (struct msgbuf *) ptr, - second, third); - case MSGRCV: - switch (version) { - case 0: { - struct ipc_kludge tmp; - if (!ptr) - return -EINVAL; - - if (copy_from_user(&tmp, - (struct ipc_kludge *) ptr, - sizeof (tmp))) - return -EFAULT; - return sys_msgrcv (first, tmp.msgp, second, - tmp.msgtyp, third); - } - default: - panic("msgrcv with version != 0"); - return sys_msgrcv (first, - (struct msgbuf *) ptr, - second, fifth, third); - } - case MSGGET: - return sys_msgget ((key_t) first, second); - case MSGCTL: - return sys_msgctl (first, second, (struct msqid_ds *) ptr); - - case SHMAT: - switch (version) { - default: { - ulong raddr; - ret = do_shmat (first, (char *) ptr, second, &raddr); - if (ret) - return ret; - return put_user (raddr, (ulong *) third); - } - case 1: /* iBCS2 emulator entry point */ - if (!segment_eq(get_fs(), get_ds())) - return -EINVAL; - return do_shmat (first, (char *) ptr, second, (ulong *) third); - } - case SHMDT: - return sys_shmdt ((char *)ptr); - case SHMGET: - return sys_shmget (first, second, third); - case SHMCTL: - return sys_shmctl (first, second, - (struct shmid_ds *) ptr); - default: - return -ENOSYS; - } -} -int sys_uname(struct old_utsname * name) +long sys_uname(struct old_utsname * name) { - int err; + long err; if (!name) return -EFAULT; down_read(&uts_sem); @@ -231,9 +122,9 @@ int sys_uname(struct old_utsname * name) return err?-EFAULT:0; } -int sys_olduname(struct oldold_utsname * name) +long sys_olduname(struct oldold_utsname * name) { - int error; + long error; struct new_utsname *ptr; if (!name) @@ -272,7 +163,7 @@ long execute_syscall(void *r) return(CHOOSE_MODE_PROC(execute_syscall_tt, execute_syscall_skas, r)); } -spinlock_t syscall_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(syscall_lock); static int syscall_index = 0; diff --git a/arch/um/kernel/syscall_user.c b/arch/um/kernel/syscall_user.c index 3712286fe..01b711e00 100644 --- a/arch/um/kernel/syscall_user.c +++ b/arch/um/kernel/syscall_user.c @@ -11,7 +11,7 @@ struct { int syscall; int pid; - int result; + long result; struct timeval start; struct timeval end; } syscall_record[1024]; @@ -30,7 +30,7 @@ int record_syscall_start(int syscall) return(index); } -void record_syscall_end(int index, int result) +void record_syscall_end(int index, long result) { syscall_record[index].result = result; gettimeofday(&syscall_record[index].end, NULL); diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index 80b84700f..e630438f9 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c @@ -6,6 +6,7 @@ #include "linux/sched.h" #include "linux/kernel.h" #include "linux/module.h" +#include "linux/kallsyms.h" #include "asm/page.h" #include "asm/processor.h" #include "sysrq.h" @@ -13,28 +14,31 @@ void show_trace(unsigned long * stack) { - int i; + /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from + * arch/i386/kernel/traps.c, and then move this to sys-i386/sysrq.c.*/ unsigned long addr; - if (!stack) + if (!stack) { stack = (unsigned long*) &stack; + WARN_ON(1); + } - printk("Call Trace: "); - i = 1; + printk("Call Trace: \n"); while (((long) stack & (THREAD_SIZE-1)) != 0) { - addr = *stack++; + addr = *stack; if (__kernel_text_address(addr)) { - if (i && ((i % 6) == 0)) - printk("\n "); - printk("[<%08lx>] ", addr); - i++; + printk("%08lx: [<%08lx>]", (unsigned long) stack, addr); + print_symbol(" %s", addr); + printk("\n"); } + stack++; } printk("\n"); } /* - * The architecture-independent dump_stack generator + * stack dumps generator - this is used by arch-independent code. + * And this is identical to i386 currently. */ void dump_stack(void) { @@ -44,18 +48,34 @@ void dump_stack(void) } EXPORT_SYMBOL(dump_stack); -void show_stack(struct task_struct *task, unsigned long *sp) +/*Stolen from arch/i386/kernel/traps.c */ +static int kstack_depth_to_print = 24; + +/* This recently started being used in arch-independent code too, as in + * kernel/sched.c.*/ +void show_stack(struct task_struct *task, unsigned long *esp) { - show_trace(sp); -} + unsigned long *stack; + int i; -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ + if (esp == NULL) { + if (task != current) { + esp = (unsigned long *) KSTK_ESP(task); + /* Which one? No actual difference - just coding style.*/ + //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs); + } else { + esp = (unsigned long *) &esp; + } + } + + stack = esp; + for(i = 0; i < kstack_depth_to_print; i++) { + if (kstack_end(stack)) + break; + if (i && ((i % 8) == 0)) + printk("\n "); + printk("%08lx ", *stack++); + } + + show_trace(esp); +} diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 96691a0df..c40c86a3f 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -60,6 +60,9 @@ void disable_timer(void) (setitimer(ITIMER_REAL, &disable, NULL) < 0)) printk("disnable_timer - setitimer failed, errno = %d\n", errno); + /* If there are signals already queued, after unblocking ignore them */ + set_handler(SIGALRM, SIG_IGN, 0, -1); + set_handler(SIGVTALRM, SIG_IGN, 0, -1); } void switch_timers(int to_real) diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 5ce566882..2461cd73c 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c @@ -22,7 +22,7 @@ #include "mode.h" #include "os.h" -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); @@ -111,19 +111,19 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs) return(IRQ_HANDLED); } -long um_time(int * tloc) +long um_time(int __user *tloc) { struct timeval now; do_gettimeofday(&now); if (tloc) { - if (put_user(now.tv_sec,tloc)) + if (put_user(now.tv_sec, tloc)) now.tv_sec = -EFAULT; } return now.tv_sec; } -long um_stime(int * tptr) +long um_stime(int __user *tptr) { int value; struct timespec new; @@ -136,22 +136,7 @@ long um_stime(int * tptr) return 0; } -/* XXX Needs to be moved under sys-i386 */ -void __delay(um_udelay_t time) -{ - /* Stolen from the i386 __loop_delay */ - int d0; - __asm__ __volatile__( - "\tjmp 1f\n" - ".align 16\n" - "1:\tjmp 2f\n" - ".align 16\n" - "2:\tdecl %0\n\tjns 2b" - :"=&a" (d0) - :"0" (time)); -} - -void __udelay(um_udelay_t usecs) +void __udelay(unsigned long usecs) { int i, n; @@ -159,7 +144,7 @@ void __udelay(um_udelay_t usecs) for(i=0;iskas.is_user)); local_irq_enable(); -#endif if(current_thread->cpu == 0) timer_irq(regs); } -static spinlock_t timer_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(timer_spinlock); unsigned long time_lock(void) { diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index c42053140..26f5d12d8 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -59,9 +59,14 @@ pgd_t *pgd_offset_proc(struct mm_struct *mm, unsigned long address) return(pgd_offset(mm, address)); } -pmd_t *pmd_offset_proc(pgd_t *pgd, unsigned long address) +pud_t *pud_offset_proc(pgd_t *pgd, unsigned long address) { - return(pmd_offset(pgd, address)); + return(pud_offset(pgd, address)); +} + +pmd_t *pmd_offset_proc(pud_t *pud, unsigned long address) +{ + return(pmd_offset(pud, address)); } pte_t *pte_offset_proc(pmd_t *pmd, unsigned long address) @@ -71,8 +76,11 @@ pte_t *pte_offset_proc(pmd_t *pmd, unsigned long address) pte_t *addr_pte(struct task_struct *task, unsigned long addr) { - return(pte_offset_kernel(pmd_offset(pgd_offset(task->mm, addr), addr), - addr)); + pgd_t *pgd = pgd_offset(task->mm, addr); + pud_t *pud = pud_offset(pgd, addr); + pmd_t *pmd = pmd_offset(pud, addr); + + return(pte_offset_map(pmd, addr)); } /* diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index cba33ef6d..47e766e6b 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c @@ -13,6 +13,7 @@ #include "linux/ptrace.h" #include "asm/semaphore.h" #include "asm/pgtable.h" +#include "asm/pgalloc.h" #include "asm/tlbflush.h" #include "asm/a.out.h" #include "asm/current.h" @@ -32,6 +33,7 @@ int handle_page_fault(unsigned long address, unsigned long ip, struct mm_struct *mm = current->mm; struct vm_area_struct *vma; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; unsigned long page; @@ -46,6 +48,8 @@ int handle_page_fault(unsigned long address, unsigned long ip, goto good_area; else if(!(vma->vm_flags & VM_GROWSDOWN)) goto out; + else if(!ARCH_IS_STACKGROW(address)) + goto out; else if(expand_stack(vma, address)) goto out; @@ -55,7 +59,8 @@ int handle_page_fault(unsigned long address, unsigned long ip, goto out; page = address & PAGE_MASK; pgd = pgd_offset(mm, page); - pmd = pmd_offset(pgd, page); + pud = pud_offset(pgd, page); + pmd = pmd_offset(pud, page); do { survive: switch (handle_mm_fault(mm, vma, address, is_write)){ @@ -74,6 +79,9 @@ int handle_page_fault(unsigned long address, unsigned long ip, default: BUG(); } + pgd = pgd_offset(mm, page); + pud = pud_offset(pgd, page); + pmd = pmd_offset(pud, page); pte = pte_offset_kernel(pmd, page); } while(!pte_present(*pte)); err = 0; @@ -215,7 +223,7 @@ void trap_init(void) { } -spinlock_t trap_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(trap_lock); static int trap_index = 0; diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c index d12eac64a..0a3d279ce 100644 --- a/arch/um/kernel/trap_user.c +++ b/arch/um/kernel/trap_user.c @@ -18,7 +18,6 @@ #include "sigcontext.h" #include "sysdep/sigcontext.h" #include "irq_user.h" -#include "frame_user.h" #include "signal_user.h" #include "time_user.h" #include "task.h" @@ -103,28 +102,6 @@ struct signal_info sig_info[] = { .is_irq = 0 }, }; -void sig_handler(int sig, struct sigcontext sc) -{ - CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas, - sig, &sc); -} - -extern int timer_irq_inited; - -void alarm_handler(int sig, struct sigcontext sc) -{ - if(!timer_irq_inited) return; - - if(sig == SIGALRM) - switch_timers(0); - - CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas, - sig, &sc); - - if(sig == SIGALRM) - switch_timers(1); -} - void do_longjmp(void *b, int val) { sigjmp_buf *buf = b; diff --git a/arch/um/kernel/tt/Makefile b/arch/um/kernel/tt/Makefile index 33416e889..7c9eec5fd 100644 --- a/arch/um/kernel/tt/Makefile +++ b/arch/um/kernel/tt/Makefile @@ -4,10 +4,11 @@ # extra-y := unmap_fin.o +clean-files := unmap_tmp.o obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \ - uaccess.o uaccess_user.o sys-$(SUBARCH)/ + uaccess.o uaccess_user.o obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/ @@ -20,10 +21,12 @@ UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< -$(O_TARGET) : $(obj)/unmap_fin.o - $(obj)/unmap.o: $(src)/unmap.c $(CC) $(UNMAP_CFLAGS) -c -o $@ $< -$(obj)/unmap_fin.o : $(src)/unmap.o - ld -r -o $@ $< -lc -L/usr/lib +LIBC_DIR ?= /usr/lib + +$(obj)/unmap_fin.o : $(obj)/unmap.o + ld -r -o $(obj)/unmap_tmp.o $< -lc -L$(LIBC_DIR) + objcopy $(obj)/unmap_tmp.o $@ -G switcheroo + diff --git a/arch/um/kernel/tt/exec_user.c b/arch/um/kernel/tt/exec_user.c index 6d5fa825a..26a120a84 100644 --- a/arch/um/kernel/tt/exec_user.c +++ b/arch/um/kernel/tt/exec_user.c @@ -10,11 +10,13 @@ #include #include #include +#include #include #include "user_util.h" #include "kern_util.h" #include "user.h" #include "ptrace_user.h" +#include "os.h" void do_exec(int old_pid, int new_pid) { @@ -35,7 +37,10 @@ void do_exec(int old_pid, int new_pid) tracer_panic("do_exec failed to get registers - errno = %d", errno); - kill(old_pid, SIGKILL); + os_kill_ptraced_process(old_pid, 0); + + if (ptrace(PTRACE_OLDSETOPTIONS, new_pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) + tracer_panic("do_exec: PTRACE_SETOPTIONS failed, errno = %d", errno); if(ptrace_setregs(new_pid, regs) < 0) tracer_panic("do_exec failed to start new proc - errno = %d", diff --git a/arch/um/kernel/tt/gdb.c b/arch/um/kernel/tt/gdb.c index 10db6d6ab..22cbdbffb 100644 --- a/arch/um/kernel/tt/gdb.c +++ b/arch/um/kernel/tt/gdb.c @@ -162,7 +162,7 @@ int gdb_remove(char *unused) void signal_usr1(int sig) { if(debugger_pid != -1){ - printk(UM_KERN_ERR "The debugger is already running\n"); + printf("The debugger is already running\n"); return; } debugger_pid = start_debugger(linux_prog, 0, 0, &debugger_fd); @@ -228,19 +228,19 @@ int debugger_signal(int status, pid_t pid){ return(0); } void child_signal(pid_t pid, int status){ } int init_ptrace_proxy(int idle_pid, int startup, int stop) { - printk(UM_KERN_ERR "debug requested when CONFIG_PT_PROXY is off\n"); + printf("debug requested when CONFIG_PT_PROXY is off\n"); kill_child_dead(idle_pid); exit(1); } void signal_usr1(int sig) { - printk(UM_KERN_ERR "debug requested when CONFIG_PT_PROXY is off\n"); + printf("debug requested when CONFIG_PT_PROXY is off\n"); } int attach_debugger(int idle_pid, int pid, int stop) { - printk(UM_KERN_ERR "attach_debugger called when CONFIG_PT_PROXY " + printf("attach_debugger called when CONFIG_PT_PROXY " "is off\n"); return(-1); } diff --git a/arch/um/kernel/tt/include/mode-tt.h b/arch/um/kernel/tt/include/mode-tt.h index fb5cfd318..efe462019 100644 --- a/arch/um/kernel/tt/include/mode-tt.h +++ b/arch/um/kernel/tt/include/mode-tt.h @@ -14,9 +14,6 @@ extern int tracing_pid; extern int tracer(int (*init_proc)(void *), void *sp); extern void user_time_init_tt(void); -extern int copy_sc_from_user_tt(void *to_ptr, void *from_ptr, void *data); -extern int copy_sc_to_user_tt(void *to_ptr, void *fp, void *from_ptr, - void *data); extern void sig_handler_common_tt(int sig, void *sc); extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); extern void reboot_tt(void); diff --git a/arch/um/kernel/tt/include/tt.h b/arch/um/kernel/tt/include/tt.h index b7c474518..01c8601cd 100644 --- a/arch/um/kernel/tt/include/tt.h +++ b/arch/um/kernel/tt/include/tt.h @@ -24,11 +24,10 @@ extern void set_init_pid(int pid); extern int set_user_mode(void *task); extern void set_tracing(void *t, int tracing); extern int is_tracing(void *task); -extern int singlestepping_tt(void *t); -extern void clear_singlestep(void *t); extern void syscall_handler(int sig, union uml_pt_regs *regs); extern void exit_kernel(int pid, void *task); -extern int do_syscall(void *task, int pid); +extern void do_syscall(void *task, int pid, int local_using_sysemu); +extern void do_sigtrap(void *task); extern int is_valid_pid(int pid); extern void remap_data(void *segment_start, void *segment_end, int w); diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index 6224afcd8..1f4d12b27 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c @@ -65,7 +65,8 @@ void *switch_to_tt(void *prev, void *next, void *last) panic("write of switch_pipe failed, err = %d", -err); reading = 1; - if((from->state == TASK_ZOMBIE) || (from->state == TASK_DEAD)) + if((from->exit_state == EXIT_ZOMBIE) || + (from->exit_state == EXIT_DEAD)) os_kill_process(os_getpid(), 0); err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c)); @@ -80,8 +81,8 @@ void *switch_to_tt(void *prev, void *next, void *last) * in case it has not already killed itself. */ prev_sched = current->thread.prev_sched; - if((prev_sched->state == TASK_ZOMBIE) || - (prev_sched->state == TASK_DEAD)) + if((prev_sched->exit_state == EXIT_ZOMBIE) || + (prev_sched->exit_state == EXIT_DEAD)) os_kill_process(prev_sched->thread.mode.tt.extern_pid, 1); /* This works around a nasty race with 'jail'. If we are switching @@ -305,7 +306,6 @@ int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, change_sig(SIGUSR1, 0); err = 0; - out: return(err); } @@ -524,22 +524,6 @@ void set_init_pid(int pid) -err); } -int singlestepping_tt(void *t) -{ - struct task_struct *task = t; - - if(task->thread.mode.tt.singlestep_syscall) - return(0); - return(task->ptrace & PT_DTRACE); -} - -void clear_singlestep(void *t) -{ - struct task_struct *task = t; - - task->ptrace &= ~PT_DTRACE; -} - int start_uml_tt(void) { void *sp; diff --git a/arch/um/kernel/tt/ptproxy/proxy.c b/arch/um/kernel/tt/ptproxy/proxy.c index 458ecf9a4..f41832c79 100644 --- a/arch/um/kernel/tt/ptproxy/proxy.c +++ b/arch/um/kernel/tt/ptproxy/proxy.c @@ -94,7 +94,9 @@ int debugger_syscall(debugger_state *debugger, pid_t child) debugger->handle_trace = debugger_syscall; return(ret); +#ifdef __NR_waitpid case __NR_waitpid: +#endif case __NR_wait4: if(!debugger_wait(debugger, (int *) arg2, arg3, debugger_syscall, debugger_normal_return, @@ -153,7 +155,11 @@ static int parent_syscall(debugger_state *debugger, int pid) syscall = get_syscall(pid, &arg1, &arg2, &arg3, &arg4, &arg5); - if((syscall == __NR_waitpid) || (syscall == __NR_wait4)){ + if((syscall == __NR_wait4) +#ifdef __NR_waitpid + || (syscall == __NR_waitpid) +#endif + ){ debugger_wait(&parent, (int *) arg2, arg3, parent_syscall, parent_normal_return, parent_wait_return); } diff --git a/arch/um/kernel/tt/ptproxy/sysdep.c b/arch/um/kernel/tt/ptproxy/sysdep.c index c42855aed..4545ea4f2 100644 --- a/arch/um/kernel/tt/ptproxy/sysdep.c +++ b/arch/um/kernel/tt/ptproxy/sysdep.c @@ -12,7 +12,6 @@ terms and conditions. #include #include #include -#include #include #include "ptrace_user.h" #include "user_util.h" diff --git a/arch/um/kernel/tt/ptproxy/wait.c b/arch/um/kernel/tt/ptproxy/wait.c index 86ef67653..fcb7ea50f 100644 --- a/arch/um/kernel/tt/ptproxy/wait.c +++ b/arch/um/kernel/tt/ptproxy/wait.c @@ -10,7 +10,6 @@ terms and conditions. #include #include #include -#include #include "ptproxy.h" #include "sysdep.h" diff --git a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c index 555ffd0ee..c02e504e5 100644 --- a/arch/um/kernel/tt/syscall_kern.c +++ b/arch/um/kernel/tt/syscall_kern.c @@ -14,95 +14,6 @@ #include "sysdep/syscalls.h" #include "kern_util.h" -static inline int check_area(void *ptr, int size) -{ - return(verify_area(VERIFY_WRITE, ptr, size)); -} - -static int check_readlink(struct pt_regs *regs) -{ - return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), - UPT_SYSCALL_ARG2(®s->regs))); -} - -static int check_utime(struct pt_regs *regs) -{ - return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), - sizeof(struct utimbuf))); -} - -static int check_oldstat(struct pt_regs *regs) -{ - return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), - sizeof(struct __old_kernel_stat))); -} - -static int check_stat(struct pt_regs *regs) -{ - return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), - sizeof(struct stat))); -} - -static int check_stat64(struct pt_regs *regs) -{ - return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), - sizeof(struct stat64))); -} - -struct bogus { - int kernel_ds; - int (*check_params)(struct pt_regs *); -}; - -struct bogus this_is_bogus[256] = { - [ __NR_mknod ] = { 1, NULL }, - [ __NR_mkdir ] = { 1, NULL }, - [ __NR_rmdir ] = { 1, NULL }, - [ __NR_unlink ] = { 1, NULL }, - [ __NR_symlink ] = { 1, NULL }, - [ __NR_link ] = { 1, NULL }, - [ __NR_rename ] = { 1, NULL }, - [ __NR_umount ] = { 1, NULL }, - [ __NR_mount ] = { 1, NULL }, - [ __NR_pivot_root ] = { 1, NULL }, - [ __NR_chdir ] = { 1, NULL }, - [ __NR_chroot ] = { 1, NULL }, - [ __NR_open ] = { 1, NULL }, - [ __NR_quotactl ] = { 1, NULL }, - [ __NR_sysfs ] = { 1, NULL }, - [ __NR_readlink ] = { 1, check_readlink }, - [ __NR_acct ] = { 1, NULL }, - [ __NR_execve ] = { 1, NULL }, - [ __NR_uselib ] = { 1, NULL }, - [ __NR_statfs ] = { 1, NULL }, - [ __NR_truncate ] = { 1, NULL }, - [ __NR_access ] = { 1, NULL }, - [ __NR_chmod ] = { 1, NULL }, - [ __NR_chown ] = { 1, NULL }, - [ __NR_lchown ] = { 1, NULL }, - [ __NR_utime ] = { 1, check_utime }, - [ __NR_oldlstat ] = { 1, check_oldstat }, - [ __NR_oldstat ] = { 1, check_oldstat }, - [ __NR_stat ] = { 1, check_stat }, - [ __NR_lstat ] = { 1, check_stat }, - [ __NR_stat64 ] = { 1, check_stat64 }, - [ __NR_lstat64 ] = { 1, check_stat64 }, - [ __NR_chown32 ] = { 1, NULL }, -}; - -/* sys_utimes */ - -static int check_bogosity(struct pt_regs *regs) -{ - struct bogus *bogon = &this_is_bogus[UPT_SYSCALL_NR(®s->regs)]; - - if(!bogon->kernel_ds) return(0); - if(bogon->check_params && (*bogon->check_params)(regs)) - return(-EFAULT); - set_fs(KERNEL_DS); - return(0); -} - extern syscall_handler_t *sys_call_table[]; long execute_syscall_tt(void *r) @@ -117,18 +28,8 @@ long execute_syscall_tt(void *r) if((syscall >= NR_syscalls) || (syscall < 0)) res = -ENOSYS; - else if(honeypot && check_bogosity(regs)) - res = -EFAULT; else res = EXECUTE_SYSCALL(syscall, regs); - set_fs(USER_DS); - - if(current->thread.mode.tt.singlestep_syscall){ - current->thread.mode.tt.singlestep_syscall = 0; - current->ptrace &= ~PT_DTRACE; - force_sig(SIGTRAP, current); - } - return(res); } diff --git a/arch/um/kernel/tt/syscall_user.c b/arch/um/kernel/tt/syscall_user.c index 1cabbd866..32fbe3248 100644 --- a/arch/um/kernel/tt/syscall_user.c +++ b/arch/um/kernel/tt/syscall_user.c @@ -17,10 +17,6 @@ #include "syscall_user.h" #include "tt.h" -/* XXX Bogus */ -#define ERESTARTSYS 512 -#define ERESTARTNOINTR 513 -#define ERESTARTNOHAND 514 void syscall_handler_tt(int sig, union uml_pt_regs *regs) { @@ -33,7 +29,7 @@ void syscall_handler_tt(int sig, union uml_pt_regs *regs) SC_START_SYSCALL(sc); index = record_syscall_start(syscall); - syscall_trace(regs, 1); + syscall_trace(regs, 0); result = execute_syscall(regs); /* regs->sc may have changed while the system call ran (there may @@ -42,39 +38,38 @@ void syscall_handler_tt(int sig, union uml_pt_regs *regs) UPT_SC(regs) = sc; SC_SET_SYSCALL_RETURN(sc, result); - if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || - (result == -ERESTARTNOINTR)) - do_signal(result); - syscall_trace(regs, 0); + syscall_trace(regs, 1); record_syscall_end(index, result); } -int do_syscall(void *task, int pid) +void do_sigtrap(void *task) +{ + UPT_SYSCALL_NR(TASK_REGS(task)) = -1; +} + +void do_syscall(void *task, int pid, int local_using_sysemu) { unsigned long proc_regs[FRAME_SIZE]; - union uml_pt_regs *regs; - int syscall; if(ptrace_getregs(pid, proc_regs) < 0) tracer_panic("Couldn't read registers"); - syscall = PT_SYSCALL_NR(proc_regs); - regs = TASK_REGS(task); - UPT_SYSCALL_NR(regs) = syscall; + UPT_SYSCALL_NR(TASK_REGS(task)) = PT_SYSCALL_NR(proc_regs); - if(syscall < 1) return(0); - - if((syscall != __NR_sigreturn) && - ((unsigned long *) PT_IP(proc_regs) >= &_stext) && + if(((unsigned long *) PT_IP(proc_regs) >= &_stext) && ((unsigned long *) PT_IP(proc_regs) <= &_etext)) tracer_panic("I'm tracing myself and I can't get out"); + /* advanced sysemu mode set syscall number to -1 automatically */ + if (local_using_sysemu==2) + return; + + /* syscall number -1 in sysemu skips syscall restarting in host */ if(ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, - __NR_getpid) < 0) + local_using_sysemu ? -1 : __NR_getpid) < 0) tracer_panic("do_syscall : Nullifying syscall failed, " "errno = %d", errno); - return(1); } /* diff --git a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c index d8ad334cf..3bc35eea1 100644 --- a/arch/um/kernel/tt/tlb.c +++ b/arch/um/kernel/tt/tlb.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Licensed under the GPL */ @@ -19,9 +20,10 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr, unsigned long end_addr, int force) { pgd_t *npgd; + pud_t *npud; pmd_t *npmd; pte_t *npte; - unsigned long addr; + unsigned long addr, end; int r, w, x, err; if((current->thread.mode.tt.extern_pid != -1) && @@ -41,45 +43,81 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr, addr = STACK_TOP - ABOVE_KMEM; continue; } + npgd = pgd_offset(mm, addr); - npmd = pmd_offset(npgd, addr); - if(pmd_present(*npmd)){ - npte = pte_offset_kernel(npmd, addr); - r = pte_read(*npte); - w = pte_write(*npte); - x = pte_exec(*npte); - if(!pte_dirty(*npte)) w = 0; - if(!pte_young(*npte)){ - r = 0; - w = 0; - } - if(force || pte_newpage(*npte)){ + if(!pgd_present(*npgd)){ + if(force || pgd_newpage(*npgd)){ + end = addr + PGDIR_SIZE; + if(end > end_addr) + end = end_addr; + err = os_unmap_memory((void *) addr, + end - addr); + if(err < 0) + panic("munmap failed, errno = %d\n", + -err); + pgd_mkuptodate(*npgd); + } + addr += PGDIR_SIZE; + continue; + } + + npud = pud_offset(npgd, addr); + if(!pud_present(*npud)){ + if(force || pud_newpage(*npud)){ + end = addr + PUD_SIZE; + if(end > end_addr) + end = end_addr; err = os_unmap_memory((void *) addr, - PAGE_SIZE); + end - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); - if(pte_present(*npte)) - map_memory(addr, - pte_val(*npte) & PAGE_MASK, - PAGE_SIZE, r, w, x); - } - else if(pte_newprot(*npte)){ - protect_memory(addr, PAGE_SIZE, r, w, x, 1); + pud_mkuptodate(*npud); } - *npte = pte_mkuptodate(*npte); - addr += PAGE_SIZE; + addr += PUD_SIZE; + continue; } - else { + + npmd = pmd_offset(npud, addr); + if(!pmd_present(*npmd)){ if(force || pmd_newpage(*npmd)){ - err = os_unmap_memory((void *) addr, PMD_SIZE); + end = addr + PMD_SIZE; + if(end > end_addr) + end = end_addr; + err = os_unmap_memory((void *) addr, + end - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); pmd_mkuptodate(*npmd); } addr += PMD_SIZE; + continue; } + + npte = pte_offset_kernel(npmd, addr); + r = pte_read(*npte); + w = pte_write(*npte); + x = pte_exec(*npte); + if(!pte_dirty(*npte)) + w = 0; + if(!pte_young(*npte)){ + r = 0; + w = 0; + } + if(force || pte_newpage(*npte)){ + err = os_unmap_memory((void *) addr, PAGE_SIZE); + if(err < 0) + panic("munmap failed, errno = %d\n", -err); + if(pte_present(*npte)) + map_memory(addr, pte_val(*npte) & PAGE_MASK, + PAGE_SIZE, r, w, x); + } + else if(pte_newprot(*npte)) + protect_memory(addr, PAGE_SIZE, r, w, x, 1); + + *npte = pte_mkuptodate(*npte); + addr += PAGE_SIZE; } } @@ -90,45 +128,83 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end, { struct mm_struct *mm; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; - unsigned long addr; + unsigned long addr, last; int updated = 0, err; mm = &init_mm; for(addr = start; addr < end;){ pgd = pgd_offset(mm, addr); - pmd = pmd_offset(pgd, addr); - if(pmd_present(*pmd)){ - pte = pte_offset_kernel(pmd, addr); - if(!pte_present(*pte) || pte_newpage(*pte)){ + if(!pgd_present(*pgd)){ + if(pgd_newpage(*pgd)){ updated = 1; + last = addr + PGDIR_SIZE; + if(last > end) + last = end; err = os_unmap_memory((void *) addr, - PAGE_SIZE); + last - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); - if(pte_present(*pte)) - map_memory(addr, - pte_val(*pte) & PAGE_MASK, - PAGE_SIZE, 1, 1, 1); } - else if(pte_newprot(*pte)){ + addr += PGDIR_SIZE; + continue; + } + + pud = pud_offset(pgd, addr); + if(!pud_present(*pud)){ + if(pud_newpage(*pud)){ updated = 1; - protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); + last = addr + PUD_SIZE; + if(last > end) + last = end; + err = os_unmap_memory((void *) addr, + last - addr); + if(err < 0) + panic("munmap failed, errno = %d\n", + -err); } - addr += PAGE_SIZE; + addr += PUD_SIZE; + continue; } - else { + + pmd = pmd_offset(pud, addr); + if(!pmd_present(*pmd)){ if(pmd_newpage(*pmd)){ updated = 1; - err = os_unmap_memory((void *) addr, PMD_SIZE); + last = addr + PMD_SIZE; + if(last > end) + last = end; + err = os_unmap_memory((void *) addr, + last - addr); if(err < 0) panic("munmap failed, errno = %d\n", -err); } addr += PMD_SIZE; + continue; + } + + pte = pte_offset_kernel(pmd, addr); + if(!pte_present(*pte) || pte_newpage(*pte)){ + updated = 1; + err = os_unmap_memory((void *) addr, + PAGE_SIZE); + if(err < 0) + panic("munmap failed, errno = %d\n", + -err); + if(pte_present(*pte)) + map_memory(addr, + pte_val(*pte) & PAGE_MASK, + PAGE_SIZE, 1, 1, 1); + } + else if(pte_newprot(*pte)){ + updated = 1; + protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); } + addr += PAGE_SIZE; } if(updated && update_seq) atomic_inc(&vmchange_seq); } @@ -155,6 +231,7 @@ void mprotect_kernel_vm(int w) { struct mm_struct *mm; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; unsigned long addr; @@ -162,7 +239,8 @@ void mprotect_kernel_vm(int w) mm = &init_mm; for(addr = start_vm; addr < end_vm;){ pgd = pgd_offset(mm, addr); - pmd = pmd_offset(pgd, addr); + pud = pud_offset(pgd, addr); + pmd = pmd_offset(pud, addr); if(pmd_present(*pmd)){ pte = pte_offset_kernel(pmd, addr); if(pte_present(*pte)) protect_vm_page(addr, w, 0); diff --git a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c index deef43bb5..257a16e84 100644 --- a/arch/um/kernel/tt/tracer.c +++ b/arch/um/kernel/tt/tracer.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include "user.h" @@ -25,7 +26,6 @@ #include "mem_user.h" #include "process.h" #include "kern_util.h" -#include "frame.h" #include "chan_user.h" #include "ptrace_user.h" #include "mode.h" @@ -72,6 +72,8 @@ void attach_process(int pid) (ptrace(PTRACE_CONT, pid, 0, 0) < 0)) tracer_panic("OP_FORK failed to attach pid"); wait_for_stop(pid, SIGSTOP, PTRACE_CONT, NULL); + if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) + tracer_panic("OP_FORK: PTRACE_SETOPTIONS failed, errno = %d", errno); if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) tracer_panic("OP_FORK failed to continue process"); } @@ -82,6 +84,7 @@ void tracer_panic(char *format, ...) va_start(ap, format); vprintf(format, ap); + va_end(ap); printf("\n"); while(1) pause(); } @@ -141,7 +144,7 @@ static void sleeping_process_signal(int pid, int sig) * any more, the trace of those will land here. So, we need to just * PTRACE_SYSCALL it. */ - case SIGTRAP: + case (SIGTRAP + 0x80): if(ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) tracer_panic("sleeping_process_signal : Failed to " "PTRACE_SYSCALL pid %d, errno = %d\n", @@ -184,8 +187,8 @@ int tracer(int (*init_proc)(void *), void *sp) unsigned long eip = 0; int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0; int last_index, proc_id = 0, n, err, old_tracing = 0, strace = 0; + int local_using_sysemu = 0; - capture_signal_stack(); signal(SIGPIPE, SIG_IGN); setup_tracer_winch(); tracing_pid = os_getpid(); @@ -197,6 +200,10 @@ int tracer(int (*init_proc)(void *), void *sp) printf("waitpid on idle thread failed, errno = %d\n", errno); exit(1); } + if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) { + printf("Failed to PTRACE_SETOPTIONS for idle thread, errno = %d\n", errno); + exit(1); + } if((ptrace(PTRACE_CONT, pid, 0, 0) < 0)){ printf("Failed to continue idle thread, errno = %d\n", errno); exit(1); @@ -297,11 +304,24 @@ int tracer(int (*init_proc)(void *), void *sp) tracing = is_tracing(task); old_tracing = tracing; + /* Assume: no syscall, when coming from user */ + if ( tracing ) + do_sigtrap(task); + switch(sig){ case SIGUSR1: sig = 0; op = do_proc_op(task, proc_id); switch(op){ + /* + * This is called when entering user mode; after + * this, we start intercepting syscalls. + * + * In fact, a process is started in kernel mode, + * so with is_tracing() == 0 (and that is reset + * when executing syscalls, since UML kernel has + * the right to do syscalls); + */ case OP_TRACE_ON: arch_leave_kernel(task, pid); tracing = 1; @@ -310,7 +330,13 @@ int tracer(int (*init_proc)(void *), void *sp) case OP_HALT: unmap_physmem(); kmalloc_ok = 0; - ptrace(PTRACE_KILL, pid, 0, 0); + os_kill_ptraced_process(pid, 0); + /* Now let's reap remaining zombies */ + errno = 0; + do { + waitpid(-1, &status, + WUNTRACED); + } while (errno != ECHILD); return(op == OP_REBOOT); case OP_NONE: printf("Detaching pid %d\n", pid); @@ -324,15 +350,26 @@ int tracer(int (*init_proc)(void *), void *sp) */ pid = cpu_tasks[proc_id].pid; break; + case (SIGTRAP + 0x80): + if(!tracing && (debugger_pid != -1)){ + child_signal(pid, status & 0x7fff); + continue; + } + tracing = 0; + /* local_using_sysemu has been already set + * below, since if we are here, is_tracing() on + * the traced task was 1, i.e. the process had + * already run through one iteration of the + * loop which executed a OP_TRACE_ON request.*/ + do_syscall(task, pid, local_using_sysemu); + sig = SIGUSR2; + break; case SIGTRAP: if(!tracing && (debugger_pid != -1)){ child_signal(pid, status); continue; } tracing = 0; - if(do_syscall(task, pid)) - sig = SIGUSR2; - else clear_singlestep(task); break; case SIGPROF: if(tracing) sig = 0; @@ -349,6 +386,7 @@ int tracer(int (*init_proc)(void *), void *sp) case SIGBUS: case SIGILL: case SIGWINCH: + default: tracing = 0; break; @@ -367,16 +405,15 @@ int tracer(int (*init_proc)(void *), void *sp) continue; } - if(tracing){ - if(singlestepping_tt(task)) - cont_type = PTRACE_SINGLESTEP; - else cont_type = PTRACE_SYSCALL; - } - else cont_type = PTRACE_CONT; + local_using_sysemu = get_using_sysemu(); - if((cont_type == PTRACE_CONT) && - (debugger_pid != -1) && strace) + if(tracing) + cont_type = SELECT_PTRACE_OPERATION(local_using_sysemu, + singlestepping(task)); + else if((debugger_pid != -1) && strace) cont_type = PTRACE_SYSCALL; + else + cont_type = PTRACE_CONT; if(ptrace(cont_type, pid, 0, sig) != 0){ tracer_panic("ptrace failed to continue " diff --git a/arch/um/kernel/tt/trap_user.c b/arch/um/kernel/tt/trap_user.c index 00bacacfc..67fdef69d 100644 --- a/arch/um/kernel/tt/trap_user.c +++ b/arch/um/kernel/tt/trap_user.c @@ -6,7 +6,6 @@ #include #include #include -#include #include "sysdep/ptrace.h" #include "signal_user.h" #include "user_util.h" diff --git a/arch/um/kernel/tt/uaccess.c b/arch/um/kernel/tt/uaccess.c index 040971893..a72aa6329 100644 --- a/arch/um/kernel/tt/uaccess.c +++ b/arch/um/kernel/tt/uaccess.c @@ -6,7 +6,7 @@ #include "linux/sched.h" #include "asm/uaccess.h" -int copy_from_user_tt(void *to, const void *from, int n) +int copy_from_user_tt(void *to, const void __user *from, int n) { if(!access_ok_tt(VERIFY_READ, from, n)) return(n); @@ -15,7 +15,7 @@ int copy_from_user_tt(void *to, const void *from, int n) ¤t->thread.fault_catcher)); } -int copy_to_user_tt(void *to, const void *from, int n) +int copy_to_user_tt(void __user *to, const void *from, int n) { if(!access_ok_tt(VERIFY_WRITE, to, n)) return(n); @@ -24,7 +24,7 @@ int copy_to_user_tt(void *to, const void *from, int n) ¤t->thread.fault_catcher)); } -int strncpy_from_user_tt(char *dst, const char *src, int count) +int strncpy_from_user_tt(char *dst, const char __user *src, int count) { int n; @@ -38,14 +38,14 @@ int strncpy_from_user_tt(char *dst, const char *src, int count) return(n); } -int __clear_user_tt(void *mem, int len) +int __clear_user_tt(void __user *mem, int len) { return(__do_clear_user(mem, len, ¤t->thread.fault_addr, ¤t->thread.fault_catcher)); } -int clear_user_tt(void *mem, int len) +int clear_user_tt(void __user *mem, int len) { if(!access_ok_tt(VERIFY_WRITE, mem, len)) return(len); @@ -54,7 +54,7 @@ int clear_user_tt(void *mem, int len) ¤t->thread.fault_catcher)); } -int strnlen_user_tt(const void *str, int len) +int strnlen_user_tt(const void __user *str, int len) { return(__do_strnlen_user(str, len, ¤t->thread.fault_addr, diff --git a/arch/um/kernel/tty_log.c b/arch/um/kernel/tty_log.c index 0a70c5e66..9ada656f6 100644 --- a/arch/um/kernel/tty_log.c +++ b/arch/um/kernel/tty_log.c @@ -205,6 +205,8 @@ static int __init set_tty_log_fd(char *name, int *add) printf("set_tty_log_fd - strtoul failed on '%s'\n", name); tty_log_fd = -1; } + + *add = 0; return 0; } diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 9146c11e5..bffd8316f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -17,6 +17,7 @@ #include "linux/sysrq.h" #include "linux/seq_file.h" #include "linux/delay.h" +#include "linux/module.h" #include "asm/page.h" #include "asm/pgtable.h" #include "asm/ptrace.h" @@ -44,11 +45,6 @@ struct cpuinfo_um boot_cpu_data = { .ipi_pipe = { -1, -1 } }; -/* Placeholder to make UML link until the vsyscall stuff is actually - * implemented - */ -void *__kernel_vsyscall; - unsigned long thread_saved_pc(struct task_struct *task) { return(os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas, @@ -161,6 +157,8 @@ static int __init uml_version_setup(char *line, int *add) { printf("%s\n", system_utsname.release); exit(0); + + return 0; } __uml_setup("--version", uml_version_setup, @@ -200,7 +198,7 @@ __uml_setup("ncpus=", uml_ncpus_setup, ); #endif -int force_tt = 0; +static int force_tt = 0; #if defined(CONFIG_MODE_TT) && defined(CONFIG_MODE_SKAS) #define DEFAULT_TT 0 @@ -261,6 +259,8 @@ static int __init Usage(char *line, int *add) p++; } exit(0); + + return 0; } __uml_setup("--help", Usage, @@ -300,6 +300,7 @@ static void __init uml_postsetup(void) /* Set during early boot */ unsigned long brk_start; unsigned long end_iomem; +EXPORT_SYMBOL(end_iomem); #define MIN_VMALLOC (32 * 1024 * 1024) @@ -318,9 +319,22 @@ int linux_main(int argc, char **argv) if(have_root == 0) add_arg(saved_command_line, DEFAULT_COMMAND_LINE); mode_tt = force_tt ? 1 : !can_do_skas(); +#ifndef CONFIG_MODE_TT + if (mode_tt) { + /*Since CONFIG_MODE_TT is #undef'ed, force_tt cannot be 1. So, + * can_do_skas() returned 0, and the message is correct. */ + printf("Support for TT mode is disabled, and no SKAS support is present on the host.\n"); + exit(1); + } +#endif uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, &host_task_size, &task_size); + /* Need to check this early because mmapping happens before the + * kernel is running. + */ + check_tmpexec(); + brk_start = (unsigned long) sbrk(0); CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); /* Increase physical memory size for exec-shield users @@ -400,9 +414,9 @@ extern int uml_exitcode; static int panic_exit(struct notifier_block *self, unsigned long unused1, void *unused2) { -#ifdef CONFIG_MAGIC_SYSRQ - handle_sysrq('p', ¤t->thread.regs, NULL); -#endif + bust_spinlocks(1); + show_regs(&(current->thread.regs)); + bust_spinlocks(0); uml_exitcode = 1; machine_halt(); return(0); diff --git a/arch/um/kernel/umid.c b/arch/um/kernel/umid.c index 78c8dc45c..186c28885 100644 --- a/arch/um/kernel/umid.c +++ b/arch/um/kernel/umid.c @@ -54,6 +54,7 @@ static int __init set_umid(char *name, int is_random, static int __init set_umid_arg(char *name, int *add) { + *add = 0; return(set_umid(name, 0, printf)); } @@ -92,8 +93,8 @@ static int __init create_pid_file(void) fd = os_open_file(file, of_create(of_excl(of_rdwr(OPENFLAGS()))), 0644); if(fd < 0){ - printf("Open of machine pid file \"%s\" failed - " - "err = %d\n", file, -fd); + printf("Open of machine pid file \"%s\" failed: %s\n", + file, strerror(-fd)); return 0; } @@ -247,7 +248,7 @@ static int __init make_uml_dir(void) strcpy(uml_dir, dir); if((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)){ - printf("Failed to mkdir %s - errno = %i\n", uml_dir, errno); + printf("Failed to mkdir %s: %s\n", uml_dir, strerror(errno)); return(-1); } return 0; @@ -264,8 +265,8 @@ static int __init make_umid(int (*printer)(const char *fmt, ...)) strcat(tmp, "XXXXXX"); fd = mkstemp(tmp); if(fd < 0){ - (*printer)("make_umid - mkstemp failed, errno = %d\n", - errno); + (*printer)("make_umid - mkstemp(%s) failed: %s\n", + tmp,strerror(errno)); return(1); } @@ -303,15 +304,14 @@ __uml_setup("uml_dir=", set_uml_dir, " The location to place the pid and umid files.\n\n" ); -__uml_postsetup(make_uml_dir); - static int __init make_umid_setup(void) { - return(make_umid(printf)); + /* one function with the ordering we need ... */ + make_uml_dir(); + make_umid(printf); + return create_pid_file(); } - __uml_postsetup(make_umid_setup); -__uml_postsetup(create_pid_file); /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S index 89ed32983..76eadb309 100644 --- a/arch/um/kernel/uml.lds.S +++ b/arch/um/kernel/uml.lds.S @@ -7,8 +7,12 @@ jiffies = jiffies_64; SECTIONS { + /*This must contain the right address - not quite the default ELF one.*/ + PROVIDE (__executable_start = START); . = START + SIZEOF_HEADERS; + /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start + * is remapped.*/ __binary_start = .; #ifdef MODE_TT .thread_private : { @@ -20,9 +24,13 @@ SECTIONS } . = ALIGN(4096); .remap : { arch/um/kernel/tt/unmap_fin.o (.text) } -#endif + + /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT + * is off the resulting binary segfaults.*/ . = ALIGN(4096); /* Init code and data */ +#endif + _stext = .; __init_begin = .; .init.text : { @@ -35,6 +43,8 @@ SECTIONS { *(.text) SCHED_TEXT + LOCK_TEXT + *(.fixup) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index ff94c8f61..f8378124b 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile @@ -3,9 +3,13 @@ # Licensed under the GPL # -obj-y = file.o process.o time.o tty.o user_syms.o drivers/ +obj-y = elf_aux.o file.o process.o signal.o time.o tty.o user_syms.o drivers/ \ + sys-$(SUBARCH)/ -USER_OBJS := $(foreach file,file.o process.o time.o tty.o,$(obj)/$(file)) +USER_OBJS := elf_aux.o file.o process.o signal.o time.o tty.o +USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< + +CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 514ab984c..77d4066d1 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -308,7 +308,8 @@ int os_seek_file(int fd, __u64 offset) __u64 actual; actual = lseek64(fd, offset, SEEK_SET); - if(actual != offset) return(-errno); + if(actual != offset) + return(-errno); return(0); } diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index ec4617b42..5d2c1a4d9 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include "os.h" @@ -94,11 +95,29 @@ void os_kill_process(int pid, int reap_child) } +/* Kill off a ptraced child by all means available. kill it normally first, + * then PTRACE_KILL it, then PTRACE_CONT it in case it's in a run state from + * which it can't exit directly. + */ + +void os_kill_ptraced_process(int pid, int reap_child) +{ + kill(pid, SIGKILL); + ptrace(PTRACE_KILL, pid); + ptrace(PTRACE_CONT, pid); + if(reap_child) + CATCH_EINTR(waitpid(pid, NULL, 0)); +} + void os_usr1_process(int pid) { kill(pid, SIGUSR1); } +/*Don't use the glibc version, which caches the result in TLS. It misses some + * syscalls, and also breaks with clone(), which does not unshare the TLS.*/ +inline _syscall0(pid_t, getpid) + int os_getpid(void) { return(getpid()); diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c index 2433c9e68..75d7af9ae 100644 --- a/arch/um/os-Linux/user_syms.c +++ b/arch/um/os-Linux/user_syms.c @@ -34,6 +34,11 @@ EXPORT_SYMBOL(strstr); int sym(void); \ EXPORT_SYMBOL(sym); +#ifdef SUBARCH_i386 +EXPORT_SYMBOL(vsyscall_ehdr); +EXPORT_SYMBOL(vsyscall_end); +#endif + EXPORT_SYMBOL_PROTO(__errno_location); EXPORT_SYMBOL_PROTO(access); diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 0f65a9259..8a0994b69 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile @@ -1,5 +1,5 @@ -obj-y = bitops.o bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o \ - ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o +obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ + ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_MODULES) += module.o diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c index ba77ccaa8..e97b98806 100644 --- a/arch/um/sys-i386/ldt.c +++ b/arch/um/sys-i386/ldt.c @@ -15,17 +15,21 @@ extern int modify_ldt(int func, void *ptr, unsigned long bytecount); /* XXX this needs copy_to_user and copy_from_user */ -int sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount) +int sys_modify_ldt_tt(int func, void __user *ptr, unsigned long bytecount) { - if(verify_area(VERIFY_READ, ptr, bytecount)) return(-EFAULT); - return(modify_ldt(func, ptr, bytecount)); + if (verify_area(VERIFY_READ, ptr, bytecount)) + return -EFAULT; + + return modify_ldt(func, ptr, bytecount); } #endif #ifdef CONFIG_MODE_SKAS extern int userspace_pid; -int sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) +#include "skas_ptrace.h" + +int sys_modify_ldt_skas(int func, void __user *ptr, unsigned long bytecount) { struct ptrace_ldt ldt; void *buf; @@ -74,7 +78,7 @@ int sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) } #endif -int sys_modify_ldt(int func, void *ptr, unsigned long bytecount) +int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) { return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func, ptr, bytecount)); diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index 817ef7479..c6a1bba33 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c @@ -3,10 +3,13 @@ * Licensed under the GPL */ +#include +#include #include "linux/sched.h" #include "asm/elf.h" #include "asm/ptrace.h" #include "asm/uaccess.h" +#include "asm/unistd.h" #include "ptrace_user.h" #include "sysdep/sigcontext.h" #include "sysdep/sc.h" @@ -21,13 +24,14 @@ int is_syscall(unsigned long addr) unsigned short instr; int n; - n = copy_from_user(&instr, (void *) addr, sizeof(instr)); + n = copy_from_user(&instr, (void __user *) addr, sizeof(instr)); if(n){ - printk("is_syscall : failed to read instruction from 0x%lu\n", + printk("is_syscall : failed to read instruction from 0x%lx\n", addr); return(0); } - return(instr == 0x80cd); + /* int 0x80 or sysenter */ + return((instr == 0x80cd) || (instr == 0x340f)); } /* determines which flags the user has access to. */ @@ -173,12 +177,12 @@ static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave */ #ifdef CONFIG_MODE_TT -static inline int convert_fxsr_to_user_tt(struct _fpstate *buf, +static inline int convert_fxsr_to_user_tt(struct _fpstate __user *buf, struct pt_regs *regs) { struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs)); unsigned long env[7]; - struct _fpreg *to; + struct _fpreg __user *to; struct _fpxreg *from; int i; @@ -203,7 +207,7 @@ static inline int convert_fxsr_to_user_tt(struct _fpstate *buf, } #endif -static inline int convert_fxsr_to_user(struct _fpstate *buf, +static inline int convert_fxsr_to_user(struct _fpstate __user *buf, struct pt_regs *regs) { return(CHOOSE_MODE(convert_fxsr_to_user_tt(buf, regs), 0)); @@ -211,12 +215,12 @@ static inline int convert_fxsr_to_user(struct _fpstate *buf, #ifdef CONFIG_MODE_TT static inline int convert_fxsr_from_user_tt(struct pt_regs *regs, - struct _fpstate *buf) + struct _fpstate __user *buf) { struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs)); unsigned long env[7]; struct _fpxreg *to; - struct _fpreg *from; + struct _fpreg __user *from; int i; if ( __copy_from_user( env, buf, 7 * sizeof(long) ) ) @@ -242,7 +246,7 @@ static inline int convert_fxsr_from_user_tt(struct pt_regs *regs, #endif static inline int convert_fxsr_from_user(struct pt_regs *regs, - struct _fpstate *buf) + struct _fpstate __user *buf) { return(CHOOSE_MODE(convert_fxsr_from_user_tt(regs, buf), 0)); } @@ -251,7 +255,7 @@ int get_fpregs(unsigned long buf, struct task_struct *child) { int err; - err = convert_fxsr_to_user((struct _fpstate *) buf, + err = convert_fxsr_to_user((struct _fpstate __user *) buf, &child->thread.regs); if(err) return(-EFAULT); else return(0); @@ -262,7 +266,7 @@ int set_fpregs(unsigned long buf, struct task_struct *child) int err; err = convert_fxsr_from_user(&child->thread.regs, - (struct _fpstate *) buf); + (struct _fpstate __user *) buf); if(err) return(-EFAULT); else return(0); } @@ -274,7 +278,7 @@ int get_fpxregs_tt(unsigned long buf, struct task_struct *tsk) struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs)); int err; - err = __copy_to_user((void *) buf, fxsave, + err = __copy_to_user((void __user *) buf, fxsave, sizeof(struct user_fxsr_struct)); if(err) return -EFAULT; else return 0; @@ -293,7 +297,7 @@ int set_fpxregs_tt(unsigned long buf, struct task_struct *tsk) struct i387_fxsave_struct *fxsave = SC_FXSR_ENV(PT_REGS_SC(regs)); int err; - err = __copy_from_user(fxsave, (void *) buf, + err = __copy_from_user(fxsave, (void __user *) buf, sizeof(struct user_fxsr_struct) ); if(err) return -EFAULT; else return 0; diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c index b1021e82b..69aa6d6d1 100644 --- a/arch/um/sys-i386/ptrace_user.c +++ b/arch/um/sys-i386/ptrace_user.c @@ -17,17 +17,30 @@ int ptrace_getregs(long pid, unsigned long *regs_out) { - return(ptrace(PTRACE_GETREGS, pid, 0, regs_out)); + if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0) + return -errno; + return 0; } int ptrace_setregs(long pid, unsigned long *regs) { - return(ptrace(PTRACE_SETREGS, pid, 0, regs)); + if (ptrace(PTRACE_SETREGS, pid, 0, regs) < 0) + return -errno; + return 0; } int ptrace_getfpregs(long pid, unsigned long *regs) { - return(ptrace(PTRACE_GETFPREGS, pid, 0, regs)); + if (ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0) + return -errno; + return 0; +} + +int ptrace_setfpregs(long pid, unsigned long *regs) +{ + if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0) + return -errno; + return 0; } static void write_debugregs(int pid, unsigned long *regs) diff --git a/arch/um/sys-i386/sigcontext.c b/arch/um/sys-i386/sigcontext.c index 28b16cd1b..467d489c3 100644 --- a/arch/um/sys-i386/sigcontext.c +++ b/arch/um/sys-i386/sigcontext.c @@ -9,29 +9,20 @@ #include #include "sysdep/ptrace.h" #include "kern_util.h" -#include "frame_user.h" - -int sc_size(void *data) -{ - struct arch_frame_data *arch = data; - - return(sizeof(struct sigcontext) + arch->fpstate_size); -} void sc_to_sc(void *to_ptr, void *from_ptr) { struct sigcontext *to = to_ptr, *from = from_ptr; - int size = sizeof(*to) + signal_frame_sc.common.arch.fpstate_size; - memcpy(to, from, size); - if(from->fpstate != NULL) to->fpstate = (struct _fpstate *) (to + 1); + memcpy(to, from, sizeof(*to) + sizeof(struct _fpstate)); + if(from->fpstate != NULL) + to->fpstate = (struct _fpstate *) (to + 1); } unsigned long *sc_sigmask(void *sc_ptr) { struct sigcontext *sc = sc_ptr; - - return(&sc->oldmask); + return &sc->oldmask; } int sc_get_fpregs(unsigned long buf, void *sc_ptr) diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c index 6ad31749b..dd58b5511 100644 --- a/arch/um/sys-i386/syscalls.c +++ b/arch/um/sys-i386/syscalls.c @@ -1,9 +1,11 @@ /* - * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) * Licensed under the GPL */ #include "linux/sched.h" +#include "linux/shm.h" +#include "asm/ipc.h" #include "asm/mman.h" #include "asm/uaccess.h" #include "asm/unistd.h" @@ -28,7 +30,7 @@ extern int old_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long offset); -int old_mmap_i386(struct mmap_arg_struct *arg) +long old_mmap_i386(struct mmap_arg_struct __user *arg) { struct mmap_arg_struct a; int err = -EFAULT; @@ -43,11 +45,13 @@ int old_mmap_i386(struct mmap_arg_struct *arg) struct sel_arg_struct { unsigned long n; - fd_set *inp, *outp, *exp; - struct timeval *tvp; + fd_set __user *inp; + fd_set __user *outp; + fd_set __user *exp; + struct timeval __user *tvp; }; -int old_select(struct sel_arg_struct *arg) +long old_select(struct sel_arg_struct __user *arg) { struct sel_arg_struct a; @@ -60,8 +64,8 @@ int old_select(struct sel_arg_struct *arg) /* The i386 version skips reading from %esi, the fourth argument. So we must do * this, too. */ -int sys_clone(unsigned long clone_flags, unsigned long newsp, int *parent_tid, - int unused, int *child_tid) +long sys_clone(unsigned long clone_flags, unsigned long newsp, + int __user *parent_tid, int unused, int __user *child_tid) { long ret; @@ -78,6 +82,122 @@ int sys_clone(unsigned long clone_flags, unsigned long newsp, int *parent_tid, return(ret); } +/* + * sys_ipc() is the de-multiplexer for the SysV IPC calls.. + * + * This is really horribly ugly. + */ +long sys_ipc (uint call, int first, int second, + int third, void *__user ptr, long fifth) +{ + int version, ret; + + version = call >> 16; /* hack for backward compatibility */ + call &= 0xffff; + + switch (call) { + case SEMOP: + return sys_semtimedop(first, (struct sembuf *) ptr, second, + NULL); + case SEMTIMEDOP: + return sys_semtimedop(first, (struct sembuf *) ptr, second, + (const struct timespec *) fifth); + case SEMGET: + return sys_semget (first, second, third); + case SEMCTL: { + union semun fourth; + if (!ptr) + return -EINVAL; + if (get_user(fourth.__pad, (void **) ptr)) + return -EFAULT; + return sys_semctl (first, second, third, fourth); + } + + case MSGSND: + return sys_msgsnd (first, (struct msgbuf *) ptr, + second, third); + case MSGRCV: + switch (version) { + case 0: { + struct ipc_kludge tmp; + if (!ptr) + return -EINVAL; + + if (copy_from_user(&tmp, + (struct ipc_kludge *) ptr, + sizeof (tmp))) + return -EFAULT; + return sys_msgrcv (first, tmp.msgp, second, + tmp.msgtyp, third); + } + default: + panic("msgrcv with version != 0"); + return sys_msgrcv (first, + (struct msgbuf *) ptr, + second, fifth, third); + } + case MSGGET: + return sys_msgget ((key_t) first, second); + case MSGCTL: + return sys_msgctl (first, second, (struct msqid_ds *) ptr); + + case SHMAT: + switch (version) { + default: { + ulong raddr; + ret = do_shmat (first, (char *) ptr, second, &raddr); + if (ret) + return ret; + return put_user (raddr, (ulong *) third); + } + case 1: /* iBCS2 emulator entry point */ + if (!segment_eq(get_fs(), get_ds())) + return -EINVAL; + return do_shmat (first, (char *) ptr, second, (ulong *) third); + } + case SHMDT: + return sys_shmdt ((char *)ptr); + case SHMGET: + return sys_shmget (first, second, third); + case SHMCTL: + return sys_shmctl (first, second, + (struct shmid_ds *) ptr); + default: + return -ENOSYS; + } +} + +long sys_sigaction(int sig, const struct old_sigaction __user *act, + struct old_sigaction __user *oact) +{ + struct k_sigaction new_ka, old_ka; + int ret; + + if (act) { + old_sigset_t mask; + if (verify_area(VERIFY_READ, act, sizeof(*act)) || + __get_user(new_ka.sa.sa_handler, &act->sa_handler) || + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) + return -EFAULT; + __get_user(new_ka.sa.sa_flags, &act->sa_flags); + __get_user(mask, &act->sa_mask); + siginitset(&new_ka.sa.sa_mask, mask); + } + + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); + + if (!ret && oact) { + if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) + return -EFAULT; + __put_user(old_ka.sa.sa_flags, &oact->sa_flags); + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); + } + + return ret; +} + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/arch/um/sys-i386/sysrq.c b/arch/um/sys-i386/sysrq.c index 51333335b..281fc7b8c 100644 --- a/arch/um/sys-i386/sysrq.c +++ b/arch/um/sys-i386/sysrq.c @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com) + * Licensed under the GPL + */ + #include "linux/kernel.h" #include "linux/smp.h" #include "linux/sched.h" diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index 5775f4fa7..80f526502 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig @@ -19,6 +19,9 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool default n +config GENERIC_CALIBRATE_DELAY + bool + default y # Turn off some random 386 crap that can affect device config config ISA diff --git a/arch/v850/kernel/fpga85e2c.c b/arch/v850/kernel/fpga85e2c.c index 17e3dbafc..4bac5149b 100644 --- a/arch/v850/kernel/fpga85e2c.c +++ b/arch/v850/kernel/fpga85e2c.c @@ -20,11 +20,11 @@ #include #include #include +#include #include #include #include -#include #include "mach.h" @@ -42,7 +42,6 @@ void __init mach_early_init (void) int i; const u32 *src; register u32 *dst asm ("ep"); - extern int panic_timeout; extern u32 _intv_end, _intv_load_start; /* Set bus sizes: CS0 32-bit, CS1 16-bit, CS7 8-bit, diff --git a/arch/v850/kernel/memcons.c b/arch/v850/kernel/memcons.c index 9bd818b0f..491614c43 100644 --- a/arch/v850/kernel/memcons.c +++ b/arch/v850/kernel/memcons.c @@ -25,7 +25,7 @@ extern char memcons_output[], memcons_output_end; static unsigned long memcons_offs = 0; /* Spinlock protecting memcons_offs. */ -static spinlock_t memcons_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(memcons_lock); static size_t write (const char *buf, size_t len) @@ -88,8 +88,7 @@ int memcons_tty_open (struct tty_struct *tty, struct file *filp) return 0; } -int memcons_tty_write (struct tty_struct *tty, int from_user, - const unsigned char *buf, int len) +int memcons_tty_write (struct tty_struct *tty, const unsigned char *buf, int len) { return write (buf, len); } diff --git a/arch/v850/kernel/ptrace.c b/arch/v850/kernel/ptrace.c index bf43ea660..c9528ad49 100644 --- a/arch/v850/kernel/ptrace.c +++ b/arch/v850/kernel/ptrace.c @@ -1,8 +1,8 @@ /* * arch/v850/kernel/ptrace.c -- `ptrace' system call * - * Copyright (C) 2002,03 NEC Electronics Corporation - * Copyright (C) 2002,03 Miles Bader + * Copyright (C) 2002,03,04 NEC Electronics Corporation + * Copyright (C) 2002,03,04 Miles Bader * * Derived from arch/mips/kernel/ptrace.c: * @@ -149,8 +149,8 @@ int sys_ptrace(long request, long pid, long addr, long data) rval = ptrace_attach(child); goto out_tsk; } - ret = ptrace_check_attach(child, request == PTRACE_KILL); - if (ret < 0) + rval = ptrace_check_attach(child, request == PTRACE_KILL); + if (rval < 0) goto out_tsk; switch (request) { @@ -234,7 +234,7 @@ int sys_ptrace(long request, long pid, long addr, long data) */ case PTRACE_KILL: rval = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); diff --git a/arch/v850/kernel/rte_cb_leds.c b/arch/v850/kernel/rte_cb_leds.c index 0dd9bf1dd..b662ad838 100644 --- a/arch/v850/kernel/rte_cb_leds.c +++ b/arch/v850/kernel/rte_cb_leds.c @@ -25,7 +25,7 @@ static unsigned char leds_image[LED_NUM_DIGITS] = { 0 }; /* Spinlock protecting the above leds. */ -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); /* Common body of LED read/write functions, checks POS and LEN for correctness, declares a variable using IMG_DECL, initialized pointing at diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index 551c41ba0..074b50abc 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c @@ -254,7 +254,7 @@ static void __devinit pcibios_assign_resources (void) struct pci_dev *dev = NULL; struct resource *r; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { unsigned di_num; unsigned class = dev->class >> 8; @@ -359,7 +359,7 @@ static struct mb_sram_free_area *mb_sram_free_areas = &mb_sram_free_tail; static struct mb_sram_free_area *mb_sram_free_free_areas = 0; /* Spinlock protecting the above globals. */ -static spinlock_t mb_sram_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mb_sram_lock); /* Allocate a memory block at least SIZE bytes long in the Mother-A SRAM space. */ @@ -514,7 +514,7 @@ static struct dma_mapping *active_dma_mappings = 0; static struct dma_mapping *free_dma_mappings = 0; /* Spinlock protecting the above globals. */ -static spinlock_t dma_mappings_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dma_mappings_lock); static struct dma_mapping *new_dma_mapping (size_t size) { diff --git a/arch/v850/kernel/semaphore.c b/arch/v850/kernel/semaphore.c index 2d2088686..fc89fd661 100644 --- a/arch/v850/kernel/semaphore.c +++ b/arch/v850/kernel/semaphore.c @@ -55,7 +55,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { diff --git a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c index 60098e4f0..9432ff84a 100644 --- a/arch/v850/kernel/signal.c +++ b/arch/v850/kernel/signal.c @@ -427,11 +427,9 @@ give_sigsegv: */ static void -handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, - struct pt_regs * regs) +handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, + sigset_t *oldset, struct pt_regs * regs) { - struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - /* Are we from a system call? */ if (PT_REGS_SYSCALL (regs)) { /* If so, check system call restarting.. */ @@ -464,9 +462,6 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, else setup_frame(sig, ka, oldset, regs); - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; - if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); @@ -489,6 +484,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) { siginfo_t info; int signr; + struct k_sigaction ka; /* * We want the common case to go fast, which @@ -502,10 +498,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs, NULL); + signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ - handle_signal(signr, &info, oldset, regs); + handle_signal(signr, &info, &ka, oldset, regs); return 1; } diff --git a/arch/v850/kernel/sim85e2.c b/arch/v850/kernel/sim85e2.c index 593998bb8..93a722b51 100644 --- a/arch/v850/kernel/sim85e2.c +++ b/arch/v850/kernel/sim85e2.c @@ -65,8 +65,6 @@ extern void memcons_setup (void); void EARLY_INIT_SECTION_ATTR mach_early_init (void) { - extern int panic_timeout; - /* The sim85e2 simulator tracks `undefined' values, so to make debugging easier, we begin by zeroing out all otherwise undefined registers. This is not strictly necessary. diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c index 9aed8871b..7f0efaa02 100644 --- a/arch/v850/kernel/simcons.c +++ b/arch/v850/kernel/simcons.c @@ -59,7 +59,7 @@ int simcons_tty_open (struct tty_struct *tty, struct file *filp) return 0; } -int simcons_tty_write (struct tty_struct *tty, int from_user, +int simcons_tty_write (struct tty_struct *tty, const unsigned char *buf, int count) { return V850_SIM_SYSCALL (write, 1, buf, count); diff --git a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c index d0266de06..f722a2682 100644 --- a/arch/v850/kernel/time.c +++ b/arch/v850/kernel/time.c @@ -56,6 +56,9 @@ static irqreturn_t timer_interrupt (int irq, void *dummy, struct pt_regs *regs) mach_tick (); do_timer (regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #if 0 /* diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S index bab351c37..bbd3429bc 100644 --- a/arch/v850/kernel/vmlinux.lds.S +++ b/arch/v850/kernel/vmlinux.lds.S @@ -60,6 +60,11 @@ ___start___kcrctab_gpl = .; \ *(__kcrctab_gpl) \ ___stop___kcrctab_gpl = .; \ + /* Built-in module parameters */ \ + ___start___param = .; \ + *(__param) \ + ___stop___param = .; + /* Kernel text segment, and some constant data areas. */ #define TEXT_CONTENTS \ diff --git a/arch/v850/lib/checksum.c b/arch/v850/lib/checksum.c index 17eb3851e..d308b724c 100644 --- a/arch/v850/lib/checksum.c +++ b/arch/v850/lib/checksum.c @@ -121,7 +121,7 @@ EXPORT_SYMBOL(csum_partial); /* * copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy(const char *src, char *dst, +unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { /* @@ -138,7 +138,7 @@ unsigned int csum_partial_copy(const char *src, char *dst, * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user (const char *src, char *dst, +unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { diff --git a/arch/v850/lib/memcpy.c b/arch/v850/lib/memcpy.c index 3a4c1f685..492847b3e 100644 --- a/arch/v850/lib/memcpy.c +++ b/arch/v850/lib/memcpy.c @@ -60,11 +60,6 @@ void *memcpy (void *dst, const void *src, __kernel_size_t size) return dst; } -void bcopy (const char *src, char *dst, int size) -{ - memcpy (dst, src, size); -} - void *memmove (void *dst, const void *src, __kernel_size_t size) { if ((unsigned long)dst < (unsigned long)src diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 7bb22c5d1..9116dbbed 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -41,6 +41,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_CALIBRATE_DELAY + bool + default y + config X86_CMPXCHG bool default y @@ -48,15 +52,6 @@ config X86_CMPXCHG config EARLY_PRINTK bool default y - help - Write kernel log output directly into the VGA buffer or to a serial - port. - - This is useful for kernel debugging when your machine crashes very - early before the console code is initialized. For normal operation - it is not recommended because it looks ugly and doesn't cooperate - with klogd/syslogd or the X server. You should normally N here, - unless you want to debug such a crash. config HPET_TIMER bool @@ -72,7 +67,8 @@ config HPET_TIMER If unsure, say Y. config HPET_EMULATE_RTC - def_bool HPET_TIMER && RTC=y + bool "Provide RTC interrupt" + depends on HPET_TIMER && RTC=y config GENERIC_ISA_DMA bool @@ -97,10 +93,11 @@ config MK8 Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. config MPSC - bool "Intel x86-64" + bool "Intel EM64T" help - Optimize for Intel IA32 with 64bit extension CPUs - (Prescott/Nocona/Potomac) + Optimize for Intel Pentium 4 and Xeon CPUs with Intel + Extended Memory 64 Technology(EM64T). For details see + . config GENERIC_CPU bool "Generic-x86-64" @@ -243,6 +240,17 @@ config PREEMPT Say Y here if you are feeling brave and building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +config PREEMPT_BKL + bool "Preempt The Big Kernel Lock" + depends on PREEMPT + default y + help + This option reduces the latency of the kernel by making the + big kernel lock preemptible. + + Say Y here if you are building a kernel for a desktop system. + Say N if you are unsure. + config SCHED_SMT bool "SMT (Hyperthreading) scheduler support" depends on SMP @@ -255,6 +263,7 @@ config SCHED_SMT config K8_NUMA bool "K8 NUMA support" + select NUMA depends on SMP help Enable NUMA (Non Unified Memory Architecture) support for @@ -264,38 +273,45 @@ config K8_NUMA This code is recommended on all multiprocessor Opteron systems and normally doesn't hurt on others. +config NUMA_EMU + bool "NUMA emulation support" + select NUMA + depends on SMP + help + Enable NUMA emulation. A flat machine will be split + into virtual nodes when booted with "numa=fake=N", where N is the + number of nodes. This is only useful for debugging. + config DISCONTIGMEM bool - depends on K8_NUMA + depends on NUMA default y config NUMA bool - depends on K8_NUMA - default y + default n config HAVE_DEC_LOCK bool depends on SMP default y -# actually 64 maximum, but you need to fix the APIC code first -# to use clustered mode or whatever your big iron needs config NR_CPUS - int "Maximum number of CPUs (2-8)" - range 2 8 + int "Maximum number of CPUs (2-256)" + range 2 256 depends on SMP default "8" help This allows you to specify the maximum number of CPUs which this - kernel will support. The maximum supported value is 32 and the - minimum value which makes sense is 2. + kernel will support. Current maximum is 256 CPUs due to + APIC addressing limits. Less depending on the hardware. This is purely to save memory - each supported CPU requires memory in the static kernel configuration. config GART_IOMMU bool "IOMMU support" + depends on PCI help Support the K8 IOMMU. Needed to run systems with more than 4GB of memory properly with 32-bit PCI devices that do not support DAC (Double Address @@ -327,8 +343,25 @@ config X86_MCE machine check error logs. See ftp://ftp.x86-64.org/pub/linux/tools/mcelog +config X86_MCE_INTEL + bool "Intel MCE features" + depends on X86_MCE && X86_LOCAL_APIC + default y + help + Additional support for intel specific MCE features such as + the thermal monitor. endmenu +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + +config GENERIC_IRQ_PROBE + bool + default y menu "Power management options" diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug index 2ba7f5a05..9cf1410d2 100644 --- a/arch/x86_64/Kconfig.debug +++ b/arch/x86_64/Kconfig.debug @@ -18,18 +18,6 @@ config INIT_DEBUG Fill __init and __initdata at the end of boot. This helps debugging illegal uses of __init and __initdata after initialization. -config SCHEDSTATS - bool "Collect scheduler statistics" - depends on DEBUG_KERNEL && PROC_FS - help - If you say Y here, additional code will be inserted into the - scheduler and related routines to collect statistics about - scheduler behavior and provide them in /proc/schedstat. These - stats may be useful for both tuning and debugging the scheduler - If you aren't debugging the scheduler or trying to tune a specific - application, you can say N to avoid the very slight overhead - this adds. - config IOMMU_DEBUG depends on GART_IOMMU && DEBUG_KERNEL bool "Enable IOMMU debugging" @@ -45,6 +33,16 @@ config IOMMU_DEBUG options. See Documentation/x86_64/boot-options.txt for more details. +config KPROBES + bool "Kprobes" + depends on DEBUG_KERNEL + help + Kprobes allows you to trap at almost any kernel address and + execute a callback function. register_kprobe() establishes + a probepoint and specifies the callback. Kprobes is useful + for kernel debugging, non-intrusive instrumentation and testing. + If in doubt, say "N". + config IOMMU_LEAK bool "IOMMU leak tracing" depends on DEBUG_KERNEL diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index a69f7bcdf..6f90c246c 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -59,6 +59,8 @@ endif # -funit-at-a-time shrinks the kernel .text considerably # unfortunately it makes reading oopses harder. CFLAGS += $(call cc-option,-funit-at-a-time) +# prevent gcc from generating any FP code by mistake +CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile index 99b790439..f4399c701 100644 --- a/arch/x86_64/boot/Makefile +++ b/arch/x86_64/boot/Makefile @@ -31,6 +31,7 @@ targets := vmlinux.bin bootsect bootsect.o \ EXTRA_CFLAGS := -m32 hostprogs-y := tools/build +HOST_EXTRACFLAGS += $(LINUXINCLUDE) subdir- := compressed/ #Let make clean descend in compressed/ # --------------------------------------------------------------------------- diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86_64/boot/compressed/Makefile index 759956d1b..f89d96f11 100644 --- a/arch/x86_64/boot/compressed/Makefile +++ b/arch/x86_64/boot/compressed/Makefile @@ -11,7 +11,7 @@ EXTRA_AFLAGS := -traditional -m32 # cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with # -m32 -CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2 +CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2 -fno-strict-aliasing LDFLAGS := -m elf_i386 LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 -m elf_i386 diff --git a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S index fc52ed801..3e838be9d 100644 --- a/arch/x86_64/boot/setup.S +++ b/arch/x86_64/boot/setup.S @@ -158,7 +158,9 @@ cmd_line_ptr: .long 0 # (Header version 0x0202 or later) ramdisk_max: .long 0xffffffff trampoline: call start_of_setup - .space 1024 + .align 16 + # The offset at this point is 0x240 + .space (0x7ff-0x240+1) # E820 & EDD space (ending at 0x7ff) # End of setup header ##################################################### start_of_setup: diff --git a/arch/x86_64/boot/video.S b/arch/x86_64/boot/video.S index fd0cc734a..0587477c9 100644 --- a/arch/x86_64/boot/video.S +++ b/arch/x86_64/boot/video.S @@ -1936,7 +1936,7 @@ store_edid: movl $0x13131313, %eax # memset block with 0x13 movw $32, %cx - movw $0x440, %di + movw $0x140, %di cld rep stosl @@ -1945,7 +1945,7 @@ store_edid: movw $0x01, %bx movw $0x00, %cx movw $0x01, %dx - movw $0x440, %di + movw $0x140, %di int $0x10 popw %di # restore all registers diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index ae2f4bfea..941e9b930 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc1-bk19 -# Sun Sep 12 23:13:23 2004 +# Linux kernel version: 2.6.10-bk7 +# Fri Jan 7 06:27:52 2005 # CONFIG_X86_64=y CONFIG_64BIT=y @@ -13,12 +13,14 @@ CONFIG_EARLY_PRINTK=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y # # General setup @@ -32,6 +34,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=18 # CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set @@ -40,12 +43,12 @@ CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # @@ -56,6 +59,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set CONFIG_STOP_MACHINE=y @@ -80,6 +84,7 @@ CONFIG_SMP=y # CONFIG_PREEMPT is not set CONFIG_SCHED_SMT=y CONFIG_K8_NUMA=y +# CONFIG_NUMA_EMU is not set CONFIG_DISCONTIGMEM=y CONFIG_NUMA=y CONFIG_HAVE_DEC_LOCK=y @@ -87,12 +92,17 @@ CONFIG_NR_CPUS=8 CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y +CONFIG_X86_MCE_INTEL=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Power management options # CONFIG_PM=y +# CONFIG_PM_DEBUG is not set CONFIG_SOFTWARE_SUSPEND=y +CONFIG_PM_STD_PARTITION="" # # ACPI (Advanced Configuration and Power Interface) Support @@ -105,22 +115,50 @@ CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y +# CONFIG_ACPI_VIDEO is not set CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y +CONFIG_ACPI_NUMA=y # CONFIG_ACPI_ASUS is not set +# CONFIG_ACPI_IBM is not set CONFIG_ACPI_TOSHIBA=y +CONFIG_ACPI_BLACKLIST_YEAR=2001 CONFIG_ACPI_DEBUG=y CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y +# CONFIG_ACPI_CONTAINER is not set # # CPU Frequency scaling # -# CONFIG_CPU_FREQ is not set +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_PROC_INTF=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_24_API=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_TABLE=y + +# +# CPUFreq processor drivers +# +CONFIG_X86_POWERNOW_K8=y +CONFIG_X86_POWERNOW_K8_ACPI=y +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +CONFIG_X86_ACPI_CPUFREQ=y + +# +# shared options +# +CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y # # Bus options (PCI etc.) @@ -168,6 +206,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -183,9 +222,20 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support @@ -205,7 +255,6 @@ CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -222,7 +271,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y @@ -278,6 +326,7 @@ 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 # # SCSI low-level drivers @@ -298,6 +347,7 @@ CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y +# CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set CONFIG_SCSI_ATA_PIIX=y # CONFIG_SCSI_SATA_NV is not set @@ -305,6 +355,7 @@ CONFIG_SCSI_ATA_PIIX=y # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set CONFIG_SCSI_SATA_VIA=y # CONFIG_SCSI_SATA_VITESSE is not set # CONFIG_SCSI_BUSLOGIC is not set @@ -314,6 +365,7 @@ CONFIG_SCSI_SATA_VIA=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set @@ -326,7 +378,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -379,6 +430,8 @@ CONFIG_IP_MULTICAST=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +CONFIG_IP_TCPDIAG_IPV6=y CONFIG_IPV6=y # CONFIG_IPV6_PRIVACY is not set # CONFIG_INET6_AH is not set @@ -404,7 +457,6 @@ CONFIG_IPV6=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set -# CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing @@ -471,7 +523,6 @@ CONFIG_8139TOO=m # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) @@ -485,13 +536,16 @@ CONFIG_E1000=y # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set -# CONFIG_S2IO is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +# CONFIG_2BUFF_MODE is not set # # Token Ring devices @@ -552,6 +606,7 @@ CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set # # Input Device Drivers @@ -714,6 +769,8 @@ CONFIG_USB_DEVICEFS=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers @@ -722,7 +779,8 @@ CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=y -# CONFIG_USB_UHCI_HCD is not set +CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -732,6 +790,10 @@ CONFIG_USB_OHCI_HCD=y # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set @@ -745,7 +807,7 @@ CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_JUMPSHOT is not set # -# USB Human Interface Devices (HID) +# USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y @@ -777,7 +839,7 @@ CONFIG_USB_HIDINPUT=y # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -806,14 +868,29 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set +# +# USB ATM/DSL drivers +# + # # USB Gadget Support # # CONFIG_USB_GADGET is not set +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + # # Firmware Drivers # @@ -845,6 +922,7 @@ CONFIG_FS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS4_FS is not set @@ -859,8 +937,11 @@ CONFIG_ISO9660_FS=y # # DOS/FAT/NT Filesystems # -# CONFIG_MSDOS_FS is not set -# CONFIG_VFAT_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # @@ -872,6 +953,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y @@ -925,7 +1007,46 @@ CONFIG_MSDOS_PARTITION=y # # Native Language Support # -# CONFIG_NLS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +CONFIG_NLS_ISO8859_15=y +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y # # Profiling support @@ -938,18 +1059,20 @@ CONFIG_OPROFILE=y # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set -# CONFIG_FRAME_POINTER is not set -# CONFIG_INIT_DEBUG is not set -# CONFIG_SCHEDSTATS is not set +CONFIG_INIT_DEBUG=y # CONFIG_IOMMU_DEBUG is not set +CONFIG_KPROBES=y # # Security options # +# CONFIG_KEYS is not set # CONFIG_SECURITY is not set # @@ -957,6 +1080,10 @@ CONFIG_MAGIC_SYSRQ=y # # CONFIG_CRYPTO is not set +# +# Hardware crypto devices +# + # # Library routines # diff --git a/arch/x86_64/ia32/fpu32.c b/arch/x86_64/ia32/fpu32.c index f9a2638c8..1c23095f1 100644 --- a/arch/x86_64/ia32/fpu32.c +++ b/arch/x86_64/ia32/fpu32.c @@ -28,16 +28,17 @@ static inline unsigned short twd_i387_to_fxsr(unsigned short twd) static inline unsigned long twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave) { struct _fpxreg *st = NULL; + unsigned long tos = (fxsave->swd >> 11) & 7; unsigned long twd = (unsigned long) fxsave->twd; unsigned long tag; unsigned long ret = 0xffff0000; int i; -#define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16); +#define FPREG_ADDR(f, n) ((void *)&(f)->st_space + (n) * 16); for (i = 0 ; i < 8 ; i++) { if (twd & 0x1) { - st = (struct _fpxreg *) FPREG_ADDR( fxsave, i ); + st = FPREG_ADDR( fxsave, (i - tos) & 7 ); switch (st->exponent & 0x7fff) { case 0x7fff: @@ -156,7 +157,7 @@ int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, sizeof(struct i387_fxsave_struct))) return -1; tsk->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask; - tsk->used_math = 1; + set_stopped_child_used_math(tsk); } return convert_fxsr_from_user(&tsk->thread.i387.fxsave, buf); } diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c index fe6bae25e..a706c7da8 100644 --- a/arch/x86_64/ia32/ia32_aout.c +++ b/arch/x86_64/ia32/ia32_aout.c @@ -32,11 +32,13 @@ #include #include #include +#include #undef WARN_OLD #undef CORE_DUMP /* probably broken */ -extern int ia32_setup_arg_pages(struct linux_binprm *bprm, int exec_stack); +extern int ia32_setup_arg_pages(struct linux_binprm *bprm, + unsigned long stack_top, int exec_stack); static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); static int load_aout_library(struct file*); @@ -114,7 +116,9 @@ static void set_brk(unsigned long start, unsigned long end) end = PAGE_ALIGN(end); if (end <= start) return; + down_write(¤t->mm->mmap_sem); do_brk(start, end - start); + up_write(¤t->mm->mmap_sem); } #if CORE_DUMP @@ -169,12 +173,12 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file) /* If the size of the dump file exceeds the rlimit, then see what would happen if we wrote the stack, but not the data area. */ if ((dump.u_dsize+dump.u_ssize+1) * PAGE_SIZE > - current->rlim[RLIMIT_CORE].rlim_cur) + current->signal->rlim[RLIMIT_CORE].rlim_cur) dump.u_dsize = 0; /* Make sure we have enough room to write the stack and data areas. */ if ((dump.u_ssize+1) * PAGE_SIZE > - current->rlim[RLIMIT_CORE].rlim_cur) + current->signal->rlim[RLIMIT_CORE].rlim_cur) dump.u_ssize = 0; /* make sure we actually have a data and stack area to dump */ @@ -282,7 +286,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) * size limits imposed on them by creating programs with large * arrays in the data or bss. */ - rlim = current->rlim[RLIMIT_DATA].rlim_cur; + rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur; if (rlim >= RLIM_INFINITY) rlim = ~0; if (ex.a_data + ex.a_bss > rlim) @@ -325,7 +329,10 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) pos = 32; map_size = ex.a_text+ex.a_data; + down_write(¤t->mm->mmap_sem); error = do_brk(text_addr & PAGE_MASK, map_size); + up_write(¤t->mm->mmap_sem); + if (error != (text_addr & PAGE_MASK)) { send_sig(SIGKILL, current, 0); return error; @@ -361,7 +368,9 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) { loff_t pos = fd_offset; + down_write(¤t->mm->mmap_sem); do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); + up_write(¤t->mm->mmap_sem); bprm->file->f_op->read(bprm->file,(char *)N_TXTADDR(ex), ex.a_text+ex.a_data, &pos); flush_icache_range((unsigned long) N_TXTADDR(ex), @@ -398,7 +407,7 @@ beyond_if: set_brk(current->mm->start_brk, current->mm->brk); - retval = ia32_setup_arg_pages(bprm, EXSTACK_DEFAULT); + retval = ia32_setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); if (retval < 0) { /* Someone check-me: is this error path enough? */ send_sig(SIGKILL, current, 0); @@ -469,8 +478,9 @@ static int load_aout_library(struct file *file) error_time = jiffies; } #endif - + down_write(¤t->mm->mmap_sem); do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); + up_write(¤t->mm->mmap_sem); file->f_op->read(file, (char *)start_addr, ex.a_text + ex.a_data, &pos); @@ -494,7 +504,9 @@ static int load_aout_library(struct file *file) len = PAGE_ALIGN(ex.a_text + ex.a_data); bss = ex.a_text + ex.a_data + ex.a_bss; if (bss > len) { + down_write(¤t->mm->mmap_sem); error = do_brk(start_addr + len, bss - len); + up_write(¤t->mm->mmap_sem); retval = error; if (error != start_addr + len) goto out; diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index 0992f5934..c4cefce0b 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c @@ -182,6 +182,7 @@ struct elf_prpsinfo #define user user32 #define __ASM_X86_64_ELF_H 1 +#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack)) //#include #include @@ -213,7 +214,7 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr struct _fpstate_ia32 *fpstate = (void*)fpu; mm_segment_t oldfs = get_fs(); - if (!tsk->used_math) + if (!tsk_used_math(tsk)) return 0; if (!regs) regs = (struct pt_regs *)tsk->thread.rsp0; @@ -234,7 +235,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) { struct pt_regs *regs = ((struct pt_regs *)(t->thread.rsp0))-1; - if (!t->used_math) + if (!tsk_used_math(t)) return 0; if (t == current) unlazy_fpu(t); @@ -248,6 +249,8 @@ elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) #define elf_check_arch(x) \ ((x)->e_machine == EM_386) +extern int force_personality32; + #define ELF_EXEC_PAGESIZE PAGE_SIZE #define ELF_HWCAP (boot_cpu_data.x86_capability[0]) #define ELF_PLATFORM ("i686") @@ -261,6 +264,8 @@ do { \ set_thread_flag(TIF_ABI_PENDING); \ else \ clear_thread_flag(TIF_ABI_PENDING); \ + /* XXX This overwrites the user set personality */ \ + current->personality |= force_personality32; \ } while (0) /* Override some function names */ @@ -272,8 +277,9 @@ do { \ #define load_elf_binary load_elf32_binary #define ELF_PLAT_INIT(r, load_addr) elf32_init(r) -#define setup_arg_pages(bprm, exec_stack) ia32_setup_arg_pages(bprm, exec_stack) -int ia32_setup_arg_pages(struct linux_binprm *bprm, int executable_stack); +#define setup_arg_pages(bprm, stack_top, exec_stack) \ + ia32_setup_arg_pages(bprm, stack_top, exec_stack) +int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack); #undef start_thread #define start_thread(regs,new_rip,new_rsp) do { \ @@ -328,12 +334,12 @@ static void elf32_init(struct pt_regs *regs) me->thread.es = __USER_DS; } -int setup_arg_pages(struct linux_binprm *bprm, int executable_stack) +int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack) { unsigned long stack_base, grow; struct vm_area_struct *mpnt; struct mm_struct *mm = current->mm; - int i; + int i, ret; stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE; mm->arg_start = bprm->p + stack_base; @@ -363,14 +369,18 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack) mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; mpnt->vm_end = IA32_STACK_TOP; if (executable_stack == EXSTACK_ENABLE_X) - mpnt->vm_flags = vm_stack_flags32 | VM_EXEC; + mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; else if (executable_stack == EXSTACK_DISABLE_X) - mpnt->vm_flags = vm_stack_flags32 & ~VM_EXEC; + mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC; else - mpnt->vm_flags = vm_stack_flags32; + mpnt->vm_flags = VM_STACK_FLAGS; mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? PAGE_COPY_EXEC : PAGE_COPY; - insert_vm_struct(mm, mpnt); + if ((ret = insert_vm_struct(mm, mpnt))) { + up_write(&mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return ret; + } // mm->stack_vm = mm->total_vm = vma_pages(mpnt); vx_vmpages_sub(mm, mm->total_vm - vma_pages(mpnt)); mm->stack_vm = mm->total_vm; @@ -395,9 +405,6 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p unsigned long map_addr; struct task_struct *me = current; - if (prot & PROT_READ) - prot |= vm_force_exec32; - down_write(&me->mm->mmap_sem); map_addr = do_mmap(filep, ELF_PAGESTART(addr), eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot, diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c index 5fb7d173b..85534e58c 100644 --- a/arch/x86_64/ia32/ia32_signal.c +++ b/arch/x86_64/ia32/ia32_signal.c @@ -35,8 +35,6 @@ #include #include -#define ptr_to_u32(x) ((u32)(u64)(x)) /* avoid gcc warning */ - #define DEBUG_SIG 0 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) @@ -44,10 +42,10 @@ asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset); void signal_fault(struct pt_regs *regs, void __user *frame, char *where); -int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from) +int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) { int err; - if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32))) + if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t))) return -EFAULT; /* If you change siginfo_t structure, please make sure that @@ -62,7 +60,7 @@ int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from) if (from->si_code < 0) { err |= __put_user(from->si_pid, &to->si_pid); err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr); + err |= __put_user(ptr_to_compat(from->si_ptr), &to->si_ptr); } else { /* First 32bits of unions are always present: * si_pid === si_band === si_tid === si_addr(LS half) */ @@ -83,7 +81,7 @@ int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from) break; case __SI_TIMER >> 16: err |= __put_user(from->si_overrun, &to->si_overrun); - err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr); + err |= __put_user(ptr_to_compat(from->si_ptr), &to->si_ptr); break; case __SI_RT >> 16: /* This is not generated by the kernel as of now. */ case __SI_MESGQ >> 16: @@ -95,11 +93,11 @@ int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from) return err; } -int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from) +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) { int err; u32 ptr32; - if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32))) + if (!access_ok (VERIFY_READ, from, sizeof(compat_siginfo_t))) return -EFAULT; err = __get_user(to->si_signo, &from->si_signo); @@ -160,7 +158,7 @@ sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, set_fs(seg); if (ret >= 0 && uoss_ptr) { if (!access_ok(VERIFY_WRITE,uoss_ptr,sizeof(stack_ia32_t)) || - __put_user((u32)(u64)uoss.ss_sp, &uoss_ptr->ss_sp) || + __put_user(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp) || __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) || __put_user(uoss.ss_size, &uoss_ptr->ss_size)) ret = -EFAULT; @@ -188,7 +186,7 @@ struct rt_sigframe int sig; u32 pinfo; u32 puc; - struct siginfo32 info; + compat_siginfo_t info; struct ucontext_ia32 uc; struct _fpstate_ia32 fpstate; char retcode[8]; @@ -261,6 +259,12 @@ ia32_restore_sigcontext(struct pt_regs *regs, struct sigcontext_ia32 __user *sc, if (verify_area(VERIFY_READ, buf, sizeof(*buf))) goto badframe; err |= restore_i387_ia32(current, buf, 0); + } else { + struct task_struct *me = current; + if (used_math()) { + clear_fpu(me); + clear_used_math(); + } } } @@ -383,9 +387,9 @@ ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, struct _fpstate_ia32 __ if (tmp < 0) err = -EFAULT; else { - current->used_math = 0; + clear_used_math(); stts(); - err |= __put_user((u32)(u64)(tmp ? fpstate : NULL), &sc->fpstate); + err |= __put_user(ptr_to_compat(tmp ? fpstate : NULL), &sc->fpstate); } /* non-iBCS2 extensions.. */ @@ -461,7 +465,7 @@ void ia32_setup_frame(int sig, struct k_sigaction *ka, void __user *restorer = VSYSCALL32_SIGRETURN; if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; - err |= __put_user(ptr_to_u32(restorer), &frame->pretcode); + err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); } /* These are actually not used anymore, but left because some gdb versions depend on them as a marker. */ @@ -534,9 +538,9 @@ void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, : sig), &frame->sig); } - err |= __put_user((u32)(u64)&frame->info, &frame->pinfo); - err |= __put_user((u32)(u64)&frame->uc, &frame->puc); - err |= ia32_copy_siginfo_to_user(&frame->info, info); + err |= __put_user(ptr_to_compat(&frame->info), &frame->pinfo); + err |= __put_user(ptr_to_compat(&frame->uc), &frame->puc); + err |= copy_siginfo_to_user32(&frame->info, info); if (err) goto give_sigsegv; @@ -558,7 +562,7 @@ void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, void __user *restorer = VSYSCALL32_RTSIGRETURN; if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; - err |= __put_user(ptr_to_u32(restorer), &frame->pretcode); + err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); } /* This is movl $,%eax ; int $0x80 */ diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index b7660caca..d4cfaba16 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S @@ -315,7 +315,7 @@ ia32_sys_call_table: .quad sys_unlink /* 10 */ .quad stub32_execve .quad sys_chdir - .quad sys32_time + .quad compat_sys_time .quad sys_mknod .quad sys_chmod /* 15 */ .quad sys_lchown16 @@ -327,7 +327,7 @@ ia32_sys_call_table: .quad sys_oldumount /* old_umount */ .quad sys_setuid16 .quad sys_getuid16 - .quad sys_stime /* stime */ /* 25 */ + .quad compat_sys_stime /* stime */ /* 25 */ .quad sys32_ptrace /* ptrace */ .quad sys_alarm .quad sys_fstat /* (old)fstat */ @@ -388,10 +388,14 @@ ia32_sys_call_table: .quad sys_symlink .quad sys_lstat .quad sys_readlink /* 85 */ +#ifdef CONFIG_IA32_AOUT .quad sys_uselib +#else + .quad quiet_ni_syscall +#endif .quad sys_swapon .quad sys_reboot - .quad sys32_oldreaddir + .quad compat_sys_old_readdir .quad sys32_mmap /* 90 */ .quad sys_munmap .quad sys_truncate @@ -433,7 +437,7 @@ ia32_sys_call_table: .quad sys_init_module .quad sys_delete_module .quad quiet_ni_syscall /* 130 get_kernel_syms */ - .quad sys32_quotactl /* quotactl */ + .quad sys_quotactl .quad sys_getpgid .quad sys_fchdir .quad quiet_ni_syscall /* bdflush */ @@ -443,7 +447,7 @@ ia32_sys_call_table: .quad sys_setfsuid16 .quad sys_setfsgid16 .quad sys_llseek /* 140 */ - .quad sys32_getdents + .quad compat_sys_getdents .quad compat_sys_select .quad sys_flock .quad sys_msync @@ -479,7 +483,7 @@ ia32_sys_call_table: .quad sys32_rt_sigaction .quad sys32_rt_sigprocmask /* 175 */ .quad sys32_rt_sigpending - .quad sys32_rt_sigtimedwait + .quad compat_sys_rt_sigtimedwait .quad sys32_rt_sigqueueinfo .quad stub32_rt_sigsuspend .quad sys32_pread /* 180 */ @@ -522,7 +526,7 @@ ia32_sys_call_table: .quad sys_pivot_root .quad sys_mincore .quad sys_madvise - .quad sys_getdents64 /* 220 getdents64 */ + .quad compat_sys_getdents64 /* 220 getdents64 */ .quad compat_sys_fcntl64 .quad quiet_ni_syscall /* tux */ .quad quiet_ni_syscall /* security */ @@ -547,10 +551,10 @@ ia32_sys_call_table: .quad compat_sys_sched_getaffinity .quad sys32_set_thread_area .quad sys32_get_thread_area - .quad sys32_io_setup /* 245 */ + .quad compat_sys_io_setup /* 245 */ .quad sys_io_destroy - .quad sys32_io_getevents - .quad sys32_io_submit + .quad compat_sys_io_getevents + .quad compat_sys_io_submit .quad sys_io_cancel .quad sys_fadvise64 /* 250 */ .quad quiet_ni_syscall /* free_huge_pages */ @@ -562,22 +566,22 @@ ia32_sys_call_table: .quad sys_remap_file_pages .quad sys_set_tid_address .quad sys32_timer_create - .quad compat_timer_settime /* 260 */ - .quad compat_timer_gettime + .quad compat_sys_timer_settime /* 260 */ + .quad compat_sys_timer_gettime .quad sys_timer_getoverrun .quad sys_timer_delete - .quad compat_clock_settime - .quad compat_clock_gettime /* 265 */ - .quad compat_clock_getres - .quad compat_clock_nanosleep - .quad compat_statfs64 - .quad compat_fstatfs64 + .quad compat_sys_clock_settime + .quad compat_sys_clock_gettime /* 265 */ + .quad compat_sys_clock_getres + .quad compat_sys_clock_nanosleep + .quad compat_sys_statfs64 + .quad compat_sys_fstatfs64 .quad sys_tgkill /* 270 */ .quad compat_sys_utimes .quad sys32_fadvise64_64 .quad sys_vserver .quad sys_mbind - .quad compat_get_mempolicy /* 275 */ + .quad compat_sys_get_mempolicy /* 275 */ .quad sys_set_mempolicy .quad compat_sys_mq_open .quad sys_mq_unlink @@ -587,6 +591,10 @@ ia32_sys_call_table: .quad compat_sys_mq_getsetattr .quad quiet_ni_syscall /* reserved for kexec */ .quad sys32_waitid + .quad quiet_ni_syscall /* sys_altroot */ + .quad sys_add_key + .quad sys_request_key + .quad sys_keyctl /* don't forget to change IA32_NR_syscalls */ ia32_syscall_end: .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 diff --git a/arch/x86_64/ia32/ipc32.c b/arch/x86_64/ia32/ipc32.c index 6ba855511..369151dc3 100644 --- a/arch/x86_64/ia32/ipc32.c +++ b/arch/x86_64/ia32/ipc32.c @@ -49,7 +49,7 @@ sys32_ipc(u32 call, int first, int second, int third, case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); } diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index 4445da812..b98b6d246 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c @@ -109,7 +109,8 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) case offsetof(struct user32, u_debugreg[7]): val &= ~DR_CONTROL_RESERVED; - /* You are not expected to understand this ... I don't neither. */ + /* See arch/i386/kernel/ptrace.c for an explanation of + * this awkward check.*/ for(i=0; i<4; i++) if ((0x5454 >> ((val >> (16 + 4*i)) & 0xf)) & 1) return -EIO; @@ -357,14 +358,14 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) break; /* no checking to be bug-to-bug compatible with i386 */ __copy_from_user(&child->thread.i387.fxsave, u, sizeof(*u)); - child->used_math = 1; + set_stopped_child_used_math(child); child->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask; ret = 0; break; } case PTRACE_GETEVENTMSG: - ret = put_user(child->ptrace_message,(unsigned int __user *)(u64)data); + ret = put_user(child->ptrace_message,(unsigned int __user *)compat_ptr(data)); break; default: diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index 267a4a8e9..e0cc6ae57 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c @@ -73,10 +73,7 @@ #include #include -#define A(__x) ((unsigned long)(__x)) #define AA(__x) ((unsigned long)(__x)) -#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) -#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) int cp_compat_stat(struct kstat *kbuf, struct compat_stat __user *ubuf) { @@ -218,9 +215,6 @@ sys32_mmap(struct mmap_arg_struct __user *arg) return -EBADF; } - if (a.prot & PROT_READ) - a.prot |= vm_force_exec32; - mm = current->mm; down_write(&mm->mmap_sem); retval = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, a.offset>>PAGE_SHIFT); @@ -235,8 +229,6 @@ sys32_mmap(struct mmap_arg_struct __user *arg) asmlinkage long sys32_mprotect(unsigned long start, size_t len, unsigned long prot) { - if (prot & PROT_READ) - prot |= vm_force_exec32; return sys_mprotect(start,len,prot); } @@ -310,8 +302,8 @@ sys32_rt_sigaction(int sig, struct sigaction32 __user *act, set32.sig[0] = old_ka.sa.sa_mask.sig[0]; } if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) || + __put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler) || + __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer) || __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t))) return -EFAULT; @@ -347,8 +339,8 @@ sys32_sigaction (int sig, struct old_sigaction32 __user *act, struct old_sigacti if (!ret && oact) { if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) || + __put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler) || + __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer) || __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) return -EFAULT; @@ -478,134 +470,6 @@ sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); } -struct linux32_dirent { - u32 d_ino; - u32 d_off; - u16 d_reclen; - char d_name[1]; -}; - -struct old_linux32_dirent { - u32 d_ino; - u32 d_offset; - u16 d_namlen; - char d_name[1]; -}; - -struct getdents32_callback { - struct linux32_dirent __user * current_dir; - struct linux32_dirent __user * previous; - int count; - int error; -}; - -struct readdir32_callback { - struct old_linux32_dirent __user * dirent; - int count; -}; - -static int -filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino, - unsigned int d_type) -{ - struct linux32_dirent __user * dirent; - struct getdents32_callback * buf = (struct getdents32_callback *) __buf; - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2, 4); - - buf->error = -EINVAL; /* only used if we fail.. */ - if (reclen > buf->count) - return -EINVAL; - dirent = buf->previous; - if (dirent) - put_user(offset, &dirent->d_off); - dirent = buf->current_dir; - buf->previous = dirent; - put_user(ino, &dirent->d_ino); - put_user(reclen, &dirent->d_reclen); - copy_to_user(dirent->d_name, name, namlen); - put_user(0, dirent->d_name + namlen); - put_user(d_type, (char __user *)dirent + reclen - 1); - dirent = ((void __user *)dirent) + reclen; - buf->current_dir = dirent; - buf->count -= reclen; - return 0; -} - -asmlinkage long -sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count) -{ - struct file * file; - struct linux32_dirent __user * lastdirent; - struct getdents32_callback buf; - int error; - - error = -EBADF; - file = fget(fd); - if (!file) - goto out; - - buf.current_dir = (struct linux32_dirent __user *) dirent; - buf.previous = NULL; - buf.count = count; - buf.error = 0; - - error = vfs_readdir(file, filldir32, &buf); - if (error < 0) - goto out_putf; - error = buf.error; - lastdirent = buf.previous; - if (lastdirent) { - put_user(file->f_pos, &lastdirent->d_off); - error = count - buf.count; - } - -out_putf: - fput(file); -out: - return error; -} - -static int -fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, unsigned d_type) -{ - struct readdir32_callback * buf = (struct readdir32_callback *) __buf; - struct old_linux32_dirent __user * dirent; - - if (buf->count) - return -EINVAL; - buf->count++; - dirent = buf->dirent; - put_user(ino, &dirent->d_ino); - put_user(offset, &dirent->d_offset); - put_user(namlen, &dirent->d_namlen); - copy_to_user(dirent->d_name, name, namlen); - put_user(0, dirent->d_name + namlen); - return 0; -} - -asmlinkage long -sys32_oldreaddir (unsigned int fd, void __user * dirent, unsigned int count) -{ - int error; - struct file * file; - struct readdir32_callback buf; - - error = -EBADF; - file = fget(fd); - if (!file) - goto out; - - buf.count = 0; - buf.dirent = dirent; - - error = vfs_readdir(file, fillonedir32, &buf); - if (error >= 0) - error = buf.count; - fput(file); -out: - return error; -} - struct sel_arg_struct { unsigned int n; unsigned int inp; @@ -625,26 +489,6 @@ sys32_old_select(struct sel_arg_struct __user *arg) compat_ptr(a.exp), compat_ptr(a.tvp)); } -/* - * sys_time() can be implemented in user-level using - * sys_gettimeofday(). x86-64 did this but i386 Linux did not - * so we have to implement this system call here. - */ -asmlinkage long sys32_time(int __user * tloc) -{ - int i; - struct timeval tv; - - do_gettimeofday(&tv); - i = tv.tv_sec; - - if (tloc) { - if (put_user(i,tloc)) - i = -EFAULT; - } - return i; -} - extern asmlinkage long compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options, struct compat_rusage *ru); @@ -658,11 +502,12 @@ sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) int sys32_ni_syscall(int call) { struct task_struct *me = current; - static char lastcomm[8]; - if (strcmp(lastcomm, me->comm)) { - printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call, - current->comm); - strcpy(lastcomm, me->comm); + static char lastcomm[sizeof(me->comm)]; + + if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) { + printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", + call, me->comm); + strncpy(lastcomm, me->comm, sizeof(lastcomm)); } return -ENOSYS; } @@ -780,53 +625,14 @@ sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) return ret; } - -asmlinkage long -sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, siginfo_t32 __user *uinfo, - struct compat_timespec __user *uts, compat_size_t sigsetsize) -{ - sigset_t s; - compat_sigset_t s32; - struct timespec t; - int ret; - mm_segment_t old_fs = get_fs(); - siginfo_t info; - - if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t))) - return -EFAULT; - switch (_NSIG_WORDS) { - case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); - case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32); - case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32); - case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); - } - if (uts && get_compat_timespec(&t, uts)) - return -EFAULT; - if (uinfo) { - /* stop data leak to user space in case of structure fill mismatch - * between sys_rt_sigtimedwait & ia32_copy_siginfo_to_user. - */ - memset(&info, 0, sizeof(info)); - } - set_fs (KERNEL_DS); - ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL, - sigsetsize); - set_fs (old_fs); - if (ret >= 0 && uinfo) { - if (ia32_copy_siginfo_to_user(uinfo, &info)) - return -EFAULT; - } - return ret; -} - asmlinkage long -sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo) +sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) { siginfo_t info; int ret; mm_segment_t old_fs = get_fs(); - if (ia32_copy_siginfo_from_user(&info, uinfo)) + if (copy_siginfo_from_user32(&info, uinfo)) return -EFAULT; set_fs (KERNEL_DS); ret = sys_rt_sigqueueinfo(pid, sig, &info); @@ -844,6 +650,7 @@ sys32_pause(void) } +#ifdef CONFIG_SYSCTL struct sysctl_ia32 { unsigned int name; int nlen; @@ -858,14 +665,11 @@ struct sysctl_ia32 { asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32) { -#ifndef CONFIG_SYSCTL - return -ENOSYS; -#else struct sysctl_ia32 a32; mm_segment_t old_fs = get_fs (); - void *oldvalp, *newvalp; + void __user *oldvalp, *newvalp; size_t oldlen; - int *namep; + int __user *namep; long ret; extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, void *newval, size_t newlen); @@ -881,9 +685,9 @@ sys32_sysctl(struct sysctl_ia32 __user *args32) * addresses, we KNOW that access_ok() will always succeed, so this is an * expensive NOP, but so what... */ - namep = (int *) A(a32.name); - oldvalp = (void *) A(a32.oldval); - newvalp = (void *) A(a32.newval); + namep = compat_ptr(a32.name); + oldvalp = compat_ptr(a32.oldval); + newvalp = compat_ptr(a32.newval); if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp))) || !access_ok(VERIFY_WRITE, namep, 0) @@ -901,8 +705,8 @@ sys32_sysctl(struct sysctl_ia32 __user *args32) return -EFAULT; return ret; -#endif } +#endif /* warning: next two assume little endian */ asmlinkage long @@ -1044,9 +848,6 @@ asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len, return -EBADF; } - if (prot & PROT_READ) - prot |= vm_force_exec32; - down_write(&mm->mmap_sem); error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); up_write(&mm->mmap_sem); @@ -1137,8 +938,11 @@ asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, if (IS_ERR(filename)) return error; error = compat_do_execve(filename, argv, envp, regs); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); return error; } @@ -1154,7 +958,7 @@ asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp, } asmlinkage long sys32_waitid(int which, compat_pid_t pid, - siginfo_t32 __user *uinfo, int options, + compat_siginfo_t __user *uinfo, int options, struct compat_rusage __user *uru) { siginfo_t info; @@ -1176,7 +980,7 @@ asmlinkage long sys32_waitid(int which, compat_pid_t pid, BUG_ON(info.si_code & __SI_MASK); info.si_code |= __SI_CHLD; - return ia32_copy_siginfo_to_user(uinfo, &info); + return copy_siginfo_to_user32(uinfo, &info); } /* @@ -1193,90 +997,6 @@ long sys32_kill(int pid, int sig) return sys_kill(pid, sig); } - -long sys32_io_setup(unsigned nr_reqs, u32 __user *ctx32p) -{ - long ret; - aio_context_t ctx64; - mm_segment_t oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_io_setup(nr_reqs, &ctx64); - set_fs(oldfs); - /* truncating is ok because it's a user address */ - if (!ret) - ret = put_user((u32)ctx64, ctx32p); - return ret; -} - -asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr, - compat_uptr_t __user *iocbpp) -{ - struct kioctx *ctx; - long ret = 0; - int i; - - if (unlikely(nr < 0)) - return -EINVAL; - - if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbpp))))) - return -EFAULT; - - ctx = lookup_ioctx(ctx_id); - if (unlikely(!ctx)) { - pr_debug("EINVAL: io_submit: invalid context id\n"); - return -EINVAL; - } - - for (i=0; i= 0xffffffff || - !access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event))) - return -EFAULT; - if (timeout && get_compat_timespec(&t, timeout)) - return -EFAULT; - oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL); - set_fs(oldfs); - if (!ret && timeout && put_compat_timespec(&t, timeout)) - return -EFAULT; - return ret; -} - asmlinkage long sys32_open(const char __user * filename, int flags, int mode) { char * tmp; @@ -1344,23 +1064,11 @@ long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, long sys32_vm86_warning(void) { struct task_struct *me = current; - static char lastcomm[8]; - if (strcmp(lastcomm, me->comm)) { + static char lastcomm[sizeof(me->comm)]; + if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) { printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n", me->comm); - strcpy(lastcomm, me->comm); - } - return -ENOSYS; -} - -long sys32_quotactl(void) -{ - struct task_struct *me = current; - static char lastcomm[8]; - if (strcmp(lastcomm, me->comm)) { - printk(KERN_INFO "%s: 32bit quotactl not supported on 64 bit kernel\n", - me->comm); - strcpy(lastcomm, me->comm); + strncpy(lastcomm, me->comm, sizeof(lastcomm)); } return -ENOSYS; } @@ -1371,8 +1079,6 @@ long sys32_lookup_dcookie(u32 addr_low, u32 addr_high, return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len); } -cond_syscall(sys32_ipc) - static int __init ia32_init (void) { printk("IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $\n"); diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c index f82aeae6f..399ff4985 100644 --- a/arch/x86_64/ia32/syscall32.c +++ b/arch/x86_64/ia32/syscall32.c @@ -28,7 +28,7 @@ extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[]; extern int sysctl_vsyscall32; char *syscall32_page; -static int use_sysenter __initdata = -1; +static int use_sysenter = -1; /* * Map the 32bit vsyscall page on demand. @@ -40,23 +40,30 @@ static int use_sysenter __initdata = -1; */ int __map_syscall32(struct mm_struct *mm, unsigned long address) { + pgd_t *pgd; + pud_t *pud; pte_t *pte; pmd_t *pmd; - int err = 0; + int err = -ENOMEM; spin_lock(&mm->page_table_lock); - pmd = pmd_alloc(mm, pgd_offset(mm, address), address); - if (pmd && (pte = pte_alloc_map(mm, pmd, address)) != NULL) { - if (pte_none(*pte)) { - set_pte(pte, - mk_pte(virt_to_page(syscall32_page), - PAGE_KERNEL_VSYSCALL)); + pgd = pgd_offset(mm, address); + pud = pud_alloc(mm, pgd, address); + if (pud) { + pmd = pmd_alloc(mm, pud, address); + if (pmd && (pte = pte_alloc_map(mm, pmd, address)) != NULL) { + if (pte_none(*pte)) { + set_pte(pte, + mk_pte(virt_to_page(syscall32_page), + PAGE_KERNEL_VSYSCALL32)); + } + /* Flush only the local CPU. Other CPUs taking a fault + will just end up here again + This probably not needed and just paranoia. */ + __flush_tlb_one(address); + err = 0; } - /* Flush only the local CPU. Other CPUs taking a fault - will just end up here again */ - __flush_tlb_one(address); - } else - err = -ENOMEM; + } spin_unlock(&mm->page_table_lock); return err; } diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile index e70de986a..0a3318e08 100644 --- a/arch/x86_64/kernel/Makefile +++ b/arch/x86_64/kernel/Makefile @@ -5,11 +5,12 @@ extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ + ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ x8664_ksyms.o i387.o syscall.o vsyscall.o \ - setup64.o bootflag.o e820.o reboot.o warmreboot.o -obj-y += mce.o + setup64.o bootflag.o e820.o reboot.o quirks.o +obj-$(CONFIG_X86_MCE) += mce.o +obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/ obj-$(CONFIG_ACPI_BOOT) += acpi/ obj-$(CONFIG_X86_MSR) += msr.o @@ -17,7 +18,8 @@ obj-$(CONFIG_MICROCODE) += microcode.o obj-$(CONFIG_X86_CPUID) += cpuid.o obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o -obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o +obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o \ + genapic.o genapic_cluster.o genapic_flat.o obj-$(CONFIG_PM) += suspend.o obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend_asm.o obj-$(CONFIG_CPU_FREQ) += cpufreq/ @@ -25,13 +27,19 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o obj-$(CONFIG_SWIOTLB) += swiotlb.o +obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_MODULES) += module.o obj-y += topology.o +obj-y += intel_cacheinfo.o + +CFLAGS_vsyscall.o := $(PROFILING) -g0 bootflag-y += ../../i386/kernel/bootflag.o cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o topology-y += ../../i386/mach-default/topology.o swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o +intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o +quirks-y += ../../i386/kernel/quirks.o diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c index 3331a564f..eb4c73076 100644 --- a/arch/x86_64/kernel/acpi/sleep.c +++ b/arch/x86_64/kernel/acpi/sleep.c @@ -61,9 +61,13 @@ extern char wakeup_start, wakeup_end; extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); +static pgd_t low_ptr; + static void init_low_mapping(void) { - cpu_pda[0].level4_pgt[0] = cpu_pda[0].level4_pgt[pml4_index(PAGE_OFFSET)]; + pgd_t *slot0 = pgd_offset(current->mm, 0UL); + low_ptr = *slot0; + set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET)); flush_tlb_all(); } @@ -97,7 +101,7 @@ int acpi_save_state_disk (void) */ void acpi_restore_state_mem (void) { - cpu_pda[0].level4_pgt[0] = 0; + set_pgd(pgd_offset(current->mm, 0UL), low_ptr); flush_tlb_all(); } diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S index e69644856..a4c630034 100644 --- a/arch/x86_64/kernel/acpi/wakeup.S +++ b/arch/x86_64/kernel/acpi/wakeup.S @@ -429,9 +429,6 @@ ENTRY(do_suspend_lowlevel_s4bios) do_suspend_lowlevel: .LFB5: subq $8, %rsp -.LCFI2: - testl %edi, %edi - jne .L99 xorl %eax, %eax call save_processor_state diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c index 1d8b3912c..4baa99fe1 100644 --- a/arch/x86_64/kernel/aperture.c +++ b/arch/x86_64/kernel/aperture.c @@ -200,8 +200,8 @@ static __u32 __init search_agp_bridge(u32 *order, int *valid_agp) void __init iommu_hole_init(void) { int fix, num; - u32 aper_size, aper_alloc = 0, aper_order; - u64 aper_base; + u32 aper_size, aper_alloc = 0, aper_order, last_aper_order = 0; + u64 aper_base, last_aper_base = 0; int valid_agp = 0; if (iommu_aperture_disabled || !fix_aperture) @@ -230,7 +230,15 @@ void __init iommu_hole_init(void) if (!aperture_valid(name, aper_base, aper_size)) { fix = 1; break; - } + } + + if ((last_aper_order && aper_order != last_aper_order) || + (last_aper_base && aper_base != last_aper_base)) { + fix = 1; + break; + } + last_aper_order = aper_order; + last_aper_base = aper_base; } if (!fix && !fallback_aper_force) diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index ddd8aac2a..dbccec489 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c @@ -32,6 +32,7 @@ #include #include #include +#include int apic_verbosity; @@ -224,6 +225,11 @@ int __init verify_local_APIC(void) void __init sync_Arb_IDs(void) { + /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 */ + unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); + if (ver >= 0x14) /* P4 or higher */ + return; + /* * Wait for idle. */ @@ -300,8 +306,7 @@ void __init setup_local_APIC (void) * Double-check whether this APIC is really registered. * This is meaningless in clustered apic mode, so we skip it. */ - if (!clustered_apic_mode && - !physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map)) + if (!apic_id_registered()) BUG(); /* @@ -309,23 +314,7 @@ void __init setup_local_APIC (void) * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ - - if (!clustered_apic_mode) { - /* - * In clustered apic mode, the firmware does this for us - * Put the APIC into flat delivery mode. - * Must be "all ones" explicitly for 82489DX. - */ - apic_write_around(APIC_DFR, 0xffffffff); - - /* - * Set up the logical destination ID. - */ - value = apic_read(APIC_LDR); - value &= ~APIC_LDR_MASK; - value |= (1<<(smp_processor_id()+24)); - apic_write_around(APIC_LDR, value); - } + init_apic_ldr(); /* * Set Task Priority to 'accept all'. We never change this @@ -921,6 +910,54 @@ void smp_apic_timer_interrupt(struct pt_regs *regs) irq_exit(); } +/* + * oem_force_hpet_timer -- force HPET mode for some boxes. + * + * Thus far, the major user of this is IBM's Summit2 series: + * + * Clustered boxes may have unsynced TSC problems if they are + * multi-chassis. Use available data to take a good guess. + * If in doubt, go HPET. + */ +__init int oem_force_hpet_timer(void) +{ + int i, clusters, zeros; + unsigned id; + DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); + + bitmap_empty(clustermap, NUM_APIC_CLUSTERS); + + for (i = 0; i < NR_CPUS; i++) { + id = bios_cpu_apicid[i]; + if (id != BAD_APICID) + __set_bit(APIC_CLUSTERID(id), clustermap); + } + + /* Problem: Partially populated chassis may not have CPUs in some of + * the APIC clusters they have been allocated. Only present CPUs have + * bios_cpu_apicid entries, thus causing zeroes in the bitmap. Since + * clusters are allocated sequentially, count zeros only if they are + * bounded by ones. + */ + clusters = 0; + zeros = 0; + for (i = 0; i < NUM_APIC_CLUSTERS; i++) { + if (test_bit(i, clustermap)) { + clusters += 1 + zeros; + zeros = 0; + } else + ++zeros; + } + + /* + * If clusters > 2, then should be multi-chassis. Return 1 for HPET. + * Else return 0 to use TSC. + * May have to revisit this when multi-core + hyperthreaded CPUs come + * out, but AFAIK this will work even for them. + */ + return (clusters > 2); +} + /* * This interrupt should _never_ happen with our APIC/SMP architecture */ diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c index 37d12fa5e..0c1de4a7a 100644 --- a/arch/x86_64/kernel/asm-offsets.c +++ b/arch/x86_64/kernel/asm-offsets.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,8 @@ int main(void) offsetof (struct rt_sigframe32, uc.uc_mcontext)); BLANK(); #endif - + DEFINE(SIZEOF_PBE, sizeof(struct pbe)); + DEFINE(pbe_address, offsetof(struct pbe, address)); + DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); return 0; } diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig index dcb518eb2..acaf62aa5 100644 --- a/arch/x86_64/kernel/cpufreq/Kconfig +++ b/arch/x86_64/kernel/cpufreq/Kconfig @@ -4,18 +4,6 @@ menu "CPU Frequency scaling" -config CPU_FREQ - bool "CPU Frequency scaling" - help - Clock scaling allows you to change the clock speed of CPUs on the - fly. This is a nice method to save battery power on notebooks, - because the lower the clock speed, the less power the CPU consumes. - - For more information, take a look at - or at - - If in doubt, say N. - source "drivers/cpufreq/Kconfig" config CPU_FREQ_TABLE @@ -48,7 +36,7 @@ config X86_POWERNOW_K8_ACPI config X86_SPEEDSTEP_CENTRINO tristate "Intel Enhanced SpeedStep" - depends on CPU_FREQ_TABLE + depends on CPU_FREQ_TABLE && ACPI_PROCESSOR help This adds the CPUFreq driver for Enhanced SpeedStep enabled mobile CPUs. This means Intel Pentium M (Centrino) CPUs @@ -58,21 +46,11 @@ config X86_SPEEDSTEP_CENTRINO If in doubt, say N. -config X86_SPEEDSTEP_CENTRINO_TABLE +config X86_SPEEDSTEP_CENTRINO_ACPI bool depends on X86_SPEEDSTEP_CENTRINO default y -config X86_SPEEDSTEP_CENTRINO_ACPI - bool "Use ACPI tables to decode valid frequency/voltage pairs (EXPERIMENTAL)" - depends on EXPERIMENTAL - depends on ((X86_SPEEDSTEP_CENTRINO = "m" && ACPI_PROCESSOR) || (X86_SPEEDSTEP_CENTRINO = "y" && ACPI_PROCESSOR = "y")) - help - Use primarily the information provided in the BIOS ACPI tables - to determine valid CPU frequency and voltage pairings. - - If in doubt, say Y. - config X86_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" depends on CPU_FREQ_TABLE && ACPI_PROCESSOR @@ -84,9 +62,13 @@ config X86_ACPI_CPUFREQ If in doubt, say N. +comment "shared options" + depends on CPU_FREQ + config X86_ACPI_CPUFREQ_PROC_INTF bool "/proc/acpi/processor/../performance interface (deprecated)" - depends on X86_ACPI_CPUFREQ && PROC_FS + depends on PROC_FS + depends on X86_ACPI_CPUFREQ || X86_SPEEDSTEP_CENTRINO_ACPI || X86_POWERNOW_K8_ACPI help This enables the deprecated /proc/acpi/processor/../performance interface. While it is helpful for debugging, the generic, @@ -94,5 +76,29 @@ config X86_ACPI_CPUFREQ_PROC_INTF If in doubt, say N. +config X86_P4_CLOCKMOD + tristate "Intel Pentium 4 clock modulation" + depends on CPU_FREQ_TABLE && EMBEDDED + help + This adds the clock modulation driver for Intel Pentium 4 / XEON + processors. When enabled it will lower CPU temperature by skipping + clocks. + + This driver should be only used in exceptional + circumstances when very low power is needed because it causes severe + slowdowns and noticeable latencies. Normally Speedstep should be used + instead. + + For details, take a look at . + + Unless you are absolutely sure say N. + + +config X86_SPEEDSTEP_LIB + tristate + depends on (X86_P4_CLOCKMOD) + default (X86_P4_CLOCKMOD) + + endmenu diff --git a/arch/x86_64/kernel/cpufreq/Makefile b/arch/x86_64/kernel/cpufreq/Makefile index d0f0b2cf3..d8b593879 100644 --- a/arch/x86_64/kernel/cpufreq/Makefile +++ b/arch/x86_64/kernel/cpufreq/Makefile @@ -6,8 +6,12 @@ SRCDIR := ../../../i386/kernel/cpu/cpufreq obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o -obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi.o +obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o +obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o +obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o powernow-k8-objs := ${SRCDIR}/powernow-k8.o speedstep-centrino-objs := ${SRCDIR}/speedstep-centrino.o -acpi-objs := ${SRCDIR}/acpi.o +acpi-cpufreq-objs := ${SRCDIR}/acpi-cpufreq.o +p4-clockmod-objs := ${SRCDIR}/p4-clockmod.o +speedstep-lib-objs := ${SRCDIR}/speedstep-lib.o diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c index 600ec815a..750bcd065 100644 --- a/arch/x86_64/kernel/early_printk.c +++ b/arch/x86_64/kernel/early_printk.c @@ -10,7 +10,7 @@ #ifdef __i386__ #define VGABASE (__ISA_IO_base + 0xb8000) #else -#define VGABASE 0xffffffff800b8000UL +#define VGABASE ((void __iomem *)0xffffffff800b8000UL) #endif #define MAX_YPOS 25 @@ -198,9 +198,6 @@ int __init setup_early_printk(char *opt) early_console = &early_serial_console; } else if (!strncmp(buf, "vga", 3)) { early_console = &early_vga_console; - } else { - early_console = NULL; - return -1; } early_console_initialized = 1; register_console(early_console); diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 17d74eb66..c261fdc10 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S @@ -41,7 +41,6 @@ #include #include #include -#include .code64 @@ -538,6 +537,9 @@ retint_kernel: CFI_ENDPROC .endm +ENTRY(thermal_interrupt) + apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt + #ifdef CONFIG_SMP ENTRY(reschedule_interrupt) apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt @@ -907,6 +909,7 @@ ENTRY(divide_error) ENTRY(spurious_interrupt_bug) zeroentry do_spurious_interrupt_bug +#ifdef CONFIG_X86_MCE /* runs on exception stack */ ENTRY(machine_check) CFI_STARTPROC @@ -915,6 +918,7 @@ ENTRY(machine_check) paranoidentry do_machine_check jmp paranoid_exit CFI_ENDPROC +#endif ENTRY(call_debug) zeroentry do_call_debug diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c index 9aa5cb6af..d2c42fb99 100644 --- a/arch/x86_64/kernel/genapic.c +++ b/arch/x86_64/kernel/genapic.c @@ -41,6 +41,12 @@ void __init clustered_apic_check(void) u8 id; u8 cluster_cnt[NUM_APIC_CLUSTERS]; + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { + /* AMD always uses flat mode right now */ + genapic = &apic_flat; + goto print; + } + memset(cluster_cnt, 0, sizeof(cluster_cnt)); for (i = 0; i < NR_CPUS; i++) { @@ -71,6 +77,7 @@ void __init clustered_apic_check(void) else genapic = &apic_cluster; +print: printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); } diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 23a2b5e02..30e92ff8b 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S @@ -176,6 +176,18 @@ initial_code: init_rsp: .quad init_thread_union+THREAD_SIZE-8 +ENTRY(early_idt_handler) + xorl %eax,%eax + movq 8(%rsp),%rsi # get rip + movq (%rsp),%rdx + movq %cr2,%rcx + leaq early_idt_msg(%rip),%rdi + call early_printk +1: hlt + jmp 1b + +early_idt_msg: + .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n" .code32 ENTRY(no_long_mode) @@ -213,7 +225,6 @@ ENTRY(init_level4_pgt) .quad 0x0000000000103007 /* -> level3_kernel_pgt */ .org 0x2000 -/* Kernel does not "know" about 4-th level of page tables. */ ENTRY(level3_ident_pgt) .quad 0x0000000000104007 .fill 511,8,0 @@ -344,7 +355,7 @@ ENTRY(cpu_gdt_table) .quad 0x008f9a000000ffff /* __KERNEL_COMPAT32_CS */ .quad 0x00af9a000000ffff /* __KERNEL_CS */ .quad 0x00cf92000000ffff /* __KERNEL_DS */ - .quad 0x00cffe000000ffff /* __USER32_CS */ + .quad 0x00cffa000000ffff /* __USER32_CS */ .quad 0x00cff2000000ffff /* __USER_DS, __USER32_DS */ .quad 0x00affa000000ffff /* __USER_CS */ .quad 0x00cf9a000000ffff /* __KERNEL32_CS */ diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c index 127a67880..6cad46c98 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86_64/kernel/head64.c @@ -11,12 +11,14 @@ #include #include #include +#include #include #include #include #include #include +#include /* Don't add a printk in there. printk relies on the PDA which is not initialized yet. */ @@ -59,16 +61,17 @@ static void __init copy_bootdata(char *real_mode_data) static void __init setup_boot_cpu_data(void) { - int dummy, eax; + unsigned int dummy, eax; /* get vendor info */ - cpuid(0, &boot_cpu_data.cpuid_level, - (int *)&boot_cpu_data.x86_vendor_id[0], - (int *)&boot_cpu_data.x86_vendor_id[8], - (int *)&boot_cpu_data.x86_vendor_id[4]); + cpuid(0, (unsigned int *)&boot_cpu_data.cpuid_level, + (unsigned int *)&boot_cpu_data.x86_vendor_id[0], + (unsigned int *)&boot_cpu_data.x86_vendor_id[8], + (unsigned int *)&boot_cpu_data.x86_vendor_id[4]); /* get cpu type */ - cpuid(1, &eax, &dummy, &dummy, (int *) &boot_cpu_data.x86_capability); + cpuid(1, &eax, &dummy, &dummy, + (unsigned int *) &boot_cpu_data.x86_capability); boot_cpu_data.x86 = (eax >> 8) & 0xf; boot_cpu_data.x86_model = (eax >> 4) & 0xf; boot_cpu_data.x86_mask = eax & 0xf; @@ -79,7 +82,11 @@ extern char _end[]; void __init x86_64_start_kernel(char * real_mode_data) { char *s; + int i; + for (i = 0; i < 256; i++) + set_intr_gate(i, early_idt_handler); + asm volatile("lidt %0" :: "m" (idt_descr)); clear_bss(); pda_init(0); copy_bootdata(real_mode_data); diff --git a/arch/x86_64/kernel/i387.c b/arch/x86_64/kernel/i387.c index 6bc3d64e0..ba139cac5 100644 --- a/arch/x86_64/kernel/i387.c +++ b/arch/x86_64/kernel/i387.c @@ -57,12 +57,12 @@ void __init fpu_init(void) mxcsr_feature_mask_init(); /* clean state in init */ current_thread_info()->status = 0; - current->used_math = 0; + clear_used_math(); } void init_fpu(struct task_struct *child) { - if (child->used_math) { + if (tsk_used_math(child)) { if (child == current) unlazy_fpu(child); return; @@ -70,7 +70,8 @@ void init_fpu(struct task_struct *child) memset(&child->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct)); child->thread.i387.fxsave.cwd = 0x37f; child->thread.i387.fxsave.mxcsr = 0x1f80; - child->used_math = 1; + /* only the device not available exception or ptrace can call init_fpu */ + set_stopped_child_used_math(child); } /* @@ -91,9 +92,9 @@ int save_i387(struct _fpstate __user *buf) if ((unsigned long)buf % 16) printk("save_i387: bad fpstate %p\n",buf); - if (!tsk->used_math) + if (!used_math()) return 0; - tsk->used_math = 0; /* trigger finit */ + clear_used_math(); /* trigger finit */ if (tsk->thread_info->status & TS_USEDFPU) { err = save_i387_checking((struct i387_fxsave_struct __user *)buf); if (err) return err; @@ -133,7 +134,7 @@ int dump_fpu( struct pt_regs *regs, struct user_i387_struct *fpu ) { struct task_struct *tsk = current; - if (!tsk->used_math) + if (!used_math()) return 0; unlazy_fpu(tsk); @@ -143,7 +144,7 @@ int dump_fpu( struct pt_regs *regs, struct user_i387_struct *fpu ) int dump_task_fpu(struct task_struct *tsk, struct user_i387_struct *fpu) { - int fpvalid = tsk->used_math; + int fpvalid = !!tsk_used_math(tsk); if (fpvalid) { if (tsk == current) diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c index f5d084a99..8bc3d658e 100644 --- a/arch/x86_64/kernel/i8259.c +++ b/arch/x86_64/kernel/i8259.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -130,7 +130,7 @@ void (*interrupt[NR_IRQS])(void) = { * moves to arch independent land */ -spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(i8259A_lock); static void end_8259A_irq (unsigned int irq) { @@ -476,6 +476,7 @@ void error_interrupt(void); void reschedule_interrupt(void); void call_function_interrupt(void); void invalidate_interrupt(void); +void thermal_interrupt(void); static void setup_timer(void) { @@ -550,6 +551,7 @@ void __init init_IRQ(void) /* IPI for generic function call */ set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); #endif + set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); #ifdef CONFIG_X86_LOCAL_APIC /* self generated IPI for local APIC timer */ diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c index 8bc4becb8..c4dc91491 100644 --- a/arch/x86_64/kernel/init_task.c +++ b/arch/x86_64/kernel/init_task.c @@ -47,5 +47,3 @@ EXPORT_SYMBOL(init_task); DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp; #define ALIGN_TO_4K __attribute__((section(".data.init_task"))) - -pgd_t boot_vmalloc_pgt[512] ALIGN_TO_4K; diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index c309cb0f8..a81bc8fe1 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c @@ -36,16 +36,13 @@ #include #include #include +#include #define __apicdebuginit __init int sis_apic_bug; /* not actually supported, dummy for compile */ -#undef APIC_LOCKUP_DEBUG - -#define APIC_LOCKUP_DEBUG - -static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ioapic_lock); /* * # of IRQ routing registers @@ -83,7 +80,7 @@ int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; * shared ISA-space IRQs, so we have to support them. We are super * fast in the common case, and fast for shared ISA-space IRQs. */ -static void __init add_pin_to_irq(unsigned int irq, int apic, int pin) +static void add_pin_to_irq(unsigned int irq, int apic, int pin) { static int first_free_entry = NR_IRQS; struct irq_pin_list *entry = irq_2_pin + irq; @@ -131,10 +128,6 @@ DO_ACTION( __mask, 0, |= 0x00010000, io_apic_sync(entry->apic) ) /* mask = 1 */ DO_ACTION( __unmask, 0, &= 0xfffeffff, ) /* mask = 0 */ -DO_ACTION( __mask_and_edge, 0, = (reg & 0xffff7fff) | 0x00010000, ) - /* mask = 1, trigger = 0 */ -DO_ACTION( __unmask_and_level, 0, = (reg & 0xfffeffff) | 0x00008000, ) - /* mask = 0, trigger = 1 */ static void mask_IO_APIC_irq (unsigned int irq) { @@ -265,12 +258,14 @@ void __init check_ioapic(void) #endif return; case PCI_VENDOR_ID_NVIDIA: -#ifndef CONFIG_SMP +#ifdef CONFIG_ACPI + /* All timer overrides on Nvidia + seem to be wrong. Skip them. */ + acpi_skip_timer_override = 1; printk(KERN_INFO - "PCI bridge %02x:%02x from %x found. Setting \"noapic\". Overwrite with \"apic\"\n", - num,slot,vendor); - skip_ioapic_setup = 1; + "Nvidia board detected. Ignoring ACPI timer override.\n"); #endif + /* RED-PEN skip them on mptables too? */ return; } @@ -315,7 +310,7 @@ __setup("pirq=", ioapic_pirq_setup); /* * Find the IRQ entry number of a certain pin. */ -static int __init find_irq_entry(int apic, int pin, int type) +static int find_irq_entry(int apic, int pin, int type) { int i; @@ -399,7 +394,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) /* * EISA Edge/Level control register, ELCR */ -static int __init EISA_ELCR(unsigned int irq) +static int EISA_ELCR(unsigned int irq) { if (irq < 16) { unsigned int port = 0x4d0 + (irq >> 3); @@ -504,7 +499,7 @@ static int __init MPBIOS_polarity(int idx) return polarity; } -static int __init MPBIOS_trigger(int idx) +static int MPBIOS_trigger(int idx) { int bus = mp_irqs[idx].mpc_srcbus; int trigger; @@ -659,11 +654,7 @@ static inline int IO_APIC_irq_trigger(int irq) /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */ u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; -#ifdef CONFIG_PCI_MSI int assign_irq_vector(int irq) -#else -int __init assign_irq_vector(int irq) -#endif { static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; @@ -732,8 +723,8 @@ void __init setup_IO_APIC_irqs(void) */ memset(&entry,0,sizeof(entry)); - entry.delivery_mode = dest_LowestPrio; - entry.dest_mode = INT_DELIVERY_MODE; + entry.delivery_mode = INT_DELIVERY_MODE; + entry.dest_mode = INT_DEST_MODE; entry.mask = 0; /* enable IRQ */ entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); @@ -801,10 +792,10 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) * We use logical delivery to get the timer IRQ * to the first CPU. */ - entry.dest_mode = INT_DELIVERY_MODE; + entry.dest_mode = INT_DEST_MODE; entry.mask = 0; /* unmask IRQ now */ entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); - entry.delivery_mode = dest_LowestPrio; + entry.delivery_mode = INT_DELIVERY_MODE; entry.polarity = 0; entry.trigger = 0; entry.vector = vector; @@ -1152,7 +1143,6 @@ void disable_IO_APIC(void) static void __init setup_ioapic_ids_from_mpc (void) { union IO_APIC_reg_00 reg_00; - physid_mask_t phys_id_present_map = phys_cpu_present_map; int apic; int i; unsigned char old_id; @@ -1170,36 +1160,8 @@ static void __init setup_ioapic_ids_from_mpc (void) old_id = mp_ioapics[apic].mpc_apicid; - if (mp_ioapics[apic].mpc_apicid >= 0xf) { - apic_printk(APIC_QUIET,KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", - apic, mp_ioapics[apic].mpc_apicid); - apic_printk(APIC_QUIET,KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", - reg_00.bits.ID); - mp_ioapics[apic].mpc_apicid = reg_00.bits.ID; - } - /* - * Sanity check, is the ID really free? Every APIC in a - * system must have a unique ID or we get lots of nice - * 'stuck on smp_invalidate_needed IPI wait' messages. - */ - if (physid_isset(mp_ioapics[apic].mpc_apicid, phys_id_present_map)) { - printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", - apic, mp_ioapics[apic].mpc_apicid); - for (i = 0; i < 0xf; i++) - if (!physid_isset(i, phys_id_present_map)) - break; - if (i >= 0xf) - panic("Max APIC ID exceeded!\n"); - printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", - i); - physid_set(i, phys_id_present_map); - mp_ioapics[apic].mpc_apicid = i; - } else { - printk(KERN_INFO - "Using IO-APIC %d\n", mp_ioapics[apic].mpc_apicid); - physid_set(mp_ioapics[apic].mpc_apicid, phys_id_present_map); - } + printk(KERN_INFO "Using IO-APIC %d\n", mp_ioapics[apic].mpc_apicid); /* @@ -1343,61 +1305,7 @@ static unsigned int startup_level_ioapic_irq (unsigned int irq) static void end_level_ioapic_irq (unsigned int irq) { - unsigned long v; - int i; - -/* - * It appears there is an erratum which affects at least version 0x11 - * of I/O APIC (that's the 82093AA and cores integrated into various - * chipsets). Under certain conditions a level-triggered interrupt is - * erroneously delivered as edge-triggered one but the respective IRR - * bit gets set nevertheless. As a result the I/O unit expects an EOI - * message but it will never arrive and further interrupts are blocked - * from the source. The exact reason is so far unknown, but the - * phenomenon was observed when two consecutive interrupt requests - * from a given source get delivered to the same CPU and the source is - * temporarily disabled in between. - * - * A workaround is to simulate an EOI message manually. We achieve it - * by setting the trigger mode to edge and then to level when the edge - * trigger mode gets detected in the TMR of a local APIC for a - * level-triggered interrupt. We mask the source for the time of the - * operation to prevent an edge-triggered interrupt escaping meanwhile. - * The idea is from Manfred Spraul. --macro - */ - i = IO_APIC_VECTOR(irq); - v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1)); - ack_APIC_irq(); - - if (!(v & (1 << (i & 0x1f)))) { -#ifdef APIC_LOCKUP_DEBUG - struct irq_pin_list *entry; -#endif - -#ifdef APIC_MISMATCH_DEBUG - atomic_inc(&irq_mis_count); -#endif - spin_lock(&ioapic_lock); - __mask_and_edge_IO_APIC_irq(irq); -#ifdef APIC_LOCKUP_DEBUG - for (entry = irq_2_pin + irq;;) { - unsigned int reg; - - if (entry->pin == -1) - break; - reg = io_apic_read(entry->apic, 0x10 + entry->pin * 2); - if (reg & 0x00004000) - printk(KERN_CRIT "Aieee!!! Remote IRR" - " still set after unlock!\n"); - if (!entry->next) - break; - entry = irq_2_pin + entry->next; - } -#endif - __unmask_and_level_IO_APIC_irq(irq); - spin_unlock(&ioapic_lock); - } } static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) @@ -1408,9 +1316,9 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) dest = cpu_mask_to_apicid(mask); /* - * Only the first 8 bits are valid. + * Only the high 8 bits are valid. */ - dest = dest << 24; + dest = SET_APIC_LOGICAL_ID(dest); spin_lock_irqsave(&ioapic_lock, flags); __DO_ACTION(1, = dest, ) @@ -1892,7 +1800,7 @@ device_initcall(ioapic_init_sysfs); #ifdef CONFIG_ACPI_BOOT -#define IO_APIC_MAX_ID 15 +#define IO_APIC_MAX_ID 0xFE int __init io_apic_get_unique_id (int ioapic, int apic_id) { @@ -2009,8 +1917,8 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a memset(&entry,0,sizeof(entry)); - entry.delivery_mode = dest_LowestPrio; - entry.dest_mode = INT_DELIVERY_MODE; + entry.delivery_mode = INT_DELIVERY_MODE; + entry.dest_mode = INT_DEST_MODE; entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); entry.trigger = edge_level; entry.polarity = active_high_low; @@ -2044,24 +1952,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a #endif /*CONFIG_ACPI_BOOT*/ -#ifndef CONFIG_SMP -void send_IPI_self(int vector) -{ - unsigned int cfg; - - /* - * Wait for idle. - */ - apic_wait_icr_idle(); - cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | APIC_DEST_LOGICAL; - - /* - * Send the IPI. The write to APIC_ICR fires this off. - */ - apic_write_around(APIC_ICR, cfg); -} -#endif - /* * This function currently is only a helper for the i386 smp boot process where diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index bf6459e58..62b112e4d 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c @@ -3,127 +3,19 @@ * * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar * - * This file contains the code used by various IRQ handling routines: - * asking for different IRQ's should be done through these routines - * instead of just grabbing them. Thus setups with different IRQ numbers - * shouldn't result in any weird surprises, and installing new handlers - * should be easier. + * This file contains the lowest level x86_64-specific interrupt + * entry and irq statistics code. All the remaining irq logic is + * done by the generic kernel/irq/ code and in the + * x86_64-specific irq controller code. (e.g. i8259.c and + * io_apic.c.) */ -/* - * (mostly architecture independent, will move to kernel/irq.c in 2.5.) - * - * IRQs are in fact implemented a bit like signal handlers for the kernel. - * Naturally it's not a 1:1 relation, but there are similarities. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include - -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include - - - -/* - * Linux has a controller-independent x86 interrupt architecture. - * every controller has a 'controller-template', that is used - * by the main code to do the right thing. Each driver-visible - * interrupt source is transparently wired to the appropriate - * controller. Thus drivers need not be aware of the - * interrupt-controller. - * - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. - * (IO-APICs assumed to be messaging to Pentium local-APICs) - * - * the code is designed to be easily extended with new/different - * interrupt controllers, without having to do assembly magic. - */ - -/* - * Controller mappings for all interrupt sources: - */ -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { - [0 ... NR_IRQS-1] = { - .handler = &no_irq_type, - .lock = SPIN_LOCK_UNLOCKED - } -}; - -static void register_irq_proc (unsigned int irq); - -/* - * Special irq handlers. - */ - -irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) { return IRQ_NONE; } - -/* - * Generic no controller code - */ - -static void enable_none(unsigned int irq) { } -static unsigned int startup_none(unsigned int irq) { return 0; } -static void disable_none(unsigned int irq) { } -static void ack_none(unsigned int irq) -{ -/* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. - */ -#ifdef CONFIG_X86 - printk("unexpected IRQ trap at vector %02x\n", irq); -#ifdef CONFIG_X86_LOCAL_APIC - /* - * Currently unexpected vectors happen only on SMP and APIC. - * We _must_ ack these because every local APIC has only N - * irq slots per priority level, and a 'hanging, unacked' IRQ - * holds up an irq slot - in excessive cases (when multiple - * unexpected vectors occur) that might lock up the APIC - * completely. - */ - ack_APIC_irq(); -#endif -#endif -} - -/* startup is the same as "enable", shutdown is same as "disable" */ -#define shutdown_none disable_none -#define end_none enable_none - -struct hw_interrupt_type no_irq_type = { - "none", - startup_none, - shutdown_none, - enable_none, - disable_none, - ack_none, - end_none -}; +#include atomic_t irq_err_count; #ifdef CONFIG_X86_IO_APIC @@ -195,131 +87,6 @@ skip: return 0; } -#ifdef CONFIG_SMP -inline void synchronize_irq(unsigned int irq) -{ - while (irq_desc[irq].status & IRQ_INPROGRESS) - cpu_relax(); -} -#endif - -/* - * This should really return information about whether - * we should do bottom half handling etc. Right now we - * end up _always_ checking the bottom half, which is a - * waste of time and is not what some drivers would - * prefer. - */ -int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) -{ - int status = 1; /* Force the "do bottom halves" bit */ - int ret; - - if (!(action->flags & SA_INTERRUPT)) - local_irq_enable(); - - do { - ret = action->handler(irq, action->dev_id, regs); - if (ret == IRQ_HANDLED) - status |= action->flags; - action = action->next; - } while (action); - if (status & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - local_irq_disable(); - - return status; -} - -/* - * Generic enable/disable code: this just calls - * down into the PIC-specific version for the actual - * hardware disable after having gotten the irq - * controller lock. - */ - -/** - * disable_irq_nosync - disable an irq without waiting - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Disables and Enables are - * nested. - * Unlike disable_irq(), this function does not ensure existing - * instances of the IRQ handler have completed before returning. - * - * This function must not be called from IRQ context. - */ - -inline void disable_irq_nosync(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->depth++) { - desc->status |= IRQ_DISABLED; - desc->handler->disable(irq); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - -/** - * disable_irq - disable an irq and wait for completion - * @irq: Interrupt to disable - * - * Disable the selected interrupt line. Enables and Disables are - * nested. - * This function waits for any pending IRQ handlers for this interrupt - * to complete before returning. If you use this function while - * holding a resource the IRQ handler may need you will deadlock. - * - * This function may be called - with care - from IRQ context. - */ - -void disable_irq(unsigned int irq) -{ - disable_irq_nosync(irq); - synchronize_irq(irq); -} - -/** - * enable_irq - enable handling of an irq - * @irq: Interrupt to enable - * - * Undoes the effect of one call to disable_irq(). If this - * matches the last disable, processing of interrupts on this - * IRQ line is re-enabled. - * - * This function may be called from IRQ context. - */ - -void enable_irq(unsigned int irq) -{ - irq_desc_t *desc = irq_desc + irq; - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - switch (desc->depth) { - case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; - desc->status = status; - if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { - desc->status = status | IRQ_REPLAY; - hw_resend_irq(desc->handler,irq); - } - desc->handler->enable(irq); - /* fall-through */ - } - default: - desc->depth--; - break; - case 0: - printk("enable_irq(%u) unbalanced from %p\n", irq, - __builtin_return_address(0)); - } - spin_unlock_irqrestore(&desc->lock, flags); -} - /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific @@ -327,591 +94,15 @@ void enable_irq(unsigned int irq) */ asmlinkage unsigned int do_IRQ(struct pt_regs *regs) { - /* - * We ack quickly, we don't want the irq controller - * thinking we're snobs just because some other CPU has - * disabled global interrupts (we have already done the - * INT_ACK cycles, it's too late to try to pretend to the - * controller that we aren't taking the interrupt). - * - * 0 return value means that this irq is already being - * handled by some other CPU. (or is disabled) - */ - unsigned irq = regs->orig_rax & 0xff; /* high bits used in ret_from_ code */ - int cpu = smp_processor_id(); - irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; - unsigned int status; - - if (irq > 256) BUG(); - - irq_enter(); - kstat_cpu(cpu).irqs[irq]++; - spin_lock(&desc->lock); - desc->handler->ack(irq); - /* - REPLAY is when Linux resends an IRQ that was dropped earlier - WAITING is used by probe to mark irqs that are being tested - */ - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); - status |= IRQ_PENDING; /* we _want_ to handle it */ + /* high bits used in ret_from_ code */ + unsigned irq = regs->orig_rax & 0xff; - /* - * If the IRQ is disabled for whatever reason, we cannot - * use the action we have. - */ - action = NULL; - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { - action = desc->action; - status &= ~IRQ_PENDING; /* we commit to handling */ - status |= IRQ_INPROGRESS; /* we are handling it */ - } - desc->status = status; - - /* - * If there is no IRQ handler or it was disabled, exit early. - Since we set PENDING, if another processor is handling - a different instance of this same irq, the other processor - will take care of it. - */ - if (unlikely(!action)) - goto out; - - /* - * Edge triggered interrupts need to remember - * pending events. - * This applies to any hw interrupts that allow a second - * instance of the same irq to arrive while we are in do_IRQ - * or in the handler. But the code here only handles the _second_ - * instance of the irq, not the third or fourth. So it is mostly - * useful for irq hardware that does not mask cleanly in an - * SMP environment. - */ - for (;;) { - spin_unlock(&desc->lock); - handle_IRQ_event(irq, regs, action); - spin_lock(&desc->lock); - - if (unlikely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } - desc->status &= ~IRQ_INPROGRESS; -out: - /* - * The ->end() handler has to deal with interrupts which got - * disabled while the handler was running. - */ - if (irq > 256) BUG(); - desc->handler->end(irq); - spin_unlock(&desc->lock); + irq_enter(); + BUG_ON(irq > 256); + __do_IRQ(irq, regs); irq_exit(); - return 1; -} -int can_request_irq(unsigned int irq, unsigned long irqflags) -{ - struct irqaction *action; - - if (irq >= NR_IRQS) - return 0; - action = irq_desc[irq].action; - if (action) { - if (irqflags & action->flags & SA_SHIRQ) - action = NULL; - } - return !action; -} - -/** - * request_irq - allocate an interrupt line - * @irq: Interrupt line to allocate - * @handler: Function to be called when the IRQ occurs - * @irqflags: Interrupt type flags - * @devname: An ascii name for the claiming device - * @dev_id: A cookie passed back to the handler function - * - * This call allocates interrupt resources and enables the - * interrupt line and IRQ handling. From the point this - * call is made your handler function may be invoked. Since - * your handler function must clear any interrupt the board - * raises, you must take care both to initialise your hardware - * and to set up the interrupt handler in the right order. - * - * Dev_id must be globally unique. Normally the address of the - * device data structure is used as the cookie. Since the handler - * receives this value it makes sense to use it. - * - * If your interrupt is shared you must pass a non NULL dev_id - * as this is required when freeing the interrupt. - * - * Flags: - * - * SA_SHIRQ Interrupt is shared - * - * SA_INTERRUPT Disable local interrupts while processing - * - * SA_SAMPLE_RANDOM The interrupt can be used for entropy - * - */ - -int request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, - const char * devname, - void *dev_id) -{ - int retval; - struct irqaction * action; - -#if 1 - /* - * Sanity-check: shared interrupts should REALLY pass in - * a real dev-ID, otherwise we'll have trouble later trying - * to figure out which interrupt is which (messes up the - * interrupt freeing logic etc). - */ - if (irqflags & SA_SHIRQ) { - if (!dev_id) - printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); - } -#endif - - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; - - action = (struct irqaction *) - kmalloc(sizeof(struct irqaction), GFP_ATOMIC); - if (!action) - return -ENOMEM; - - action->handler = handler; - action->flags = irqflags; - cpus_clear(action->mask); - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; -} - -EXPORT_SYMBOL(request_irq); - -/** - * free_irq - free an interrupt - * @irq: Interrupt line to free - * @dev_id: Device identity to free - * - * Remove an interrupt handler. The handler is removed and if the - * interrupt line is no longer in use by any driver it is disabled. - * On a shared IRQ the caller must ensure the interrupt is disabled - * on the card it drives before calling this function. The function - * does not return until any executing interrupts for this IRQ - * have completed. - * - * This function may be called from interrupt context. - * - * Bugs: Attempting to free an irq in a handler for the same irq hangs - * the machine. - */ - -void free_irq(unsigned int irq, void *dev_id) -{ - irq_desc_t *desc; - struct irqaction **p; - unsigned long flags; - - if (irq >= NR_IRQS) - return; - - desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - for (;;) { - struct irqaction * action = *p; - if (action) { - struct irqaction **pp = p; - p = &action->next; - if (action->dev_id != dev_id) - continue; - - /* Found it - now remove it from the list of entries */ - *pp = action->next; - if (!desc->action) { - desc->status |= IRQ_DISABLED; - desc->handler->shutdown(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - synchronize_irq(irq); - kfree(action); - return; - } - printk("Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); - return; - } -} - -EXPORT_SYMBOL(free_irq); - -/* - * IRQ autodetection code.. - * - * This depends on the fact that any interrupt that - * comes in on to an unassigned handler will get stuck - * with "IRQ_WAITING" cleared and the interrupt - * disabled. - */ - -static DECLARE_MUTEX(probe_sem); - -/** - * probe_irq_on - begin an interrupt autodetect - * - * Commence probing for an interrupt. The interrupts are scanned - * and a mask of potential interrupt lines is returned. - * - */ - -unsigned long probe_irq_on(void) -{ - unsigned int i; - irq_desc_t *desc; - unsigned long val; - unsigned long delay; - - down(&probe_sem); - /* - * something may have generated an irq long ago and we want to - * flush such a longstanding irq before considering it as spurious. - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!irq_desc[i].action) - irq_desc[i].handler->startup(i); - spin_unlock_irq(&desc->lock); - } - - /* Wait for longstanding interrupts to trigger. */ - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) - /* about 20ms delay */ barrier(); - - /* - * enable any unassigned irqs - * (we must startup again here because if a longstanding irq - * happened in the previous stage, it may have masked itself) - */ - for (i = NR_IRQS-1; i > 0; i--) { - desc = irq_desc + i; - - spin_lock_irq(&desc->lock); - if (!desc->action) { - desc->status |= IRQ_AUTODETECT | IRQ_WAITING; - if (desc->handler->startup(i)) - desc->status |= IRQ_PENDING; - } - spin_unlock_irq(&desc->lock); - } - - /* - * Wait for spurious interrupts to trigger - */ - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) - /* about 100ms delay */ barrier(); - - /* - * Now filter out any obviously spurious interrupts - */ - val = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - /* It triggered already - consider it spurious. */ - if (!(status & IRQ_WAITING)) { - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } else - if (i < 32) - val |= 1 << i; - } - spin_unlock_irq(&desc->lock); - } - - return val; -} - -EXPORT_SYMBOL(probe_irq_on); - -/* - * Return a mask of triggered interrupts (this - * can handle only legacy ISA interrupts). - */ - -/** - * probe_irq_mask - scan a bitmap of interrupt lines - * @val: mask of interrupts to consider - * - * Scan the ISA bus interrupt lines and return a bitmap of - * active interrupts. The interrupt probe logic state is then - * returned to its previous value. - * - * Note: we need to scan all the irq's even though we will - * only return ISA irq numbers - just so that we reset them - * all to a known state. - */ -unsigned int probe_irq_mask(unsigned long val) -{ - int i; - unsigned int mask; - - mask = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (i < 16 && !(status & IRQ_WAITING)) - mask |= 1 << i; - - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - return mask & val; -} - -/* - * Return the one interrupt that triggered (this can - * handle any interrupt source). - */ - -/** - * probe_irq_off - end an interrupt autodetect - * @val: mask of potential interrupts (unused) - * - * Scans the unused interrupt lines and returns the line which - * appears to have triggered the interrupt. If no interrupt was - * found then zero is returned. If more than one interrupt is - * found then minus the first candidate is returned to indicate - * their is doubt. - * - * The interrupt probe logic state is returned to its previous - * value. - * - * BUGS: When used in a module (which arguably shouldn't happen) - * nothing prevents two IRQ probe callers from overlapping. The - * results of this are non-optimal. - */ - -int probe_irq_off(unsigned long val) -{ - int i, irq_found, nr_irqs; - - nr_irqs = 0; - irq_found = 0; - for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; - unsigned int status; - - spin_lock_irq(&desc->lock); - status = desc->status; - - if (status & IRQ_AUTODETECT) { - if (!(status & IRQ_WAITING)) { - if (!nr_irqs) - irq_found = i; - nr_irqs++; - } - desc->status = status & ~IRQ_AUTODETECT; - desc->handler->shutdown(i); - } - spin_unlock_irq(&desc->lock); - } - up(&probe_sem); - - if (nr_irqs > 1) - irq_found = -irq_found; - return irq_found; -} - -EXPORT_SYMBOL(probe_irq_off); - -/* this was setup_x86_irq but it seems pretty generic */ -int setup_irq(unsigned int irq, struct irqaction * new) -{ - int shared = 0; - unsigned long flags; - struct irqaction *old, **p; - irq_desc_t *desc = irq_desc + irq; - - if (desc->handler == &no_irq_type) - return -ENOSYS; - - /* - * Some drivers like serial.c use request_irq() heavily, - * so we have to be careful not to interfere with a - * running system. - */ - if (new->flags & SA_SAMPLE_RANDOM) { - /* - * This function might sleep, we want to call it first, - * outside of the atomic block. - * Yes, this might clear the entropy pool if the wrong - * driver is attempted to be loaded, without actually - * installing a new handler, but is this really a problem, - * only the sysadmin is able to do this. - */ - rand_initialize_irq(irq); - } - - /* - * The following block of code has to be executed atomically - */ - spin_lock_irqsave(&desc->lock,flags); - p = &desc->action; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) { - spin_unlock_irqrestore(&desc->lock,flags); - return -EBUSY; - } - - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - - *p = new; - - if (!shared) { - desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING); - desc->handler->startup(irq); - } - spin_unlock_irqrestore(&desc->lock,flags); - - register_irq_proc(irq); - return 0; -} - -static struct proc_dir_entry * root_irq_dir; -static struct proc_dir_entry * irq_dir [NR_IRQS]; - -#ifdef CONFIG_SMP - -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; - -static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; -static int irq_affinity_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); - if (count - len < 2) - return -EINVAL; - len += sprintf(page + len, "\n"); - return len; -} - -static int irq_affinity_write_proc (struct file *file, - const char __user *buffer, - unsigned long count, void *data) -{ - int irq = (long) data, full_count = count, err; - cpumask_t tmp, new_value; - - if (!irq_desc[irq].handler->set_affinity) - return -EIO; - - err = cpumask_parse(buffer, count, new_value); - - /* - * Do not allow disabling IRQs completely - it's a too easy - * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. - */ - cpus_and(tmp, new_value, cpu_online_map); - if (cpus_empty(tmp)) - return -EINVAL; - - irq_affinity[irq] = new_value; - irq_desc[irq].handler->set_affinity(irq, new_value); - - return full_count; -} - -#endif - -#define MAX_NAMELEN 10 - -static void register_irq_proc (unsigned int irq) -{ - char name [MAX_NAMELEN]; - - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || - irq_dir[irq]) - return; - - memset(name, 0, MAX_NAMELEN); - sprintf(name, "%d", irq); - - /* create /proc/irq/1234 */ - irq_dir[irq] = proc_mkdir(name, root_irq_dir); - -#ifdef CONFIG_SMP - { - struct proc_dir_entry *entry; - - /* create /proc/irq/1234/smp_affinity */ - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); - - if (entry) { - entry->nlink = 1; - entry->data = (void *)(long)irq; - entry->read_proc = irq_affinity_read_proc; - entry->write_proc = irq_affinity_write_proc; - } - - smp_affinity_entry[irq] = entry; - } -#endif + return 1; } -void init_irq_proc (void) -{ - int i; - - /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", NULL); - - /* create /proc/irq/prof_cpu_mask */ - create_prof_cpu_mask(root_irq_dir); - - /* - * Create entries for all existing IRQs. - */ - for (i = 0; i < NR_IRQS; i++) - register_irq_proc(i); -} diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index dfef3128f..131d24ef9 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c @@ -39,6 +39,8 @@ #include #include +static DECLARE_MUTEX(kprobe_mutex); + /* kprobe_status settings */ #define KPROBE_HIT_ACTIVE 0x00000001 #define KPROBE_HIT_SS 0x00000002 @@ -75,17 +77,25 @@ static inline int is_IF_modifier(kprobe_opcode_t *insn) int arch_prepare_kprobe(struct kprobe *p) { /* insn: must be on special executable page on x86_64. */ + up(&kprobe_mutex); p->ainsn.insn = get_insn_slot(); + down(&kprobe_mutex); if (!p->ainsn.insn) { return -ENOMEM; } - memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); return 0; } +void arch_copy_kprobe(struct kprobe *p) +{ + memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); +} + void arch_remove_kprobe(struct kprobe *p) { + up(&kprobe_mutex); free_insn_slot(p->ainsn.insn); + down(&kprobe_mutex); } static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs) @@ -425,12 +435,12 @@ static kprobe_opcode_t *get_insn_slot(void) } /* All out of space. Need to allocate a new page. Use slot 0.*/ - kip = kmalloc(sizeof(struct kprobe_insn_page), GFP_ATOMIC); + kip = kmalloc(sizeof(struct kprobe_insn_page), GFP_KERNEL); if (!kip) { return NULL; } kip->insns = (kprobe_opcode_t*) __vmalloc(PAGE_SIZE, - GFP_ATOMIC|__GFP_HIGHMEM, __pgprot(__PAGE_KERNEL_EXEC)); + GFP_KERNEL|__GFP_HIGHMEM, __pgprot(__PAGE_KERNEL_EXEC)); if (!kip->insns) { kfree(kip); return NULL; diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index cf1fe8b7f..86f9fd850 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c @@ -31,6 +31,8 @@ static int mce_dont_init; static int tolerant = 1; static int banks; static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL }; +static unsigned long console_logged; +static int notify_user; /* * Lockless MCE logging infrastructure. @@ -43,7 +45,7 @@ struct mce_log mcelog = { MCE_LOG_LEN, }; -static void mce_log(struct mce *mce) +void mce_log(struct mce *mce) { unsigned next, entry; mce->finished = 0; @@ -68,6 +70,9 @@ static void mce_log(struct mce *mce) smp_wmb(); mcelog.entry[entry].finished = 1; smp_wmb(); + + if (!test_and_set_bit(0, &console_logged)) + notify_user = 1; } static void print_mce(struct mce *m) @@ -191,6 +196,8 @@ void do_machine_check(struct pt_regs * regs, long error_code) panicm = m; panicm_found = 1; } + + tainted |= TAINT_MACHINE_CHECK; } /* Never do anything final in the polling timer */ @@ -250,6 +257,19 @@ static void mcheck_timer(void *data) { on_each_cpu(mcheck_check_cpu, NULL, 1, 1); schedule_delayed_work(&mcheck_work, check_interval * HZ); + + /* + * It's ok to read stale data here for notify_user and + * console_logged as we'll simply get the updated versions + * on the next mcheck_timer execution and atomic operations + * on console_logged act as synchronization for notify_user + * writes. + */ + if (notify_user && console_logged) { + notify_user = 0; + clear_bit(0, &console_logged); + printk(KERN_INFO "Machine check events logged\n"); + } } @@ -303,22 +323,34 @@ static void __init mce_cpu_quirks(struct cpuinfo_x86 *c) } } +static void __init mce_cpu_features(struct cpuinfo_x86 *c) +{ + switch (c->x86_vendor) { + case X86_VENDOR_INTEL: + mce_intel_feature_init(c); + break; + default: + break; + } +} + /* * Called for each booted CPU to set up machine checks. * Must be called with preempt off. */ void __init mcheck_init(struct cpuinfo_x86 *c) { - static unsigned long mce_cpus __initdata = 0; + static cpumask_t mce_cpus __initdata = CPU_MASK_NONE; mce_cpu_quirks(c); if (mce_dont_init || - test_and_set_bit(smp_processor_id(), &mce_cpus) || + cpu_test_and_set(smp_processor_id(), mce_cpus) || !mce_available(c)) return; mce_init(NULL); + mce_cpu_features(c); } /* @@ -359,8 +391,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, loff memset(mcelog.entry, 0, next * sizeof(struct mce)); mcelog.next = 0; - smp_wmb(); - + synchronize_kernel(); /* Collect entries that were still getting written before the synchronize. */ diff --git a/arch/x86_64/kernel/module.c b/arch/x86_64/kernel/module.c index 78ce354a5..d763d10c8 100644 --- a/arch/x86_64/kernel/module.c +++ b/arch/x86_64/kernel/module.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 646b3c0a9..7f5f57e54 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c @@ -330,6 +330,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) } } } + clustered_apic_check(); if (!num_processors) printk(KERN_ERR "SMP mptable: no processors registered!\n"); return num_processors; @@ -575,7 +576,6 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) extern void __bad_mpf_size(void); unsigned int *bp = phys_to_virt(base); struct intel_mp_floating *mpf; - static int printed __initdata; Dprintk("Scan SMP from %p for %ld bytes.\n", bp,length); if (sizeof(*mpf) != 16) @@ -599,10 +599,6 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) bp += 4; length -= 16; } - if (!printed) { - printk(KERN_INFO "No mptable found.\n"); - printed = 1; - } return 0; } @@ -639,7 +635,11 @@ void __init find_intel_smp (void) address = *(unsigned short *)phys_to_virt(0x40E); address <<= 4; - smp_scan_config(address, 0x1000); + if (smp_scan_config(address, 0x1000)) + return; + + /* If we have come this far, we did not find an MP table */ + printk(KERN_INFO "No mptable found.\n"); } /* @@ -895,25 +895,25 @@ void __init mp_config_acpi_legacy_irqs (void) return; } -void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) +int mp_register_gsi(u32 gsi, int edge_level, int active_high_low) { int ioapic = -1; int ioapic_pin = 0; int idx, bit = 0; if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) - return; + return gsi; #ifdef CONFIG_ACPI_BUS /* Don't set up the ACPI SCI because it's already set up */ if (acpi_fadt.sci_int == gsi) - return; + return gsi; #endif ioapic = mp_find_ioapic(gsi); if (ioapic < 0) { printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); - return; + return gsi; } ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start; @@ -929,12 +929,12 @@ void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) printk(KERN_ERR "Invalid reference to IOAPIC pin " "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, ioapic_pin); - return; + return gsi; } if ((1< #include #include +#include #include #include @@ -42,7 +43,7 @@ * This is maintained separately from nmi_active because the NMI * watchdog may also be driven from the I/O APIC timer. */ -static spinlock_t lapic_nmi_owner_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(lapic_nmi_owner_lock); static unsigned int lapic_nmi_owner; #define LAPIC_NMI_WATCHDOG (1<<0) #define LAPIC_NMI_RESERVED (1<<1) @@ -54,7 +55,7 @@ static unsigned int lapic_nmi_owner; * -1: the lapic NMI watchdog is disabled, but can be enabled */ int nmi_active; /* oprofile uses this */ -static int panic_on_timeout; +int panic_on_timeout; unsigned int nmi_watchdog = NMI_DEFAULT; static unsigned int nmi_hz = HZ; @@ -129,8 +130,12 @@ int __init check_nmi_watchdog (void) mdelay((10*1000)/nmi_hz); // wait 10 ticks for (cpu = 0; cpu < NR_CPUS; cpu++) { - if (!cpu_online(cpu)) +#ifdef CONFIG_SMP + /* Check cpu_callin_map here because that is set + after the timer is started. */ + if (!cpu_isset(cpu, cpu_callin_map)) continue; +#endif if (cpu_pda[cpu].__nmi_count - counts[cpu] <= 5) { printk("CPU#%d: NMI appears to be stuck (%d)!\n", cpu, @@ -344,8 +349,6 @@ void setup_apic_nmi_watchdog(void) nmi_active = 1; } -static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED; - /* * the best way to detect whether a CPU has a 'hard lockup' problem * is to check it's local APIC timer IRQ counts. If they are not @@ -395,21 +398,7 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) alert_counter[cpu] = 0; return; } - spin_lock(&nmi_print_lock); - /* - * We are in trouble anyway, lets at least try - * to get a message out. - */ - bust_spinlocks(1); - printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu); - show_registers(regs); - if (panic_on_timeout || panic_on_oops) - panic("nmi watchdog"); - printk("console shuts up ...\n"); - console_silent(); - spin_unlock(&nmi_print_lock); - bust_spinlocks(0); - do_exit(SIGSEGV); + die_nmi("NMI Watchdog detected LOCKUP on CPU%d", regs); } } else { last_irq_sums[cpu] = sum; @@ -447,6 +436,49 @@ void unset_nmi_callback(void) nmi_callback = dummy_nmi_callback; } +#ifdef CONFIG_SYSCTL + +static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu) +{ + unsigned char reason = get_nmi_reason(); + char buf[64]; + + if (!(reason & 0xc0)) { + sprintf(buf, "NMI received for unknown reason %02x\n", reason); + die_nmi(buf,regs); + } + return 0; +} + +/* + * proc handler for /proc/sys/kernel/unknown_nmi_panic + */ +int proc_unknown_nmi_panic(struct ctl_table *table, int write, struct file *file, + void __user *buffer, size_t *length, loff_t *ppos) +{ + int old_state; + + old_state = unknown_nmi_panic; + proc_dointvec(table, write, file, buffer, length, ppos); + if (!!old_state == !!unknown_nmi_panic) + return 0; + + if (unknown_nmi_panic) { + if (reserve_lapic_nmi() < 0) { + unknown_nmi_panic = 0; + return -EBUSY; + } else { + set_nmi_callback(unknown_nmi_panic_callback); + } + } else { + release_lapic_nmi(); + unset_nmi_callback(); + } + return 0; +} + +#endif + EXPORT_SYMBOL(nmi_active); EXPORT_SYMBOL(nmi_watchdog); EXPORT_SYMBOL(reserve_lapic_nmi); diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index ca608a2a0..ca01bc202 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c @@ -22,10 +22,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -65,7 +65,7 @@ int iommu_bio_merge = 0; #define MAX_NB 8 /* Allocation bitmap for the remapping area */ -static spinlock_t iommu_bitmap_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(iommu_bitmap_lock); static unsigned long *iommu_gart_bitmap; /* guarded by iommu_bitmap_lock */ static u32 gart_unmapped_entry; @@ -81,7 +81,7 @@ static u32 gart_unmapped_entry; #define for_all_nb(dev) \ dev = NULL; \ - while ((dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)\ + while ((dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)\ if (dev->bus->number == 0 && \ (PCI_SLOT(dev->devfn) >= 24) && (PCI_SLOT(dev->devfn) <= 31)) @@ -236,11 +236,21 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, mmu = 1; if (no_iommu || dma_mask < 0xffffffffUL) { if (high) { + free_pages((unsigned long)memory, + get_order(size)); + + if (swiotlb) { + return + swiotlb_alloc_coherent(dev, size, + dma_handle, + gfp); + } + if (!(gfp & GFP_DMA)) { gfp |= GFP_DMA; goto again; } - goto free; + return NULL; } mmu = 0; } @@ -260,9 +270,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, error: if (panic_on_overflow) panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n", size); -free: free_pages((unsigned long)memory, get_order(size)); - /* XXX Could use the swiotlb pool here too */ return NULL; } @@ -273,6 +281,11 @@ free: void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t bus) { + if (swiotlb) { + swiotlb_free_coherent(dev, size, vaddr, bus); + return; + } + dma_unmap_single(dev, bus, size, 0); free_pages((unsigned long)vaddr, get_order(size)); } diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index 6e835be5f..3a3522b9c 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -54,10 +54,14 @@ unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; atomic_t hlt_counter = ATOMIC_INIT(0); +unsigned long boot_option_idle_override = 0; +EXPORT_SYMBOL(boot_option_idle_override); + /* * Powermanagement idle function, if any.. */ void (*pm_idle)(void); +static cpumask_t cpu_idle_map; void disable_hlt(void) { @@ -120,6 +124,23 @@ static void poll_idle (void) } } + +void cpu_idle_wait(void) +{ + int cpu; + cpumask_t map; + + for_each_online_cpu(cpu) + cpu_set(cpu, cpu_idle_map); + + wmb(); + do { + ssleep(1); + cpus_and(map, cpu_idle_map, cpu_online_map); + } while (!cpus_empty(map)); +} +EXPORT_SYMBOL_GPL(cpu_idle_wait); + /* * The idle thread. There's no useful work to be * done, so just try to conserve power and have a @@ -128,21 +149,20 @@ static void poll_idle (void) */ void cpu_idle (void) { + int cpu = smp_processor_id(); + /* endless idle loop with no priority at all */ while (1) { while (!need_resched()) { void (*idle)(void); - /* - * Mark this as an RCU critical section so that - * synchronize_kernel() in the unload path waits - * for our completion. - */ - rcu_read_lock(); + + if (cpu_isset(cpu, cpu_idle_map)) + cpu_clear(cpu, cpu_idle_map); + rmb(); idle = pm_idle; if (!idle) idle = default_idle; idle(); - rcu_read_unlock(); } schedule(); } @@ -196,6 +216,7 @@ static int __init idle_setup (char *str) pm_idle = poll_idle; } + boot_option_idle_override = 1; return 1; } @@ -211,7 +232,7 @@ void __show_regs(struct pt_regs * regs) printk("\n"); print_modules(); printk("Pid: %d, comm: %.20s %s %s\n", - current->pid, current->comm, print_tainted(), UTS_RELEASE); + current->pid, current->comm, print_tainted(), system_utsname.release); printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); printk_address(regs->rip); printk("\nRSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags); @@ -293,7 +314,7 @@ void flush_thread(void) * Forget coprocessor state.. */ clear_fpu(tsk); - tsk->used_math = 0; + clear_used_math(); } void release_thread(struct task_struct *dead_task) @@ -359,7 +380,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, if (rsp == ~0UL) { childregs->rsp = (unsigned long)childregs; } - p->set_child_tid = p->clear_child_tid = NULL; p->thread.rsp = (unsigned long) childregs; p->thread.rsp0 = (unsigned long) (childregs+1); @@ -542,8 +562,11 @@ long sys_execve(char __user *name, char __user * __user *argv, if (IS_ERR(filename)) return error; error = do_execve(filename, argv, envp, ®s); - if (error == 0) + if (error == 0) { + task_lock(current); current->ptrace &= ~PT_DTRACE; + task_unlock(current); + } putname(filename); return error; } @@ -554,6 +577,12 @@ void set_personality_64bit(void) /* Make sure to be in 64bit mode */ clear_thread_flag(TIF_IA32); + + /* TBD: overwrites user setup. Should have two bits. + But 64bit processes have always behaved this way, + so it's not too bad. The main problem is just that + 32bit childs are affected again. */ + current->personality &= ~READ_IMPLIES_EXEC; } asmlinkage long sys_fork(struct pt_regs *regs) diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c index 672637d53..7c2d280ba 100644 --- a/arch/x86_64/kernel/ptrace.c +++ b/arch/x86_64/kernel/ptrace.c @@ -325,6 +325,8 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data ret = 0; break; case offsetof(struct user, u_debugreg[7]): + /* See arch/i386/kernel/ptrace.c for an explanation of + * this awkward check.*/ data &= ~DR_CONTROL_RESERVED; for(i=0; i<4; i++) if ((0x5454 >> ((data >> (16 + 4*i)) & 0xf)) & 1) @@ -397,7 +399,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data long tmp; ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ break; clear_tsk_thread_flag(child, TIF_SINGLESTEP); child->exit_code = SIGKILL; @@ -480,7 +482,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data ret = -EIO; break; } - child->used_math = 1; + set_stopped_child_used_math(child); ret = set_fpregs(child, (struct user_i387_struct __user *)data); break; } diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c index 3dac33924..be4b36f76 100644 --- a/arch/x86_64/kernel/reboot.c +++ b/arch/x86_64/kernel/reboot.c @@ -22,18 +22,18 @@ void (*pm_power_off)(void); static long no_idt[3]; static enum { - BOOT_BIOS = 'b', BOOT_TRIPLE = 't', BOOT_KBD = 'k' } reboot_type = BOOT_KBD; static int reboot_mode = 0; +int reboot_force; -/* reboot=b[ios] | t[riple] | k[bd] [, [w]arm | [c]old] - bios Use the CPU reboot vector for warm reset +/* reboot=t[riple] | k[bd] [, [w]arm | [c]old] warm Don't set the cold reboot flag cold Set the cold reboot flag triple Force a triple fault (init) kbd Use the keyboard controller. cold reset (default) + force Avoid anything that could hang. */ static int __init reboot_setup(char *str) { @@ -52,6 +52,9 @@ static int __init reboot_setup(char *str) case 'k': reboot_type = *str; break; + case 'f': + reboot_force = 1; + break; } if((str = strchr(str,',')) != NULL) str++; @@ -63,44 +66,19 @@ static int __init reboot_setup(char *str) __setup("reboot=", reboot_setup); -/* overwrites random kernel memory. Should not be kernel .text */ -#define WARMBOOT_TRAMP 0x1000UL - -static void reboot_warm(void) -{ - extern unsigned char warm_reboot[], warm_reboot_end[]; - printk("warm reboot\n"); - - local_irq_disable(); - - /* restore identity mapping */ - init_level4_pgt[0] = __pml4(__pa(level3_ident_pgt) | 7); - __flush_tlb_all(); - - /* Move the trampoline to low memory */ - memcpy(__va(WARMBOOT_TRAMP), warm_reboot, warm_reboot_end - warm_reboot); - - /* Start it in compatibility mode. */ - asm volatile( " pushq $0\n" /* ss */ - " pushq $0x2000\n" /* rsp */ - " pushfq\n" /* eflags */ - " pushq %[cs]\n" - " pushq %[target]\n" - " iretq" :: - [cs] "i" (__KERNEL_COMPAT32_CS), - [target] "b" (WARMBOOT_TRAMP)); -} - #ifdef CONFIG_SMP static void smp_halt(void) { int cpuid = safe_smp_processor_id(); - static int first_entry = 1; + static int first_entry = 1; + + if (reboot_force) + return; - if (first_entry) { - first_entry = 0; - smp_call_function((void *)machine_restart, NULL, 1, 0); - } + if (first_entry) { + first_entry = 0; + smp_call_function((void *)machine_restart, NULL, 1, 0); + } smp_stop_cpu(); @@ -129,19 +107,20 @@ void machine_restart(char * __unused) { int i; + printk("machine restart\n"); + #ifdef CONFIG_SMP smp_halt(); #endif - local_irq_disable(); - + if (!reboot_force) { + local_irq_disable(); #ifndef CONFIG_SMP - disable_local_APIC(); + disable_local_APIC(); #endif - - disable_IO_APIC(); - - local_irq_enable(); + disable_IO_APIC(); + local_irq_enable(); + } /* Tell the BIOS if we want cold or warm reboot */ *((unsigned short *)__va(0x472)) = reboot_mode; @@ -149,9 +128,6 @@ void machine_restart(char * __unused) for (;;) { /* Could also try the reset bit in the Hammer NB */ switch (reboot_type) { - case BOOT_BIOS: - reboot_warm(); - case BOOT_KBD: for (i=0; i<100; i++) { kb_wait(); @@ -161,8 +137,8 @@ void machine_restart(char * __unused) } case BOOT_TRIPLE: - __asm__ __volatile__("lidt (%0)": :"r" (&no_idt)); - __asm__ __volatile__("int3"); + __asm__ __volatile__("lidt (%0)": :"r" (&no_idt)); + __asm__ __volatile__("int3"); reboot_type = BOOT_KBD; break; diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 108cf17c4..96e4ca9b7 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c @@ -53,9 +53,10 @@ #include #include #include -#include #include #include +#include +#include /* * Machine setup.. @@ -74,9 +75,14 @@ extern acpi_interrupt_flags acpi_sci_flags; int __initdata acpi_force = 0; #endif +int acpi_numa __initdata; + /* For PCI or other memory-mapped resources */ unsigned long pci_mem_start = 0x10000000; +/* Boot loader ID as an integer, for the benefit of proc_dointvec */ +int bootloader_type; + unsigned long saved_video_mode; #ifdef CONFIG_SWIOTLB @@ -105,15 +111,24 @@ extern char _text, _etext, _edata, _end; char command_line[COMMAND_LINE_SIZE]; struct resource standard_io_resources[] = { - { "dma1", 0x00, 0x1f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "pic1", 0x20, 0x21, IORESOURCE_BUSY | IORESOURCE_IO }, - { "timer0", 0x40, 0x43, IORESOURCE_BUSY | IORESOURCE_IO }, - { "timer1", 0x50, 0x53, IORESOURCE_BUSY | IORESOURCE_IO }, - { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "pic2", 0xa0, 0xa1, IORESOURCE_BUSY | IORESOURCE_IO }, - { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY | IORESOURCE_IO }, - { "fpu", 0xf0, 0xff, IORESOURCE_BUSY | IORESOURCE_IO } + { .name = "dma1", .start = 0x00, .end = 0x1f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "pic1", .start = 0x20, .end = 0x21, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "timer0", .start = 0x40, .end = 0x43, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "timer1", .start = 0x50, .end = 0x53, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "keyboard", .start = 0x60, .end = 0x6f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "dma page reg", .start = 0x80, .end = 0x8f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "pic2", .start = 0xa0, .end = 0xa1, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "dma2", .start = 0xc0, .end = 0xdf, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "fpu", .start = 0xf0, .end = 0xff, + .flags = IORESOURCE_BUSY | IORESOURCE_IO } }; #define STANDARD_IO_RESOURCES \ @@ -121,28 +136,66 @@ struct resource standard_io_resources[] = { #define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM) -struct resource data_resource = { "Kernel data", 0, 0, IORESOURCE_RAM }; -struct resource code_resource = { "Kernel code", 0, 0, IORESOURCE_RAM }; +struct resource data_resource = { + .name = "Kernel data", + .start = 0, + .end = 0, + .flags = IORESOURCE_RAM, +}; +struct resource code_resource = { + .name = "Kernel code", + .start = 0, + .end = 0, + .flags = IORESOURCE_RAM, +}; #define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM) -static struct resource system_rom_resource = { "System ROM", 0xf0000, 0xfffff, IORESOURCE_ROM }; -static struct resource extension_rom_resource = { "Extension ROM", 0xe0000, 0xeffff, IORESOURCE_ROM }; +static struct resource system_rom_resource = { + .name = "System ROM", + .start = 0xf0000, + .end = 0xfffff, + .flags = IORESOURCE_ROM, +}; + +static struct resource extension_rom_resource = { + .name = "Extension ROM", + .start = 0xe0000, + .end = 0xeffff, + .flags = IORESOURCE_ROM, +}; static struct resource adapter_rom_resources[] = { - { "Adapter ROM", 0xc8000, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM } + { .name = "Adapter ROM", .start = 0xc8000, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM } }; #define ADAPTER_ROM_RESOURCES \ (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) -static struct resource video_rom_resource = { "Video ROM", 0xc0000, 0xc7fff, IORESOURCE_ROM }; -static struct resource video_ram_resource = { "Video RAM area", 0xa0000, 0xbffff, IORESOURCE_RAM }; +static struct resource video_rom_resource = { + .name = "Video ROM", + .start = 0xc0000, + .end = 0xc7fff, + .flags = IORESOURCE_ROM, +}; + +static struct resource video_ram_resource = { + .name = "Video RAM area", + .start = 0xa0000, + .end = 0xbffff, + .flags = IORESOURCE_RAM, +}; #define romsignature(x) (*(unsigned short *)(x) == 0xaa55) @@ -311,6 +364,9 @@ static __init void parse_cmdline_early (char ** cmdline_p) if (!memcmp(from,"oops=panic", 10)) panic_on_oops = 1; + if (!memcmp(from, "noexec=", 7)) + nonx_setup(from + 7); + next_char: c = *(from++); if (!c) @@ -451,6 +507,7 @@ void __init setup_arch(char **cmdline_p) edid_info = EDID_INFO; aux_device_present = AUX_DEVICE_INFO; saved_video_mode = SAVED_VIDEO_MODE; + bootloader_type = LOADER_TYPE; #ifdef CONFIG_BLK_DEV_RAM rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; @@ -474,6 +531,8 @@ void __init setup_arch(char **cmdline_p) parse_cmdline_early(cmdline_p); + early_identify_cpu(&boot_cpu_data); + /* * partially used pages are not usable - thus * we are rounding upwards: @@ -482,7 +541,22 @@ void __init setup_arch(char **cmdline_p) check_efer(); - init_memory_mapping(); + init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); + +#ifdef CONFIG_ACPI_BOOT + /* + * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). + * Call this early for SRAT node setup. + */ + acpi_boot_table_init(); +#endif + +#ifdef CONFIG_ACPI_NUMA + /* + * Parse SRAT to discover nodes. + */ + acpi_numa_init(); +#endif #ifdef CONFIG_DISCONTIGMEM numa_initmem_init(0, end_pfn); @@ -550,16 +624,15 @@ void __init setup_arch(char **cmdline_p) #endif paging_init(); - check_ioapic(); + check_ioapic(); + #ifdef CONFIG_ACPI_BOOT - /* - * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). - * Must do this after paging_init (due to reliance on fixmap, and thus - * the bootmem allocator) but before get_smp_config (to allow parsing - * of MADT). - */ + /* + * Read APIC and some other early information from ACPI tables. + */ acpi_boot_init(); #endif + #ifdef CONFIG_X86_LOCAL_APIC /* * get boot-time SMP configuration: @@ -610,7 +683,7 @@ static int __init get_model_name(struct cpuinfo_x86 *c) { unsigned int *v; - if (cpuid_eax(0x80000000) < 0x80000004) + if (c->x86_cpuid_level < 0x80000004) return 0; v = (unsigned int *) c->x86_model_id; @@ -626,24 +699,24 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c) { unsigned int n, dummy, eax, ebx, ecx, edx; - n = cpuid_eax(0x80000000); + n = c->x86_cpuid_level; if (n >= 0x80000005) { cpuid(0x80000005, &dummy, &ebx, &ecx, &edx); printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); - c->x86_cache_size=(ecx>>24)+(edx>>24); - /* DTLB and ITLB together, but only 4K */ - c->x86_tlbsize = ((ebx>>16)&0xff) + (ebx&0xff); + c->x86_cache_size=(ecx>>24)+(edx>>24); + /* On K8 L1 TLB is inclusive, so don't count it */ + c->x86_tlbsize = 0; } if (n >= 0x80000006) { cpuid(0x80000006, &dummy, &ebx, &ecx, &edx); - ecx = cpuid_ecx(0x80000006); - c->x86_cache_size = ecx >> 16; + ecx = cpuid_ecx(0x80000006); + c->x86_cache_size = ecx >> 16; c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff); - printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", + printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", c->x86_cache_size, ecx & 0xFF); } @@ -661,6 +734,9 @@ static int __init init_amd(struct cpuinfo_x86 *c) { int r; int level; +#ifdef CONFIG_NUMA + int cpu; +#endif /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */ @@ -683,7 +759,7 @@ static int __init init_amd(struct cpuinfo_x86 *c) } display_cacheinfo(c); - if (c->cpuid_level >= 0x80000008) { + if (c->x86_cpuid_level >= 0x80000008) { c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; if (c->x86_num_cores & (c->x86_num_cores - 1)) c->x86_num_cores = 1; @@ -692,13 +768,16 @@ static int __init init_amd(struct cpuinfo_x86 *c) /* On a dual core setup the lower bits of apic id distingush the cores. Fix up the CPU<->node mappings here based on that. - Assumes number of cores is a power of two. */ - if (c->x86_num_cores > 1) { - int cpu = c->x86_apicid; + Assumes number of cores is a power of two. + When using SRAT use mapping from SRAT. */ + cpu = c->x86_apicid; + if (acpi_numa <= 0 && c->x86_num_cores > 1) { cpu_to_node[cpu] = cpu >> hweight32(c->x86_num_cores - 1); - printk(KERN_INFO "CPU %d -> Node %d\n", - cpu, cpu_to_node[cpu]); + if (!node_online(cpu_to_node[cpu])) + cpu_to_node[cpu] = first_node(node_online_map); } + printk(KERN_INFO "CPU %d(%d) -> Node %d\n", + cpu, c->x86_num_cores, cpu_to_node[cpu]); #endif } @@ -710,7 +789,6 @@ static void __init detect_ht(struct cpuinfo_x86 *c) #ifdef CONFIG_SMP u32 eax, ebx, ecx, edx; int index_lsb, index_msb, tmp; - int initial_apic_id; int cpu = smp_processor_id(); if (!cpu_has(c, X86_FEATURE_HT)) @@ -745,144 +823,34 @@ static void __init detect_ht(struct cpuinfo_x86 *c) } if (index_lsb != index_msb ) index_msb++; - initial_apic_id = hard_smp_processor_id(); - phys_proc_id[cpu] = initial_apic_id >> index_msb; + phys_proc_id[cpu] = phys_pkg_id(index_msb); printk(KERN_INFO "CPU: Physical Processor ID: %d\n", phys_proc_id[cpu]); } #endif } - -#define LVL_1_INST 1 -#define LVL_1_DATA 2 -#define LVL_2 3 -#define LVL_3 4 -#define LVL_TRACE 5 - -struct _cache_table -{ - unsigned char descriptor; - char cache_type; - short size; -}; -/* all the cache descriptor types we care about (no TLB or trace cache entries) */ -static struct _cache_table cache_table[] __initdata = +static void __init sched_cmp_hack(struct cpuinfo_x86 *c) { - { 0x06, LVL_1_INST, 8 }, - { 0x08, LVL_1_INST, 16 }, - { 0x0a, LVL_1_DATA, 8 }, - { 0x0c, LVL_1_DATA, 16 }, - { 0x22, LVL_3, 512 }, - { 0x23, LVL_3, 1024 }, - { 0x25, LVL_3, 2048 }, - { 0x29, LVL_3, 4096 }, - { 0x2c, LVL_1_DATA, 32 }, - { 0x30, LVL_1_INST, 32 }, - { 0x39, LVL_2, 128 }, - { 0x3b, LVL_2, 128 }, - { 0x3c, LVL_2, 256 }, - { 0x41, LVL_2, 128 }, - { 0x42, LVL_2, 256 }, - { 0x43, LVL_2, 512 }, - { 0x44, LVL_2, 1024 }, - { 0x45, LVL_2, 2048 }, - { 0x60, LVL_1_DATA, 16 }, - { 0x66, LVL_1_DATA, 8 }, - { 0x67, LVL_1_DATA, 16 }, - { 0x68, LVL_1_DATA, 32 }, - { 0x70, LVL_TRACE, 12 }, - { 0x71, LVL_TRACE, 16 }, - { 0x72, LVL_TRACE, 32 }, - { 0x79, LVL_2, 128 }, - { 0x7a, LVL_2, 256 }, - { 0x7b, LVL_2, 512 }, - { 0x7c, LVL_2, 1024 }, - { 0x82, LVL_2, 256 }, - { 0x83, LVL_2, 512 }, - { 0x84, LVL_2, 1024 }, - { 0x85, LVL_2, 2048 }, - { 0x86, LVL_2, 512 }, - { 0x87, LVL_2, 1024 }, - { 0x00, 0, 0} -}; - +#ifdef CONFIG_SMP + /* AMD dual core looks like HT but isn't really. Hide it from the + scheduler. This works around problems with the domain scheduler. + Also probably gives slightly better scheduling and disables + SMT nice which is harmful on dual core. + TBD tune the domain scheduler for dual core. */ + if (c->x86_vendor == X86_VENDOR_AMD && cpu_has(c, X86_FEATURE_CMP_LEGACY)) + smp_num_siblings = 1; +#endif +} + static void __init init_intel(struct cpuinfo_x86 *c) { /* Cache sizes */ - unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; unsigned n; - if (c->cpuid_level > 1) { - /* supports eax=2 call */ - int i, j, n; - int regs[4]; - unsigned char *dp = (unsigned char *)regs; - - /* Number of times to iterate */ - n = cpuid_eax(2) & 0xFF; - - for ( i = 0 ; i < n ; i++ ) { - cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]); - - /* If bit 31 is set, this is an unknown format */ - for ( j = 0 ; j < 3 ; j++ ) { - if ( regs[j] < 0 ) regs[j] = 0; - } - - /* Byte 0 is level count, not a descriptor */ - for ( j = 1 ; j < 16 ; j++ ) { - unsigned char des = dp[j]; - unsigned char k = 0; - - /* look up this descriptor in the table */ - while (cache_table[k].descriptor != 0) - { - if (cache_table[k].descriptor == des) { - switch (cache_table[k].cache_type) { - case LVL_1_INST: - l1i += cache_table[k].size; - break; - case LVL_1_DATA: - l1d += cache_table[k].size; - break; - case LVL_2: - l2 += cache_table[k].size; - break; - case LVL_3: - l3 += cache_table[k].size; - break; - case LVL_TRACE: - trace += cache_table[k].size; - break; - } - - break; - } - - k++; - } - } - } - - if (trace) - printk (KERN_INFO "CPU: Trace cache: %dK uops", trace); - else if (l1i) - printk (KERN_INFO "CPU: L1 I cache: %dK", l1i); - if (l1d) - printk(", L1 D cache: %dK\n", l1d); - else - printk("\n"); - if (l2) - printk(KERN_INFO "CPU: L2 cache: %dK\n", l2); - if (l3) - printk(KERN_INFO "CPU: L3 cache: %dK\n", l3); - - c->x86_cache_size = l2 ? l2 : (l1i+l1d); - } - - n = cpuid_eax(0x80000000); + init_intel_cacheinfo(c); + n = c->x86_cpuid_level; if (n >= 0x80000008) { unsigned eax = cpuid_eax(0x80000008); c->x86_virt_bits = (eax >> 8) & 0xff; @@ -928,13 +896,14 @@ void __init early_identify_cpu(struct cpuinfo_x86 *c) c->x86_cache_alignment = c->x86_clflush_size; c->x86_num_cores = 1; c->x86_apicid = c == &boot_cpu_data ? 0 : c - cpu_data; + c->x86_cpuid_level = 0; memset(&c->x86_capability, 0, sizeof c->x86_capability); /* Get vendor name */ - cpuid(0x00000000, &c->cpuid_level, - (int *)&c->x86_vendor_id[0], - (int *)&c->x86_vendor_id[8], - (int *)&c->x86_vendor_id[4]); + cpuid(0x00000000, (unsigned int *)&c->cpuid_level, + (unsigned int *)&c->x86_vendor_id[0], + (unsigned int *)&c->x86_vendor_id[8], + (unsigned int *)&c->x86_vendor_id[4]); get_cpu_vendor(c); @@ -974,19 +943,21 @@ void __init identify_cpu(struct cpuinfo_x86 *c) /* AMD-defined flags: level 0x80000001 */ xlvl = cpuid_eax(0x80000000); - if ( (xlvl & 0xffff0000) == 0x80000000 ) { - if ( xlvl >= 0x80000001 ) { + c->x86_cpuid_level = xlvl; + if ((xlvl & 0xffff0000) == 0x80000000) { + if (xlvl >= 0x80000001) { c->x86_capability[1] = cpuid_edx(0x80000001); c->x86_capability[5] = cpuid_ecx(0x80000001); } - if ( xlvl >= 0x80000004 ) + if (xlvl >= 0x80000004) get_model_name(c); /* Default name */ } /* Transmeta-defined flags: level 0x80860001 */ xlvl = cpuid_eax(0x80860000); - if ( (xlvl & 0xffff0000) == 0x80860000 ) { - if ( xlvl >= 0x80860001 ) + if ((xlvl & 0xffff0000) == 0x80860000) { + /* Don't set x86_cpuid_level here for now to not confuse. */ + if (xlvl >= 0x80860001) c->x86_capability[2] = cpuid_edx(0x80860001); } @@ -1000,38 +971,44 @@ void __init identify_cpu(struct cpuinfo_x86 *c) * At the end of this section, c->x86_capability better * indicate the features this CPU genuinely supports! */ - switch ( c->x86_vendor ) { - - case X86_VENDOR_AMD: - init_amd(c); - break; + switch (c->x86_vendor) { + case X86_VENDOR_AMD: + init_amd(c); + break; - case X86_VENDOR_INTEL: - init_intel(c); - break; + case X86_VENDOR_INTEL: + init_intel(c); + break; - case X86_VENDOR_UNKNOWN: - default: - display_cacheinfo(c); - break; + case X86_VENDOR_UNKNOWN: + default: + display_cacheinfo(c); + break; } select_idle_routine(c); detect_ht(c); - + sched_cmp_hack(c); + /* * On SMP, boot_cpu_data holds the common feature set between * all CPUs; so make sure that we indicate which features are * common between the CPUs. The first time this routine gets * executed, c == &boot_cpu_data. */ - if ( c != &boot_cpu_data ) { + if (c != &boot_cpu_data) { /* AND the already accumulated flags with these */ - for ( i = 0 ; i < NCAPINTS ; i++ ) + for (i = 0 ; i < NCAPINTS ; i++) boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; } +#ifdef CONFIG_X86_MCE mcheck_init(c); +#endif +#ifdef CONFIG_NUMA + if (c != &boot_cpu_data) + numa_add_cpu(c - cpu_data); +#endif } @@ -1070,10 +1047,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL, /* AMD-defined */ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "pni", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL, - NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow", + NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", /* Transmeta-defined */ "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, @@ -1092,6 +1069,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* AMD-defined (#2) */ + "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static char *x86_power_flags[] = { "ts", /* temperature sensor */ @@ -1131,11 +1114,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); -#ifdef CONFIG_X86_HT - if (cpu_has_ht) { - seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]); - seq_printf(m, "siblings\t: %d\n", smp_num_siblings); - } +#ifdef CONFIG_SMP + seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]); + seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings); #endif seq_printf(m, @@ -1177,6 +1158,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, " [%d]", i); } } + seq_printf(m, "\n"); if (c->x86_num_cores > 1) seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores); diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c index b83680afe..b5305b04b 100644 --- a/arch/x86_64/kernel/setup64.c +++ b/arch/x86_64/kernel/setup64.c @@ -11,11 +11,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -28,7 +28,7 @@ char x86_boot_params[2048] __initdata = {0,}; -unsigned long cpu_initialized __initdata = 0; +cpumask_t cpu_initialized __initdata = CPU_MASK_NONE; struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned; @@ -43,83 +43,48 @@ char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); unsigned long __supported_pte_mask = ~0UL; static int do_not_nx __initdata = 0; -unsigned long vm_stack_flags = __VM_STACK_FLAGS; -unsigned long vm_stack_flags32 = __VM_STACK_FLAGS; -unsigned long vm_data_default_flags = __VM_DATA_DEFAULT_FLAGS; -unsigned long vm_data_default_flags32 = __VM_DATA_DEFAULT_FLAGS; -unsigned long vm_force_exec32 = PROT_EXEC; /* noexec=on|off Control non executable mappings for 64bit processes. -on Enable +on Enable(default) off Disable -noforce (default) Don't enable by default for heap/stack/data, - but allow PROT_EXEC to be effective - */ -static int __init nonx_setup(char *str) +int __init nonx_setup(char *str) { - if (!strcmp(str, "on")) { + if (!strncmp(str, "on", 2)) { __supported_pte_mask |= _PAGE_NX; do_not_nx = 0; - vm_data_default_flags &= ~VM_EXEC; - vm_stack_flags &= ~VM_EXEC; - } else if (!strcmp(str, "noforce") || !strcmp(str, "off")) { - do_not_nx = (str[0] == 'o'); - if (do_not_nx) - __supported_pte_mask &= ~_PAGE_NX; - vm_data_default_flags |= VM_EXEC; - vm_stack_flags |= VM_EXEC; - } - return 1; + } else if (!strncmp(str, "off", 3)) { + do_not_nx = 1; + __supported_pte_mask &= ~_PAGE_NX; + } + return 0; } +__setup("noexec=", nonx_setup); /* parsed early actually */ -__setup("noexec=", nonx_setup); - -/* noexec32=opt{,opt} - -Control the no exec default for 32bit processes. Can be also overwritten -per executable using ELF header flags (e.g. needed for the X server) -Requires noexec=on or noexec=noforce to be effective. +int force_personality32 = READ_IMPLIES_EXEC; -Valid options: - all,on Heap,stack,data is non executable. - off (default) Heap,stack,data is executable - stack Stack is non executable, heap/data is. - force Don't imply PROT_EXEC for PROT_READ - compat (default) Imply PROT_EXEC for PROT_READ +/* noexec32=on|off +Control non executable heap for 32bit processes. +To control the stack too use noexec=off +on PROT_READ does not imply PROT_EXEC for 32bit processes +off PROT_READ implies PROT_EXEC (default) */ - static int __init nonx32_setup(char *s) - { - while (*s) { - if (!strncmp(s, "all", 3) || !strncmp(s,"on",2)) { - vm_data_default_flags32 &= ~VM_EXEC; - vm_stack_flags32 &= ~VM_EXEC; - } else if (!strncmp(s, "off",3)) { - vm_data_default_flags32 |= VM_EXEC; - vm_stack_flags32 |= VM_EXEC; - } else if (!strncmp(s, "stack", 5)) { - vm_data_default_flags32 |= VM_EXEC; - vm_stack_flags32 &= ~VM_EXEC; - } else if (!strncmp(s, "force",5)) { - vm_force_exec32 = 0; - } else if (!strncmp(s, "compat",5)) { - vm_force_exec32 = PROT_EXEC; - } - s += strcspn(s, ","); - if (*s == ',') - ++s; - } - return 1; -} - -__setup("noexec32=", nonx32_setup); +static int __init nonx32_setup(char *str) +{ + if (!strcmp(str, "on")) + force_personality32 &= ~READ_IMPLIES_EXEC; + else if (!strcmp(str, "off")) + force_personality32 |= READ_IMPLIES_EXEC; + return 0; +} +__setup("noexec32=", nonx32_setup); /* * Great future plan: - * Declare PDA itself and support (irqstack,tss,pml4) as per cpu data. + * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data. * Always point %gs to its beginning */ void __init setup_per_cpu_areas(void) @@ -136,13 +101,13 @@ void __init setup_per_cpu_areas(void) for (i = 0; i < NR_CPUS; i++) { unsigned char *ptr; - /* If possible allocate on the node of the CPU. - In case it doesn't exist round-robin nodes. */ - if (!NODE_DATA(i % numnodes)) { - printk("cpu with no node %d, numnodes %d\n", i, numnodes); + + if (!NODE_DATA(cpu_to_node(i))) { + printk("cpu with no node %d, num_online_nodes %d\n", + i, num_online_nodes()); ptr = alloc_bootmem(size); } else { - ptr = alloc_bootmem_node(NODE_DATA(i % numnodes), size); + ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size); } if (!ptr) panic("Cannot allocate cpu data for CPU %d\n", i); @@ -153,7 +118,6 @@ void __init setup_per_cpu_areas(void) void pda_init(int cpu) { - pml4_t *level4; struct x8664_pda *pda = &cpu_pda[cpu]; /* Setup up data that may be needed in __get_free_pages early */ @@ -172,22 +136,14 @@ void pda_init(int cpu) /* others are initialized in smpboot.c */ pda->pcurrent = &init_task; pda->irqstackptr = boot_cpu_stack; - level4 = init_level4_pgt; } else { - level4 = (pml4_t *)__get_free_pages(GFP_ATOMIC, 0); - if (!level4) - panic("Cannot allocate top level page for cpu %d", cpu); pda->irqstackptr = (char *) __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); if (!pda->irqstackptr) panic("cannot allocate irqstack for cpu %d", cpu); } - pda->level4_pgt = (unsigned long *)level4; - if (level4 != init_level4_pgt) - memcpy(level4, &init_level4_pgt, PAGE_SIZE); - set_pml4(level4 + 510, mk_kernel_pml4(__pa_symbol(boot_vmalloc_pgt))); - asm volatile("movq %0,%%cr3" :: "r" (__pa(level4))); + asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt))); pda->irqstackptr += IRQSTACKSIZE-64; } @@ -252,7 +208,7 @@ void __init cpu_init (void) me = current; - if (test_and_set_bit(cpu, &cpu_initialized)) + if (cpu_test_and_set(cpu, cpu_initialized)) panic("CPU#%d already initialized!\n", cpu); printk("Initializing CPU#%d\n", cpu); @@ -269,8 +225,8 @@ void __init cpu_init (void) cpu_gdt_descr[cpu].size = GDT_SIZE; cpu_gdt_descr[cpu].address = (unsigned long)cpu_gdt_table[cpu]; - __asm__ __volatile__("lgdt %0": "=m" (cpu_gdt_descr[cpu])); - __asm__ __volatile__("lidt %0": "=m" (idt_descr)); + asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu])); + asm volatile("lidt %0" :: "m" (idt_descr)); memcpy(me->thread.tls_array, cpu_gdt_table[cpu], GDT_ENTRY_TLS_ENTRIES * 8); @@ -280,9 +236,6 @@ void __init cpu_init (void) asm volatile("pushfq ; popq %%rax ; btr $14,%%rax ; pushq %%rax ; popfq" ::: "eax"); - if (cpu == 0) - early_identify_cpu(&boot_cpu_data); - syscall_init(); wrmsrl(MSR_FS_BASE, 0); @@ -336,8 +289,4 @@ void __init cpu_init (void) set_debug(0UL, 7); fpu_init(); - -#ifdef CONFIG_NUMA - numa_add_cpu(cpu); -#endif } diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c index 99bcd7275..9cf703827 100644 --- a/arch/x86_64/kernel/signal.c +++ b/arch/x86_64/kernel/signal.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -125,6 +124,12 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned if (verify_area(VERIFY_READ, buf, sizeof(*buf))) goto badframe; err |= restore_i387(buf); + } else { + struct task_struct *me = current; + if (used_math()) { + clear_fpu(me); + clear_used_math(); + } } } @@ -139,7 +144,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) { struct rt_sigframe __user *frame; sigset_t set; - long eax; + unsigned long eax; frame = (struct rt_sigframe __user *)(regs->rsp - 8); if (verify_area(VERIFY_READ, frame, sizeof(*frame))) { @@ -246,7 +251,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, int err = 0; struct task_struct *me = current; - if (me->used_math) { + if (used_math()) { fp = get_stack(ka, regs, sizeof(struct _fpstate)); frame = (void __user *)round_down((unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8; @@ -325,7 +330,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, set_fs(USER_DS); if (regs->eflags & TF_MASK) { - if (current->ptrace & PT_PTRACED) { + if ((current->ptrace & (PT_PTRACED | PT_DTRACE)) == (PT_PTRACED | PT_DTRACE)) { ptrace_notify(SIGTRAP); } else { regs->eflags &= ~TF_MASK; @@ -357,7 +362,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, #endif /* Are we from a system call? */ - if (regs->orig_rax >= 0) { + if ((long)regs->orig_rax >= 0) { /* If so, check system call restarting.. */ switch (regs->rax) { case -ERESTART_RESTARTBLOCK: @@ -417,10 +422,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) return 1; } - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (!oldset) oldset = ¤t->blocked; @@ -442,7 +445,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) no_signal: /* Did we come from a system call? */ - if (regs->orig_rax >= 0) { + if ((long)regs->orig_rax >= 0) { /* Restart the system call - no handlers present */ long res = regs->rax; if (res == -ERESTARTNOHAND || diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c index 269ef092f..b183fafac 100644 --- a/arch/x86_64/kernel/smp.c +++ b/arch/x86_64/kernel/smp.c @@ -24,105 +24,8 @@ #include #include #include - -/* - * the following functions deal with sending IPIs between CPUs. - * - * We use 'broadcast', CPU->CPU IPIs and self-IPIs too. - */ - -static inline unsigned int __prepare_ICR (unsigned int shortcut, int vector) -{ - unsigned int icr = APIC_DM_FIXED | shortcut | vector | APIC_DEST_LOGICAL; - if (vector == KDB_VECTOR) - icr = (icr & (~APIC_VECTOR_MASK)) | APIC_DM_NMI; - return icr; -} - -static inline int __prepare_ICR2 (unsigned int mask) -{ - return SET_APIC_DEST_FIELD(mask); -} - -static inline void __send_IPI_shortcut(unsigned int shortcut, int vector) -{ - /* - * Subtle. In the case of the 'never do double writes' workaround - * we have to lock out interrupts to be safe. As we don't care - * of the value read we use an atomic rmw access to avoid costly - * cli/sti. Otherwise we use an even cheaper single atomic write - * to the APIC. - */ - unsigned int cfg; - - /* - * Wait for idle. - */ - apic_wait_icr_idle(); - - /* - * No need to touch the target chip field - */ - cfg = __prepare_ICR(shortcut, vector); - - /* - * Send the IPI. The write to APIC_ICR fires this off. - */ - apic_write_around(APIC_ICR, cfg); -} - -static inline void send_IPI_allbutself(int vector) -{ - /* - * if there are no other CPUs in the system then - * we get an APIC send error if we try to broadcast. - * thus we have to avoid sending IPIs in this case. - */ - if (num_online_cpus() > 1) - __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); -} - -static inline void send_IPI_all(int vector) -{ - __send_IPI_shortcut(APIC_DEST_ALLINC, vector); -} - -void send_IPI_self(int vector) -{ - __send_IPI_shortcut(APIC_DEST_SELF, vector); -} - -static inline void send_IPI_mask(cpumask_t cpumask, int vector) -{ - unsigned long mask = cpus_addr(cpumask)[0]; - unsigned long cfg; - unsigned long flags; - - local_save_flags(flags); - local_irq_disable(); - - /* - * Wait for idle. - */ - apic_wait_icr_idle(); - - /* - * prepare target chip field - */ - cfg = __prepare_ICR2(mask); - apic_write_around(APIC_ICR2, cfg); - - /* - * program the ICR - */ - cfg = __prepare_ICR(0, vector); - - /* - * Send the IPI. The write to APIC_ICR fires this off. - */ - apic_write_around(APIC_ICR, cfg); - local_irq_restore(flags); -} +#include +#include /* * Smarter SMP flushing macros. @@ -137,7 +40,7 @@ static inline void send_IPI_mask(cpumask_t cpumask, int vector) static cpumask_t flush_cpumask; static struct mm_struct * flush_mm; static unsigned long flush_va; -static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tlbstate_lock); #define FLUSH_ALL 0xffffffff /* @@ -366,7 +269,7 @@ void smp_send_reschedule(int cpu) * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); struct call_data_struct { void (*func) (void *info); @@ -405,11 +308,13 @@ static void __smp_call_function (void (*func) (void *info), void *info, /* Wait for response */ while (atomic_read(&data.started) != cpus) - barrier(); + cpu_relax(); - if (wait) - while (atomic_read(&data.finished) != cpus) - barrier(); + if (!wait) + return; + + while (atomic_read(&data.finished) != cpus) + cpu_relax(); } /* @@ -457,13 +362,14 @@ static void smp_really_stop_cpu(void *dummy) void smp_send_stop(void) { int nolock = 0; + if (reboot_force) + return; /* Don't deadlock on the call lock in panic */ if (!spin_trylock(&call_lock)) { - udelay(100); /* ignore locking because we have paniced anyways */ nolock = 1; } - __smp_call_function(smp_really_stop_cpu, NULL, 1, 0); + __smp_call_function(smp_really_stop_cpu, NULL, 0, 0); if (!nolock) spin_unlock(&call_lock); smp_stop_cpu(); diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index dc0f40fea..a7e2c3e95 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c @@ -56,16 +56,14 @@ /* Number of siblings per CPU package */ int smp_num_siblings = 1; -char phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */ +/* Package ID of each logical CPU */ +u8 phys_proc_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; +EXPORT_SYMBOL(phys_proc_id); /* Bitmask of currently online CPUs */ cpumask_t cpu_online_map; -/* which logical CPU number maps to which CPU (physical APIC ID) */ -volatile char x86_cpu_to_apicid[NR_CPUS]; -EXPORT_SYMBOL(x86_cpu_to_apicid); - -static cpumask_t cpu_callin_map; +cpumask_t cpu_callin_map; cpumask_t cpu_callout_map; static cpumask_t smp_commenced_mask; @@ -658,6 +656,8 @@ static void __init do_boot_cpu (int apicid) cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */ clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ cpucount--; + x86_cpu_to_apicid[cpu] = BAD_APICID; + x86_cpu_to_log_apicid[cpu] = BAD_APICID; } } diff --git a/arch/x86_64/kernel/suspend_asm.S b/arch/x86_64/kernel/suspend_asm.S index 8a3999810..633a86901 100644 --- a/arch/x86_64/kernel/suspend_asm.S +++ b/arch/x86_64/kernel/suspend_asm.S @@ -1,6 +1,9 @@ -/* Originally gcc generated, modified by hand +/* Copyright 2004,2005 Pavel Machek , Andi Kleen , Rafael J. Wysocki * - * This may not use any stack, nor any variable that is not "NoSave": + * Distribute under GPLv2. + * + * swsusp_arch_resume may not use any stack, nor any variable that is + * not "NoSave" during copying pages: * * Its rewriting one kernel image with another. What is stack in "old" * image could very well be data page in "new" image, and overwriting @@ -11,6 +14,7 @@ #include #include #include +#include ENTRY(swsusp_arch_suspend) @@ -49,43 +53,28 @@ ENTRY(swsusp_arch_resume) movq %rcx, %cr3; movq %rax, %cr4; # turn PGE back on + movq pagedir_nosave(%rip), %rdx + /* compute the limit */ movl nr_copy_pages(%rip), %eax - xorl %ecx, %ecx - movq $0, %r10 testl %eax, %eax jz done -.L105: - xorl %esi, %esi - movq $0, %r11 - jmp .L104 - .p2align 4,,7 -copy_one_page: - movq %r10, %rcx -.L104: - movq pagedir_nosave(%rip), %rdx - movq %rcx, %rax - salq $5, %rax - movq 8(%rdx,%rax), %rcx - movq (%rdx,%rax), %rax - movzbl (%rsi,%rax), %eax - movb %al, (%rsi,%rcx) - - movq %cr3, %rax; # flush TLB - movq %rax, %cr3; + movq %rdx,%r8 + movl $SIZEOF_PBE,%r9d + mul %r9 # with rax, clobbers rdx + movq %r8, %rdx + addq %r8, %rax +loop: + /* get addresses from the pbe and copy the page */ + movq pbe_address(%rdx), %rsi + movq pbe_orig_address(%rdx), %rdi + movq $512, %rcx + rep + movsq - movq %r11, %rax - incq %rax - cmpq $4095, %rax - movq %rax, %rsi - movq %rax, %r11 - jbe copy_one_page - movq %r10, %rax - incq %rax - movq %rax, %rcx - movq %rax, %r10 - mov nr_copy_pages(%rip), %eax - cmpq %rax, %rcx - jb .L105 + /* progress to the next pbe */ + addq $SIZEOF_PBE, %rdx + cmpq %rax, %rdx + jb loop done: movl $24, %eax movl %eax, %ds diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index ee941842d..b0df27f80 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef CONFIG_X86_LOCAL_APIC #include #endif @@ -48,14 +49,14 @@ static void cpufreq_delayed_get(void); extern int using_apic_timer; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; -spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); +DEFINE_SPINLOCK(i8253_lock); static int nohpet __initdata = 0; +static int notsc __initdata = 0; #undef HPET_HACK_ENABLE_DANGEROUS - unsigned int cpu_khz; /* TSC clocks / usec, not used here */ unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_tick; /* HPET clocks / interrupt */ @@ -330,7 +331,7 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs) print_symbol("rip %s)\n", regs->rip); } - if (lost_count == 100 && !warned) { + if (lost_count == 1000 && !warned) { printk(KERN_WARNING "warning: many lost ticks.\n" KERN_WARNING "Your time source seems to be instable or " @@ -427,6 +428,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) */ do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif /* * In the SMP case we use the local APIC timer interrupt to do the profiling, @@ -723,31 +727,59 @@ static unsigned int __init pit_calibrate_tsc(void) return (end - start) / 50; } -static int hpet_init(void) +#ifdef CONFIG_HPET +static __init int late_hpet_init(void) { - unsigned int cfg, id; + struct hpet_data hd; + unsigned int ntimer; if (!vxtime.hpet_address) - return -1; - set_fixmap_nocache(FIX_HPET_BASE, vxtime.hpet_address); - __set_fixmap(VSYSCALL_HPET, vxtime.hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE); + return -1; -/* - * Read the period, compute tick and quotient. - */ + memset(&hd, 0, sizeof (hd)); - id = hpet_readl(HPET_ID); + ntimer = hpet_readl(HPET_ID); + ntimer = (ntimer & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT; + ntimer++; - if (!(id & HPET_ID_VENDOR) || !(id & HPET_ID_NUMBER) || - !(id & HPET_ID_LEGSUP)) - return -1; + /* + * Register with driver. + * Timer0 and Timer1 is used by platform. + */ + hd.hd_phys_address = vxtime.hpet_address; + hd.hd_address = (void *)fix_to_virt(FIX_HPET_BASE); + hd.hd_nirqs = ntimer; + hd.hd_flags = HPET_DATA_PLATFORM; + hpet_reserve_timer(&hd, 0); +#ifdef CONFIG_HPET_EMULATE_RTC + hpet_reserve_timer(&hd, 1); +#endif + hd.hd_irq[0] = HPET_LEGACY_8254; + hd.hd_irq[1] = HPET_LEGACY_RTC; + if (ntimer > 2) { + struct hpet *hpet; + struct hpet_timer *timer; + int i; - hpet_period = hpet_readl(HPET_PERIOD); - if (hpet_period < 100000 || hpet_period > 100000000) - return -1; + hpet = (struct hpet *) fix_to_virt(FIX_HPET_BASE); - hpet_tick = (1000000000L * (USEC_PER_SEC / HZ) + hpet_period / 2) / - hpet_period; + for (i = 2, timer = &hpet->hpet_timers[2]; i < ntimer; + timer++, i++) + hd.hd_irq[i] = (timer->hpet_config & + Tn_INT_ROUTE_CNF_MASK) >> + Tn_INT_ROUTE_CNF_SHIFT; + + } + + hpet_alloc(&hd); + return 0; +} +fs_initcall(late_hpet_init); +#endif + +static int hpet_timer_stop_set_go(unsigned long tick) +{ + unsigned int cfg; /* * Stop the timers and reset the main counter. @@ -779,6 +811,40 @@ static int hpet_init(void) return 0; } +static int hpet_init(void) +{ + unsigned int id; + + if (!vxtime.hpet_address) + return -1; + set_fixmap_nocache(FIX_HPET_BASE, vxtime.hpet_address); + __set_fixmap(VSYSCALL_HPET, vxtime.hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE); + +/* + * Read the period, compute tick and quotient. + */ + + id = hpet_readl(HPET_ID); + + if (!(id & HPET_ID_VENDOR) || !(id & HPET_ID_NUMBER) || + !(id & HPET_ID_LEGSUP)) + return -1; + + hpet_period = hpet_readl(HPET_PERIOD); + if (hpet_period < 100000 || hpet_period > 100000000) + return -1; + + hpet_tick = (1000000000L * (USEC_PER_SEC / HZ) + hpet_period / 2) / + hpet_period; + + return hpet_timer_stop_set_go(hpet_tick); +} + +static int hpet_reenable(void) +{ + return hpet_timer_stop_set_go(hpet_tick); +} + void __init pit_init(void) { unsigned long flags; @@ -856,61 +922,93 @@ void __init time_init_smp(void) { char *timetype; - if (vxtime.hpet_address) { + /* + * AMD systems with more than one CPU don't have fully synchronized + * TSCs. Always use HPET gettimeofday for these, although it is slower. + * Intel SMP systems usually have synchronized TSCs, so use always + * the TSC. + * + * Exceptions: + * IBM Summit2 checked by oem_force_hpet_timer(). + * AMD dual core may also not need HPET. Check me. + * + * Can be turned off with "notsc". + */ + if (num_online_cpus() > 1 && + boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + notsc = 1; + /* Some systems will want to disable TSC and use HPET. */ + if (oem_force_hpet_timer()) + notsc = 1; + if (vxtime.hpet_address && notsc) { timetype = "HPET"; vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; vxtime.mode = VXTIME_HPET; do_gettimeoffset = do_gettimeoffset_hpet; } else { - timetype = "PIT/TSC"; + timetype = vxtime.hpet_address ? "HPET/TSC" : "PIT/TSC"; vxtime.mode = VXTIME_TSC; } + printk(KERN_INFO "time.c: Using %s based timekeeping.\n", timetype); } __setup("report_lost_ticks", time_setup); static long clock_cmos_diff; +static unsigned long sleep_start; -static int time_suspend(struct sys_device *dev, u32 state) +static int timer_suspend(struct sys_device *dev, u32 state) { /* * Estimate time zone so that set_time can update the clock */ - clock_cmos_diff = -get_cmos_time(); + long cmos_time = get_cmos_time(); + + clock_cmos_diff = -cmos_time; clock_cmos_diff += get_seconds(); + sleep_start = cmos_time; return 0; } -static int time_resume(struct sys_device *dev) +static int timer_resume(struct sys_device *dev) { unsigned long flags; - unsigned long sec = get_cmos_time() + clock_cmos_diff; + unsigned long sec; + unsigned long ctime = get_cmos_time(); + unsigned long sleep_length = (ctime - sleep_start) * HZ; + + if (vxtime.hpet_address) + hpet_reenable(); + + sec = ctime + clock_cmos_diff; write_seqlock_irqsave(&xtime_lock,flags); xtime.tv_sec = sec; xtime.tv_nsec = 0; write_sequnlock_irqrestore(&xtime_lock,flags); + jiffies += sleep_length; + wall_jiffies += sleep_length; return 0; } -static struct sysdev_class pit_sysclass = { - .resume = time_resume, - .suspend = time_suspend, - set_kset_name("pit"), +static struct sysdev_class timer_sysclass = { + .resume = timer_resume, + .suspend = timer_suspend, + set_kset_name("timer"), }; /* XXX this driverfs stuff should probably go elsewhere later -john */ -static struct sys_device device_i8253 = { +static struct sys_device device_timer = { .id = 0, - .cls = &pit_sysclass, + .cls = &timer_sysclass, }; static int time_init_device(void) { - int error = sysdev_class_register(&pit_sysclass); + int error = sysdev_class_register(&timer_sysclass); if (!error) - error = sysdev_register(&device_i8253); + error = sysdev_register(&device_timer); return error; } @@ -931,7 +1029,6 @@ device_initcall(time_init_device); * For (3), we use interrupts at 64Hz or user specified periodic * frequency, whichever is higher. */ -#include #include extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -1151,3 +1248,14 @@ static int __init nohpet_setup(char *s) } __setup("nohpet", nohpet_setup); + + +static int __init notsc_setup(char *s) +{ + notsc = 1; + return 0; +} + +__setup("notsc", notsc_setup); + + diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index c0a31a4ad..72e672ef3 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c @@ -43,9 +43,11 @@ #include #include #include +#include #include + extern struct gate_struct idt_table[256]; asmlinkage void divide_error(void); @@ -72,6 +74,17 @@ asmlinkage void spurious_interrupt_bug(void); asmlinkage void call_debug(void); struct notifier_block *die_chain; +static DEFINE_SPINLOCK(die_notifier_lock); + +int register_die_notifier(struct notifier_block *nb) +{ + int err = 0; + unsigned long flags; + spin_lock_irqsave(&die_notifier_lock, flags); + err = notifier_chain_register(&die_chain, nb); + spin_unlock_irqrestore(&die_notifier_lock, flags); + return err; +} static inline void conditional_sti(struct pt_regs *regs) { @@ -311,7 +324,7 @@ void out_of_line_bug(void) BUG(); } -static spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(die_lock); static int die_owner = -1; void oops_begin(void) @@ -376,13 +389,20 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long e die(str, regs, err); } -static inline unsigned long get_cr2(void) +void die_nmi(char *str, struct pt_regs *regs) { - unsigned long address; - - /* get the address */ - __asm__("movq %%cr2,%0":"=r" (address)); - return address; + oops_begin(); + /* + * We are in trouble anyway, lets at least try + * to get a message out. + */ + printk(str, safe_smp_processor_id()); + show_registers(regs); + if (panic_on_timeout || panic_on_oops) + panic("nmi watchdog"); + printk("console shuts up ...\n"); + oops_end(); + do_exit(SIGSEGV); } static void do_trap(int trapnr, int signr, char *str, @@ -458,7 +478,6 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ } DO_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->rip) -DO_ERROR( 3, SIGTRAP, "int3", int3); DO_ERROR( 4, SIGSEGV, "overflow", overflow) DO_ERROR( 5, SIGSEGV, "bounds", bounds) DO_ERROR_INFO( 6, SIGILL, "invalid operand", invalid_op, ILL_ILLOPN, regs->rip) @@ -528,8 +547,9 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) regs->rip = fixup->fixup; return; } - notify_die(DIE_GPF, "general protection fault", regs, error_code, - 13, SIGSEGV); + if (notify_die(DIE_GPF, "general protection fault", regs, + error_code, 13, SIGSEGV) == NOTIFY_STOP) + return; die("general protection fault", regs, error_code); } } @@ -563,9 +583,13 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs) printk("Do you have a strange power saving mode enabled?\n"); } -asmlinkage void default_do_nmi(struct pt_regs * regs) +asmlinkage void default_do_nmi(struct pt_regs *regs) { - unsigned char reason = inb(0x61); + unsigned char reason = 0; + + /* Only the BSP gets external NMIs from the system. */ + if (!smp_processor_id()) + reason = get_nmi_reason(); if (!(reason & 0xc0)) { if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) @@ -586,6 +610,9 @@ asmlinkage void default_do_nmi(struct pt_regs * regs) } if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) return; + + /* AK: following checks seem to be broken on modern chipsets. FIXME */ + if (reason & 0x80) mem_parity_error(reason, regs); if (reason & 0x40) @@ -601,6 +628,15 @@ asmlinkage void default_do_nmi(struct pt_regs * regs) inb(0x71); /* dummy */ } +asmlinkage void do_int3(struct pt_regs * regs, long error_code) +{ + if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { + return; + } + do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); + return; +} + /* runs on IST stack. */ asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code) { @@ -630,6 +666,10 @@ asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code) asm("movq %%db6,%0" : "=r" (condition)); + if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, + SIGTRAP) == NOTIFY_STOP) { + return regs; + } conditional_sti(regs); /* Mask out spurious debug traps due to lazy DR7 setting */ @@ -642,7 +682,9 @@ asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code) tsk->thread.debugreg6 = condition; /* Mask out spurious TF errors due to lazy TF clearing */ - if (condition & DR_STEP) { + if ((condition & DR_STEP) && + (notify_die(DIE_DEBUGSTEP, "debugstep", regs, condition, + 1, SIGTRAP) != NOTIFY_STOP)) { /* * The TF error should be masked out only if the current * process is not traced and if the TRAP flag has been set @@ -834,6 +876,10 @@ asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs) { } +asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) +{ +} + /* * 'math_state_restore()' saves the current math information in the * old math state array, and gets the new ones from the current task @@ -846,7 +892,7 @@ asmlinkage void math_state_restore(void) struct task_struct *me = current; clts(); /* Allow maths ops (or we recurse) */ - if (!me->used_math) + if (!used_math()) init_fpu(me); restore_fpu_checking(&me->thread.i387.fxsave); me->thread_info->status |= TS_USEDFPU; @@ -862,8 +908,8 @@ void __init trap_init(void) set_intr_gate(0,÷_error); set_intr_gate_ist(1,&debug,DEBUG_STACK); set_intr_gate_ist(2,&nmi,NMI_STACK); - set_system_gate(3,&int3); /* int3-5 can be called from all */ - set_system_gate(4,&overflow); + set_system_gate(3,&int3); + set_system_gate(4,&overflow); /* int4-5 can be called from all */ set_system_gate(5,&bounds); set_intr_gate(6,&invalid_op); set_intr_gate(7,&device_not_available); @@ -877,7 +923,9 @@ void __init trap_init(void) set_intr_gate(15,&spurious_interrupt_bug); set_intr_gate(16,&coprocessor_error); set_intr_gate(17,&alignment_check); +#ifdef CONFIG_X86_MCE set_intr_gate_ist(18,&machine_check, MCE_STACK); +#endif set_intr_gate(19,&simd_coprocessor_error); #ifdef CONFIG_IA32_EMULATION @@ -900,3 +948,11 @@ static int __init oops_dummy(char *s) return -1; } __setup("oops=", oops_dummy); + +static int __init kstack_setup(char *s) +{ + kstack_depth_to_print = simple_strtoul(s,NULL,0); + return 0; +} +__setup("kstack=", kstack_setup); + diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index f656f197b..65108e17e 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S @@ -45,32 +45,31 @@ SECTIONS } __bss_end = .; - . = ALIGN(64); + . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); .data.cacheline_aligned : { *(.data.cacheline_aligned) } +#define AFTER(x) BINALIGN(LOADADDR(x) + SIZEOF(x), 16) +#define BINALIGN(x,y) (((x) + (y) - 1) & ~((y) - 1)) +#define CACHE_ALIGN(x) BINALIGN(x, CONFIG_X86_L1_CACHE_BYTES) + .vsyscall_0 -10*1024*1024: AT ((LOADADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) { *(.vsyscall_0) } __vsyscall_0 = LOADADDR(.vsyscall_0); - . = ALIGN(64); - .xtime_lock : AT ((LOADADDR(.vsyscall_0) + SIZEOF(.vsyscall_0) + 63) & ~(63)) { *(.xtime_lock) } + . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); + .xtime_lock : AT CACHE_ALIGN(AFTER(.vsyscall_0)) { *(.xtime_lock) } xtime_lock = LOADADDR(.xtime_lock); - . = ALIGN(16); - .vxtime : AT ((LOADADDR(.xtime_lock) + SIZEOF(.xtime_lock) + 15) & ~(15)) { *(.vxtime) } + .vxtime : AT AFTER(.xtime_lock) { *(.vxtime) } vxtime = LOADADDR(.vxtime); - . = ALIGN(16); - .wall_jiffies : AT ((LOADADDR(.vxtime) + SIZEOF(.vxtime) + 15) & ~(15)) { *(.wall_jiffies) } + .wall_jiffies : AT AFTER(.vxtime) { *(.wall_jiffies) } wall_jiffies = LOADADDR(.wall_jiffies); - . = ALIGN(16); - .sys_tz : AT ((LOADADDR(.wall_jiffies) + SIZEOF(.wall_jiffies) + 15) & ~(15)) { *(.sys_tz) } + .sys_tz : AT AFTER(.wall_jiffies) { *(.sys_tz) } sys_tz = LOADADDR(.sys_tz); - . = ALIGN(16); - .sysctl_vsyscall : AT ((LOADADDR(.sys_tz) + SIZEOF(.sys_tz) + 15) & ~(15)) { *(.sysctl_vsyscall) } - sysctl_vsyscall = LOADADDR(.sysctl_vsyscall); - . = ALIGN(16); - .jiffies : AT ((LOADADDR(.sysctl_vsyscall) + SIZEOF(.sysctl_vsyscall) + 15) & ~(15)) { *(.jiffies) } - jiffies = LOADADDR(.jiffies); - . = ALIGN(16); - .xtime : AT ((LOADADDR(.jiffies) + SIZEOF(.jiffies) + 15) & ~(15)) { *(.xtime) } + .sysctl_vsyscall : AT AFTER(.sys_tz) { *(.sysctl_vsyscall) } + sysctl_vsyscall = LOADADDR(.sysctl_vsyscall); + .xtime : AT AFTER(.sysctl_vsyscall) { *(.xtime) } xtime = LOADADDR(.xtime); + . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); + .jiffies : AT CACHE_ALIGN(AFTER(.xtime)) { *(.jiffies) } + jiffies = LOADADDR(.jiffies); .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) } . = LOADADDR(.vsyscall_0) + 4096; @@ -87,7 +86,9 @@ SECTIONS *(.init.text) _einittext = .; } + __initdata_begin = .; .init.data : { *(.init.data) } + __initdata_end = .; . = ALIGN(16); __setup_start = .; .init.setup : { *(.init.setup) } diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c index 13ec453e2..f28a07c77 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86_64/kernel/vsyscall.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -88,7 +89,7 @@ static force_inline void do_vgettimeofday(struct timeval * tv) __vxtime.tsc_quot) >> 32; /* See comment in x86_64 do_gettimeofday. */ } else { - usec += ((readl(fix_to_virt(VSYSCALL_HPET) + 0xf0) - + usec += ((readl((void *)fix_to_virt(VSYSCALL_HPET) + 0xf0) - __vxtime.last) * __vxtime.quot) >> 32; } } while (read_seqretry(&__xtime_lock, sequence)); @@ -165,14 +166,12 @@ static void __init map_vsyscall(void) static int __init vsyscall_init(void) { - if ((unsigned long) &vgettimeofday != VSYSCALL_ADDR(__NR_vgettimeofday)) - panic("vgettimeofday link addr broken"); - if ((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime)) - panic("vtime link addr broken"); - if (VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE)) - panic("fixmap first vsyscall %lx should be %lx", __fix_to_virt(VSYSCALL_FIRST_PAGE), - VSYSCALL_ADDR(0)); + BUG_ON(((unsigned long) &vgettimeofday != + VSYSCALL_ADDR(__NR_vgettimeofday))); + BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime)); + BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE))); map_vsyscall(); + sysctl_vsyscall = 1; return 0; } diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c index 6e3acce42..a6396131e 100644 --- a/arch/x86_64/kernel/x8664_ksyms.c +++ b/arch/x86_64/kernel/x8664_ksyms.c @@ -30,8 +30,8 @@ #include #include #include -#include #include +#include extern spinlock_t rtc_lock; @@ -193,10 +193,11 @@ EXPORT_SYMBOL(rwsem_down_write_failed_thunk); EXPORT_SYMBOL(empty_zero_page); #ifdef CONFIG_HAVE_DEC_LOCK -EXPORT_SYMBOL(atomic_dec_and_lock); +EXPORT_SYMBOL(_atomic_dec_and_lock); #endif EXPORT_SYMBOL(die_chain); +EXPORT_SYMBOL(register_die_notifier); #ifdef CONFIG_SMP EXPORT_SYMBOL(cpu_sibling_map); diff --git a/arch/x86_64/lib/bitops.c b/arch/x86_64/lib/bitops.c index 6060dd908..994d76650 100644 --- a/arch/x86_64/lib/bitops.c +++ b/arch/x86_64/lib/bitops.c @@ -1,5 +1,5 @@ #include -#include +#include #undef find_first_zero_bit #undef find_next_zero_bit diff --git a/arch/x86_64/lib/bitstr.c b/arch/x86_64/lib/bitstr.c index e7ce82a0a..24676609a 100644 --- a/arch/x86_64/lib/bitstr.c +++ b/arch/x86_64/lib/bitstr.c @@ -1,5 +1,5 @@ #include -#include +#include /* Find string of zero bits in a bitmap */ unsigned long diff --git a/arch/x86_64/lib/copy_user.S b/arch/x86_64/lib/copy_user.S index 6859a7809..bd556c804 100644 --- a/arch/x86_64/lib/copy_user.S +++ b/arch/x86_64/lib/copy_user.S @@ -73,7 +73,7 @@ bad_to_user: * rdx count * * Output: - * eax uncopied bytes or 0 if successfull. + * eax uncopied bytes or 0 if successful. */ .globl copy_user_generic .p2align 4 @@ -179,9 +179,9 @@ copy_user_generic: movl $8,%r9d subl %ecx,%r9d movl %r9d,%ecx - subq %r9,%rdx - jz .Lsmall_align - js .Lsmall_align + cmpq %r9,%rdx + jz .Lhandle_7 + js .Lhandle_7 .Lalign_1: .Ls11: movb (%rsi),%bl .Ld11: movb %bl,(%rdi) @@ -189,10 +189,8 @@ copy_user_generic: incq %rdi decl %ecx jnz .Lalign_1 + subq %r9,%rdx jmp .Lafter_bad_alignment -.Lsmall_align: - addq %r9,%rdx - jmp .Lhandle_7 #endif /* table sorted by exception address */ @@ -219,8 +217,8 @@ copy_user_generic: .quad .Ls10,.Le_byte .quad .Ld10,.Le_byte #ifdef FIX_ALIGNMENT - .quad .Ls11,.Le_byte - .quad .Ld11,.Le_byte + .quad .Ls11,.Lzero_rest + .quad .Ld11,.Lzero_rest #endif .quad .Le5,.Le_zero .previous diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86_64/lib/csum-wrappers.c index 18abae985..94323f208 100644 --- a/arch/x86_64/lib/csum-wrappers.c +++ b/arch/x86_64/lib/csum-wrappers.c @@ -19,7 +19,7 @@ * src and dst are best aligned to 64bits. */ unsigned int -csum_partial_copy_from_user(const char __user *src, char *dst, +csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, int len, unsigned int isum, int *errp) { might_sleep(); @@ -67,7 +67,7 @@ EXPORT_SYMBOL(csum_partial_copy_from_user); * src and dst are best aligned to 64bits. */ unsigned int -csum_partial_copy_to_user(const char *src, char __user *dst, +csum_partial_copy_to_user(unsigned const char *src, unsigned char __user *dst, int len, unsigned int isum, int *errp) { might_sleep(); @@ -105,7 +105,7 @@ EXPORT_SYMBOL(csum_partial_copy_to_user); * Returns an 32bit unfolded checksum of the buffer. */ unsigned int -csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum) +csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { return csum_partial_copy_generic(src,dst,len,sum,NULL,NULL); } diff --git a/arch/x86_64/lib/dec_and_lock.c b/arch/x86_64/lib/dec_and_lock.c index ffd486900..ab43394dc 100644 --- a/arch/x86_64/lib/dec_and_lock.c +++ b/arch/x86_64/lib/dec_and_lock.c @@ -10,7 +10,7 @@ #include #include -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) { int counter; int newcount; diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c index 9fcdb2d2d..05689cc54 100644 --- a/arch/x86_64/lib/delay.c +++ b/arch/x86_64/lib/delay.c @@ -34,7 +34,7 @@ void __delay(unsigned long loops) inline void __const_udelay(unsigned long xloops) { - __delay(((xloops * current_cpu_data.loops_per_jiffy) >> 32) * HZ); + __delay(((xloops * cpu_data[_smp_processor_id()].loops_per_jiffy) >> 32) * HZ); } void __udelay(unsigned long usecs) diff --git a/arch/x86_64/lib/io.c b/arch/x86_64/lib/io.c index 5950b821d..87b4a4e18 100644 --- a/arch/x86_64/lib/io.c +++ b/arch/x86_64/lib/io.c @@ -2,14 +2,22 @@ #include #include -void *__memcpy_toio(unsigned long dst,const void*src,unsigned len) +void __memcpy_toio(unsigned long dst,const void*src,unsigned len) { - return __inline_memcpy((void *) dst,src,len); + __inline_memcpy((void *) dst,src,len); } EXPORT_SYMBOL(__memcpy_toio); -void *__memcpy_fromio(void *dst,unsigned long src,unsigned len) +void __memcpy_fromio(void *dst,unsigned long src,unsigned len) { - return __inline_memcpy(dst,(const void *) src,len); + __inline_memcpy(dst,(const void *) src,len); } EXPORT_SYMBOL(__memcpy_fromio); + +void memset_io(volatile void __iomem *a, int b, size_t c) +{ + /* XXX: memset can mangle the IO patterns quite a bit. + perhaps it would be better to use a dumb one */ + memset((void *)a,b,c); +} +EXPORT_SYMBOL(memset_io); diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile index 14bbe9e77..66c354ad8 100644 --- a/arch/x86_64/mm/Makefile +++ b/arch/x86_64/mm/Makefile @@ -6,5 +6,6 @@ obj-y := init.o fault.o ioremap.o extable.o pageattr.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_DISCONTIGMEM) += numa.o obj-$(CONFIG_K8_NUMA) += k8topology.o +obj-$(CONFIG_ACPI_NUMA) += srat.o hugetlbpage-y = ../../i386/mm/hugetlbpage.o diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 4e12a56c9..572437047 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c @@ -23,6 +23,7 @@ #include /* For unblank_screen() */ #include #include +#include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include void bust_spinlocks(int yes) { @@ -141,25 +143,25 @@ static int bad_address(void *p) void dump_pagetable(unsigned long address) { - pml4_t *pml4; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; - asm("movq %%cr3,%0" : "=r" (pml4)); - - pml4 = __va((unsigned long)pml4 & PHYSICAL_PAGE_MASK); - pml4 += pml4_index(address); - printk("PML4 %lx ", pml4_val(*pml4)); - if (bad_address(pml4)) goto bad; - if (!pml4_present(*pml4)) goto ret; + asm("movq %%cr3,%0" : "=r" (pgd)); - pgd = __pgd_offset_k((pgd_t *)pml4_page(*pml4), address); + pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); + pgd += pgd_index(address); + printk("PGD %lx ", pgd_val(*pgd)); if (bad_address(pgd)) goto bad; - printk("PGD %lx ", pgd_val(*pgd)); - if (!pgd_present(*pgd)) goto ret; + if (!pgd_present(*pgd)) goto ret; - pmd = pmd_offset(pgd, address); + pud = __pud_offset_k((pud_t *)pgd_page(*pgd), address); + if (bad_address(pud)) goto bad; + printk("PUD %lx ", pud_val(*pud)); + if (!pud_present(*pud)) goto ret; + + pmd = pmd_offset(pud, address); if (bad_address(pmd)) goto bad; printk("PMD %lx ", pmd_val(*pmd)); if (!pmd_present(*pmd)) goto ret; @@ -210,6 +212,8 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) int unhandled_signal(struct task_struct *tsk, int sig) { + if (tsk->pid == 1) + return 1; /* Warn for strace, but not for gdb */ if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) && (tsk->ptrace & PT_PTRACED)) @@ -230,7 +234,53 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, do_exit(SIGKILL); } -int page_fault_trace; +/* + * Handle a fault on the vmalloc or module mapping area + */ +static int vmalloc_fault(unsigned long address) +{ + pgd_t *pgd, *pgd_ref; + pud_t *pud, *pud_ref; + pmd_t *pmd, *pmd_ref; + pte_t *pte, *pte_ref; + + /* Copy kernel mappings over when needed. This can also + happen within a race in page table update. In the later + case just flush. */ + + pgd = pgd_offset(current->mm ?: &init_mm, address); + pgd_ref = pgd_offset_k(address); + if (pgd_none(*pgd_ref)) + return -1; + if (pgd_none(*pgd)) + set_pgd(pgd, *pgd_ref); + + /* Below here mismatches are bugs because these lower tables + are shared */ + + pud = pud_offset(pgd, address); + pud_ref = pud_offset(pgd_ref, address); + if (pud_none(*pud_ref)) + return -1; + if (pud_none(*pud) || pud_page(*pud) != pud_page(*pud_ref)) + BUG(); + pmd = pmd_offset(pud, address); + pmd_ref = pmd_offset(pud_ref, address); + if (pmd_none(*pmd_ref)) + return -1; + if (pmd_none(*pmd) || pmd_page(*pmd) != pmd_page(*pmd_ref)) + BUG(); + pte_ref = pte_offset_kernel(pmd_ref, address); + if (!pte_present(*pte_ref)) + return -1; + pte = pte_offset_kernel(pmd, address); + if (!pte_present(*pte) || pte_page(*pte) != pte_page(*pte_ref)) + BUG(); + __flush_tlb_all(); + return 0; +} + +int page_fault_trace = 0; int exception_trace = 1; /* @@ -268,6 +318,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) /* get the address */ __asm__("movq %%cr2,%0":"=r" (address)); + if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, + SIGSEGV) == NOTIFY_STOP) + return; if (likely(regs->eflags & X86_EFLAGS_IF)) local_irq_enable(); @@ -295,8 +348,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) * protection error (error_code & 1) == 0. */ if (unlikely(address >= TASK_SIZE)) { - if (!(error_code & 5)) - goto vmalloc_fault; + if (!(error_code & 5)) { + if (vmalloc_fault(address) < 0) + goto bad_area_nosemaphore; + return; + } /* * Don't take the mm semaphore here. If we fixup a prefetch * fault we could otherwise deadlock. @@ -305,7 +361,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) } if (unlikely(error_code & (1 << 3))) - goto page_table_corruption; + pgtable_bad(address, regs, error_code); /* * If we're in an interrupt or have no user @@ -406,7 +462,7 @@ bad_area_nosemaphore: #ifdef CONFIG_IA32_EMULATION /* 32bit vsyscall. map on demand. */ if (test_thread_flag(TIF_IA32) && - address >= 0xffffe000 && address < 0xffffe000 + PAGE_SIZE) { + address >= VSYSCALL32_BASE && address < VSYSCALL32_END) { if (map_syscall32(mm, address) < 0) goto out_of_memory2; return; @@ -429,8 +485,9 @@ bad_area_nosemaphore: return; if (exception_trace && unhandled_signal(tsk, SIGSEGV)) { - printk(KERN_INFO - "%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n", + printk( + "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n", + tsk->pid > 1 ? KERN_INFO : KERN_EMERG, tsk->comm, tsk->pid, address, regs->rip, regs->rsp, error_code); } @@ -519,34 +576,4 @@ do_sigbus: info.si_addr = (void __user *)address; force_sig_info(SIGBUS, &info, tsk); return; - -vmalloc_fault: - { - pgd_t *pgd; - pmd_t *pmd; - pte_t *pte; - - /* - * x86-64 has the same kernel 3rd level pages for all CPUs. - * But for vmalloc/modules the TLB synchronization works lazily, - * so it can happen that we get a page fault for something - * that is really already in the page table. Just check if it - * is really there and when yes flush the local TLB. - */ - pgd = pgd_offset_k(address); - if (!pgd_present(*pgd)) - goto bad_area_nosemaphore; - pmd = pmd_offset(pgd, address); - if (!pmd_present(*pmd)) - goto bad_area_nosemaphore; - pte = pte_offset_kernel(pmd, address); - if (!pte_present(*pte)) - goto bad_area_nosemaphore; - - __flush_tlb_all(); - return; - } - -page_table_corruption: - pgtable_bad(address, regs, error_code); } diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index e13acb6ab..b0d604551 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c @@ -68,8 +68,8 @@ void show_mem(void) for_each_pgdat(pgdat) { for (i = 0; i < pgdat->node_spanned_pages; ++i) { - page = pgdat->node_mem_map + i; - total++; + page = pfn_to_page(pgdat->node_start_pfn + i); + total++; if (PageReserved(page)) reserved++; else if (PageSwapCache(page)) @@ -108,28 +108,28 @@ static void *spp_getpage(void) static void set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) { - pml4_t *level4; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte, new_pte; Dprintk("set_pte_phys %lx to %lx\n", vaddr, phys); - level4 = pml4_offset_k(vaddr); - if (pml4_none(*level4)) { - printk("PML4 FIXMAP MISSING, it should be setup in head.S!\n"); + pgd = pgd_offset_k(vaddr); + if (pgd_none(*pgd)) { + printk("PGD FIXMAP MISSING, it should be setup in head.S!\n"); return; } - pgd = level3_offset_k(level4, vaddr); - if (pgd_none(*pgd)) { + pud = pud_offset(pgd, vaddr); + if (pud_none(*pud)) { pmd = (pmd_t *) spp_getpage(); - set_pgd(pgd, __pgd(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER)); - if (pmd != pmd_offset(pgd, 0)) { - printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pgd,0)); + set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER)); + if (pmd != pmd_offset(pud, 0)) { + printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pud,0)); return; } } - pmd = pmd_offset(pgd, vaddr); + pmd = pmd_offset(pud, vaddr); if (pmd_none(*pmd)) { pte = (pte_t *) spp_getpage(); set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER)); @@ -210,31 +210,31 @@ static __init void unmap_low_page(int i) ti->allocated = 0; } -static void __init phys_pgd_init(pgd_t *pgd, unsigned long address, unsigned long end) +static void __init phys_pud_init(pud_t *pud, unsigned long address, unsigned long end) { long i, j; - i = pgd_index(address); - pgd = pgd + i; - for (; i < PTRS_PER_PGD; pgd++, i++) { + i = pud_index(address); + pud = pud + i; + for (; i < PTRS_PER_PUD; pud++, i++) { int map; unsigned long paddr, pmd_phys; pmd_t *pmd; - paddr = (address & PML4_MASK) + i*PGDIR_SIZE; + paddr = address + i*PUD_SIZE; if (paddr >= end) { - for (; i < PTRS_PER_PGD; i++, pgd++) - set_pgd(pgd, __pgd(0)); + for (; i < PTRS_PER_PUD; i++, pud++) + set_pud(pud, __pud(0)); break; } - if (!e820_mapped(paddr, paddr+PGDIR_SIZE, 0)) { - set_pgd(pgd, __pgd(0)); + if (!e820_mapped(paddr, paddr+PUD_SIZE, 0)) { + set_pud(pud, __pud(0)); continue; } pmd = alloc_low_page(&map, &pmd_phys); - set_pgd(pgd, __pgd(pmd_phys | _KERNPG_TABLE)); + set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE)); for (j = 0; j < PTRS_PER_PMD; pmd++, j++, paddr += PMD_SIZE) { unsigned long pe; @@ -252,51 +252,55 @@ static void __init phys_pgd_init(pgd_t *pgd, unsigned long address, unsigned lon __flush_tlb(); } +static void __init find_early_table_space(unsigned long end) +{ + unsigned long puds, pmds, tables; + + puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; + pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; + tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) + + round_up(pmds * sizeof(pmd_t), PAGE_SIZE); + + table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables); + if (table_start == -1UL) + panic("Cannot find space for the kernel page tables"); + + table_start >>= PAGE_SHIFT; + table_end = table_start; +} + /* Setup the direct mapping of the physical memory at PAGE_OFFSET. This runs before bootmem is initialized and gets pages directly from the physical memory. To access them they are temporarily mapped. */ -void __init init_memory_mapping(void) +void __init init_memory_mapping(unsigned long start, unsigned long end) { - unsigned long adr; - unsigned long end; unsigned long next; - unsigned long pgds, pmds, tables; Dprintk("init_memory_mapping\n"); - end = end_pfn_map << PAGE_SHIFT; - /* * Find space for the kernel direct mapping tables. * Later we should allocate these tables in the local node of the memory * mapped. Unfortunately this is done currently before the nodes are * discovered. */ + find_early_table_space(end); - pgds = (end + PGDIR_SIZE - 1) >> PGDIR_SHIFT; - pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; - tables = round_up(pgds*8, PAGE_SIZE) + round_up(pmds * 8, PAGE_SIZE); - - table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables); - if (table_start == -1UL) - panic("Cannot find space for the kernel page tables"); - - table_start >>= PAGE_SHIFT; - table_end = table_start; - - end += __PAGE_OFFSET; /* turn virtual */ + start = (unsigned long)__va(start); + end = (unsigned long)__va(end); - for (adr = PAGE_OFFSET; adr < end; adr = next) { + for (; start < end; start = next) { int map; - unsigned long pgd_phys; - pgd_t *pgd = alloc_low_page(&map, &pgd_phys); - next = adr + PML4_SIZE; + unsigned long pud_phys; + pud_t *pud = alloc_low_page(&map, &pud_phys); + next = start + PGDIR_SIZE; if (next > end) next = end; - phys_pgd_init(pgd, adr-PAGE_OFFSET, next-PAGE_OFFSET); - set_pml4(init_level4_pgt + pml4_index(adr), mk_kernel_pml4(pgd_phys)); + phys_pud_init(pud, __pa(start), __pa(next)); + set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys)); unmap_low_page(map); } + asm volatile("movq %%cr4,%0" : "=r" (mmu_cr4_features)); __flush_tlb_all(); early_printk("kernel direct mapping tables upto %lx @ %lx-%lx\n", end, @@ -306,25 +310,12 @@ void __init init_memory_mapping(void) extern struct x8664_pda cpu_pda[NR_CPUS]; -static unsigned long low_pml4[NR_CPUS]; - -void swap_low_mappings(void) -{ - int i; - for (i = 0; i < NR_CPUS; i++) { - unsigned long t; - if (!cpu_pda[i].level4_pgt) - continue; - t = cpu_pda[i].level4_pgt[0]; - cpu_pda[i].level4_pgt[0] = low_pml4[i]; - low_pml4[i] = t; - } - flush_tlb_all(); -} - +/* Assumes all CPUs still execute in init_mm */ void zap_low_mappings(void) { - swap_low_mappings(); + pgd_t *pgd = pgd_offset_k(0UL); + pgd_clear(pgd); + flush_tlb_all(); } #ifndef CONFIG_DISCONTIGMEM @@ -361,10 +352,14 @@ void __init clear_kernel_mapping(unsigned long address, unsigned long size) for (; address < end; address += LARGE_PAGE_SIZE) { pgd_t *pgd = pgd_offset_k(address); - pmd_t *pmd; - if (!pgd || pgd_none(*pgd)) + pud_t *pud; + pmd_t *pmd; + if (pgd_none(*pgd)) + continue; + pud = pud_offset(pgd, address); + if (pud_none(*pud)) continue; - pmd = pmd_offset(pgd, address); + pmd = pmd_offset(pud, address); if (!pmd || pmd_none(*pmd)) continue; if (0 == (pmd_val(*pmd) & _PAGE_PSE)) { @@ -446,7 +441,7 @@ void __init mem_init(void) /* * Only count reserved RAM pages */ - if (page_is_ram(tmp) && PageReserved(mem_map+tmp)) + if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp))) reservedpages++; #endif @@ -484,6 +479,8 @@ void __init mem_init(void) #endif } +extern char __initdata_begin[], __initdata_end[]; + void free_initmem(void) { unsigned long addr; @@ -492,12 +489,11 @@ void free_initmem(void) for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { ClearPageReserved(virt_to_page(addr)); set_page_count(virt_to_page(addr), 1); -#ifdef CONFIG_INIT_DEBUG memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE); -#endif free_page(addr); totalram_pages++; } + memset(__initdata_begin, 0xba, __initdata_end - __initdata_begin); printk ("Freeing unused kernel memory: %luk freed\n", (&__init_end - &__init_begin) >> 10); } @@ -530,29 +526,29 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len) int kern_addr_valid(unsigned long addr) { unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT; - pml4_t *pml4; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; if (above != 0 && above != -1UL) return 0; - pml4 = pml4_offset_k(addr); - if (pml4_none(*pml4)) + pgd = pgd_offset_k(addr); + if (pgd_none(*pgd)) return 0; - pgd = pgd_offset_k(addr); - if (pgd_none(*pgd)) + pud = pud_offset(pgd, addr); + if (pud_none(*pud)) return 0; - pmd = pmd_offset(pgd, addr); + pmd = pmd_offset(pud, addr); if (pmd_none(*pmd)) return 0; if (pmd_large(*pmd)) return pfn_valid(pmd_pfn(*pmd)); - pte = pte_offset_kernel(pmd, addr); + pte = pte_offset_kernel(pmd, addr); if (pte_none(*pte)) return 0; return pfn_valid(pte_pfn(*pte)); @@ -609,7 +605,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk) if (test_tsk_thread_flag(tsk, TIF_IA32)) { /* lookup code assumes the pages are present. set them up now */ - if (__map_syscall32(tsk->mm, 0xfffe000) < 0) + if (__map_syscall32(tsk->mm, VSYSCALL32_BASE) < 0) return NULL; return &gate32_vma; } @@ -622,3 +618,13 @@ int in_gate_area(struct task_struct *task, unsigned long addr) struct vm_area_struct *vma = get_gate_vma(task); return (addr >= vma->vm_start) && (addr < vma->vm_end); } + +/* Use this when you have no reliable task/vma, typically from interrupt + * context. It is less reliable than using the task's vma and may give + * false positives. + */ +int in_gate_area_no_task(unsigned long addr) +{ + return (((addr >= VSYSCALL_START) && (addr < VSYSCALL_END)) || + ((addr >= VSYSCALL32_BASE) && (addr < VSYSCALL32_END))); +} diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c index 9fc032b99..911262d8c 100644 --- a/arch/x86_64/mm/ioremap.c +++ b/arch/x86_64/mm/ioremap.c @@ -16,7 +16,7 @@ #include #include #include - +#include static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, unsigned long phys_addr, unsigned long flags) @@ -49,10 +49,10 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo { unsigned long end; - address &= ~PGDIR_MASK; + address &= ~PUD_MASK; end = address + size; - if (end > PGDIR_SIZE) - end = PGDIR_SIZE; + if (end > PUD_SIZE) + end = PUD_SIZE; phys_addr -= address; if (address >= end) BUG(); @@ -67,31 +67,54 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo return 0; } +static inline int remap_area_pud(pud_t * pud, unsigned long address, unsigned long size, + unsigned long phys_addr, unsigned long flags) +{ + unsigned long end; + + address &= ~PGDIR_MASK; + end = address + size; + if (end > PGDIR_SIZE) + end = PGDIR_SIZE; + phys_addr -= address; + if (address >= end) + BUG(); + do { + pmd_t * pmd = pmd_alloc(&init_mm, pud, address); + if (!pmd) + return -ENOMEM; + remap_area_pmd(pmd, address, end - address, address + phys_addr, flags); + address = (address + PUD_SIZE) & PUD_MASK; + pud++; + } while (address && (address < end)); + return 0; +} + static int remap_area_pages(unsigned long address, unsigned long phys_addr, unsigned long size, unsigned long flags) { int error; - pgd_t * dir; + pgd_t *pgd; unsigned long end = address + size; phys_addr -= address; - dir = pgd_offset_k(address); + pgd = pgd_offset_k(address); flush_cache_all(); if (address >= end) BUG(); spin_lock(&init_mm.page_table_lock); do { - pmd_t *pmd; - pmd = pmd_alloc(&init_mm, dir, address); + pud_t *pud; + pud = pud_alloc(&init_mm, pgd, address); error = -ENOMEM; - if (!pmd) + if (!pud) break; - if (remap_area_pmd(pmd, address, end - address, + if (remap_area_pud(pud, address, end - address, phys_addr + address, flags)) break; error = 0; address = (address + PGDIR_SIZE) & PGDIR_MASK; - dir++; + pgd++; } while (address && (address < end)); spin_unlock(&init_mm.page_table_lock); flush_tlb_all(); @@ -99,7 +122,31 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, } /* - * Generic mapping function (not visible outside): + * Fix up the linear direct mapping of the kernel to avoid cache attribute + * conflicts. + */ +static int +ioremap_change_attr(unsigned long phys_addr, unsigned long size, + unsigned long flags) +{ + int err = 0; + if (flags && phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { + unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; + unsigned long vaddr = (unsigned long) __va(phys_addr); + + /* + * Must use a address here and not struct page because the phys addr + * can be a in hole between nodes and not have an memmap entry. + */ + err = change_page_attr_addr(vaddr,npages,__pgprot(__PAGE_KERNEL|flags)); + if (!err) + global_flush_tlb(); + } + return err; +} + +/* + * Generic mapping function */ /* @@ -128,11 +175,11 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l if (phys_addr >= 0xA0000 && last_addr < 0x100000) return (__force void __iomem *)phys_to_virt(phys_addr); +#ifndef CONFIG_DISCONTIGMEM /* * Don't allow anybody to remap normal RAM that we're using.. */ - if (phys_addr < virt_to_phys(high_memory)) { -#ifndef CONFIG_DISCONTIGMEM + if (last_addr < virt_to_phys(high_memory)) { char *t_addr, *t_end; struct page *page; @@ -142,8 +189,8 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) if(!PageReserved(page)) return NULL; -#endif } +#endif /* * Mappings have to be page-aligned @@ -155,12 +202,17 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l /* * Ok, go for it.. */ - area = get_vm_area(size, VM_IOREMAP); + area = get_vm_area(size, VM_IOREMAP | (flags << 20)); if (!area) return NULL; area->phys_addr = phys_addr; addr = area->addr; if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { + remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); + return NULL; + } + if (ioremap_change_attr(phys_addr, size, flags) < 0) { + area->flags &= 0xffffff; vunmap(addr); return NULL; } @@ -191,43 +243,35 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) { - void __iomem *p = __ioremap(phys_addr, size, _PAGE_PCD); - if (!p) - return p; - - if (phys_addr + size < virt_to_phys(high_memory)) { - struct page *ppage = virt_to_page(__va(phys_addr)); - unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; - - BUG_ON(phys_addr+size > (unsigned long)high_memory); - BUG_ON(phys_addr + size < phys_addr); - - if (change_page_attr(ppage, npages, PAGE_KERNEL_NOCACHE) < 0) { - iounmap(p); - p = NULL; - } - global_flush_tlb(); - } - - return p; + return __ioremap(phys_addr, size, _PAGE_PCD); } -void iounmap(void __iomem *addr) +void iounmap(volatile void __iomem *addr) { - struct vm_struct *p; + struct vm_struct *p, **pprev; + if (addr <= high_memory) return; - p = remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); + + write_lock(&vmlist_lock); + for (p = vmlist, pprev = &vmlist; p != NULL; pprev = &p->next, p = *pprev) + if (p->addr == (void *)(PAGE_MASK & (unsigned long)addr)) + break; if (!p) { printk("__iounmap: bad address %p\n", addr); - return; - } - - if (p->flags && p->phys_addr < virt_to_phys(high_memory)) { + goto out_unlock; + } + *pprev = p->next; + unmap_vm_area(p); + if ((p->flags >> 20) && + p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) { + /* p->size includes the guard page, but cpa doesn't like that */ change_page_attr(virt_to_page(__va(p->phys_addr)), - p->size >> PAGE_SHIFT, + (p->size - PAGE_SIZE) >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } +out_unlock: + write_unlock(&vmlist_lock); kfree(p); } diff --git a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c index 0825e37fd..ec35747aa 100644 --- a/arch/x86_64/mm/k8topology.c +++ b/arch/x86_64/mm/k8topology.c @@ -2,9 +2,7 @@ * AMD K8 NUMA support. * Discover the memory map and associated nodes. * - * Doesn't use the ACPI SRAT table because it has a questionable license. - * Instead the northbridge registers are read directly. - * XXX in 2.5 we could use the generic SRAT code + * This version reads it directly from the K8 northbridge. * * Copyright 2002,2003 Andi Kleen, SuSE Labs. */ @@ -12,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -44,10 +43,14 @@ static __init int find_northbridge(void) int __init k8_scan_nodes(unsigned long start, unsigned long end) { unsigned long prevbase; - struct node nodes[MAXNODE]; + struct node nodes[8]; int nodeid, i, nb; int found = 0; u32 reg; + unsigned numnodes; + nodemask_t nodes_parsed; + + nodes_clear(nodes_parsed); nb = find_northbridge(); if (nb < 0) @@ -56,9 +59,9 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); reg = read_pci_config(0, nb, 0, 0x60); - numnodes = ((reg >> 4) & 7) + 1; + numnodes = ((reg >> 4) & 0xF) + 1; - printk(KERN_INFO "Number of nodes %d (%x)\n", numnodes, reg); + printk(KERN_INFO "Number of nodes %d\n", numnodes); memset(&nodes,0,sizeof(nodes)); prevbase = 0; @@ -70,11 +73,11 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) nodeid = limit & 7; if ((base & 3) == 0) { - if (i < numnodes) + if (i < numnodes) printk("Skipping disabled node %d\n", i); continue; } - if (nodeid >= numnodes) { + if (nodeid >= numnodes) { printk("Ignoring excess node %d (%lx:%lx)\n", nodeid, base, limit); continue; @@ -90,7 +93,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) nodeid, (base>>8)&3, (limit>>8) & 3); return -1; } - if (node_online(nodeid)) { + if (node_isset(nodeid, nodes_parsed)) { printk(KERN_INFO "Node %d already present. Skipping\n", nodeid); continue; @@ -138,24 +141,26 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) nodes[nodeid].end = limit; prevbase = base; + + node_set(nodeid, nodes_parsed); } if (!found) return -1; - memnode_shift = compute_hash_shift(nodes); + memnode_shift = compute_hash_shift(nodes, numnodes); if (memnode_shift < 0) { printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n"); return -1; } printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift); - for (i = 0; i < MAXNODE; i++) { + for (i = 0; i < 8; i++) { if (nodes[i].start != nodes[i].end) { /* assume 1:1 NODE:CPU */ cpu_to_node[i] = i; - setup_node_bootmem(i, nodes[i].start, nodes[i].end); - } + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + } } numa_init_array(); diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index e6746a26b..fd9f25d7a 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c @@ -10,29 +10,30 @@ #include #include #include +#include + #include #include #include #include +#include #ifndef Dprintk #define Dprintk(x...) #endif -struct pglist_data *node_data[MAXNODE]; +struct pglist_data *node_data[MAX_NUMNODES]; bootmem_data_t plat_node_bdata[MAX_NUMNODES]; int memnode_shift; u8 memnodemap[NODEMAPSIZE]; -unsigned char cpu_to_node[NR_CPUS]; -cpumask_t node_to_cpumask[MAXNODE]; - -static int numa_off __initdata; +unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE }; +cpumask_t node_to_cpumask[MAX_NUMNODES]; -unsigned long nodes_present; +int numa_off __initdata; -int __init compute_hash_shift(struct node *nodes) +int __init compute_hash_shift(struct node *nodes, int numnodes) { int i; int shift = 24; @@ -41,7 +42,7 @@ int __init compute_hash_shift(struct node *nodes) /* When in doubt use brute force. */ while (shift < 48) { memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE); - for (i = 0; i < numnodes; i++) { + for (i = 0; i < numnodes; i++) { if (nodes[i].start == nodes[i].end) continue; for (addr = nodes[i].start; @@ -107,8 +108,6 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size); reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages< numnodes) - numnodes = nodeid + 1; node_set_online(nodeid); } @@ -148,13 +147,12 @@ void __init numa_init_array(void) CPUs, as the number of CPUs is not known yet. We round robin the existing nodes. */ rr = 0; - for (i = 0; i < MAXNODE; i++) { - if (node_online(i)) + for (i = 0; i < NR_CPUS; i++) { + if (cpu_to_node[i] != NUMA_NO_NODE) continue; - rr = find_next_bit(node_online_map, MAX_NUMNODES, rr); + rr = next_node(rr, node_online_map); if (rr == MAX_NUMNODES) - rr = find_first_bit(node_online_map, MAX_NUMNODES); - node_data[i] = node_data[rr]; + rr = first_node(node_online_map); cpu_to_node[i] = rr; rr++; } @@ -162,13 +160,14 @@ void __init numa_init_array(void) set_bit(0, &node_to_cpumask[cpu_to_node(0)]); } +#ifdef CONFIG_NUMA_EMU int numa_fake __initdata = 0; /* Numa emulation */ static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn) { int i; - struct node nodes[MAXNODE]; + struct node nodes[MAX_NUMNODES]; unsigned long sz = ((end_pfn - start_pfn)<> 20); + node_set_online(i); } - numnodes = numa_fake; - memnode_shift = compute_hash_shift(nodes); + memnode_shift = compute_hash_shift(nodes, numa_fake); if (memnode_shift < 0) { memnode_shift = 0; printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n"); return -1; } - for (i = 0; i < numa_fake; i++) + for_each_online_node(i) setup_node_bootmem(i, nodes[i].start, nodes[i].end); numa_init_array(); return 0; } +#endif void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) { int i; +#ifdef CONFIG_NUMA_EMU if (numa_fake && !numa_emulation(start_pfn, end_pfn)) return; +#endif + +#ifdef CONFIG_ACPI_NUMA + if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, + end_pfn << PAGE_SHIFT)) + return; +#endif #ifdef CONFIG_K8_NUMA if (!numa_off && !k8_scan_nodes(start_pfn<> PAGE_SHIFT; + + err = __change_page_attr(address, pfn, prot, PAGE_KERNEL); if (err) break; /* Handle kernel mapping too which aliases part of the * lowmem */ - /* Disabled right now. Fixme */ - if (0 && page_to_phys(page) < KERNEL_TEXT_SIZE) { + if (__pa(address) < KERNEL_TEXT_SIZE) { unsigned long addr2; - addr2 = __START_KERNEL_map + page_to_phys(page); - err = __change_page_attr(addr2, page, prot, - PAGE_KERNEL_EXEC); + pgprot_t prot2 = prot; + addr2 = __START_KERNEL_map + __pa(address); + pgprot_val(prot2) &= ~_PAGE_NX; + err = __change_page_attr(addr2, pfn, prot2, PAGE_KERNEL_EXEC); } } up_write(&init_mm.mmap_sem); return err; } +/* Don't call this for MMIO areas that may not have a mem_map entry */ +int change_page_attr(struct page *page, int numpages, pgprot_t prot) +{ + unsigned long addr = (unsigned long)page_address(page); + return change_page_attr_addr(addr, numpages, prot); +} + void global_flush_tlb(void) { struct deferred_page *df, *next_df; @@ -194,6 +220,8 @@ void global_flush_tlb(void) down_read(&init_mm.mmap_sem); df = xchg(&df_list, NULL); up_read(&init_mm.mmap_sem); + if (!df) + return; flush_map((df && !df->next) ? df->address : 0); for (; df; df = next_df) { next_df = df->next; diff --git a/arch/x86_64/oprofile/Makefile b/arch/x86_64/oprofile/Makefile index f4e3ccb8b..6be32683e 100644 --- a/arch/x86_64/oprofile/Makefile +++ b/arch/x86_64/oprofile/Makefile @@ -11,7 +11,7 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ oprofilefs.o oprofile_stats.o \ timer_int.o ) -OPROFILE-y := init.o +OPROFILE-y := init.o backtrace.o OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o op_model_p4.o \ op_model_ppro.o OPROFILE-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index 7004ee82f..142b9befe 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c @@ -63,9 +63,6 @@ static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 va break; } - /* Dummy read to flush PCI write */ - readl(addr); - return 0; } @@ -81,6 +78,13 @@ static int __init pci_mmcfg_init(void) if (!pci_mmcfg_base_addr) return 0; + /* Kludge for now. Don't use mmconfig on AMD systems because + those have some busses where mmconfig doesn't work, + and we don't parse ACPI MCFG well enough to handle that. + Remove when proper handling is added. */ + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + return 0; + /* RED-PEN i386 doesn't do _nocache right now */ pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE); if (!pci_mmcfg_virt) { diff --git a/crypto/Kconfig b/crypto/Kconfig index 9916a1830..a477f2a32 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -73,11 +73,11 @@ config CRYPTO_WP512 help Whirlpool hash algorithm 512, 384 and 256-bit hashes - Whirlpool-512 is part of the NESSIE cryptographic primtives. + Whirlpool-512 is part of the NESSIE cryptographic primitives. Whirlpool will be part of the ISO/IEC 10118-3:2003(E) standard See also: - http://planeta.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html + config CRYPTO_DES tristate "DES and Triple DES EDE cipher algorithms" @@ -102,7 +102,7 @@ config CRYPTO_BLOWFISH designed for use on "large microprocessors". See also: - http://www.schneier.com/blowfish.html + config CRYPTO_TWOFISH tristate "Twofish cipher algorithm" @@ -116,7 +116,7 @@ config CRYPTO_TWOFISH bits. See also: - http://www.schneier.com/twofish.html + config CRYPTO_SERPENT tristate "Serpent cipher algorithm" @@ -125,10 +125,11 @@ config CRYPTO_SERPENT Serpent cipher algorithm, by Anderson, Biham & Knudsen. Keys are allowed to be from 0 to 256 bits in length, in steps - of 8 bits. + of 8 bits. Also includes the 'Tnepres' algorithm, a reversed + variant of Serpent for compatibility with old kerneli code. See also: - http://www.cl.cam.ac.uk/~rja14/serpent.html + config CRYPTO_AES tristate "AES cipher algorithms" @@ -148,7 +149,7 @@ config CRYPTO_AES The AES specifies three key sizes: 128, 192 and 256 bits - See http://csrc.nist.gov/CryptoToolkit/aes/ for more information. + See for more information. config CRYPTO_AES_586 tristate "AES cipher algorithms (i586)" @@ -168,7 +169,7 @@ config CRYPTO_AES_586 The AES specifies three key sizes: 128, 192 and 256 bits - See http://csrc.nist.gov/encryption/aes/ for more information. + See for more information. config CRYPTO_CAST5 tristate "CAST5 (CAST-128) cipher algorithm" @@ -220,7 +221,22 @@ config CRYPTO_KHAZAD on 32-bit processors. Khazad uses an 128 bit key size. See also: - http://planeta.terra.com.br/informatica/paulobarreto/KhazadPage.html + + +config CRYPTO_ANUBIS + tristate "Anubis cipher algorithm" + depends on CRYPTO + help + Anubis cipher algorithm. + + Anubis is a variable key length cipher which can use keys from + 128 bits to 320 bits in length. It was evaluated as a entrant + in the NESSIE competition. + + See also: + + + config CRYPTO_DEFLATE tristate "Deflate compression algorithm" @@ -258,5 +274,6 @@ config CRYPTO_TEST help Quick & dirty crypto test module. +source "drivers/crypto/Kconfig" endmenu diff --git a/crypto/Makefile b/crypto/Makefile index 0c9d42bfb..96467bfd7 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -25,6 +25,7 @@ obj-$(CONFIG_CRYPTO_CAST6) += cast6.o obj-$(CONFIG_CRYPTO_ARC4) += arc4.o obj-$(CONFIG_CRYPTO_TEA) += tea.o obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o +obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o diff --git a/crypto/blowfish.c b/crypto/blowfish.c index b6bea821c..83d575557 100644 --- a/crypto/blowfish.c +++ b/crypto/blowfish.c @@ -316,7 +316,7 @@ static const u32 bf_sbox[256 * 4] = { * The blowfish encipher, processes 64-bit blocks. * NOTE: This function MUSTN'T respect endianess */ -static inline void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src) +static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src) { const u32 *P = bctx->p; const u32 *S = bctx->s; diff --git a/crypto/serpent.c b/crypto/serpent.c index 9802b1c54..4c95ba9c5 100644 --- a/crypto/serpent.c +++ b/crypto/serpent.c @@ -4,6 +4,10 @@ * Serpent Cipher Algorithm. * * Copyright (C) 2002 Dag Arne Osvik + * 2003 Herbert Valerio Riedel + * + * Added tnepres support: Ruben Jesus Garcia Hernandez , 18.10.2004 + * Based on code by hvr * * 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 @@ -212,7 +216,8 @@ struct serpent_ctx { u32 expkey[SERPENT_EXPKEY_WORDS]; }; -static int setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) + +static int serpent_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { u32 *k = ((struct serpent_ctx *)ctx)->expkey; u8 *k8 = (u8 *)k; @@ -362,7 +367,7 @@ static int setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) return 0; } -static void encrypt(void *ctx, u8 *dst, const u8 *src) +static void serpent_encrypt(void *ctx, u8 *dst, const u8 *src) { const u32 *k = ((struct serpent_ctx *)ctx)->expkey, @@ -420,7 +425,7 @@ static void encrypt(void *ctx, u8 *dst, const u8 *src) d[3] = cpu_to_le32(r3); } -static void decrypt(void *ctx, u8 *dst, const u8 *src) +static void serpent_decrypt(void *ctx, u8 *dst, const u8 *src) { const u32 *k = ((struct serpent_ctx *)ctx)->expkey, @@ -483,18 +488,101 @@ static struct crypto_alg serpent_alg = { .cra_u = { .cipher = { .cia_min_keysize = SERPENT_MIN_KEY_SIZE, .cia_max_keysize = SERPENT_MAX_KEY_SIZE, - .cia_setkey = setkey, - .cia_encrypt = encrypt, - .cia_decrypt = decrypt } } + .cia_setkey = serpent_setkey, + .cia_encrypt = serpent_encrypt, + .cia_decrypt = serpent_decrypt } } +}; + +static int tnepres_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) +{ + u8 rev_key[SERPENT_MAX_KEY_SIZE]; + int i; + + if ((keylen < SERPENT_MIN_KEY_SIZE) + || (keylen > SERPENT_MAX_KEY_SIZE)) { + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; + return -EINVAL; + } + + for (i = 0; i < keylen; ++i) + rev_key[keylen - i - 1] = key[i]; + + return serpent_setkey(ctx, rev_key, keylen, flags); +} + +static void tnepres_encrypt(void *ctx, u8 *dst, const u8 *src) +{ + const u32 * const s = (const u32 * const)src; + u32 * const d = (u32 * const)dst; + + u32 rs[4], rd[4]; + + rs[0] = swab32(s[3]); + rs[1] = swab32(s[2]); + rs[2] = swab32(s[1]); + rs[3] = swab32(s[0]); + + serpent_encrypt(ctx, (u8 *)rd, (u8 *)rs); + + d[0] = swab32(rd[3]); + d[1] = swab32(rd[2]); + d[2] = swab32(rd[1]); + d[3] = swab32(rd[0]); +} + +static void tnepres_decrypt(void *ctx, u8 *dst, const u8 *src) +{ + const u32 * const s = (const u32 * const)src; + u32 * const d = (u32 * const)dst; + + u32 rs[4], rd[4]; + + rs[0] = swab32(s[3]); + rs[1] = swab32(s[2]); + rs[2] = swab32(s[1]); + rs[3] = swab32(s[0]); + + serpent_decrypt(ctx, (u8 *)rd, (u8 *)rs); + + d[0] = swab32(rd[3]); + d[1] = swab32(rd[2]); + d[2] = swab32(rd[1]); + d[3] = swab32(rd[0]); +} + +static struct crypto_alg tnepres_alg = { + .cra_name = "tnepres", + .cra_flags = CRYPTO_ALG_TYPE_CIPHER, + .cra_blocksize = SERPENT_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct serpent_ctx), + .cra_module = THIS_MODULE, + .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list), + .cra_u = { .cipher = { + .cia_min_keysize = SERPENT_MIN_KEY_SIZE, + .cia_max_keysize = SERPENT_MAX_KEY_SIZE, + .cia_setkey = tnepres_setkey, + .cia_encrypt = tnepres_encrypt, + .cia_decrypt = tnepres_decrypt } } }; static int __init init(void) { - return crypto_register_alg(&serpent_alg); + int ret = crypto_register_alg(&serpent_alg); + + if (ret) + return ret; + + ret = crypto_register_alg(&tnepres_alg); + + if (ret) + crypto_unregister_alg(&serpent_alg); + + return ret; } static void __exit fini(void) { + crypto_unregister_alg(&tnepres_alg); crypto_unregister_alg(&serpent_alg); } @@ -502,5 +590,6 @@ module_init(init); module_exit(fini); MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("Serpent Cipher Algorithm"); +MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm"); MODULE_AUTHOR("Dag Arne Osvik "); +MODULE_ALIAS("tnepres"); diff --git a/crypto/sha256.c b/crypto/sha256.c index e8adf150d..39f5a6547 100644 --- a/crypto/sha256.c +++ b/crypto/sha256.c @@ -63,15 +63,7 @@ static inline u32 RORu32(u32 x, u32 y) static inline void LOAD_OP(int I, u32 *W, const u8 *input) { - u32 t1 = input[(4 * I)] & 0xff; - - t1 <<= 8; - t1 |= input[(4 * I) + 1] & 0xff; - t1 <<= 8; - t1 |= input[(4 * I) + 2] & 0xff; - t1 <<= 8; - t1 |= input[(4 * I) + 3] & 0xff; - W[I] = t1; + W[I] = __be32_to_cpu( ((u32*)(input))[I] ); } static inline void BLEND_OP(int I, u32 *W) diff --git a/crypto/sha512.c b/crypto/sha512.c index f1a8dc0ae..2403bb946 100644 --- a/crypto/sha512.c +++ b/crypto/sha512.c @@ -30,6 +30,7 @@ struct sha512_ctx { u64 state[8]; u32 count[4]; u8 buf[128]; + u64 W[80]; }; static inline u64 Ch(u64 x, u64 y, u64 z) @@ -47,7 +48,7 @@ static inline u64 RORu64(u64 x, u64 y) return (x >> y) | (x << (64 - y)); } -const u64 sha512_K[80] = { +static const u64 sha512_K[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, @@ -104,34 +105,18 @@ const u64 sha512_K[80] = { static inline void LOAD_OP(int I, u64 *W, const u8 *input) { - u64 t1 = input[(8*I) ] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+1] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+2] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+3] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+4] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+5] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+6] & 0xff; - t1 <<= 8; - t1 |= input[(8*I)+7] & 0xff; - W[I] = t1; + W[I] = __be64_to_cpu( ((u64*)(input))[I] ); } static inline void BLEND_OP(int I, u64 *W) { - W[I] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16]; + W[I] = s1(W[I-2]) + W[I-7] + s0(W[I-15]) + W[I-16]; } static void -sha512_transform(u64 *state, const u8 *input) +sha512_transform(u64 *state, u64 *W, const u8 *input) { u64 a, b, c, d, e, f, g, h, t1, t2; - u64 W[80]; int i; @@ -172,7 +157,6 @@ sha512_transform(u64 *state, const u8 *input) /* erase our data */ a = b = c = d = e = f = g = h = t1 = t2 = 0; - memset(W, 0, 80 * sizeof(u64)); } static void @@ -230,10 +214,10 @@ sha512_update(void *ctx, const u8 *data, unsigned int len) /* Transform as many times as possible. */ if (len >= part_len) { memcpy(&sctx->buf[index], data, part_len); - sha512_transform(sctx->state, sctx->buf); + sha512_transform(sctx->state, sctx->W, sctx->buf); for (i = part_len; i + 127 < len; i+=128) - sha512_transform(sctx->state, &data[i]); + sha512_transform(sctx->state, sctx->W, &data[i]); index = 0; } else { @@ -242,6 +226,9 @@ sha512_update(void *ctx, const u8 *data, unsigned int len) /* Buffer remaining input */ memcpy(&sctx->buf[index], &data[i], len - i); + + /* erase our data */ + memset(sctx->W, 0, sizeof(sctx->W)); } static void diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index c23d5ee69..a685df621 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -63,7 +63,7 @@ static char *check[] = { "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", - "wp512", "wp384", "wp256", NULL + "khazad", "wp512", "wp384", "wp256", "tnepres", NULL }; static void @@ -255,7 +255,7 @@ out: #endif /* CONFIG_CRYPTO_HMAC */ -void +static void test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, unsigned int tcount) { unsigned int ret, i, j, k, temp; @@ -651,6 +651,10 @@ do_test(void) test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS); test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS); + //TNEPRES + test_cipher ("tnepres", MODE_ECB, ENCRYPT, tnepres_enc_tv_template, TNEPRES_ENC_TEST_VECTORS); + test_cipher ("tnepres", MODE_ECB, DECRYPT, tnepres_dec_tv_template, TNEPRES_DEC_TEST_VECTORS); + //AES test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS); test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS); @@ -680,6 +684,12 @@ do_test(void) test_cipher ("khazad", MODE_ECB, ENCRYPT, khazad_enc_tv_template, KHAZAD_ENC_TEST_VECTORS); test_cipher ("khazad", MODE_ECB, DECRYPT, khazad_dec_tv_template, KHAZAD_DEC_TEST_VECTORS); + //ANUBIS + test_cipher ("anubis", MODE_ECB, ENCRYPT, anubis_enc_tv_template, ANUBIS_ENC_TEST_VECTORS); + test_cipher ("anubis", MODE_ECB, DECRYPT, anubis_dec_tv_template, ANUBIS_DEC_TEST_VECTORS); + test_cipher ("anubis", MODE_CBC, ENCRYPT, anubis_cbc_enc_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); + test_cipher ("anubis", MODE_CBC, DECRYPT, anubis_cbc_dec_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); + test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS); test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS); test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS); @@ -739,6 +749,8 @@ do_test(void) break; case 9: + test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS); + test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS); break; case 10: @@ -808,6 +820,17 @@ do_test(void) test_hash("wp256", wp256_tv_template, WP256_TEST_VECTORS); break; + case 25: + test_cipher ("tnepres", MODE_ECB, ENCRYPT, tnepres_enc_tv_template, TNEPRES_ENC_TEST_VECTORS); + test_cipher ("tnepres", MODE_ECB, DECRYPT, tnepres_dec_tv_template, TNEPRES_DEC_TEST_VECTORS); + break; + + case 26: + test_cipher ("anubis", MODE_ECB, ENCRYPT, anubis_enc_tv_template, ANUBIS_ENC_TEST_VECTORS); + test_cipher ("anubis", MODE_ECB, DECRYPT, anubis_dec_tv_template, ANUBIS_DEC_TEST_VECTORS); + test_cipher ("anubis", MODE_CBC, ENCRYPT, anubis_cbc_enc_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); + test_cipher ("anubis", MODE_CBC, DECRYPT, anubis_cbc_dec_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); + break; #ifdef CONFIG_CRYPTO_HMAC case 100: diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index 18370befc..df08d0d8c 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h @@ -63,7 +63,7 @@ struct cipher_testvec { */ #define MD4_TEST_VECTORS 7 -struct hash_testvec md4_tv_template [] = { +static struct hash_testvec md4_tv_template [] = { { .plaintext = "", .digest = { 0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, @@ -109,7 +109,7 @@ struct hash_testvec md4_tv_template [] = { */ #define MD5_TEST_VECTORS 7 -struct hash_testvec md5_tv_template[] = { +static struct hash_testvec md5_tv_template[] = { { .digest = { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e }, @@ -154,7 +154,7 @@ struct hash_testvec md5_tv_template[] = { */ #define SHA1_TEST_VECTORS 2 -struct hash_testvec sha1_tv_template[] = { +static struct hash_testvec sha1_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -175,7 +175,7 @@ struct hash_testvec sha1_tv_template[] = { */ #define SHA256_TEST_VECTORS 2 -struct hash_testvec sha256_tv_template[] = { +static struct hash_testvec sha256_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -200,7 +200,7 @@ struct hash_testvec sha256_tv_template[] = { */ #define SHA384_TEST_VECTORS 4 -struct hash_testvec sha384_tv_template[] = { +static struct hash_testvec sha384_tv_template[] = { { .plaintext= "abc", .psize = 3, @@ -249,7 +249,7 @@ struct hash_testvec sha384_tv_template[] = { */ #define SHA512_TEST_VECTORS 4 -struct hash_testvec sha512_tv_template[] = { +static struct hash_testvec sha512_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -309,7 +309,7 @@ struct hash_testvec sha512_tv_template[] = { */ #define WP512_TEST_VECTORS 8 -struct hash_testvec wp512_tv_template[] = { +static struct hash_testvec wp512_tv_template[] = { { .plaintext = "", .psize = 0, @@ -407,7 +407,7 @@ struct hash_testvec wp512_tv_template[] = { #define WP384_TEST_VECTORS 8 -struct hash_testvec wp384_tv_template[] = { +static struct hash_testvec wp384_tv_template[] = { { .plaintext = "", .psize = 0, @@ -489,7 +489,7 @@ struct hash_testvec wp384_tv_template[] = { #define WP256_TEST_VECTORS 8 -struct hash_testvec wp256_tv_template[] = { +static struct hash_testvec wp256_tv_template[] = { { .plaintext = "", .psize = 0, @@ -561,7 +561,7 @@ struct hash_testvec wp256_tv_template[] = { */ #define HMAC_MD5_TEST_VECTORS 7 -struct hmac_testvec hmac_md5_tv_template[] = +static struct hmac_testvec hmac_md5_tv_template[] = { { .key = { [0 ... 15] = 0x0b }, @@ -625,7 +625,7 @@ struct hmac_testvec hmac_md5_tv_template[] = */ #define HMAC_SHA1_TEST_VECTORS 7 -struct hmac_testvec hmac_sha1_tv_template[] = { +static struct hmac_testvec hmac_sha1_tv_template[] = { { .key = { [0 ... 19] = 0x0b }, .ksize = 20, @@ -690,7 +690,7 @@ struct hmac_testvec hmac_sha1_tv_template[] = { */ #define HMAC_SHA256_TEST_VECTORS 10 -struct hmac_testvec hmac_sha256_tv_template[] = { +static struct hmac_testvec hmac_sha256_tv_template[] = { { .key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, @@ -813,7 +813,7 @@ struct hmac_testvec hmac_sha256_tv_template[] = { #define DES3_EDE_ENC_TEST_VECTORS 3 #define DES3_EDE_DEC_TEST_VECTORS 3 -struct cipher_testvec des_enc_tv_template[] = { +static struct cipher_testvec des_enc_tv_template[] = { { /* From Applied Cryptography */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -917,7 +917,7 @@ struct cipher_testvec des_enc_tv_template[] = { }, }; -struct cipher_testvec des_dec_tv_template[] = { +static struct cipher_testvec des_dec_tv_template[] = { { /* From Applied Cryptography */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -957,7 +957,7 @@ struct cipher_testvec des_dec_tv_template[] = { }, }; -struct cipher_testvec des_cbc_enc_tv_template[] = { +static struct cipher_testvec des_cbc_enc_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, .klen = 8, @@ -1012,7 +1012,7 @@ struct cipher_testvec des_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec des_cbc_dec_tv_template[] = { +static struct cipher_testvec des_cbc_dec_tv_template[] = { { /* FIPS Pub 81 */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -1053,7 +1053,7 @@ struct cipher_testvec des_cbc_dec_tv_template[] = { /* * We really need some more test vectors, especially for DES3 CBC. */ -struct cipher_testvec des3_ede_enc_tv_template[] = { +static struct cipher_testvec des3_ede_enc_tv_template[] = { { /* These are from openssl */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, @@ -1084,7 +1084,7 @@ struct cipher_testvec des3_ede_enc_tv_template[] = { }, }; -struct cipher_testvec des3_ede_dec_tv_template[] = { +static struct cipher_testvec des3_ede_dec_tv_template[] = { { /* These are from openssl */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, @@ -1123,7 +1123,7 @@ struct cipher_testvec des3_ede_dec_tv_template[] = { #define BF_CBC_ENC_TEST_VECTORS 1 #define BF_CBC_DEC_TEST_VECTORS 1 -struct cipher_testvec bf_enc_tv_template[] = { +static struct cipher_testvec bf_enc_tv_template[] = { { /* DES test vectors from OpenSSL */ .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, .klen = 8, @@ -1178,7 +1178,7 @@ struct cipher_testvec bf_enc_tv_template[] = { }, }; -struct cipher_testvec bf_dec_tv_template[] = { +static struct cipher_testvec bf_dec_tv_template[] = { { /* DES test vectors from OpenSSL */ .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, .klen = 8, @@ -1233,7 +1233,7 @@ struct cipher_testvec bf_dec_tv_template[] = { }, }; -struct cipher_testvec bf_cbc_enc_tv_template[] = { +static struct cipher_testvec bf_cbc_enc_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, @@ -1252,7 +1252,7 @@ struct cipher_testvec bf_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec bf_cbc_dec_tv_template[] = { +static struct cipher_testvec bf_cbc_dec_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, @@ -1279,7 +1279,7 @@ struct cipher_testvec bf_cbc_dec_tv_template[] = { #define TF_CBC_ENC_TEST_VECTORS 4 #define TF_CBC_DEC_TEST_VECTORS 4 -struct cipher_testvec tf_enc_tv_template[] = { +static struct cipher_testvec tf_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1312,7 +1312,7 @@ struct cipher_testvec tf_enc_tv_template[] = { }, }; -struct cipher_testvec tf_dec_tv_template[] = { +static struct cipher_testvec tf_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1345,7 +1345,7 @@ struct cipher_testvec tf_dec_tv_template[] = { }, }; -struct cipher_testvec tf_cbc_enc_tv_template[] = { +static struct cipher_testvec tf_cbc_enc_tv_template[] = { { /* Generated with Nettle */ .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1391,7 +1391,7 @@ struct cipher_testvec tf_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec tf_cbc_dec_tv_template[] = { +static struct cipher_testvec tf_cbc_dec_tv_template[] = { { /* Reverse of the first four above */ .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1444,7 +1444,10 @@ struct cipher_testvec tf_cbc_dec_tv_template[] = { #define SERPENT_ENC_TEST_VECTORS 4 #define SERPENT_DEC_TEST_VECTORS 4 -struct cipher_testvec serpent_enc_tv_template[] = +#define TNEPRES_ENC_TEST_VECTORS 4 +#define TNEPRES_DEC_TEST_VECTORS 4 + +static struct cipher_testvec serpent_enc_tv_template[] = { { .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -1486,7 +1489,58 @@ struct cipher_testvec serpent_enc_tv_template[] = }, }; -struct cipher_testvec serpent_dec_tv_template[] = +static struct cipher_testvec tnepres_enc_tv_template[] = +{ + { /* KeySize=128, PT=0, I=1 */ + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 16, + .ilen = 16, + .result = { 0x49, 0xaf, 0xbf, 0xad, 0x9d, 0x5a, 0x34, 0x05, + 0x2c, 0xd8, 0xff, 0xa5, 0x98, 0x6b, 0xd2, 0xdd }, + .rlen = 16, + }, { /* KeySize=192, PT=0, I=1 */ + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 24, + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .ilen = 16, + .result = { 0xe7, 0x8e, 0x54, 0x02, 0xc7, 0x19, 0x55, 0x68, + 0xac, 0x36, 0x78, 0xf7, 0xa3, 0xf6, 0x0c, 0x66 }, + .rlen = 16, + }, { /* KeySize=256, PT=0, I=1 */ + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 32, + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .ilen = 16, + .result = { 0xab, 0xed, 0x96, 0xe7, 0x66, 0xbf, 0x28, 0xcb, + 0xc0, 0xeb, 0xd2, 0x1a, 0x82, 0xef, 0x08, 0x19 }, + .rlen = 16, + }, { /* KeySize=256, I=257 */ + .key = { 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, + 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }, + .klen = 32, + .input = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }, + .ilen = 16, + .result = { 0x5c, 0xe7, 0x1c, 0x70, 0xd2, 0x88, 0x2e, 0x5b, + 0xb8, 0x32, 0xe4, 0x33, 0xf8, 0x9f, 0x26, 0xde }, + .rlen = 16, + }, +}; + + +static struct cipher_testvec serpent_dec_tv_template[] = { { .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47, @@ -1528,11 +1582,54 @@ struct cipher_testvec serpent_dec_tv_template[] = }, }; +static struct cipher_testvec tnepres_dec_tv_template[] = +{ + { + .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97, + 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { + .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .klen = 16, + .input = { 0xea, 0xf4, 0xd7, 0xfc, 0xd8, 0x01, 0x34, 0x47, + 0x81, 0x45, 0x0b, 0xfa, 0x0c, 0xd6, 0xad, 0x6e }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { + .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, + .klen = 32, + .input = { 0x64, 0xa9, 0x1a, 0x37, 0xed, 0x9f, 0xe7, 0x49, + 0xa8, 0x4e, 0x76, 0xd6, 0xf5, 0x0d, 0x78, 0xee }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { /* KeySize=128, I=121 */ + .key = { [15] = 0x80 }, + .klen = 16, + .input = { 0x3d, 0xda, 0xbf, 0xc0, 0x06, 0xda, 0xab, 0x06, + 0x46, 0x2a, 0xf4, 0xef, 0x81, 0x54, 0x4e, 0x26 }, + .ilen = 16, + .result = { [0 ... 15] = 0x00 }, + .rlen = 16, + }, +}; + + /* Cast6 test vectors from RFC 2612 */ #define CAST6_ENC_TEST_VECTORS 3 #define CAST6_DEC_TEST_VECTORS 3 -struct cipher_testvec cast6_enc_tv_template[] = +static struct cipher_testvec cast6_enc_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, @@ -1567,7 +1664,7 @@ struct cipher_testvec cast6_enc_tv_template[] = }, }; -struct cipher_testvec cast6_dec_tv_template[] = +static struct cipher_testvec cast6_dec_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, @@ -1609,7 +1706,7 @@ struct cipher_testvec cast6_dec_tv_template[] = #define AES_ENC_TEST_VECTORS 3 #define AES_DEC_TEST_VECTORS 3 -struct cipher_testvec aes_enc_tv_template[] = { +static struct cipher_testvec aes_enc_tv_template[] = { { /* From FIPS-197 */ .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -1646,7 +1743,7 @@ struct cipher_testvec aes_enc_tv_template[] = { }, }; -struct cipher_testvec aes_dec_tv_template[] = { +static struct cipher_testvec aes_dec_tv_template[] = { { /* From FIPS-197 */ .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -1687,7 +1784,7 @@ struct cipher_testvec aes_dec_tv_template[] = { #define CAST5_ENC_TEST_VECTORS 3 #define CAST5_DEC_TEST_VECTORS 3 -struct cipher_testvec cast5_enc_tv_template[] = +static struct cipher_testvec cast5_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, @@ -1715,7 +1812,7 @@ struct cipher_testvec cast5_enc_tv_template[] = }, }; -struct cipher_testvec cast5_dec_tv_template[] = +static struct cipher_testvec cast5_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, @@ -1749,7 +1846,7 @@ struct cipher_testvec cast5_dec_tv_template[] = #define ARC4_ENC_TEST_VECTORS 7 #define ARC4_DEC_TEST_VECTORS 7 -struct cipher_testvec arc4_enc_tv_template[] = +static struct cipher_testvec arc4_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, @@ -1816,7 +1913,7 @@ struct cipher_testvec arc4_enc_tv_template[] = }, }; -struct cipher_testvec arc4_dec_tv_template[] = +static struct cipher_testvec arc4_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, @@ -1889,7 +1986,7 @@ struct cipher_testvec arc4_dec_tv_template[] = #define TEA_ENC_TEST_VECTORS 4 #define TEA_DEC_TEST_VECTORS 4 -struct cipher_testvec tea_enc_tv_template[] = +static struct cipher_testvec tea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -1933,7 +2030,7 @@ struct cipher_testvec tea_enc_tv_template[] = } }; -struct cipher_testvec tea_dec_tv_template[] = +static struct cipher_testvec tea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -1983,7 +2080,7 @@ struct cipher_testvec tea_dec_tv_template[] = #define XTEA_ENC_TEST_VECTORS 4 #define XTEA_DEC_TEST_VECTORS 4 -struct cipher_testvec xtea_enc_tv_template[] = +static struct cipher_testvec xtea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -2027,7 +2124,7 @@ struct cipher_testvec xtea_enc_tv_template[] = } }; -struct cipher_testvec xtea_dec_tv_template[] = +static struct cipher_testvec xtea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -2077,7 +2174,7 @@ struct cipher_testvec xtea_dec_tv_template[] = #define KHAZAD_ENC_TEST_VECTORS 5 #define KHAZAD_DEC_TEST_VECTORS 5 -struct cipher_testvec khazad_enc_tv_template[] = { +static struct cipher_testvec khazad_enc_tv_template[] = { { .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, @@ -2123,7 +2220,7 @@ struct cipher_testvec khazad_enc_tv_template[] = { }, }; -struct cipher_testvec khazad_dec_tv_template[] = { +static struct cipher_testvec khazad_dec_tv_template[] = { { .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, @@ -2169,6 +2266,211 @@ struct cipher_testvec khazad_dec_tv_template[] = { }, }; +/* + * Anubis test vectors. + */ + +#define ANUBIS_ENC_TEST_VECTORS 5 +#define ANUBIS_DEC_TEST_VECTORS 5 +#define ANUBIS_CBC_ENC_TEST_VECTORS 2 +#define ANUBIS_CBC_DEC_TEST_VECTORS 2 + +static struct cipher_testvec anubis_enc_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .ilen = 16, + .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 }, + .rlen = 16, + }, { + + .key = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03 }, + .klen = 20, + .input = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .ilen = 16, + .result = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49, + 0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae }, + .rlen = 16, + }, { + .key = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24 }, + .klen = 28, + .input = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + .ilen = 16, + .result = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d, + 0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde }, + .rlen = 16, + }, { + .key = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .klen = 32, + .input = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .ilen = 16, + .result = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4, + 0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe }, + .rlen = 16, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .ilen = 16, + .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee }, + .rlen = 16, + }, +}; + +static struct cipher_testvec anubis_dec_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 }, + .ilen = 16, + .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .rlen = 16, + }, { + + .key = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03 }, + .klen = 20, + .input = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49, + 0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae }, + .ilen = 16, + .result = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .rlen = 16, + }, { + .key = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24 }, + .klen = 28, + .input = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d, + 0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde }, + .ilen = 16, + .result = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + .rlen = 16, + }, { + .key = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .klen = 32, + .input = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4, + 0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe }, + .ilen = 16, + .result = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .rlen = 16, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .input = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee }, + .klen = 40, + .ilen = 16, + .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .rlen = 16, + }, +}; + +static struct cipher_testvec anubis_cbc_enc_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .ilen = 32, + .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90, + 0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66, + 0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe }, + .rlen = 32, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .ilen = 32, + .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee, + 0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75, + 0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 }, + .rlen = 32, + }, +}; + +static struct cipher_testvec anubis_cbc_dec_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90, + 0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66, + 0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe }, + .ilen = 32, + .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .rlen = 32, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee, + 0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75, + 0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 }, + .ilen = 32, + .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .rlen = 32, + }, +}; + /* * Compression stuff. */ @@ -2187,7 +2489,7 @@ struct comp_testvec { #define DEFLATE_COMP_TEST_VECTORS 2 #define DEFLATE_DECOMP_TEST_VECTORS 2 -struct comp_testvec deflate_comp_tv_template[] = { +static struct comp_testvec deflate_comp_tv_template[] = { { .inlen = 70, .outlen = 38, @@ -2223,7 +2525,7 @@ struct comp_testvec deflate_comp_tv_template[] = { }, }; -struct comp_testvec deflate_decomp_tv_template[] = { +static struct comp_testvec deflate_decomp_tv_template[] = { { .inlen = 122, .outlen = 191, @@ -2264,7 +2566,7 @@ struct comp_testvec deflate_decomp_tv_template[] = { */ #define MICHAEL_MIC_TEST_VECTORS 6 -struct hash_testvec michael_mic_tv_template[] = +static struct hash_testvec michael_mic_tv_template[] = { { .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, diff --git a/drivers/Kconfig b/drivers/Kconfig index 3270c2a3a..ed41d9036 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -54,4 +54,8 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" +source "drivers/mmc/Kconfig" + +source "drivers/infiniband/Kconfig" + endmenu diff --git a/drivers/Makefile b/drivers/Makefile index dfaafd02f..04fba9e50 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -17,8 +17,9 @@ obj-$(CONFIG_PNP) += pnp/ # default. obj-y += char/ -# i810fb depends on char/agp/ +# i810fb and intelfb depend on char/agp/ obj-$(CONFIG_FB_I810) += video/i810/ +obj-$(CONFIG_FB_INTEL) += video/intelfb/ # we also need input/serio early so serio bus is initialized by the time # serial drivers start registering their serio ports @@ -36,11 +37,12 @@ obj-$(CONFIG_FUSION) += message/ obj-$(CONFIG_IEEE1394) += ieee1394/ obj-y += cdrom/ obj-$(CONFIG_MTD) += mtd/ -obj-$(CONFIG_PCMCIA) += pcmcia/ +obj-$(CONFIG_PCCARD) += pcmcia/ obj-$(CONFIG_DIO) += dio/ obj-$(CONFIG_SBUS) += sbus/ obj-$(CONFIG_ZORRO) += zorro/ obj-$(CONFIG_MAC) += macintosh/ +obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_USB) += usb/ @@ -58,4 +60,6 @@ obj-$(CONFIG_MCA) += mca/ obj-$(CONFIG_EISA) += eisa/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_MMC) += mmc/ +obj-$(CONFIG_INFINIBAND) += infiniband/ obj-y += firmware/ +obj-$(CONFIG_CRYPTO) += crypto/ diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index 0e7a399d2..3cd2e968e 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c @@ -138,9 +138,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -1522,7 +1522,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) int fd1772_init(void) { - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); int i, err = -ENOMEM; if (!machine_is_archimedes()) diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c index 45779b6bb..4b65f74d6 100644 --- a/drivers/acorn/block/mfmhd.c +++ b/drivers/acorn/block/mfmhd.c @@ -124,7 +124,7 @@ static void (*do_mfm)(void) = NULL; static struct request_queue *mfm_queue; -static spinlock_t mfm_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mfm_lock); #define MAJOR_NR MFM_ACORN_MAJOR #define QUEUE (mfm_queue) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 96e4fafb0..76d3f2b14 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -20,7 +20,7 @@ config ACPI kernel by about 70K. Linux ACPI provides a robust functional replacement for several - legacy configuration and power management intefaces, including + legacy configuration and power management interfaces, including the Plug-and-Play BIOS specification (PnP BIOS), the MultiProcessor Specification (MPS), and the Advanced Power Management (APM) specification. If both ACPI and APM support @@ -110,6 +110,21 @@ config ACPI_BUTTON down the system. Until then, you can cat it, and see output when a button is pressed. +config ACPI_VIDEO + tristate "Video" + depends on ACPI_INTERPRETER + depends on EXPERIMENTAL + depends on !IA64_SGI_SN + default m + help + This driver implement the ACPI Extensions For Display Adapters + for integrated graphics devices on motherboard, as specified in + ACPI 2.0 Specification, Appendix B, allowing to perform some basic + control like defining the video POST device, retrieving EDID information + or to setup a video output, etc. + Note that this is an ref. implementation only. It may or may not work + for your integrated video device. + config ACPI_FAN tristate "Fan" depends on ACPI_INTERPRETER @@ -129,6 +144,15 @@ config ACPI_PROCESSOR ACPI C2 and C3 processor states to save power, on systems that support it. +config ACPI_HOTPLUG_CPU + bool "Processor Hotplug (EXPERIMENTAL)" + depends on ACPI_PROCESSOR && HOTPLUG_CPU && EXPERIMENTAL + depends on !IA64_SGI_SN + select ACPI_CONTAINER + default n + ---help--- + Select this option if your platform support physical CPU hotplug. + config ACPI_THERMAL tristate "Thermal Zone" depends on ACPI_PROCESSOR @@ -143,7 +167,7 @@ config ACPI_NUMA bool "NUMA support" depends on ACPI_INTERPRETER depends on NUMA - depends on IA64 + depends on (IA64 || X86_64) default y if IA64_GENERIC || IA64_SGI_SN2 config ACPI_ASUS @@ -176,6 +200,20 @@ config ACPI_ASUS something works not quite as expected, please use the mailing list available on the above page (acpi4asus-user@lists.sourceforge.net) +config ACPI_IBM + tristate "IBM ThinkPad Laptop Extras" + depends on X86 + depends on ACPI_INTERPRETER + default m + ---help--- + This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds + support for Fn-Fx key combinations, Bluetooth control, video + output switching, ThinkLight control, UltraBay eject and more. + For more information about this driver see + and . + + If you have an IBM ThinkPad laptop, say Y or M here. + config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" depends on X86 @@ -206,7 +244,7 @@ config ACPI_TOSHIBA config ACPI_CUSTOM_DSDT bool "Include Custom DSDT" - depends on X86 && ACPI_INTERPRETER && !STANDALONE + depends on ACPI_INTERPRETER && !STANDALONE default n help Thist option is to load a custom ACPI DSDT @@ -221,6 +259,7 @@ config ACPI_CUSTOM_DSDT_FILE config ACPI_BLACKLIST_YEAR int "Disable ACPI for systems before Jan 1st this year" + depends on ACPI_INTERPRETER default 0 help enter a 4-digit year, eg. 2001 to disable ACPI by default @@ -296,5 +335,12 @@ config X86_PM_TIMER kernel logs, and/or you are using this on a notebook which does not yet have an HPET, you should say "Y" here. -endmenu +config ACPI_CONTAINER + tristate "ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)" + depends on ACPI && EXPERIMENTAL + default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_CPU || ACPI_HOTPLUG_IO) + ---help--- + This is the ACPI generic container driver which supports + ACPI0004, PNP0A05 and PNP0A06 devices +endmenu diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index bcc35ca79..1ae0d89c2 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -12,8 +12,6 @@ endif EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-$(CONFIG_ACPI) := acpi_ksyms.o - # # ACPI Boot-Time Table Parsing # @@ -31,6 +29,12 @@ obj-$(CONFIG_ACPI_INTERPRETER) += osl.o utils.o \ # # ACPI Bus and Device Drivers # +processor-objs += processor_core.o processor_throttling.o \ + processor_idle.o processor_thermal.o +ifdef CONFIG_CPU_FREQ +processor-objs += processor_perflib.o +endif + obj-$(CONFIG_ACPI_BUS) += sleep/ obj-$(CONFIG_ACPI_BUS) += bus.o obj-$(CONFIG_ACPI_AC) += ac.o @@ -38,13 +42,16 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_EC) += ec.o obj-$(CONFIG_ACPI_FAN) += fan.o +obj-$(CONFIG_ACPI_VIDEO) += video.o obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o obj-$(CONFIG_ACPI_POWER) += power.o obj-$(CONFIG_ACPI_PROCESSOR) += processor.o +obj-$(CONFIG_ACPI_CONTAINER) += container.o obj-$(CONFIG_ACPI_THERMAL) += thermal.o obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o +obj-$(CONFIG_ACPI_IBM) += ibm_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_BUS) += scan.o motherboard.o diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 7333d5ffc..e0f498c7b 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -117,11 +117,11 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset) ACPI_FUNCTION_TRACE("acpi_ac_seq_show"); if (!ac) - return 0; + return_VALUE(0); if (acpi_ac_get_state(ac)) { seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); - return 0; + return_VALUE(0); } seq_puts(seq, "state: "); @@ -137,7 +137,7 @@ int acpi_ac_seq_show(struct seq_file *seq, void *offset) break; } - return 0; + return_VALUE(0); } static int acpi_ac_open_fs(struct inode *inode, struct file *file) @@ -212,7 +212,7 @@ acpi_ac_notify ( ACPI_FUNCTION_TRACE("acpi_ac_notify"); if (!ac) - return; + return_VOID; if (acpi_bus_get_device(ac->handle, &device)) return_VOID; diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index f2ca51bef..a75cb565c 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c @@ -78,9 +78,9 @@ MODULE_LICENSE("GPL"); static uid_t asus_uid; static gid_t asus_gid; -MODULE_PARM(asus_uid, "i"); +module_param(asus_uid, uint, 0); MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n"); -MODULE_PARM(asus_gid, "i"); +module_param(asus_gid, uint, 0); MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n"); @@ -866,7 +866,7 @@ static int __init asus_hotk_add_fs(struct acpi_device *device) acpi_device_dir(device) = asus_proc_dir; if (!acpi_device_dir(device)) - return(-ENODEV); + return -ENODEV; proc = create_proc_entry(PROC_INFO, mode, acpi_device_dir(device)); if (proc) { @@ -1098,16 +1098,16 @@ static int __init asus_hotk_check(void) result = acpi_bus_get_status(hotk->device); if (result) - return(result); + return result; if (hotk->device->status.present) { result = asus_hotk_get_info(); } else { printk(KERN_ERR " Hotkey device not present, aborting\n"); - return(-EINVAL); + return -EINVAL; } - return(result); + return result; } @@ -1117,7 +1117,7 @@ static int __init asus_hotk_add(struct acpi_device *device) int result; if (!device) - return(-EINVAL); + return -EINVAL; printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", ASUS_ACPI_VERSION); @@ -1125,7 +1125,7 @@ static int __init asus_hotk_add(struct acpi_device *device) hotk = (struct asus_hotk *) kmalloc(sizeof(struct asus_hotk), GFP_KERNEL); if (!hotk) - return(-ENOMEM); + return -ENOMEM; memset(hotk, 0, sizeof(struct asus_hotk)); hotk->handle = device->handle; @@ -1173,7 +1173,7 @@ static int __init asus_hotk_add(struct acpi_device *device) kfree(hotk); } - return(result); + return result; } @@ -1182,7 +1182,7 @@ static int asus_hotk_remove(struct acpi_device *device, int type) acpi_status status = 0; if (!device || !acpi_driver_data(device)) - return(-EINVAL); + return -EINVAL; status = acpi_remove_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY, asus_hotk_notify); @@ -1193,7 +1193,7 @@ static int asus_hotk_remove(struct acpi_device *device, int type) kfree(hotk); - return(0); + return 0; } diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index f6218dd8f..a10de067d 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -341,32 +342,22 @@ acpi_battery_check ( -------------------------------------------------------------------------- */ struct proc_dir_entry *acpi_battery_dir; - -static int -acpi_battery_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +static int acpi_battery_read_info(struct seq_file *seq, void *offset) { int result = 0; - struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_battery *battery = (struct acpi_battery *) seq->private; struct acpi_battery_info *bif = NULL; char *units = "?"; - char *p = page; - int len = 0; ACPI_FUNCTION_TRACE("acpi_battery_read_info"); - if (!battery || (off != 0)) + if (!battery) goto end; if (battery->flags.present) - p += sprintf(p, "present: yes\n"); + seq_printf(seq, "present: yes\n"); else { - p += sprintf(p, "present: no\n"); + seq_printf(seq, "present: no\n"); goto end; } @@ -374,98 +365,88 @@ acpi_battery_read_info ( result = acpi_battery_get_info(battery, &bif); if (result || !bif) { - p += sprintf(p, "ERROR: Unable to read battery information\n"); + seq_printf(seq, "ERROR: Unable to read battery information\n"); goto end; } units = bif->power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "design capacity: unknown\n"); + seq_printf(seq, "design capacity: unknown\n"); else - p += sprintf(p, "design capacity: %d %sh\n", + seq_printf(seq, "design capacity: %d %sh\n", (u32) bif->design_capacity, units); if (bif->last_full_capacity == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "last full capacity: unknown\n"); + seq_printf(seq, "last full capacity: unknown\n"); else - p += sprintf(p, "last full capacity: %d %sh\n", + seq_printf(seq, "last full capacity: %d %sh\n", (u32) bif->last_full_capacity, units); switch ((u32) bif->battery_technology) { case 0: - p += sprintf(p, "battery technology: non-rechargeable\n"); + seq_printf(seq, "battery technology: non-rechargeable\n"); break; case 1: - p += sprintf(p, "battery technology: rechargeable\n"); + seq_printf(seq, "battery technology: rechargeable\n"); break; default: - p += sprintf(p, "battery technology: unknown\n"); + seq_printf(seq, "battery technology: unknown\n"); break; } if (bif->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "design voltage: unknown\n"); + seq_printf(seq, "design voltage: unknown\n"); else - p += sprintf(p, "design voltage: %d mV\n", + seq_printf(seq, "design voltage: %d mV\n", (u32) bif->design_voltage); - p += sprintf(p, "design capacity warning: %d %sh\n", + seq_printf(seq, "design capacity warning: %d %sh\n", (u32) bif->design_capacity_warning, units); - p += sprintf(p, "design capacity low: %d %sh\n", + seq_printf(seq, "design capacity low: %d %sh\n", (u32) bif->design_capacity_low, units); - p += sprintf(p, "capacity granularity 1: %d %sh\n", + seq_printf(seq, "capacity granularity 1: %d %sh\n", (u32) bif->battery_capacity_granularity_1, units); - p += sprintf(p, "capacity granularity 2: %d %sh\n", + seq_printf(seq, "capacity granularity 2: %d %sh\n", (u32) bif->battery_capacity_granularity_2, units); - p += sprintf(p, "model number: %s\n", + seq_printf(seq, "model number: %s\n", bif->model_number); - p += sprintf(p, "serial number: %s\n", + seq_printf(seq, "serial number: %s\n", bif->serial_number); - p += sprintf(p, "battery type: %s\n", + seq_printf(seq, "battery type: %s\n", bif->battery_type); - p += sprintf(p, "OEM info: %s\n", + seq_printf(seq, "OEM info: %s\n", bif->oem_info); end: kfree(bif); - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; + return_VALUE(0); +} - return_VALUE(len); +static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_battery_read_info, PDE(inode)->data); } static int -acpi_battery_read_state ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +acpi_battery_read_state (struct seq_file *seq, void *offset) { int result = 0; - struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_battery *battery = (struct acpi_battery *) seq->private; struct acpi_battery_status *bst = NULL; char *units = "?"; - char *p = page; - int len = 0; ACPI_FUNCTION_TRACE("acpi_battery_read_state"); - if (!battery || (off != 0)) + if (!battery) goto end; if (battery->flags.present) - p += sprintf(p, "present: yes\n"); + seq_printf(seq, "present: yes\n"); else { - p += sprintf(p, "present: no\n"); + seq_printf(seq, "present: no\n"); goto end; } @@ -477,81 +458,71 @@ acpi_battery_read_state ( result = acpi_battery_get_status(battery, &bst); if (result || !bst) { - p += sprintf(p, "ERROR: Unable to read battery status\n"); + seq_printf(seq, "ERROR: Unable to read battery status\n"); goto end; } if (!(bst->state & 0x04)) - p += sprintf(p, "capacity state: ok\n"); + seq_printf(seq, "capacity state: ok\n"); else - p += sprintf(p, "capacity state: critical\n"); + seq_printf(seq, "capacity state: critical\n"); if ((bst->state & 0x01) && (bst->state & 0x02)){ - p += sprintf(p, "charging state: charging/discharging\n"); + seq_printf(seq, "charging state: charging/discharging\n"); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Battery Charging and Discharging?\n")); } else if (bst->state & 0x01) - p += sprintf(p, "charging state: discharging\n"); + seq_printf(seq, "charging state: discharging\n"); else if (bst->state & 0x02) - p += sprintf(p, "charging state: charging\n"); + seq_printf(seq, "charging state: charging\n"); else { - p += sprintf(p, "charging state: charged\n"); + seq_printf(seq, "charging state: charged\n"); } if (bst->present_rate == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "present rate: unknown\n"); + seq_printf(seq, "present rate: unknown\n"); else - p += sprintf(p, "present rate: %d %s\n", + seq_printf(seq, "present rate: %d %s\n", (u32) bst->present_rate, units); if (bst->remaining_capacity == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "remaining capacity: unknown\n"); + seq_printf(seq, "remaining capacity: unknown\n"); else - p += sprintf(p, "remaining capacity: %d %sh\n", + seq_printf(seq, "remaining capacity: %d %sh\n", (u32) bst->remaining_capacity, units); if (bst->present_voltage == ACPI_BATTERY_VALUE_UNKNOWN) - p += sprintf(p, "present voltage: unknown\n"); + seq_printf(seq, "present voltage: unknown\n"); else - p += sprintf(p, "present voltage: %d mV\n", + seq_printf(seq, "present voltage: %d mV\n", (u32) bst->present_voltage); end: kfree(bst); - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; + return_VALUE(0); +} - return_VALUE(len); +static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_battery_read_state, PDE(inode)->data); } static int -acpi_battery_read_alarm ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +acpi_battery_read_alarm (struct seq_file *seq, void *offset) { - struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_battery *battery = (struct acpi_battery *) seq->private; char *units = "?"; - char *p = page; - int len = 0; ACPI_FUNCTION_TRACE("acpi_battery_read_alarm"); - if (!battery || (off != 0)) + if (!battery) goto end; if (!battery->flags.present) { - p += sprintf(p, "present: no\n"); + seq_printf(seq, "present: no\n"); goto end; } @@ -561,34 +532,28 @@ acpi_battery_read_alarm ( /* Battery Alarm */ - p += sprintf(p, "alarm: "); + seq_printf(seq, "alarm: "); if (!battery->alarm) - p += sprintf(p, "unsupported\n"); + seq_printf(seq, "unsupported\n"); else - p += sprintf(p, "%d %sh\n", (u32) battery->alarm, units); + seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units); end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return_VALUE(len); + return_VALUE(0); } -static int +static ssize_t acpi_battery_write_alarm ( - struct file *file, - const char __user *buffer, - unsigned long count, - void *data) + struct file *file, + const char __user *buffer, + size_t count, + loff_t *ppos) { int result = 0; - struct acpi_battery *battery = (struct acpi_battery *) data; char alarm_string[12] = {'\0'}; + struct seq_file *m = (struct seq_file *)file->private_data; + struct acpi_battery *battery = (struct acpi_battery *)m->private; ACPI_FUNCTION_TRACE("acpi_battery_write_alarm"); @@ -611,6 +576,35 @@ acpi_battery_write_alarm ( return_VALUE(count); } +static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); +} + +static struct file_operations acpi_battery_info_ops = { + .open = acpi_battery_info_open_fs, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; + +static struct file_operations acpi_battery_state_ops = { + .open = acpi_battery_state_open_fs, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; + +static struct file_operations acpi_battery_alarm_ops = { + .open = acpi_battery_alarm_open_fs, + .read = seq_read, + .write = acpi_battery_write_alarm, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; static int acpi_battery_add_fs ( @@ -636,7 +630,7 @@ acpi_battery_add_fs ( "Unable to create '%s' fs entry\n", ACPI_BATTERY_FILE_INFO)); else { - entry->read_proc = acpi_battery_read_info; + entry->proc_fops = &acpi_battery_info_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } @@ -649,7 +643,7 @@ acpi_battery_add_fs ( "Unable to create '%s' fs entry\n", ACPI_BATTERY_FILE_STATUS)); else { - entry->read_proc = acpi_battery_read_state; + entry->proc_fops = &acpi_battery_state_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } @@ -662,8 +656,7 @@ acpi_battery_add_fs ( "Unable to create '%s' fs entry\n", ACPI_BATTERY_FILE_ALARM)); else { - entry->read_proc = acpi_battery_read_alarm; - entry->write_proc = acpi_battery_write_alarm; + entry->proc_fops = &acpi_battery_alarm_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 4c303e19e..4edff1738 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -22,6 +22,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include #include #include #include @@ -44,8 +45,11 @@ extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger); #endif FADT_DESCRIPTOR acpi_fadt; +EXPORT_SYMBOL(acpi_fadt); + struct acpi_device *acpi_root; struct proc_dir_entry *acpi_root_dir; +EXPORT_SYMBOL(acpi_root_dir); #define STRUCT_TO_INT(s) (*((int*)&s)) @@ -53,10 +57,6 @@ struct proc_dir_entry *acpi_root_dir; Device Management -------------------------------------------------------------------------- */ -extern void acpi_bus_data_handler ( - acpi_handle handle, - u32 function, - void *context); int acpi_bus_get_device ( acpi_handle handle, @@ -73,13 +73,14 @@ acpi_bus_get_device ( status = acpi_get_data(handle, acpi_bus_data_handler, (void**) device); if (ACPI_FAILURE(status) || !*device) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context for object [%p]\n", + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n", handle)); return_VALUE(-ENODEV); } return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_get_device); int acpi_bus_get_status ( @@ -125,6 +126,7 @@ acpi_bus_get_status ( return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_get_status); /* -------------------------------------------------------------------------- @@ -182,6 +184,7 @@ acpi_bus_get_power ( return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_get_power); int @@ -270,6 +273,7 @@ end: return_VALUE(result); } +EXPORT_SYMBOL(acpi_bus_set_power); @@ -277,7 +281,7 @@ end: Event Management -------------------------------------------------------------------------- */ -static spinlock_t acpi_bus_event_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(acpi_bus_event_lock); LIST_HEAD(acpi_bus_event_list); DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue); @@ -319,6 +323,7 @@ acpi_bus_generate_event ( return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_generate_event); int acpi_bus_receive_event ( @@ -332,7 +337,7 @@ acpi_bus_receive_event ( ACPI_FUNCTION_TRACE("acpi_bus_receive_event"); if (!event) - return -EINVAL; + return_VALUE(-EINVAL); if (list_empty(&acpi_bus_event_list)) { @@ -364,6 +369,7 @@ acpi_bus_receive_event ( return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_receive_event); /* -------------------------------------------------------------------------- @@ -599,7 +605,7 @@ acpi_early_init (void) ACPI_FUNCTION_TRACE("acpi_early_init"); if (acpi_disabled) - return; + return_VOID; /* enable workarounds, unless strict ACPI spec. compliance */ if (!acpi_strict) @@ -652,11 +658,11 @@ acpi_early_init (void) goto error0; } - return; + return_VOID; error0: disable_acpi(); - return; + return_VOID; } static int __init @@ -743,7 +749,7 @@ static int __init acpi_init (void) if (acpi_disabled) { printk(KERN_INFO PREFIX "Interpreter disabled.\n"); - return -ENODEV; + return_VALUE(-ENODEV); } firmware_register(&acpi_subsys); diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index b632b93af..31aded126 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -116,12 +116,12 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) ACPI_FUNCTION_TRACE("acpi_button_info_seq_show"); if (!button || !button->device) - return 0; + return_VALUE(0); seq_printf(seq, "type: %s\n", acpi_device_name(button->device)); - return 0; + return_VALUE(0); } static int acpi_button_info_open_fs(struct inode *inode, struct file *file) @@ -138,7 +138,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) ACPI_FUNCTION_TRACE("acpi_button_state_seq_show"); if (!button || !button->device) - return 0; + return_VALUE(0); status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state); if (ACPI_FAILURE(status)) { @@ -148,7 +148,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "state: %s\n", (state ? "open" : "closed")); } - return 0; + return_VALUE(0); } static int acpi_button_state_open_fs(struct inode *inode, struct file *file) diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index 9fb8caedb..d947e2a0a 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c @@ -4,9 +4,12 @@ #include #include +#include +#include #include #include #include +#include #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME ("debug") @@ -87,7 +90,6 @@ const struct acpi_dlevel acpi_debug_levels[] = ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES), ACPI_DEBUG_INIT(ACPI_LV_EVENTS), }; -#define NUM_OF(v) ( sizeof(v)/sizeof(v[0]) ) static int acpi_system_read_debug ( @@ -100,7 +102,7 @@ acpi_system_read_debug ( { char *p = page; int size = 0; - int i; + unsigned int i; if (off != 0) goto end; @@ -109,7 +111,7 @@ acpi_system_read_debug ( switch ((unsigned long) data) { case 0: - for (i = 0; i < NUM_OF(acpi_debug_layers); i++) { + for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) { p += sprintf(p, "%-25s\t0x%08lX [%c]\n", acpi_debug_layers[i].name, acpi_debug_layers[i].value, @@ -126,7 +128,7 @@ acpi_system_read_debug ( acpi_dbg_layer); break; case 1: - for (i = 0; i < NUM_OF(acpi_debug_levels); i++) { + for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) { p += sprintf(p, "%-25s\t0x%08lX [%c]\n", acpi_debug_levels[i].name, acpi_debug_levels[i].value, diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c index e99e296ce..2779211be 100644 --- a/drivers/acpi/dispatcher/dsfield.c +++ b/drivers/acpi/dispatcher/dsfield.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c index ee474a5d4..b4d264dbb 100644 --- a/drivers/acpi/dispatcher/dsinit.c +++ b/drivers/acpi/dispatcher/dsinit.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index 4fd369018..fac39ba4a 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c index befe750a7..f31d095f9 100644 --- a/drivers/acpi/dispatcher/dsmthdat.c +++ b/drivers/acpi/dispatcher/dsmthdat.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -312,7 +312,7 @@ acpi_ds_method_data_set_value ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "obj %p op %X, ref count = %d [%s]\n", object, + "new_obj %p Opcode %X, Refs=%d [%s]\n", object, opcode, object->common.reference_count, acpi_ut_get_type_name (object->common.type))); @@ -350,7 +350,7 @@ acpi_ds_method_data_set_value ( * RETURN: Data type of current value of the selected Arg or Local * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_object_type acpi_ds_method_data_get_type ( u16 opcode, @@ -385,6 +385,7 @@ acpi_ds_method_data_get_type ( return_VALUE (ACPI_GET_OBJECT_TYPE (object)); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -448,7 +449,22 @@ acpi_ds_method_data_get_value ( * was referenced by the method (via the ASL) * before it was initialized. Either case is an error. */ - switch (opcode) { + + /* If slack enabled, init the local_x/arg_x to an Integer of value zero */ + + if (acpi_gbl_enable_interpreter_slack) { + object = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!object) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + object->integer.value = 0; + node->object = object; + } + + /* Otherwise, return the error */ + + else switch (opcode) { case AML_ARG_OP: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n", @@ -572,7 +588,7 @@ acpi_ds_store_object_to_local ( ACPI_FUNCTION_TRACE ("ds_store_object_to_local"); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%X Index=%d Obj=%p\n", opcode, index, obj_desc)); /* Parameter validation */ diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c index e40563950..eb8af4785 100644 --- a/drivers/acpi/dispatcher/dsobject.c +++ b/drivers/acpi/dispatcher/dsobject.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -516,7 +516,7 @@ acpi_ds_init_object_from_op ( case AML_REVISION_OP: - obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL; + obj_desc->integer.value = ACPI_CA_VERSION; break; default: diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c index 68084760e..66fc7549c 100644 --- a/drivers/acpi/dispatcher/dsopcode.c +++ b/drivers/acpi/dispatcher/dsopcode.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -762,9 +762,8 @@ acpi_ds_eval_region_operands ( * * RETURN: Status * - * DESCRIPTION: Get the operands and complete the following data objec types: - * Buffer - * Package + * DESCRIPTION: Get the operands and complete the following data object types: + * Buffer, Package. * ****************************************************************************/ diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c index 24462789a..df6b00186 100644 --- a/drivers/acpi/dispatcher/dsutils.c +++ b/drivers/acpi/dispatcher/dsutils.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -88,11 +88,13 @@ acpi_ds_is_result_used ( } /* - * If there is no parent, we are executing at the method level. - * An executing method typically has no parent, since each method - * is parsed separately. + * If there is no parent, or the parent is a scope_op, we are executing + * at the method level. An executing method typically has no parent, + * since each method is parsed separately. A method invoked externally + * via execute_control_method has a scope_op as the parent. */ - if (!op->common.parent) { + if ((!op->common.parent) || + (op->common.parent->common.aml_opcode == AML_SCOPE_OP)) { /* * If this is the last statement in the method, we know it is not a * Return() operator (would not come here.) The following code is the @@ -333,7 +335,7 @@ acpi_ds_clear_operands ( u32 i; - ACPI_FUNCTION_TRACE_PTR ("acpi_ds_clear_operands", walk_state); + ACPI_FUNCTION_TRACE_PTR ("ds_clear_operands", walk_state); /* diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c index 02872ca22..b02322e21 100644 --- a/drivers/acpi/dispatcher/dswexec.c +++ b/drivers/acpi/dispatcher/dswexec.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,17 +60,18 @@ * Dispatch table for opcode classes */ static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = { - acpi_ex_opcode_1A_0T_0R, - acpi_ex_opcode_1A_0T_1R, - acpi_ex_opcode_1A_1T_0R, - acpi_ex_opcode_1A_1T_1R, - acpi_ex_opcode_2A_0T_0R, - acpi_ex_opcode_2A_0T_1R, - acpi_ex_opcode_2A_1T_1R, - acpi_ex_opcode_2A_2T_1R, - acpi_ex_opcode_3A_0T_0R, - acpi_ex_opcode_3A_1T_1R, - acpi_ex_opcode_6A_0T_1R}; + acpi_ex_opcode_0A_0T_1R, + acpi_ex_opcode_1A_0T_0R, + acpi_ex_opcode_1A_0T_1R, + acpi_ex_opcode_1A_1T_0R, + acpi_ex_opcode_1A_1T_1R, + acpi_ex_opcode_2A_0T_0R, + acpi_ex_opcode_2A_0T_1R, + acpi_ex_opcode_2A_1T_1R, + acpi_ex_opcode_2A_2T_1R, + acpi_ex_opcode_3A_0T_0R, + acpi_ex_opcode_3A_1T_1R, + acpi_ex_opcode_6A_0T_1R}; /***************************************************************************** * @@ -398,22 +399,30 @@ acpi_ds_exec_end_op ( goto cleanup; } - /* Resolve all operands */ + /* + * All opcodes require operand resolution, with the only exceptions + * being the object_type and size_of operators. + */ + if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) { + /* Resolve all operands */ + + status = acpi_ex_resolve_operands (walk_state->opcode, + &(walk_state->operands [walk_state->num_operands -1]), + walk_state); + if (ACPI_SUCCESS (status)) { + ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, + acpi_ps_get_opcode_name (walk_state->opcode), + walk_state->num_operands, "after ex_resolve_operands"); + } + } - status = acpi_ex_resolve_operands (walk_state->opcode, - &(walk_state->operands [walk_state->num_operands -1]), - walk_state); if (ACPI_SUCCESS (status)) { - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - acpi_ps_get_opcode_name (walk_state->opcode), - walk_state->num_operands, "after ex_resolve_operands"); - /* * Dispatch the request to the appropriate interpreter handler * routine. There is one routine per opcode "type" based upon the * number of opcode arguments and return type. */ - status = acpi_gbl_op_type_dispatch [op_type] (walk_state); + status = acpi_gbl_op_type_dispatch[op_type] (walk_state); } else { /* @@ -425,7 +434,9 @@ acpi_ds_exec_end_op ( (walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && (walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && (walk_state->operands[0]->reference.opcode == - walk_state->operands[1]->reference.opcode)) { + walk_state->operands[1]->reference.opcode) && + (walk_state->operands[0]->reference.offset == + walk_state->operands[1]->reference.offset)) { status = AE_OK; } else { @@ -567,6 +578,13 @@ acpi_ds_exec_end_op ( break; } + /* Done with this result state (Now that operand stack is built) */ + + status = acpi_ds_result_stack_pop (walk_state); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + /* * If a result object was returned from above, push it on the * current result stack @@ -639,7 +657,8 @@ acpi_ds_exec_end_op ( * conditional predicate */ - if ((walk_state->control_state) && + if ((ACPI_SUCCESS (status)) && + (walk_state->control_state) && (walk_state->control_state->common.state == ACPI_CONTROL_PREDICATE_EXECUTING) && (walk_state->control_state->control.predicate_op == op)) { @@ -649,6 +668,19 @@ acpi_ds_exec_end_op ( cleanup: + + /* Invoke exception handler on error */ + + if (ACPI_FAILURE (status) && + acpi_gbl_exception_handler && + !(status & AE_CODE_CONTROL)) { + acpi_ex_exit_interpreter (); + status = acpi_gbl_exception_handler (status, + walk_state->method_node->name.integer, walk_state->opcode, + walk_state->aml_offset, NULL); + acpi_ex_enter_interpreter (); + } + if (walk_state->result_obj) { /* Break to debugger to display result */ diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c index 9c0d99e09..06d758679 100644 --- a/drivers/acpi/dispatcher/dswload.c +++ b/drivers/acpi/dispatcher/dswload.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -182,18 +182,20 @@ acpi_ds_load1_begin_op ( */ status = acpi_ns_lookup (walk_state->scope_info, path, object_type, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); - if (ACPI_FAILURE (status)) { #ifdef _ACPI_ASL_COMPILER - if (status == AE_NOT_FOUND) { - acpi_dm_add_to_external_list (path); - status = AE_OK; - } - else { - ACPI_REPORT_NSERROR (path, status); - } -#else - ACPI_REPORT_NSERROR (path, status); + if (status == AE_NOT_FOUND) { + /* + * Table disassembly: + * Target of Scope() not found. Generate an External for it, and + * insert the name into the namespace. + */ + acpi_dm_add_to_external_list (path); + status = acpi_ns_lookup (walk_state->scope_info, path, object_type, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); + } #endif + if (ACPI_FAILURE (status)) { + ACPI_REPORT_NSERROR (path, status); return (status); } diff --git a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c index 7c8a38544..65f456151 100644 --- a/drivers/acpi/dispatcher/dswscope.c +++ b/drivers/acpi/dispatcher/dswscope.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c index 81c6b46ac..e555b3fbd 100644 --- a/drivers/acpi/dispatcher/dswstate.c +++ b/drivers/acpi/dispatcher/dswstate.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,8 @@ ACPI_MODULE_NAME ("dswstate") +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_ds_result_insert @@ -174,6 +176,8 @@ acpi_ds_result_remove ( return (AE_OK); } +#endif /* ACPI_FUTURE_USAGE */ + /******************************************************************************* * @@ -445,7 +449,7 @@ acpi_ds_result_stack_pop ( * Should be used with great care, if at all! * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_ds_obj_stack_delete_all ( struct acpi_walk_state *walk_state) @@ -467,6 +471,7 @@ acpi_ds_obj_stack_delete_all ( return_ACPI_STATUS (AE_OK); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -687,7 +692,7 @@ acpi_ds_obj_stack_pop_and_delete ( * be within the range of the current stack pointer. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE void * acpi_ds_obj_stack_get_value ( u32 index, @@ -712,6 +717,7 @@ acpi_ds_obj_stack_get_value ( return_PTR (walk_state->operands[(acpi_native_uint)(walk_state->num_operands - 1) - index]); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -867,6 +873,7 @@ acpi_ds_create_walk_state ( status = acpi_ds_result_stack_push (walk_state); if (ACPI_FAILURE (status)) { + acpi_ut_release_to_cache (ACPI_MEM_LIST_WALK, walk_state); return_PTR (NULL); } @@ -1064,6 +1071,7 @@ acpi_ds_delete_walk_state ( } +#ifdef ACPI_ENABLE_OBJECT_CACHE /****************************************************************************** * * FUNCTION: acpi_ds_delete_walk_state_cache @@ -1087,5 +1095,6 @@ acpi_ds_delete_walk_state_cache ( acpi_ut_delete_generic_cache (ACPI_MEM_LIST_WALK); return_VOID; } +#endif diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index d1419145e..8d4219388 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1,6 +1,7 @@ /* * acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 38 $) * + * Copyright (C) 2004 Luming Yu * Copyright (C) 2001, 2002 Andy Grover * Copyright (C) 2001, 2002 Paul Diefenbaugh * @@ -29,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +264,7 @@ ec_read(u8 addr, u8 *val) else return err; } +EXPORT_SYMBOL(ec_read); int ec_write(u8 addr, u8 val) @@ -278,6 +281,7 @@ ec_write(u8 addr, u8 val) return err; } +EXPORT_SYMBOL(ec_write); static int @@ -438,14 +442,23 @@ acpi_ec_space_handler ( int result = 0; struct acpi_ec *ec = NULL; u32 temp = 0; + acpi_integer f_v = 0; + int i = 0; ACPI_FUNCTION_TRACE("acpi_ec_space_handler"); - if ((address > 0xFF) || (bit_width != 8) || !value || !handler_context) + if ((address > 0xFF) || !value || !handler_context) return_VALUE(AE_BAD_PARAMETER); + if(bit_width != 8) { + printk(KERN_WARNING PREFIX "acpi_ec_space_handler: bit_width should be 8\n"); + if (acpi_strict) + return_VALUE(AE_BAD_PARAMETER); + } + ec = (struct acpi_ec *) handler_context; +next_byte: switch (function) { case ACPI_READ: result = acpi_ec_read(ec, (u8) address, &temp); @@ -456,9 +469,29 @@ acpi_ec_space_handler ( break; default: result = -EINVAL; + goto out; break; } + bit_width -= 8; + if(bit_width){ + + if(function == ACPI_READ) + f_v |= (acpi_integer) (*value) << 8*i; + if(function == ACPI_WRITE) + (*value) >>=8; + i++; + goto next_byte; + } + + + if(function == ACPI_READ){ + f_v |= (acpi_integer) (*value) << 8*i; + *value = f_v; + } + + +out: switch (result) { case -EINVAL: return_VALUE(AE_BAD_PARAMETER); @@ -472,6 +505,7 @@ acpi_ec_space_handler ( default: return_VALUE(AE_OK); } + } @@ -484,41 +518,38 @@ struct proc_dir_entry *acpi_ec_dir; static int -acpi_ec_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +acpi_ec_read_info (struct seq_file *seq, void *offset) { - struct acpi_ec *ec = (struct acpi_ec *) data; - char *p = page; - int len = 0; + struct acpi_ec *ec = (struct acpi_ec *) seq->private; ACPI_FUNCTION_TRACE("acpi_ec_read_info"); - if (!ec || (off != 0)) + if (!ec) goto end; - p += sprintf(p, "gpe bit: 0x%02x\n", + seq_printf(seq, "gpe bit: 0x%02x\n", (u32) ec->gpe_bit); - p += sprintf(p, "ports: 0x%02x, 0x%02x\n", + seq_printf(seq, "ports: 0x%02x, 0x%02x\n", (u32) ec->status_addr.address, (u32) ec->data_addr.address); - p += sprintf(p, "use global lock: %s\n", + seq_printf(seq, "use global lock: %s\n", ec->global_lock?"yes":"no"); end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return_VALUE(len); + return_VALUE(0); } +static int acpi_ec_info_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_ec_read_info, PDE(inode)->data); +} + +static struct file_operations acpi_ec_info_ops = { + .open = acpi_ec_info_open_fs, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; static int acpi_ec_add_fs ( @@ -535,13 +566,17 @@ acpi_ec_add_fs ( return_VALUE(-ENODEV); } - entry = create_proc_read_entry(ACPI_EC_FILE_INFO, S_IRUGO, - acpi_device_dir(device), acpi_ec_read_info, - acpi_driver_data(device)); + entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO, + acpi_device_dir(device)); if (!entry) ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to create '%s' fs entry\n", ACPI_EC_FILE_INFO)); + else { + entry->proc_fops = &acpi_ec_info_ops; + entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; + } return_VALUE(0); } @@ -588,7 +623,7 @@ acpi_ec_add ( ec->handle = device->handle; ec->uid = -1; - ec->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&ec->lock); strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_EC_CLASS); acpi_driver_data(device) = ec; @@ -776,9 +811,81 @@ acpi_ec_stop ( return_VALUE(0); } +static acpi_status __init +acpi_fake_ecdt_callback ( + acpi_handle handle, + u32 Level, + void *context, + void **retval) +{ + acpi_status status; -int __init -acpi_ec_ecdt_probe (void) + status = acpi_walk_resources(handle, METHOD_NAME__CRS, + acpi_ec_io_ports, ec_ecdt); + if (ACPI_FAILURE(status)) + return status; + ec_ecdt->status_addr = ec_ecdt->command_addr; + + ec_ecdt->uid = -1; + acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->uid); + + status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->gpe_bit); + if (ACPI_FAILURE(status)) + return status; + spin_lock_init(&ec_ecdt->lock); + ec_ecdt->global_lock = TRUE; + ec_ecdt->handle = handle; + + printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n", + (u32) ec_ecdt->gpe_bit, (u32) ec_ecdt->command_addr.address, + (u32) ec_ecdt->data_addr.address); + + return AE_CTRL_TERMINATE; +} + +/* + * Some BIOS (such as some from Gateway laptops) access EC region very early + * such as in BAT0._INI or EC._INI before an EC device is found and + * do not provide an ECDT. According to ACPI spec, ECDT isn't mandatorily + * required, but if EC regison is accessed early, it is required. + * The routine tries to workaround the BIOS bug by pre-scan EC device + * It assumes that _CRS, _HID, _GPE, _UID methods of EC don't touch any + * op region (since _REG isn't invoked yet). The assumption is true for + * all systems found. + */ +static int __init +acpi_ec_fake_ecdt(void) +{ + acpi_status status; + int ret = 0; + + printk(KERN_INFO PREFIX "Try to make an fake ECDT\n"); + + ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); + if (!ec_ecdt) { + ret = -ENOMEM; + goto error; + } + memset(ec_ecdt, 0, sizeof(struct acpi_ec)); + + status = acpi_get_devices (ACPI_EC_HID, + acpi_fake_ecdt_callback, + NULL, + NULL); + if (ACPI_FAILURE(status)) { + kfree(ec_ecdt); + ec_ecdt = NULL; + ret = -ENODEV; + goto error; + } + return 0; +error: + printk(KERN_ERR PREFIX "Can't make an fake ECDT\n"); + return ret; +} + +static int __init +acpi_ec_get_real_ecdt(void) { acpi_status status; struct acpi_table_ecdt *ecdt_ptr; @@ -786,11 +893,11 @@ acpi_ec_ecdt_probe (void) status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING, (struct acpi_table_header **) &ecdt_ptr); if (ACPI_FAILURE(status)) - return 0; + return -ENODEV; printk(KERN_INFO PREFIX "Found ECDT\n"); - /* + /* * Generate a temporary ec context to use until the namespace is scanned */ ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); @@ -802,7 +909,7 @@ acpi_ec_ecdt_probe (void) ec_ecdt->status_addr = ecdt_ptr->ec_control; ec_ecdt->data_addr = ecdt_ptr->ec_data; ec_ecdt->gpe_bit = ecdt_ptr->gpe_bit; - ec_ecdt->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&ec_ecdt->lock); /* use the GL just to be safe */ ec_ecdt->global_lock = TRUE; ec_ecdt->uid = ecdt_ptr->uid; @@ -812,6 +919,31 @@ acpi_ec_ecdt_probe (void) goto error; } + return 0; +error: + printk(KERN_ERR PREFIX "Could not use ECDT\n"); + kfree(ec_ecdt); + ec_ecdt = NULL; + + return -ENODEV; +} + +static int __initdata acpi_fake_ecdt_enabled; +int __init +acpi_ec_ecdt_probe (void) +{ + acpi_status status; + int ret; + + ret = acpi_ec_get_real_ecdt(); + /* Try to make a fake ECDT */ + if (ret && acpi_fake_ecdt_enabled) { + ret = acpi_ec_fake_ecdt(); + } + + if (ret) + return 0; + /* * Install GPE handler */ @@ -884,3 +1016,9 @@ acpi_ec_exit (void) } #endif /* 0 */ +static int __init acpi_fake_ecdt_setup(char *str) +{ + acpi_fake_ecdt_enabled = 1; + return 0; +} +__setup("acpi_fake_ecdt", acpi_fake_ecdt_setup); diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 385fc65bf..43c49f66a 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -16,7 +16,7 @@ ACPI_MODULE_NAME ("event") /* Global vars for handling event proc entry */ -static spinlock_t acpi_system_event_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(acpi_system_event_lock); int event_is_open = 0; extern struct list_head acpi_bus_event_list; extern wait_queue_head_t acpi_bus_event_queue; diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c index 558ec7b33..2a213604a 100644 --- a/drivers/acpi/events/evevent.c +++ b/drivers/acpi/events/evevent.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index afb36886b..118d72ac7 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -434,13 +434,8 @@ acpi_ev_gpe_detect ( } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, - "GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n", - ACPI_FORMAT_UINT64 ( - gpe_register_info->status_address.address), - status_reg, - ACPI_FORMAT_UINT64 ( - gpe_register_info->enable_address.address), - enable_reg)); + "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n", + gpe_register_info->base_gpe_number, status_reg, enable_reg)); /* First check if there is anything active at all in this register */ @@ -610,8 +605,8 @@ acpi_ev_gpe_dispatch ( if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED) { status = acpi_hw_clear_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { - ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n", - gpe_number)); + ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", + acpi_format_exception (status), gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -648,8 +643,8 @@ acpi_ev_gpe_dispatch ( status = acpi_hw_clear_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( - "acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n", - gpe_number)); + "acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", + acpi_format_exception (status), gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -664,8 +659,8 @@ acpi_ev_gpe_dispatch ( status = acpi_ev_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( - "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", - gpe_number)); + "acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", + acpi_format_exception (status), gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } @@ -673,12 +668,12 @@ acpi_ev_gpe_dispatch ( * Execute the method associated with the GPE * NOTE: Level-triggered GPEs are cleared after the method completes. */ - if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE, - acpi_ev_asynch_execute_gpe_method, - gpe_event_info))) { + status = acpi_os_queue_for_execution (OSD_PRIORITY_GPE, + acpi_ev_asynch_execute_gpe_method, gpe_event_info); + if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( - "acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%2X], event is disabled\n", - gpe_number)); + "acpi_ev_gpe_dispatch: %s, Unable to queue handler for GPE[%2X] - event disabled\n", + acpi_format_exception (status), gpe_number)); } break; @@ -697,8 +692,8 @@ acpi_ev_gpe_dispatch ( status = acpi_ev_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( - "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", - gpe_number)); + "acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", + acpi_format_exception (status), gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } break; diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c index 1913f4efe..00d981f53 100644 --- a/drivers/acpi/events/evgpeblk.c +++ b/drivers/acpi/events/evgpeblk.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -925,7 +925,7 @@ acpi_ev_create_gpe_block ( /* * Runtime option: Should Wake GPEs be enabled at runtime? The default - * is No,they should only be enabled just as the machine goes to sleep. + * is No, they should only be enabled just as the machine goes to sleep. */ if (acpi_gbl_leave_wake_gpes_disabled) { /* @@ -970,16 +970,14 @@ acpi_ev_create_gpe_block ( /* Dump info about this GPE block */ ACPI_DEBUG_PRINT ((ACPI_DB_INIT, - "GPE %02X to %02X [%4.4s] %u regs at %8.8X%8.8X on int 0x%X\n", + "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n", (u32) gpe_block->block_base_number, (u32) (gpe_block->block_base_number + ((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)), gpe_device->name.ascii, gpe_block->register_count, - ACPI_FORMAT_UINT64 (gpe_block->block_address.address), interrupt_level)); - /* Enable all valid GPEs found above */ status = acpi_hw_enable_runtime_gpe_block (NULL, gpe_block); diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 35e61d522..2548efa7a 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c index b7ff3b162..772342708 100644 --- a/drivers/acpi/events/evregion.c +++ b/drivers/acpi/events/evregion.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c index e19d82297..4983a3378 100644 --- a/drivers/acpi/events/evrgnini.c +++ b/drivers/acpi/events/evrgnini.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/events/evsci.c b/drivers/acpi/events/evsci.c index dfb9a0dff..46b31995c 100644 --- a/drivers/acpi/events/evsci.c +++ b/drivers/acpi/events/evsci.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c index 26e9b0e41..a48820152 100644 --- a/drivers/acpi/events/evxface.c +++ b/drivers/acpi/events/evxface.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -51,6 +52,52 @@ ACPI_MODULE_NAME ("evxface") +/******************************************************************************* + * + * FUNCTION: acpi_install_exception_handler + * + * PARAMETERS: Handler - Pointer to the handler function for the + * event + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function + * + ******************************************************************************/ +#ifdef ACPI_FUTURE_USAGE +acpi_status +acpi_install_exception_handler ( + acpi_exception_handler handler) +{ + acpi_status status; + + + ACPI_FUNCTION_TRACE ("acpi_install_exception_handler"); + + + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + /* Don't allow two handlers. */ + + if (acpi_gbl_exception_handler) { + status = AE_ALREADY_EXISTS; + goto cleanup; + } + + /* Install the handler */ + + acpi_gbl_exception_handler = handler; + +cleanup: + (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (status); +} +#endif /* ACPI_FUTURE_USAGE */ + + /******************************************************************************* * * FUNCTION: acpi_install_fixed_event_handler @@ -121,6 +168,7 @@ cleanup: (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_install_fixed_event_handler); /******************************************************************************* @@ -178,6 +226,7 @@ acpi_remove_fixed_event_handler ( (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_remove_fixed_event_handler); /******************************************************************************* @@ -347,6 +396,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_install_notify_handler); /******************************************************************************* @@ -505,6 +555,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_remove_notify_handler); /******************************************************************************* @@ -602,6 +653,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_install_gpe_handler); /******************************************************************************* @@ -704,6 +756,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_remove_gpe_handler); /******************************************************************************* @@ -746,6 +799,7 @@ acpi_acquire_global_lock ( return (status); } +EXPORT_SYMBOL(acpi_acquire_global_lock); /******************************************************************************* @@ -774,5 +828,5 @@ acpi_release_global_lock ( status = acpi_ev_release_global_lock (); return (status); } - +EXPORT_SYMBOL(acpi_release_global_lock); diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c index e941678ce..fa8d5f25b 100644 --- a/drivers/acpi/events/evxfevnt.c +++ b/drivers/acpi/events/evxfevnt.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -200,6 +201,7 @@ acpi_enable_event ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_enable_event); /******************************************************************************* @@ -248,6 +250,7 @@ acpi_set_gpe_type ( unlock_and_exit: return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_set_gpe_type); /******************************************************************************* @@ -305,6 +308,7 @@ unlock_and_exit: } return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_enable_gpe); /******************************************************************************* @@ -417,6 +421,7 @@ acpi_disable_event ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_disable_event); /******************************************************************************* @@ -456,6 +461,7 @@ acpi_clear_event ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_clear_event); /******************************************************************************* @@ -512,6 +518,8 @@ unlock_and_exit: } +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_get_event_status @@ -613,6 +621,7 @@ unlock_and_exit: } return_ACPI_STATUS (status); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -705,6 +714,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_install_gpe_block); /******************************************************************************* @@ -765,4 +775,4 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } - +EXPORT_SYMBOL(acpi_remove_gpe_block); diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c index 8eeb938f7..d058587b3 100644 --- a/drivers/acpi/events/evxfregn.c +++ b/drivers/acpi/events/evxfregn.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -116,6 +117,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_install_address_space_handler); /******************************************************************************* @@ -241,5 +243,5 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } - +EXPORT_SYMBOL(acpi_remove_address_space_handler); diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 1e6a89805..ac3c06196 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,7 +95,7 @@ acpi_ex_add_table ( ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc)); - table_info.type = 5; + table_info.type = ACPI_TABLE_SSDT; table_info.pointer = table; table_info.length = (acpi_size) table->length; table_info.allocation = ACPI_MEM_ALLOCATED; diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c index 04c04e4ae..df7ba1219 100644 --- a/drivers/acpi/executer/exconvrt.c +++ b/drivers/acpi/executer/exconvrt.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,7 +58,7 @@ * PARAMETERS: obj_desc - Object to be converted. Must be an * Integer, Buffer, or String * result_desc - Where the new Integer object is returned - * walk_state - Current method state + * Flags - Used for string conversion * * RETURN: Status * @@ -70,13 +70,13 @@ acpi_status acpi_ex_convert_to_integer ( union acpi_operand_object *obj_desc, union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state) + u32 flags) { - u32 i; - union acpi_operand_object *ret_desc; - u32 count; + union acpi_operand_object *return_desc; u8 *pointer; acpi_integer result; + u32 i; + u32 count; acpi_status status; @@ -85,15 +85,17 @@ acpi_ex_convert_to_integer ( switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_INTEGER: + + /* No conversion necessary */ + *result_desc = obj_desc; return_ACPI_STATUS (AE_OK); + case ACPI_TYPE_BUFFER: case ACPI_TYPE_STRING: - pointer = (u8 *) obj_desc->string.pointer; - count = obj_desc->string.length; - break; - case ACPI_TYPE_BUFFER: + /* Note: Takes advantage of common buffer/string fields */ + pointer = obj_desc->buffer.pointer; count = obj_desc->buffer.length; break; @@ -113,12 +115,6 @@ acpi_ex_convert_to_integer ( */ result = 0; - /* Transfer no more than an integer's worth of data */ - - if (count > acpi_gbl_integer_byte_width) { - count = acpi_gbl_integer_byte_width; - } - /* * String conversion is different than Buffer conversion */ @@ -126,10 +122,12 @@ acpi_ex_convert_to_integer ( case ACPI_TYPE_STRING: /* - * Convert string to an integer - * String must be hexadecimal as per the ACPI specification + * Convert string to an integer - for most cases, the string must be + * hexadecimal as per the ACPI specification. The only exception (as + * of ACPI 3.0) is that the to_integer() operator allows both decimal + * and hexadecimal strings (hex prefixed with "0x"). */ - status = acpi_ut_strtoul64 ((char *) pointer, 16, &result); + status = acpi_ut_strtoul64 ((char *) pointer, flags, &result); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -138,9 +136,21 @@ acpi_ex_convert_to_integer ( case ACPI_TYPE_BUFFER: + /* Check for zero-length buffer */ + + if (!count) { + return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); + } + + /* Transfer no more than an integer's worth of data */ + + if (count > acpi_gbl_integer_byte_width) { + count = acpi_gbl_integer_byte_width; + } + /* - * Buffer conversion - we simply grab enough raw data from the - * buffer to fill an integer + * Convert buffer to an integer - we simply grab enough raw data + * from the buffer to fill an integer */ for (i = 0; i < count; i++) { /* @@ -161,27 +171,16 @@ acpi_ex_convert_to_integer ( /* * Create a new integer */ - ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); - if (!ret_desc) { + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Save the Result */ - ret_desc->integer.value = result; - - /* - * If we are about to overwrite the original object on the operand stack, - * we must remove a reference on the original object because we are - * essentially removing it from the stack. - */ - if (*result_desc == obj_desc) { - if (walk_state->opcode != AML_STORE_OP) { - acpi_ut_remove_reference (obj_desc); - } - } - - *result_desc = ret_desc; + return_desc->integer.value = result; + acpi_ex_truncate_for32bit_table (return_desc); + *result_desc = return_desc; return_ACPI_STATUS (AE_OK); } @@ -193,7 +192,6 @@ acpi_ex_convert_to_integer ( * PARAMETERS: obj_desc - Object to be converted. Must be an * Integer, Buffer, or String * result_desc - Where the new buffer object is returned - * walk_state - Current method state * * RETURN: Status * @@ -204,11 +202,9 @@ acpi_ex_convert_to_integer ( acpi_status acpi_ex_convert_to_buffer ( union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state) + union acpi_operand_object **result_desc) { - union acpi_operand_object *ret_desc; - u32 i; + union acpi_operand_object *return_desc; u8 *new_buf; @@ -230,17 +226,17 @@ acpi_ex_convert_to_buffer ( * Create a new Buffer object. * Need enough space for one integer */ - ret_desc = acpi_ut_create_buffer_object (acpi_gbl_integer_byte_width); - if (!ret_desc) { + return_desc = acpi_ut_create_buffer_object (acpi_gbl_integer_byte_width); + if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } - /* Copy the integer to the buffer */ + /* Copy the integer to the buffer, LSB first */ - new_buf = ret_desc->buffer.pointer; - for (i = 0; i < acpi_gbl_integer_byte_width; i++) { - new_buf[i] = (u8) (obj_desc->integer.value >> (i * 8)); - } + new_buf = return_desc->buffer.pointer; + ACPI_MEMCPY (new_buf, + &obj_desc->integer.value, + acpi_gbl_integer_byte_width); break; @@ -249,15 +245,20 @@ acpi_ex_convert_to_buffer ( /* * Create a new Buffer object * Size will be the string length + * + * NOTE: Add one to the string length to include the null terminator. + * The ACPI spec is unclear on this subject, but there is existing + * ASL/AML code that depends on the null being transferred to the new + * buffer. */ - ret_desc = acpi_ut_create_buffer_object ((acpi_size) obj_desc->string.length); - if (!ret_desc) { + return_desc = acpi_ut_create_buffer_object ((acpi_size) obj_desc->string.length + 1); + if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Copy the string to the buffer */ - new_buf = ret_desc->buffer.pointer; + new_buf = return_desc->buffer.pointer; ACPI_STRNCPY ((char *) new_buf, (char *) obj_desc->string.pointer, obj_desc->string.length); break; @@ -269,32 +270,20 @@ acpi_ex_convert_to_buffer ( /* Mark buffer initialized */ - ret_desc->common.flags |= AOPOBJ_DATA_VALID; - - /* - * If we are about to overwrite the original object on the operand stack, - * we must remove a reference on the original object because we are - * essentially removing it from the stack. - */ - if (*result_desc == obj_desc) { - if (walk_state->opcode != AML_STORE_OP) { - acpi_ut_remove_reference (obj_desc); - } - } - - *result_desc = ret_desc; + return_desc->common.flags |= AOPOBJ_DATA_VALID; + *result_desc = return_desc; return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: acpi_ex_convert_ascii + * FUNCTION: acpi_ex_convert_to_ascii * * PARAMETERS: Integer - Value to be converted - * Base - 10 or 16 + * Base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX * String - Where the string is returned - * data_width - Size of data item to be converted + * data_width - Size of data item to be converted, in bytes * * RETURN: Actual string length * @@ -305,79 +294,81 @@ acpi_ex_convert_to_buffer ( u32 acpi_ex_convert_to_ascii ( acpi_integer integer, - u32 base, + u16 base, u8 *string, u8 data_width) { - u32 i; - u32 j; - u32 k = 0; - char hex_digit; acpi_integer digit; + acpi_native_uint i; + acpi_native_uint j; + acpi_native_uint k = 0; + acpi_native_uint hex_length; + acpi_native_uint decimal_length; u32 remainder; - u32 length; - u8 leading_zero; + u8 supress_zeros; ACPI_FUNCTION_ENTRY (); - if (data_width < sizeof (acpi_integer)) { - leading_zero = FALSE; - length = data_width; - } - else { - leading_zero = TRUE; - length = sizeof (acpi_integer); - } - switch (base) { case 10: + /* Setup max length for the decimal number */ + + switch (data_width) { + case 1: + decimal_length = ACPI_MAX8_DECIMAL_DIGITS; + break; + + case 4: + decimal_length = ACPI_MAX32_DECIMAL_DIGITS; + break; + + case 8: + default: + decimal_length = ACPI_MAX64_DECIMAL_DIGITS; + break; + } + + supress_zeros = TRUE; /* No leading zeros */ remainder = 0; - for (i = ACPI_MAX_DECIMAL_DIGITS; i > 0; i--) { + + for (i = decimal_length; i > 0; i--) { /* Divide by nth factor of 10 */ digit = integer; for (j = 0; j < i; j++) { - (void) acpi_ut_short_divide (&digit, 10, &digit, &remainder); + (void) acpi_ut_short_divide (digit, 10, &digit, &remainder); } - /* Create the decimal digit */ + /* Handle leading zeros */ if (remainder != 0) { - leading_zero = FALSE; + supress_zeros = FALSE; } - if (!leading_zero) { + if (!supress_zeros) { string[k] = (u8) (ACPI_ASCII_ZERO + remainder); k++; } } break; - case 16: - /* Copy the integer to the buffer */ + hex_length = ACPI_MUL_2 (data_width); /* 2 ascii hex chars per data byte */ - for (i = 0, j = ((length * 2) -1); i < (length * 2); i++, j--) { - - hex_digit = acpi_ut_hex_to_ascii_char (integer, (j * 4)); - if (hex_digit != ACPI_ASCII_ZERO) { - leading_zero = FALSE; - } + for (i = 0, j = (hex_length-1); i < hex_length; i++, j--) { + /* Get one hex digit, most significant digits first */ - if (!leading_zero) { - string[k] = (u8) hex_digit; - k++; - } + string[k] = (u8) acpi_ut_hex_to_ascii_char (integer, ACPI_MUL_4 (j)); + k++; } break; - default: - break; + return (0); } /* @@ -392,7 +383,7 @@ acpi_ex_convert_to_ascii ( } string [k] = 0; - return (k); + return ((u32) k); } @@ -401,11 +392,9 @@ acpi_ex_convert_to_ascii ( * FUNCTION: acpi_ex_convert_to_string * * PARAMETERS: obj_desc - Object to be converted. Must be an - * Integer, Buffer, or String + * Integer, Buffer, or String * result_desc - Where the string object is returned - * Base - 10 or 16 - * max_length - Max length of the returned string - * walk_state - Current method state + * Type - String flags (base and conversion type) * * RETURN: Status * @@ -417,15 +406,14 @@ acpi_status acpi_ex_convert_to_string ( union acpi_operand_object *obj_desc, union acpi_operand_object **result_desc, - u32 base, - u32 max_length, - struct acpi_walk_state *walk_state) + u32 type) { - union acpi_operand_object *ret_desc; + union acpi_operand_object *return_desc; u8 *new_buf; - u8 *pointer; - u32 string_length; u32 i; + u32 string_length = 0; + u16 base = 16; + u8 separator = ','; ACPI_FUNCTION_TRACE_PTR ("ex_convert_to_string", obj_desc); @@ -434,130 +422,146 @@ acpi_ex_convert_to_string ( switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_STRING: - if (max_length >= obj_desc->string.length) { - *result_desc = obj_desc; - return_ACPI_STATUS (AE_OK); - } - else { - /* Must copy the string first and then truncate it */ + /* No conversion necessary */ - return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - } + *result_desc = obj_desc; + return_ACPI_STATUS (AE_OK); case ACPI_TYPE_INTEGER: - string_length = acpi_gbl_integer_byte_width * 2; - if (base == 10) { + switch (type) { + case ACPI_EXPLICIT_CONVERT_DECIMAL: + + /* Make room for maximum decimal number */ + string_length = ACPI_MAX_DECIMAL_DIGITS; + base = 10; + break; + + default: + + /* Two hex string characters for each integer byte */ + + string_length = ACPI_MUL_2 (acpi_gbl_integer_byte_width); + break; } /* * Create a new String + * Need enough space for one ASCII integer (plus null terminator) */ - ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); - if (!ret_desc) { + return_desc = acpi_ut_create_string_object ((acpi_size) string_length); + if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } - /* Need enough space for one ASCII integer plus null terminator */ + new_buf = return_desc->buffer.pointer; - new_buf = ACPI_MEM_CALLOCATE ((acpi_size) string_length + 1); - if (!new_buf) { - ACPI_REPORT_ERROR - (("ex_convert_to_string: Buffer allocation failure\n")); - acpi_ut_remove_reference (ret_desc); - return_ACPI_STATUS (AE_NO_MEMORY); - } + /* Convert integer to string */ - /* Convert */ - - i = acpi_ex_convert_to_ascii (obj_desc->integer.value, base, new_buf, sizeof (acpi_integer)); + string_length = acpi_ex_convert_to_ascii (obj_desc->integer.value, base, + new_buf, acpi_gbl_integer_byte_width); /* Null terminate at the correct place */ - if (max_length < i) { - new_buf[max_length] = 0; - ret_desc->string.length = max_length; - } - else { - new_buf [i] = 0; - ret_desc->string.length = i; - } - - ret_desc->buffer.pointer = new_buf; + return_desc->string.length = string_length; + new_buf [string_length] = 0; break; case ACPI_TYPE_BUFFER: - /* Find the string length */ + /* Setup string length, base, and separator */ - pointer = obj_desc->buffer.pointer; - for (string_length = 0; string_length < obj_desc->buffer.length; string_length++) { - /* Exit on null terminator */ + switch (type) { + case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by to_decimal_string operator */ + /* + * From ACPI: "If Data is a buffer, it is converted to a string of + * decimal values separated by commas." + */ + base = 10; - if (!pointer[string_length]) { - break; + /* + * Calculate the final string length. Individual string values + * are variable length (include separator for each) + */ + for (i = 0; i < obj_desc->buffer.length; i++) { + if (obj_desc->buffer.pointer[i] >= 100) { + string_length += 4; + } + else if (obj_desc->buffer.pointer[i] >= 10) { + string_length += 3; + } + else { + string_length += 2; + } } - } + break; - if (max_length > ACPI_MAX_STRING_CONVERSION) { - if (string_length > ACPI_MAX_STRING_CONVERSION) { - return_ACPI_STATUS (AE_AML_STRING_LIMIT); - } + case ACPI_IMPLICIT_CONVERT_HEX: + /* + * From the ACPI spec: + *"The entire contents of the buffer are converted to a string of + * two-character hexadecimal numbers, each separated by a space." + */ + separator = ' '; + string_length = (obj_desc->buffer.length * 3); + break; + + case ACPI_EXPLICIT_CONVERT_HEX: /* Used by to_hex_string operator */ + /* + * From ACPI: "If Data is a buffer, it is converted to a string of + * hexadecimal values separated by commas." + */ + string_length = (obj_desc->buffer.length * 3); + break; + + default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } /* - * Create a new string object + * Perform the conversion. + * (-1 because of extra separator included in string_length from above) */ - ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); - if (!ret_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* String length is the lesser of the Max or the actual length */ - - if (max_length < string_length) { - string_length = max_length; + string_length--; + if (string_length > ACPI_MAX_STRING_CONVERSION) /* ACPI limit */ { + return_ACPI_STATUS (AE_AML_STRING_LIMIT); } - new_buf = ACPI_MEM_CALLOCATE ((acpi_size) string_length + 1); - if (!new_buf) { - ACPI_REPORT_ERROR - (("ex_convert_to_string: Buffer allocation failure\n")); - acpi_ut_remove_reference (ret_desc); + /* + * Create a new string object and string buffer + */ + return_desc = acpi_ut_create_string_object ((acpi_size) string_length); + if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } - /* Copy the appropriate number of buffer characters */ + new_buf = return_desc->buffer.pointer; - ACPI_MEMCPY (new_buf, pointer, string_length); + /* + * Convert buffer bytes to hex or decimal values + * (separated by commas or spaces) + */ + for (i = 0; i < obj_desc->buffer.length; i++) { + new_buf += acpi_ex_convert_to_ascii ( + (acpi_integer) obj_desc->buffer.pointer[i], base, + new_buf, 1); + *new_buf++ = separator; /* each separated by a comma or space */ + } - /* Null terminate */ + /* Null terminate the string (overwrites final comma/space from above) */ - new_buf [string_length] = 0; - ret_desc->buffer.pointer = new_buf; - ret_desc->string.length = string_length; + new_buf--; + *new_buf = 0; break; - default: return_ACPI_STATUS (AE_TYPE); } - /* - * If we are about to overwrite the original object on the operand stack, - * we must remove a reference on the original object because we are - * essentially removing it from the stack. - */ - if (*result_desc == obj_desc) { - if (walk_state->opcode != AML_STORE_OP) { - acpi_ut_remove_reference (obj_desc); - } - } - - *result_desc = ret_desc; + *result_desc = return_desc; return_ACPI_STATUS (AE_OK); } @@ -635,7 +639,8 @@ acpi_ex_convert_to_target_type ( * These types require an Integer operand. We can convert * a Buffer or a String to an Integer if necessary. */ - status = acpi_ex_convert_to_integer (source_desc, result_desc, walk_state); + status = acpi_ex_convert_to_integer (source_desc, result_desc, + 16); break; @@ -645,7 +650,8 @@ acpi_ex_convert_to_target_type ( * The operand must be a String. We can convert an * Integer or Buffer if necessary */ - status = acpi_ex_convert_to_string (source_desc, result_desc, 16, ACPI_UINT32_MAX, walk_state); + status = acpi_ex_convert_to_string (source_desc, result_desc, + ACPI_IMPLICIT_CONVERT_HEX); break; @@ -655,7 +661,7 @@ acpi_ex_convert_to_target_type ( * The operand must be a Buffer. We can convert an * Integer or String if necessary */ - status = acpi_ex_convert_to_buffer (source_desc, result_desc, walk_state); + status = acpi_ex_convert_to_buffer (source_desc, result_desc); break; diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index 0c3027c59..d94c260da 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c index 5c2c912ed..e2f7c32f2 100644 --- a/drivers/acpi/executer/exdump.c +++ b/drivers/acpi/executer/exdump.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,6 @@ /* * The following routines are used for debug output only */ - #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /***************************************************************************** @@ -64,7 +63,7 @@ * * PARAMETERS: *obj_desc - Pointer to entry to be dumped * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Dump an operand object * @@ -72,12 +71,11 @@ void acpi_ex_dump_operand ( - union acpi_operand_object *obj_desc) + union acpi_operand_object *obj_desc, + u32 depth) { - u8 *buf = NULL; u32 length; - union acpi_operand_object **element; - u16 element_index; + u32 index; ACPI_FUNCTION_NAME ("ex_dump_operand") @@ -89,9 +87,9 @@ acpi_ex_dump_operand ( if (!obj_desc) { /* - * This usually indicates that something serious is wrong + * This could be a null element of a package */ - acpi_os_printf ("Null Object Descriptor\n"); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); return; } @@ -103,15 +101,21 @@ acpi_ex_dump_operand ( if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "%p is not a node or operand object: [%s]\n", - obj_desc, acpi_ut_get_descriptor_name (obj_desc))); + "%p is not a node or operand object: [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc))); ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object)); return; } /* obj_desc is a valid object */ - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); + if (depth > 0) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ", + depth, " ", depth, obj_desc)); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); + } switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_LOCAL_REFERENCE: @@ -125,8 +129,8 @@ acpi_ex_dump_operand ( case AML_NAME_OP: - ACPI_DUMP_PATHNAME (obj_desc->reference.object, "Reference: Name: ", - ACPI_LV_INFO, _COMPONENT); + ACPI_DUMP_PATHNAME (obj_desc->reference.object, + "Reference: Name: ", ACPI_LV_INFO, _COMPONENT); ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO); break; @@ -134,27 +138,27 @@ acpi_ex_dump_operand ( case AML_INDEX_OP: acpi_os_printf ("Reference: Index %p\n", - obj_desc->reference.object); + obj_desc->reference.object); break; case AML_REF_OF_OP: acpi_os_printf ("Reference: (ref_of) %p\n", - obj_desc->reference.object); + obj_desc->reference.object); break; case AML_ARG_OP: acpi_os_printf ("Reference: Arg%d", - obj_desc->reference.offset); + obj_desc->reference.offset); if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { /* Value is an Integer */ acpi_os_printf (" value is [%8.8X%8.8x]", - ACPI_FORMAT_UINT64 (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); } acpi_os_printf ("\n"); @@ -164,14 +168,14 @@ acpi_ex_dump_operand ( case AML_LOCAL_OP: acpi_os_printf ("Reference: Local%d", - obj_desc->reference.offset); + obj_desc->reference.offset); if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { /* Value is an Integer */ acpi_os_printf (" value is [%8.8X%8.8x]", - ACPI_FORMAT_UINT64 (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); } acpi_os_printf ("\n"); @@ -181,7 +185,7 @@ acpi_ex_dump_operand ( case AML_INT_NAMEPATH_OP: acpi_os_printf ("Reference.Node->Name %X\n", - obj_desc->reference.node->name.integer); + obj_desc->reference.node->name.integer); break; @@ -194,18 +198,15 @@ acpi_ex_dump_operand ( break; } - break; case ACPI_TYPE_BUFFER: acpi_os_printf ("Buffer len %X @ %p \n", - obj_desc->buffer.length, - obj_desc->buffer.pointer); + obj_desc->buffer.length, obj_desc->buffer.pointer); length = obj_desc->buffer.length; - if (length > 64) { length = 64; } @@ -215,41 +216,37 @@ acpi_ex_dump_operand ( if (obj_desc->buffer.pointer) { acpi_os_printf ("Buffer Contents: "); - for (buf = obj_desc->buffer.pointer; length--; ++buf) { - acpi_os_printf (" %02x", *buf); + for (index = 0; index < length; index++) { + acpi_os_printf (" %02x", obj_desc->buffer.pointer[index]); } acpi_os_printf ("\n"); } - break; case ACPI_TYPE_INTEGER: acpi_os_printf ("Integer %8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; case ACPI_TYPE_PACKAGE: - acpi_os_printf ("Package count %X @ %p\n", - obj_desc->package.count, obj_desc->package.elements); + acpi_os_printf ("Package [Len %X] element_array %p\n", + obj_desc->package.count, obj_desc->package.elements); /* - * If elements exist, package vector pointer is valid, + * If elements exist, package element pointer is valid, * and debug_level exceeds 1, dump package's elements. */ if (obj_desc->package.count && obj_desc->package.elements && acpi_dbg_level > 1) { - for (element_index = 0, element = obj_desc->package.elements; - element_index < obj_desc->package.count; - ++element_index, ++element) { - acpi_ex_dump_operand (*element); + for (index = 0; index < obj_desc->package.count; index++) { + acpi_ex_dump_operand (obj_desc->package.elements[index], depth+1); } } - acpi_os_printf ("\n"); break; @@ -277,7 +274,7 @@ acpi_ex_dump_operand ( case ACPI_TYPE_STRING: acpi_os_printf ("String length %X @ %p ", - obj_desc->string.length, obj_desc->string.pointer); + obj_desc->string.length, obj_desc->string.pointer); acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX); acpi_os_printf ("\n"); break; @@ -297,7 +294,7 @@ acpi_ex_dump_operand ( obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset); - ACPI_DUMP_STACK_ENTRY (obj_desc->field.region_obj); + acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1); break; @@ -321,9 +318,8 @@ acpi_ex_dump_operand ( acpi_os_printf ("*not a Buffer* \n"); } else { - ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj); + acpi_ex_dump_operand (obj_desc->buffer_field.buffer_obj, depth+1); } - break; @@ -387,10 +383,13 @@ acpi_ex_dump_operand ( * * FUNCTION: acpi_ex_dump_operands * - * PARAMETERS: interpreter_mode - Load or Exec - * *Ident - Identification + * PARAMETERS: Operands - Operand list + * interpreter_mode - Load or Exec + * Ident - Identification * num_levels - # of stack entries to dump above line - * *Note - Output notation + * Note - Output notation + * module_name - Caller's module name + * line_number - Caller's invocation line number * * DESCRIPTION: Dump the object stack * @@ -407,7 +406,6 @@ acpi_ex_dump_operands ( u32 line_number) { acpi_native_uint i; - union acpi_operand_object **obj_desc; ACPI_FUNCTION_NAME ("ex_dump_operands"); @@ -432,8 +430,7 @@ acpi_ex_dump_operands ( /* Dump the operand stack starting at the top */ for (i = 0; num_levels > 0; i--, num_levels--) { - obj_desc = &operands[i]; - acpi_ex_dump_operand (*obj_desc); + acpi_ex_dump_operand (operands[i], 0); } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -443,6 +440,8 @@ acpi_ex_dump_operands ( } +#ifdef ACPI_FUTURE_USAGE + /***************************************************************************** * * FUNCTION: acpi_ex_out* @@ -489,8 +488,7 @@ acpi_ex_out_address ( #if ACPI_MACHINE_WIDTH == 16 acpi_os_printf ("%20s : %p\n", title, value); #else - acpi_os_printf ("%20s : %8.8X%8.8X\n", title, - ACPI_FORMAT_UINT64 (value)); + acpi_os_printf ("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64 (value)); #endif } @@ -499,7 +497,7 @@ acpi_ex_out_address ( * * FUNCTION: acpi_ex_dump_node * - * PARAMETERS: *Node - Descriptor to dump + * PARAMETERS: *Node - Descriptor to dump * Flags - Force display * * DESCRIPTION: Dumps the members of the given.Node @@ -563,22 +561,25 @@ acpi_ex_dump_object_descriptor ( if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) { acpi_ex_dump_node ((struct acpi_namespace_node *) obj_desc, flags); - acpi_os_printf ("\nAttached Object (%p):\n", ((struct acpi_namespace_node *) obj_desc)->object); - acpi_ex_dump_object_descriptor (((struct acpi_namespace_node *) obj_desc)->object, flags); - return; + acpi_os_printf ("\nAttached Object (%p):\n", + ((struct acpi_namespace_node *) obj_desc)->object); + acpi_ex_dump_object_descriptor ( + ((struct acpi_namespace_node *) obj_desc)->object, flags); + return_VOID; } if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { - acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n", - obj_desc, acpi_ut_get_descriptor_name (obj_desc)); + acpi_os_printf ( + "ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc)); return_VOID; } /* Common Fields */ - acpi_ex_out_string ("Type", acpi_ut_get_object_type_name (obj_desc)); + acpi_ex_out_string ("Type", acpi_ut_get_object_type_name (obj_desc)); acpi_ex_out_integer ("Reference Count", obj_desc->common.reference_count); - acpi_ex_out_integer ("Flags", obj_desc->common.flags); + acpi_ex_out_integer ("Flags", obj_desc->common.flags); /* Object-specific Fields */ @@ -592,7 +593,7 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_STRING: - acpi_ex_out_integer ("Length", obj_desc->string.length); + acpi_ex_out_integer ("Length", obj_desc->string.length); acpi_os_printf ("%20s : %p ", "Pointer", obj_desc->string.pointer); acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX); @@ -602,17 +603,17 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_BUFFER: - acpi_ex_out_integer ("Length", obj_desc->buffer.length); - acpi_ex_out_pointer ("Pointer", obj_desc->buffer.pointer); + acpi_ex_out_integer ("Length", obj_desc->buffer.length); + acpi_ex_out_pointer ("Pointer", obj_desc->buffer.pointer); ACPI_DUMP_BUFFER (obj_desc->buffer.pointer, obj_desc->buffer.length); break; case ACPI_TYPE_PACKAGE: - acpi_ex_out_integer ("Flags", obj_desc->package.flags); - acpi_ex_out_integer ("Count", obj_desc->package.count); - acpi_ex_out_pointer ("Elements", obj_desc->package.elements); + acpi_ex_out_integer ("Flags", obj_desc->package.flags); + acpi_ex_out_integer ("Count", obj_desc->package.count); + acpi_ex_out_pointer ("Elements", obj_desc->package.elements); /* Dump the package contents */ @@ -621,7 +622,8 @@ acpi_ex_dump_object_descriptor ( for (i = 0; i < obj_desc->package.count; i++) { acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]); if (obj_desc->package.elements[i]) { - acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i])); + acpi_os_printf (" %s", + acpi_ut_get_object_type_name (obj_desc->package.elements[i])); } acpi_os_printf ("\n"); } @@ -639,38 +641,38 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_EVENT: - acpi_ex_out_pointer ("Semaphore", obj_desc->event.semaphore); + acpi_ex_out_pointer ("Semaphore", obj_desc->event.semaphore); break; case ACPI_TYPE_METHOD: - acpi_ex_out_integer ("param_count", obj_desc->method.param_count); - acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency); - acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore); - acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id); - acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length); - acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start); + acpi_ex_out_integer ("param_count", obj_desc->method.param_count); + acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency); + acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore); + acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id); + acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length); + acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start); break; case ACPI_TYPE_MUTEX: - acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level); + acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level); acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread); - acpi_ex_out_integer ("acquisition_depth",obj_desc->mutex.acquisition_depth); - acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore); + acpi_ex_out_integer ("acquire_depth", obj_desc->mutex.acquisition_depth); + acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore); break; case ACPI_TYPE_REGION: - acpi_ex_out_integer ("space_id", obj_desc->region.space_id); - acpi_ex_out_integer ("Flags", obj_desc->region.flags); - acpi_ex_out_address ("Address", obj_desc->region.address); - acpi_ex_out_integer ("Length", obj_desc->region.length); - acpi_ex_out_pointer ("Handler", obj_desc->region.handler); - acpi_ex_out_pointer ("Next", obj_desc->region.next); + acpi_ex_out_integer ("space_id", obj_desc->region.space_id); + acpi_ex_out_integer ("Flags", obj_desc->region.flags); + acpi_ex_out_address ("Address", obj_desc->region.address); + acpi_ex_out_integer ("Length", obj_desc->region.length); + acpi_ex_out_pointer ("Handler", obj_desc->region.handler); + acpi_ex_out_pointer ("Next", obj_desc->region.next); break; @@ -686,11 +688,11 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_PROCESSOR: acpi_ex_out_integer ("Processor ID", obj_desc->processor.proc_id); - acpi_ex_out_integer ("Length", obj_desc->processor.length); - acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address); + acpi_ex_out_integer ("Length", obj_desc->processor.length); + acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address); acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify); acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify); - acpi_ex_out_pointer ("Handler", obj_desc->processor.handler); + acpi_ex_out_pointer ("Handler", obj_desc->processor.handler); break; @@ -698,7 +700,7 @@ acpi_ex_dump_object_descriptor ( acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify); acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify); - acpi_ex_out_pointer ("Handler", obj_desc->thermal_zone.handler); + acpi_ex_out_pointer ("Handler", obj_desc->thermal_zone.handler); break; @@ -707,35 +709,32 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: - acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags); - acpi_ex_out_integer ("access_byte_width", obj_desc->common_field.access_byte_width); - acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length); + acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags); + acpi_ex_out_integer ("access_byte_width",obj_desc->common_field.access_byte_width); + acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length); acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset); acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset); - acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits); - acpi_ex_out_integer ("end_fld_valid_bits", obj_desc->common_field.end_field_valid_bits); - acpi_ex_out_integer ("end_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits); - acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node); + acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node); switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_BUFFER_FIELD: - acpi_ex_out_pointer ("buffer_obj", obj_desc->buffer_field.buffer_obj); + acpi_ex_out_pointer ("buffer_obj", obj_desc->buffer_field.buffer_obj); break; case ACPI_TYPE_LOCAL_REGION_FIELD: - acpi_ex_out_pointer ("region_obj", obj_desc->field.region_obj); + acpi_ex_out_pointer ("region_obj", obj_desc->field.region_obj); break; case ACPI_TYPE_LOCAL_BANK_FIELD: - acpi_ex_out_integer ("Value", obj_desc->bank_field.value); - acpi_ex_out_pointer ("region_obj", obj_desc->bank_field.region_obj); - acpi_ex_out_pointer ("bank_obj", obj_desc->bank_field.bank_obj); + acpi_ex_out_integer ("Value", obj_desc->bank_field.value); + acpi_ex_out_pointer ("region_obj", obj_desc->bank_field.region_obj); + acpi_ex_out_pointer ("bank_obj", obj_desc->bank_field.bank_obj); break; case ACPI_TYPE_LOCAL_INDEX_FIELD: - acpi_ex_out_integer ("Value", obj_desc->index_field.value); - acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj); - acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj); + acpi_ex_out_integer ("Value", obj_desc->index_field.value); + acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj); + acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj); break; default: @@ -747,29 +746,29 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_LOCAL_REFERENCE: - acpi_ex_out_integer ("target_type", obj_desc->reference.target_type); - acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); - acpi_ex_out_integer ("Offset", obj_desc->reference.offset); - acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object); - acpi_ex_out_pointer ("Node", obj_desc->reference.node); - acpi_ex_out_pointer ("Where", obj_desc->reference.where); + acpi_ex_out_integer ("target_type", obj_desc->reference.target_type); + acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); + acpi_ex_out_integer ("Offset", obj_desc->reference.offset); + acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object); + acpi_ex_out_pointer ("Node", obj_desc->reference.node); + acpi_ex_out_pointer ("Where", obj_desc->reference.where); break; case ACPI_TYPE_LOCAL_ADDRESS_HANDLER: - acpi_ex_out_integer ("space_id", obj_desc->address_space.space_id); - acpi_ex_out_pointer ("Next", obj_desc->address_space.next); - acpi_ex_out_pointer ("region_list", obj_desc->address_space.region_list); - acpi_ex_out_pointer ("Node", obj_desc->address_space.node); - acpi_ex_out_pointer ("Context", obj_desc->address_space.context); + acpi_ex_out_integer ("space_id", obj_desc->address_space.space_id); + acpi_ex_out_pointer ("Next", obj_desc->address_space.next); + acpi_ex_out_pointer ("region_list", obj_desc->address_space.region_list); + acpi_ex_out_pointer ("Node", obj_desc->address_space.node); + acpi_ex_out_pointer ("Context", obj_desc->address_space.context); break; case ACPI_TYPE_LOCAL_NOTIFY: - acpi_ex_out_pointer ("Node", obj_desc->notify.node); - acpi_ex_out_pointer ("Context", obj_desc->notify.context); + acpi_ex_out_pointer ("Node", obj_desc->notify.node); + acpi_ex_out_pointer ("Context", obj_desc->notify.context); break; @@ -779,7 +778,8 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_LOCAL_DATA: default: - acpi_os_printf ("ex_dump_object_descriptor: Display not implemented for object type %s\n", + acpi_os_printf ( + "ex_dump_object_descriptor: Display not implemented for object type %s\n", acpi_ut_get_object_type_name (obj_desc)); break; } @@ -787,5 +787,7 @@ acpi_ex_dump_object_descriptor ( return_VOID; } +#endif /* ACPI_FUTURE_USAGE */ + #endif diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c index 2810bcc8f..be7f2124f 100644 --- a/drivers/acpi/executer/exfield.c +++ b/drivers/acpi/executer/exfield.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c index 03ccfb9e1..9d0f9d2e9 100644 --- a/drivers/acpi/executer/exfldio.c +++ b/drivers/acpi/executer/exfldio.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -139,7 +139,7 @@ acpi_ex_setup_region ( if (ACPI_ROUND_UP (rgn_desc->region.length, obj_desc->common_field.access_byte_width) >= (obj_desc->common_field.base_byte_offset + - obj_desc->common_field.access_byte_width + + (acpi_native_uint) obj_desc->common_field.access_byte_width + field_datum_byte_offset)) { return_ACPI_STATUS (AE_OK); } @@ -610,210 +610,6 @@ acpi_ex_write_with_update_rule ( } -/******************************************************************************* - * - * FUNCTION: acpi_ex_get_buffer_datum - * - * PARAMETERS: Datum - Where the Datum is returned - * Buffer - Raw field buffer - * buffer_length - Entire length (used for big-endian only) - * byte_granularity - 1/2/4/8 Granularity of the field - * (aka Datum Size) - * buffer_offset - Datum offset into the buffer - * - * RETURN: none - * - * DESCRIPTION: Get a datum from the buffer according to the buffer field - * byte granularity - * - ******************************************************************************/ - -void -acpi_ex_get_buffer_datum ( - acpi_integer *datum, - void *buffer, - u32 buffer_length, - u32 byte_granularity, - u32 buffer_offset) -{ - u32 index; - - - ACPI_FUNCTION_TRACE_U32 ("ex_get_buffer_datum", byte_granularity); - - - /* Get proper index into buffer (handles big/little endian) */ - - index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity); - - /* Move the requested number of bytes */ - - switch (byte_granularity) { - case ACPI_FIELD_BYTE_GRANULARITY: - - *datum = ((u8 *) buffer) [index]; - break; - - case ACPI_FIELD_WORD_GRANULARITY: - - ACPI_MOVE_16_TO_64 (datum, &(((u16 *) buffer) [index])); - break; - - case ACPI_FIELD_DWORD_GRANULARITY: - - ACPI_MOVE_32_TO_64 (datum, &(((u32 *) buffer) [index])); - break; - - case ACPI_FIELD_QWORD_GRANULARITY: - - ACPI_MOVE_64_TO_64 (datum, &(((u64 *) buffer) [index])); - break; - - default: - /* Should not get here */ - break; - } - - return_VOID; -} - - -/******************************************************************************* - * - * FUNCTION: acpi_ex_set_buffer_datum - * - * PARAMETERS: merged_datum - Value to store - * Buffer - Receiving buffer - * buffer_length - Entire length (used for big-endian only) - * byte_granularity - 1/2/4/8 Granularity of the field - * (aka Datum Size) - * buffer_offset - Datum offset into the buffer - * - * RETURN: none - * - * DESCRIPTION: Store the merged datum to the buffer according to the - * byte granularity - * - ******************************************************************************/ - -void -acpi_ex_set_buffer_datum ( - acpi_integer merged_datum, - void *buffer, - u32 buffer_length, - u32 byte_granularity, - u32 buffer_offset) -{ - u32 index; - - - ACPI_FUNCTION_TRACE_U32 ("ex_set_buffer_datum", byte_granularity); - - - /* Get proper index into buffer (handles big/little endian) */ - - index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity); - - /* Move the requested number of bytes */ - - switch (byte_granularity) { - case ACPI_FIELD_BYTE_GRANULARITY: - - ((u8 *) buffer) [index] = (u8) merged_datum; - break; - - case ACPI_FIELD_WORD_GRANULARITY: - - ACPI_MOVE_64_TO_16 (&(((u16 *) buffer)[index]), &merged_datum); - break; - - case ACPI_FIELD_DWORD_GRANULARITY: - - ACPI_MOVE_64_TO_32 (&(((u32 *) buffer)[index]), &merged_datum); - break; - - case ACPI_FIELD_QWORD_GRANULARITY: - - ACPI_MOVE_64_TO_64 (&(((u64 *) buffer)[index]), &merged_datum); - break; - - default: - /* Should not get here */ - break; - } - - return_VOID; -} - - -/******************************************************************************* - * - * FUNCTION: acpi_ex_common_buffer_setup - * - * PARAMETERS: obj_desc - Field object - * buffer_length - Length of caller's buffer - * datum_count - Where the datum_count is returned - * - * RETURN: Status, datum_count - * - * DESCRIPTION: Common code to validate the incoming buffer size and compute - * the number of field "datums" that must be read or written. - * A "datum" is the smallest unit that can be read or written - * to the field, it is either 1,2,4, or 8 bytes. - * - ******************************************************************************/ - -acpi_status -acpi_ex_common_buffer_setup ( - union acpi_operand_object *obj_desc, - u32 buffer_length, - u32 *datum_count) -{ - u32 byte_field_length; - u32 actual_byte_field_length; - - - ACPI_FUNCTION_TRACE ("ex_common_buffer_setup"); - - - /* - * Incoming buffer must be at least as long as the field, we do not - * allow "partial" field reads/writes. We do not care if the buffer is - * larger than the field, this typically happens when an integer is - * read/written to a field that is actually smaller than an integer. - */ - byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES ( - obj_desc->common_field.bit_length); - if (byte_field_length > buffer_length) { - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Field size %X (bytes) is too large for buffer (%X)\n", - byte_field_length, buffer_length)); - - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); - } - - /* - * Create "actual" field byte count (minimum number of bytes that - * must be read), then convert to datum count (minimum number - * of datum-sized units that must be read) - */ - actual_byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES ( - obj_desc->common_field.start_field_bit_offset + - obj_desc->common_field.bit_length); - - - *datum_count = ACPI_ROUND_UP_TO (actual_byte_field_length, - obj_desc->common_field.access_byte_width); - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "buffer_bytes %X, actual_bytes %X, Datums %X, byte_gran %X\n", - byte_field_length, actual_byte_field_length, - *datum_count, obj_desc->common_field.access_byte_width)); - - return_ACPI_STATUS (AE_OK); -} - - /******************************************************************************* * * FUNCTION: acpi_ex_extract_from_field @@ -835,128 +631,92 @@ acpi_ex_extract_from_field ( u32 buffer_length) { acpi_status status; - u32 field_datum_byte_offset; - u32 buffer_datum_offset; - acpi_integer previous_raw_datum = 0; - acpi_integer this_raw_datum = 0; - acpi_integer merged_datum = 0; + acpi_integer raw_datum; + acpi_integer merged_datum; + u32 field_offset = 0; + u32 buffer_offset = 0; + u32 buffer_tail_bits; u32 datum_count; + u32 field_datum_count; u32 i; ACPI_FUNCTION_TRACE ("ex_extract_from_field"); - /* Validate buffer, compute number of datums */ + /* Validate target buffer and clear it */ - status = acpi_ex_common_buffer_setup (obj_desc, buffer_length, &datum_count); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + if (buffer_length < ACPI_ROUND_BITS_UP_TO_BYTES ( + obj_desc->common_field.bit_length)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Field size %X (bits) is too large for buffer (%X)\n", + obj_desc->common_field.bit_length, buffer_length)); - /* - * Clear the caller's buffer (the whole buffer length as given) - * This is very important, especially in the cases where the buffer - * is longer than the size of the field. - */ + return_ACPI_STATUS (AE_BUFFER_OVERFLOW); + } ACPI_MEMSET (buffer, 0, buffer_length); - field_datum_byte_offset = 0; - buffer_datum_offset= 0; - - /* Read the entire field */ - - for (i = 0; i < datum_count; i++) { - status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, - &this_raw_datum, ACPI_READ); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* We might actually be done if the request fits in one datum */ - - if ((datum_count == 1) && - (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { - /* 1) Shift the valid data bits down to start at bit 0 */ + /* Compute the number of datums (access width data items) */ - merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset); + datum_count = ACPI_ROUND_UP_TO ( + obj_desc->common_field.bit_length, + obj_desc->common_field.access_bit_width); + field_datum_count = ACPI_ROUND_UP_TO ( + obj_desc->common_field.bit_length + + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.access_bit_width); - /* 2) Mask off any upper unused bits (bits not part of the field) */ + /* Priming read from the field */ - if (obj_desc->common_field.end_buffer_valid_bits) { - merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); - } + status = acpi_ex_field_datum_io (obj_desc, field_offset, &raw_datum, ACPI_READ); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + merged_datum = raw_datum >> obj_desc->common_field.start_field_bit_offset; - /* Store the datum to the caller buffer */ + /* Read the rest of the field */ - acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, buffer_datum_offset); + for (i = 1; i < field_datum_count; i++) { + /* Get next input datum from the field */ - return_ACPI_STATUS (AE_OK); + field_offset += obj_desc->common_field.access_byte_width; + status = acpi_ex_field_datum_io (obj_desc, field_offset, + &raw_datum, ACPI_READ); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - /* Special handling for the last datum to ignore extra bits */ - - if ((i >= (datum_count -1)) && - (obj_desc->common_field.end_field_valid_bits)) { - /* - * This is the last iteration of the loop. We need to clear - * any unused bits (bits that are not part of this field) before - * we store the final merged datum into the caller buffer. - */ - this_raw_datum &= - ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); - } + /* Merge with previous datum if necessary */ - /* - * Create the (possibly) merged datum to be stored to the caller buffer - */ - if (obj_desc->common_field.start_field_bit_offset == 0) { - /* Field is not skewed and we can just copy the datum */ + merged_datum |= raw_datum << + (obj_desc->common_field.access_bit_width - obj_desc->common_field.start_field_bit_offset); - acpi_ex_set_buffer_datum (this_raw_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, buffer_datum_offset); - buffer_datum_offset++; + if (i == datum_count) { + break; } - else { - /* Not aligned -- on the first iteration, just save the datum */ - if (i != 0) { - /* - * Put together the appropriate bits of the two raw data to make a - * single complete field datum - * - * 1) Normalize the first datum down to bit 0 - */ - merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset); + /* Write merged datum to target buffer */ - /* 2) Insert the second datum "above" the first datum */ + ACPI_MEMCPY (((char *) buffer) + buffer_offset, &merged_datum, + ACPI_MIN(obj_desc->common_field.access_byte_width, + buffer_length - buffer_offset)); - merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits); - - acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, buffer_datum_offset); - buffer_datum_offset++; - } + buffer_offset += obj_desc->common_field.access_byte_width; + merged_datum = raw_datum >> obj_desc->common_field.start_field_bit_offset; + } - /* - * Save the raw datum that was just acquired since it may contain bits - * of the *next* field datum - */ - previous_raw_datum = this_raw_datum; - } + /* Mask off any extra bits in the last datum */ - field_datum_byte_offset += obj_desc->common_field.access_byte_width; + buffer_tail_bits = obj_desc->common_field.bit_length % obj_desc->common_field.access_bit_width; + if (buffer_tail_bits) { + merged_datum &= ACPI_MASK_BITS_ABOVE (buffer_tail_bits); } - /* For non-aligned case, there is one last datum to insert */ + /* Write the last datum to the buffer */ - if (obj_desc->common_field.start_field_bit_offset != 0) { - merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset); - - acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, buffer_datum_offset); - } + ACPI_MEMCPY (((char *) buffer) + buffer_offset, &merged_datum, + ACPI_MIN(obj_desc->common_field.access_byte_width, + buffer_length - buffer_offset)); return_ACPI_STATUS (AE_OK); } @@ -983,169 +743,91 @@ acpi_ex_insert_into_field ( u32 buffer_length) { acpi_status status; - u32 field_datum_byte_offset; - u32 datum_offset; acpi_integer mask; acpi_integer merged_datum; - acpi_integer previous_raw_datum; - acpi_integer this_raw_datum; + acpi_integer raw_datum = 0; + u32 field_offset = 0; + u32 buffer_offset = 0; + u32 buffer_tail_bits; u32 datum_count; + u32 field_datum_count; + u32 i; ACPI_FUNCTION_TRACE ("ex_insert_into_field"); - /* Validate buffer, compute number of datums */ - - status = acpi_ex_common_buffer_setup (obj_desc, buffer_length, &datum_count); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* - * Break the request into up to three parts (similar to an I/O request): - * 1) non-aligned part at start - * 2) aligned part in middle - * 3) non-aligned part at the end - */ - field_datum_byte_offset = 0; - datum_offset= 0; - - /* Get a single datum from the caller's buffer */ - - acpi_ex_get_buffer_datum (&previous_raw_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, datum_offset); - - /* - * Part1: - * Write a partial field datum if field does not begin on a datum boundary - * Note: The code in this section also handles the aligned case - * - * Construct Mask with 1 bits where the field is, 0 bits elsewhere - * (Only the bottom 5 bits of bit_length are valid for a shift operation) - * - * Mask off bits that are "below" the field (if any) - */ - mask = ACPI_MASK_BITS_BELOW (obj_desc->common_field.start_field_bit_offset); - - /* If the field fits in one datum, may need to mask upper bits */ + /* Validate input buffer */ - if ((obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM) && - obj_desc->common_field.end_field_valid_bits) { - /* There are bits above the field, mask them off also */ + if (buffer_length < ACPI_ROUND_BITS_UP_TO_BYTES ( + obj_desc->common_field.bit_length)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Field size %X (bits) is too large for buffer (%X)\n", + obj_desc->common_field.bit_length, buffer_length)); - mask &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); + return_ACPI_STATUS (AE_BUFFER_OVERFLOW); } - /* Shift and mask the value into the field position */ - - merged_datum = (previous_raw_datum << obj_desc->common_field.start_field_bit_offset); - merged_datum &= mask; - - /* Apply the update rule (if necessary) and write the datum to the field */ + /* Compute the number of datums (access width data items) */ - status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, - field_datum_byte_offset); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + mask = ACPI_MASK_BITS_BELOW (obj_desc->common_field.start_field_bit_offset); + datum_count = ACPI_ROUND_UP_TO (obj_desc->common_field.bit_length, + obj_desc->common_field.access_bit_width); + field_datum_count = ACPI_ROUND_UP_TO (obj_desc->common_field.bit_length + + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.access_bit_width); - /* We just wrote the first datum */ + /* Get initial Datum from the input buffer */ - datum_offset++; + ACPI_MEMCPY (&raw_datum, buffer, + ACPI_MIN(obj_desc->common_field.access_byte_width, + buffer_length - buffer_offset)); - /* If the entire field fits within one datum, we are done. */ + merged_datum = raw_datum << obj_desc->common_field.start_field_bit_offset; - if ((datum_count == 1) && - (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { - return_ACPI_STATUS (AE_OK); - } + /* Write the entire field */ - /* - * Part2: - * Write the aligned data. - * - * We don't need to worry about the update rule for these data, because - * all of the bits in each datum are part of the field. - * - * The last datum must be special cased because it might contain bits - * that are not part of the field -- therefore the "update rule" must be - * applied in Part3 below. - */ - while (datum_offset < datum_count) { - field_datum_byte_offset += obj_desc->common_field.access_byte_width; + for (i = 1; i < field_datum_count; i++) { + /* Write merged datum to the target field */ - /* - * Get the next raw buffer datum. It may contain bits of the previous - * field datum - */ - acpi_ex_get_buffer_datum (&this_raw_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, datum_offset); + merged_datum &= mask; + status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, field_offset); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - /* Create the field datum based on the field alignment */ + /* Start new output datum by merging with previous input datum */ - if (obj_desc->common_field.start_field_bit_offset != 0) { - /* - * Put together appropriate bits of the two raw buffer data to make - * a single complete field datum - */ - merged_datum = - (previous_raw_datum >> obj_desc->common_field.datum_valid_bits) | - (this_raw_datum << obj_desc->common_field.start_field_bit_offset); - } - else { - /* Field began aligned on datum boundary */ + field_offset += obj_desc->common_field.access_byte_width; + merged_datum = raw_datum >> + (obj_desc->common_field.access_bit_width - obj_desc->common_field.start_field_bit_offset); + mask = ACPI_INTEGER_MAX; - merged_datum = this_raw_datum; + if (i == datum_count) { + break; } - /* - * Special handling for the last datum if the field does NOT end on - * a datum boundary. Update Rule must be applied to the bits outside - * the field. - */ - datum_offset++; - if ((datum_offset == datum_count) && - (obj_desc->common_field.end_field_valid_bits)) { - /* - * If there are dangling non-aligned bits, perform one more merged write - * Else - field is aligned at the end, no need for any more writes - */ + /* Get the next input datum from the buffer */ - /* - * Part3: - * This is the last datum and the field does not end on a datum boundary. - * Build the partial datum and write with the update rule. - * - * Mask off the unused bits above (after) the end-of-field - */ - mask = ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); - merged_datum &= mask; + buffer_offset += obj_desc->common_field.access_byte_width; + ACPI_MEMCPY (&raw_datum, ((char *) buffer) + buffer_offset, + ACPI_MIN(obj_desc->common_field.access_byte_width, + buffer_length - buffer_offset)); + merged_datum |= raw_datum << obj_desc->common_field.start_field_bit_offset; + } - /* Write the last datum with the update rule */ + /* Mask off any extra bits in the last datum */ - status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, - field_datum_byte_offset); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - } - else { - /* Normal (aligned) case -- write the completed datum */ + buffer_tail_bits = (obj_desc->common_field.bit_length + + obj_desc->common_field.start_field_bit_offset) % obj_desc->common_field.access_bit_width; + if (buffer_tail_bits) { + mask &= ACPI_MASK_BITS_ABOVE (buffer_tail_bits); + } - status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, - &merged_datum, ACPI_WRITE); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - } + /* Write the last datum to the field */ - /* - * Save the most recent datum since it may contain bits of the *next* - * field datum. Update current byte offset. - */ - previous_raw_datum = this_raw_datum; - } + merged_datum &= mask; + status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, field_offset); return_ACPI_STATUS (status); } diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c index 961a949e9..fc54d4d0c 100644 --- a/drivers/acpi/executer/exmisc.c +++ b/drivers/acpi/executer/exmisc.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -149,8 +149,9 @@ acpi_ex_get_object_reference ( * * FUNCTION: acpi_ex_concat_template * - * PARAMETERS: *obj_desc - Object to be converted. Must be an - * Integer, Buffer, or String + * PARAMETERS: Operand0 - First source object + * Operand1 - Second source object + * actual_return_desc - Where to place the return object * walk_state - Current walk state * * RETURN: Status @@ -161,8 +162,8 @@ acpi_ex_get_object_reference ( acpi_status acpi_ex_concat_template ( - union acpi_operand_object *obj_desc1, - union acpi_operand_object *obj_desc2, + union acpi_operand_object *operand0, + union acpi_operand_object *operand1, union acpi_operand_object **actual_return_desc, struct acpi_walk_state *walk_state) { @@ -179,16 +180,16 @@ acpi_ex_concat_template ( /* Find the end_tags in each resource template */ - end_tag1 = acpi_ut_get_resource_end_tag (obj_desc1); - end_tag2 = acpi_ut_get_resource_end_tag (obj_desc2); + end_tag1 = acpi_ut_get_resource_end_tag (operand0); + end_tag2 = acpi_ut_get_resource_end_tag (operand1); if (!end_tag1 || !end_tag2) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Compute the length of each part */ - length1 = ACPI_PTR_DIFF (end_tag1, obj_desc1->buffer.pointer); - length2 = ACPI_PTR_DIFF (end_tag2, obj_desc2->buffer.pointer) + + length1 = ACPI_PTR_DIFF (end_tag1, operand0->buffer.pointer); + length2 = ACPI_PTR_DIFF (end_tag2, operand1->buffer.pointer) + 2; /* Size of END_TAG */ /* Create a new buffer object for the result */ @@ -201,8 +202,8 @@ acpi_ex_concat_template ( /* Copy the templates to the new descriptor */ new_buf = return_desc->buffer.pointer; - ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, length1); - ACPI_MEMCPY (new_buf + length1, obj_desc2->buffer.pointer, length2); + ACPI_MEMCPY (new_buf, operand0->buffer.pointer, length1); + ACPI_MEMCPY (new_buf + length1, operand1->buffer.pointer, length2); /* Compute the new checksum */ @@ -221,8 +222,8 @@ acpi_ex_concat_template ( * * FUNCTION: acpi_ex_do_concatenate * - * PARAMETERS: obj_desc1 - First source object - * obj_desc2 - Second source object + * PARAMETERS: Operand0 - First source object + * Operand1 - Second source object * actual_return_desc - Where to place the return object * walk_state - Current walk state * @@ -234,20 +235,57 @@ acpi_ex_concat_template ( acpi_status acpi_ex_do_concatenate ( - union acpi_operand_object *obj_desc1, - union acpi_operand_object *obj_desc2, + union acpi_operand_object *operand0, + union acpi_operand_object *operand1, union acpi_operand_object **actual_return_desc, struct acpi_walk_state *walk_state) { - acpi_status status; - u32 i; - acpi_integer this_integer; + union acpi_operand_object *local_operand1 = operand1; union acpi_operand_object *return_desc; char *new_buf; + acpi_status status; + acpi_size new_length; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("ex_do_concatenate"); + + + /* + * Convert the second operand if necessary. The first operand + * determines the type of the second operand, (See the Data Types + * section of the ACPI specification.) Both object types are + * guaranteed to be either Integer/String/Buffer by the operand + * resolution mechanism. + */ + switch (ACPI_GET_OBJECT_TYPE (operand0)) { + case ACPI_TYPE_INTEGER: + status = acpi_ex_convert_to_integer (operand1, &local_operand1, 16); + break; + + case ACPI_TYPE_STRING: + status = acpi_ex_convert_to_string (operand1, &local_operand1, + ACPI_IMPLICIT_CONVERT_HEX); + break; + + case ACPI_TYPE_BUFFER: + status = acpi_ex_convert_to_buffer (operand1, &local_operand1); + break; + + default: + ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n", + ACPI_GET_OBJECT_TYPE (operand0))); + status = AE_AML_INTERNAL; + } + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + /* + * Both operands are now known to be the same object type + * (Both are Integer, String, or Buffer), and we can now perform the + * concatenation. + */ /* * There are three cases to handle: @@ -256,113 +294,102 @@ acpi_ex_do_concatenate ( * 2) Two Strings concatenated to produce a new String * 3) Two Buffers concatenated to produce a new Buffer */ - switch (ACPI_GET_OBJECT_TYPE (obj_desc1)) { + switch (ACPI_GET_OBJECT_TYPE (operand0)) { case ACPI_TYPE_INTEGER: /* Result of two Integers is a Buffer */ /* Need enough buffer space for two integers */ - return_desc = acpi_ut_create_buffer_object (acpi_gbl_integer_byte_width * 2); + return_desc = acpi_ut_create_buffer_object ( + ACPI_MUL_2 (acpi_gbl_integer_byte_width)); if (!return_desc) { - return (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup; } new_buf = (char *) return_desc->buffer.pointer; - /* Convert the first integer */ - - this_integer = obj_desc1->integer.value; - for (i = 0; i < acpi_gbl_integer_byte_width; i++) { - new_buf[i] = (char) this_integer; - this_integer >>= 8; - } + /* Copy the first integer, LSB first */ - /* Convert the second integer */ + ACPI_MEMCPY (new_buf, + &operand0->integer.value, + acpi_gbl_integer_byte_width); - this_integer = obj_desc2->integer.value; - for (; i < (ACPI_MUL_2 (acpi_gbl_integer_byte_width)); i++) { - new_buf[i] = (char) this_integer; - this_integer >>= 8; - } + /* Copy the second integer (LSB first) after the first */ + ACPI_MEMCPY (new_buf + acpi_gbl_integer_byte_width, + &local_operand1->integer.value, + acpi_gbl_integer_byte_width); break; - case ACPI_TYPE_STRING: /* Result of two Strings is a String */ - return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); - if (!return_desc) { - return (AE_NO_MEMORY); + new_length = (acpi_size) operand0->string.length + + (acpi_size) local_operand1->string.length; + if (new_length > ACPI_MAX_STRING_CONVERSION) { + status = AE_AML_STRING_LIMIT; + goto cleanup; } - /* Operand0 is string */ - - new_buf = ACPI_MEM_CALLOCATE ((acpi_size) obj_desc1->string.length + - (acpi_size) obj_desc2->string.length + 1); - if (!new_buf) { - ACPI_REPORT_ERROR - (("ex_do_concatenate: String allocation failure\n")); + return_desc = acpi_ut_create_string_object (new_length); + if (!return_desc) { status = AE_NO_MEMORY; goto cleanup; } - /* Concatenate the strings */ + new_buf = return_desc->string.pointer; - ACPI_STRCPY (new_buf, obj_desc1->string.pointer); - ACPI_STRCPY (new_buf + obj_desc1->string.length, - obj_desc2->string.pointer); - - /* Complete the String object initialization */ + /* Concatenate the strings */ - return_desc->string.pointer = new_buf; - return_desc->string.length = obj_desc1->string.length + - obj_desc2->string.length; + ACPI_STRCPY (new_buf, + operand0->string.pointer); + ACPI_STRCPY (new_buf + operand0->string.length, + local_operand1->string.pointer); break; - case ACPI_TYPE_BUFFER: /* Result of two Buffers is a Buffer */ return_desc = acpi_ut_create_buffer_object ( - (acpi_size) obj_desc1->buffer.length + - (acpi_size) obj_desc2->buffer.length); + (acpi_size) operand0->buffer.length + + (acpi_size) local_operand1->buffer.length); if (!return_desc) { - return (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup; } new_buf = (char *) return_desc->buffer.pointer; /* Concatenate the buffers */ - ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, - obj_desc1->buffer.length); - ACPI_MEMCPY (new_buf + obj_desc1->buffer.length, obj_desc2->buffer.pointer, - obj_desc2->buffer.length); - + ACPI_MEMCPY (new_buf, + operand0->buffer.pointer, + operand0->buffer.length); + ACPI_MEMCPY (new_buf + operand0->buffer.length, + local_operand1->buffer.pointer, + local_operand1->buffer.length); break; - default: /* Invalid object type, should not happen here */ - ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n", - ACPI_GET_OBJECT_TYPE (obj_desc1))); - status = AE_AML_INTERNAL; - return_desc = NULL; + ACPI_REPORT_ERROR (("Concatenate - Invalid object type: %X\n", + ACPI_GET_OBJECT_TYPE (operand0))); + status =AE_AML_INTERNAL; + goto cleanup; } *actual_return_desc = return_desc; - return (AE_OK); - cleanup: - - acpi_ut_remove_reference (return_desc); - return (status); + if (local_operand1 != operand1) { + acpi_ut_remove_reference (local_operand1); + } + return_ACPI_STATUS (status); } @@ -371,8 +398,8 @@ cleanup: * FUNCTION: acpi_ex_do_math_op * * PARAMETERS: Opcode - AML opcode - * Operand0 - Integer operand #0 - * Operand1 - Integer operand #1 + * Integer0 - Integer operand #0 + * Integer1 - Integer operand #1 * * RETURN: Integer result of the operation * @@ -385,62 +412,62 @@ cleanup: acpi_integer acpi_ex_do_math_op ( u16 opcode, - acpi_integer operand0, - acpi_integer operand1) + acpi_integer integer0, + acpi_integer integer1) { ACPI_FUNCTION_ENTRY (); switch (opcode) { - case AML_ADD_OP: /* Add (Operand0, Operand1, Result) */ + case AML_ADD_OP: /* Add (Integer0, Integer1, Result) */ - return (operand0 + operand1); + return (integer0 + integer1); - case AML_BIT_AND_OP: /* And (Operand0, Operand1, Result) */ + case AML_BIT_AND_OP: /* And (Integer0, Integer1, Result) */ - return (operand0 & operand1); + return (integer0 & integer1); - case AML_BIT_NAND_OP: /* NAnd (Operand0, Operand1, Result) */ + case AML_BIT_NAND_OP: /* NAnd (Integer0, Integer1, Result) */ - return (~(operand0 & operand1)); + return (~(integer0 & integer1)); - case AML_BIT_OR_OP: /* Or (Operand0, Operand1, Result) */ + case AML_BIT_OR_OP: /* Or (Integer0, Integer1, Result) */ - return (operand0 | operand1); + return (integer0 | integer1); - case AML_BIT_NOR_OP: /* NOr (Operand0, Operand1, Result) */ + case AML_BIT_NOR_OP: /* NOr (Integer0, Integer1, Result) */ - return (~(operand0 | operand1)); + return (~(integer0 | integer1)); - case AML_BIT_XOR_OP: /* XOr (Operand0, Operand1, Result) */ + case AML_BIT_XOR_OP: /* XOr (Integer0, Integer1, Result) */ - return (operand0 ^ operand1); + return (integer0 ^ integer1); - case AML_MULTIPLY_OP: /* Multiply (Operand0, Operand1, Result) */ + case AML_MULTIPLY_OP: /* Multiply (Integer0, Integer1, Result) */ - return (operand0 * operand1); + return (integer0 * integer1); case AML_SHIFT_LEFT_OP: /* shift_left (Operand, shift_count, Result) */ - return (operand0 << operand1); + return (integer0 << integer1); case AML_SHIFT_RIGHT_OP: /* shift_right (Operand, shift_count, Result) */ - return (operand0 >> operand1); + return (integer0 >> integer1); - case AML_SUBTRACT_OP: /* Subtract (Operand0, Operand1, Result) */ + case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */ - return (operand0 - operand1); + return (integer0 - integer1); default: @@ -449,22 +476,86 @@ acpi_ex_do_math_op ( } +/******************************************************************************* + * + * FUNCTION: acpi_ex_do_logical_numeric_op + * + * PARAMETERS: Opcode - AML opcode + * Integer0 - Integer operand #0 + * Integer1 - Integer operand #1 + * logical_result - TRUE/FALSE result of the operation + * + * RETURN: Status + * + * DESCRIPTION: Execute a logical "Numeric" AML opcode. For these Numeric + * operators (LAnd and LOr), both operands must be integers. + * + * Note: cleanest machine code seems to be produced by the code + * below, rather than using statements of the form: + * Result = (Integer0 && Integer1); + * + ******************************************************************************/ + +acpi_status +acpi_ex_do_logical_numeric_op ( + u16 opcode, + acpi_integer integer0, + acpi_integer integer1, + u8 *logical_result) +{ + acpi_status status = AE_OK; + u8 local_result = FALSE; + + + ACPI_FUNCTION_TRACE ("ex_do_logical_numeric_op"); + + + switch (opcode) { + case AML_LAND_OP: /* LAnd (Integer0, Integer1) */ + + if (integer0 && integer1) { + local_result = TRUE; + } + break; + + case AML_LOR_OP: /* LOr (Integer0, Integer1) */ + + if (integer0 || integer1) { + local_result = TRUE; + } + break; + + default: + status = AE_AML_INTERNAL; + break; + } + + /* Return the logical result and status */ + + *logical_result = local_result; + return_ACPI_STATUS (status); +} + + /******************************************************************************* * * FUNCTION: acpi_ex_do_logical_op * * PARAMETERS: Opcode - AML opcode - * obj_desc0 - operand #0 - * obj_desc1 - operand #1 + * Operand0 - operand #0 + * Operand1 - operand #1 + * logical_result - TRUE/FALSE result of the operation * - * RETURN: TRUE/FALSE result of the operation + * RETURN: Status * * DESCRIPTION: Execute a logical AML opcode. The purpose of having all of the * functions here is to prevent a lot of pointer dereferencing * to obtain the operands and to simplify the generation of the - * logical value. Both operands must already be validated as - * 1) Both the same type, and - * 2) Either Integer, Buffer, or String type. + * logical value. For the Numeric operators (LAnd and LOr), both + * operands must be integers. For the other logical operators, + * operands can be any combination of Integer/String/Buffer. The + * first operand determines the type to which the second operand + * will be converted. * * Note: cleanest machine code seems to be produced by the code * below, rather than using statements of the form: @@ -472,143 +563,175 @@ acpi_ex_do_math_op ( * ******************************************************************************/ -u8 +acpi_status acpi_ex_do_logical_op ( u16 opcode, - union acpi_operand_object *obj_desc0, - union acpi_operand_object *obj_desc1) + union acpi_operand_object *operand0, + union acpi_operand_object *operand1, + u8 *logical_result) { - acpi_integer operand0; - acpi_integer operand1; - u8 *ptr0; - u8 *ptr1; + union acpi_operand_object *local_operand1 = operand1; + acpi_integer integer0; + acpi_integer integer1; u32 length0; u32 length1; - u32 i; + acpi_status status = AE_OK; + u8 local_result = FALSE; + int compare; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("ex_do_logical_op"); - if (ACPI_GET_OBJECT_TYPE (obj_desc0) == ACPI_TYPE_INTEGER) { - /* Both operands are of type integer */ + /* + * Convert the second operand if necessary. The first operand + * determines the type of the second operand, (See the Data Types + * section of the ACPI 3.0+ specification.) Both object types are + * guaranteed to be either Integer/String/Buffer by the operand + * resolution mechanism. + */ + switch (ACPI_GET_OBJECT_TYPE (operand0)) { + case ACPI_TYPE_INTEGER: + status = acpi_ex_convert_to_integer (operand1, &local_operand1, 16); + break; - operand0 = obj_desc0->integer.value; - operand1 = obj_desc1->integer.value; + case ACPI_TYPE_STRING: + status = acpi_ex_convert_to_string (operand1, &local_operand1, + ACPI_IMPLICIT_CONVERT_HEX); + break; - switch (opcode) { - case AML_LAND_OP: /* LAnd (Operand0, Operand1) */ + case ACPI_TYPE_BUFFER: + status = acpi_ex_convert_to_buffer (operand1, &local_operand1); + break; - if (operand0 && operand1) { - return (TRUE); - } - break; + default: + status = AE_AML_INTERNAL; + break; + } + + if (ACPI_FAILURE (status)) { + goto cleanup; + } + /* + * Two cases: 1) Both Integers, 2) Both Strings or Buffers + */ + if (ACPI_GET_OBJECT_TYPE (operand0) == ACPI_TYPE_INTEGER) { + /* + * 1) Both operands are of type integer + * Note: local_operand1 may have changed above + */ + integer0 = operand0->integer.value; + integer1 = local_operand1->integer.value; + + switch (opcode) { case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */ - if (operand0 == operand1) { - return (TRUE); + if (integer0 == integer1) { + local_result = TRUE; } break; case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */ - if (operand0 > operand1) { - return (TRUE); + if (integer0 > integer1) { + local_result = TRUE; } break; case AML_LLESS_OP: /* LLess (Operand0, Operand1) */ - if (operand0 < operand1) { - return (TRUE); - } - break; - - case AML_LOR_OP: /* LOr (Operand0, Operand1) */ - - if (operand0 || operand1) { - return (TRUE); + if (integer0 < integer1) { + local_result = TRUE; } break; default: + status = AE_AML_INTERNAL; break; } } else { /* - * Case for Buffer/String objects. - * NOTE: takes advantage of common Buffer/String object fields + * 2) Both operands are Strings or both are Buffers + * Note: Code below takes advantage of common Buffer/String + * object fields. local_operand1 may have changed above. Use + * memcmp to handle nulls in buffers. */ - length0 = obj_desc0->buffer.length; - ptr0 = obj_desc0->buffer.pointer; + length0 = operand0->buffer.length; + length1 = local_operand1->buffer.length; - length1 = obj_desc1->buffer.length; - ptr1 = obj_desc1->buffer.pointer; + /* Lexicographic compare: compare the data bytes */ + + compare = ACPI_MEMCMP ((const char * ) operand0->buffer.pointer, + (const char * ) local_operand1->buffer.pointer, + (length0 > length1) ? length1 : length0); switch (opcode) { case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */ /* Length and all bytes must be equal */ - if (length0 != length1) { - return (FALSE); - } + if ((length0 == length1) && + (compare == 0)) { + /* Length and all bytes match ==> TRUE */ - for (i = 0; i < length0; i++) { - if (ptr0[i] != ptr1[i]) { - return (FALSE); - } + local_result = TRUE; } - return (TRUE); + break; case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */ - /* Lexicographic compare: Scan the 1-to-1 data */ - - for (i = 0; (i < length0) && (i < length1); i++) { - if (ptr0[i] > ptr1[i]) { - return (TRUE); - } + if (compare > 0) { + local_result = TRUE; + goto cleanup; /* TRUE */ + } + if (compare < 0) { + goto cleanup; /* FALSE */ } - /* Bytes match, now check lengths */ + /* Bytes match (to shortest length), compare lengths */ if (length0 > length1) { - return (TRUE); + local_result = TRUE; } - - /* Length0 <= Length1 */ - - return (FALSE); + break; case AML_LLESS_OP: /* LLess (Operand0, Operand1) */ - /* Lexicographic compare: Scan the 1-to-1 data */ - - for (i = 0; (i < length0) && (i < length1); i++) { - if (ptr0[i] < ptr1[i]) { - return (TRUE); - } + if (compare > 0) { + goto cleanup; /* FALSE */ + } + if (compare < 0) { + local_result = TRUE; + goto cleanup; /* TRUE */ } - /* Bytes match, now check lengths */ + /* Bytes match (to shortest length), compare lengths */ if (length0 < length1) { - return (TRUE); + local_result = TRUE; } - - /* Length0 >= Length1 */ - - return (FALSE); + break; default: + status = AE_AML_INTERNAL; break; } } - return (FALSE); +cleanup: + + /* New object was created if implicit conversion performed - delete */ + + if (local_operand1 != operand1) { + acpi_ut_remove_reference (local_operand1); + } + + /* Return the logical result and status */ + + *logical_result = local_result; + return_ACPI_STATUS (status); } diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c index c709ed2f5..68c4bb197 100644 --- a/drivers/acpi/executer/exmutex.c +++ b/drivers/acpi/executer/exmutex.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c index 9fb44d44b..7911c533c 100644 --- a/drivers/acpi/executer/exnames.c +++ b/drivers/acpi/executer/exnames.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c index 8ba1e6469..8482aefaf 100644 --- a/drivers/acpi/executer/exoparg1.c +++ b/drivers/acpi/executer/exoparg1.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ * Where: * * xA - ARGUMENTS: The number of arguments (input operands) that are - * required for this opcode type (1 through 6 args). + * required for this opcode type (0 through 6 args). * yT - TARGETS: The number of targets (output operands) that are required * for this opcode type (0, 1, or 2 targets). * zR - RETURN VALUE: Indicates whether this opcode type returns a value @@ -77,6 +77,69 @@ * fully resolved operands. !*/ +/******************************************************************************* + * + * FUNCTION: acpi_ex_opcode_0A_0T_1R + * + * PARAMETERS: walk_state - Current state (contains AML opcode) + * + * RETURN: Status + * + * DESCRIPTION: Execute operator with no operands, one return value + * + ******************************************************************************/ + +acpi_status +acpi_ex_opcode_0A_0T_1R ( + struct acpi_walk_state *walk_state) +{ + acpi_status status = AE_OK; + union acpi_operand_object *return_desc = NULL; + + + ACPI_FUNCTION_TRACE_STR ("ex_opcode_0A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + + + /* Examine the AML opcode */ + + switch (walk_state->opcode) { + case AML_TIMER_OP: /* Timer () */ + + /* Create a return object of type Integer */ + + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!return_desc) { + status = AE_NO_MEMORY; + goto cleanup; + } + + return_desc->integer.value = acpi_os_get_timer (); + break; + + default: /* Unknown opcode */ + + ACPI_REPORT_ERROR (("acpi_ex_opcode_0A_0T_1R: Unknown opcode %X\n", + walk_state->opcode)); + status = AE_AML_BAD_OPCODE; + break; + } + +cleanup: + + if (!walk_state->result_obj) { + walk_state->result_obj = return_desc; + } + + /* Delete return object on error */ + + if (ACPI_FAILURE (status)) { + acpi_ut_remove_reference (return_desc); + } + + return_ACPI_STATUS (status); +} + + /******************************************************************************* * * FUNCTION: acpi_ex_opcode_1A_0T_0R @@ -124,7 +187,7 @@ acpi_ex_opcode_1A_0T_0R ( case AML_SLEEP_OP: /* Sleep (msec_time) */ - status = acpi_ex_system_do_suspend ((u32) operand[0]->integer.value); + status = acpi_ex_system_do_suspend (operand[0]->integer.value); break; @@ -222,7 +285,7 @@ acpi_ex_opcode_1A_1T_1R ( union acpi_operand_object *return_desc2 = NULL; u32 temp32; u32 i; - u32 power_of_ten; + acpi_integer power_of_ten; acpi_integer digit; @@ -262,7 +325,8 @@ acpi_ex_opcode_1A_1T_1R ( * Acpi specification describes Integer type as a little * endian unsigned value, so this boundary condition is valid. */ - for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { + for (temp32 = 0; return_desc->integer.value && + temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { return_desc->integer.value >>= 1; } @@ -278,13 +342,15 @@ acpi_ex_opcode_1A_1T_1R ( * The Acpi specification describes Integer type as a little * endian unsigned value, so this boundary condition is valid. */ - for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { + for (temp32 = 0; return_desc->integer.value && + temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { return_desc->integer.value <<= 1; } /* Since the bit position is one-based, subtract from 33 (65) */ - return_desc->integer.value = temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - temp32; + return_desc->integer.value = temp32 == 0 ? 0 : + (ACPI_INTEGER_BIT_SIZE + 1) - temp32; break; @@ -319,7 +385,8 @@ acpi_ex_opcode_1A_1T_1R ( /* Sum the digit into the result with the current power of 10 */ - return_desc->integer.value += (((acpi_integer) temp32) * power_of_ten); + return_desc->integer.value += (((acpi_integer) temp32) * + power_of_ten); /* Shift to next BCD digit */ @@ -340,18 +407,20 @@ acpi_ex_opcode_1A_1T_1R ( /* Each BCD digit is one nybble wide */ for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) { - (void) acpi_ut_short_divide (&digit, 10, &digit, &temp32); + (void) acpi_ut_short_divide (digit, 10, &digit, &temp32); /* Insert the BCD digit that resides in the remainder from above */ - return_desc->integer.value |= (((acpi_integer) temp32) << (i * 4)); + return_desc->integer.value |= (((acpi_integer) temp32) << + ACPI_MUL_4 (i)); } /* Overflow if there is any data left in Digit */ if (digit > 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (operand[0]->integer.value))); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Integer too large to convert to BCD: %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (operand[0]->integer.value))); status = AE_AML_NUMERIC_OVERFLOW; goto cleanup; } @@ -429,42 +498,63 @@ acpi_ex_opcode_1A_1T_1R ( */ case AML_COPY_OP: /* Copy (Source, Target) */ - status = acpi_ut_copy_iobject_to_iobject (operand[0], &return_desc, walk_state); + status = acpi_ut_copy_iobject_to_iobject (operand[0], &return_desc, + walk_state); break; case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */ - status = acpi_ex_convert_to_string (operand[0], &return_desc, 10, ACPI_UINT32_MAX, walk_state); + status = acpi_ex_convert_to_string (operand[0], &return_desc, + ACPI_EXPLICIT_CONVERT_DECIMAL); + if (return_desc == operand[0]) { + /* No conversion performed, add ref to handle return value */ + acpi_ut_add_reference (return_desc); + } break; case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */ - status = acpi_ex_convert_to_string (operand[0], &return_desc, 16, ACPI_UINT32_MAX, walk_state); + status = acpi_ex_convert_to_string (operand[0], &return_desc, + ACPI_EXPLICIT_CONVERT_HEX); + if (return_desc == operand[0]) { + /* No conversion performed, add ref to handle return value */ + acpi_ut_add_reference (return_desc); + } break; case AML_TO_BUFFER_OP: /* to_buffer (Data, Result) */ - status = acpi_ex_convert_to_buffer (operand[0], &return_desc, walk_state); + status = acpi_ex_convert_to_buffer (operand[0], &return_desc); + if (return_desc == operand[0]) { + /* No conversion performed, add ref to handle return value */ + acpi_ut_add_reference (return_desc); + } break; case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */ - status = acpi_ex_convert_to_integer (operand[0], &return_desc, walk_state); + status = acpi_ex_convert_to_integer (operand[0], &return_desc, + ACPI_ANY_BASE); + if (return_desc == operand[0]) { + /* No conversion performed, add ref to handle return value */ + acpi_ut_add_reference (return_desc); + } break; - case AML_SHIFT_LEFT_BIT_OP: /* shift_left_bit (Source, bit_num) */ - case AML_SHIFT_RIGHT_BIT_OP: /* shift_right_bit (Source, bit_num) */ + case AML_SHIFT_LEFT_BIT_OP: /* shift_left_bit (Source, bit_num) */ + case AML_SHIFT_RIGHT_BIT_OP: /* shift_right_bit (Source, bit_num) */ /* * These are two obsolete opcodes */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s is obsolete and not implemented\n", - acpi_ps_get_opcode_name (walk_state->opcode))); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "%s is obsolete and not implemented\n", + acpi_ps_get_opcode_name (walk_state->opcode))); status = AE_SUPPORT; goto cleanup; @@ -477,10 +567,12 @@ acpi_ex_opcode_1A_1T_1R ( goto cleanup; } - /* - * Store the return value computed above into the target object - */ - status = acpi_ex_store (return_desc, operand[1], walk_state); + if (ACPI_SUCCESS (status)) { + /* + * Store the return value computed above into the target object + */ + status = acpi_ex_store (return_desc, operand[1], walk_state); + } cleanup: @@ -537,7 +629,13 @@ acpi_ex_opcode_1A_0T_1R ( goto cleanup; } - return_desc->integer.value = !operand[0]->integer.value; + /* + * Set result to ONES (TRUE) if Value == 0. Note: + * return_desc->Integer.Value is initially == 0 (FALSE) from above. + */ + if (!operand[0]->integer.value) { + return_desc->integer.value = ACPI_INTEGER_MAX; + } break; @@ -545,54 +643,80 @@ acpi_ex_opcode_1A_0T_1R ( case AML_INCREMENT_OP: /* Increment (Operand) */ /* - * Since we are expecting a Reference operand, it - * can be either a NS Node or an internal object. + * Create a new integer. Can't just get the base integer and + * increment it because it may be an Arg or Field. + */ + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!return_desc) { + status = AE_NO_MEMORY; + goto cleanup; + } + + /* + * Since we are expecting a Reference operand, it can be either a + * NS Node or an internal object. */ - return_desc = operand[0]; - if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_OPERAND) { + temp_desc = operand[0]; + if (ACPI_GET_DESCRIPTOR_TYPE (temp_desc) == ACPI_DESC_TYPE_OPERAND) { /* Internal reference object - prevent deletion */ - acpi_ut_add_reference (return_desc); + acpi_ut_add_reference (temp_desc); } /* - * Convert the return_desc Reference to a Number - * (This removes a reference on the return_desc object) + * Convert the Reference operand to an Integer (This removes a + * reference on the Operand[0] object) + * + * NOTE: We use LNOT_OP here in order to force resolution of the + * reference operand to an actual integer. */ - status = acpi_ex_resolve_operands (AML_LNOT_OP, &return_desc, walk_state); + status = acpi_ex_resolve_operands (AML_LNOT_OP, &temp_desc, walk_state); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s: bad operand(s) %s\n", - acpi_ps_get_opcode_name (walk_state->opcode), acpi_format_exception(status))); + acpi_ps_get_opcode_name (walk_state->opcode), + acpi_format_exception(status))); goto cleanup; } /* - * return_desc is now guaranteed to be an Integer object - * Do the actual increment or decrement + * temp_desc is now guaranteed to be an Integer object -- + * Perform the actual increment or decrement */ - if (AML_INCREMENT_OP == walk_state->opcode) { - return_desc->integer.value++; + if (walk_state->opcode == AML_INCREMENT_OP) { + return_desc->integer.value = temp_desc->integer.value +1; } else { - return_desc->integer.value--; + return_desc->integer.value = temp_desc->integer.value -1; } - /* Store the result back in the original descriptor */ + /* Finished with this Integer object */ + + acpi_ut_remove_reference (temp_desc); + /* + * Store the result back (indirectly) through the original + * Reference object + */ status = acpi_ex_store (return_desc, operand[0], walk_state); break; case AML_TYPE_OP: /* object_type (source_object) */ + /* + * Note: The operand is not resolved at this point because we want to + * get the associated object, not its value. For example, we don't want + * to resolve a field_unit to its value, we want the actual field_unit + * object. + */ + /* Get the type of the base object */ status = acpi_ex_resolve_multiple (walk_state, operand[0], &type, NULL); if (ACPI_FAILURE (status)) { goto cleanup; } - /* Allocate a descriptor to hold the type. */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); @@ -607,6 +731,11 @@ acpi_ex_opcode_1A_0T_1R ( case AML_SIZE_OF_OP: /* size_of (source_object) */ + /* + * Note: The operand is not resolved at this point because we want to + * get the associated object, not its value. + */ + /* Get the base object */ status = acpi_ex_resolve_multiple (walk_state, operand[0], &type, &temp_desc); @@ -615,11 +744,19 @@ acpi_ex_opcode_1A_0T_1R ( } /* - * Type is guaranteed to be a buffer, string, or package at this - * point (even if the original operand was an object reference, it - * will be resolved and typechecked during operand resolution.) + * The type of the base object must be integer, buffer, string, or + * package. All others are not supported. + * + * NOTE: Integer is not specifically supported by the ACPI spec, + * but is supported implicitly via implicit operand conversion. + * rather than bother with conversion, we just use the byte width + * global (4 or 8 bytes). */ switch (type) { + case ACPI_TYPE_INTEGER: + value = acpi_gbl_integer_byte_width; + break; + case ACPI_TYPE_BUFFER: value = temp_desc->buffer.length; break; @@ -633,7 +770,8 @@ acpi_ex_opcode_1A_0T_1R ( break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "size_of, Not Buf/Str/Pkg - found type %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "size_of - Operand is not Buf/Int/Str/Pkg - found type %s\n", acpi_ut_get_type_name (type))); status = AE_AML_OPERAND_TYPE; goto cleanup; @@ -803,7 +941,8 @@ acpi_ex_opcode_1A_0T_1R ( * an uninitialized package element and is thus a * severe error. */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "NULL package element obj %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "NULL package element obj %p\n", operand[0])); status = AE_AML_UNINITIALIZED_ELEMENT; goto cleanup; @@ -815,7 +954,8 @@ acpi_ex_opcode_1A_0T_1R ( default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Index target_type %X in obj %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Unknown Index target_type %X in obj %p\n", operand[0]->reference.target_type, operand[0])); status = AE_AML_OPERAND_TYPE; goto cleanup; @@ -839,7 +979,8 @@ acpi_ex_opcode_1A_0T_1R ( default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Unknown opcode in ref(%p) - %X\n", operand[0], operand[0]->reference.opcode)); status = AE_TYPE; diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c index 0b6f86a91..23964e70a 100644 --- a/drivers/acpi/executer/exoparg2.c +++ b/drivers/acpi/executer/exoparg2.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -199,7 +199,8 @@ acpi_ex_opcode_2A_2T_1R ( acpi_status status; - ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_2T_1R", + acpi_ps_get_opcode_name (walk_state->opcode)); /* @@ -222,8 +223,10 @@ acpi_ex_opcode_2A_2T_1R ( /* Quotient to return_desc1, remainder to return_desc2 */ - status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value, - &return_desc1->integer.value, &return_desc2->integer.value); + status = acpi_ut_divide (operand[0]->integer.value, + operand[1]->integer.value, + &return_desc1->integer.value, + &return_desc2->integer.value); if (ACPI_FAILURE (status)) { goto cleanup; } @@ -292,13 +295,13 @@ acpi_ex_opcode_2A_1T_1R ( { union acpi_operand_object **operand = &walk_state->operands[0]; union acpi_operand_object *return_desc = NULL; - union acpi_operand_object *temp_desc = NULL; u32 index; acpi_status status = AE_OK; acpi_size length; - ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_1T_1R", + acpi_ps_get_opcode_name (walk_state->opcode)); /* @@ -331,52 +334,17 @@ acpi_ex_opcode_2A_1T_1R ( /* return_desc will contain the remainder */ - status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value, - NULL, &return_desc->integer.value); + status = acpi_ut_divide (operand[0]->integer.value, + operand[1]->integer.value, + NULL, + &return_desc->integer.value); break; case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ - /* - * Convert the second operand if necessary. The first operand - * determines the type of the second operand, (See the Data Types - * section of the ACPI specification.) Both object types are - * guaranteed to be either Integer/String/Buffer by the operand - * resolution mechanism above. - */ - switch (ACPI_GET_OBJECT_TYPE (operand[0])) { - case ACPI_TYPE_INTEGER: - status = acpi_ex_convert_to_integer (operand[1], &temp_desc, walk_state); - break; - - case ACPI_TYPE_STRING: - status = acpi_ex_convert_to_string (operand[1], &temp_desc, 16, ACPI_UINT32_MAX, walk_state); - break; - - case ACPI_TYPE_BUFFER: - status = acpi_ex_convert_to_buffer (operand[1], &temp_desc, walk_state); - break; - - default: - ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n", - ACPI_GET_OBJECT_TYPE (operand[0]))); - status = AE_AML_INTERNAL; - } - - if (ACPI_FAILURE (status)) { - goto cleanup; - } - - /* - * Both operands are now known to be the same object type - * (Both are Integer, String, or Buffer), and we can now perform the - * concatenation. - */ - status = acpi_ex_do_concatenate (operand[0], temp_desc, &return_desc, walk_state); - if (temp_desc != operand[1]) { - acpi_ut_remove_reference (temp_desc); - } + status = acpi_ex_do_concatenate (operand[0], operand[1], + &return_desc, walk_state); break; @@ -387,55 +355,45 @@ acpi_ex_opcode_2A_1T_1R ( * been converted.) Copy the raw buffer data to a new object of type String. */ - /* Get the length of the new string */ - + /* + * Get the length of the new string. It is the smallest of: + * 1) Length of the input buffer + * 2) Max length as specified in the to_string operator + * 3) Length of input buffer up to a zero byte (null terminator) + * + * NOTE: A length of zero is ok, and will create a zero-length, null + * terminated string. + */ length = 0; - if (operand[1]->integer.value == 0) { - /* Handle optional length value */ - - operand[1]->integer.value = ACPI_INTEGER_MAX; - } - while ((length < operand[0]->buffer.length) && (length < operand[1]->integer.value) && (operand[0]->buffer.pointer[length])) { length++; + if (length > ACPI_MAX_STRING_CONVERSION) { + status = AE_AML_STRING_LIMIT; + goto cleanup; + } } - if (length > ACPI_MAX_STRING_CONVERSION) { - status = AE_AML_STRING_LIMIT; - goto cleanup; - } - - /* Create the internal return object */ + /* Allocate a new string object */ - return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); + return_desc = acpi_ut_create_string_object (length); if (!return_desc) { status = AE_NO_MEMORY; goto cleanup; } - /* Allocate a new string buffer (Length + 1 for null terminator) */ - - return_desc->string.pointer = ACPI_MEM_CALLOCATE (length + 1); - if (!return_desc->string.pointer) { - status = AE_NO_MEMORY; - goto cleanup; - } - - /* Copy the raw buffer data with no transform */ - - ACPI_MEMCPY (return_desc->string.pointer, operand[0]->buffer.pointer, length); + /* Copy the raw buffer data with no transform. NULL terminated already. */ - /* Set the string length */ - - return_desc->string.length = (u32) length; + ACPI_MEMCPY (return_desc->string.pointer, + operand[0]->buffer.pointer, length); break; case AML_CONCAT_RES_OP: /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */ - status = acpi_ex_concat_template (operand[0], operand[1], &return_desc, walk_state); + status = acpi_ex_concat_template (operand[0], operand[1], + &return_desc, walk_state); break; @@ -452,13 +410,14 @@ acpi_ex_opcode_2A_1T_1R ( index = (u32) operand[1]->integer.value; /* - * At this point, the Source operand is either a Package or a Buffer + * At this point, the Source operand is a Package, Buffer, or String */ if (ACPI_GET_OBJECT_TYPE (operand[0]) == ACPI_TYPE_PACKAGE) { /* Object to be indexed is a Package */ if (index >= operand[0]->package.count) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond package end (%X)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Index value (%X) beyond package end (%X)\n", index, operand[0]->package.count)); status = AE_AML_PACKAGE_LIMIT; goto cleanup; @@ -469,10 +428,11 @@ acpi_ex_opcode_2A_1T_1R ( return_desc->reference.where = &operand[0]->package.elements [index]; } else { - /* Object to be indexed is a Buffer */ + /* Object to be indexed is a Buffer/String */ if (index >= operand[0]->buffer.length) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond end of buffer (%X)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Index value (%X) beyond end of buffer (%X)\n", index, operand[0]->buffer.length)); status = AE_AML_BUFFER_LIMIT; goto cleanup; @@ -558,7 +518,8 @@ acpi_ex_opcode_2A_0T_1R ( u8 logical_result = FALSE; - ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_1R", + acpi_ps_get_opcode_name (walk_state->opcode)); /* Create the internal return object */ @@ -572,18 +533,15 @@ acpi_ex_opcode_2A_0T_1R ( /* * Execute the Opcode */ - if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ { - /* Both operands must be of the same type */ - - if (ACPI_GET_OBJECT_TYPE (operand[0]) != - ACPI_GET_OBJECT_TYPE (operand[1])) { - status = AE_AML_OPERAND_TYPE; - goto cleanup; - } - - logical_result = acpi_ex_do_logical_op (walk_state->opcode, - operand[0], - operand[1]); + if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) /* logical_op (Operand0, Operand1) */ { + status = acpi_ex_do_logical_numeric_op (walk_state->opcode, + operand[0]->integer.value, operand[1]->integer.value, + &logical_result); + goto store_logical_result; + } + else if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ { + status = acpi_ex_do_logical_op (walk_state->opcode, operand[0], + operand[1], &logical_result); goto store_logical_result; } diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c index 7f6253c47..29d0b1677 100644 --- a/drivers/acpi/executer/exoparg3.c +++ b/drivers/acpi/executer/exoparg3.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -218,6 +218,10 @@ acpi_ex_opcode_3A_1T_1R ( return_desc->string.pointer = buffer; return_desc->string.length = (u32) length; } + + /* Mark buffer initialized */ + + return_desc->buffer.flags |= AOPOBJ_DATA_VALID; break; diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c index c9020af1c..d32624331 100644 --- a/drivers/acpi/executer/exoparg6.c +++ b/drivers/acpi/executer/exoparg6.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,75 +81,119 @@ * FUNCTION: acpi_ex_do_match * * PARAMETERS: match_op - The AML match operand - * package_value - Value from the target package - * match_value - Value to be matched + * package_obj - Object from the target package + * match_obj - Object to be matched * * RETURN: TRUE if the match is successful, FALSE otherwise * - * DESCRIPTION: Implements the low-level match for the ASL Match operator + * DESCRIPTION: Implements the low-level match for the ASL Match operator. + * Package elements will be implicitly converted to the type of + * the match object (Integer/Buffer/String). * ******************************************************************************/ u8 acpi_ex_do_match ( u32 match_op, - acpi_integer package_value, - acpi_integer match_value) + union acpi_operand_object *package_obj, + union acpi_operand_object *match_obj) { - + u8 logical_result = TRUE; + acpi_status status; + + + /* + * Note: Since the package_obj/match_obj ordering is opposite to that of + * the standard logical operators, we have to reverse them when we call + * do_logical_op in order to make the implicit conversion rules work + * correctly. However, this means we have to flip the entire equation + * also. A bit ugly perhaps, but overall, better than fussing the + * parameters around at runtime, over and over again. + * + * Below, P[i] refers to the package element, M refers to the Match object. + */ switch (match_op) { - case MATCH_MTR: /* always true */ + case MATCH_MTR: - break; + /* Always true */ + break; - case MATCH_MEQ: /* true if equal */ + case MATCH_MEQ: - if (package_value != match_value) { + /* + * True if equal: (P[i] == M) + * Change to: (M == P[i]) + */ + status = acpi_ex_do_logical_op (AML_LEQUAL_OP, match_obj, package_obj, + &logical_result); + if (ACPI_FAILURE (status)) { return (FALSE); } break; + case MATCH_MLE: - case MATCH_MLE: /* true if less than or equal */ - - if (package_value > match_value) { + /* + * True if less than or equal: (P[i] <= M) (P[i] not_greater than M) + * Change to: (M >= P[i]) (M not_less than P[i]) + */ + status = acpi_ex_do_logical_op (AML_LLESS_OP, match_obj, package_obj, + &logical_result); + if (ACPI_FAILURE (status)) { return (FALSE); } + logical_result = (u8) !logical_result; break; + case MATCH_MLT: - case MATCH_MLT: /* true if less than */ - - if (package_value >= match_value) { + /* + * True if less than: (P[i] < M) + * Change to: (M > P[i]) + */ + status = acpi_ex_do_logical_op (AML_LGREATER_OP, match_obj, package_obj, + &logical_result); + if (ACPI_FAILURE (status)) { return (FALSE); } break; + case MATCH_MGE: - case MATCH_MGE: /* true if greater than or equal */ - - if (package_value < match_value) { + /* + * True if greater than or equal: (P[i] >= M) (P[i] not_less than M) + * Change to: (M <= P[i]) (M not_greater than P[i]) + */ + status = acpi_ex_do_logical_op (AML_LGREATER_OP, match_obj, package_obj, + &logical_result); + if (ACPI_FAILURE (status)) { return (FALSE); } + logical_result = (u8)!logical_result; break; + case MATCH_MGT: - case MATCH_MGT: /* true if greater than */ - - if (package_value <= match_value) { + /* + * True if greater than: (P[i] > M) + * Change to: (M < P[i]) + */ + status = acpi_ex_do_logical_op (AML_LLESS_OP, match_obj, package_obj, + &logical_result); + if (ACPI_FAILURE (status)) { return (FALSE); } break; + default: - default: /* undefined */ + /* Undefined */ return (FALSE); } - - return TRUE; + return logical_result; } @@ -182,19 +226,21 @@ acpi_ex_opcode_6A_0T_1R ( switch (walk_state->opcode) { case AML_MATCH_OP: /* - * Match (search_package[0], match_op1[1], match_object1[2], - * match_op2[3], match_object2[4], start_index[5]) + * Match (search_pkg[0], match_op1[1], match_obj1[2], + * match_op2[3], match_obj2[4], start_index[5]) */ - /* Validate match comparison sub-opcodes */ + /* Validate both Match Term Operators (MTR, MEQ, etc.) */ if ((operand[1]->integer.value > MAX_MATCH_OPERATOR) || (operand[3]->integer.value > MAX_MATCH_OPERATOR)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "operation encoding out of range\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Match operator out of range\n")); status = AE_AML_OPERAND_VALUE; goto cleanup; } + /* Get the package start_index, validate against the package length */ + index = (u32) operand[5]->integer.value; if (index >= (u32) operand[0]->package.count) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index beyond package end\n")); @@ -202,6 +248,8 @@ acpi_ex_opcode_6A_0T_1R ( goto cleanup; } + /* Create an integer for the return value */ + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); if (!return_desc) { status = AE_NO_MEMORY; @@ -214,37 +262,39 @@ acpi_ex_opcode_6A_0T_1R ( return_desc->integer.value = ACPI_INTEGER_MAX; /* - * Examine each element until a match is found. Within the loop, + * Examine each element until a match is found. Both match conditions + * must be satisfied for a match to occur. Within the loop, * "continue" signifies that the current element does not match * and the next should be examined. * * Upon finding a match, the loop will terminate via "break" at - * the bottom. If it terminates "normally", match_value will be -1 - * (its initial value) indicating that no match was found. When - * returned as a Number, this will produce the Ones value as specified. + * the bottom. If it terminates "normally", match_value will be + * ACPI_INTEGER_MAX (Ones) (its initial value) indicating that no + * match was found. */ for ( ; index < operand[0]->package.count; index++) { + /* Get the current package element */ + this_element = operand[0]->package.elements[index]; - /* - * Treat any NULL or non-numeric elements as non-matching. - */ - if (!this_element || - ACPI_GET_OBJECT_TYPE (this_element) != ACPI_TYPE_INTEGER) { + /* Treat any uninitialized (NULL) elements as non-matching */ + + if (!this_element) { continue; } /* - * "continue" (proceed to next iteration of enclosing - * "for" loop) signifies a non-match. + * Both match conditions must be satisfied. Execution of a continue + * (proceed to next iteration of enclosing for loop) signifies a + * non-match. */ if (!acpi_ex_do_match ((u32) operand[1]->integer.value, - this_element->integer.value, operand[2]->integer.value)) { + this_element, operand[2])) { continue; } if (!acpi_ex_do_match ((u32) operand[3]->integer.value, - this_element->integer.value, operand[4]->integer.value)) { + this_element, operand[4])) { continue; } @@ -253,7 +303,6 @@ acpi_ex_opcode_6A_0T_1R ( return_desc->integer.value = index; break; } - break; diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c index c5c6dd8e0..264ef3bba 100644 --- a/drivers/acpi/executer/exprep.c +++ b/drivers/acpi/executer/exprep.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -339,6 +339,8 @@ acpi_ex_prep_common_field_object ( obj_desc->common_field.access_byte_width = (u8) ACPI_DIV_8 (access_bit_width); /* 1, 2, 4, 8 */ + obj_desc->common_field.access_bit_width = (u8) access_bit_width; + /* * base_byte_offset is the address of the start of the field within the * region. It is the byte address of the first *datum* (field-width data @@ -361,28 +363,6 @@ acpi_ex_prep_common_field_object ( obj_desc->common_field.start_field_bit_offset = (u8) (field_bit_position - ACPI_MUL_8 (obj_desc->common_field.base_byte_offset)); - /* - * Valid bits -- the number of bits that compose a partial datum, - * 1) At the end of the field within the region (arbitrary starting bit - * offset) - * 2) At the end of a buffer used to contain the field (starting offset - * always zero) - */ - obj_desc->common_field.end_field_valid_bits = (u8) - ((obj_desc->common_field.start_field_bit_offset + field_bit_length) % - access_bit_width); - /* start_buffer_bit_offset always = 0 */ - - obj_desc->common_field.end_buffer_valid_bits = (u8) - (field_bit_length % access_bit_width); - - /* - * datum_valid_bits is the number of valid field bits in the first - * field datum. - */ - obj_desc->common_field.datum_valid_bits = (u8) - (access_bit_width - obj_desc->common_field.start_field_bit_offset); - /* * Does the entire field fit within a single field access element? (datum) * (i.e., without crossing a datum boundary) @@ -508,6 +488,7 @@ acpi_ex_prep_field_value ( if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) { ACPI_REPORT_ERROR (("Null Index Object during field prep\n")); + acpi_ut_delete_object_desc (obj_desc); return_ACPI_STATUS (AE_AML_INTERNAL); } diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c index 3262f1a1d..7cfd0684c 100644 --- a/drivers/acpi/executer/exregion.c +++ b/drivers/acpi/executer/exregion.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -121,7 +121,7 @@ acpi_ex_system_memory_space_handler ( * Hardware does not support non-aligned data transfers, we must verify * the request. */ - (void) acpi_ut_short_divide ((acpi_integer *) &address, length, NULL, &remainder); + (void) acpi_ut_short_divide ((acpi_integer) address, length, NULL, &remainder); if (remainder != 0) { return_ACPI_STATUS (AE_AML_ALIGNMENT); } diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c index 03a9d7150..7936329a0 100644 --- a/drivers/acpi/executer/exresnte.c +++ b/drivers/acpi/executer/exresnte.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c index 504d53f4a..9cccf8299 100644 --- a/drivers/acpi/executer/exresolv.c +++ b/drivers/acpi/executer/exresolv.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -327,11 +327,44 @@ acpi_ex_resolve_multiple ( union acpi_operand_object *obj_desc = (void *) operand; struct acpi_namespace_node *node; acpi_object_type type; + acpi_status status; ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple"); + /* + * Operand can be either a namespace node or an operand descriptor + */ + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { + case ACPI_DESC_TYPE_OPERAND: + type = obj_desc->common.type; + break; + + case ACPI_DESC_TYPE_NAMED: + type = ((struct acpi_namespace_node *) obj_desc)->type; + obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc); + + /* If we had an Alias node, use the attached object for type info */ + + if (type == ACPI_TYPE_LOCAL_ALIAS) { + type = ((struct acpi_namespace_node *) obj_desc)->type; + obj_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) obj_desc); + } + break; + + default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + + + /* + * If type is anything other than a reference, we are done + */ + if (type != ACPI_TYPE_LOCAL_REFERENCE) { + goto exit; + } + /* * For reference objects created via the ref_of or Index operators, * we need to get to the base object (as per the ACPI specification @@ -424,6 +457,33 @@ acpi_ex_resolve_multiple ( break; + case AML_LOCAL_OP: + case AML_ARG_OP: + + if (return_desc) { + status = acpi_ds_method_data_get_value (obj_desc->reference.opcode, + obj_desc->reference.offset, walk_state, &obj_desc); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + acpi_ut_remove_reference (obj_desc); + } + else { + status = acpi_ds_method_data_get_node (obj_desc->reference.opcode, + obj_desc->reference.offset, walk_state, &node); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + obj_desc = acpi_ns_get_attached_object (node); + if (!obj_desc) { + type = ACPI_TYPE_ANY; + goto exit; + } + } + break; + + case AML_DEBUG_OP: /* The Debug Object is of type "debug_object" */ diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c index d410bd7f1..c92890220 100644 --- a/drivers/acpi/executer/exresop.c +++ b/drivers/acpi/executer/exresop.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -160,7 +160,7 @@ acpi_ex_resolve_operands ( return_ACPI_STATUS (AE_AML_INTERNAL); } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] operand_types=%X \n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] required_operand_types=%8.8X \n", opcode, op_info->name, arg_types)); /* @@ -227,12 +227,13 @@ acpi_ex_resolve_operands ( case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Reference Opcode: %s\n", op_info->name))); + "Operand is a Reference, ref_opcode [%s]\n", + (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name))); break; default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown Reference Opcode %X [%s]\n", + "Operand is a Reference, Unknown Reference Opcode %X [%s]\n", obj_desc->reference.opcode, (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name)); @@ -311,7 +312,7 @@ acpi_ex_resolve_operands ( goto next_operand; - case ARGI_ANYTYPE: + case ARGI_DATAREFOBJ: /* Store operator only */ /* * We don't want to resolve index_op reference objects during @@ -398,7 +399,7 @@ acpi_ex_resolve_operands ( * But we can implicitly convert from a STRING or BUFFER * Aka - "Implicit Source Operand Conversion" */ - status = acpi_ex_convert_to_integer (obj_desc, stack_ptr, walk_state); + status = acpi_ex_convert_to_integer (obj_desc, stack_ptr, 16); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -420,7 +421,7 @@ acpi_ex_resolve_operands ( * But we can implicitly convert from a STRING or INTEGER * Aka - "Implicit Source Operand Conversion" */ - status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr, walk_state); + status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -442,7 +443,8 @@ acpi_ex_resolve_operands ( * But we can implicitly convert from a BUFFER or INTEGER * Aka - "Implicit Source Operand Conversion" */ - status = acpi_ex_convert_to_string (obj_desc, stack_ptr, 16, ACPI_UINT32_MAX, walk_state); + status = acpi_ex_convert_to_string (obj_desc, stack_ptr, + ACPI_IMPLICIT_CONVERT_HEX); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -494,7 +496,7 @@ acpi_ex_resolve_operands ( /* Highest priority conversion is to type Buffer */ - status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr, walk_state); + status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -582,6 +584,45 @@ acpi_ex_resolve_operands ( goto next_operand; + case ARGI_DATAREFOBJ: + + /* Used by the Store() operator only */ + + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + case ACPI_TYPE_BUFFER_FIELD: + case ACPI_TYPE_LOCAL_REFERENCE: + case ACPI_TYPE_LOCAL_REGION_FIELD: + case ACPI_TYPE_LOCAL_BANK_FIELD: + case ACPI_TYPE_LOCAL_INDEX_FIELD: + case ACPI_TYPE_DDB_HANDLE: + + /* Valid operand */ + break; + + default: + + if (acpi_gbl_enable_interpreter_slack) { + /* + * Enable original behavior of Store(), allowing any and all + * objects as the source operand. The ACPI spec does not + * allow this, however. + */ + break; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p\n", + acpi_ut_get_object_type_name (obj_desc), obj_desc)); + + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + goto next_operand; + + default: /* Unknown type */ diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c index 25464f751..e0fc6aba1 100644 --- a/drivers/acpi/executer/exstore.c +++ b/drivers/acpi/executer/exstore.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,7 +129,8 @@ acpi_ex_store ( /* Destination is not a Reference object */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Destination is not a Reference or Constant object [%p]\n", dest_desc)); + "Target is not a Reference or Constant object - %s [%p]\n", + acpi_ut_get_object_type_name (dest_desc), dest_desc)); ACPI_DUMP_STACK_ENTRY (source_desc); ACPI_DUMP_STACK_ENTRY (dest_desc); @@ -182,23 +183,37 @@ acpi_ex_store ( * Storing to the Debug object causes the value stored to be * displayed and otherwise has no effect -- see ACPI Specification */ - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Write to Debug Object: ****:\n\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "**** Write to Debug Object: Object %p %s ****:\n\n", + source_desc, acpi_ut_get_object_type_name (source_desc))); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ", - acpi_ut_get_object_type_name (source_desc))); + acpi_ut_get_object_type_name (source_desc))); + + if (!acpi_ut_valid_internal_object (source_desc)) { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, + "%p, Invalid Internal Object!\n", source_desc)); + break; + } switch (ACPI_GET_OBJECT_TYPE (source_desc)) { case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n", + if (acpi_gbl_integer_byte_width == 4) { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X\n", + (u32) source_desc->integer.value)); + } + else { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (source_desc->integer.value))); + } break; case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X", - (u32) source_desc->buffer.length)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]", + (u32) source_desc->buffer.length)); ACPI_DUMP_BUFFER (source_desc->buffer.pointer, (source_desc->buffer.length < 32) ? source_desc->buffer.length : 32); break; @@ -206,22 +221,22 @@ acpi_ex_store ( case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X, \"%s\"\n", - source_desc->string.length, source_desc->string.pointer)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n", + source_desc->string.length, source_desc->string.pointer)); break; case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Size 0x%.2X Elements Ptr - %p\n", - source_desc->package.count, source_desc->package.elements)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] Elements Ptr - %p\n", + source_desc->package.count, source_desc->package.elements)); break; default: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%p\n", - source_desc)); + source_desc)); break; } @@ -280,56 +295,45 @@ acpi_ex_store_object_to_index ( switch (index_desc->reference.target_type) { case ACPI_TYPE_PACKAGE: /* - * Storing to a package element is not simple. The source must be - * evaluated and converted to the type of the destination and then the - * source is copied into the destination - we can't just point to the - * source object. - */ - /* + * Storing to a package element. Copy the object and replace + * any existing object with the new object. No implicit + * conversion is performed. + * * The object at *(index_desc->Reference.Where) is the * element within the package that is to be modified. * The parent package object is at index_desc->Reference.Object */ obj_desc = *(index_desc->reference.where); - /* Do the conversion/store */ - - status = acpi_ex_store_object_to_object (source_desc, obj_desc, &new_desc, - walk_state); + status = acpi_ut_copy_iobject_to_iobject (source_desc, &new_desc, walk_state); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Could not store object to indexed package element\n")); return_ACPI_STATUS (status); } - /* - * If a new object was created, we must install it as the new - * package element - */ - if (new_desc != obj_desc) { - acpi_ut_remove_reference (obj_desc); - *(index_desc->reference.where) = new_desc; + if (obj_desc) { + /* Decrement reference count by the ref count of the parent package */ - /* If same as the original source, add a reference */ - - if (new_desc == source_desc) { - acpi_ut_add_reference (new_desc); + for (i = 0; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) { + acpi_ut_remove_reference (obj_desc); } + } - /* Increment reference count by the ref count of the parent package -1 */ + *(index_desc->reference.where) = new_desc; - for (i = 1; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) { - acpi_ut_add_reference (new_desc); - } + /* Increment reference count by the ref count of the parent package -1 */ + + for (i = 1; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) { + acpi_ut_add_reference (new_desc); } + break; case ACPI_TYPE_BUFFER_FIELD: /* - * Store into a Buffer (not actually a real buffer_field) at a - * location defined by an Index. + * Store into a Buffer or String (not actually a real buffer_field) + * at a location defined by an Index. * * The first 8-bit element of the source object is written to the * 8-bit Buffer location defined by the Index destination object, @@ -337,10 +341,13 @@ acpi_ex_store_object_to_index ( */ /* - * Make sure the target is a Buffer + * Make sure the target is a Buffer or String. An error should + * not happen here, since the reference_object was constructed + * by the INDEX_OP code. */ obj_desc = index_desc->reference.object; - if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_BUFFER) { + if ((ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_BUFFER) && + (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_STRING)) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -357,13 +364,11 @@ acpi_ex_store_object_to_index ( break; case ACPI_TYPE_BUFFER: - - value = source_desc->buffer.pointer[0]; - break; - case ACPI_TYPE_STRING: - value = (u8) source_desc->string.pointer[0]; + /* Note: Takes advantage of common string/buffer fields */ + + value = source_desc->buffer.pointer[0]; break; default: diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c index 6ddb1e073..e663a48f8 100644 --- a/drivers/acpi/executer/exstoren.c +++ b/drivers/acpi/executer/exstoren.c @@ -7,7 +7,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -206,6 +206,7 @@ acpi_ex_store_object_to_object ( { union acpi_operand_object *actual_src_desc; acpi_status status = AE_OK; + acpi_object_type original_src_type; ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_object", source_desc); @@ -222,7 +223,8 @@ acpi_ex_store_object_to_object ( return_ACPI_STATUS (status); } - if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_GET_OBJECT_TYPE (dest_desc)) { + original_src_type = ACPI_GET_OBJECT_TYPE (source_desc); + if (original_src_type != ACPI_GET_OBJECT_TYPE (dest_desc)) { /* * The source type does not match the type of the destination. * Perform the "implicit conversion" of the source to the current type @@ -232,15 +234,15 @@ acpi_ex_store_object_to_object ( * Otherwise, actual_src_desc is a temporary object to hold the * converted object. */ - status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), source_desc, - &actual_src_desc, walk_state); + status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), + source_desc, &actual_src_desc, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } if (source_desc == actual_src_desc) { /* - * No conversion was performed. Return the source_desc as the + * No conversion was performed. Return the source_desc as the * new object. */ *new_desc = source_desc; @@ -269,12 +271,18 @@ acpi_ex_store_object_to_object ( case ACPI_TYPE_BUFFER: - status = acpi_ex_store_buffer_to_buffer (actual_src_desc, dest_desc); + /* + * Note: There is different store behavior depending on the original + * source type + */ + status = acpi_ex_store_buffer_to_buffer (original_src_type, actual_src_desc, + dest_desc); break; case ACPI_TYPE_PACKAGE: - status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc, walk_state); + status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc, + walk_state); break; default: diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c index 42c1feb2d..4e2b442ee 100644 --- a/drivers/acpi/executer/exstorob.c +++ b/drivers/acpi/executer/exstorob.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ acpi_status acpi_ex_store_buffer_to_buffer ( + acpi_object_type original_src_type, union acpi_operand_object *source_desc, union acpi_operand_object *target_desc) { @@ -93,34 +94,42 @@ acpi_ex_store_buffer_to_buffer ( return_ACPI_STATUS (AE_NO_MEMORY); } - target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER; target_desc->buffer.length = length; } - /* - * Buffer is a static allocation, - * only place what will fit in the buffer. - */ + /* Copy source buffer to target buffer */ + if (length <= target_desc->buffer.length) { /* Clear existing buffer and copy in the new one */ ACPI_MEMSET (target_desc->buffer.pointer, 0, target_desc->buffer.length); ACPI_MEMCPY (target_desc->buffer.pointer, buffer, length); - } - else { + /* - * Truncate the source, copy only what will fit + * If the original source was a string, we must truncate the buffer, + * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer + * copy must not truncate the original buffer. */ + if (original_src_type == ACPI_TYPE_STRING) { + /* Set the new length of the target */ + + target_desc->buffer.length = length; + } + } + else { + /* Truncate the source, copy only what will fit */ + ACPI_MEMCPY (target_desc->buffer.pointer, buffer, target_desc->buffer.length); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Truncating src buffer from %X to %X\n", + "Truncating source buffer from %X to %X\n", length, target_desc->buffer.length)); } /* Copy flags */ target_desc->buffer.flags = source_desc->buffer.flags; + target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER; return_ACPI_STATUS (AE_OK); } diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c index 42a1332b5..f92efc512 100644 --- a/drivers/acpi/executer/exsystem.c +++ b/drivers/acpi/executer/exsystem.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -167,7 +167,7 @@ acpi_ex_system_do_stall ( acpi_status acpi_ex_system_do_suspend ( - u32 how_long) + acpi_integer how_long) { acpi_status status; @@ -179,8 +179,7 @@ acpi_ex_system_do_suspend ( acpi_ex_exit_interpreter (); - acpi_os_sleep ((u16) (how_long / (u32) 1000), - (u16) (how_long % (u32) 1000)); + acpi_os_sleep (how_long); /* And now we must get the interpreter again */ diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c index bc425b2b4..40c6abb8b 100644 --- a/drivers/acpi/executer/exutils.c +++ b/drivers/acpi/executer/exutils.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -280,25 +280,25 @@ acpi_ex_digits_needed ( { u32 num_digits; acpi_integer current_value; - acpi_integer quotient; ACPI_FUNCTION_TRACE ("ex_digits_needed"); - /* - * acpi_integer is unsigned, so we don't worry about a '-' - */ - if ((current_value = value) == 0) { + /* acpi_integer is unsigned, so we don't worry about a '-' prefix */ + + if (value == 0) { return_VALUE (1); } + current_value = value; num_digits = 0; + /* Count the digits in the requested base */ + while (current_value) { - (void) acpi_ut_short_divide (¤t_value, base, "ient, NULL); + (void) acpi_ut_short_divide (current_value, base, ¤t_value, NULL); num_digits++; - current_value = quotient; } return_VALUE (num_digits); @@ -361,7 +361,6 @@ acpi_ex_unsigned_integer_to_string ( u32 count; u32 digits_needed; u32 remainder; - acpi_integer quotient; ACPI_FUNCTION_ENTRY (); @@ -371,9 +370,8 @@ acpi_ex_unsigned_integer_to_string ( out_string[digits_needed] = 0; for (count = digits_needed; count > 0; count--) { - (void) acpi_ut_short_divide (&value, 10, "ient, &remainder); + (void) acpi_ut_short_divide (value, 10, &value, &remainder); out_string[count-1] = (char) ('0' + remainder);\ - value = quotient; } } diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index fa2a1b414..2c5422dfe 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -75,51 +76,41 @@ struct proc_dir_entry *acpi_fan_dir; static int -acpi_fan_read_state ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +acpi_fan_read_state (struct seq_file *seq, void *offset) { - struct acpi_fan *fan = (struct acpi_fan *) data; - char *p = page; - int len = 0; + struct acpi_fan *fan = (struct acpi_fan *) seq->private; int state = 0; ACPI_FUNCTION_TRACE("acpi_fan_read_state"); - if (!fan || (off != 0)) + if (!fan) goto end; if (acpi_bus_get_power(fan->handle, &state)) goto end; - p += sprintf(p, "status: %s\n", + seq_printf(seq, "status: %s\n", !state?"on":"off"); end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return_VALUE(len); + return_VALUE(0); } +static int acpi_fan_state_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_fan_read_state, PDE(inode)->data); +} -static int +static ssize_t acpi_fan_write_state ( struct file *file, const char __user *buffer, - unsigned long count, - void *data) + size_t count, + loff_t *ppos) { int result = 0; - struct acpi_fan *fan = (struct acpi_fan *) data; + struct seq_file *m = (struct seq_file *)file->private_data; + struct acpi_fan *fan = (struct acpi_fan *) m->private; char state_string[12] = {'\0'}; ACPI_FUNCTION_TRACE("acpi_fan_write_state"); @@ -140,6 +131,14 @@ acpi_fan_write_state ( return_VALUE(count); } +static struct file_operations acpi_fan_state_ops = { + .open = acpi_fan_state_open_fs, + .read = seq_read, + .write = acpi_fan_write_state, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; static int acpi_fan_add_fs ( @@ -168,8 +167,7 @@ acpi_fan_add_fs ( "Unable to create '%s' fs entry\n", ACPI_FAN_FILE_STATE)); else { - entry->read_proc = acpi_fan_read_state; - entry->write_proc = acpi_fan_write_state; + entry->proc_fops = &acpi_fan_state_ops; entry->data = acpi_driver_data(device); entry->owner = THIS_MODULE; } diff --git a/drivers/acpi/hardware/Makefile b/drivers/acpi/hardware/Makefile index 97989bc85..438ad373b 100644 --- a/drivers/acpi/hardware/Makefile +++ b/drivers/acpi/hardware/Makefile @@ -2,6 +2,8 @@ # Makefile for all Linux ACPI interpreter subdirectories # -obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwtimer.o +obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o + +obj-$(ACPI_FUTURE_USAGE) += hwtimer.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c index 7c3419b8b..529e922bd 100644 --- a/drivers/acpi/hardware/hwacpi.c +++ b/drivers/acpi/hardware/hwacpi.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c index 3910b5ec9..9ac1d639b 100644 --- a/drivers/acpi/hardware/hwgpe.c +++ b/drivers/acpi/hardware/hwgpe.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -135,7 +135,7 @@ acpi_hw_clear_gpe ( * DESCRIPTION: Return the status of a single GPE. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_hw_get_gpe_status ( struct acpi_gpe_event_info *gpe_event_info, @@ -194,6 +194,7 @@ acpi_hw_get_gpe_status ( unlock_and_exit: return (status); } +#endif /* ACPI_FUTURE_USAGE */ /****************************************************************************** diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index cb998fe9e..91af0c2dd 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c @@ -7,7 +7,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -211,6 +212,7 @@ acpi_get_sleep_type_data ( acpi_ut_remove_reference (info.return_object); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_sleep_type_data); /******************************************************************************* @@ -307,6 +309,7 @@ acpi_get_register ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_register); /******************************************************************************* @@ -457,6 +460,7 @@ unlock_and_exit: value, register_value, bit_reg_info->parent_register)); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_set_register); /****************************************************************************** @@ -709,6 +713,7 @@ acpi_hw_low_level_read ( u32 *value, struct acpi_generic_address *reg) { + u64 address; acpi_status status; @@ -720,8 +725,14 @@ acpi_hw_low_level_read ( * a non-zero address within. However, don't return an error * because the PM1A/B code must not fail if B isn't present. */ - if ((!reg) || - (!reg->address)) { + if (!reg) { + return (AE_OK); + } + + /* Get a local copy of the address. Handles possible alignment issues */ + + ACPI_MOVE_64_TO_64 (&address, ®->address); + if (!address) { return (AE_OK); } *value = 0; @@ -734,14 +745,14 @@ acpi_hw_low_level_read ( case ACPI_ADR_SPACE_SYSTEM_MEMORY: status = acpi_os_read_memory ( - (acpi_physical_address) reg->address, + (acpi_physical_address) address, value, width); break; case ACPI_ADR_SPACE_SYSTEM_IO: - status = acpi_os_read_port ((acpi_io_address) reg->address, + status = acpi_os_read_port ((acpi_io_address) address, value, width); break; @@ -754,7 +765,7 @@ acpi_hw_low_level_read ( ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", *value, width, - ACPI_FORMAT_UINT64 (reg->address), + ACPI_FORMAT_UINT64 (address), acpi_ut_get_region_name (reg->address_space_id))); return (status); @@ -781,6 +792,7 @@ acpi_hw_low_level_write ( u32 value, struct acpi_generic_address *reg) { + u64 address; acpi_status status; @@ -792,8 +804,14 @@ acpi_hw_low_level_write ( * a non-zero address within. However, don't return an error * because the PM1A/B code must not fail if B isn't present. */ - if ((!reg) || - (!reg->address)) { + if (!reg) { + return (AE_OK); + } + + /* Get a local copy of the address. Handles possible alignment issues */ + + ACPI_MOVE_64_TO_64 (&address, ®->address); + if (!address) { return (AE_OK); } @@ -805,14 +823,14 @@ acpi_hw_low_level_write ( case ACPI_ADR_SPACE_SYSTEM_MEMORY: status = acpi_os_write_memory ( - (acpi_physical_address) reg->address, + (acpi_physical_address) address, value, width); break; case ACPI_ADR_SPACE_SYSTEM_IO: - status = acpi_os_write_port ((acpi_io_address) reg->address, + status = acpi_os_write_port ((acpi_io_address) address, value, width); break; @@ -825,7 +843,7 @@ acpi_hw_low_level_write ( ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", value, width, - ACPI_FORMAT_UINT64 (reg->address), + ACPI_FORMAT_UINT64 (address), acpi_ut_get_region_name (reg->address_space_id))); return (status); diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index 6ffa80ba2..77b3e9a85 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,8 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include + #include #define _COMPONENT ACPI_HARDWARE @@ -110,7 +112,7 @@ acpi_set_firmware_waking_vector ( * DESCRIPTION: Access function for firmware_waking_vector field in FACS * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_firmware_waking_vector ( acpi_physical_address *physical_address) @@ -136,6 +138,7 @@ acpi_get_firmware_waking_vector ( return_ACPI_STATUS (AE_OK); } +#endif /****************************************************************************** @@ -279,15 +282,6 @@ acpi_enter_sleep_state ( return_ACPI_STATUS (status); } - if (sleep_state != ACPI_STATE_S5) { - /* Disable BM arbitration */ - - status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - } - /* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs @@ -391,6 +385,7 @@ acpi_enter_sleep_state ( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_enter_sleep_state); /****************************************************************************** @@ -456,6 +451,7 @@ acpi_enter_sleep_state_s4bios ( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios); /****************************************************************************** @@ -576,13 +572,6 @@ acpi_leave_sleep_state ( (void) acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].status_register_id, 1, ACPI_MTX_DO_NOT_LOCK); - /* Enable BM arbitration */ - - status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - arg.integer.value = ACPI_SST_WORKING; status = acpi_evaluate_object (NULL, METHOD_NAME__SST, &arg_list, NULL); if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { diff --git a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c index 1f94d6ffa..1906167d7 100644 --- a/drivers/acpi/hardware/hwtimer.c +++ b/drivers/acpi/hardware/hwtimer.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,8 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include + #include #define _COMPONENT ACPI_HARDWARE @@ -112,6 +114,7 @@ acpi_get_timer ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_timer); /****************************************************************************** @@ -149,10 +152,9 @@ acpi_get_timer_duration ( u32 end_ticks, u32 *time_elapsed) { - u32 delta_ticks = 0; - union uint64_overlay normalized_ticks; acpi_status status; - acpi_integer out_quotient; + u32 delta_ticks; + acpi_integer quotient; ACPI_FUNCTION_TRACE ("acpi_get_timer_duration"); @@ -164,7 +166,7 @@ acpi_get_timer_duration ( /* * Compute Tick Delta: - * Handle (max one) timer rollovers on 24- versus 32-bit timers. + * Handle (max one) timer rollovers on 24-bit versus 32-bit timers. */ if (start_ticks < end_ticks) { delta_ticks = end_ticks - start_ticks; @@ -181,23 +183,21 @@ acpi_get_timer_duration ( delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks; } } - else { + else /* start_ticks == end_ticks */ { *time_elapsed = 0; return_ACPI_STATUS (AE_OK); } /* - * Compute Duration (Requires a 64-bit divide): + * Compute Duration (Requires a 64-bit multiply and divide): * * time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY; */ - normalized_ticks.full = ((u64) delta_ticks) * 1000000; + status = acpi_ut_short_divide (((u64) delta_ticks) * 1000000, + PM_TIMER_FREQUENCY, "ient, NULL); - status = acpi_ut_short_divide (&normalized_ticks.full, PM_TIMER_FREQUENCY, - &out_quotient, NULL); - - *time_elapsed = (u32) out_quotient; + *time_elapsed = (u32) quotient; return_ACPI_STATUS (status); } - +EXPORT_SYMBOL(acpi_get_timer_duration); diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index b435b3e3e..94a76e520 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c @@ -1168,7 +1168,7 @@ static int set_ibm_param(const char *val, struct kernel_param *kp) #define IBM_PARAM(feature) \ module_param_call(feature, set_ibm_param, NULL, NULL, 0) -static void __exit acpi_ibm_exit(void) +static void acpi_ibm_exit(void) { int i; diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c index ee9c5d13e..61ea70742 100644 --- a/drivers/acpi/motherboard.c +++ b/drivers/acpi/motherboard.c @@ -62,7 +62,7 @@ acpi_reserve_io_ranges (struct acpi_resource *res, void *data) struct acpi_resource_io *io_res = &res->data.io; if (io_res->min_base_address != io_res->max_base_address) - return AE_OK; + return_VALUE(AE_OK); if (IS_RESERVED_ADDR(io_res->min_base_address, io_res->range_length)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n", io_res->min_base_address, @@ -86,7 +86,7 @@ acpi_reserve_io_ranges (struct acpi_resource *res, void *data) if (requested_res) requested_res->flags &= ~IORESOURCE_BUSY; - return AE_OK; + return_VALUE(AE_OK); } static int acpi_motherboard_add (struct acpi_device *device) diff --git a/drivers/acpi/namespace/Makefile b/drivers/acpi/namespace/Makefile index 9462af174..3f63d3640 100644 --- a/drivers/acpi/namespace/Makefile +++ b/drivers/acpi/namespace/Makefile @@ -2,9 +2,11 @@ # Makefile for all Linux ACPI interpreter subdirectories # -obj-y := nsaccess.o nsdumpdv.o nsload.o nssearch.o nsxfeval.o \ +obj-y := nsaccess.o nsload.o nssearch.o nsxfeval.o \ nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ nsparse.o +obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o + EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c index 765217be4..1c0c12336 100644 --- a/drivers/acpi/namespace/nsaccess.c +++ b/drivers/acpi/namespace/nsaccess.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -155,14 +155,15 @@ acpi_ns_root_initialize (void) */ switch (init_val->type) { case ACPI_TYPE_METHOD: - obj_desc->method.param_count = (u8) ACPI_STRTOUL - (val, NULL, 10); + obj_desc->method.param_count = (u8) ACPI_TO_INTEGER (val); obj_desc->common.flags |= AOPOBJ_DATA_VALID; #if defined (_ACPI_ASL_COMPILER) || defined (_ACPI_DUMP_App) - /* i_aSL Compiler cheats by putting parameter count in the owner_iD */ - + /* + * i_aSL Compiler cheats by putting parameter count + * in the owner_iD + */ new_node->owner_id = obj_desc->method.param_count; #else /* Mark this as a very SPECIAL method */ @@ -174,8 +175,7 @@ acpi_ns_root_initialize (void) case ACPI_TYPE_INTEGER: - obj_desc->integer.value = - (acpi_integer) ACPI_STRTOUL (val, NULL, 10); + obj_desc->integer.value = ACPI_TO_INTEGER (val); break; @@ -193,8 +193,7 @@ acpi_ns_root_initialize (void) case ACPI_TYPE_MUTEX: obj_desc->mutex.node = new_node; - obj_desc->mutex.sync_level = (u8) ACPI_STRTOUL - (val, NULL, 10); + obj_desc->mutex.sync_level = (u8) (ACPI_TO_INTEGER (val) - 1); if (ACPI_STRCMP (init_val->name, "_GL_") == 0) { /* @@ -204,6 +203,7 @@ acpi_ns_root_initialize (void) status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 1, &obj_desc->mutex.semaphore); if (ACPI_FAILURE (status)) { + acpi_ut_remove_reference (obj_desc); goto unlock_and_exit; } @@ -219,6 +219,7 @@ acpi_ns_root_initialize (void) status = acpi_os_create_semaphore (1, 1, &obj_desc->mutex.semaphore); if (ACPI_FAILURE (status)) { + acpi_ut_remove_reference (obj_desc); goto unlock_and_exit; } } @@ -236,7 +237,8 @@ acpi_ns_root_initialize (void) /* Store pointer to value descriptor in the Node */ - status = acpi_ns_attach_object (new_node, obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc)); + status = acpi_ns_attach_object (new_node, obj_desc, + ACPI_GET_OBJECT_TYPE (obj_desc)); /* Remove local reference to the object */ @@ -462,7 +464,8 @@ acpi_ns_lookup ( type = this_node->type; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Prefix-only Pathname (Zero name segments), Flags=%X\n", flags)); + "Prefix-only Pathname (Zero name segments), Flags=%X\n", + flags)); break; case AML_DUAL_NAME_PREFIX: @@ -554,7 +557,7 @@ acpi_ns_lookup ( /* Try to find the single (4 character) ACPI name */ status = acpi_ns_search_and_enter (simple_name, walk_state, current_node, - interpreter_mode, this_search_type, local_flags, &this_node); + interpreter_mode, this_search_type, local_flags, &this_node); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { /* Name not found in ACPI namespace */ diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c index 89b997717..bfd922c5c 100644 --- a/drivers/acpi/namespace/nsalloc.c +++ b/drivers/acpi/namespace/nsalloc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -502,8 +502,8 @@ acpi_ns_delete_namespace_subtree ( * visit the node */ level++; - parent_node = child_node; - child_node = NULL; + parent_node = child_node; + child_node = NULL; } } else { @@ -650,8 +650,8 @@ acpi_ns_delete_namespace_by_owner ( * visit the node */ level++; - parent_node = child_node; - child_node = NULL; + parent_node = child_node; + child_node = NULL; } else if (child_node->owner_id == owner_id) { deletion_node = child_node; diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c index 8afa1dcf7..1f6af3eb6 100644 --- a/drivers/acpi/namespace/nsdump.c +++ b/drivers/acpi/namespace/nsdump.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -198,7 +198,8 @@ acpi_ns_dump_one_object ( } if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { - ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", this_node->name.integer)); + ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", + this_node->name.integer)); } /* @@ -226,9 +227,8 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_PROCESSOR: acpi_os_printf ("ID %X Len %.4X Addr %p\n", - obj_desc->processor.proc_id, - obj_desc->processor.length, - (char *) obj_desc->processor.address); + obj_desc->processor.proc_id, obj_desc->processor.length, + (char *) obj_desc->processor.address); break; @@ -241,16 +241,15 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_METHOD: acpi_os_printf ("Args %X Len %.4X Aml %p\n", - (u32) obj_desc->method.param_count, - obj_desc->method.aml_length, - obj_desc->method.aml_start); + (u32) obj_desc->method.param_count, + obj_desc->method.aml_length, obj_desc->method.aml_start); break; case ACPI_TYPE_INTEGER: acpi_os_printf ("= %8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; @@ -258,7 +257,7 @@ acpi_ns_dump_one_object ( if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { acpi_os_printf ("Elements %.2X\n", - obj_desc->package.count); + obj_desc->package.count); } else { acpi_os_printf ("[Length not yet evaluated]\n"); @@ -298,11 +297,12 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_REGION: - acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id)); + acpi_os_printf ("[%s]", + acpi_ut_get_region_name (obj_desc->region.space_id)); if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n", - ACPI_FORMAT_UINT64 (obj_desc->region.address), - obj_desc->region.length); + ACPI_FORMAT_UINT64 (obj_desc->region.address), + obj_desc->region.length); } else { acpi_os_printf (" [Address/Length not yet evaluated]\n"); @@ -313,7 +313,7 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_LOCAL_REFERENCE: acpi_os_printf ("[%s]\n", - acpi_ps_get_opcode_name (obj_desc->reference.opcode)); + acpi_ps_get_opcode_name (obj_desc->reference.opcode)); break; @@ -322,7 +322,7 @@ acpi_ns_dump_one_object ( if (obj_desc->buffer_field.buffer_obj && obj_desc->buffer_field.buffer_obj->buffer.node) { acpi_os_printf ("Buf [%4.4s]", - acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node)); + acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node)); } break; @@ -330,30 +330,31 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_LOCAL_REGION_FIELD: acpi_os_printf ("Rgn [%4.4s]", - acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node)); + acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node)); break; case ACPI_TYPE_LOCAL_BANK_FIELD: acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]", - acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node), - acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node)); + acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node), + acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node)); break; case ACPI_TYPE_LOCAL_INDEX_FIELD: acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]", - acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node), - acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node)); + acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node), + acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node)); break; case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: - acpi_os_printf ("Target %4.4s (%p)\n", acpi_ut_get_node_name (obj_desc), obj_desc); + acpi_os_printf ("Target %4.4s (%p)\n", + acpi_ut_get_node_name (obj_desc), obj_desc); break; default: @@ -371,10 +372,10 @@ acpi_ns_dump_one_object ( case ACPI_TYPE_LOCAL_INDEX_FIELD: acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n", - (obj_desc->common_field.base_byte_offset * 8) - + obj_desc->common_field.start_field_bit_offset, - obj_desc->common_field.bit_length, - obj_desc->common_field.access_byte_width); + (obj_desc->common_field.base_byte_offset * 8) + + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.bit_length, + obj_desc->common_field.access_byte_width); break; default: @@ -471,12 +472,13 @@ acpi_ns_dump_one_object ( obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); if (obj_type > ACPI_TYPE_LOCAL_MAX) { - acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type); + acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", + obj_type); bytes_to_dump = 32; } else { acpi_os_printf ("(Ptr to ACPI Object type %s, %X)\n", - acpi_ut_get_type_name (obj_type), obj_type); + acpi_ut_get_type_name (obj_type), obj_type); bytes_to_dump = sizeof (union acpi_operand_object); } break; @@ -484,8 +486,9 @@ acpi_ns_dump_one_object ( default: - acpi_os_printf ("(String or Buffer ptr - not an object descriptor) [%s]\n", - acpi_ut_get_descriptor_name (obj_desc)); + acpi_os_printf ( + "(String or Buffer ptr - not an object descriptor) [%s]\n", + acpi_ut_get_descriptor_name (obj_desc)); bytes_to_dump = 16; break; } @@ -547,12 +550,14 @@ cleanup: } +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_ns_dump_objects * * PARAMETERS: Type - Object type to be dumped - * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX + * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX * for an effectively unlimited depth. * owner_id - Dump only objects owned by this ID. Use * ACPI_UINT32_MAX to match all owners. @@ -632,6 +637,8 @@ acpi_ns_dump_tables ( return_VOID; } +#endif /* ACPI_FUTURE_USAGE */ + /******************************************************************************* * diff --git a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c index 7196a0112..d30a59e6b 100644 --- a/drivers/acpi/namespace/nsdumpdv.c +++ b/drivers/acpi/namespace/nsdumpdv.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,10 +91,10 @@ acpi_ns_dump_one_device ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", - info->hardware_id.value, - ACPI_FORMAT_UINT64 (info->address), - info->current_status)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, + " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", + info->hardware_id.value, ACPI_FORMAT_UINT64 (info->address), + info->current_status)); ACPI_MEM_FREE (info); } @@ -133,7 +133,8 @@ acpi_ns_dump_root_devices (void) return; } - ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, + "Display of all devices in the namespace:\n")); status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 418f03ee2..0d008d536 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,14 +57,9 @@ * * FUNCTION: acpi_ns_evaluate_relative * - * PARAMETERS: Handle - The relative containing object - * Pathname - Name of method to execute, If NULL, the + * PARAMETERS: Pathname - Name of method to execute, If NULL, the * handle is the object to execute - * Params - List of parameters to pass to the method, - * terminated by NULL. Params itself may be - * NULL if no parameters are being passed. - * return_object - Where to put method's return value (if - * any). If NULL, no value is returned. + * Info - Method info block * * RETURN: Status * @@ -138,8 +133,7 @@ acpi_ns_evaluate_relative ( } /* - * Now that we have a handle to the object, we can attempt - * to evaluate it. + * Now that we have a handle to the object, we can attempt to evaluate it. */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", pathname, node, acpi_ns_get_attached_object (node))); @@ -165,9 +159,9 @@ cleanup1: * * PARAMETERS: Pathname - Fully qualified pathname to the object * Info - Contains: - * return_object - Where to put method's return value (if + * return_object - Where to put method's return value (if * any). If NULL, no value is returned. - * Params - List of parameters to pass to the method, + * Params - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. * @@ -213,14 +207,14 @@ acpi_ns_evaluate_by_name ( (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object at [%s] was not found, status=%.4X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Object at [%s] was not found, status=%.4X\n", pathname, status)); goto cleanup; } /* - * Now that we have a handle to the object, we can attempt - * to evaluate it. + * Now that we have a handle to the object, we can attempt to evaluate it. */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", pathname, info->node, acpi_ns_get_attached_object (info->node))); @@ -303,9 +297,8 @@ acpi_ns_evaluate_by_handle ( } /* - * For a method alias, we must grab the actual method node - * so that proper scoping context will be established - * before execution. + * For a method alias, we must grab the actual method node so that proper + * scoping context will be established before execution. */ if (acpi_ns_get_type (info->node) == ACPI_TYPE_LOCAL_METHOD_ALIAS) { info->node = ACPI_CAST_PTR (struct acpi_namespace_node, info->node->object); @@ -314,11 +307,9 @@ acpi_ns_evaluate_by_handle ( /* * Two major cases here: * 1) The object is an actual control method -- execute it. - * 2) The object is not a method -- just return it's current - * value + * 2) The object is not a method -- just return it's current value * - * In both cases, the namespace is unlocked by the - * acpi_ns* procedure + * In both cases, the namespace is unlocked by the acpi_ns* procedure */ if (acpi_ns_get_type (info->node) == ACPI_TYPE_METHOD) { /* @@ -328,15 +319,13 @@ acpi_ns_evaluate_by_handle ( } else { /* - * Case 2) Object is NOT a method, just return its - * current value + * Case 2) Object is NOT a method, just return its current value */ status = acpi_ns_get_object_value (info); } /* - * Check if there is a return value on the stack that must - * be dealt with + * Check if there is a return value on the stack that must be dealt with */ if (status == AE_CTRL_RETURN_VALUE) { /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ @@ -345,8 +334,8 @@ acpi_ns_evaluate_by_handle ( } /* - * Namespace was unlocked by the handling acpi_ns* function, - * so we just return + * Namespace was unlocked by the handling acpi_ns* function, so we + * just return */ return_ACPI_STATUS (status); } @@ -356,12 +345,7 @@ acpi_ns_evaluate_by_handle ( * * FUNCTION: acpi_ns_execute_control_method * - * PARAMETERS: method_node - The method to execute - * Params - List of parameters to pass to the method, - * terminated by NULL. Params itself may be - * NULL if no parameters are being passed. - * return_obj_desc - List of result objects to be returned - * from the method. + * PARAMETERS: Info - Method info block (w/params) * * RETURN: Status * @@ -430,8 +414,7 @@ acpi_ns_execute_control_method ( * * FUNCTION: acpi_ns_get_object_value * - * PARAMETERS: Node - The object - * return_obj_desc - Where the objects value is returned + * PARAMETERS: Info - Method info block (w/params) * * RETURN: Status * @@ -453,28 +436,25 @@ acpi_ns_get_object_value ( /* - * Objects require additional resolution steps (e.g., the - * Node may be a field that must be read, etc.) -- we can't just grab - * the object out of the node. + * Objects require additional resolution steps (e.g., the Node may be a + * field that must be read, etc.) -- we can't just grab the object out of + * the node. */ /* - * Use resolve_node_to_value() to get the associated value. This call - * always deletes obj_desc (allocated above). + * Use resolve_node_to_value() to get the associated value. This call always + * deletes obj_desc (allocated above). * - * NOTE: we can get away with passing in NULL for a walk state - * because obj_desc is guaranteed to not be a reference to either - * a method local or a method argument (because this interface can only be - * called from the acpi_evaluate external interface, never called from - * a running control method.) + * NOTE: we can get away with passing in NULL for a walk state because + * obj_desc is guaranteed to not be a reference to either a method local or + * a method argument (because this interface can only be called from the + * acpi_evaluate external interface, never called from a running method.) * - * Even though we do not directly invoke the interpreter - * for this, we must enter it because we could access an opregion. - * The opregion access code assumes that the interpreter - * is locked. + * Even though we do not directly invoke the interpreter for this, we must + * enter it because we could access an opregion. The opregion access code + * assumes that the interpreter is locked. * - * We must release the namespace lock before entering the - * intepreter. + * We must release the namespace lock before entering the intepreter. */ status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { @@ -485,16 +465,18 @@ acpi_ns_get_object_value ( if (ACPI_SUCCESS (status)) { status = acpi_ex_resolve_node_to_value (&resolved_node, NULL); /* - * If acpi_ex_resolve_node_to_value() succeeded, the return value was - * placed in resolved_node. + * If acpi_ex_resolve_node_to_value() succeeded, the return value was placed + * in resolved_node. */ acpi_ex_exit_interpreter (); if (ACPI_SUCCESS (status)) { status = AE_CTRL_RETURN_VALUE; - info->return_object = ACPI_CAST_PTR (union acpi_operand_object, resolved_node); + info->return_object = ACPI_CAST_PTR + (union acpi_operand_object, resolved_node); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n", - info->return_object, acpi_ut_get_object_type_name (info->return_object))); + info->return_object, + acpi_ut_get_object_type_name (info->return_object))); } } diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 861787520..4a46b3806 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,7 +77,8 @@ acpi_ns_initialize_objects ( ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "**** Starting initialization of namespace objects ****\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Completing Region/Field/Buffer/Package initialization:")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, + "Completing Region/Field/Buffer/Package initialization:")); /* Set all init info to zero */ @@ -142,7 +143,8 @@ acpi_ns_initialize_devices ( info.num_STA = 0; info.num_INI = 0; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, + "Executing all Device _STA and_INI methods:")); status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { @@ -257,8 +259,8 @@ acpi_ns_init_one_object ( } /* - * Each of these types can contain executable AML code within - * the declaration. + * Each of these types can contain executable AML code within the + * declaration. */ switch (type) { case ACPI_TYPE_REGION: @@ -267,21 +269,18 @@ acpi_ns_init_one_object ( status = acpi_ds_get_region_arguments (obj_desc); break; - case ACPI_TYPE_BUFFER_FIELD: info->field_init++; status = acpi_ds_get_buffer_field_arguments (obj_desc); break; - case ACPI_TYPE_BUFFER: info->buffer_init++; status = acpi_ds_get_buffer_arguments (obj_desc); break; - case ACPI_TYPE_PACKAGE: info->package_init++; @@ -301,15 +300,17 @@ acpi_ns_init_one_object ( acpi_format_exception (status))); } - /* Print a dot for each object unless we are going to print the entire pathname */ - + /* + * Print a dot for each object unless we are going to print the entire + * pathname + */ if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); } /* - * We ignore errors from above, and always return OK, since - * we don't want to abort the walk on any single error. + * We ignore errors from above, and always return OK, since we don't want + * to abort the walk on any single error. */ acpi_ex_exit_interpreter (); return (AE_OK); @@ -363,7 +364,8 @@ acpi_ns_init_one_device ( return_ACPI_STATUS (AE_OK); } - if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) { + if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && + (!(acpi_dbg_level & ACPI_LV_INFO))) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); } @@ -418,6 +420,12 @@ acpi_ns_init_one_device ( status = AE_OK; } else { + /* Delete any return object (especially if implicit_return is enabled) */ + + if (pinfo.return_object) { + acpi_ut_remove_reference (pinfo.return_object); + } + /* Count of successful INIs */ info->num_INI++; @@ -429,6 +437,5 @@ acpi_ns_init_one_device ( status = acpi_gbl_init_handler (pinfo.node, ACPI_INIT_DEVICE_INI); } - return_ACPI_STATUS (status); } diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c index 314ec6659..1d7aedf68 100644 --- a/drivers/acpi/namespace/nsload.c +++ b/drivers/acpi/namespace/nsload.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,12 +92,14 @@ acpi_ns_load_table ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_start)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", + table_desc->aml_start)); /* Ignore table if there is no AML contained within */ if (!table_desc->aml_length) { - ACPI_REPORT_WARNING (("Zero-length AML block in table [%4.4s]\n", table_desc->pointer->signature)); + ACPI_REPORT_WARNING (("Zero-length AML block in table [%4.4s]\n", + table_desc->pointer->signature)); return_ACPI_STATUS (AE_OK); } @@ -110,7 +112,8 @@ acpi_ns_load_table ( * to another control method, we can't continue parsing * because we don't know how many arguments to parse next! */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "**** Loading table into namespace ****\n")); status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { @@ -196,7 +199,6 @@ acpi_ns_load_table_by_type ( if (ACPI_SUCCESS (status)) { table_desc->loaded_into_namespace = TRUE; } - break; @@ -252,7 +254,6 @@ acpi_ns_load_table_by_type ( table_desc = table_desc->next; } - break; @@ -320,6 +321,8 @@ acpi_ns_load_namespace ( } +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_ns_delete_subtree @@ -451,5 +454,7 @@ acpi_ns_unload_namespace ( return_ACPI_STATUS (status); } +#endif /* ACPI_FUTURE_USAGE */ + #endif diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index e0b9663ae..b6f8f910e 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -202,7 +202,11 @@ acpi_ns_get_pathname_length ( next_node = acpi_ns_get_parent_node (next_node); } - return (size + 1); + if (!size) { + size = 1; /* Root node case */ + } + + return (size + 1); /* +1 for null string terminator */ } @@ -253,7 +257,8 @@ acpi_ns_handle_to_pathname ( acpi_ns_build_external_path (node, required_size, buffer->pointer); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n", (char *) buffer->pointer, (u32) required_size)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n", + (char *) buffer->pointer, (u32) required_size)); return_ACPI_STATUS (AE_OK); } diff --git a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c index 6eb3e86b8..4e41e66db 100644 --- a/drivers/acpi/namespace/nsobject.c +++ b/drivers/acpi/namespace/nsobject.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index 530982a38..a0e13e8d3 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c index 7870a43eb..0e6dea236 100644 --- a/drivers/acpi/namespace/nssearch.c +++ b/drivers/acpi/namespace/nssearch.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,8 +96,10 @@ acpi_ns_search_node ( scope_name = acpi_ns_get_external_pathname (node); if (scope_name) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s (%p) For [%4.4s] (%s)\n", - scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type))); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Searching %s (%p) For [%4.4s] (%s)\n", + scope_name, node, (char *) &target_name, + acpi_ut_get_type_name (type))); ACPI_MEM_FREE (scope_name); } @@ -164,7 +166,7 @@ acpi_ns_search_node ( * PARAMETERS: *target_name - Ascii ACPI name to search for * *Node - Starting node where search will begin * Type - Object type to match - * **return_node - Where the matched Named Obj is returned + * **return_node - Where the matched Node is returned * * RETURN: Status * @@ -199,13 +201,13 @@ acpi_ns_search_parent_tree ( parent_node = acpi_ns_get_parent_node (node); /* - * If there is no parent (i.e., we are at the root) or - * type is "local", we won't be searching the parent tree. + * If there is no parent (i.e., we are at the root) or type is "local", + * we won't be searching the parent tree. */ if (!parent_node) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n", (char *) &target_name)); - return_ACPI_STATUS (AE_NOT_FOUND); + return_ACPI_STATUS (AE_NOT_FOUND); } if (acpi_ns_local (type)) { @@ -217,11 +219,12 @@ acpi_ns_search_parent_tree ( /* Search the parent tree */ - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char *) &target_name)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Searching parent [%4.4s] for [%4.4s]\n", + acpi_ut_get_node_name (parent_node), (char *) &target_name)); /* - * Search parents until found the target or we have backed up to - * the root + * Search parents until target is found or we have backed up to the root */ while (parent_node) { /* @@ -230,7 +233,7 @@ acpi_ns_search_parent_tree ( * the actual name we are searching for. Typechecking comes later. */ status = acpi_ns_search_node (target_name, parent_node, - ACPI_TYPE_ANY, return_node); + ACPI_TYPE_ANY, return_node); if (ACPI_SUCCESS (status)) { return_ACPI_STATUS (status); } @@ -293,7 +296,8 @@ acpi_ns_search_and_enter ( /* Parameter validation */ if (!node || !target_name || !return_node) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param: Node %p Name %X return_node %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Null param: Node %p Name %X return_node %p\n", node, target_name, return_node)); ACPI_REPORT_ERROR (("ns_search_and_enter: Null parameter\n")); @@ -330,22 +334,20 @@ acpi_ns_search_and_enter ( } /* - * The name was not found. If we are NOT performing the - * first pass (name entry) of loading the namespace, search - * the parent tree (all the way to the root if necessary.) - * We don't want to perform the parent search when the - * namespace is actually being loaded. We want to perform - * the search when namespace references are being resolved - * (load pass 2) and during the execution phase. + * The name was not found. If we are NOT performing the first pass + * (name entry) of loading the namespace, search the parent tree (all the + * way to the root if necessary.) We don't want to perform the parent + * search when the namespace is actually being loaded. We want to perform + * the search when namespace references are being resolved (load pass 2) + * and during the execution phase. */ if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) && (flags & ACPI_NS_SEARCH_PARENT)) { /* - * Not found at this level - search parent tree according - * to ACPI specification + * Not found at this level - search parent tree according to the + * ACPI specification */ - status = acpi_ns_search_parent_tree (target_name, node, - type, return_node); + status = acpi_ns_search_parent_tree (target_name, node, type, return_node); if (ACPI_SUCCESS (status)) { return_ACPI_STATUS (status); } @@ -355,7 +357,8 @@ acpi_ns_search_and_enter ( * In execute mode, just search, never add names. Exit now. */ if (interpreter_mode == ACPI_IMODE_EXECUTE) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "%4.4s Not found in %p [Not adding]\n", (char *) &target_name, node)); return_ACPI_STATUS (AE_NOT_FOUND); diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c index bf49ce296..75da76cc0 100644 --- a/drivers/acpi/namespace/nsutils.c +++ b/drivers/acpi/namespace/nsutils.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,12 +85,14 @@ acpi_ns_report_error ( if (lookup_status == AE_BAD_CHARACTER) { /* There is a non-ascii character in the name */ - acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n", *(ACPI_CAST_PTR (u32, internal_name))); + acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n", + *(ACPI_CAST_PTR (u32, internal_name))); } else { /* Convert path to external format */ - status = acpi_ns_externalize_name (ACPI_UINT32_MAX, internal_name, NULL, &name); + status = acpi_ns_externalize_name (ACPI_UINT32_MAX, + internal_name, NULL, &name); /* Print target name */ @@ -141,7 +143,8 @@ acpi_ns_report_method_error ( if (path) { - status = acpi_ns_get_node_by_path (path, prefix_node, ACPI_NS_NO_UPSEARCH, &node); + status = acpi_ns_get_node_by_path (path, prefix_node, + ACPI_NS_NO_UPSEARCH, &node); if (ACPI_FAILURE (status)) { acpi_os_printf ("report_method_error: Could not get node\n"); return; @@ -180,7 +183,7 @@ acpi_ns_print_node_pathname ( return; } - /* Convert handle to a full pathname and print it (with supplied message) */ + /* Convert handle to full pathname and print it (with supplied message) */ buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; @@ -324,13 +327,11 @@ acpi_ns_get_internal_name_length ( info->fully_qualified = FALSE; /* - * For the internal name, the required length is 4 bytes - * per segment, plus 1 each for root_prefix, multi_name_prefix_op, - * segment count, trailing null (which is not really needed, - * but no there's harm in putting it there) + * For the internal name, the required length is 4 bytes per segment, plus + * 1 each for root_prefix, multi_name_prefix_op, segment count, trailing null + * (which is not really needed, but no there's harm in putting it there) * - * strlen() + 1 covers the first name_seg, which has no - * path separator + * strlen() + 1 covers the first name_seg, which has no path separator */ if (acpi_ns_valid_root_prefix (next_external_char[0])) { info->fully_qualified = TRUE; @@ -347,10 +348,9 @@ acpi_ns_get_internal_name_length ( } /* - * Determine the number of ACPI name "segments" by counting - * the number of path separators within the string. Start - * with one segment since the segment count is (# separators) - * + 1, and zero separators is ok. + * Determine the number of ACPI name "segments" by counting the number of + * path separators within the string. Start with one segment since the + * segment count is [(# separators) + 1], and zero separators is ok. */ if (*next_external_char) { info->num_segments = 1; @@ -625,7 +625,8 @@ acpi_ns_externalize_name ( /* 4-byte names */ names_index = prefix_length + 2; - num_segments = (acpi_native_uint) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)]; + num_segments = (acpi_native_uint) (u8) + internal_name[(acpi_native_uint) (prefix_length + 1)]; break; case AML_DUAL_NAME_PREFIX: @@ -672,7 +673,7 @@ acpi_ns_externalize_name ( } /* - * Build converted_name... + * Build converted_name */ *converted_name = ACPI_MEM_CALLOCATE (required_length); if (!(*converted_name)) { @@ -756,7 +757,7 @@ acpi_ns_map_handle_to_node ( * * PARAMETERS: Node - Node to be converted to a Handle * - * RETURN: An USER acpi_handle + * RETURN: A user handle * * DESCRIPTION: Convert a real Node to a namespace handle * @@ -960,7 +961,7 @@ cleanup: * (which "should not happen"). * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_name acpi_ns_find_parent_name ( struct acpi_namespace_node *child_node) @@ -976,7 +977,8 @@ acpi_ns_find_parent_name ( parent_node = acpi_ns_get_parent_node (child_node); if (parent_node) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Parent of %p [%4.4s] is %p [%4.4s]\n", child_node, acpi_ut_get_node_name (child_node), parent_node, acpi_ut_get_node_name (parent_node))); @@ -985,12 +987,14 @@ acpi_ns_find_parent_name ( } } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Unable to find parent of %p (%4.4s)\n", child_node, acpi_ut_get_node_name (child_node))); } return_VALUE (ACPI_UNKNOWN_NAME); } +#endif /******************************************************************************* @@ -1018,11 +1022,9 @@ acpi_ns_get_parent_node ( } /* - * Walk to the end of this peer list. - * The last entry is marked with a flag and the peer - * pointer is really a pointer back to the parent. - * This saves putting a parent back pointer in each and - * every named object! + * Walk to the end of this peer list. The last entry is marked with a flag + * and the peer pointer is really a pointer back to the parent. This saves + * putting a parent back pointer in each and every named object! */ while (!(node->flags & ANOBJ_END_OF_PEER_LIST)) { node = node->peer; @@ -1039,8 +1041,8 @@ acpi_ns_get_parent_node ( * * PARAMETERS: Node - Current table entry * - * RETURN: Next valid Node in the linked node list. NULL if no more valid - * nodess + * RETURN: Next valid Node in the linked node list. NULL if no more valid + * nodes. * * DESCRIPTION: Find the next valid node within a name table. * Useful for implementing NULL-end-of-list loops. diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c index 5482e74de..4de2444df 100644 --- a/drivers/acpi/namespace/nswalk.c +++ b/drivers/acpi/namespace/nswalk.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -264,8 +264,8 @@ acpi_ns_walk_namespace ( * node, visit the onde */ level++; - parent_node = child_node; - child_node = NULL; + parent_node = child_node; + child_node = NULL; } } } diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index 8e916b5e2..1dc995586 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -72,7 +73,7 @@ * be valid (non-null) * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_evaluate_object_typed ( acpi_handle handle, @@ -143,6 +144,7 @@ acpi_evaluate_object_typed ( return_buffer->length = 0; return_ACPI_STATUS (AE_TYPE); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -354,6 +356,7 @@ acpi_evaluate_object ( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_evaluate_object); /******************************************************************************* @@ -426,6 +429,7 @@ acpi_walk_namespace ( (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_walk_namespace); /******************************************************************************* @@ -599,6 +603,7 @@ acpi_get_devices ( (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_devices); /******************************************************************************* diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c index 0508b4d79..f2405efd1 100644 --- a/drivers/acpi/namespace/nsxfname.c +++ b/drivers/acpi/namespace/nsxfname.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -129,6 +130,7 @@ acpi_get_handle ( return (status); } +EXPORT_SYMBOL(acpi_get_handle); /****************************************************************************** @@ -210,6 +212,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } +EXPORT_SYMBOL(acpi_get_name); /****************************************************************************** @@ -234,7 +237,7 @@ acpi_get_object_info ( { acpi_status status; struct acpi_namespace_node *node; - struct acpi_device_info info; + struct acpi_device_info *info; struct acpi_device_info *return_info; struct acpi_compatible_id_list *cid_list = NULL; acpi_size size; @@ -251,55 +254,59 @@ acpi_get_object_info ( return (status); } + info = ACPI_MEM_CALLOCATE (sizeof (struct acpi_device_info)); + if (!info) { + return (AE_NO_MEMORY); + } + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { - return (status); + goto cleanup; } node = acpi_ns_map_handle_to_node (handle); if (!node) { (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - return (AE_BAD_PARAMETER); + goto cleanup; } /* Init return structure */ size = sizeof (struct acpi_device_info); - ACPI_MEMSET (&info, 0, size); - info.type = node->type; - info.name = node->name.integer; - info.valid = 0; + info->type = node->type; + info->name = node->name.integer; + info->valid = 0; status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { - return (status); + goto cleanup; } /* If not a device, we are all done */ - if (info.type == ACPI_TYPE_DEVICE) { + if (info->type == ACPI_TYPE_DEVICE) { /* * Get extra info for ACPI Devices objects only: * Run the Device _HID, _UID, _CID, _STA, _ADR and _sx_d methods. * * Note: none of these methods are required, so they may or may - * not be present for this device. The Info.Valid bitfield is used + * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and ran successfully. */ /* Execute the Device._HID method */ - status = acpi_ut_execute_HID (node, &info.hardware_id); + status = acpi_ut_execute_HID (node, &info->hardware_id); if (ACPI_SUCCESS (status)) { - info.valid |= ACPI_VALID_HID; + info->valid |= ACPI_VALID_HID; } /* Execute the Device._UID method */ - status = acpi_ut_execute_UID (node, &info.unique_id); + status = acpi_ut_execute_UID (node, &info->unique_id); if (ACPI_SUCCESS (status)) { - info.valid |= ACPI_VALID_UID; + info->valid |= ACPI_VALID_UID; } /* Execute the Device._CID method */ @@ -308,32 +315,30 @@ acpi_get_object_info ( if (ACPI_SUCCESS (status)) { size += ((acpi_size) cid_list->count - 1) * sizeof (struct acpi_compatible_id); - info.valid |= ACPI_VALID_CID; + info->valid |= ACPI_VALID_CID; } /* Execute the Device._STA method */ - status = acpi_ut_execute_STA (node, &info.current_status); + status = acpi_ut_execute_STA (node, &info->current_status); if (ACPI_SUCCESS (status)) { - info.valid |= ACPI_VALID_STA; + info->valid |= ACPI_VALID_STA; } /* Execute the Device._ADR method */ status = acpi_ut_evaluate_numeric_object (METHOD_NAME__ADR, node, - &info.address); + &info->address); if (ACPI_SUCCESS (status)) { - info.valid |= ACPI_VALID_ADR; + info->valid |= ACPI_VALID_ADR; } /* Execute the Device._sx_d methods */ - status = acpi_ut_execute_sxds (node, info.highest_dstates); + status = acpi_ut_execute_sxds (node, info->highest_dstates); if (ACPI_SUCCESS (status)) { - info.valid |= ACPI_VALID_SXDS; + info->valid |= ACPI_VALID_SXDS; } - - status = AE_OK; } /* Validate/Allocate/Clear caller buffer */ @@ -346,7 +351,7 @@ acpi_get_object_info ( /* Populate the return buffer */ return_info = buffer->pointer; - ACPI_MEMCPY (return_info, &info, sizeof (struct acpi_device_info)); + ACPI_MEMCPY (return_info, info, sizeof (struct acpi_device_info)); if (cid_list) { ACPI_MEMCPY (&return_info->compatibility_id, cid_list, cid_list->size); @@ -354,9 +359,11 @@ acpi_get_object_info ( cleanup: + ACPI_MEM_FREE (info); if (cid_list) { ACPI_MEM_FREE (cid_list); } return (status); } +EXPORT_SYMBOL(acpi_get_object_info); diff --git a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c index 537032073..19acf3267 100644 --- a/drivers/acpi/namespace/nsxfobj.c +++ b/drivers/acpi/namespace/nsxfobj.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -106,6 +107,7 @@ acpi_get_type ( status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } +EXPORT_SYMBOL(acpi_get_type); /******************************************************************************* @@ -171,6 +173,7 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } +EXPORT_SYMBOL(acpi_get_parent); /******************************************************************************* @@ -255,5 +258,5 @@ unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } - +EXPORT_SYMBOL(acpi_get_next_object); diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 1f63b4d71..9bfce46cd 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -22,7 +22,7 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * */ - +#include #include #include #include @@ -184,18 +184,30 @@ acpi_numa_init() result = acpi_table_parse_srat(ACPI_SRAT_MEMORY_AFFINITY, acpi_parse_memory_affinity, NR_NODE_MEMBLKS); // IA64 specific - } else { - /* FIXME */ - printk("Warning: acpi_table_parse(ACPI_SRAT) returned %d!\n",result); } /* SLIT: System Locality Information Table */ result = acpi_table_parse(ACPI_SLIT, acpi_parse_slit); - if (result < 1) { - /* FIXME */ - printk("Warning: acpi_table_parse(ACPI_SLIT) returned %d!\n",result); - } acpi_numa_arch_fixup(); return 0; } + +int +acpi_get_pxm(acpi_handle h) +{ + unsigned long pxm; + acpi_status status; + acpi_handle handle; + acpi_handle phandle = h; + + do { + handle = phandle; + status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm); + if (ACPI_SUCCESS(status)) + return (int)pxm; + status = acpi_get_parent(handle, &phandle); + } while(ACPI_SUCCESS(status)); + return -1; +} +EXPORT_SYMBOL(acpi_get_pxm); diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index a7c4fdfcb..96772a48b 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include @@ -61,8 +63,11 @@ struct acpi_os_dpc #ifdef ENABLE_DEBUGGER #include + /* stuff for debugger support */ int acpi_in_debugger; +EXPORT_SYMBOL(acpi_in_debugger); + extern char line_buf[80]; #endif /*ENABLE_DEBUGGER*/ @@ -117,6 +122,7 @@ acpi_os_printf(const char *fmt,...) acpi_os_vprintf(fmt, args); va_end(args); } +EXPORT_SYMBOL(acpi_os_printf); void acpi_os_vprintf(const char *fmt, va_list args) @@ -147,6 +153,7 @@ acpi_os_free(void *ptr) { kfree(ptr); } +EXPORT_SYMBOL(acpi_os_free); acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr) @@ -205,6 +212,7 @@ acpi_os_unmap_memory(void __iomem *virt, acpi_size size) iounmap(virt); } +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_os_get_physical_address(void *virt, acpi_physical_address *phys) { @@ -215,6 +223,7 @@ acpi_os_get_physical_address(void *virt, acpi_physical_address *phys) return AE_OK; } +#endif #define ACPI_MAX_OVERRIDE_LEN 100 @@ -229,7 +238,7 @@ acpi_os_predefined_override (const struct acpi_predefined_names *init_val, *new_val = NULL; if (!memcmp (init_val->name, "_OS_", 4) && strlen(acpi_os_name)) { - printk(KERN_INFO PREFIX "Overriding _OS definition %s\n", + printk(KERN_INFO PREFIX "Overriding _OS definition to '%s'\n", acpi_os_name); *new_val = acpi_os_name; } @@ -306,11 +315,12 @@ acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) */ void -acpi_os_sleep(u32 sec, u32 ms) +acpi_os_sleep(acpi_integer ms) { current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ * sec + (ms * HZ) / 1000); + schedule_timeout(((signed long) ms * HZ) / 1000); } +EXPORT_SYMBOL(acpi_os_sleep); void acpi_os_stall(u32 us) @@ -325,6 +335,30 @@ acpi_os_stall(u32 us) us -= delay; } } +EXPORT_SYMBOL(acpi_os_stall); + +/* + * Support ACPI 3.0 AML Timer operand + * Returns 64-bit free-running, monotonically increasing timer + * with 100ns granularity + */ +u64 +acpi_os_get_timer (void) +{ + static u64 t; + +#ifdef CONFIG_HPET + /* TBD: use HPET if available */ +#endif + +#ifdef CONFIG_X86_PM_TIMER + /* TBD: default to PM timer if HPET was not available */ +#endif + if (!t) + printk(KERN_ERR PREFIX "acpi_os_get_timer() TBD\n"); + + return ++t; +} acpi_status acpi_os_read_port( @@ -354,6 +388,7 @@ acpi_os_read_port( return AE_OK; } +EXPORT_SYMBOL(acpi_os_read_port); acpi_status acpi_os_write_port( @@ -378,6 +413,7 @@ acpi_os_write_port( return AE_OK; } +EXPORT_SYMBOL(acpi_os_write_port); acpi_status acpi_os_read_memory( @@ -496,6 +532,7 @@ acpi_os_read_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, void *value return (result ? AE_ERROR : AE_OK); } +EXPORT_SYMBOL(acpi_os_read_pci_configuration); acpi_status acpi_os_write_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, acpi_integer value, u32 width) @@ -599,7 +636,7 @@ acpi_os_write_pci_configuration ( acpi_integer value, u32 width) { - return (AE_SUPPORT); + return AE_SUPPORT; } acpi_status @@ -609,7 +646,7 @@ acpi_os_read_pci_configuration ( void *value, u32 width) { - return (AE_SUPPORT); + return AE_SUPPORT; } void @@ -689,6 +726,7 @@ acpi_os_queue_for_execution( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_os_queue_for_execution); void acpi_os_wait_events_complete( @@ -696,6 +734,7 @@ acpi_os_wait_events_complete( { flush_workqueue(kacpid_wq); } +EXPORT_SYMBOL(acpi_os_wait_events_complete); /* * Allocate the memory for a spinlock and initialize it. @@ -807,6 +846,7 @@ acpi_os_create_semaphore( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_os_create_semaphore); /* @@ -833,6 +873,7 @@ acpi_os_delete_semaphore( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_os_delete_semaphore); /* @@ -897,7 +938,7 @@ acpi_os_wait_semaphore( // TODO: A better timeout algorithm? { int i = 0; - static const int quantum_ms = 1000/HZ; + static const int quantum_ms = (HZ>1000)?1:(1000/HZ); ret = down_trylock(sem); for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { @@ -922,6 +963,7 @@ acpi_os_wait_semaphore( return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_os_wait_semaphore); /* @@ -948,7 +990,9 @@ acpi_os_signal_semaphore( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_os_signal_semaphore); +#ifdef ACPI_FUTURE_USAGE u32 acpi_os_get_line(char *buffer) { @@ -967,6 +1011,7 @@ acpi_os_get_line(char *buffer) return 0; } +#endif /* ACPI_FUTURE_USAGE */ /* Assumes no unreadable holes inbetween */ u8 @@ -979,6 +1024,7 @@ acpi_os_readable(void *ptr, acpi_size len) return 1; } +#ifdef ACPI_FUTURE_USAGE u8 acpi_os_writable(void *ptr, acpi_size len) { @@ -986,6 +1032,7 @@ acpi_os_writable(void *ptr, acpi_size len) The later may be difficult at early boot when kmap doesn't work yet. */ return 1; } +#endif u32 acpi_os_get_thread_id (void) @@ -1007,17 +1054,22 @@ acpi_os_signal ( printk(KERN_ERR PREFIX "Fatal opcode executed\n"); break; case ACPI_SIGNAL_BREAKPOINT: - { - char *bp_info = (char*) info; - - printk(KERN_ERR "ACPI breakpoint: %s\n", bp_info); - } + /* + * AML Breakpoint + * ACPI spec. says to treat it as a NOP unless + * you are debugging. So if/when we integrate + * AML debugger into the kernel debugger its + * hook will go here. But until then it is + * not useful to print anything on breakpoints. + */ + break; default: break; } return AE_OK; } +EXPORT_SYMBOL(acpi_os_signal); int __init acpi_os_name_setup(char *str) @@ -1100,3 +1152,11 @@ acpi_wake_gpes_always_on_setup(char *str) __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup); +/* + * max_cstate is defined in the base kernel so modules can + * change it w/o depending on the state of the processor module. + */ +unsigned int max_cstate = ACPI_PROCESSOR_MAX_POWER; + + +EXPORT_SYMBOL(max_cstate); diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c index 87bf4b61e..b5d98895f 100644 --- a/drivers/acpi/parser/psargs.c +++ b/drivers/acpi/parser/psargs.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c index 30620375b..c1360fc23 100644 --- a/drivers/acpi/parser/psopcode.c +++ b/drivers/acpi/parser/psopcode.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,6 +194,7 @@ #define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST) #define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST) +#define ARGP_TIMER_OP ARG_NONE #define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) #define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) #define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) @@ -288,7 +289,7 @@ #define ARGI_LOCAL6 ARG_NONE #define ARGI_LOCAL7 ARG_NONE #define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER) -#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER) +#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_COMPUTEDATA, ARGI_INTEGER,ARGI_COMPUTEDATA,ARGI_INTEGER) #define ARGI_METHOD_OP ARGI_INVALID_OPCODE #define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE #define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFER_OR_STRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) @@ -321,10 +322,11 @@ #define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE -#define ARGI_STORE_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_TARGETREF) +#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF) #define ARGI_STRING_OP ARGI_INVALID_OPCODE #define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE +#define ARGI_TIMER_OP ARG_NONE #define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) #define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) #define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET) @@ -519,16 +521,16 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = /* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), /* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), /* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R), -/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE), /* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), /* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT), /* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), /* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), /* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), /* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), -/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE), +/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT), +/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT), /* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT), /* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), /* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), @@ -588,7 +590,6 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = /* 6C */ ACPI_OP ("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), /* 6D */ ACPI_OP ("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), - /* ACPI 2.0 opcodes */ /* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), @@ -606,7 +607,11 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = /* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), /* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), /* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE) +/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE), + +/* ACPI 3.0 opcodes */ + +/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R) /*! [End] no source code translation !*/ }; @@ -615,7 +620,6 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = * This table is directly indexed by the opcodes, and returns an * index into the table above */ - static const u8 acpi_gbl_short_op_index[256] = { /* 0 1 2 3 4 5 6 7 */ @@ -654,7 +658,10 @@ static const u8 acpi_gbl_short_op_index[256] = /* 0xF8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x45, }; - +/* + * This table is indexed by the second opcode of the extended opcode + * pair. It returns an index into the opcode table (acpi_gbl_aml_op_info) + */ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = { /* 0 1 2 3 4 5 6 7 */ @@ -665,7 +672,7 @@ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = /* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x7B, /* 0x20 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, /* 0x28 */ 0x52, 0x53, 0x54, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x30 */ 0x55, 0x56, 0x57, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x30 */ 0x55, 0x56, 0x57, 0x7e, _UNK, _UNK, _UNK, _UNK, /* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x40 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x48 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, @@ -724,7 +731,7 @@ acpi_ps_get_opcode_info ( default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode [%X]\n", opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode [%4.4X]\n", opcode)); break; } diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 00a3540f0..fd2751f51 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -164,123 +164,125 @@ acpi_ps_complete_this_op ( /* Delete this op and the subtree below it if asked to */ - if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) == ACPI_PARSE_DELETE_TREE) && - (walk_state->op_info->class != AML_CLASS_ARGUMENT)) { - /* Make sure that we only delete this subtree */ + if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) || + (walk_state->op_info->class == AML_CLASS_ARGUMENT)) { + return_VOID; + } + + /* Make sure that we only delete this subtree */ + + if (op->common.parent) { + /* + * Check if we need to replace the operator and its subtree + * with a return value op (placeholder op) + */ + parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode); + + switch (parent_info->class) { + case AML_CLASS_CONTROL: + break; + + case AML_CLASS_CREATE: - if (op->common.parent) { /* - * Check if we need to replace the operator and its subtree - * with a return value op (placeholder op) + * These opcodes contain term_arg operands. The current + * op must be replaced by a placeholder return op */ - parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode); - - switch (parent_info->class) { - case AML_CLASS_CONTROL: - break; + replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); + if (!replacement_op) { + goto cleanup; + } + break; - case AML_CLASS_CREATE: + case AML_CLASS_NAMED_OBJECT: - /* - * These opcodes contain term_arg operands. The current - * op must be replaced by a placeholder return op - */ + /* + * These opcodes contain term_arg operands. The current + * op must be replaced by a placeholder return op + */ + if ((op->common.parent->common.aml_opcode == AML_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_DATA_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_BUFFER_OP) || + (op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); if (!replacement_op) { - return_VOID; + goto cleanup; } - break; - - case AML_CLASS_NAMED_OBJECT: + } - /* - * These opcodes contain term_arg operands. The current - * op must be replaced by a placeholder return op - */ - if ((op->common.parent->common.aml_opcode == AML_REGION_OP) || - (op->common.parent->common.aml_opcode == AML_DATA_REGION_OP) || - (op->common.parent->common.aml_opcode == AML_BUFFER_OP) || - (op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || - (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { - replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); + if ((op->common.parent->common.aml_opcode == AML_NAME_OP) && + (walk_state->descending_callback != acpi_ds_exec_begin_op)) { + if ((op->common.aml_opcode == AML_BUFFER_OP) || + (op->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.aml_opcode == AML_VAR_PACKAGE_OP)) { + replacement_op = acpi_ps_alloc_op (op->common.aml_opcode); if (!replacement_op) { - return_VOID; + goto cleanup; } + + replacement_op->named.data = op->named.data; + replacement_op->named.length = op->named.length; } + } + break; - if ((op->common.parent->common.aml_opcode == AML_NAME_OP) && - (walk_state->descending_callback != acpi_ds_exec_begin_op)) { - if ((op->common.aml_opcode == AML_BUFFER_OP) || - (op->common.aml_opcode == AML_PACKAGE_OP) || - (op->common.aml_opcode == AML_VAR_PACKAGE_OP)) { - replacement_op = acpi_ps_alloc_op (op->common.aml_opcode); - if (!replacement_op) { - return_VOID; - } + default: + replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); + if (!replacement_op) { + goto cleanup; + } + } - replacement_op->named.data = op->named.data; - replacement_op->named.length = op->named.length; - } - } - break; + /* We must unlink this op from the parent tree */ - default: - replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); - if (!replacement_op) { - return_VOID; - } + prev = op->common.parent->common.value.arg; + if (prev == op) { + /* This op is the first in the list */ + + if (replacement_op) { + replacement_op->common.parent = op->common.parent; + replacement_op->common.value.arg = NULL; + replacement_op->common.node = op->common.node; + op->common.parent->common.value.arg = replacement_op; + replacement_op->common.next = op->common.next; + } + else { + op->common.parent->common.value.arg = op->common.next; } + } - /* We must unlink this op from the parent tree */ + /* Search the parent list */ - prev = op->common.parent->common.value.arg; - if (prev == op) { - /* This op is the first in the list */ + else while (prev) { + /* Traverse all siblings in the parent's argument list */ + next = prev->common.next; + if (next == op) { if (replacement_op) { - replacement_op->common.parent = op->common.parent; - replacement_op->common.value.arg = NULL; - replacement_op->common.node = op->common.node; - op->common.parent->common.value.arg = replacement_op; - replacement_op->common.next = op->common.next; + replacement_op->common.parent = op->common.parent; + replacement_op->common.value.arg = NULL; + replacement_op->common.node = op->common.node; + prev->common.next = replacement_op; + replacement_op->common.next = op->common.next; + next = NULL; } else { - op->common.parent->common.value.arg = op->common.next; + prev->common.next = op->common.next; + next = NULL; } } - /* Search the parent list */ - - else while (prev) { - /* Traverse all siblings in the parent's argument list */ - - next = prev->common.next; - if (next == op) { - if (replacement_op) { - replacement_op->common.parent = op->common.parent; - replacement_op->common.value.arg = NULL; - replacement_op->common.node = op->common.node; - prev->common.next = replacement_op; - replacement_op->common.next = op->common.next; - next = NULL; - } - else { - prev->common.next = op->common.next; - next = NULL; - } - } - - prev = next; - } + prev = next; } + } - /* Now we can actually delete the subtree rooted at op */ - acpi_ps_delete_parse_tree (op); +cleanup: - return_VOID; - } + /* Now we can actually delete the subtree rooted at op */ + acpi_ps_delete_parse_tree (op); return_VOID; } @@ -552,7 +554,8 @@ acpi_ps_parse_loop ( if (!pre_op) { pre_op = acpi_ps_alloc_op (walk_state->opcode); if (!pre_op) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto close_this_op; } } @@ -578,7 +581,8 @@ acpi_ps_parse_loop ( /* Make sure that we found a NAME and didn't run out of arguments */ if (!GET_CURRENT_ARG_TYPE (walk_state->arg_types)) { - return_ACPI_STATUS (AE_AML_NO_OPERAND); + status = AE_AML_NO_OPERAND; + goto close_this_op; } /* We know that this arg is a name, move to next arg */ @@ -638,7 +642,8 @@ acpi_ps_parse_loop ( walk_state->op_info = acpi_ps_get_opcode_info (walk_state->opcode); op = acpi_ps_alloc_op (walk_state->opcode); if (!op) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto close_this_op; } if (walk_state->op_info->flags & AML_CREATE) { @@ -801,7 +806,7 @@ acpi_ps_parse_loop ( status = acpi_ps_push_scope (parser_state, op, walk_state->arg_types, walk_state->arg_count); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto close_this_op; } op = NULL; continue; @@ -1128,7 +1133,7 @@ acpi_ps_parse_aml ( else if (status == AE_CTRL_TERMINATE) { status = AE_OK; } - else if (status != AE_OK) { + else if ((status != AE_OK) && (walk_state->method_desc)) { ACPI_REPORT_METHOD_ERROR ("Method execution failed", walk_state->method_node, NULL, status); diff --git a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c index b917edfb5..dcbed4960 100644 --- a/drivers/acpi/parser/psscope.c +++ b/drivers/acpi/parser/psscope.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c index a25f31c8a..2140bd1ac 100644 --- a/drivers/acpi/parser/pstree.c +++ b/drivers/acpi/parser/pstree.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -181,6 +181,8 @@ acpi_ps_append_arg ( } +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_ps_get_child @@ -192,7 +194,6 @@ acpi_ps_append_arg ( * DESCRIPTION: Get op's children or NULL if none * ******************************************************************************/ - union acpi_parse_object * acpi_ps_get_child ( union acpi_parse_object *op) @@ -322,4 +323,5 @@ acpi_ps_get_depth_next ( return (next); } +#endif /* ACPI_FUTURE_USAGE */ diff --git a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c index e4b8a280e..b3597cb19 100644 --- a/drivers/acpi/parser/psutils.c +++ b/drivers/acpi/parser/psutils.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,10 +129,9 @@ union acpi_parse_object* acpi_ps_alloc_op ( u16 opcode) { - union acpi_parse_object *op = NULL; - u32 size; - u8 flags; + union acpi_parse_object *op; const struct acpi_opcode_info *op_info; + u8 flags = ACPI_PARSEOP_GENERIC; ACPI_FUNCTION_ENTRY (); @@ -140,32 +139,28 @@ acpi_ps_alloc_op ( op_info = acpi_ps_get_opcode_info (opcode); - /* Allocate the minimum required size object */ + /* Determine type of parse_op required */ if (op_info->flags & AML_DEFER) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_DEFERRED; } else if (op_info->flags & AML_NAMED) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_NAMED; } else if (opcode == AML_INT_BYTELIST_OP) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_BYTELIST; } - else { - size = sizeof (struct acpi_parse_obj_common); - flags = ACPI_PARSEOP_GENERIC; - } - if (size == sizeof (struct acpi_parse_obj_common)) { - /* - * The generic op is by far the most common (16 to 1) - */ + /* Allocate the minimum required size object */ + + if (flags == ACPI_PARSEOP_GENERIC) { + /* The generic op (default) is by far the most common (16 to 1) */ + op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE); } else { + /* Extended parseop */ + op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT); } @@ -213,6 +208,7 @@ acpi_ps_free_op ( } +#ifdef ACPI_ENABLE_OBJECT_CACHE /******************************************************************************* * * FUNCTION: acpi_ps_delete_parse_cache @@ -236,6 +232,7 @@ acpi_ps_delete_parse_cache ( acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE_EXT); return_VOID; } +#endif /******************************************************************************* @@ -272,6 +269,7 @@ acpi_ps_is_prefix_char ( /* * Get op's name (4-byte name segment) or 0 if unnamed */ +#ifdef ACPI_FUTURE_USAGE u32 acpi_ps_get_name ( union acpi_parse_object *op) @@ -288,6 +286,7 @@ acpi_ps_get_name ( return (op->named.name); } +#endif /* ACPI_FUTURE_USAGE */ /* diff --git a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c index 59dfbe179..e04b1b736 100644 --- a/drivers/acpi/parser/pswalk.c +++ b/drivers/acpi/parser/pswalk.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c index 9281f6aec..b318ad247 100644 --- a/drivers/acpi/parser/psxface.c +++ b/drivers/acpi/parser/psxface.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index ec264c806..5d19b39e9 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c @@ -67,6 +67,7 @@ acpi_pci_data_handler ( * to resolve PCI information for ACPI-PCI devices defined in the namespace. * This typically occurs when resolving PCI operation region information. */ +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_os_get_pci_id ( acpi_handle handle, @@ -114,6 +115,7 @@ acpi_os_get_pci_id ( return_ACPI_STATUS(AE_OK); } +#endif /* ACPI_FUTURE_USAGE */ int @@ -124,8 +126,8 @@ acpi_pci_bind ( acpi_status status = AE_OK; struct acpi_pci_data *data = NULL; struct acpi_pci_data *pdata = NULL; - char pathname[ACPI_PATHNAME_MAX] = {0}; - struct acpi_buffer buffer = {ACPI_PATHNAME_MAX, pathname}; + char *pathname = NULL; + struct acpi_buffer buffer = {0, NULL}; acpi_handle handle = NULL; ACPI_FUNCTION_TRACE("acpi_pci_bind"); @@ -133,9 +135,18 @@ acpi_pci_bind ( if (!device || !device->parent) return_VALUE(-EINVAL); + pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); + if(!pathname) + return_VALUE(-ENOMEM); + memset(pathname, 0, ACPI_PATHNAME_MAX); + buffer.length = ACPI_PATHNAME_MAX; + buffer.pointer = pathname; + data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); - if (!data) + if (!data){ + kfree (pathname); return_VALUE(-ENOMEM); + } memset(data, 0, sizeof(struct acpi_pci_data)); acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); @@ -214,6 +225,7 @@ acpi_pci_bind ( data->id.device, data->id.function)); data->bus = data->dev->subordinate; device->ops.bind = acpi_pci_bind; + device->ops.unbind = acpi_pci_unbind; } /* @@ -251,12 +263,64 @@ acpi_pci_bind ( } end: + kfree(pathname); if (result) kfree(data); return_VALUE(result); } +int acpi_pci_unbind( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_pci_data *data = NULL; + char *pathname = NULL; + struct acpi_buffer buffer = {0, NULL}; + + ACPI_FUNCTION_TRACE("acpi_pci_unbind"); + + if (!device || !device->parent) + return_VALUE(-EINVAL); + + pathname = (char *) kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); + if(!pathname) + return_VALUE(-ENOMEM); + memset(pathname, 0, ACPI_PATHNAME_MAX); + + buffer.length = ACPI_PATHNAME_MAX; + buffer.pointer = pathname; + acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n", + pathname)); + kfree(pathname); + + status = acpi_get_data(device->handle, acpi_pci_data_handler, (void**)&data); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to get data from device %s\n", + acpi_device_bid(device))); + result = -ENODEV; + goto end; + } + + status = acpi_detach_data(device->handle, acpi_pci_data_handler); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to detach data from device %s\n", + acpi_device_bid(device))); + result = -ENODEV; + goto end; + } + if (data->dev->subordinate) { + acpi_pci_irq_del_prt(data->id.segment, data->bus->number); + } + kfree(data); + +end: + return_VALUE(result); +} int acpi_pci_bind_root ( @@ -267,22 +331,35 @@ acpi_pci_bind_root ( int result = 0; acpi_status status = AE_OK; struct acpi_pci_data *data = NULL; - char pathname[ACPI_PATHNAME_MAX] = {0}; - struct acpi_buffer buffer = {ACPI_PATHNAME_MAX, pathname}; + char *pathname = NULL; + struct acpi_buffer buffer = {0, NULL}; ACPI_FUNCTION_TRACE("acpi_pci_bind_root"); - if (!device || !id || !bus) + pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); + if(!pathname) + return_VALUE(-ENOMEM); + memset(pathname, 0, ACPI_PATHNAME_MAX); + + buffer.length = ACPI_PATHNAME_MAX; + buffer.pointer = pathname; + + if (!device || !id || !bus){ + kfree(pathname); return_VALUE(-EINVAL); + } data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); - if (!data) + if (!data){ + kfree(pathname); return_VALUE(-ENOMEM); + } memset(data, 0, sizeof(struct acpi_pci_data)); data->id = *id; data->bus = bus; device->ops.bind = acpi_pci_bind; + device->ops.unbind = acpi_pci_unbind; acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); @@ -299,6 +376,7 @@ acpi_pci_bind_root ( } end: + kfree(pathname); if (result != 0) kfree(data); diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 23e994522..a4750192a 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -43,7 +43,7 @@ ACPI_MODULE_NAME ("pci_irq") struct acpi_prt_list acpi_prt; - +DEFINE_SPINLOCK(acpi_prt_lock); /* -------------------------------------------------------------------------- PCI IRQ Routing Table (PRT) Support @@ -68,18 +68,20 @@ acpi_pci_irq_find_prt_entry ( * Parse through all PRT entries looking for a match on the specified * PCI device's segment, bus, device, and pin (don't care about func). * - * TBD: Acquire/release lock */ + spin_lock(&acpi_prt_lock); list_for_each(node, &acpi_prt.entries) { entry = list_entry(node, struct acpi_prt_entry, node); if ((segment == entry->id.segment) && (bus == entry->id.bus) && (device == entry->id.device) && (pin == entry->pin)) { + spin_unlock(&acpi_prt_lock); return_PTR(entry); } } + spin_unlock(&acpi_prt_lock); return_PTR(NULL); } @@ -141,14 +143,29 @@ acpi_pci_irq_add_entry ( entry->id.segment, entry->id.bus, entry->id.device, ('A' + entry->pin), prt->source, entry->link.index)); - /* TBD: Acquire/release lock */ + spin_lock(&acpi_prt_lock); list_add_tail(&entry->node, &acpi_prt.entries); acpi_prt.count++; + spin_unlock(&acpi_prt_lock); return_VALUE(0); } +static void +acpi_pci_irq_del_entry ( + int segment, + int bus, + struct acpi_prt_entry *entry) +{ + if (segment == entry->id.segment && bus == entry->id.bus){ + acpi_prt.count--; + list_del(&entry->node); + kfree(entry); + } +} + + int acpi_pci_irq_add_prt ( acpi_handle handle, @@ -156,7 +173,7 @@ acpi_pci_irq_add_prt ( int bus) { acpi_status status = AE_OK; - char pathname[ACPI_PATHNAME_MAX] = {0}; + char *pathname = NULL; struct acpi_buffer buffer = {0, NULL}; struct acpi_pci_routing_table *prt = NULL; struct acpi_pci_routing_table *entry = NULL; @@ -164,6 +181,11 @@ acpi_pci_irq_add_prt ( ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt"); + pathname = (char *) kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); + if(!pathname) + return_VALUE(-ENOMEM); + memset(pathname, 0, ACPI_PATHNAME_MAX); + if (first_time) { acpi_prt.count = 0; INIT_LIST_HEAD(&acpi_prt.entries); @@ -175,7 +197,7 @@ acpi_pci_irq_add_prt ( * (either a PCI root bridge or PCI-PCI bridge). */ - buffer.length = sizeof(pathname); + buffer.length = ACPI_PATHNAME_MAX; buffer.pointer = pathname; acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); @@ -188,6 +210,7 @@ acpi_pci_irq_add_prt ( buffer.length = 0; buffer.pointer = NULL; + kfree(pathname); status = acpi_get_irq_routing_table(handle, &buffer); if (status != AE_BUFFER_OVERFLOW) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", @@ -196,8 +219,9 @@ acpi_pci_irq_add_prt ( } prt = kmalloc(buffer.length, GFP_KERNEL); - if (!prt) + if (!prt){ return_VALUE(-ENOMEM); + } memset(prt, 0, buffer.length); buffer.pointer = prt; @@ -222,11 +246,35 @@ acpi_pci_irq_add_prt ( return_VALUE(0); } +void +acpi_pci_irq_del_prt (int segment, int bus) +{ + struct list_head *node = NULL, *n = NULL; + struct acpi_prt_entry *entry = NULL; + + if (!acpi_prt.count) { + return; + } + + printk(KERN_DEBUG "ACPI: Delete PCI Interrupt Routing Table for %x:%x\n", + segment, bus); + spin_lock(&acpi_prt_lock); + list_for_each_safe(node, n, &acpi_prt.entries) { + entry = list_entry(node, struct acpi_prt_entry, node); + acpi_pci_irq_del_entry(segment, bus, entry); + } + spin_unlock(&acpi_prt_lock); +} /* -------------------------------------------------------------------------- PCI Interrupt Routing Support -------------------------------------------------------------------------- */ +/* + * acpi_pci_irq_lookup + * success: return IRQ >= 0 + * failure: return -1 + */ static int acpi_pci_irq_lookup ( struct pci_bus *bus, @@ -249,14 +297,14 @@ acpi_pci_irq_lookup ( entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin); if (!entry) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); - return_VALUE(0); + return_VALUE(-1); } if (entry->link.handle) { irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low); - if (!irq) { + if (irq < 0) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n")); - return_VALUE(0); + return_VALUE(-1); } } else { irq = entry->link.index; @@ -269,6 +317,11 @@ acpi_pci_irq_lookup ( return_VALUE(irq); } +/* + * acpi_pci_irq_derive + * success: return IRQ >= 0 + * failure: return < 0 + */ static int acpi_pci_irq_derive ( struct pci_dev *dev, @@ -277,7 +330,7 @@ acpi_pci_irq_derive ( int *active_high_low) { struct pci_dev *bridge = dev; - int irq = 0; + int irq = -1; u8 bridge_pin = 0; ACPI_FUNCTION_TRACE("acpi_pci_irq_derive"); @@ -289,7 +342,7 @@ acpi_pci_irq_derive ( * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ - while (!irq && bridge->bus->self) { + while (irq < 0 && bridge->bus->self) { pin = (pin + PCI_SLOT(bridge->devfn)) % 4; bridge = bridge->bus->self; @@ -299,7 +352,7 @@ acpi_pci_irq_derive ( if (!bridge_pin) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No interrupt pin configured for device %s\n", pci_name(bridge))); - return_VALUE(0); + return_VALUE(-1); } /* Pin is from 0 to 3 */ bridge_pin --; @@ -310,9 +363,9 @@ acpi_pci_irq_derive ( pin, edge_level, active_high_low); } - if (!irq) { + if (irq < 0) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to derive IRQ for device %s\n", pci_name(dev))); - return_VALUE(0); + return_VALUE(-1); } ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n", @@ -321,6 +374,11 @@ acpi_pci_irq_derive ( return_VALUE(irq); } +/* + * acpi_pci_irq_enable + * success: return 0 + * failure: return < 0 + */ int acpi_pci_irq_enable ( @@ -330,6 +388,7 @@ acpi_pci_irq_enable ( u8 pin = 0; int edge_level = ACPI_LEVEL_SENSITIVE; int active_high_low = ACPI_ACTIVE_LOW; + extern int via_interrupt_line_quirk; ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); @@ -358,20 +417,20 @@ acpi_pci_irq_enable ( * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ - if (!irq) + if (irq < 0) irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low); /* * No IRQ known to the ACPI subsystem - maybe the BIOS / * driver reported one, then use it. Exit in any case. */ - if (!irq) { + if (irq < 0) { printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI", pci_name(dev), ('A' + pin)); /* Interrupt Line values above 0xF are forbidden */ - if (dev->irq && (dev->irq <= 0xF)) { + if (dev->irq >= 0 && (dev->irq <= 0xF)) { printk(" - using IRQ %d\n", dev->irq); - return_VALUE(dev->irq); + return_VALUE(0); } else { printk("\n"); @@ -379,6 +438,9 @@ acpi_pci_irq_enable ( } } + if (via_interrupt_line_quirk) + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15); + dev->irq = acpi_register_gsi(irq, edge_level, active_high_low); printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u " @@ -388,5 +450,59 @@ acpi_pci_irq_enable ( (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq); - return_VALUE(dev->irq); + return_VALUE(0); +} +EXPORT_SYMBOL(acpi_pci_irq_enable); + + +#ifdef CONFIG_ACPI_DEALLOCATE_IRQ +void +acpi_pci_irq_disable ( + struct pci_dev *dev) +{ + int gsi = 0; + u8 pin = 0; + int edge_level = ACPI_LEVEL_SENSITIVE; + int active_high_low = ACPI_ACTIVE_LOW; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_disable"); + + if (!dev) + return_VOID; + + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); + if (!pin) + return_VOID; + pin--; + + if (!dev->bus) + return_VOID; + + /* + * First we check the PCI IRQ routing table (PRT) for an IRQ. + */ + gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, + &edge_level, &active_high_low); + /* + * If no PRT entry was found, we'll try to derive an IRQ from the + * device's parent bridge. + */ + if (gsi < 0) + gsi = acpi_pci_irq_derive(dev, pin, + &edge_level, &active_high_low); + if (gsi < 0) + return_VOID; + + /* + * TBD: It might be worth clearing dev->irq by magic constant + * (e.g. PCI_UNDEFINED_IRQ). + */ + + printk(KERN_INFO PREFIX "PCI interrupt for device %s disabled\n", + pci_name(dev)); + + acpi_unregister_gsi(gsi); + + return_VOID; } +#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 86e8a0ca0..3191b5ff1 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -110,13 +110,13 @@ acpi_pci_link_check_possible ( switch (resource->id) { case ACPI_RSTYPE_START_DPF: - return AE_OK; + return_ACPI_STATUS(AE_OK); case ACPI_RSTYPE_IRQ: { struct acpi_resource_irq *p = &resource->data.irq; if (!p || !p->number_of_interrupts) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Blank IRQ resource\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } for (i = 0; (inumber_of_interrupts && iinterrupts[i]) { @@ -137,7 +137,7 @@ acpi_pci_link_check_possible ( if (!p || !p->number_of_interrupts) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Blank EXT IRQ resource\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } for (i = 0; (inumber_of_interrupts && iinterrupts[i]) { @@ -155,10 +155,10 @@ acpi_pci_link_check_possible ( default: ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource is not an IRQ entry\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } - return AE_CTRL_TERMINATE; + return_ACPI_STATUS(AE_CTRL_TERMINATE); } @@ -207,7 +207,7 @@ acpi_pci_link_check_current ( */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Blank IRQ resource\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } *irq = p->interrupts[0]; break; @@ -222,7 +222,7 @@ acpi_pci_link_check_current ( */ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Blank EXT IRQ resource\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } *irq = p->interrupts[0]; break; @@ -230,9 +230,9 @@ acpi_pci_link_check_current ( default: ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource isn't an IRQ\n")); - return AE_OK; + return_ACPI_STATUS(AE_OK); } - return AE_CTRL_TERMINATE; + return_ACPI_STATUS(AE_CTRL_TERMINATE); } /* @@ -307,50 +307,57 @@ acpi_pci_link_set ( struct { struct acpi_resource res; struct acpi_resource end; - } resource; - struct acpi_buffer buffer = {sizeof(resource)+1, &resource}; + } *resource; + struct acpi_buffer buffer = {0, NULL}; ACPI_FUNCTION_TRACE("acpi_pci_link_set"); if (!link || !irq) return_VALUE(-EINVAL); - memset(&resource, 0, sizeof(resource)); + resource = kmalloc( sizeof(*resource)+1, GFP_KERNEL); + if(!resource) + return_VALUE(-ENOMEM); + + memset(resource, 0, sizeof(*resource)+1); + buffer.length = sizeof(*resource) +1; + buffer.pointer = resource; switch(link->irq.resource_type) { case ACPI_RSTYPE_IRQ: - resource.res.id = ACPI_RSTYPE_IRQ; - resource.res.length = sizeof(struct acpi_resource); - resource.res.data.irq.edge_level = link->irq.edge_level; - resource.res.data.irq.active_high_low = link->irq.active_high_low; + resource->res.id = ACPI_RSTYPE_IRQ; + resource->res.length = sizeof(struct acpi_resource); + resource->res.data.irq.edge_level = link->irq.edge_level; + resource->res.data.irq.active_high_low = link->irq.active_high_low; if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) - resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; + resource->res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; else - resource.res.data.irq.shared_exclusive = ACPI_SHARED; - resource.res.data.irq.number_of_interrupts = 1; - resource.res.data.irq.interrupts[0] = irq; + resource->res.data.irq.shared_exclusive = ACPI_SHARED; + resource->res.data.irq.number_of_interrupts = 1; + resource->res.data.irq.interrupts[0] = irq; break; case ACPI_RSTYPE_EXT_IRQ: - resource.res.id = ACPI_RSTYPE_EXT_IRQ; - resource.res.length = sizeof(struct acpi_resource); - resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER; - resource.res.data.extended_irq.edge_level = link->irq.edge_level; - resource.res.data.extended_irq.active_high_low = link->irq.active_high_low; + resource->res.id = ACPI_RSTYPE_EXT_IRQ; + resource->res.length = sizeof(struct acpi_resource); + resource->res.data.extended_irq.producer_consumer = ACPI_CONSUMER; + resource->res.data.extended_irq.edge_level = link->irq.edge_level; + resource->res.data.extended_irq.active_high_low = link->irq.active_high_low; if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) - resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; + resource->res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; else - resource.res.data.irq.shared_exclusive = ACPI_SHARED; - resource.res.data.extended_irq.number_of_interrupts = 1; - resource.res.data.extended_irq.interrupts[0] = irq; + resource->res.data.irq.shared_exclusive = ACPI_SHARED; + resource->res.data.extended_irq.number_of_interrupts = 1; + resource->res.data.extended_irq.interrupts[0] = irq; /* ignore resource_source, it's optional */ break; default: printk("ACPI BUG: resource_type %d\n", link->irq.resource_type); - return_VALUE(-EINVAL); + result = -EINVAL; + goto end; } - resource.end.id = ACPI_RSTYPE_END_TAG; + resource->end.id = ACPI_RSTYPE_END_TAG; /* Attempt to set the resource */ status = acpi_set_current_resources(link->handle, &buffer); @@ -358,14 +365,15 @@ acpi_pci_link_set ( /* check for total failure */ if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); - return_VALUE(-ENODEV); + result = -ENODEV; + goto end; } /* Query _STA, set device->status */ result = acpi_bus_get_status(link->device); if (result) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); - return_VALUE(result); + goto end; } if (!link->device->status.enabled) { printk(KERN_WARNING PREFIX @@ -377,7 +385,7 @@ acpi_pci_link_set ( /* Query _CRS, set link->irq.active */ result = acpi_pci_link_get_current(link); if (result) { - return_VALUE(result); + goto end; } /* @@ -399,7 +407,9 @@ acpi_pci_link_set ( ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); - return_VALUE(0); +end: + kfree(resource); + return_VALUE(result); } @@ -577,6 +587,11 @@ static int acpi_pci_link_allocate(struct acpi_pci_link* link) { return_VALUE(0); } +/* + * acpi_pci_link_get_irq + * success: return IRQ >= 0 + * failure: return -1 + */ int acpi_pci_link_get_irq ( @@ -594,27 +609,27 @@ acpi_pci_link_get_irq ( result = acpi_bus_get_device(handle, &device); if (result) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); - return_VALUE(0); + return_VALUE(-1); } link = (struct acpi_pci_link *) acpi_driver_data(device); if (!link) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); - return_VALUE(0); + return_VALUE(-1); } /* TBD: Support multiple index (IRQ) entries per Link Device */ if (index) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index)); - return_VALUE(0); + return_VALUE(-1); } if (acpi_pci_link_allocate(link)) - return_VALUE(0); + return_VALUE(-1); if (!link->irq.active) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); - return_VALUE(0); + return_VALUE(-1); } if (edge_level) *edge_level = link->irq.edge_level; @@ -786,6 +801,18 @@ static int __init acpi_irq_penalty_update(char *str, int used) return 1; } +/* + * We'd like PNP to call this routine for the + * single ISA_USED value for each legacy device. + * But instead it calls us with each POSSIBLE setting. + * There is no ISA_POSSIBLE weight, so we simply use + * the (small) PCI_USING penalty. + */ +void acpi_penalize_isa_irq(int irq) +{ + acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; +} + /* * Over-ride default table to reserve additional IRQs for use by ISA * e.g. acpi_irq_isa=5 @@ -793,7 +820,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) */ static int __init acpi_irq_isa(char *str) { - return(acpi_irq_penalty_update(str, 1)); + return acpi_irq_penalty_update(str, 1); } __setup("acpi_irq_isa=", acpi_irq_isa); @@ -804,21 +831,21 @@ __setup("acpi_irq_isa=", acpi_irq_isa); */ static int __init acpi_irq_pci(char *str) { - return(acpi_irq_penalty_update(str, 0)); + return acpi_irq_penalty_update(str, 0); } __setup("acpi_irq_pci=", acpi_irq_pci); static int __init acpi_irq_nobalance_set(char *str) { acpi_irq_balance = 0; - return(1); + return 1; } __setup("acpi_irq_nobalance", acpi_irq_nobalance_set); int __init acpi_irq_balance_set(char *str) { acpi_irq_balance = 1; - return(1); + return 1; } __setup("acpi_irq_balance", acpi_irq_balance_set); diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index dd08b633a..2adaba68b 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -90,6 +90,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) return n; } +EXPORT_SYMBOL(acpi_pci_register_driver); void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) { @@ -112,6 +113,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) driver->remove(root->handle); } } +EXPORT_SYMBOL(acpi_pci_unregister_driver); static acpi_status get_root_bridge_busnr_callback (struct acpi_resource *resource, void *data) diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 4c3d2a7d2..419b371d9 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -303,7 +303,7 @@ int acpi_enable_wakeup_device_power (struct acpi_device *dev) ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power"); if (!dev || !dev->wakeup.flags.valid) - return -1; + return_VALUE(-1); arg.integer.value = 1; /* Open power resource */ @@ -313,7 +313,7 @@ int acpi_enable_wakeup_device_power (struct acpi_device *dev) ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error transition power state\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } } @@ -325,7 +325,7 @@ int acpi_enable_wakeup_device_power (struct acpi_device *dev) ret = -1; } - return ret; + return_VALUE(ret); } /* @@ -344,7 +344,7 @@ int acpi_disable_wakeup_device_power (struct acpi_device *dev) ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power"); if (!dev || !dev->wakeup.flags.valid) - return -1; + return_VALUE(-1); arg.integer.value = 0; /* Execute PSW */ @@ -352,7 +352,7 @@ int acpi_disable_wakeup_device_power (struct acpi_device *dev) if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } /* Close power resource */ @@ -362,11 +362,11 @@ int acpi_disable_wakeup_device_power (struct acpi_device *dev) ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error transition power state\n")); dev->wakeup.flags.valid = 0; - return -1; + return_VALUE(-1); } } - return ret; + return_VALUE(ret); } /* -------------------------------------------------------------------------- @@ -513,7 +513,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset) resource->references); end: - return 0; + return_VALUE(0); } static int acpi_power_open_fs(struct inode *inode, struct file *file) diff --git a/drivers/acpi/resources/Makefile b/drivers/acpi/resources/Makefile index 9916b6572..2130b7417 100644 --- a/drivers/acpi/resources/Makefile +++ b/drivers/acpi/resources/Makefile @@ -3,6 +3,8 @@ # obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \ - rscalc.o rsdump.o rsirq.o rsmemory.o rsutils.o + rscalc.o rsirq.o rsmemory.o rsutils.o + +obj-$(ACPI_FUTURE_USAGE) += rsdump.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c index 646f61c4d..ec4ae9a15 100644 --- a/drivers/acpi/resources/rsaddr.c +++ b/drivers/acpi/resources/rsaddr.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c index 299fc9376..1113af746 100644 --- a/drivers/acpi/resources/rscalc.c +++ b/drivers/acpi/resources/rscalc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -74,7 +74,6 @@ acpi_rs_get_byte_stream_length ( { acpi_size byte_stream_size_needed = 0; acpi_size segment_size; - struct acpi_resource_ext_irq *ex_irq = NULL; u8 done = FALSE; @@ -91,8 +90,8 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_IRQ: /* * IRQ Resource - * For an IRQ Resource, Byte 3, although optional, will - * always be created - it holds IRQ information. + * For an IRQ Resource, Byte 3, although optional, will always be + * created - it holds IRQ information. */ segment_size = 4; break; @@ -108,8 +107,8 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_START_DPF: /* * Start Dependent Functions Resource - * For a start_dependent_functions Resource, Byte 1, - * although optional, will always be created. + * For a start_dependent_functions Resource, Byte 1, although + * optional, will always be created. */ segment_size = 2; break; @@ -141,10 +140,9 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_VENDOR: /* * Vendor Defined Resource - * For a Vendor Specific resource, if the Length is - * between 1 and 7 it will be created as a Small - * Resource data type, otherwise it is a Large - * Resource data type. + * For a Vendor Specific resource, if the Length is between 1 and 7 + * it will be created as a Small Resource data type, otherwise it + * is a Large Resource data type. */ if (linked_list->data.vendor_specific.length > 7) { segment_size = 3; @@ -191,10 +189,9 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_ADDRESS16: /* * 16-Bit Address Resource - * The base size of this byte stream is 16. If a - * Resource Source string is not NULL, add 1 for - * the Index + the length of the null terminated - * string Resource Source + 1 for the null. + * The base size of this byte stream is 16. If a Resource Source + * string is not NULL, add 1 for the Index + the length of the null + * terminated string Resource Source + 1 for the null. */ segment_size = 16; @@ -223,10 +220,9 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_ADDRESS64: /* * 64-Bit Address Resource - * The base size of this byte stream is 46. If a Resource - * Source string is not NULL, add 1 for the Index + the - * length of the null terminated string Resource Source + - * 1 for the null. + * The base size of this byte stream is 46. If a resource_source + * string is not NULL, add 1 for the Index + the length of the null + * terminated string Resource Source + 1 for the null. */ segment_size = 46; @@ -239,9 +235,8 @@ acpi_rs_get_byte_stream_length ( case ACPI_RSTYPE_EXT_IRQ: /* * Extended IRQ Resource - * The base size of this byte stream is 9. This is for an - * Interrupt table length of 1. For each additional - * interrupt, add 4. + * The base size of this byte stream is 9. This is for an Interrupt + * table length of 1. For each additional interrupt, add 4. * If a Resource Source string is not NULL, add 1 for the * Index + the length of the null terminated string * Resource Source + 1 for the null. @@ -249,7 +244,7 @@ acpi_rs_get_byte_stream_length ( segment_size = 9 + (((acpi_size) linked_list->data.extended_irq.number_of_interrupts - 1) * 4); - if (ex_irq && ex_irq->resource_source.string_ptr) { + if (linked_list->data.extended_irq.resource_source.string_ptr) { segment_size += linked_list->data.extended_irq.resource_source.string_length; segment_size++; } @@ -257,8 +252,7 @@ acpi_rs_get_byte_stream_length ( default: /* - * If we get here, everything is out of sync, - * so exit with an error + * If we get here, everything is out of sync, exit with error */ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); @@ -366,7 +360,6 @@ acpi_rs_get_list_length ( /* * 32-Bit Memory Range Resource */ - bytes_consumed = 20; structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_mem32); @@ -395,14 +388,12 @@ acpi_rs_get_list_length ( bytes_consumed = temp16 + 3; /* - * Resource Source Index and Resource Source are - * optional elements. Check the length of the - * Bytestream. If it is greater than 43, that - * means that an Index exists and is followed by - * a null termininated string. Therefore, set - * the temp variable to the length minus the minimum - * byte stream length plus the byte for the Index to - * determine the size of the NULL terminiated string. + * Resource Source Index and Resource Source are optional elements. + * Check the length of the Bytestream. If it is greater than 43, + * that means that an Index exists and is followed by a null + * terminated string. Therefore, set the temp variable to the + * length minus the minimum byte stream length plus the byte for + * the Index to determine the size of the NULL terminated string. */ if (43 < temp16) { temp8 = (u8) (temp16 - 44); @@ -433,14 +424,12 @@ acpi_rs_get_list_length ( bytes_consumed = temp16 + 3; /* - * Resource Source Index and Resource Source are - * optional elements. Check the length of the - * Bytestream. If it is greater than 23, that - * means that an Index exists and is followed by - * a null termininated string. Therefore, set - * the temp variable to the length minus the minimum - * byte stream length plus the byte for the Index to - * determine the size of the NULL terminiated string. + * Resource Source Index and Resource Source are optional elements. + * Check the length of the Bytestream. If it is greater than 23, + * that means that an Index exists and is followed by a null + * terminated string. Therefore, set the temp variable to the + * length minus the minimum byte stream length plus the byte for + * the Index to determine the size of the NULL terminated string. */ if (23 < temp16) { temp8 = (u8) (temp16 - 24); @@ -471,14 +460,12 @@ acpi_rs_get_list_length ( bytes_consumed = temp16 + 3; /* - * Resource Source Index and Resource Source are - * optional elements. Check the length of the - * Bytestream. If it is greater than 13, that - * means that an Index exists and is followed by - * a null termininated string. Therefore, set - * the temp variable to the length minus the minimum - * byte stream length plus the byte for the Index to - * determine the size of the NULL terminiated string. + * Resource Source Index and Resource Source are optional elements. + * Check the length of the Bytestream. If it is greater than 13, + * that means that an Index exists and is followed by a null + * terminated string. Therefore, set the temp variable to the + * length minus the minimum byte stream length plus the byte for + * the Index to determine the size of the NULL terminated string. */ if (13 < temp16) { temp8 = (u8) (temp16 - 14); @@ -509,9 +496,8 @@ acpi_rs_get_list_length ( bytes_consumed = temp16 + 3; /* - * Point past the length field and the - * Interrupt vector flags to save off the - * Interrupt table length to the Temp8 variable. + * Point past the length field and the Interrupt vector flags to + * save off the Interrupt table length to the Temp8 variable. */ buffer += 3; temp8 = *buffer; @@ -523,14 +509,12 @@ acpi_rs_get_list_length ( additional_bytes = (u8) ((temp8 - 1) * 4); /* - * Resource Source Index and Resource Source are - * optional elements. Check the length of the - * Bytestream. If it is greater than 9, that - * means that an Index exists and is followed by - * a null termininated string. Therefore, set - * the temp variable to the length minus the minimum - * byte stream length plus the byte for the Index to - * determine the size of the NULL terminiated string. + * Resource Source Index and Resource Source are optional elements. + * Check the length of the Bytestream. If it is greater than 9, + * that means that an Index exists and is followed by a null + * terminated string. Therefore, set the temp variable to the + * length minus the minimum byte stream length plus the byte for + * the Index to determine the size of the NULL terminated string. */ if (9 + additional_bytes < temp16) { temp8 = (u8) (temp16 - (9 + additional_bytes)); @@ -565,9 +549,8 @@ acpi_rs_get_list_length ( bytes_consumed = 3; } - /* - * Point past the descriptor - */ + /* Point past the descriptor */ + ++buffer; /* @@ -595,9 +578,8 @@ acpi_rs_get_list_length ( buffer = byte_stream_buffer; bytes_consumed = 3; - /* - * Point past the descriptor - */ + /* Point past the descriptor */ + ++buffer; /* diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c index db6541acf..a3a0cbfda 100644 --- a/drivers/acpi/resources/rscreate.c +++ b/drivers/acpi/resources/rscreate.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c index a60ca5de5..a869980f7 100644 --- a/drivers/acpi/resources/rsdump.c +++ b/drivers/acpi/resources/rsdump.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c index d8187792a..972c746d3 100644 --- a/drivers/acpi/resources/rsio.c +++ b/drivers/acpi/resources/rsio.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c index cf5295af2..fd07a8702 100644 --- a/drivers/acpi/resources/rsirq.c +++ b/drivers/acpi/resources/rsirq.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c index 045e7e191..1297589d7 100644 --- a/drivers/acpi/resources/rslist.c +++ b/drivers/acpi/resources/rslist.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c index 4796cc6e9..7c935aecf 100644 --- a/drivers/acpi/resources/rsmemory.c +++ b/drivers/acpi/resources/rsmemory.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c index b6fd8359e..d16be44b5 100644 --- a/drivers/acpi/resources/rsmisc.c +++ b/drivers/acpi/resources/rsmisc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c index 01dea9b94..ee9ce13c0 100644 --- a/drivers/acpi/resources/rsutils.c +++ b/drivers/acpi/resources/rsutils.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -175,7 +175,7 @@ acpi_rs_get_crs_method_data ( * and the contents of the callers buffer is undefined. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_rs_get_prs_method_data ( acpi_handle handle, @@ -210,6 +210,7 @@ acpi_rs_get_prs_method_data ( acpi_ut_remove_reference (obj_desc); return_ACPI_STATUS (status); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -338,6 +339,13 @@ acpi_rs_set_srs_method_data ( * Execute the method, no return value */ status = acpi_ns_evaluate_relative ("_SRS", &info); + if (ACPI_SUCCESS (status)) { + /* Delete any return object (especially if implicit_return is enabled) */ + + if (info.return_object) { + acpi_ut_remove_reference (info.return_object); + } + } /* * Clean up and return the status from acpi_ns_evaluate_relative diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c index d02aa1df3..a9cdcbeb3 100644 --- a/drivers/acpi/resources/rsxface.c +++ b/drivers/acpi/resources/rsxface.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -156,6 +157,7 @@ acpi_get_current_resources ( status = acpi_rs_get_crs_method_data (device_handle, ret_buffer); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_current_resources); /******************************************************************************* @@ -178,7 +180,7 @@ acpi_get_current_resources ( * and the value of ret_buffer is undefined. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_possible_resources ( acpi_handle device_handle, @@ -208,6 +210,8 @@ acpi_get_possible_resources ( status = acpi_rs_get_prs_method_data (device_handle, ret_buffer); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_possible_resources); +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -310,6 +314,7 @@ cleanup: acpi_os_free (buffer.pointer); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_walk_resources); /******************************************************************************* @@ -354,6 +359,7 @@ acpi_set_current_resources ( status = acpi_rs_set_srs_method_data (device_handle, in_buffer); return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_set_current_resources); #define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field) @@ -427,3 +433,5 @@ acpi_resource_to_address64 ( return (AE_OK); } +EXPORT_SYMBOL(acpi_resource_to_address64); + diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 4e46eeddf..f20d88d3c 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2,6 +2,7 @@ * scan.c - support for transforming the ACPI namespace into individual objects */ +#include #include #include @@ -23,7 +24,7 @@ extern struct acpi_device *acpi_root; #define ACPI_BUS_DEVICE_NAME "System Bus" static LIST_HEAD(acpi_device_list); -spinlock_t acpi_device_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(acpi_device_lock); LIST_HEAD(acpi_wakeup_device_list); static void acpi_device_release(struct kobject * kobj) @@ -34,7 +35,49 @@ static void acpi_device_release(struct kobject * kobj) kfree(dev); } +struct acpi_device_attribute { + struct attribute attr; + ssize_t (*show)(struct acpi_device *, char *); + ssize_t (*store)(struct acpi_device *, const char *, size_t); +}; + +typedef void acpi_device_sysfs_files(struct kobject *, + const struct attribute *); + +static void setup_sys_fs_device_files(struct acpi_device *dev, + acpi_device_sysfs_files *func); + +#define create_sysfs_device_files(dev) \ + setup_sys_fs_device_files(dev, (acpi_device_sysfs_files *)&sysfs_create_file) +#define remove_sysfs_device_files(dev) \ + setup_sys_fs_device_files(dev, (acpi_device_sysfs_files *)&sysfs_remove_file) + + +#define to_acpi_device(n) container_of(n, struct acpi_device, kobj) +#define to_handle_attr(n) container_of(n, struct acpi_device_attribute, attr); + +static ssize_t acpi_device_attr_show(struct kobject *kobj, + struct attribute *attr, char *buf) +{ + struct acpi_device *device = to_acpi_device(kobj); + struct acpi_device_attribute *attribute = to_handle_attr(attr); + return attribute->show ? attribute->show(device, buf) : 0; +} +static ssize_t acpi_device_attr_store(struct kobject *kobj, + struct attribute *attr, const char *buf, size_t len) +{ + struct acpi_device *device = to_acpi_device(kobj); + struct acpi_device_attribute *attribute = to_handle_attr(attr); + return attribute->store ? attribute->store(device, buf, len) : len; +} + +static struct sysfs_ops acpi_device_sysfs_ops = { + .show = acpi_device_attr_show, + .store = acpi_device_attr_store, +}; + static struct kobj_type ktype_acpi_ns = { + .sysfs_ops = &acpi_device_sysfs_ops, .release = acpi_device_release, }; @@ -57,6 +100,7 @@ static void acpi_device_register(struct acpi_device * device, struct acpi_device INIT_LIST_HEAD(&device->children); INIT_LIST_HEAD(&device->node); INIT_LIST_HEAD(&device->g_list); + INIT_LIST_HEAD(&device->wakeup_list); spin_lock(&acpi_device_lock); if (device->parent) { @@ -64,15 +108,17 @@ static void acpi_device_register(struct acpi_device * device, struct acpi_device list_add_tail(&device->g_list,&device->parent->g_list); } else list_add_tail(&device->g_list,&acpi_device_list); + if (device->wakeup.flags.valid) + list_add_tail(&device->wakeup_list,&acpi_wakeup_device_list); spin_unlock(&acpi_device_lock); - kobject_init(&device->kobj); strlcpy(device->kobj.name,device->pnp.bus_id,KOBJ_NAME_LEN); if (parent) device->kobj.parent = &parent->kobj; device->kobj.ktype = &ktype_acpi_ns; device->kobj.kset = &acpi_namespace_kset; - kobject_add(&device->kobj); + kobject_register(&device->kobj); + create_sysfs_device_files(device); } static int @@ -80,6 +126,19 @@ acpi_device_unregister ( struct acpi_device *device, int type) { + spin_lock(&acpi_device_lock); + if (device->parent) { + list_del(&device->node); + list_del(&device->g_list); + } else + list_del(&device->g_list); + + list_del(&device->wakeup_list); + + spin_unlock(&acpi_device_lock); + + acpi_detach_data(device->handle, acpi_bus_data_handler); + remove_sysfs_device_files(device); kobject_unregister(&device->kobj); return 0; } @@ -158,10 +217,10 @@ acpi_bus_get_power_flags ( device->power.state = ACPI_STATE_UNKNOWN; - return 0; + return_VALUE(0); } -static int +int acpi_match_ids ( struct acpi_device *device, char *ids) @@ -271,18 +330,120 @@ acpi_bus_get_wakeup_device_flags ( if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E")) device->wakeup.flags.run_wake = 1; - /* TBD: lock */ - INIT_LIST_HEAD(&device->wakeup_list); - spin_lock(&acpi_device_lock); - list_add_tail(&device->wakeup_list, &acpi_wakeup_device_list); - spin_unlock(&acpi_device_lock); - end: if (ACPI_FAILURE(status)) device->flags.wake_capable = 0; - return 0; + return_VALUE(0); } +/* -------------------------------------------------------------------------- + ACPI hotplug sysfs device file support + -------------------------------------------------------------------------- */ +static ssize_t acpi_eject_store(struct acpi_device *device, + const char *buf, size_t count); + +#define ACPI_DEVICE_ATTR(_name,_mode,_show,_store) \ +static struct acpi_device_attribute acpi_device_attr_##_name = \ + __ATTR(_name, _mode, _show, _store) + +ACPI_DEVICE_ATTR(eject, 0200, NULL, acpi_eject_store); + +/** + * setup_sys_fs_device_files - sets up the device files under device namespace + * @@dev: acpi_device object + * @@func: function pointer to create or destroy the device file + */ +static void +setup_sys_fs_device_files ( + struct acpi_device *dev, + acpi_device_sysfs_files *func) +{ + if (dev->flags.ejectable == 1) + (*(func))(&dev->kobj,&acpi_device_attr_eject.attr); +} + +static int +acpi_eject_operation(acpi_handle handle, int lockable) +{ + struct acpi_object_list arg_list; + union acpi_object arg; + acpi_status status = AE_OK; + + /* + * TBD: evaluate _PS3? + */ + + if (lockable) { + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = 0; + acpi_evaluate_object(handle, "_LCK", &arg_list, NULL); + } + + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = 1; + + /* + * TBD: _EJD support. + */ + + status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); + if (ACPI_FAILURE(status)) { + return(-ENODEV); + } + + return(0); +} + + +static ssize_t +acpi_eject_store(struct acpi_device *device, const char *buf, size_t count) +{ + int result; + int ret = count; + int islockable; + acpi_status status; + acpi_handle handle; + acpi_object_type type = 0; + + if ((!count) || (buf[0] != '1')) { + return -EINVAL; + } + +#ifndef FORCE_EJECT + if (device->driver == NULL) { + ret = -ENODEV; + goto err; + } +#endif + status = acpi_get_type(device->handle, &type); + if (ACPI_FAILURE(status) || (!device->flags.ejectable) ) { + ret = -ENODEV; + goto err; + } + + islockable = device->flags.lockable; + handle = device->handle; + + if (type == ACPI_TYPE_PROCESSOR) + result = acpi_bus_trim(device, 0); + else + result = acpi_bus_trim(device, 1); + + if (!result) + result = acpi_eject_operation(handle, islockable); + + if (result) { + ret = -EBUSY; + } +err: + return ret; +} + + /* -------------------------------------------------------------------------- Performance Management -------------------------------------------------------------------------- */ @@ -314,6 +475,8 @@ acpi_bus_match ( struct acpi_device *device, struct acpi_driver *driver) { + if (driver && driver->ops.match) + return driver->ops.match(device, driver); return acpi_match_ids(device, driver->ids); } @@ -451,6 +614,7 @@ acpi_bus_register_driver ( return_VALUE(count); } +EXPORT_SYMBOL(acpi_bus_register_driver); /** @@ -479,6 +643,7 @@ acpi_bus_unregister_driver ( error = -EINVAL; return_VALUE(error); } +EXPORT_SYMBOL(acpi_bus_unregister_driver); /** * acpi_bus_find_driver @@ -495,9 +660,6 @@ acpi_bus_find_driver ( ACPI_FUNCTION_TRACE("acpi_bus_find_driver"); - if (!device->flags.hardware_id && !device->flags.compatible_ids) - goto Done; - spin_lock(&acpi_device_lock); list_for_each_safe(node,next,&acpi_bus_drivers) { struct acpi_driver * driver = container_of(node,struct acpi_driver,node); @@ -725,7 +887,7 @@ void acpi_device_get_debug_info(struct acpi_device * device, acpi_handle handle, #ifdef CONFIG_ACPI_DEBUG_OUTPUT char *type_string = NULL; char name[80] = {'?','\0'}; - acpi_buffer buffer = {sizeof(name), name}; + struct acpi_buffer buffer = {sizeof(name), name}; switch (type) { case ACPI_BUS_TYPE_DEVICE: @@ -762,7 +924,55 @@ void acpi_device_get_debug_info(struct acpi_device * device, acpi_handle handle, #endif /*CONFIG_ACPI_DEBUG_OUTPUT*/ } -static int + +int +acpi_bus_remove ( + struct acpi_device *dev, + int rmdevice) +{ + int result = 0; + struct acpi_driver *driver; + + ACPI_FUNCTION_TRACE("acpi_bus_remove"); + + if (!dev) + return_VALUE(-EINVAL); + + driver = dev->driver; + + if ((driver) && (driver->ops.remove)) { + + if (driver->ops.stop) { + result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT); + if (result) + return_VALUE(result); + } + + result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT); + if (result) { + return_VALUE(result); + } + + atomic_dec(&dev->driver->references); + dev->driver = NULL; + acpi_driver_data(dev) = NULL; + } + + if (!rmdevice) + return_VALUE(0); + + if (dev->flags.bus_address) { + if ((dev->parent) && (dev->parent->ops.unbind)) + dev->parent->ops.unbind(dev); + } + + acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT); + + return_VALUE(0); +} + + +int acpi_bus_add ( struct acpi_device **child, struct acpi_device *parent, @@ -906,10 +1116,10 @@ end: return_VALUE(result); } +EXPORT_SYMBOL(acpi_bus_add); - -static int acpi_bus_scan (struct acpi_device *start) +int acpi_bus_scan (struct acpi_device *start) { acpi_status status = AE_OK; struct acpi_device *parent = NULL; @@ -1010,7 +1220,64 @@ static int acpi_bus_scan (struct acpi_device *start) return_VALUE(0); } +EXPORT_SYMBOL(acpi_bus_scan); + +int +acpi_bus_trim(struct acpi_device *start, + int rmdevice) +{ + acpi_status status; + struct acpi_device *parent, *child; + acpi_handle phandle, chandle; + acpi_object_type type; + u32 level = 1; + int err = 0; + + parent = start; + phandle = start->handle; + child = chandle = NULL; + + while ((level > 0) && parent && (!err)) { + status = acpi_get_next_object(ACPI_TYPE_ANY, phandle, + chandle, &chandle); + + /* + * If this scope is exhausted then move our way back up. + */ + if (ACPI_FAILURE(status)) { + level--; + chandle = phandle; + acpi_get_parent(phandle, &phandle); + child = parent; + parent = parent->parent; + + if (level == 0) + err = acpi_bus_remove(child, rmdevice); + else + err = acpi_bus_remove(child, 1); + + continue; + } + + status = acpi_get_type(chandle, &type); + if (ACPI_FAILURE(status)) { + continue; + } + /* + * If there is a device corresponding to chandle then + * parse it (depth-first). + */ + if (acpi_bus_get_device(chandle, &child) == 0) { + level++; + phandle = chandle; + chandle = NULL; + parent = child; + } + continue; + } + return err; +} static int acpi_bus_scan_fixed ( diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile index bb52f85d0..d6c017709 100644 --- a/drivers/acpi/sleep/Makefile +++ b/drivers/acpi/sleep/Makefile @@ -1,5 +1,5 @@ -obj-y := poweroff.o -obj-$(CONFIG_ACPI_SLEEP) += main.o wakeup.o +obj-y := poweroff.o wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += main.o obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 847a90ed5..0a5d2a941 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -1,6 +1,7 @@ /* * sleep.c - ACPI sleep support. * + * Copyright (c) 2004 David Shaohua Li * Copyright (c) 2000-2003 Patrick Mochel * Copyright (c) 2003 Open Source Development Lab * @@ -13,6 +14,7 @@ #include #include #include +#include #include #include #include "sleep.h" @@ -42,7 +44,7 @@ static int init_8259A_after_S1; * wakeup code to the waking vector. */ -static int acpi_pm_prepare(u32 pm_state) +static int acpi_pm_prepare(suspend_state_t pm_state) { u32 acpi_state = acpi_suspend_states[pm_state]; @@ -56,7 +58,8 @@ static int acpi_pm_prepare(u32 pm_state) if (!acpi_wakeup_address) return -EFAULT; acpi_set_firmware_waking_vector( - (acpi_physical_address) acpi_wakeup_address); + (acpi_physical_address) virt_to_phys( + (void *)acpi_wakeup_address)); } ACPI_FLUSH_CPU_CACHE(); acpi_enable_wakeup_device_prep(acpi_state); @@ -74,7 +77,7 @@ static int acpi_pm_prepare(u32 pm_state) * It's unfortunate, but it works. Please fix if you're feeling frisky. */ -static int acpi_pm_enter(u32 pm_state) +static int acpi_pm_enter(suspend_state_t pm_state) { acpi_status status = AE_OK; unsigned long flags = 0; @@ -136,7 +139,7 @@ static int acpi_pm_enter(u32 pm_state) * failed). */ -static int acpi_pm_finish(u32 pm_state) +static int acpi_pm_finish(suspend_state_t pm_state) { u32 acpi_state = acpi_suspend_states[pm_state]; @@ -156,7 +159,7 @@ static int acpi_pm_finish(u32 pm_state) int acpi_suspend(u32 acpi_state) { - u32 states[] = { + suspend_state_t states[] = { [1] = PM_SUSPEND_STANDBY, [3] = PM_SUSPEND_MEM, [4] = PM_SUSPEND_DISK, diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c index 257e16f19..da237754d 100644 --- a/drivers/acpi/sleep/poweroff.c +++ b/drivers/acpi/sleep/poweroff.c @@ -9,6 +9,7 @@ #include #include #include +#include "sleep.h" static void acpi_power_off (void) @@ -16,6 +17,7 @@ acpi_power_off (void) printk("%s called\n",__FUNCTION__); /* Some SMP machines only can poweroff in boot CPU */ set_cpus_allowed(current, cpumask_of_cpu(0)); + acpi_wakeup_gpe_poweroff_prepare(); acpi_enter_sleep_state_prep(ACPI_STATE_S5); ACPI_DISABLE_IRQS(); acpi_enter_sleep_state(ACPI_STATE_S5); diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 666498e38..607cfddc7 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c @@ -70,7 +70,7 @@ acpi_system_write_sleep ( state = simple_strtoul(str, NULL, 0); #ifdef CONFIG_SOFTWARE_SUSPEND if (state == 4) { - software_suspend(); + error = software_suspend(); goto Done; } #endif @@ -83,6 +83,7 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) { u32 sec, min, hr; u32 day, mo, yr; + unsigned char rtc_control = 0; ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show"); @@ -91,10 +92,12 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) sec = CMOS_READ(RTC_SECONDS_ALARM); min = CMOS_READ(RTC_MINUTES_ALARM); hr = CMOS_READ(RTC_HOURS_ALARM); + rtc_control = CMOS_READ(RTC_CONTROL); -#if 0 /* If we ever get an FACP with proper values... */ + /* If we ever get an FACP with proper values... */ if (acpi_gbl_FADT->day_alrm) - day = CMOS_READ(acpi_gbl_FADT->day_alrm); + /* ACPI spec: only low 6 its should be cared */ + day = CMOS_READ(acpi_gbl_FADT->day_alrm) & 0x3F; else day = CMOS_READ(RTC_DAY_OF_MONTH); if (acpi_gbl_FADT->mon_alrm) @@ -105,24 +108,20 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); else yr = CMOS_READ(RTC_YEAR); -#else - day = CMOS_READ(RTC_DAY_OF_MONTH); - mo = CMOS_READ(RTC_MONTH); - yr = CMOS_READ(RTC_YEAR); -#endif spin_unlock(&rtc_lock); - BCD_TO_BIN(sec); - BCD_TO_BIN(min); - BCD_TO_BIN(hr); - BCD_TO_BIN(day); - BCD_TO_BIN(mo); - BCD_TO_BIN(yr); + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BCD_TO_BIN(sec); + BCD_TO_BIN(min); + BCD_TO_BIN(hr); + BCD_TO_BIN(day); + BCD_TO_BIN(mo); + BCD_TO_BIN(yr); + } -#if 0 /* we're trusting the FADT (see above)*/ -#else + if (!acpi_gbl_FADT->century) /* If we're not trusting the FADT, we should at least make it * right for _this_ century... ehm, what is _this_ century? * @@ -141,8 +140,7 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) * s/2000/2100 * */ - yr += 2000; -#endif + yr += 2000; seq_printf(seq,"%4.4u-", yr); (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo); @@ -316,6 +314,13 @@ acpi_system_write_alarm ( } spin_lock_irq(&rtc_lock); + /* + * Disable alarm interrupt before setting alarm timer or else + * when ACPI_EVENT_RTC is enabled, a spurious ACPI interrupt occurs + */ + rtc_control &= ~RTC_AIE; + CMOS_WRITE(rtc_control, RTC_CONTROL); + CMOS_READ(RTC_INTR_FLAGS); /* write the fields the rtc knows about */ CMOS_WRITE(hr, RTC_HOURS_ALARM); @@ -327,24 +332,21 @@ acpi_system_write_alarm ( * offsets into the CMOS RAM here -- which for some reason are pointing * to the RTC area of memory. */ -#if 0 if (acpi_gbl_FADT->day_alrm) CMOS_WRITE(day, acpi_gbl_FADT->day_alrm); if (acpi_gbl_FADT->mon_alrm) CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm); if (acpi_gbl_FADT->century) CMOS_WRITE(yr/100, acpi_gbl_FADT->century); -#endif /* enable the rtc alarm interrupt */ - if (!(rtc_control & RTC_AIE)) { - rtc_control |= RTC_AIE; - CMOS_WRITE(rtc_control,RTC_CONTROL); - CMOS_READ(RTC_INTR_FLAGS); - } + rtc_control |= RTC_AIE; + CMOS_WRITE(rtc_control, RTC_CONTROL); + CMOS_READ(RTC_INTR_FLAGS); spin_unlock_irq(&rtc_lock); - acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK); + acpi_clear_event(ACPI_EVENT_RTC); + acpi_enable_event(ACPI_EVENT_RTC, 0); *ppos += count; @@ -395,6 +397,7 @@ acpi_system_write_wakeup_device ( char strbuf[5]; char str[5] = ""; int len = count; + struct acpi_device *found_dev = NULL; if (len > 4) len = 4; @@ -411,9 +414,25 @@ acpi_system_write_wakeup_device ( if (!strncmp(dev->pnp.bus_id, str, 4)) { dev->wakeup.state.enabled = dev->wakeup.state.enabled ? 0:1; + found_dev = dev; break; } } + if (found_dev) { + list_for_each_safe(node, next, &acpi_wakeup_device_list) { + struct acpi_device * dev = container_of(node, + struct acpi_device, wakeup_list); + + if ((dev != found_dev) && + (dev->wakeup.gpe_number == found_dev->wakeup.gpe_number) && + (dev->wakeup.gpe_device == found_dev->wakeup.gpe_device)) { + printk(KERN_WARNING "ACPI: '%s' and '%s' have the same GPE, " + "can't disable/enable one seperately\n", + dev->pnp.bus_id, found_dev->pnp.bus_id); + dev->wakeup.state.enabled = found_dev->wakeup.state.enabled; + } + } + } spin_unlock(&acpi_device_lock); return count; } @@ -449,6 +468,14 @@ static struct file_operations acpi_system_alarm_fops = { }; +static u32 rtc_handler(void * context) +{ + acpi_clear_event(ACPI_EVENT_RTC); + acpi_disable_event(ACPI_EVENT_RTC, 0); + + return ACPI_INTERRUPT_HANDLED; +} + static int acpi_sleep_proc_init(void) { struct proc_dir_entry *entry = NULL; @@ -474,6 +501,7 @@ static int acpi_sleep_proc_init(void) if (entry) entry->proc_fops = &acpi_system_wakeup_device_fops; + acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); return 0; } diff --git a/drivers/acpi/sleep/sleep.h b/drivers/acpi/sleep/sleep.h index cfaf8f5b0..efd0001c6 100644 --- a/drivers/acpi/sleep/sleep.h +++ b/drivers/acpi/sleep/sleep.h @@ -5,3 +5,4 @@ extern int acpi_suspend (u32 state); extern void acpi_enable_wakeup_device_prep(u8 sleep_state); extern void acpi_enable_wakeup_device(u8 sleep_state); extern void acpi_disable_wakeup_device(u8 sleep_state); +extern void acpi_wakeup_gpe_poweroff_prepare(void); diff --git a/drivers/acpi/sleep/wakeup.c b/drivers/acpi/sleep/wakeup.c index 9c004b948..d9b199969 100644 --- a/drivers/acpi/sleep/wakeup.c +++ b/drivers/acpi/sleep/wakeup.c @@ -1,5 +1,6 @@ /* * wakeup.c - support wakeup devices + * Copyright (C) 2004 Li Shaohua */ #include @@ -13,14 +14,16 @@ #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME ("wakeup_devices") +extern struct list_head acpi_wakeup_device_list; +extern spinlock_t acpi_device_lock; + +#ifdef CONFIG_ACPI_SLEEP /** * acpi_enable_wakeup_device_prep - prepare wakeup devices * @sleep_state: ACPI state * Enable all wakup devices power if the devices' wakeup level * is higher than requested sleep level */ -extern struct list_head acpi_wakeup_device_list; -extern spinlock_t acpi_device_lock; void acpi_enable_wakeup_device_prep( @@ -179,3 +182,28 @@ static int __init acpi_wakeup_device_init(void) } late_initcall(acpi_wakeup_device_init); +#endif + +/* + * Disable all wakeup GPEs before power off. + * + * Since acpi_enter_sleep_state() will disable all + * RUNTIME GPEs, we simply mark all GPES that + * are not enabled for wakeup from S5 as RUNTIME. + */ +void acpi_wakeup_gpe_poweroff_prepare(void) +{ + struct list_head * node, * next; + + list_for_each_safe(node, next, &acpi_wakeup_device_list) { + struct acpi_device * dev = container_of(node, + struct acpi_device, wakeup_list); + + /* The GPE can wakeup system from S5, don't touch it */ + if ((u32)dev->wakeup.sleep_state == ACPI_STATE_S5) + continue; + /* acpi_set_gpe_type will automatically disable GPE */ + acpi_set_gpe_type(dev->wakeup.gpe_device, + dev->wakeup.gpe_number, ACPI_GPE_TYPE_RUNTIME); + } +} diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 9919e76d7..8925a6ca5 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c @@ -24,6 +24,7 @@ */ #include +#include #include #include @@ -48,35 +49,26 @@ extern FADT_DESCRIPTOR acpi_fadt; -------------------------------------------------------------------------- */ static int -acpi_system_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) +acpi_system_read_info (struct seq_file *seq, void *offset) { - char *p = page; - int size = 0; - ACPI_FUNCTION_TRACE("acpi_system_read_info"); - if (off != 0) - goto end; - - p += sprintf(p, "version: %x\n", ACPI_CA_VERSION); - -end: - size = (p - page); - if (size <= off+count) *eof = 1; - *start = page + off; - size -= off; - if (size>count) size = count; - if (size<0) size = 0; + seq_printf(seq, "version: %x\n", ACPI_CA_VERSION); + return_VALUE(0); +} - return_VALUE(size); +static int acpi_system_info_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_system_read_info, PDE(inode)->data); } +static struct file_operations acpi_system_info_ops = { + .open = acpi_system_info_open_fs, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static ssize_t acpi_system_read_dsdt (struct file*, char __user *, size_t, loff_t*); static struct file_operations acpi_system_dsdt_ops = { @@ -152,10 +144,13 @@ static int __init acpi_system_init (void) /* 'info' [R] */ name = ACPI_SYSTEM_FILE_INFO; - entry = create_proc_read_entry(name, - S_IRUGO, acpi_root_dir, acpi_system_read_info,NULL); + entry = create_proc_entry(name, + S_IRUGO, acpi_root_dir); if (!entry) goto Error; + else { + entry->proc_fops = &acpi_system_info_ops; + } /* 'dsdt' [R] */ name = ACPI_SYSTEM_FILE_DSDT; diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c index ee6818832..334327c1f 100644 --- a/drivers/acpi/tables/tbconvrt.c +++ b/drivers/acpi/tables/tbconvrt.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -50,6 +51,9 @@ ACPI_MODULE_NAME ("tbconvrt") +u8 acpi_fadt_is_v1; +EXPORT_SYMBOL(acpi_fadt_is_v1); + /******************************************************************************* * * FUNCTION: acpi_tb_get_table_count @@ -186,7 +190,7 @@ acpi_tb_init_generic_address ( new_gas_struct->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO; new_gas_struct->register_bit_width = register_bit_width; new_gas_struct->register_bit_offset = 0; - new_gas_struct->reserved = 0; + new_gas_struct->access_width = 0; } @@ -212,6 +216,7 @@ acpi_tb_convert_fadt1 ( /* ACPI 1.0 FACS */ /* The BIOS stored FADT should agree with Revision 1.0 */ + acpi_fadt_is_v1 = 1; /* * Copy the table header and the common part of the tables. @@ -240,9 +245,12 @@ acpi_tb_convert_fadt1 ( /* * Processor Performance State Control. This is the value OSPM writes to * the SMI_CMD register to assume processor performance state control - * responsibility. There isn't any equivalence in 1.0, leave it zeroed. + * responsibility. There isn't any equivalence in 1.0, but as many 1.x + * ACPI tables contain _PCT and _PSS we also keep this value, unless + * acpi_strict is set. */ - local_fadt->pstate_cnt = 0; + if (acpi_strict) + local_fadt->pstate_cnt = 0; /* * Support for the _CST object and C States change notification. @@ -251,10 +259,26 @@ acpi_tb_convert_fadt1 ( local_fadt->cst_cnt = 0; /* - * Since there isn't any equivalence in 1.0 and since it highly likely - * that a 1.0 system has legacy support. + * FADT Rev 2 was an interim FADT released between ACPI 1.0 and ACPI 2.0. + * It primarily adds the FADT reset mechanism. */ - local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES; + if ((original_fadt->revision == 2) && + (original_fadt->length == sizeof (struct fadt_descriptor_rev2_minus))) { + /* + * Grab the entire generic address struct, plus the 1-byte reset value + * that immediately follows. + */ + ACPI_MEMCPY (&local_fadt->reset_register, + &(ACPI_CAST_PTR (struct fadt_descriptor_rev2_minus, original_fadt))->reset_register, + sizeof (struct acpi_generic_address) + 1); + } + else { + /* + * Since there isn't any equivalence in 1.0 and since it is highly + * likely that a 1.0 system has legacy support. + */ + local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES; + } /* * Convert the V1.0 block addresses to V2.0 GAS structures @@ -418,23 +442,21 @@ acpi_tb_convert_table_fadt (void) /* - * acpi_gbl_FADT is valid - * Allocate and zero the 2.0 FADT buffer - */ - local_fadt = ACPI_MEM_CALLOCATE (sizeof (struct fadt_descriptor_rev2)); - if (local_fadt == NULL) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* - * FADT length and version validation. The table must be at least as - * long as the version 1.0 FADT + * acpi_gbl_FADT is valid. Validate the FADT length. The table must be + * at least as long as the version 1.0 FADT */ if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev1)) { - ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", acpi_gbl_FADT->length)); + ACPI_REPORT_ERROR (("FADT is invalid, too short: 0x%X\n", acpi_gbl_FADT->length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } + /* Allocate buffer for the ACPI 2.0(+) FADT */ + + local_fadt = ACPI_MEM_CALLOCATE (sizeof (struct fadt_descriptor_rev2)); + if (!local_fadt) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) { if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev2)) { /* Length is too short to be a V2.0 table */ @@ -488,7 +510,7 @@ acpi_tb_convert_table_fadt (void) * * FUNCTION: acpi_tb_convert_table_facs * - * PARAMETERS: table_info - Info for currently installad FACS + * PARAMETERS: table_info - Info for currently installed FACS * * RETURN: Status * diff --git a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c index 1456c7b32..896f3ddda 100644 --- a/drivers/acpi/tables/tbget.c +++ b/drivers/acpi/tables/tbget.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -167,6 +167,9 @@ acpi_tb_get_table_header ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Table Signature: [%4.4s]\n", + return_header->signature)); + return_ACPI_STATUS (AE_OK); } diff --git a/drivers/acpi/tables/tbgetall.c b/drivers/acpi/tables/tbgetall.c index e2422b143..adc427098 100644 --- a/drivers/acpi/tables/tbgetall.c +++ b/drivers/acpi/tables/tbgetall.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index 79efa36b7..85d5bb010 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -266,9 +266,10 @@ acpi_tb_init_table_descriptor ( if (ACPI_IS_SINGLE_TABLE (acpi_gbl_table_data[table_type].flags)) { /* * Only one table allowed, and a table has alread been installed - * at this location, so return an error. + * at this location, so return an error. */ if (list_head->next) { + ACPI_MEM_FREE (table_desc); return_ACPI_STATUS (AE_ALREADY_EXISTS); } diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c index b15669b16..9c6913238 100644 --- a/drivers/acpi/tables/tbrsdt.c +++ b/drivers/acpi/tables/tbrsdt.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -277,6 +277,7 @@ acpi_tb_get_table_rsdt ( acpi_tb_get_rsdt_address (&address); + table_info.type = ACPI_TABLE_XSDT; status = acpi_tb_get_table (&address, &table_info); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not get the RSDT/XSDT, %s\n", diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index fef603f40..fede5804c 100644 --- a/drivers/acpi/tables/tbutils.c +++ b/drivers/acpi/tables/tbutils.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ * return a pointer to that table descriptor. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_tb_handle_to_object ( u16 table_id, @@ -90,6 +90,7 @@ acpi_tb_handle_to_object ( ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id)); return (AE_BAD_PARAMETER); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index c92e71508..771504346 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -137,6 +138,8 @@ error_exit: } +#ifdef ACPI_FUTURE_USAGE + /******************************************************************************* * * FUNCTION: acpi_load_table @@ -343,6 +346,8 @@ acpi_get_table_header ( } +#endif /* ACPI_FUTURE_USAGE */ + /******************************************************************************* * * FUNCTION: acpi_get_table @@ -439,5 +444,5 @@ acpi_get_table ( ACPI_MEMCPY ((void *) ret_buffer->pointer, (void *) tbl_ptr, table_length); return_ACPI_STATUS (AE_OK); } - +EXPORT_SYMBOL(acpi_get_table); diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c index 4a9669590..6e8072ebb 100644 --- a/drivers/acpi/tables/tbxfroot.c +++ b/drivers/acpi/tables/tbxfroot.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -87,21 +88,40 @@ acpi_tb_find_table ( return_ACPI_STATUS (AE_AML_STRING_LIMIT); } - /* Find the table */ + if (!ACPI_STRNCMP (signature, DSDT_SIG, ACPI_NAME_SIZE)) { + /* + * The DSDT pointer is contained in the FADT, not the RSDT. + * This code should suffice, because the only code that would perform + * a "find" on the DSDT is the data_table_region() AML opcode -- in + * which case, the DSDT is guaranteed to be already loaded. + * If this becomes insufficient, the FADT will have to be found first. + */ + if (!acpi_gbl_DSDT) { + return_ACPI_STATUS (AE_NO_ACPI_TABLES); + } - status = acpi_get_firmware_table (signature, 1, - ACPI_LOGICAL_ADDRESSING, &table); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + table = acpi_gbl_DSDT; + } + else { + /* Find the table */ + + status = acpi_get_firmware_table (signature, 1, + ACPI_LOGICAL_ADDRESSING, &table); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } /* Check oem_id and oem_table_id */ - if ((oem_id[0] && ACPI_STRCMP (oem_id, table->oem_id)) || - (oem_table_id[0] && ACPI_STRCMP (oem_table_id, table->oem_table_id))) { + if ((oem_id[0] && ACPI_STRNCMP ( + oem_id, table->oem_id, sizeof (table->oem_id))) || + (oem_table_id[0] && ACPI_STRNCMP ( + oem_table_id, table->oem_table_id, sizeof (table->oem_table_id)))) { return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND); } + ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Found table [%4.4s]\n", table->signature)); *table_ptr = table; return_ACPI_STATUS (AE_OK); } @@ -304,6 +324,7 @@ cleanup: } return_ACPI_STATUS (status); } +EXPORT_SYMBOL(acpi_get_firmware_table); /* TBD: Move to a new file */ @@ -339,7 +360,8 @@ acpi_find_root_pointer ( status = acpi_tb_find_rsdp (&table_info, flags); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "RSDP structure not found, %s Flags=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "RSDP structure not found, %s Flags=%X\n", acpi_format_exception (status), flags)); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } @@ -368,35 +390,58 @@ acpi_tb_scan_memory_for_rsdp ( u8 *start_address, u32 length) { - u32 offset; u8 *mem_rover; + u8 *end_address; + u8 checksum; ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp"); - /* Search from given start addr for the requested length */ + end_address = start_address + length; - for (offset = 0, mem_rover = start_address; - offset < length; - offset += ACPI_RSDP_SCAN_STEP, mem_rover += ACPI_RSDP_SCAN_STEP) { + /* Search from given start address for the requested length */ + for (mem_rover = start_address; mem_rover < end_address; + mem_rover += ACPI_RSDP_SCAN_STEP) { /* The signature and checksum must both be correct */ - if (ACPI_STRNCMP ((char *) mem_rover, - RSDP_SIG, sizeof (RSDP_SIG)-1) == 0 && - acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH) == 0) { - /* If so, we have found the RSDP */ + if (ACPI_STRNCMP ((char *) mem_rover, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { + /* No signature match, keep looking */ + + continue; + } + + /* Signature matches, check the appropriate checksum */ + + if ((ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover))->revision < 2) { + /* ACPI version 1.0 */ + + checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH); + } + else { + /* Post ACPI 1.0, use extended_checksum */ + + checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_XCHECKSUM_LENGTH); + } + + if (checksum == 0) { + /* Checksum valid, we have found a valid RSDP */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "RSDP located at physical address %p\n",mem_rover)); + "RSDP located at physical address %p\n", mem_rover)); return_PTR (mem_rover); } + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Found an RSDP at physical address %p, but it has a bad checksum\n", + mem_rover)); } /* Searched entire block, no RSDP was found */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO,"Searched entire block, no RSDP was found.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Searched entire block, no valid RSDP was found.\n")); return_PTR (NULL); } @@ -448,7 +493,8 @@ acpi_tb_find_rsdp ( ACPI_EBDA_PTR_LENGTH, (void *) &table_ptr); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X for length %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not map memory at %8.8X for length %X\n", ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH)); return_ACPI_STATUS (status); } @@ -467,7 +513,8 @@ acpi_tb_find_rsdp ( ACPI_EBDA_WINDOW_SIZE, (void *) &table_ptr); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X for length %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not map memory at %8.8X for length %X\n", physical_address, ACPI_EBDA_WINDOW_SIZE)); return_ACPI_STATUS (status); } @@ -492,7 +539,8 @@ acpi_tb_find_rsdp ( ACPI_HI_RSDP_WINDOW_SIZE, (void *) &table_ptr); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X for length %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not map memory at %8.8X for length %X\n", ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE)); return_ACPI_STATUS (status); } diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 05388672d..be97f2869 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -60,10 +60,11 @@ #define ACPI_THERMAL_NOTIFY_HOT 0xF1 #define ACPI_THERMAL_MODE_ACTIVE 0x00 #define ACPI_THERMAL_MODE_PASSIVE 0x01 -#define ACPI_THERMAL_MODE_CRT 0xff +#define ACPI_THERMAL_MODE_CRITICAL 0xff #define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" #define ACPI_THERMAL_MAX_ACTIVE 10 +#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 #define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732>=0) ? ((long)t-2732+5)/10 : ((long)t-2732-5)/10) #define CELSIUS_TO_KELVIN(t) ((t+273)*10) @@ -76,7 +77,7 @@ MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME); MODULE_LICENSE("GPL"); static int tzp; -MODULE_PARM(tzp, "i"); +module_param(tzp, int, 0); MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); @@ -226,7 +227,7 @@ acpi_thermal_get_temperature ( status = acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature); if (ACPI_FAILURE(status)) - return -ENODEV; + return_VALUE(-ENODEV); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", tz->temperature)); @@ -328,7 +329,7 @@ acpi_thermal_get_trip_points ( if (ACPI_FAILURE(status)) { tz->trips.critical.flags.valid = 0; ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n")); - return -ENODEV; + return_VALUE(-ENODEV); } else { tz->trips.critical.flags.valid = 1; @@ -801,7 +802,7 @@ static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset) } end: - return 0; + return_VALUE(0); } static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file) @@ -828,7 +829,7 @@ static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset) KELVIN_TO_CELSIUS(tz->temperature)); end: - return 0; + return_VALUE(0); } static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file) @@ -881,7 +882,7 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) } end: - return 0; + return_VALUE(0); } static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file) @@ -899,21 +900,33 @@ acpi_thermal_write_trip_points ( struct seq_file *m = (struct seq_file *)file->private_data; struct acpi_thermal *tz = (struct acpi_thermal *)m->private; - char limit_string[65] = {'\0'}; + char *limit_string; int num, critical, hot, passive; - int active[ACPI_THERMAL_MAX_ACTIVE]; + int *active; int i = 0; ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points"); - if (!tz || (count > sizeof(limit_string) - 1)) { + limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL); + if(!limit_string) + return_VALUE(-ENOMEM); + + memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); + + active = kmalloc(ACPI_THERMAL_MAX_ACTIVE *sizeof(int), GFP_KERNEL); + if(!active) + return_VALUE(-ENOMEM); + + if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); - return_VALUE(-EINVAL); + count = -EINVAL; + goto end; } if (copy_from_user(limit_string, buffer, count)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n")); - return_VALUE(-EFAULT); + count = -EFAULT; + goto end; } limit_string[count] = '\0'; @@ -924,7 +937,8 @@ acpi_thermal_write_trip_points ( &active[5], &active[6], &active[7], &active[8], &active[9]); if(!(num >=5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); - return_VALUE(-EINVAL); + count = -EINVAL; + goto end; } tz->trips.critical.temperature = CELSIUS_TO_KELVIN(critical); @@ -936,6 +950,9 @@ acpi_thermal_write_trip_points ( tz->trips.active[i].temperature = CELSIUS_TO_KELVIN(active[i]); } +end: + kfree(active); + kfree(limit_string); return_VALUE(count); } @@ -953,14 +970,14 @@ static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset) seq_puts(seq, "\n"); } - if ( tz->cooling_mode == ACPI_THERMAL_MODE_CRT ) + if ( tz->cooling_mode == ACPI_THERMAL_MODE_CRITICAL ) seq_printf(seq, "cooling mode: critical\n"); else seq_printf(seq, "cooling mode: %s\n", tz->cooling_mode?"passive":"active"); end: - return 0; + return_VALUE(0); } static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file) @@ -1023,7 +1040,7 @@ static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset) (tz->polling_frequency / 10)); end: - return 0; + return_VALUE(0); } static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file) @@ -1262,7 +1279,7 @@ acpi_thermal_get_info ( tz->cooling_mode = ACPI_THERMAL_MODE_ACTIVE; } else { /* _ACx and _PSV are optional, but _CRT is required */ - tz->cooling_mode = ACPI_THERMAL_MODE_CRT; + tz->cooling_mode = ACPI_THERMAL_MODE_CRITICAL; } } diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index a07325638..c0c9ea108 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -508,7 +508,7 @@ add_device(void) proc->write_proc = (write_proc_t*)dispatch_write; } - return(AE_OK); + return AE_OK; } static acpi_status __exit @@ -518,7 +518,7 @@ remove_device(void) for (item = proc_items; item->name; ++item) remove_proc_entry(item->name, toshiba_proc_dir); - return(AE_OK); + return AE_OK; } static int __init diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index 58ec6733e..3313439c4 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,9 +73,12 @@ acpi_ut_release_to_cache ( ACPI_FUNCTION_ENTRY (); + cache_info = &acpi_gbl_memory_lists[list_id]; + +#ifdef ACPI_ENABLE_OBJECT_CACHE + /* If walk cache is full, just free this wallkstate object */ - cache_info = &acpi_gbl_memory_lists[list_id]; if (cache_info->cache_depth >= cache_info->max_cache_depth) { ACPI_MEM_FREE (object); ACPI_MEM_TRACKING (cache_info->total_freed++); @@ -101,6 +104,14 @@ acpi_ut_release_to_cache ( (void) acpi_ut_release_mutex (ACPI_MTX_CACHES); } + +#else + + /* Object cache is disabled; just free the object */ + + ACPI_MEM_FREE (object); + ACPI_MEM_TRACKING (cache_info->total_freed++); +#endif } @@ -130,6 +141,9 @@ acpi_ut_acquire_from_cache ( cache_info = &acpi_gbl_memory_lists[list_id]; + +#ifdef ACPI_ENABLE_OBJECT_CACHE + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) { return (NULL); } @@ -174,10 +188,19 @@ acpi_ut_acquire_from_cache ( ACPI_MEM_TRACKING (cache_info->total_allocated++); } +#else + + /* Object cache is disabled; just allocate the object */ + + object = ACPI_MEM_CALLOCATE (cache_info->object_size); + ACPI_MEM_TRACKING (cache_info->total_allocated++); +#endif + return (object); } +#ifdef ACPI_ENABLE_OBJECT_CACHE /****************************************************************************** * * FUNCTION: acpi_ut_delete_generic_cache @@ -212,6 +235,7 @@ acpi_ut_delete_generic_cache ( cache_info->cache_depth--; } } +#endif /******************************************************************************* @@ -265,7 +289,7 @@ acpi_ut_validate_buffer ( * RETURN: Status * * DESCRIPTION: Validate that the buffer is of the required length or - * allocate a new buffer. + * allocate a new buffer. Returned buffer is always zeroed. * ******************************************************************************/ @@ -305,24 +329,25 @@ acpi_ut_initialize_buffer ( /* Allocate a new buffer with local interface to allow tracking */ - buffer->pointer = ACPI_MEM_ALLOCATE (required_length); + buffer->pointer = ACPI_MEM_CALLOCATE (required_length); if (!buffer->pointer) { return (AE_NO_MEMORY); } - - /* Clear the buffer */ - - ACPI_MEMSET (buffer->pointer, 0, required_length); break; default: - /* Validate the size of the buffer */ + /* Existing buffer: Validate the size of the buffer */ if (buffer->length < required_length) { status = AE_BUFFER_OVERFLOW; + break; } + + /* Clear the buffer */ + + ACPI_MEMSET (buffer->pointer, 0, required_length); break; } @@ -472,7 +497,7 @@ acpi_ut_allocate_and_track ( acpi_status status; - allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_block), component, + allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header), component, module, line); if (!allocation) { return (NULL); @@ -518,7 +543,7 @@ acpi_ut_callocate_and_track ( acpi_status status; - allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_block), component, + allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header), component, module, line); if (!allocation) { /* Report allocation error */ @@ -712,6 +737,7 @@ acpi_ut_track_allocation ( allocation->line = line; ACPI_STRNCPY (allocation->module, module, ACPI_MAX_MODULE_NAME); + allocation->module[ACPI_MAX_MODULE_NAME-1] = 0; /* Insert at list head */ @@ -816,7 +842,7 @@ acpi_ut_remove_allocation ( * DESCRIPTION: Print some info about the outstanding allocations. * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE void acpi_ut_dump_allocation_info ( void) @@ -862,6 +888,7 @@ acpi_ut_dump_allocation_info ( */ return_VOID; } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c index f04e81aac..0b366d3b4 100644 --- a/drivers/acpi/utilities/utcopy.c +++ b/drivers/acpi/utilities/utcopy.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -424,23 +424,21 @@ acpi_ut_copy_esimple_to_isimple ( break; default: - /* - * Whatever other type -- it is not supported - */ + /* All other types are not supported */ + return_ACPI_STATUS (AE_SUPPORT); } - switch (external_object->type) { - /* Must COPY string and buffer contents */ + switch (external_object->type) { case ACPI_TYPE_STRING: internal_object->string.pointer = ACPI_MEM_CALLOCATE ((acpi_size) external_object->string.length + 1); if (!internal_object->string.pointer) { - return_ACPI_STATUS (AE_NO_MEMORY); + goto error_exit; } ACPI_MEMCPY (internal_object->string.pointer, @@ -456,7 +454,7 @@ acpi_ut_copy_esimple_to_isimple ( internal_object->buffer.pointer = ACPI_MEM_CALLOCATE (external_object->buffer.length); if (!internal_object->buffer.pointer) { - return_ACPI_STATUS (AE_NO_MEMORY); + goto error_exit; } ACPI_MEMCPY (internal_object->buffer.pointer, @@ -479,6 +477,11 @@ acpi_ut_copy_esimple_to_isimple ( *ret_internal_object = internal_object; return_ACPI_STATUS (AE_OK); + + +error_exit: + acpi_ut_remove_reference (internal_object); + return_ACPI_STATUS (AE_NO_MEMORY); } @@ -747,7 +750,7 @@ acpi_ut_copy_ielement_to_ielement ( status = acpi_ut_copy_simple_object (source_object, target_object); if (ACPI_FAILURE (status)) { - return (status); + goto error_exit; } *this_target_ptr = target_object; @@ -781,8 +784,8 @@ acpi_ut_copy_ielement_to_ielement ( ACPI_MEM_CALLOCATE (((acpi_size) source_object->package.count + 1) * sizeof (void *)); if (!target_object->package.elements) { - ACPI_MEM_FREE (target_object); - return (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto error_exit; } /* @@ -802,6 +805,10 @@ acpi_ut_copy_ielement_to_ielement ( } return (status); + +error_exit: + acpi_ut_remove_reference (target_object); + return (status); } diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index 4fc32d596..985c5d045 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include @@ -178,6 +179,7 @@ acpi_ut_debug_print ( va_start (args, format); acpi_os_vprintf (format, args); } +EXPORT_SYMBOL(acpi_ut_debug_print); /***************************************************************************** @@ -219,6 +221,7 @@ acpi_ut_debug_print_raw ( va_start (args, format); acpi_os_vprintf (format, args); } +EXPORT_SYMBOL(acpi_ut_debug_print_raw); /***************************************************************************** @@ -250,6 +253,7 @@ acpi_ut_trace ( acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, "%s\n", acpi_gbl_fn_entry_str); } +EXPORT_SYMBOL(acpi_ut_trace); /***************************************************************************** @@ -378,6 +382,7 @@ acpi_ut_exit ( acpi_gbl_nesting_level--; } +EXPORT_SYMBOL(acpi_ut_exit); /***************************************************************************** @@ -418,6 +423,7 @@ acpi_ut_status_exit ( acpi_gbl_nesting_level--; } +EXPORT_SYMBOL(acpi_ut_status_exit); /***************************************************************************** @@ -451,6 +457,7 @@ acpi_ut_value_exit ( acpi_gbl_nesting_level--; } +EXPORT_SYMBOL(acpi_ut_value_exit); /***************************************************************************** diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c index dd57a1674..e8ee13280 100644 --- a/drivers/acpi/utilities/utdelete.c +++ b/drivers/acpi/utilities/utdelete.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -621,6 +621,10 @@ acpi_ut_add_reference ( return_VOID; } + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, + "Obj %p Current Refs=%X [To Be Incremented]\n", + object, object->common.reference_count)); + /* Increment the reference count */ (void) acpi_ut_update_object_reference (object, REF_INCREMENT); @@ -664,8 +668,9 @@ acpi_ut_remove_reference ( return_VOID; } - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X\n", - object, object->common.reference_count)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, + "Obj %p Current Refs=%X [To Be Decremented]\n", + object, object->common.reference_count)); /* * Decrement the reference count, and only actually delete the object diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c index 0aa1fde7e..ead27d2c4 100644 --- a/drivers/acpi/utilities/uteval.c +++ b/drivers/acpi/utilities/uteval.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -198,6 +198,17 @@ acpi_ut_evaluate_object ( break; } + if ((acpi_gbl_enable_interpreter_slack) && + (!expected_return_btypes)) { + /* + * We received a return object, but one was not expected. This can + * happen frequently if the "implicit return" feature is enabled. + * Just delete the return object and return AE_OK. + */ + acpi_ut_remove_reference (info.return_object); + return_ACPI_STATUS (AE_OK); + } + /* Is the return object one of the expected types? */ if (!(expected_return_btypes & return_btype)) { @@ -205,8 +216,9 @@ acpi_ut_evaluate_object ( prefix_node, path, AE_TYPE); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Type returned from %s was incorrect: %X\n", - path, ACPI_GET_OBJECT_TYPE (info.return_object))); + "Type returned from %s was incorrect: %s, expected Btypes: %X\n", + path, acpi_ut_get_object_type_name (info.return_object), + expected_return_btypes)); /* On error exit, we must delete the return object */ diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index f42848ab7..d3eb4db38 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,8 @@ #define DEFINE_ACPI_GLOBALS +#include + #include #include @@ -142,11 +144,13 @@ unknown: */ /* Debug switch - level and trace mask */ -u32 acpi_dbg_level = 0; +u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; +EXPORT_SYMBOL(acpi_dbg_level); /* Debug switch - layer (component) mask */ -u32 acpi_dbg_layer = 0; +u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; +EXPORT_SYMBOL(acpi_dbg_layer); u32 acpi_gbl_nesting_level = 0; @@ -215,6 +219,8 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR * NOTES: * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run * during the initialization sequence. + * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to + * perform a Notify() operation on it. */ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, @@ -222,12 +228,12 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_TZ_", ACPI_TYPE_THERMAL, NULL}, - {"_REV", ACPI_TYPE_INTEGER, "2"}, + {"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, - {"_GL_", ACPI_TYPE_MUTEX, "0"}, + {"_GL_", ACPI_TYPE_MUTEX, (char *) 1}, #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) - {"_OSI", ACPI_TYPE_METHOD, "1"}, + {"_OSI", ACPI_TYPE_METHOD, (char *) 1}, #endif {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ }; @@ -861,6 +867,7 @@ acpi_ut_init_globals ( acpi_gbl_system_notify.handler = NULL; acpi_gbl_device_notify.handler = NULL; + acpi_gbl_exception_handler = NULL; acpi_gbl_init_handler = NULL; /* Global "typed" ACPI table pointers */ diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c index b7c6339e3..bdbadaf48 100644 --- a/drivers/acpi/utilities/utinit.c +++ b/drivers/acpi/utilities/utinit.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c index 573176cac..2525c1a93 100644 --- a/drivers/acpi/utilities/utmath.c +++ b/drivers/acpi/utilities/utmath.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,7 +59,7 @@ * * FUNCTION: acpi_ut_short_divide * - * PARAMETERS: in_dividend - Pointer to the dividend + * PARAMETERS: Dividend - 64-bit dividend * Divisor - 32-bit divisor * out_quotient - Pointer to where the quotient is returned * out_remainder - Pointer to where the remainder is returned @@ -74,19 +74,18 @@ acpi_status acpi_ut_short_divide ( - acpi_integer *in_dividend, + acpi_integer dividend, u32 divisor, acpi_integer *out_quotient, u32 *out_remainder) { - union uint64_overlay dividend; + union uint64_overlay dividend_ovl; union uint64_overlay quotient; u32 remainder32; ACPI_FUNCTION_TRACE ("ut_short_divide"); - dividend.full = *in_dividend; /* Always check for a zero divisor */ @@ -95,13 +94,15 @@ acpi_ut_short_divide ( return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } + dividend_ovl.full = dividend; + /* * The quotient is 64 bits, the remainder is always 32 bits, * and is generated by the second divide. */ - ACPI_DIV_64_BY_32 (0, dividend.part.hi, divisor, + ACPI_DIV_64_BY_32 (0, dividend_ovl.part.hi, divisor, quotient.part.hi, remainder32); - ACPI_DIV_64_BY_32 (remainder32, dividend.part.lo, divisor, + ACPI_DIV_64_BY_32 (remainder32, dividend_ovl.part.lo, divisor, quotient.part.lo, remainder32); /* Return only what was requested */ @@ -121,8 +122,8 @@ acpi_ut_short_divide ( * * FUNCTION: acpi_ut_divide * - * PARAMETERS: in_dividend - Pointer to the dividend - * in_divisor - Pointer to the divisor + * PARAMETERS: in_dividend - Dividend + * in_divisor - Divisor * out_quotient - Pointer to where the quotient is returned * out_remainder - Pointer to where the remainder is returned * @@ -134,8 +135,8 @@ acpi_ut_short_divide ( acpi_status acpi_ut_divide ( - acpi_integer *in_dividend, - acpi_integer *in_divisor, + acpi_integer in_dividend, + acpi_integer in_divisor, acpi_integer *out_quotient, acpi_integer *out_remainder) { @@ -155,13 +156,13 @@ acpi_ut_divide ( /* Always check for a zero divisor */ - if (*in_divisor == 0) { + if (in_divisor == 0) { ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } - divisor.full = *in_divisor; - dividend.full = *in_dividend; + divisor.full = in_divisor; + dividend.full = in_dividend; if (divisor.part.hi == 0) { /* * 1) Simplest case is where the divisor is 32 bits, we can @@ -269,7 +270,7 @@ acpi_ut_divide ( acpi_status acpi_ut_short_divide ( - acpi_integer *in_dividend, + acpi_integer in_dividend, u32 divisor, acpi_integer *out_quotient, u32 *out_remainder) @@ -288,10 +289,10 @@ acpi_ut_short_divide ( /* Return only what was requested */ if (out_quotient) { - *out_quotient = *in_dividend / divisor; + *out_quotient = in_dividend / divisor; } if (out_remainder) { - *out_remainder = (u32) *in_dividend % divisor; + *out_remainder = (u32) in_dividend % divisor; } return_ACPI_STATUS (AE_OK); @@ -299,8 +300,8 @@ acpi_ut_short_divide ( acpi_status acpi_ut_divide ( - acpi_integer *in_dividend, - acpi_integer *in_divisor, + acpi_integer in_dividend, + acpi_integer in_divisor, acpi_integer *out_quotient, acpi_integer *out_remainder) { @@ -309,7 +310,7 @@ acpi_ut_divide ( /* Always check for a zero divisor */ - if (*in_divisor == 0) { + if (in_divisor == 0) { ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -318,10 +319,10 @@ acpi_ut_divide ( /* Return only what was requested */ if (out_quotient) { - *out_quotient = *in_dividend / *in_divisor; + *out_quotient = in_dividend / in_divisor; } if (out_remainder) { - *out_remainder = *in_dividend % *in_divisor; + *out_remainder = in_dividend % in_divisor; } return_ACPI_STATUS (AE_OK); diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 9efcb99a3..4d32f6d18 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -356,16 +356,15 @@ acpi_ut_valid_acpi_character ( * FUNCTION: acpi_ut_strtoul64 * * PARAMETERS: String - Null terminated string - * Terminater - Where a pointer to the terminating byte is returned - * Base - Radix of the string + * Base - Radix of the string: 10, 16, or ACPI_ANY_BASE + * ret_integer - Where the converted integer is returned * - * RETURN: Converted value + * RETURN: Status and Converted value * * DESCRIPTION: Convert a string into an unsigned value. + * NOTE: Does not support Octal strings, not needed. * ******************************************************************************/ -#define NEGATIVE 1 -#define POSITIVE 0 acpi_status acpi_ut_strtoul64 ( @@ -373,50 +372,40 @@ acpi_ut_strtoul64 ( u32 base, acpi_integer *ret_integer) { - u32 index; + u32 this_digit; acpi_integer return_value = 0; - acpi_status status = AE_OK; - acpi_integer dividend; acpi_integer quotient; - *ret_integer = 0; + ACPI_FUNCTION_TRACE ("ut_stroul64"); + switch (base) { - case 0: - case 8: + case ACPI_ANY_BASE: case 10: case 16: break; default: - /* - * The specified Base parameter is not in the domain of - * this function: - */ - return (AE_BAD_PARAMETER); + /* Invalid Base */ + return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* - * skip over any white space in the buffer: - */ + /* Skip over any white space in the buffer */ + while (ACPI_IS_SPACE (*string) || *string == '\t') { ++string; } /* * If the input parameter Base is zero, then we need to - * determine if it is octal, decimal, or hexadecimal: + * determine if it is decimal or hexadecimal: */ if (base == 0) { - if (*string == '0') { - if (ACPI_TOLOWER (*(++string)) == 'x') { - base = 16; - ++string; - } - else { - base = 8; - } + if ((*string == '0') && + (ACPI_TOLOWER (*(++string)) == 'x')) { + base = 16; + ++string; } else { base = 10; @@ -424,76 +413,73 @@ acpi_ut_strtoul64 ( } /* - * For octal and hexadecimal bases, skip over the leading + * For hexadecimal base, skip over the leading * 0 or 0x, if they are present. */ - if (base == 8 && *string == '0') { - string++; - } - if (base == 16 && *string == '0' && ACPI_TOLOWER (*(++string)) == 'x') { string++; } - /* Main loop: convert the string to an unsigned long */ + /* Any string left? */ + + if (!(*string)) { + goto error_exit; + } + + /* Main loop: convert the string to a 64-bit integer */ while (*string) { if (ACPI_IS_DIGIT (*string)) { - index = ((u8) *string) - '0'; + /* Convert ASCII 0-9 to Decimal value */ + + this_digit = ((u8) *string) - '0'; } else { - index = (u8) ACPI_TOUPPER (*string); - if (ACPI_IS_UPPER ((char) index)) { - index = index - 'A' + 10; + this_digit = (u8) ACPI_TOUPPER (*string); + if (ACPI_IS_UPPER ((char) this_digit)) { + /* Convert ASCII Hex char to value */ + + this_digit = this_digit - 'A' + 10; } else { goto error_exit; } } - if (index >= base) { + /* Check to see if digit is out of range */ + + if (this_digit >= base) { goto error_exit; } - /* Check to see if value is out of range: */ + /* Divide the digit into the correct position */ - dividend = ACPI_INTEGER_MAX - (acpi_integer) index; - (void) acpi_ut_short_divide (÷nd, base, "ient, NULL); + (void) acpi_ut_short_divide ((ACPI_INTEGER_MAX - (acpi_integer) this_digit), + base, "ient, NULL); if (return_value > quotient) { goto error_exit; } return_value *= base; - return_value += index; + return_value += this_digit; ++string; } *ret_integer = return_value; - return (status); + return_ACPI_STATUS (AE_OK); error_exit: - switch (base) { - case 8: - status = AE_BAD_OCTAL_CONSTANT; - break; - - case 10: - status = AE_BAD_DECIMAL_CONSTANT; - break; - - case 16: - status = AE_BAD_HEX_CONSTANT; - break; + /* Base was set/validated above */ - default: - /* Base validated above */ - break; + if (base == 10) { + return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT); + } + else { + return_ACPI_STATUS (AE_BAD_HEX_CONSTANT); } - - return (status); } @@ -508,7 +494,7 @@ error_exit: * DESCRIPTION: Convert string to uppercase * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE char * acpi_ut_strupr ( char *src_string) @@ -528,6 +514,7 @@ acpi_ut_strupr ( return (src_string); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* @@ -691,7 +678,6 @@ acpi_ut_acquire_mutex ( acpi_mutex_handle mutex_id) { acpi_status status; - u32 i; u32 this_thread_id; @@ -704,30 +690,37 @@ acpi_ut_acquire_mutex ( this_thread_id = acpi_os_get_thread_id (); - /* - * Deadlock prevention. Check if this thread owns any mutexes of value - * greater than or equal to this one. If so, the thread has violated - * the mutex ordering rule. This indicates a coding error somewhere in - * the ACPI subsystem code. - */ - for (i = mutex_id; i < MAX_MUTEX; i++) { - if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { - if (i == mutex_id) { +#ifdef ACPI_MUTEX_DEBUG + { + u32 i; + /* + * Mutex debug code, for internal debugging only. + * + * Deadlock prevention. Check if this thread owns any mutexes of value + * greater than or equal to this one. If so, the thread has violated + * the mutex ordering rule. This indicates a coding error somewhere in + * the ACPI subsystem code. + */ + for (i = mutex_id; i < MAX_MUTEX; i++) { + if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { + if (i == mutex_id) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Mutex [%s] already acquired by this thread [%X]\n", + acpi_ut_get_mutex_name (mutex_id), this_thread_id)); + + return (AE_ALREADY_ACQUIRED); + } + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Mutex [%s] already acquired by this thread [%X]\n", - acpi_ut_get_mutex_name (mutex_id), this_thread_id)); + "Invalid acquire order: Thread %X owns [%s], wants [%s]\n", + this_thread_id, acpi_ut_get_mutex_name (i), + acpi_ut_get_mutex_name (mutex_id))); - return (AE_ALREADY_ACQUIRED); + return (AE_ACQUIRE_DEADLOCK); } - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Invalid acquire order: Thread %X owns [%s], wants [%s]\n", - this_thread_id, acpi_ut_get_mutex_name (i), - acpi_ut_get_mutex_name (mutex_id))); - - return (AE_ACQUIRE_DEADLOCK); } } +#endif ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X attempting to acquire Mutex [%s]\n", @@ -891,7 +884,7 @@ acpi_ut_create_update_state_and_push ( * DESCRIPTION: Create a new state and push it * ******************************************************************************/ - +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_ut_create_pkg_state_and_push ( void *internal_object, @@ -913,7 +906,7 @@ acpi_ut_create_pkg_state_and_push ( acpi_ut_push_generic_state (state_list, state); return (AE_OK); } - +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* * @@ -1206,6 +1199,7 @@ acpi_ut_delete_generic_state ( } +#ifdef ACPI_ENABLE_OBJECT_CACHE /******************************************************************************* * * FUNCTION: acpi_ut_delete_generic_state_cache @@ -1229,6 +1223,7 @@ acpi_ut_delete_generic_state_cache ( acpi_ut_delete_generic_cache (ACPI_MEM_LIST_STATE); return_VOID; } +#endif /******************************************************************************* diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c index b3b8757c1..9ee40a484 100644 --- a/drivers/acpi/utilities/utobject.c +++ b/drivers/acpi/utilities/utobject.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -155,9 +155,8 @@ acpi_ut_create_buffer_object ( ACPI_FUNCTION_TRACE_U32 ("ut_create_buffer_object", buffer_size); - /* - * Create a new Buffer object - */ + /* Create a new Buffer object */ + buffer_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!buffer_desc) { return_PTR (NULL); @@ -189,6 +188,61 @@ acpi_ut_create_buffer_object ( } +/******************************************************************************* + * + * FUNCTION: acpi_ut_create_string_object + * + * PARAMETERS: string_size - Size of string to be created. Does not + * include NULL terminator, this is added + * automatically. + * + * RETURN: Pointer to a new String object + * + * DESCRIPTION: Create a fully initialized string object + * + ******************************************************************************/ + +union acpi_operand_object * +acpi_ut_create_string_object ( + acpi_size string_size) +{ + union acpi_operand_object *string_desc; + char *string; + + + ACPI_FUNCTION_TRACE_U32 ("ut_create_string_object", string_size); + + + /* Create a new String object */ + + string_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); + if (!string_desc) { + return_PTR (NULL); + } + + /* + * Allocate the actual string buffer -- (Size + 1) for NULL terminator. + * NOTE: Zero-length strings are NULL terminated + */ + string = ACPI_MEM_CALLOCATE (string_size + 1); + if (!string) { + ACPI_REPORT_ERROR (("create_string: could not allocate size %X\n", + (u32) string_size)); + acpi_ut_remove_reference (string_desc); + return_PTR (NULL); + } + + /* Complete string object initialization */ + + string_desc->string.pointer = string; + string_desc->string.length = (u32) string_size; + + /* Return the new string descriptor */ + + return_PTR (string_desc); +} + + /******************************************************************************* * * FUNCTION: acpi_ut_valid_internal_object @@ -314,6 +368,7 @@ acpi_ut_delete_object_desc ( } +#ifdef ACPI_ENABLE_OBJECT_CACHE /******************************************************************************* * * FUNCTION: acpi_ut_delete_object_cache @@ -337,6 +392,7 @@ acpi_ut_delete_object_cache ( acpi_ut_delete_generic_cache (ACPI_MEM_LIST_OPERAND); return_VOID; } +#endif /******************************************************************************* diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c index 45c14f9ef..97a91f3f0 100644 --- a/drivers/acpi/utilities/utxface.c +++ b/drivers/acpi/utilities/utxface.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -342,6 +343,8 @@ acpi_terminate (void) } +#ifdef ACPI_FUTURE_USAGE + /***************************************************************************** * * FUNCTION: acpi_subsystem_status @@ -455,6 +458,7 @@ acpi_get_system_info ( return_ACPI_STATUS (AE_OK); } +EXPORT_SYMBOL(acpi_get_system_info); /***************************************************************************** @@ -489,6 +493,8 @@ acpi_install_initialization_handler ( return AE_OK; } +#endif /* ACPI_FUTURE_USAGE */ + /***************************************************************************** * @@ -508,10 +514,12 @@ acpi_purge_cached_objects (void) ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects"); +#ifdef ACPI_ENABLE_OBJECT_CACHE acpi_ut_delete_generic_state_cache (); acpi_ut_delete_object_cache (); acpi_ds_delete_walk_state_cache (); acpi_ps_delete_parse_cache (); +#endif return_ACPI_STATUS (AE_OK); } diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index ed66215b3..1ce2047c3 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -233,6 +233,7 @@ acpi_extract_package ( return_ACPI_STATUS(AE_OK); } +EXPORT_SYMBOL(acpi_extract_package); acpi_status @@ -243,31 +244,40 @@ acpi_evaluate_integer ( unsigned long *data) { acpi_status status = AE_OK; - union acpi_object element; - struct acpi_buffer buffer = {sizeof(union acpi_object), &element}; + union acpi_object *element; + struct acpi_buffer buffer = {0,NULL}; ACPI_FUNCTION_TRACE("acpi_evaluate_integer"); if (!data) return_ACPI_STATUS(AE_BAD_PARAMETER); + element = kmalloc(sizeof(union acpi_object), GFP_KERNEL); + if(!element) + return_ACPI_STATUS(AE_NO_MEMORY); + + memset(element, 0, sizeof(union acpi_object)); + buffer.length = sizeof(union acpi_object); + buffer.pointer = element; status = acpi_evaluate_object(handle, pathname, arguments, &buffer); if (ACPI_FAILURE(status)) { acpi_util_eval_error(handle, pathname, status); return_ACPI_STATUS(status); } - if (element.type != ACPI_TYPE_INTEGER) { + if (element->type != ACPI_TYPE_INTEGER) { acpi_util_eval_error(handle, pathname, AE_BAD_DATA); return_ACPI_STATUS(AE_BAD_DATA); } - *data = element.integer.value; + *data = element->integer.value; + kfree(element); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); return_ACPI_STATUS(AE_OK); } +EXPORT_SYMBOL(acpi_evaluate_integer); #if 0 @@ -373,7 +383,7 @@ acpi_evaluate_reference ( } if (package->package.count > ACPI_MAX_HANDLES) { - return AE_NO_MEMORY; + return_ACPI_STATUS(AE_NO_MEMORY); } list->count = package->package.count; @@ -409,5 +419,5 @@ end: return_ACPI_STATUS(status); } - +EXPORT_SYMBOL(acpi_evaluate_reference); diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5618a2378..bd311c207 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -242,6 +242,13 @@ static struct file_operations acpi_video_device_EDID_fops = { .release = single_release, }; +static char device_decode[][30] = { + "motherboard VGA device", + "PCI VGA device", + "AGP VGA device", + "UNKNOWN", +}; + static void acpi_video_device_notify ( acpi_handle handle, u32 event, void *data); static void acpi_video_device_rebind( struct acpi_video_bus *video); static void acpi_video_device_bind( struct acpi_video_bus *video, struct acpi_video_device *device); @@ -1117,12 +1124,6 @@ acpi_video_bus_POST_seq_show ( struct acpi_video_bus *video = (struct acpi_video_bus *) seq->private; int status; unsigned long id; - char device_decode[][30] = { - "motherboard VGA device", - "PCI VGA device", - "AGP VGA device", - "UNKNOWN", - }; ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show"); @@ -1523,7 +1524,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) dod->package.count)); active_device_list= kmalloc( - dod->package.count*sizeof(struct acpi_video_enumerated_device), + (1+dod->package.count)*sizeof(struct acpi_video_enumerated_device), GFP_KERNEL); if (!active_device_list) { diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile index 907c5933a..d1dcd8eae 100644 --- a/drivers/atm/Makefile +++ b/drivers/atm/Makefile @@ -68,4 +68,4 @@ $(obj)/fore200e_sba_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_SBA_FW)) \ # deal with the various suffixes of the binary firmware images $(obj)/%.bin $(obj)/%.bin1 $(obj)/%.bin2: $(src)/%.data objcopy -Iihex $< -Obinary $@.gz - gzip -df $@.gz + gzip -n -df $@.gz diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index 9be4013f5..3870e3787 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c @@ -313,9 +313,6 @@ static u32 __initdata ucode_data[] = { static void do_housekeeping (unsigned long arg); /********** globals **********/ -static amb_dev * amb_devs = NULL; -static struct timer_list housekeeping = TIMER_INITIALIZER(do_housekeeping, 0, 1); - static unsigned short debug = 0; static unsigned int cmds = 8; static unsigned int txs = 32; @@ -577,7 +574,6 @@ static int command_do (amb_dev * dev, command * cmd) { amb_cq * cq = &dev->cq; volatile amb_cq_ptrs * ptrs = &cq->ptrs; command * my_slot; - unsigned long timeout; PRINTD (DBG_FLOW|DBG_CMD, "command_do %p", dev); @@ -602,20 +598,14 @@ static int command_do (amb_dev * dev, command * cmd) { // mail the command wr_mem (dev, offsetof(amb_mem, mb.adapter.cmd_address), virt_to_bus (ptrs->in)); - // prepare to wait for cq->pending milliseconds - // effectively one centisecond on i386 - timeout = (cq->pending*HZ+999)/1000; - if (cq->pending > cq->high) cq->high = cq->pending; spin_unlock (&cq->lock); - while (timeout) { - // go to sleep - // PRINTD (DBG_CMD, "wait: sleeping %lu for command", timeout); - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); - } + // these comments were in a while-loop before, msleep removes the loop + // go to sleep + // PRINTD (DBG_CMD, "wait: sleeping %lu for command", timeout); + msleep(cq->pending); // wait for my slot to be reached (all waiters are here or above, until...) while (ptrs->out != my_slot) { @@ -870,7 +860,7 @@ static inline void interrupts_off (amb_dev * dev) { static irqreturn_t interrupt_handler(int irq, void *dev_id, struct pt_regs *pt_regs) { - amb_dev * dev = amb_devs; + amb_dev * dev = (amb_dev *) dev_id; (void) pt_regs; PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); @@ -879,24 +869,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id, PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); return IRQ_NONE; } - // Did one of our cards generate the interrupt? - while (dev) { - if (dev == dev_id) - break; - dev = dev->prev; - } - // impossible - unless we add the device to our list after both - // registering the IRQ handler for it and enabling interrupts, AND - // the card generates an IRQ at startup - should not happen again - if (!dev) { - PRINTD (DBG_IRQ, "irq for unknown device: %d", irq); - return IRQ_NONE; - } - // impossible - unless we have memory corruption of dev or kernel - if (irq != dev->irq) { - PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); - return IRQ_NONE; - } { u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); @@ -1554,22 +1526,13 @@ static const struct atmdev_ops amb_ops = { /********** housekeeping **********/ static void do_housekeeping (unsigned long arg) { - amb_dev * dev = amb_devs; - // data is set to zero at module unload - (void) arg; + amb_dev * dev = (amb_dev *) arg; - if (housekeeping.data) { - while (dev) { - - // could collect device-specific (not driver/atm-linux) stats here + // could collect device-specific (not driver/atm-linux) stats here - // last resort refill once every ten seconds - fill_rx_pools (dev); - - dev = dev->prev; - } - mod_timer(&housekeeping, jiffies + 10*HZ); - } + // last resort refill once every ten seconds + fill_rx_pools (dev); + mod_timer(&dev->housekeeping, jiffies + 10*HZ); return; } @@ -1722,7 +1685,7 @@ static unsigned int command_timeouts [] = { }; -unsigned int command_successes [] = { +static unsigned int command_successes [] = { [host_memory_test] = COMMAND_PASSED_TEST, [read_adapter_memory] = COMMAND_READ_DATA_OK, [write_adapter_memory] = COMMAND_WRITE_DATA_OK, @@ -1829,12 +1792,11 @@ static int __init do_loader_command (volatile loader_block * lb, // dump_loader_block (lb); wr_mem (dev, offsetof(amb_mem, doorbell), virt_to_bus (lb) & ~onegigmask); - timeout = command_timeouts[cmd] * HZ/100; + timeout = command_timeouts[cmd] * 10; while (!lb->result || lb->result == cpu_to_be32 (COMMAND_IN_PROGRESS)) if (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "command %d timed out", cmd); dump_registers (dev); @@ -1844,10 +1806,10 @@ static int __init do_loader_command (volatile loader_block * lb, if (cmd == adapter_start) { // wait for start command to acknowledge... - timeout = HZ/10; + timeout = 100; while (rd_plain (dev, offsetof(amb_mem, doorbell))) if (timeout) { - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "start command did not clear doorbell, res=%08x", be32_to_cpu (lb->result)); @@ -1962,17 +1924,12 @@ static int amb_reset (amb_dev * dev, int diags) { if (diags) { unsigned long timeout; // 4.2 second wait - timeout = HZ*42/10; - while (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); - } + msleep(4200); // half second time-out - timeout = HZ/2; + timeout = 500; while (!rd_plain (dev, offsetof(amb_mem, mb.loader.ready))) if (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "reset timed out"); return -ETIMEDOUT; @@ -2086,14 +2043,12 @@ static int __init amb_talk (amb_dev * dev) { wr_mem (dev, offsetof(amb_mem, doorbell), virt_to_bus (&a)); // 2.2 second wait (must not touch doorbell during 2 second DMA test) - timeout = HZ*22/10; - while (timeout) - timeout = schedule_timeout (timeout); + msleep(2200); // give the adapter another half second? - timeout = HZ/2; + timeout = 500; while (rd_plain (dev, offsetof(amb_mem, doorbell))) if (timeout) { - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_INIT|DBG_ERR, "adapter init timed out"); return -ETIMEDOUT; @@ -2118,7 +2073,7 @@ static void __init amb_ucode_version (amb_dev * dev) { } // swap bits within byte to get Ethernet ordering -u8 bit_swap (u8 byte) +static u8 bit_swap (u8 byte) { const u8 swap[] = { 0x0, 0x8, 0x4, 0xc, @@ -2225,6 +2180,7 @@ static void setup_dev(amb_dev *dev, struct pci_dev *pci_dev) // set up known dev items straight away dev->pci_dev = pci_dev; + pci_set_drvdata(pci_dev, dev); dev->iobase = pci_resource_start (pci_dev, 1); dev->irq = pci_dev->irq; @@ -2257,17 +2213,12 @@ static void setup_dev(amb_dev *dev, struct pci_dev *pci_dev) spin_lock_init (&dev->rxq[pool].lock); } -static int setup_pci_dev(struct pci_dev *pci_dev) +static void setup_pci_dev(struct pci_dev *pci_dev) { unsigned char lat; - int ret; // enable bus master accesses pci_set_master(pci_dev); - - ret = pci_enable_device(pci_dev); - if (ret < 0) - goto out; // frobnicate latency (upwards, usually) pci_read_config_byte (pci_dev, PCI_LATENCY_TIMER, &lat); @@ -2280,27 +2231,38 @@ static int setup_pci_dev(struct pci_dev *pci_dev) lat, pci_lat); pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat); } -out: - return ret; } -static int __init do_pci_device(struct pci_dev *pci_dev) +static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) { amb_dev * dev; int err; + unsigned int irq; + + err = pci_enable_device(pci_dev); + if (err < 0) { + PRINTK (KERN_ERR, "skipped broken (PLX rev 2) card"); + goto out; + } // read resources from PCI configuration space - u8 irq = pci_dev->irq; + irq = pci_dev->irq; + + if (pci_dev->device == PCI_DEVICE_ID_MADGE_AMBASSADOR_BAD) { + PRINTK (KERN_ERR, "skipped broken (PLX rev 2) card"); + err = -EINVAL; + goto out_disable; + } PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at" - " IO %x, IRQ %u, MEM %p", pci_resource_start(pci_dev, 1), + " IO %lx, IRQ %u, MEM %p", pci_resource_start(pci_dev, 1), irq, bus_to_virt(pci_resource_start(pci_dev, 0))); // check IO region err = pci_request_region(pci_dev, 1, DEV_LABEL); if (err < 0) { PRINTK (KERN_ERR, "IO range already in use!"); - goto out; + goto out_disable; } dev = kmalloc (sizeof(amb_dev), GFP_KERNEL); @@ -2318,15 +2280,13 @@ static int __init do_pci_device(struct pci_dev *pci_dev) goto out_free; } - err = setup_pci_dev(pci_dev); - if (err < 0) - goto out_reset; + setup_pci_dev(pci_dev); // grab (but share) IRQ and install handler err = request_irq(irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev); if (err < 0) { PRINTK (KERN_ERR, "request IRQ failed!"); - goto out_disable; + goto out_reset; } dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL); @@ -2347,9 +2307,10 @@ static int __init do_pci_device(struct pci_dev *pci_dev) dev->atm_dev->ci_range.vpi_bits = NUM_VPI_BITS; dev->atm_dev->ci_range.vci_bits = NUM_VCI_BITS; - // update linked list - dev->prev = amb_devs; - amb_devs = dev; + init_timer(&dev->housekeeping); + dev->housekeeping.function = do_housekeeping; + dev->housekeeping.data = (unsigned long) dev; + mod_timer(&dev->housekeeping, jiffies); // enable host interrupts interrupts_on (dev); @@ -2359,40 +2320,36 @@ out: out_free_irq: free_irq(irq, dev); -out_disable: - pci_disable_device(pci_dev); out_reset: amb_reset(dev, 0); out_free: kfree(dev); out_release: pci_release_region(pci_dev, 1); +out_disable: + pci_disable_device(pci_dev); goto out; } -static int __init amb_probe (void) { - struct pci_dev * pci_dev; - int devs; - - PRINTD (DBG_FLOW, "amb_probe"); - - devs = 0; - pci_dev = NULL; - while ((pci_dev = pci_find_device - (PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_AMBASSADOR, pci_dev) - )) { - if (do_pci_device(pci_dev) == 0) - devs++; - } - - pci_dev = NULL; - while ((pci_dev = pci_find_device - (PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_AMBASSADOR_BAD, pci_dev) - )) - PRINTK (KERN_ERR, "skipped broken (PLX rev 2) card"); - - return devs; +static void __devexit amb_remove_one(struct pci_dev *pci_dev) +{ + struct amb_dev *dev; + + dev = pci_get_drvdata(pci_dev); + + PRINTD(DBG_INFO|DBG_INIT, "closing %p (atm_dev = %p)", dev, dev->atm_dev); + del_timer_sync(&dev->housekeeping); + // the drain should not be necessary + drain_rx_pools(dev); + interrupts_off(dev); + amb_reset(dev, 0); + free_irq(dev->irq, dev); + pci_disable_device(pci_dev); + destroy_queues(dev); + atm_dev_deregister(dev->atm_dev); + kfree(dev); + pci_release_region(pci_dev, 1); } static void __init amb_check_args (void) { @@ -2440,13 +2397,13 @@ static void __init amb_check_args (void) { MODULE_AUTHOR(maintainer_string); MODULE_DESCRIPTION(description_string); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "h"); -MODULE_PARM(cmds, "i"); -MODULE_PARM(txs, "i"); -MODULE_PARM(rxs, __MODULE_STRING(NUM_RX_POOLS) "i"); -MODULE_PARM(rxs_bs, __MODULE_STRING(NUM_RX_POOLS) "i"); -MODULE_PARM(rx_lats, "i"); -MODULE_PARM(pci_lat, "b"); +module_param(debug, ushort, 0644); +module_param(cmds, uint, 0); +module_param(txs, uint, 0); +module_param_array(rxs, uint, NULL, 0); +module_param_array(rxs_bs, uint, NULL, 0); +module_param(rx_lats, uint, 0); +module_param(pci_lat, byte, 0); MODULE_PARM_DESC(debug, "debug bitmap, see .h file"); MODULE_PARM_DESC(cmds, "number of command queue entries"); MODULE_PARM_DESC(txs, "number of TX queue entries"); @@ -2457,9 +2414,25 @@ MODULE_PARM_DESC(pci_lat, "PCI latency in bus cycles"); /********** module entry **********/ -static int __init amb_module_init (void) { - int devs; - +static struct pci_device_id amb_pci_tbl[] = { + { PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_AMBASSADOR, PCI_ANY_ID, PCI_ANY_ID, + 0, 0, 0 }, + { PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_AMBASSADOR_BAD, PCI_ANY_ID, PCI_ANY_ID, + 0, 0, 0 }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, amb_pci_tbl); + +static struct pci_driver amb_driver = { + .name = "amb", + .probe = amb_probe, + .remove = __devexit_p(amb_remove_one), + .id_table = amb_pci_tbl, +}; + +static int __init amb_module_init (void) +{ PRINTD (DBG_FLOW|DBG_INIT, "init_module"); // sanity check - cast needed as printk does not support %Zu @@ -2474,49 +2447,16 @@ static int __init amb_module_init (void) { amb_check_args(); // get the juice - devs = amb_probe(); - - if (devs) { - mod_timer (&housekeeping, jiffies); - } else { - PRINTK (KERN_INFO, "no (usable) adapters found"); - } - - return devs ? 0 : -ENODEV; + return pci_module_init(&amb_driver); } /********** module exit **********/ -static void __exit amb_module_exit (void) { - amb_dev * dev; - +static void __exit amb_module_exit (void) +{ PRINTD (DBG_FLOW|DBG_INIT, "cleanup_module"); - // paranoia - housekeeping.data = 0; - del_timer_sync(&housekeeping); - - while (amb_devs) { - struct pci_dev *pdev; - - dev = amb_devs; - pdev = dev->pci_dev; - amb_devs = dev->prev; - - PRINTD (DBG_INFO|DBG_INIT, "closing %p (atm_dev = %p)", dev, dev->atm_dev); - // the drain should not be necessary - drain_rx_pools (dev); - interrupts_off (dev); - amb_reset (dev, 0); - free_irq (dev->irq, dev); - pci_disable_device (pdev); - destroy_queues (dev); - atm_dev_deregister (dev->atm_dev); - kfree (dev); - pci_release_region (pdev, 1); - } - - return; + return pci_unregister_driver(&amb_driver); } module_init(amb_module_init); diff --git a/drivers/atm/ambassador.h b/drivers/atm/ambassador.h index 75681ade5..3892dcf9d 100644 --- a/drivers/atm/ambassador.h +++ b/drivers/atm/ambassador.h @@ -649,7 +649,7 @@ struct amb_dev { struct atm_dev * atm_dev; struct pci_dev * pci_dev; - struct amb_dev * prev; + struct timer_list housekeeping; }; typedef struct amb_dev amb_dev; diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index 0572f724b..436b83a1b 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c @@ -271,6 +271,28 @@ static void atmtcp_c_close(struct atm_vcc *vcc) } } read_unlock(&vcc_sklist_lock); + module_put(THIS_MODULE); +} + + +static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci) +{ + struct hlist_head *head; + struct atm_vcc *vcc; + struct hlist_node *node; + struct sock *s; + + head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)]; + + sk_for_each(s, node, head) { + vcc = atm_sk(s); + if (vcc->dev == dev && + vcc->vci == vci && vcc->vpi == vpi && + vcc->qos.rxtp.traffic_class != ATM_NONE) { + return vcc; + } + } + return NULL; } @@ -278,11 +300,9 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) { struct atm_dev *dev; struct atmtcp_hdr *hdr; - struct sock *s; - struct hlist_node *node; - struct atm_vcc *out_vcc = NULL; + struct atm_vcc *out_vcc; struct sk_buff *new_skb; - int i, result = 0; + int result = 0; if (!skb->len) return 0; dev = vcc->dev_data; @@ -293,19 +313,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) goto done; } read_lock(&vcc_sklist_lock); - for(i = 0; i < VCC_HTABLE_SIZE; ++i) { - struct hlist_head *head = &vcc_hash[i]; - - sk_for_each(s, node, head) { - out_vcc = atm_sk(s); - if (out_vcc->dev != dev) - continue; - if (out_vcc->vpi == ntohs(hdr->vpi) && - out_vcc->vci == ntohs(hdr->vci) && - out_vcc->qos.rxtp.traffic_class != ATM_NONE) - break; - } - } + out_vcc = find_vcc(dev, ntohs(hdr->vpi), ntohs(hdr->vci)); read_unlock(&vcc_sklist_lock); if (!out_vcc) { atomic_inc(&vcc->stats->tx_err); @@ -388,7 +396,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) } -int atmtcp_attach(struct atm_vcc *vcc,int itf) +static int atmtcp_attach(struct atm_vcc *vcc,int itf) { struct atm_dev *dev; @@ -419,13 +427,13 @@ int atmtcp_attach(struct atm_vcc *vcc,int itf) } -int atmtcp_create_persistent(int itf) +static int atmtcp_create_persistent(int itf) { return atmtcp_create(itf,1,NULL); } -int atmtcp_remove_persistent(int itf) +static int atmtcp_remove_persistent(int itf) { struct atm_dev *dev; struct atmtcp_dev_data *dev_data; diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 81127d178..78e34ee79 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -245,7 +245,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size) list = eni_dev->free_list; len = eni_dev->free_len; if (*size < MID_MIN_BUF_SIZE) *size = MID_MIN_BUF_SIZE; - if (*size > MID_MAX_BUF_SIZE) return 0; + if (*size > MID_MAX_BUF_SIZE) return NULL; for (order = 0; (1 << order) < *size; order++); DPRINTK("trying: %ld->%d\n",*size,order); best_order = 65; /* we don't have more than 2^64 of anything ... */ @@ -260,7 +260,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size) best_order = list[i].order; index = i; } - if (best_order == 65) return 0; + if (best_order == 65) return NULL; start = list[index].start-eni_dev->base_diff; list[index] = list[--len]; eni_dev->free_len = len; @@ -1315,7 +1315,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp, size = UBR_BUFFER; } new_tx = !eni_vcc->tx; - mem = 0; /* for gcc */ + mem = NULL; /* for gcc */ if (!new_tx) tx = eni_vcc->tx; else { mem = eni_alloc_mem(eni_dev,&size); @@ -1349,7 +1349,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp, error = -EINVAL; if (error) { if (new_tx) { - tx->send = 0; + tx->send = NULL; eni_free_mem(eni_dev,mem,size); } return error; @@ -1423,7 +1423,7 @@ static void close_tx(struct atm_vcc *vcc) eni_in(MID_TX_DESCRSTART(eni_vcc->tx->index))) schedule(); eni_free_mem(eni_dev,eni_vcc->tx->send,eni_vcc->tx->words << 2); - eni_vcc->tx->send = 0; + eni_vcc->tx->send = NULL; eni_dev->tx_bw += eni_vcc->tx->reserved; } eni_vcc->tx = NULL; @@ -1444,7 +1444,7 @@ static int start_tx(struct atm_dev *dev) skb_queue_head_init(&eni_dev->tx_queue); eni_out(0,MID_DMA_WR_TX); for (i = 0; i < NR_CHAN; i++) { - eni_dev->tx[i].send = 0; + eni_dev->tx[i].send = NULL; eni_dev->tx[i].index = i; } return 0; @@ -1702,7 +1702,7 @@ static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base) static int __devinit eni_do_init(struct atm_dev *dev) { - struct midway_eprom *eprom; + struct midway_eprom __iomem *eprom; struct eni_dev *eni_dev; struct pci_dev *pci_dev; unsigned long real_base; @@ -1742,8 +1742,7 @@ static int __devinit eni_do_init(struct atm_dev *dev) eni_dev->base_diff = real_base - (unsigned long) base; /* id may not be present in ASIC Tonga boards - check this @@@ */ if (!eni_dev->asic) { - eprom = (struct midway_eprom *) (base+EPROM_SIZE-sizeof(struct - midway_eprom)); + eprom = (base+EPROM_SIZE-sizeof(struct midway_eprom)); if (readl(&eprom->magic) != ENI155_MAGIC) { printk("\n"); printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad " @@ -2290,9 +2289,7 @@ static int __init eni_init(void) sizeof(skb->cb),sizeof(struct eni_skb_prv)); return -EIO; } - if (pci_register_driver(&eni_driver) > 0) return 0; - pci_unregister_driver (&eni_driver); - return -ENODEV; + return pci_register_driver(&eni_driver); } diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 68919a710..b5cd86192 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -82,14 +82,14 @@ static int num=0x5a; * would be interpreted. -- REW */ #define NP FS_NR_FREE_POOLS -int rx_buf_sizes[NP] = {128, 256, 512, 1024, 2048, 4096, 16384, 65520}; +static int rx_buf_sizes[NP] = {128, 256, 512, 1024, 2048, 4096, 16384, 65520}; /* log2: 7 8 9 10 11 12 14 16 */ #if 0 -int rx_pool_sizes[NP] = {1024, 1024, 512, 256, 128, 64, 32, 32}; +static int rx_pool_sizes[NP] = {1024, 1024, 512, 256, 128, 64, 32, 32}; #else /* debug */ -int rx_pool_sizes[NP] = {128, 128, 128, 64, 64, 64, 32, 32}; +static int rx_pool_sizes[NP] = {128, 128, 128, 64, 64, 64, 32, 32}; #endif /* log2: 10 10 9 8 7 6 5 5 */ /* sumlog2: 17 18 18 18 18 18 19 21 */ @@ -250,7 +250,7 @@ struct reginit_item { }; -struct reginit_item PHY_NTC_INIT[] __devinitdata = { +static struct reginit_item PHY_NTC_INIT[] __devinitdata = { { PHY_CLEARALL, 0x40 }, { 0x12, 0x0001 }, { 0x13, 0x7605 }, @@ -306,11 +306,11 @@ static int fs_debug = 0; #ifdef MODULE #ifdef DEBUG -MODULE_PARM(fs_debug, "i"); +module_param(fs_debug, int, 0644); #endif -MODULE_PARM(loopback, "i"); -MODULE_PARM(num, "i"); -MODULE_PARM(fs_keystream, "i"); +module_param(loopback, int, 0); +module_param(num, int, 0); +module_param(fs_keystream, int, 0); /* XXX Add rx_buf_sizes, and rx_pool_sizes As per request Amar. -- REW */ #endif @@ -334,7 +334,7 @@ MODULE_PARM(fs_keystream, "i"); #define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__) -struct fs_dev *fs_boards = NULL; +static struct fs_dev *fs_boards = NULL; #ifdef DEBUG @@ -1921,7 +1921,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev, return -ENODEV; } -void __devexit firestream_remove_one (struct pci_dev *pdev) +static void __devexit firestream_remove_one (struct pci_dev *pdev) { int i; struct fs_dev *dev, *nxtdev; @@ -2012,66 +2012,6 @@ void __devexit firestream_remove_one (struct pci_dev *pdev) func_exit (); } - -#if 0 -int __init fs_detect(void) -{ - struct pci_dev *pci_dev; - int devs = 0; - - func_enter (); - pci_dev = NULL; - while ((pci_dev = pci_find_device(PCI_VENDOR_ID_FUJITSU_ME, - PCI_DEVICE_ID_FUJITSU_FS50, - pci_dev))) { - if (fs_register_and_init (pci_dev, &fs_pci_tbl[0])) - break; - devs++; - } - - while ((pci_dev = pci_find_device(PCI_VENDOR_ID_FUJITSU_ME, - PCI_DEVICE_ID_FUJITSU_FS155, - pci_dev))) { - if (fs_register_and_init (pci_dev, FS_IS155)) - break; - devs++; - } - func_exit (); - return devs; -} -#else - -#if 0 -int __init init_PCI (void) -{ /* Begin init_PCI */ - - int pci_count; - printk ("init_PCI\n"); - /* - memset (&firestream_driver, 0, sizeof (firestream_driver)); - firestream_driver.name = "firestream"; - firestream_driver.id_table = firestream_pci_tbl; - firestream_driver.probe = fs_register_and_init; - */ - pci_count = pci_register_driver (&firestream_driver); - - if (pci_count <= 0) { - pci_unregister_driver (&firestream_driver); - pci_count = 0; - } - - return(pci_count); - -} /* End init_PCI */ -#endif -#endif - -/* -#ifdef MODULE -#define firestream_init init_module -#endif -*/ - static struct pci_device_id firestream_pci_tbl[] = { { PCI_VENDOR_ID_FUJITSU_ME, PCI_DEVICE_ID_FUJITSU_FS50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FS_IS50}, @@ -2110,3 +2050,4 @@ module_exit(firestream_cleanup_module); MODULE_LICENSE("GPL"); + diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index b2f13752c..3ad3d9e9a 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -275,7 +276,7 @@ fore200e_poll(struct fore200e* fore200e, volatile u32* addr, u32 val, int msecs) static int -fore200e_io_poll(struct fore200e* fore200e, volatile u32* addr, u32 val, int msecs) +fore200e_io_poll(struct fore200e* fore200e, volatile u32 __iomem *addr, u32 val, int msecs) { unsigned long timeout = jiffies + MSECS(msecs); int ok; @@ -347,7 +348,7 @@ fore200e_reset(struct fore200e* fore200e, int diag) { int ok; - fore200e->cp_monitor = (struct cp_monitor*)(fore200e->virt_base + FORE200E_CP_MONITOR_OFFSET); + fore200e->cp_monitor = fore200e->virt_base + FORE200E_CP_MONITOR_OFFSET; fore200e->bus->write(BSTAT_COLD_START, &fore200e->cp_monitor->bstat); @@ -440,7 +441,7 @@ fore200e_shutdown(struct fore200e* fore200e) #ifdef CONFIG_ATM_FORE200E_PCA -static u32 fore200e_pca_read(volatile u32* addr) +static u32 fore200e_pca_read(volatile u32 __iomem *addr) { /* on big-endian hosts, the board is configured to convert the endianess of slave RAM accesses */ @@ -448,7 +449,7 @@ static u32 fore200e_pca_read(volatile u32* addr) } -static void fore200e_pca_write(u32 val, volatile u32* addr) +static void fore200e_pca_write(u32 val, volatile u32 __iomem *addr) { /* on big-endian hosts, the board is configured to convert the endianess of slave RAM accesses */ @@ -576,9 +577,9 @@ fore200e_pca_map(struct fore200e* fore200e) DPRINTK(1, "device %s mapped to 0x%p\n", fore200e->name, fore200e->virt_base); /* gain access to the PCA specific registers */ - fore200e->regs.pca.hcr = (u32*)(fore200e->virt_base + PCA200E_HCR_OFFSET); - fore200e->regs.pca.imr = (u32*)(fore200e->virt_base + PCA200E_IMR_OFFSET); - fore200e->regs.pca.psr = (u32*)(fore200e->virt_base + PCA200E_PSR_OFFSET); + fore200e->regs.pca.hcr = fore200e->virt_base + PCA200E_HCR_OFFSET; + fore200e->regs.pca.imr = fore200e->virt_base + PCA200E_IMR_OFFSET; + fore200e->regs.pca.psr = fore200e->virt_base + PCA200E_PSR_OFFSET; fore200e->state = FORE200E_STATE_MAP; return 0; @@ -689,7 +690,7 @@ fore200e_pca_prom_read(struct fore200e* fore200e, struct prom_data* prom) *entry->status = STATUS_PENDING; - fore200e->bus->write(*(u32*)&opcode, (u32*)&entry->cp_entry->cmd.prom_block.opcode); + fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.prom_block.opcode); ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); @@ -730,14 +731,14 @@ fore200e_pca_proc_read(struct fore200e* fore200e, char *page) #ifdef CONFIG_ATM_FORE200E_SBA static u32 -fore200e_sba_read(volatile u32* addr) +fore200e_sba_read(volatile u32 __iomem *addr) { return sbus_readl(addr); } static void -fore200e_sba_write(u32 val, volatile u32* addr) +fore200e_sba_write(u32 val, volatile u32 __iomem *addr) { sbus_writel(val, addr); } @@ -856,10 +857,10 @@ fore200e_sba_map(struct fore200e* fore200e) unsigned int bursts; /* gain access to the SBA specific registers */ - fore200e->regs.sba.hcr = (u32*)sbus_ioremap(&sbus_dev->resource[0], 0, SBA200E_HCR_LENGTH, "SBA HCR"); - fore200e->regs.sba.bsr = (u32*)sbus_ioremap(&sbus_dev->resource[1], 0, SBA200E_BSR_LENGTH, "SBA BSR"); - fore200e->regs.sba.isr = (u32*)sbus_ioremap(&sbus_dev->resource[2], 0, SBA200E_ISR_LENGTH, "SBA ISR"); - fore200e->virt_base = (u32*)sbus_ioremap(&sbus_dev->resource[3], 0, SBA200E_RAM_LENGTH, "SBA RAM"); + fore200e->regs.sba.hcr = sbus_ioremap(&sbus_dev->resource[0], 0, SBA200E_HCR_LENGTH, "SBA HCR"); + fore200e->regs.sba.bsr = sbus_ioremap(&sbus_dev->resource[1], 0, SBA200E_BSR_LENGTH, "SBA BSR"); + fore200e->regs.sba.isr = sbus_ioremap(&sbus_dev->resource[2], 0, SBA200E_ISR_LENGTH, "SBA ISR"); + fore200e->virt_base = sbus_ioremap(&sbus_dev->resource[3], 0, SBA200E_RAM_LENGTH, "SBA RAM"); if (fore200e->virt_base == NULL) { printk(FORE200E "unable to map RAM of device %s\n", fore200e->name); @@ -884,10 +885,10 @@ fore200e_sba_map(struct fore200e* fore200e) static void fore200e_sba_unmap(struct fore200e* fore200e) { - sbus_iounmap((ulong)fore200e->regs.sba.hcr, SBA200E_HCR_LENGTH); - sbus_iounmap((ulong)fore200e->regs.sba.bsr, SBA200E_BSR_LENGTH); - sbus_iounmap((ulong)fore200e->regs.sba.isr, SBA200E_ISR_LENGTH); - sbus_iounmap((ulong)fore200e->virt_base, SBA200E_RAM_LENGTH); + sbus_iounmap(fore200e->regs.sba.hcr, SBA200E_HCR_LENGTH); + sbus_iounmap(fore200e->regs.sba.bsr, SBA200E_BSR_LENGTH); + sbus_iounmap(fore200e->regs.sba.isr, SBA200E_ISR_LENGTH); + sbus_iounmap(fore200e->virt_base, SBA200E_RAM_LENGTH); } @@ -1477,12 +1478,12 @@ fore200e_activate_vcin(struct fore200e* fore200e, int activate, struct atm_vcc* #endif /* the MTU is not used by the cp, except in the case of AAL0 */ fore200e->bus->write(mtu, &entry->cp_entry->cmd.activate_block.mtu); - fore200e->bus->write(*(u32*)&vpvc, (u32*)&entry->cp_entry->cmd.activate_block.vpvc); - fore200e->bus->write(*(u32*)&activ_opcode, (u32*)&entry->cp_entry->cmd.activate_block.opcode); + fore200e->bus->write(*(u32*)&vpvc, (u32 __iomem *)&entry->cp_entry->cmd.activate_block.vpvc); + fore200e->bus->write(*(u32*)&activ_opcode, (u32 __iomem *)&entry->cp_entry->cmd.activate_block.opcode); } else { - fore200e->bus->write(*(u32*)&vpvc, (u32*)&entry->cp_entry->cmd.deactivate_block.vpvc); - fore200e->bus->write(*(u32*)&deactiv_opcode, (u32*)&entry->cp_entry->cmd.deactivate_block.opcode); + fore200e->bus->write(*(u32*)&vpvc, (u32 __iomem *)&entry->cp_entry->cmd.deactivate_block.vpvc); + fore200e->bus->write(*(u32*)&deactiv_opcode, (u32 __iomem *)&entry->cp_entry->cmd.deactivate_block.opcode); } ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); @@ -1779,7 +1780,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb) /* retry once again? */ if (--retry > 0) { - schedule(); + udelay(50); goto retry_here; } @@ -1858,7 +1859,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb) tpd_haddr.haddr = entry->tpd_dma >> TPD_HADDR_SHIFT; /* shift the address, as we are in a bitfield */ *entry->status = STATUS_PENDING; - fore200e->bus->write(*(u32*)&tpd_haddr, (u32*)&entry->cp_entry->tpd_haddr); + fore200e->bus->write(*(u32*)&tpd_haddr, (u32 __iomem *)&entry->cp_entry->tpd_haddr); spin_unlock_irqrestore(&fore200e->q_lock, flags); @@ -1893,7 +1894,7 @@ fore200e_getstats(struct fore200e* fore200e) *entry->status = STATUS_PENDING; - fore200e->bus->write(*(u32*)&opcode, (u32*)&entry->cp_entry->cmd.stats_block.opcode); + fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.stats_block.opcode); ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); @@ -1996,7 +1997,7 @@ fore200e_set_oc3(struct fore200e* fore200e, u32 reg, u32 value, u32 mask) *entry->status = STATUS_PENDING; - fore200e->bus->write(*(u32*)&opcode, (u32*)&entry->cp_entry->cmd.oc3_block.opcode); + fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.oc3_block.opcode); ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); @@ -2291,7 +2292,7 @@ fore200e_init_bs_queue(struct fore200e* fore200e) int scheme, magn, i; struct host_bsq* bsq; - struct cp_bsq_entry* cp_entry; + struct cp_bsq_entry __iomem * cp_entry; for (scheme = 0; scheme < BUFFER_SCHEME_NBR; scheme++) { for (magn = 0; magn < BUFFER_MAGN_NBR; magn++) { @@ -2321,8 +2322,8 @@ fore200e_init_bs_queue(struct fore200e* fore200e) } /* get the base address of the cp resident buffer supply queue entries */ - cp_entry = (struct cp_bsq_entry*)(fore200e->virt_base + - fore200e->bus->read(&fore200e->cp_queues->cp_bsq[ scheme ][ magn ])); + cp_entry = fore200e->virt_base + + fore200e->bus->read(&fore200e->cp_queues->cp_bsq[ scheme ][ magn ]); /* fill the host resident and cp resident buffer supply queue entries */ for (i = 0; i < QUEUE_SIZE_BS; i++) { @@ -2352,7 +2353,7 @@ static int __init fore200e_init_rx_queue(struct fore200e* fore200e) { struct host_rxq* rxq = &fore200e->host_rxq; - struct cp_rxq_entry* cp_entry; + struct cp_rxq_entry __iomem * cp_entry; int i; DPRINTK(2, "receive queue is being initialized\n"); @@ -2378,8 +2379,7 @@ fore200e_init_rx_queue(struct fore200e* fore200e) } /* get the base address of the cp resident rx queue entries */ - cp_entry = (struct cp_rxq_entry*)(fore200e->virt_base + - fore200e->bus->read(&fore200e->cp_queues->cp_rxq)); + cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_rxq); /* fill the host resident and cp resident rx entries */ for (i=0; i < QUEUE_SIZE_RX; i++) { @@ -2413,7 +2413,7 @@ static int __init fore200e_init_tx_queue(struct fore200e* fore200e) { struct host_txq* txq = &fore200e->host_txq; - struct cp_txq_entry* cp_entry; + struct cp_txq_entry __iomem * cp_entry; int i; DPRINTK(2, "transmit queue is being initialized\n"); @@ -2439,8 +2439,7 @@ fore200e_init_tx_queue(struct fore200e* fore200e) } /* get the base address of the cp resident tx queue entries */ - cp_entry = (struct cp_txq_entry*)(fore200e->virt_base + - fore200e->bus->read(&fore200e->cp_queues->cp_txq)); + cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_txq); /* fill the host resident and cp resident tx entries */ for (i=0; i < QUEUE_SIZE_TX; i++) { @@ -2477,7 +2476,7 @@ static int __init fore200e_init_cmd_queue(struct fore200e* fore200e) { struct host_cmdq* cmdq = &fore200e->host_cmdq; - struct cp_cmdq_entry* cp_entry; + struct cp_cmdq_entry __iomem * cp_entry; int i; DPRINTK(2, "command queue is being initialized\n"); @@ -2492,8 +2491,7 @@ fore200e_init_cmd_queue(struct fore200e* fore200e) } /* get the base address of the cp resident cmd queue entries */ - cp_entry = (struct cp_cmdq_entry*)(fore200e->virt_base + - fore200e->bus->read(&fore200e->cp_queues->cp_cmdq)); + cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_cmdq); /* fill the host resident and cp resident cmd entries */ for (i=0; i < QUEUE_SIZE_CMD; i++) { @@ -2521,7 +2519,7 @@ fore200e_param_bs_queue(struct fore200e* fore200e, enum buffer_scheme scheme, enum buffer_magn magn, int queue_length, int pool_size, int supply_blksize) { - struct bs_spec* bs_spec = &fore200e->cp_queues->init.bs_spec[ scheme ][ magn ]; + struct bs_spec __iomem * bs_spec = &fore200e->cp_queues->init.bs_spec[ scheme ][ magn ]; fore200e->bus->write(queue_length, &bs_spec->queue_length); fore200e->bus->write(fore200e_rx_buf_size[ scheme ][ magn ], &bs_spec->buffer_size); @@ -2533,7 +2531,7 @@ fore200e_param_bs_queue(struct fore200e* fore200e, static int __init fore200e_initialize(struct fore200e* fore200e) { - struct cp_queues* cpq; + struct cp_queues __iomem * cpq; int ok, scheme, magn; DPRINTK(2, "device %s being initialized\n", fore200e->name); @@ -2541,7 +2539,7 @@ fore200e_initialize(struct fore200e* fore200e) init_MUTEX(&fore200e->rate_sf); spin_lock_init(&fore200e->q_lock); - cpq = fore200e->cp_queues = (struct cp_queues*) (fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET); + cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET; /* enable cp to host interrupts */ fore200e->bus->write(1, &cpq->imask); @@ -2585,7 +2583,7 @@ fore200e_initialize(struct fore200e* fore200e) static void __init fore200e_monitor_putc(struct fore200e* fore200e, char c) { - struct cp_monitor* monitor = fore200e->cp_monitor; + struct cp_monitor __iomem * monitor = fore200e->cp_monitor; #if 0 printk("%c", c); @@ -2597,7 +2595,7 @@ fore200e_monitor_putc(struct fore200e* fore200e, char c) static int __init fore200e_monitor_getc(struct fore200e* fore200e) { - struct cp_monitor* monitor = fore200e->cp_monitor; + struct cp_monitor __iomem * monitor = fore200e->cp_monitor; unsigned long timeout = jiffies + MSECS(50); int c; @@ -2673,7 +2671,7 @@ fore200e_load_fw(struct fore200e* fore200e) struct fw_header* fw_header = (struct fw_header*) fw_data; - u32* load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset); + u32 __iomem *load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset); DPRINTK(2, "device %s firmware being loaded at 0x%p (%d words)\n", fore200e->name, load_addr, fw_size); @@ -2854,7 +2852,7 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) " board serial number:\t\t%d\n\n", fore200e_irq_itoa(fore200e->irq), (void*)fore200e->phys_base, - (void*)fore200e->virt_base, + fore200e->virt_base, fore200e->esi[0], fore200e->esi[1], fore200e->esi[2], fore200e->esi[3], fore200e->esi[4], fore200e->esi[5], fore200e->esi[4] * 256 + fore200e->esi[5]); @@ -2938,7 +2936,7 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) } if (!left--) { - struct cp_monitor* cp_monitor = fore200e->cp_monitor; + struct cp_monitor __iomem * cp_monitor = fore200e->cp_monitor; return sprintf(page, "\n\n" diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h index 420216561..492f7f549 100644 --- a/drivers/atm/fore200e.h +++ b/drivers/atm/fore200e.h @@ -520,7 +520,7 @@ typedef struct cp_cmdq_entry { /* host resident transmit queue entry */ typedef struct host_txq_entry { - struct cp_txq_entry* cp_entry; /* addr of cp resident tx queue entry */ + struct cp_txq_entry __iomem *cp_entry; /* addr of cp resident tx queue entry */ enum status* status; /* addr of host resident status */ struct tpd* tpd; /* addr of transmit PDU descriptor */ u32 tpd_dma; /* DMA address of tpd */ @@ -535,7 +535,7 @@ typedef struct host_txq_entry { /* host resident receive queue entry */ typedef struct host_rxq_entry { - struct cp_rxq_entry* cp_entry; /* addr of cp resident rx queue entry */ + struct cp_rxq_entry __iomem *cp_entry; /* addr of cp resident rx queue entry */ enum status* status; /* addr of host resident status */ struct rpd* rpd; /* addr of receive PDU descriptor */ u32 rpd_dma; /* DMA address of rpd */ @@ -545,7 +545,7 @@ typedef struct host_rxq_entry { /* host resident buffer supply queue entry */ typedef struct host_bsq_entry { - struct cp_bsq_entry* cp_entry; /* addr of cp resident buffer supply queue entry */ + struct cp_bsq_entry __iomem *cp_entry; /* addr of cp resident buffer supply queue entry */ enum status* status; /* addr of host resident status */ struct rbd_block* rbd_block; /* addr of receive buffer descriptor block */ u32 rbd_block_dma; /* DMA address od rdb */ @@ -555,7 +555,7 @@ typedef struct host_bsq_entry { /* host resident command queue entry */ typedef struct host_cmdq_entry { - struct cp_cmdq_entry* cp_entry; /* addr of cp resident cmd queue entry */ + struct cp_cmdq_entry __iomem *cp_entry; /* addr of cp resident cmd queue entry */ enum status *status; /* addr of host resident status */ } host_cmdq_entry_t; @@ -645,7 +645,7 @@ typedef struct host_bsq { typedef struct fw_header { u32 magic; /* magic number */ - u32 version; /* firware version id */ + u32 version; /* firmware version id */ u32 load_offset; /* fw load offset in board memory */ u32 start_offset; /* fw execution start address in board memory */ } fw_header_t; @@ -772,18 +772,18 @@ typedef enum fore200e_state { /* PCA-200E registers */ typedef struct fore200e_pca_regs { - volatile u32* hcr; /* address of host control register */ - volatile u32* imr; /* address of host interrupt mask register */ - volatile u32* psr; /* address of PCI specific register */ + volatile u32 __iomem * hcr; /* address of host control register */ + volatile u32 __iomem * imr; /* address of host interrupt mask register */ + volatile u32 __iomem * psr; /* address of PCI specific register */ } fore200e_pca_regs_t; /* SBA-200E registers */ typedef struct fore200e_sba_regs { - volatile u32* hcr; /* address of host control register */ - volatile u32* bsr; /* address of burst transfer size register */ - volatile u32* isr; /* address of interrupt level selection register */ + volatile u32 __iomem *hcr; /* address of host control register */ + volatile u32 __iomem *bsr; /* address of burst transfer size register */ + volatile u32 __iomem *isr; /* address of interrupt level selection register */ } fore200e_sba_regs_t; @@ -807,8 +807,8 @@ typedef struct fore200e_bus { int status_alignment; /* status words DMA alignment requirement */ const unsigned char* fw_data; /* address of firmware data start */ const unsigned int* fw_size; /* address of firmware data size */ - u32 (*read)(volatile u32*); - void (*write)(u32, volatile u32*); + u32 (*read)(volatile u32 __iomem *); + void (*write)(u32, volatile u32 __iomem *); u32 (*dma_map)(struct fore200e*, void*, int, int); void (*dma_unmap)(struct fore200e*, u32, int, int); void (*dma_sync_for_cpu)(struct fore200e*, u32, int, int); @@ -852,12 +852,12 @@ typedef struct fore200e { void* bus_dev; /* bus-specific kernel data */ int irq; /* irq number */ unsigned long phys_base; /* physical base address */ - void* virt_base; /* virtual base address */ + void __iomem * virt_base; /* virtual base address */ unsigned char esi[ ESI_LEN ]; /* end system identifier */ - struct cp_monitor* cp_monitor; /* i960 monitor address */ - struct cp_queues* cp_queues; /* cp resident queues */ + struct cp_monitor __iomem * cp_monitor; /* i960 monitor address */ + struct cp_queues __iomem * cp_queues; /* cp resident queues */ struct host_cmdq host_cmdq; /* host resident cmd queue */ struct host_txq host_txq; /* host resident tx queue */ struct host_rxq host_rxq; /* host resident rx queue */ diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 74b490bc4..f20bfdf73 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c @@ -86,44 +86,19 @@ #undef USE_RBPL_POOL /* if memory is tight try this */ #define USE_TPD_POOL /* #undef CONFIG_ATM_HE_USE_SUNI */ - -/* compatibility */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -typedef void irqreturn_t; -#define IRQ_NONE -#define IRQ_HANDLED -#define IRQ_RETVAL(x) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9) -#define __devexit_p(func) func -#endif - -#ifndef MODULE_LICENSE -#define MODULE_LICENSE(x) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) -#define pci_set_drvdata(pci_dev, data) (pci_dev)->driver_data = (data) -#define pci_get_drvdata(pci_dev) (pci_dev)->driver_data -#endif +/* #undef HE_DEBUG */ #include "he.h" - #include "suni.h" - #include #define hprintk(fmt,args...) printk(KERN_ERR DEV_LABEL "%d: " fmt, he_dev->number , ##args) -#undef DEBUG -#ifdef DEBUG +#ifdef HE_DEBUG #define HPRINTK(fmt,args...) printk(KERN_DEBUG DEV_LABEL "%d: " fmt, he_dev->number , ##args) -#else +#else /* !HE_DEBUG */ #define HPRINTK(fmt,args...) do { } while (0) -#endif /* DEBUG */ - +#endif /* HE_DEBUG */ /* version definition */ @@ -147,13 +122,55 @@ static u8 read_prom_byte(struct he_dev *he_dev, int addr); /* globals */ -struct he_dev *he_devs = NULL; -static short disable64 = -1; +static struct he_dev *he_devs; +static int disable64; static short nvpibits = -1; static short nvcibits = -1; static short rx_skb_reserve = 16; -static short irq_coalesce = 1; -static short sdh = 0; +static int irq_coalesce = 1; +static int sdh = 0; + +/* Read from EEPROM = 0000 0011b */ +static unsigned int readtab[] = { + CS_HIGH | CLK_HIGH, + CS_LOW | CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW, + CLK_HIGH, /* 0 */ + CLK_LOW | SI_HIGH, + CLK_HIGH | SI_HIGH, /* 1 */ + CLK_LOW | SI_HIGH, + CLK_HIGH | SI_HIGH /* 1 */ +}; + +/* Clock to read from/write to the EEPROM */ +static unsigned int clocktab[] = { + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW, + CLK_HIGH, + CLK_LOW +}; static struct atmdev_ops he_ops = { @@ -1701,7 +1718,7 @@ he_stop(struct he_dev *he_dev) } if (he_dev->membase) - iounmap((void *) he_dev->membase); + iounmap(he_dev->membase); } static struct he_tpd * @@ -2558,8 +2575,8 @@ he_close(struct atm_vcc *vcc) udelay(250); } - add_wait_queue(&he_vcc->rx_waitq, &wait); set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&he_vcc->rx_waitq, &wait); he_writel_rsr0(he_dev, RSR0_CLOSE_CONN, cid); (void) he_readl_rsr0(he_dev, cid); /* flush posted writes */ @@ -2633,8 +2650,8 @@ he_close(struct atm_vcc *vcc) tpd->vcc = vcc; wmb(); - add_wait_queue(&he_vcc->tx_waitq, &wait); set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&he_vcc->tx_waitq, &wait); __enqueue_tpd(he_dev, tpd, cid); spin_unlock_irqrestore(&he_dev->global_lock, flags); @@ -3032,17 +3049,17 @@ read_prom_byte(struct he_dev *he_dev, int addr) MODULE_LICENSE("GPL"); MODULE_AUTHOR("chas williams "); MODULE_DESCRIPTION("ForeRunnerHE ATM Adapter driver"); -MODULE_PARM(disable64, "h"); +module_param(disable64, bool, 0); MODULE_PARM_DESC(disable64, "disable 64-bit pci bus transfers"); -MODULE_PARM(nvpibits, "i"); +module_param(nvpibits, short, 0); MODULE_PARM_DESC(nvpibits, "numbers of bits for vpi (default 0)"); -MODULE_PARM(nvcibits, "i"); +module_param(nvcibits, short, 0); MODULE_PARM_DESC(nvcibits, "numbers of bits for vci (default 12)"); -MODULE_PARM(rx_skb_reserve, "i"); +module_param(rx_skb_reserve, short, 0); MODULE_PARM_DESC(rx_skb_reserve, "padding for receive skb (default 16)"); -MODULE_PARM(irq_coalesce, "i"); +module_param(irq_coalesce, bool, 0); MODULE_PARM_DESC(irq_coalesce, "use interrupt coalescing (default 1)"); -MODULE_PARM(sdh, "i"); +module_param(sdh, bool, 0); MODULE_PARM_DESC(sdh, "use SDH framing (default 0)"); static struct pci_device_id he_pci_tbl[] = { @@ -3051,6 +3068,8 @@ static struct pci_device_id he_pci_tbl[] = { { 0, } }; +MODULE_DEVICE_TABLE(pci, he_pci_tbl); + static struct pci_driver he_driver = { .name = "he", .probe = he_init_one, diff --git a/drivers/atm/he.h b/drivers/atm/he.h index 7075ef4aa..1a9038593 100644 --- a/drivers/atm/he.h +++ b/drivers/atm/he.h @@ -892,47 +892,4 @@ struct he_vcc #define SI_HIGH ID_DIN /* HOST_CNTL_ID_PROM_DATA_IN */ #define EEPROM_DELAY 400 /* microseconds */ -/* Read from EEPROM = 0000 0011b */ -unsigned int readtab[] = { - CS_HIGH | CLK_HIGH, - CS_LOW | CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW, - CLK_HIGH, /* 0 */ - CLK_LOW | SI_HIGH, - CLK_HIGH | SI_HIGH, /* 1 */ - CLK_LOW | SI_HIGH, - CLK_HIGH | SI_HIGH /* 1 */ -}; - -/* Clock to read from/write to the EEPROM */ -unsigned int clocktab[] = { - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW, - CLK_HIGH, - CLK_LOW -}; - - #endif /* _HE_H_ */ diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 9ae4121ae..801d05966 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -354,8 +355,7 @@ static inline void __init show_version (void) { /********** globals **********/ -static hrz_dev * hrz_devs = NULL; -static struct timer_list housekeeping; +static void do_housekeeping (unsigned long arg); static unsigned short debug = 0; static unsigned short vpi_bits = 0; @@ -1090,13 +1090,11 @@ static inline void rx_bus_master_complete_handler (hrz_dev * dev) { /********** (queue to) become the next TX thread **********/ static inline int tx_hold (hrz_dev * dev) { - while (test_and_set_bit (tx_busy, &dev->flags)) { - PRINTD (DBG_TX, "sleeping at tx lock %p %lu", dev, dev->flags); - interruptible_sleep_on (&dev->tx_queue); - PRINTD (DBG_TX, "woken at tx lock %p %lu", dev, dev->flags); - if (signal_pending (current)) - return -1; - } + PRINTD (DBG_TX, "sleeping at tx lock %p %lu", dev, dev->flags); + wait_event_interruptible(dev->tx_queue, (!test_and_set_bit(tx_busy, &dev->flags))); + PRINTD (DBG_TX, "woken at tx lock %p %lu", dev, dev->flags); + if (signal_pending (current)) + return -1; PRINTD (DBG_TX, "set tx_busy for dev %p", dev); return 0; } @@ -1386,7 +1384,7 @@ static inline void rx_data_av_handler (hrz_dev * dev) { static irqreturn_t interrupt_handler(int irq, void *dev_id, struct pt_regs *pt_regs) { - hrz_dev * dev = hrz_devs; + hrz_dev * dev = (hrz_dev *) dev_id; u32 int_source; unsigned int irq_ok; (void) pt_regs; @@ -1397,16 +1395,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id, PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); return IRQ_NONE; } - // Did one of our cards generate the interrupt? - while (dev) { - if (dev == dev_id) - break; - dev = dev->prev; - } - if (!dev) { - PRINTD (DBG_IRQ, "irq not for me: %d", irq); - return IRQ_NONE; - } if (irq != dev->irq) { PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); return IRQ_NONE; @@ -1462,28 +1450,18 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id, /********** housekeeping **********/ -static void set_timer (struct timer_list * timer, unsigned int delay) { - timer->expires = jiffies + delay; - add_timer (timer); - return; -} - static void do_housekeeping (unsigned long arg) { // just stats at the moment - hrz_dev * dev = hrz_devs; - (void) arg; - // data is set to zero at module unload - if (housekeeping.data) { - while (dev) { - // collect device-specific (not driver/atm-linux) stats here - dev->tx_cell_count += rd_regw (dev, TX_CELL_COUNT_OFF); - dev->rx_cell_count += rd_regw (dev, RX_CELL_COUNT_OFF); - dev->hec_error_count += rd_regw (dev, HEC_ERROR_COUNT_OFF); - dev->unassigned_cell_count += rd_regw (dev, UNASSIGNED_CELL_COUNT_OFF); - dev = dev->prev; - } - set_timer (&housekeeping, HZ/10); - } + hrz_dev * dev = (hrz_dev *) arg; + + // collect device-specific (not driver/atm-linux) stats here + dev->tx_cell_count += rd_regw (dev, TX_CELL_COUNT_OFF); + dev->rx_cell_count += rd_regw (dev, RX_CELL_COUNT_OFF); + dev->hec_error_count += rd_regw (dev, HEC_ERROR_COUNT_OFF); + dev->unassigned_cell_count += rd_regw (dev, UNASSIGNED_CELL_COUNT_OFF); + + mod_timer (&dev->housekeeping, jiffies + HZ/10); + return; } @@ -2719,157 +2697,177 @@ static const struct atmdev_ops hrz_ops = { .owner = THIS_MODULE, }; -static int __init hrz_probe (void) { - struct pci_dev * pci_dev; - int devs; - - PRINTD (DBG_FLOW, "hrz_probe"); - - devs = 0; - pci_dev = NULL; - while ((pci_dev = pci_find_device - (PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_HORIZON, pci_dev) - )) { - hrz_dev * dev; - - // adapter slot free, read resources from PCI configuration space - u32 iobase = pci_resource_start (pci_dev, 0); - u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 1)); - u8 irq = pci_dev->irq; - - /* XXX DEV_LABEL is a guess */ - if (!request_region (iobase, HRZ_IO_EXTENT, DEV_LABEL)) - continue; +static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) +{ + hrz_dev * dev; + int err = 0; - if (pci_enable_device (pci_dev)) - continue; - - dev = kmalloc (sizeof(hrz_dev), GFP_KERNEL); - if (!dev) { - // perhaps we should be nice: deregister all adapters and abort? - PRINTD (DBG_ERR, "out of memory"); - continue; - } - - memset (dev, 0, sizeof(hrz_dev)); - - // grab IRQ and install handler - move this someplace more sensible - if (request_irq (irq, - interrupt_handler, - SA_SHIRQ, /* irqflags guess */ - DEV_LABEL, /* name guess */ - dev)) { - PRINTD (DBG_WARN, "request IRQ failed!"); - // free_irq is at "endif" - } else { - - PRINTD (DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", - iobase, irq, membase); - - dev->atm_dev = atm_dev_register (DEV_LABEL, &hrz_ops, -1, NULL); - if (!(dev->atm_dev)) { - PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); - } else { + // adapter slot free, read resources from PCI configuration space + u32 iobase = pci_resource_start (pci_dev, 0); + u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 1)); + unsigned int irq; unsigned char lat; - - PRINTD (DBG_INFO, "registered Madge ATM adapter (no. %d) (%p) at %p", - dev->atm_dev->number, dev, dev->atm_dev); + + PRINTD (DBG_FLOW, "hrz_probe"); + + if (pci_enable_device(pci_dev)) + return -EINVAL; + + /* XXX DEV_LABEL is a guess */ + if (!request_region(iobase, HRZ_IO_EXTENT, DEV_LABEL)) { + return -EINVAL; + goto out_disable; + } + + dev = kmalloc(sizeof(hrz_dev), GFP_KERNEL); + if (!dev) { + // perhaps we should be nice: deregister all adapters and abort? + PRINTD(DBG_ERR, "out of memory"); + err = -ENOMEM; + goto out_release; + } + + memset(dev, 0, sizeof(hrz_dev)); + + pci_set_drvdata(pci_dev, dev); + + // grab IRQ and install handler - move this someplace more sensible + irq = pci_dev->irq; + if (request_irq(irq, + interrupt_handler, + SA_SHIRQ, /* irqflags guess */ + DEV_LABEL, /* name guess */ + dev)) { + PRINTD(DBG_WARN, "request IRQ failed!"); + err = -EINVAL; + goto out_free; + } + + PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", + iobase, irq, membase); + + dev->atm_dev = atm_dev_register(DEV_LABEL, &hrz_ops, -1, NULL); + if (!(dev->atm_dev)) { + PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); + err = -EINVAL; + goto out_free_irq; + } + + PRINTD(DBG_INFO, "registered Madge ATM adapter (no. %d) (%p) at %p", + dev->atm_dev->number, dev, dev->atm_dev); dev->atm_dev->dev_data = (void *) dev; dev->pci_dev = pci_dev; - + // enable bus master accesses - pci_set_master (pci_dev); - + pci_set_master(pci_dev); + // frobnicate latency (upwards, usually) - pci_read_config_byte (pci_dev, PCI_LATENCY_TIMER, &lat); + pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &lat); if (pci_lat) { - PRINTD (DBG_INFO, "%s PCI latency timer from %hu to %hu", - "changing", lat, pci_lat); - pci_write_config_byte (pci_dev, PCI_LATENCY_TIMER, pci_lat); + PRINTD(DBG_INFO, "%s PCI latency timer from %hu to %hu", + "changing", lat, pci_lat); + pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat); } else if (lat < MIN_PCI_LATENCY) { - PRINTK (KERN_INFO, "%s PCI latency timer from %hu to %hu", - "increasing", lat, MIN_PCI_LATENCY); - pci_write_config_byte (pci_dev, PCI_LATENCY_TIMER, MIN_PCI_LATENCY); + PRINTK(KERN_INFO, "%s PCI latency timer from %hu to %hu", + "increasing", lat, MIN_PCI_LATENCY); + pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, MIN_PCI_LATENCY); } - + dev->iobase = iobase; dev->irq = irq; dev->membase = membase; - + dev->rx_q_entry = dev->rx_q_reset = &memmap->rx_q_entries[0]; dev->rx_q_wrap = &memmap->rx_q_entries[RX_CHANS-1]; - + // these next three are performance hacks dev->last_vc = -1; dev->tx_last = -1; dev->tx_idle = 0; - + dev->tx_regions = 0; dev->tx_bytes = 0; dev->tx_skb = NULL; dev->tx_iovec = NULL; - + dev->tx_cell_count = 0; dev->rx_cell_count = 0; dev->hec_error_count = 0; dev->unassigned_cell_count = 0; - + dev->noof_spare_buffers = 0; - + { - unsigned int i; - for (i = 0; i < TX_CHANS; ++i) - dev->tx_channel_record[i] = -1; + unsigned int i; + for (i = 0; i < TX_CHANS; ++i) + dev->tx_channel_record[i] = -1; } - + dev->flags = 0; - + // Allocate cell rates and remember ASIC version // Fibre: ATM_OC3_PCR = 1555200000/8/270*260/53 - 29/53 // Copper: (WRONG) we want 6 into the above, close to 25Mb/s // Copper: (plagarise!) 25600000/8/270*260/53 - n/53 - - if (hrz_init (dev)) { - // to be really pedantic, this should be ATM_OC3c_PCR - dev->tx_avail = ATM_OC3_PCR; - dev->rx_avail = ATM_OC3_PCR; - set_bit (ultra, &dev->flags); // NOT "|= ultra" ! + + if (hrz_init(dev)) { + // to be really pedantic, this should be ATM_OC3c_PCR + dev->tx_avail = ATM_OC3_PCR; + dev->rx_avail = ATM_OC3_PCR; + set_bit(ultra, &dev->flags); // NOT "|= ultra" ! } else { - dev->tx_avail = ((25600000/8)*26)/(27*53); - dev->rx_avail = ((25600000/8)*26)/(27*53); - PRINTD (DBG_WARN, "Buggy ASIC: no TX bus-mastering."); + dev->tx_avail = ((25600000/8)*26)/(27*53); + dev->rx_avail = ((25600000/8)*26)/(27*53); + PRINTD(DBG_WARN, "Buggy ASIC: no TX bus-mastering."); } - + // rate changes spinlock - spin_lock_init (&dev->rate_lock); - + spin_lock_init(&dev->rate_lock); + // on-board memory access spinlock; we want atomic reads and // writes to adapter memory (handles IRQ and SMP) - spin_lock_init (&dev->mem_lock); - - init_waitqueue_head (&dev->tx_queue); - + spin_lock_init(&dev->mem_lock); + + init_waitqueue_head(&dev->tx_queue); + // vpi in 0..4, vci in 6..10 dev->atm_dev->ci_range.vpi_bits = vpi_bits; dev->atm_dev->ci_range.vci_bits = 10-vpi_bits; - - // update count and linked list - ++devs; - dev->prev = hrz_devs; - hrz_devs = dev; - // success - continue; - - /* not currently reached */ - atm_dev_deregister (dev->atm_dev); - } /* atm_dev_register */ - free_irq (irq, dev); - - } /* request_irq */ - kfree (dev); - release_region(iobase, HRZ_IO_EXTENT); - } /* kmalloc and while */ - return devs; + + init_timer(&dev->housekeeping); + dev->housekeeping.function = do_housekeeping; + dev->housekeeping.data = (unsigned long) dev; + mod_timer(&dev->housekeeping, jiffies); + +out: + return err; + +out_free_irq: + free_irq(dev->irq, dev); +out_free: + kfree(dev); +out_release: + release_region(iobase, HRZ_IO_EXTENT); +out_disable: + pci_disable_device(pci_dev); + goto out; +} + +static void __devexit hrz_remove_one(struct pci_dev *pci_dev) +{ + hrz_dev *dev; + + dev = pci_get_drvdata(pci_dev); + + PRINTD(DBG_INFO, "closing %p (atm_dev = %p)", dev, dev->atm_dev); + del_timer_sync(&dev->housekeeping); + hrz_reset(dev); + atm_dev_deregister(dev->atm_dev); + free_irq(dev->irq, dev); + release_region(dev->iobase, HRZ_IO_EXTENT); + kfree(dev); + + pci_disable_device(pci_dev); } static void __init hrz_check_args (void) { @@ -2898,22 +2896,35 @@ static void __init hrz_check_args (void) { MODULE_AUTHOR(maintainer_string); MODULE_DESCRIPTION(description_string); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "h"); -MODULE_PARM(vpi_bits, "h"); -MODULE_PARM(max_tx_size, "i"); -MODULE_PARM(max_rx_size, "i"); -MODULE_PARM(pci_lat, "b"); +module_param(debug, ushort, 0644); +module_param(vpi_bits, ushort, 0); +module_param(max_tx_size, int, 0); +module_param(max_rx_size, int, 0); +module_param(pci_lat, byte, 0); MODULE_PARM_DESC(debug, "debug bitmap, see .h file"); MODULE_PARM_DESC(vpi_bits, "number of bits (0..4) to allocate to VPIs"); MODULE_PARM_DESC(max_tx_size, "maximum size of TX AAL5 frames"); MODULE_PARM_DESC(max_rx_size, "maximum size of RX AAL5 frames"); MODULE_PARM_DESC(pci_lat, "PCI latency in bus cycles"); +static struct pci_device_id hrz_pci_tbl[] = { + { PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_HORIZON, PCI_ANY_ID, PCI_ANY_ID, + 0, 0, 0 }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, hrz_pci_tbl); + +static struct pci_driver hrz_driver = { + .name = "horizon", + .probe = hrz_probe, + .remove = __devexit_p(hrz_remove_one), + .id_table = hrz_pci_tbl, +}; + /********** module entry **********/ static int __init hrz_module_init (void) { - int devs; - // sanity check - cast is needed since printk does not support %Zu if (sizeof(struct MEMMAP) != 128*1024/4) { PRINTK (KERN_ERR, "Fix struct MEMMAP (is %lu fakewords).", @@ -2927,44 +2938,15 @@ static int __init hrz_module_init (void) { hrz_check_args(); // get the juice - devs = hrz_probe(); - - if (devs) { - init_timer (&housekeeping); - housekeeping.function = do_housekeeping; - // paranoia - housekeeping.data = 1; - set_timer (&housekeeping, 0); - } else { - PRINTK (KERN_ERR, "no (usable) adapters found"); - } - - return devs ? 0 : -ENODEV; + return pci_module_init(&hrz_driver); } /********** module exit **********/ static void __exit hrz_module_exit (void) { - hrz_dev * dev; PRINTD (DBG_FLOW, "cleanup_module"); - // paranoia - housekeeping.data = 0; - del_timer (&housekeeping); - - while (hrz_devs) { - dev = hrz_devs; - hrz_devs = dev->prev; - - PRINTD (DBG_INFO, "closing %p (atm_dev = %p)", dev, dev->atm_dev); - hrz_reset (dev); - atm_dev_deregister (dev->atm_dev); - free_irq (dev->irq, dev); - release_region (dev->iobase, HRZ_IO_EXTENT); - kfree (dev); - } - - return; + return pci_unregister_driver(&hrz_driver); } module_init(hrz_module_init); diff --git a/drivers/atm/horizon.h b/drivers/atm/horizon.h index ec5ba498d..e2cc7020f 100644 --- a/drivers/atm/horizon.h +++ b/drivers/atm/horizon.h @@ -457,7 +457,7 @@ struct hrz_dev { unsigned long unassigned_cell_count; struct pci_dev * pci_dev; - struct hrz_dev * prev; + struct timer_list housekeeping; }; typedef struct hrz_dev hrz_dev; diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index 0747dbadb..b8c260ed4 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -39,7 +39,7 @@ struct idt77105_priv { unsigned char old_mcr; /* storage of MCR reg while signal lost */ }; -static spinlock_t idt77105_priv_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(idt77105_priv_lock); #define PRIV(dev) ((struct idt77105_priv *) dev->phy_data) @@ -323,7 +323,7 @@ static int idt77105_start(struct atm_dev *dev) } -int idt77105_stop(struct atm_dev *dev) +static int idt77105_stop(struct atm_dev *dev) { struct idt77105_priv *walk, *prev; diff --git a/drivers/atm/idt77105.h b/drivers/atm/idt77105.h index bd542f364..8ba8218aa 100644 --- a/drivers/atm/idt77105.h +++ b/drivers/atm/idt77105.h @@ -77,7 +77,6 @@ #ifdef __KERNEL__ int idt77105_init(struct atm_dev *dev) __init; -int idt77105_stop(struct atm_dev *dev); #endif /* diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 3959cf83e..3d8764ab2 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -1266,8 +1266,9 @@ idt77252_rx_raw(struct idt77252_dev *card) head = IDT77252_PRV_PADDR(queue) + (queue->data - queue->head - 16); tail = readl(SAR_REG_RAWCT); - pci_dma_sync_single(card->pcidev, IDT77252_PRV_PADDR(queue), - queue->end - queue->head - 16, PCI_DMA_FROMDEVICE); + pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue), + queue->end - queue->head - 16, + PCI_DMA_FROMDEVICE); while (head != tail) { unsigned int vpi, vci, pti; @@ -1360,10 +1361,10 @@ drop: if (next) { card->raw_cell_head = next; queue = card->raw_cell_head; - pci_dma_sync_single(card->pcidev, - IDT77252_PRV_PADDR(queue), - queue->end - queue->data, - PCI_DMA_FROMDEVICE); + pci_dma_sync_single_for_cpu(card->pcidev, + IDT77252_PRV_PADDR(queue), + queue->end - queue->data, + PCI_DMA_FROMDEVICE); } else { card->raw_cell_head = NULL; printk("%s: raw cell queue overrun\n", @@ -3135,14 +3136,11 @@ deinit_card(struct idt77252_dev *card) } } - if (card->soft_tst) - vfree(card->soft_tst); + vfree(card->soft_tst); - if (card->scd2vc) - vfree(card->scd2vc); + vfree(card->scd2vc); - if (card->vcs) - vfree(card->vcs); + vfree(card->vcs); if (card->raw_cell_hnd) { pci_free_consistent(card->pcidev, 2 * sizeof(u32), @@ -3168,7 +3166,7 @@ deinit_card(struct idt77252_dev *card) } if (card->membase) - iounmap((void *) card->membase); + iounmap(card->membase); clear_bit(IDT77252_BIT_INIT, &card->flags); DIPRINTK("%s: Card deinitialized.\n", card->name); @@ -3684,9 +3682,9 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) int i, err; - if (pci_enable_device(pcidev)) { + if ((err = pci_enable_device(pcidev))) { printk("idt77252: can't enable PCI device at %s\n", pci_name(pcidev)); - return -ENODEV; + return err; } if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) { @@ -3802,7 +3800,7 @@ err_out_deinit_card: deinit_card(card); err_out_iounmap: - iounmap((void *) card->membase); + iounmap(card->membase); err_out_free_card: kfree(card); @@ -3819,6 +3817,8 @@ static struct pci_device_id idt77252_pci_tbl[] = { 0, } }; +MODULE_DEVICE_TABLE(pci, idt77252_pci_tbl); + static struct pci_driver idt77252_driver = { .name = "idt77252", .id_table = idt77252_pci_tbl, @@ -3840,11 +3840,7 @@ static int __init idt77252_init(void) return -EIO; } - if (pci_register_driver(&idt77252_driver) > 0) - return 0; - - pci_unregister_driver(&idt77252_driver); - return -ENODEV; + return pci_register_driver(&idt77252_driver); } static void __exit idt77252_exit(void) @@ -3874,10 +3870,10 @@ module_exit(idt77252_exit); MODULE_LICENSE("GPL"); -MODULE_PARM(vpibits, "i"); +module_param(vpibits, uint, 0); MODULE_PARM_DESC(vpibits, "number of VPI bits supported (0, 1, or 2)"); #ifdef CONFIG_ATM_IDT77252_DEBUG -MODULE_PARM(debug, "i"); +module_param(debug, ulong, 0644); MODULE_PARM_DESC(debug, "debug bitmap, see drivers/atm/idt77252.h"); #endif diff --git a/drivers/atm/idt77252.h b/drivers/atm/idt77252.h index cfdd15e7d..544b39738 100644 --- a/drivers/atm/idt77252.h +++ b/drivers/atm/idt77252.h @@ -275,7 +275,7 @@ struct rsq_info { struct rsq_entry *next; struct rsq_entry *last; dma_addr_t paddr; -} rsq_info; +}; /*****************************************************************************/ diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 0c8395cfb..ce9202eed 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -72,23 +73,23 @@ struct suni_priv { #define PRIV(dev) ((struct suni_priv *) dev->phy_data) static unsigned char ia_phy_get(struct atm_dev *dev, unsigned long addr); +static void desc_dbg(IADEV *iadev); static IADEV *ia_dev[8]; static struct atm_dev *_ia_dev[8]; static int iadev_count; static void ia_led_timer(unsigned long arg); static struct timer_list ia_timer = TIMER_INITIALIZER(ia_led_timer, 0, 0); -struct atm_vcc *vcc_close_que[100]; static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ; static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ; -static u32 IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER +static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER |IF_IADBG_ABR | IF_IADBG_EVENT*/ 0; -MODULE_PARM(IA_TX_BUF, "i"); -MODULE_PARM(IA_TX_BUF_SZ, "i"); -MODULE_PARM(IA_RX_BUF, "i"); -MODULE_PARM(IA_RX_BUF_SZ, "i"); -MODULE_PARM(IADebugFlag, "i"); +module_param(IA_TX_BUF, int, 0); +module_param(IA_TX_BUF_SZ, int, 0); +module_param(IA_RX_BUF, int, 0); +module_param(IA_RX_BUF_SZ, int, 0); +module_param(IADebugFlag, uint, 0644); MODULE_LICENSE("GPL"); @@ -147,7 +148,6 @@ static void ia_hack_tcq(IADEV *dev) { u_short desc1; u_short tcq_wr; struct ia_vcc *iavcc_r = NULL; - extern void desc_dbg(IADEV *iadev); tcq_wr = readl(dev->seg_reg+TCQ_WR_PTR) & 0xffff; while (dev->host_tcq_wr != tcq_wr) { @@ -187,7 +187,6 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) { unsigned long delta; static unsigned long timer = 0; int ltimeout; - extern void desc_dbg(IADEV *iadev); ia_hack_tcq (dev); if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){ @@ -615,12 +614,13 @@ static int ia_avail_descs(IADEV *iadev) { return tmp; } +static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb); + static int ia_que_tx (IADEV *iadev) { struct sk_buff *skb; int num_desc; struct atm_vcc *vcc; struct ia_vcc *iavcc; - static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb); num_desc = ia_avail_descs(iadev); while (num_desc && (skb = skb_dequeue(&iadev->tx_backlog))) { @@ -643,7 +643,7 @@ static int ia_que_tx (IADEV *iadev) { return 0; } -void ia_tx_poll (IADEV *iadev) { +static void ia_tx_poll (IADEV *iadev) { struct atm_vcc *vcc = NULL; struct sk_buff *skb = NULL, *skb1 = NULL; struct ia_vcc *iavcc; @@ -860,7 +860,7 @@ static void IaFrontEndIntr(IADEV *iadev) { return; } -void ia_mb25_init (IADEV *iadev) +static void ia_mb25_init (IADEV *iadev) { volatile ia_mb25_t *mb25 = (ia_mb25_t*)iadev->phy; #if 0 @@ -875,7 +875,7 @@ void ia_mb25_init (IADEV *iadev) return; } -void ia_suni_pm7345_init (IADEV *iadev) +static void ia_suni_pm7345_init (IADEV *iadev) { volatile suni_pm7345_t *suni_pm7345 = (suni_pm7345_t *)iadev->phy; if (iadev->phy_type & FE_DS3_PHY) @@ -958,9 +958,8 @@ void ia_suni_pm7345_init (IADEV *iadev) /***************************** IA_LIB END *****************************/ -/* pwang_test debug utility */ -int tcnter = 0, rcnter = 0; -void xdump( u_char* cp, int length, char* prefix ) +static int tcnter = 0; +static void xdump( u_char* cp, int length, char* prefix ) { int col, count; u_char prntBuf[120]; @@ -1007,10 +1006,11 @@ static struct atm_dev *ia_boards = NULL; /*-- some utilities and memory allocation stuff will come here -------------*/ -void desc_dbg(IADEV *iadev) { +static void desc_dbg(IADEV *iadev) { u_short tcq_wr_ptr, tcq_st_ptr, tcq_ed_ptr; - u32 tmp, i; + u32 i; + void __iomem *tmp; // regval = readl((u32)ia_cmds->maddr); tcq_wr_ptr = readw(iadev->seg_reg+TCQ_WR_PTR); printk("B_tcq_wr = 0x%x desc = %d last desc = %d\n", @@ -1024,7 +1024,7 @@ void desc_dbg(IADEV *iadev) { i = 0; while (tcq_st_ptr != tcq_ed_ptr) { tmp = iadev->seg_ram+tcq_st_ptr; - printk("TCQ slot %d desc = %d Addr = 0x%x\n", i++, readw(tmp), tmp); + printk("TCQ slot %d desc = %d Addr = %p\n", i++, readw(tmp), tmp); tcq_st_ptr += 2; } for(i=0; i num_tx_desc; i++) @@ -1080,7 +1080,7 @@ static int rx_pkt(struct atm_dev *dev) IADEV *iadev; struct atm_vcc *vcc; unsigned short status; - struct rx_buf_desc *buf_desc_ptr; + struct rx_buf_desc __iomem *buf_desc_ptr; int desc; struct dle* wr_ptr; int len; @@ -1095,7 +1095,7 @@ static int rx_pkt(struct atm_dev *dev) } /* mask 1st 3 bits to get the actual descno. */ desc = readw(iadev->reass_ram+iadev->rfL.pcq_rd) & 0x1fff; - IF_RX(printk("reass_ram = 0x%x iadev->rfL.pcq_rd = 0x%x desc = %d\n", + IF_RX(printk("reass_ram = %p iadev->rfL.pcq_rd = 0x%x desc = %d\n", iadev->reass_ram, iadev->rfL.pcq_rd, desc); printk(" pcq_wr_ptr = 0x%x\n", readw(iadev->reass_reg+PCQ_WR_PTR)&0xffff);) @@ -1109,7 +1109,7 @@ static int rx_pkt(struct atm_dev *dev) /* get the buffer desc entry. update stuff. - doesn't seem to be any update necessary */ - buf_desc_ptr = (struct rx_buf_desc *)iadev->RX_DESC_BASE_ADDR; + buf_desc_ptr = iadev->RX_DESC_BASE_ADDR; /* make the ptr point to the corresponding buffer desc entry */ buf_desc_ptr += desc; if (!desc || (desc > iadev->num_rx_desc) || @@ -1358,8 +1358,8 @@ INCR_DLE: static int open_rx(struct atm_vcc *vcc) { IADEV *iadev; - u_short *vc_table; - u_short *reass_ptr; + u_short __iomem *vc_table; + u_short __iomem *reass_ptr; IF_EVENT(printk("iadev: open_rx %d.%d\n", vcc->vpi, vcc->vci);) if (vcc->qos.rxtp.traffic_class == ATM_NONE) return 0; @@ -1372,8 +1372,8 @@ static int open_rx(struct atm_vcc *vcc) } /* Make only this VCI in the vc table valid and let all others be invalid entries */ - vc_table = (u_short *)(iadev->reass_ram+RX_VC_TABLE*iadev->memSize); - vc_table += vcc->vci; + vc_table = iadev->reass_ram+RX_VC_TABLE*iadev->memSize; + vc_table += vcc->vci; /* mask the last 6 bits and OR it with 3 for 1K VCs */ *vc_table = vcc->vci << 6; @@ -1387,9 +1387,8 @@ static int open_rx(struct atm_vcc *vcc) ia_open_abr_vc(iadev, &srv_p, vcc, 0); } else { /* for UBR later may need to add CBR logic */ - reass_ptr = (u_short *) - (iadev->reass_ram+REASS_TABLE*iadev->memSize); - reass_ptr += vcc->vci; + reass_ptr = iadev->reass_ram+REASS_TABLE*iadev->memSize; + reass_ptr += vcc->vci; *reass_ptr = NO_AAL5_PKT; } @@ -1403,7 +1402,7 @@ static int open_rx(struct atm_vcc *vcc) static int rx_init(struct atm_dev *dev) { IADEV *iadev; - struct rx_buf_desc *buf_desc_ptr; + struct rx_buf_desc __iomem *buf_desc_ptr; unsigned long rx_pkt_start = 0; void *dle_addr; struct abr_vc_table *abr_vc_table; @@ -1465,13 +1464,13 @@ static int rx_init(struct atm_dev *dev) /* Initialize each entry in the Buffer Descriptor Table */ iadev->RX_DESC_BASE_ADDR = iadev->reass_ram+RX_DESC_BASE*iadev->memSize; - buf_desc_ptr =(struct rx_buf_desc *)iadev->RX_DESC_BASE_ADDR; - memset((caddr_t)buf_desc_ptr, 0, sizeof(*buf_desc_ptr)); + buf_desc_ptr = iadev->RX_DESC_BASE_ADDR; + memset_io(buf_desc_ptr, 0, sizeof(*buf_desc_ptr)); buf_desc_ptr++; rx_pkt_start = iadev->rx_pkt_ram; for(i=1; i<=iadev->num_rx_desc; i++) { - memset((caddr_t)buf_desc_ptr, 0, sizeof(*buf_desc_ptr)); + memset_io(buf_desc_ptr, 0, sizeof(*buf_desc_ptr)); buf_desc_ptr->buf_start_hi = rx_pkt_start >> 16; buf_desc_ptr->buf_start_lo = rx_pkt_start & 0x0000ffff; buf_desc_ptr++; @@ -2053,10 +2052,9 @@ static int tx_init(struct atm_dev *dev) 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));) - tmp16 = (iadev->seg_ram+CBR_SCHED_TABLE*iadev->memSize); /* Initialize the CBR Schedualing Table */ - memset((caddr_t)(iadev->seg_ram+CBR_SCHED_TABLE*iadev->memSize), + memset_io(iadev->seg_ram+CBR_SCHED_TABLE*iadev->memSize, 0, iadev->num_vc*6); iadev->CbrRemEntries = iadev->CbrTotEntries = iadev->num_vc*3; iadev->CbrEntryPt = 0; @@ -2287,7 +2285,8 @@ static int reset_sar(struct atm_dev *dev) static int __init ia_init(struct atm_dev *dev) { IADEV *iadev; - unsigned long real_base, base; + unsigned long real_base; + void __iomem *base; unsigned short command; unsigned char revision; int error, i; @@ -2343,7 +2342,7 @@ static int __init ia_init(struct atm_dev *dev) udelay(10); /* mapping the physical address to a virtual address in address space */ - base=(unsigned long)ioremap((unsigned long)real_base,iadev->pci_map_size); /* ioremap is not resolved ??? */ + base = ioremap(real_base,iadev->pci_map_size); /* ioremap is not resolved ??? */ if (!base) { @@ -2351,39 +2350,38 @@ static int __init ia_init(struct atm_dev *dev) dev->number); return error; } - IF_INIT(printk(DEV_LABEL " (itf %d): rev.%d,base=0x%lx,irq=%d\n", + IF_INIT(printk(DEV_LABEL " (itf %d): rev.%d,base=%p,irq=%d\n", dev->number, revision, base, iadev->irq);) /* filling the iphase dev structure */ iadev->mem = iadev->pci_map_size /2; - iadev->base_diff = real_base - base; iadev->real_base = real_base; iadev->base = base; /* Bus Interface Control Registers */ - iadev->reg = (u32 *) (base + REG_BASE); + iadev->reg = base + REG_BASE; /* Segmentation Control Registers */ - iadev->seg_reg = (u32 *) (base + SEG_BASE); + iadev->seg_reg = base + SEG_BASE; /* Reassembly Control Registers */ - iadev->reass_reg = (u32 *) (base + REASS_BASE); + iadev->reass_reg = base + REASS_BASE; /* Front end/ DMA control registers */ - iadev->phy = (u32 *) (base + PHY_BASE); - iadev->dma = (u32 *) (base + PHY_BASE); + iadev->phy = base + PHY_BASE; + iadev->dma = base + PHY_BASE; /* RAM - Segmentation RAm and Reassembly RAM */ - iadev->ram = (u32 *) (base + ACTUAL_RAM_BASE); - iadev->seg_ram = (base + ACTUAL_SEG_RAM_BASE); - iadev->reass_ram = (base + ACTUAL_REASS_RAM_BASE); + iadev->ram = base + ACTUAL_RAM_BASE; + iadev->seg_ram = base + ACTUAL_SEG_RAM_BASE; + iadev->reass_ram = base + ACTUAL_REASS_RAM_BASE; /* lets print out the above */ - IF_INIT(printk("Base addrs: %08x %08x %08x \n %08x %08x %08x %08x\n", - (u32)iadev->reg,(u32)iadev->seg_reg,(u32)iadev->reass_reg, - (u32)iadev->phy, (u32)iadev->ram, (u32)iadev->seg_ram, - (u32)iadev->reass_ram);) + IF_INIT(printk("Base addrs: %p %p %p \n %p %p %p %p\n", + iadev->reg,iadev->seg_reg,iadev->reass_reg, + iadev->phy, iadev->ram, iadev->seg_ram, + iadev->reass_ram);) /* lets try reading the MAC address */ error = get_esi(dev); if (error) { - iounmap((void *) iadev->base); + iounmap(iadev->base); return error; } printk("IA: "); @@ -2393,7 +2391,7 @@ static int __init ia_init(struct atm_dev *dev) /* reset SAR */ if (reset_sar(dev)) { - iounmap((void *) iadev->base); + iounmap(iadev->base); printk("IA: reset SAR fail, please try again\n"); return 1; } @@ -2589,14 +2587,14 @@ err_out: } static void ia_close(struct atm_vcc *vcc) -{ +{ + DEFINE_WAIT(wait); u16 *vc_table; IADEV *iadev; struct ia_vcc *ia_vcc; struct sk_buff *skb = NULL; struct sk_buff_head tmp_tx_backlog, tmp_vcc_backlog; unsigned long closetime, flags; - int ctimeout; iadev = INPH_IA_DEV(vcc->dev); ia_vcc = INPH_IA_VCC(vcc); @@ -2609,7 +2607,9 @@ static void ia_close(struct atm_vcc *vcc) skb_queue_head_init (&tmp_vcc_backlog); if (vcc->qos.txtp.traffic_class != ATM_NONE) { iadev->close_pending++; - sleep_on_timeout(&iadev->timeout_wait, 50); + prepare_to_wait(&iadev->timeout_wait, &wait, TASK_UNINTERRUPTIBLE); + schedule_timeout(50); + finish_wait(&iadev->timeout_wait, &wait); spin_lock_irqsave(&iadev->tx_lock, flags); while((skb = skb_dequeue(&iadev->tx_backlog))) { if (ATM_SKB(skb)->vcc == vcc){ @@ -2622,17 +2622,12 @@ static void ia_close(struct atm_vcc *vcc) while((skb = skb_dequeue(&tmp_tx_backlog))) skb_queue_tail(&iadev->tx_backlog, skb); IF_EVENT(printk("IA TX Done decs_cnt = %d\n", ia_vcc->vc_desc_cnt);) - closetime = jiffies; - ctimeout = 300000 / ia_vcc->pcr; - if (ctimeout == 0) - ctimeout = 1; - while (ia_vcc->vc_desc_cnt > 0){ - if ((jiffies - closetime) >= ctimeout) - break; - spin_unlock_irqrestore(&iadev->tx_lock, flags); - sleep_on(&iadev->close_wait); - spin_lock_irqsave(&iadev->tx_lock, flags); - } + closetime = 300000 / ia_vcc->pcr; + if (closetime == 0) + closetime = 1; + spin_unlock_irqrestore(&iadev->tx_lock, flags); + wait_event_timeout(iadev->close_wait, (ia_vcc->vc_desc_cnt <= 0), closetime); + spin_lock_irqsave(&iadev->tx_lock, flags); iadev->close_pending--; iadev->testTable[vcc->vci]->lastTime = 0; iadev->testTable[vcc->vci]->fract = 0; @@ -2659,7 +2654,7 @@ static void ia_close(struct atm_vcc *vcc) vc_table += vcc->vci; *vc_table = (vcc->vci << 6) | 15; if (vcc->qos.rxtp.traffic_class == ATM_ABR) { - struct abr_vc_table *abr_vc_table = (struct abr_vc_table *) + struct abr_vc_table __iomem *abr_vc_table = (iadev->reass_ram+ABR_VC_TABLE*iadev->memSize); abr_vc_table += vcc->vci; abr_vc_table->rdf = 0x0003; @@ -2890,7 +2885,7 @@ static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname, static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { IADEV *iadev; struct dle *wr_ptr; - struct tx_buf_desc *buf_desc_ptr; + struct tx_buf_desc __iomem *buf_desc_ptr; int desc; int comp_code; int total_len; @@ -2994,7 +2989,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { printk("\n");) /* Build the buffer descriptor */ - buf_desc_ptr = (struct tx_buf_desc *)(iadev->seg_ram+TX_DESC_BASE); + buf_desc_ptr = iadev->seg_ram+TX_DESC_BASE; buf_desc_ptr += desc; /* points to the corresponding entry */ buf_desc_ptr->desc_mode = AAL5 | EOM_EN | APP_CRC32 | CMPL_INT; /* Huh ? p.115 of users guide describes this as a read-only register */ @@ -3252,7 +3247,7 @@ static void __devexit ia_remove_one(struct pci_dev *pdev) atm_dev_deregister(dev); IF_EVENT(printk("iav deregistered at (itf:%d)\n", dev->number);) - iounmap((void *) iadev->base); + iounmap(iadev->base); pci_disable_device(pdev); ia_free_rx(iadev); diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h index 9da028683..b8d0bd4d6 100644 --- a/drivers/atm/iphase.h +++ b/drivers/atm/iphase.h @@ -996,18 +996,18 @@ typedef struct _SUNI_STATS_ typedef struct iadev_t { /*-----base pointers into (i)chipSAR+ address space */ - u32 *phy; /* base pointer into phy(SUNI) */ - u32 *dma; /* base pointer into DMA control + u32 __iomem *phy; /* base pointer into phy(SUNI) */ + u32 __iomem *dma; /* base pointer into DMA control registers */ - u32 *reg; /* base pointer to SAR registers + u32 __iomem *reg; /* base pointer to SAR registers - Bus Interface Control Regs */ - u32 *seg_reg; /* base pointer to segmentation engine + u32 __iomem *seg_reg; /* base pointer to segmentation engine internal registers */ - u32 *reass_reg; /* base pointer to reassemble engine + u32 __iomem *reass_reg; /* base pointer to reassemble engine internal registers */ - u32 *ram; /* base pointer to SAR RAM */ - unsigned int seg_ram; - unsigned int reass_ram; + u32 __iomem *ram; /* base pointer to SAR RAM */ + void __iomem *seg_ram; + void __iomem *reass_ram; struct dle_q tx_dle_q; struct free_desc_q *tx_free_desc_qhead; struct sk_buff_head tx_dma_q, tx_backlog; @@ -1019,7 +1019,7 @@ typedef struct iadev_t { struct cpcs_trailer_desc *tx_buf; u16 num_tx_desc, tx_buf_sz, rate_limit; u32 tx_cell_cnt, tx_pkt_cnt; - u32 MAIN_VC_TABLE_ADDR, EXT_VC_TABLE_ADDR, ABR_SCHED_TABLE_ADDR; + void __iomem *MAIN_VC_TABLE_ADDR, *EXT_VC_TABLE_ADDR, *ABR_SCHED_TABLE_ADDR; struct dle_q rx_dle_q; struct free_desc_q *rx_free_desc_qhead; struct sk_buff_head rx_dma_q; @@ -1027,13 +1027,13 @@ typedef struct iadev_t { struct atm_vcc **rx_open; /* list of all open VCs */ u16 num_rx_desc, rx_buf_sz, rxing; u32 rx_pkt_ram, rx_tmp_cnt, rx_tmp_jif; - u32 RX_DESC_BASE_ADDR; + void __iomem *RX_DESC_BASE_ADDR; u32 drop_rxpkt, drop_rxcell, rx_cell_cnt, rx_pkt_cnt; struct atm_dev *next_board; /* other iphase devices */ struct pci_dev *pci; int mem; - unsigned long base_diff; /* virtual - real base address */ - unsigned int real_base, base; /* real and virtual base address */ + unsigned int real_base; /* real and virtual base address */ + void __iomem *base; unsigned int pci_map_size; /*pci map size of board */ unsigned char irq; unsigned char bus; @@ -1126,8 +1126,6 @@ typedef struct { #define FE_DS3_PHY 0x0080 /* DS3 */ #define FE_E3_PHY 0x0090 /* E3 */ -extern void ia_mb25_init (IADEV *); - /*********************** SUNI_PM7345 PHY DEFINE HERE *********************/ typedef struct _suni_pm7345_t { @@ -1326,8 +1324,6 @@ typedef struct _suni_pm7345_t #define SUNI_DS3_FOVRI 0x02 /* FIFO overrun */ #define SUNI_DS3_FUDRI 0x01 /* FIFO underrun */ -extern void ia_suni_pm7345_init (IADEV *iadev); - ///////////////////SUNI_PM7345 PHY DEFINE END ///////////////////////////// /* ia_eeprom define*/ diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index e23d3f714..c5c4a89bc 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1481,7 +1481,7 @@ static inline struct lanai_vcc *new_lanai_vcc(void) struct lanai_vcc *lvcc; lvcc = (struct lanai_vcc *) kmalloc(sizeof(*lvcc), GFP_KERNEL); if (likely(lvcc != NULL)) { - lvcc->vbase = 0; + lvcc->vbase = NULL; lvcc->rx.atmvcc = lvcc->tx.atmvcc = NULL; lvcc->nref = 0; memset(&lvcc->stats, 0, sizeof lvcc->stats); @@ -1565,7 +1565,7 @@ static inline void host_vcc_unbind(struct lanai_dev *lanai, if (lvcc->vbase == 0) return; /* This vcc was never bound */ DPRINTK("Unbinding vci %d\n", lvcc->vci); - lvcc->vbase = 0; + lvcc->vbase = NULL; lanai->vccs[lvcc->vci] = NULL; #ifdef USE_POWERDOWN if (--lanai->nbound == 0) { @@ -2279,7 +2279,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev) lanai->conf1 = reg_read(lanai, Config1_Reg) | CONFIG1_POWERDOWN; conf1_write(lanai); #endif - iounmap((void *) lanai->base); + iounmap(lanai->base); error_pci: pci_disable_device(lanai->pci); error: @@ -2309,7 +2309,7 @@ static void lanai_dev_close(struct atm_dev *atmdev) pci_disable_device(lanai->pci); vcc_table_deallocate(lanai); service_buffer_deallocate(lanai); - iounmap((void *) lanai->base); + iounmap(lanai->base); kfree(lanai); } diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 3f18782bd..d99aede28 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -54,7 +54,6 @@ #include #include #include "nicstar.h" -#include "nicstarmac.h" #ifdef CONFIG_ATM_NICSTAR_USE_SUNI #include "suni.h" #endif /* CONFIG_ATM_NICSTAR_USE_SUNI */ @@ -267,7 +266,7 @@ static struct atmdev_ops atm_ops = }; static struct timer_list ns_timer; static char *mac[NS_MAX_CARDS]; -MODULE_PARM(mac, "1-" __MODULE_STRING(NS_MAX_CARDS) "s"); +module_param_array(mac, charp, NULL, 0); MODULE_LICENSE("GPL"); diff --git a/drivers/atm/nicstarmac.c b/drivers/atm/nicstarmac.c index 7a842ef71..2c5e3ae77 100644 --- a/drivers/atm/nicstarmac.c +++ b/drivers/atm/nicstarmac.c @@ -7,6 +7,8 @@ * Read this ForeRunner's MAC address from eprom/eeprom */ +typedef void __iomem *virt_addr_t; + #define CYCLE_DELAY 5 /* This was the original definition @@ -35,6 +37,7 @@ #define SI_LOW 0x0000 /* Serial input data low */ /* Read Status Register = 0000 0101b */ +#if 0 static u_int32_t rdsrtab[] = { CS_HIGH | CLK_HIGH, @@ -55,6 +58,7 @@ static u_int32_t rdsrtab[] = CLK_LOW | SI_HIGH, CLK_HIGH | SI_HIGH /* 1 */ }; +#endif /* 0 */ /* Read from EEPROM = 0000 0011b */ @@ -117,7 +121,7 @@ static u_int32_t clocktab[] = * eeprom, then pull the result from bit 16 of the NicSTaR's General Purpose * register. */ - +#if 0 u_int32_t nicstar_read_eprom_status( virt_addr_t base ) { @@ -153,6 +157,7 @@ nicstar_read_eprom_status( virt_addr_t base ) osp_MicroDelay( CYCLE_DELAY ); return rbyte; } +#endif /* 0 */ /* @@ -210,7 +215,7 @@ read_eprom_byte(virt_addr_t base, u_int8_t offset) } -void +static void nicstar_init_eprom( virt_addr_t base ) { u_int32_t val; @@ -243,7 +248,7 @@ nicstar_init_eprom( virt_addr_t base ) * above. */ -void +static void nicstar_read_eprom( virt_addr_t base, u_int8_t prom_offset, diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c index 678df9418..06817dec0 100644 --- a/drivers/atm/suni.c +++ b/drivers/atm/suni.c @@ -48,7 +48,7 @@ struct suni_priv { static struct timer_list poll_timer; static struct suni_priv *sunis = NULL; -static spinlock_t sunis_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sunis_lock); #define ADD_LIMITED(s,v) \ diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 88d548a18..2d26075ea 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,8 @@ * - OAM */ +#define ZATM_COPPER 1 + #if 0 #define DPRINTK(format,args...) printk(KERN_DEBUG format,##args) #else @@ -865,31 +868,21 @@ static void close_tx(struct atm_vcc *vcc) struct zatm_vcc *zatm_vcc; unsigned long flags; int chan; -struct sk_buff *skb; -int once = 1; zatm_vcc = ZATM_VCC(vcc); zatm_dev = ZATM_DEV(vcc->dev); chan = zatm_vcc->tx_chan; if (!chan) return; DPRINTK("close_tx\n"); - while (skb_peek(&zatm_vcc->backlog)) { -if (once) { -printk("waiting for backlog to drain ...\n"); -event_dump(); -once = 0; -} - sleep_on(&zatm_vcc->tx_wait); + if (skb_peek(&zatm_vcc->backlog)) { + printk("waiting for backlog to drain ...\n"); + event_dump(); + wait_event(zatm_vcc->tx_wait, !skb_peek(&zatm_vcc->backlog)); } -once = 1; - while ((skb = skb_peek(&zatm_vcc->tx_queue))) { -if (once) { -printk("waiting for TX queue to drain ... %p\n",skb); -event_dump(); -once = 0; -} - DPRINTK("waiting for TX queue to drain ... %p\n",skb); - sleep_on(&zatm_vcc->tx_wait); + if (skb_peek(&zatm_vcc->tx_queue)) { + printk("waiting for TX queue to drain ...\n"); + event_dump(); + wait_event(zatm_vcc->tx_wait, !skb_peek(&zatm_vcc->tx_queue)); } spin_lock_irqsave(&zatm_dev->lock, flags); #if 0 @@ -1577,51 +1570,77 @@ static const struct atmdev_ops ops = { .change_qos = zatm_change_qos, }; -static int __init zatm_module_init(void) +static int __devinit zatm_init_one(struct pci_dev *pci_dev, + const struct pci_device_id *ent) { struct atm_dev *dev; struct zatm_dev *zatm_dev; - int devs,type; - - zatm_dev = (struct zatm_dev *) kmalloc(sizeof(struct zatm_dev), - GFP_KERNEL); - if (!zatm_dev) return -ENOMEM; - devs = 0; - for (type = 0; type < 2; type++) { - struct pci_dev *pci_dev; - - pci_dev = NULL; - while ((pci_dev = pci_find_device(PCI_VENDOR_ID_ZEITNET,type ? - PCI_DEVICE_ID_ZEITNET_1225 : PCI_DEVICE_ID_ZEITNET_1221, - pci_dev))) { - if (pci_enable_device(pci_dev)) break; - dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL); - if (!dev) break; - zatm_dev->pci_dev = pci_dev; - dev->dev_data = zatm_dev; - zatm_dev->copper = type; - if (zatm_init(dev) || zatm_start(dev)) { - atm_dev_deregister(dev); - break; - } - zatm_dev->more = zatm_boards; - zatm_boards = dev; - devs++; - zatm_dev = (struct zatm_dev *) kmalloc(sizeof(struct - zatm_dev),GFP_KERNEL); - if (!zatm_dev) { - printk(KERN_EMERG "zatm.c: memory shortage\n"); - goto out; - } - } + int ret = -ENOMEM; + + zatm_dev = (struct zatm_dev *) kmalloc(sizeof(*zatm_dev), GFP_KERNEL); + if (!zatm_dev) { + printk(KERN_EMERG "%s: memory shortage\n", DEV_LABEL); + goto out; } + + dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); + if (!dev) + goto out_free; + + ret = pci_enable_device(pci_dev); + if (ret < 0) + goto out_deregister; + + ret = pci_request_regions(pci_dev, DEV_LABEL); + if (ret < 0) + goto out_disable; + + zatm_dev->pci_dev = pci_dev; + dev->dev_data = zatm_dev; + zatm_dev->copper = (int)ent->driver_data; + if ((ret = zatm_init(dev)) || (ret = zatm_start(dev))) + goto out_release; + + pci_set_drvdata(pci_dev, dev); + zatm_dev->more = zatm_boards; + zatm_boards = dev; + ret = 0; out: + return ret; + +out_release: + pci_release_regions(pci_dev); +out_disable: + pci_disable_device(pci_dev); +out_deregister: + atm_dev_deregister(dev); +out_free: kfree(zatm_dev); - - return 0; + goto out; } + MODULE_LICENSE("GPL"); -module_init(zatm_module_init); +static struct pci_device_id zatm_pci_tbl[] __devinitdata = { + { PCI_VENDOR_ID_ZEITNET, PCI_DEVICE_ID_ZEITNET_1221, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, ZATM_COPPER }, + { PCI_VENDOR_ID_ZEITNET, PCI_DEVICE_ID_ZEITNET_1225, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0, } +}; +MODULE_DEVICE_TABLE(pci, zatm_pci_tbl); + +static struct pci_driver zatm_driver = { + .name = DEV_LABEL, + .id_table = zatm_pci_tbl, + .probe = zatm_init_one, +}; + +static int __init zatm_init_module(void) +{ + return pci_module_init(&zatm_driver); +} + +module_init(zatm_init_module); /* module_exit not defined so not unloadable */ diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 0a160b2a5..934149c15 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -14,13 +14,13 @@ config PREVENT_FIRMWARE_BUILD default y help Say yes to avoid building firmware. Firmware is usually shipped - with the driver, and only when updating the firware a rebuild + with the driver, and only when updating the firmware a rebuild should be made. If unsure say Y here. config FW_LOADER tristate "Hotplug firmware loading support" - depends on HOTPLUG + select HOTPLUG ---help--- This option is provided for the case where no in-kernel-tree modules require hotplug firmware loading support, but a module built outside diff --git a/drivers/base/Makefile b/drivers/base/Makefile index c83abfa20..6662b545e 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -2,7 +2,8 @@ obj-y := core.o sys.o interface.o bus.o \ driver.o class.o class_simple.o platform.o \ - cpu.o firmware.o init.o map.o dmapool.o + cpu.o firmware.o init.o map.o dmapool.o \ + attribute_container.o transport_class.o obj-y += power/ obj-$(CONFIG_FW_LOADER) += firmware_class.o obj-$(CONFIG_NUMA) += node.o diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 12701407b..3da24059b 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -135,6 +135,52 @@ static struct kobj_type ktype_bus = { decl_subsys(bus, &ktype_bus, NULL); +static int __bus_for_each_dev(struct bus_type *bus, struct device *start, + void *data, int (*fn)(struct device *, void *)) +{ + struct list_head *head; + struct device *dev; + int error = 0; + + if (!(bus = get_bus(bus))) + return -EINVAL; + + head = &bus->devices.list; + dev = list_prepare_entry(start, head, bus_list); + list_for_each_entry_continue(dev, head, bus_list) { + get_device(dev); + error = fn(dev, data); + put_device(dev); + if (error) + break; + } + put_bus(bus); + return error; +} + +static int __bus_for_each_drv(struct bus_type *bus, struct device_driver *start, + void * data, int (*fn)(struct device_driver *, void *)) +{ + struct list_head *head; + struct device_driver *drv; + int error = 0; + + if (!(bus = get_bus(bus))) + return -EINVAL; + + head = &bus->drivers.list; + drv = list_prepare_entry(start, head, kobj.entry); + list_for_each_entry_continue(drv, head, kobj.entry) { + get_driver(drv); + error = fn(drv, data); + put_driver(drv); + if (error) + break; + } + put_bus(bus); + return error; +} + /** * bus_for_each_dev - device iterator. * @bus: bus type. @@ -154,30 +200,16 @@ decl_subsys(bus, &ktype_bus, NULL); * to retain this data, it should do, and increment the reference * count in the supplied callback. */ + int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, int (*fn)(struct device *, void *)) { - struct device *dev; - struct list_head * head; - int error = 0; - - if (!(bus = get_bus(bus))) - return -EINVAL; - - head = &bus->devices.list; - dev = list_prepare_entry(start, head, bus_list); + int ret; down_read(&bus->subsys.rwsem); - list_for_each_entry_continue(dev, head, bus_list) { - get_device(dev); - error = fn(dev, data); - put_device(dev); - if (error) - break; - } + ret = __bus_for_each_dev(bus, start, data, fn); up_read(&bus->subsys.rwsem); - put_bus(bus); - return error; + return ret; } /** @@ -203,34 +235,19 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start, int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, void * data, int (*fn)(struct device_driver *, void *)) { - struct list_head * head; - struct device_driver *drv; - int error = 0; - - if(!(bus = get_bus(bus))) - return -EINVAL; - - head = &bus->drivers.list; - drv = list_prepare_entry(start, head, kobj.entry); + int ret; down_read(&bus->subsys.rwsem); - list_for_each_entry_continue(drv, head, kobj.entry) { - get_driver(drv); - error = fn(drv, data); - put_driver(drv); - if(error) - break; - } + ret = __bus_for_each_drv(bus, start, data, fn); up_read(&bus->subsys.rwsem); - put_bus(bus); - return error; + return ret; } /** * device_bind_driver - bind a driver to one device. * @dev: device. * - * Allow manual attachment of a driver to a deivce. + * Allow manual attachment of a driver to a device. * Caller must have already set @dev->driver. * * Note that this does not modify the bus reference count @@ -246,38 +263,40 @@ void device_bind_driver(struct device * dev) list_add_tail(&dev->driver_list, &dev->driver->devices); sysfs_create_link(&dev->driver->kobj, &dev->kobj, kobject_name(&dev->kobj)); + sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver"); } /** - * bus_match - check compatibility between device & driver. - * @dev: device. + * driver_probe_device - attempt to bind device & driver. * @drv: driver. + * @dev: device. * - * First, we call the bus's match function, which should compare - * the device IDs the driver supports with the device IDs of the - * device. Note we don't do this ourselves because we don't know - * the format of the ID structures, nor what is to be considered - * a match and what is not. + * First, we call the bus's match function, if one present, which + * should compare the device IDs the driver supports with the + * device IDs of the device. Note we don't do this ourselves + * because we don't know the format of the ID structures, nor what + * is to be considered a match and what is not. * * If we find a match, we call @drv->probe(@dev) if it exists, and - * call attach() above. + * call device_bind_driver() above. */ -static int bus_match(struct device * dev, struct device_driver * drv) -{ - int error = -ENODEV; - if (dev->bus->match(dev, drv)) { - dev->driver = drv; - if (drv->probe) { - if ((error = drv->probe(dev))) { - dev->driver = NULL; - return error; - } +int driver_probe_device(struct device_driver * drv, struct device * dev) +{ + if (drv->bus->match && !drv->bus->match(dev, drv)) + return -ENODEV; + + dev->driver = drv; + if (drv->probe) { + int error = drv->probe(dev); + if (error) { + dev->driver = NULL; + return error; } - device_bind_driver(dev); - error = 0; } - return error; + + device_bind_driver(dev); + return 0; } @@ -285,10 +304,11 @@ static int bus_match(struct device * dev, struct device_driver * drv) * device_attach - try to attach device to a driver. * @dev: device. * - * Walk the list of drivers that the bus has and call bus_match() - * for each pair. If a compatible pair is found, break out and return. + * Walk the list of drivers that the bus has and call + * driver_probe_device() for each pair. If a compatible + * pair is found, break out and return. */ -static int device_attach(struct device * dev) +int device_attach(struct device * dev) { struct bus_type * bus = dev->bus; struct list_head * entry; @@ -302,11 +322,11 @@ static int device_attach(struct device * dev) if (bus->match) { list_for_each(entry, &bus->drivers.list) { struct device_driver * drv = to_drv(entry); - error = bus_match(dev, drv); + error = driver_probe_device(drv, dev); if (!error) /* success, driver matched */ return 1; - if (error != -ENODEV) + if (error != -ENODEV && error != -ENXIO) /* driver matched but the probe failed */ printk(KERN_WARNING "%s: probe of %s failed with error %d\n", @@ -322,13 +342,13 @@ static int device_attach(struct device * dev) * driver_attach - try to bind driver to devices. * @drv: driver. * - * Walk the list of devices that the bus has on it and try to match - * the driver with each one. - * If bus_match() returns 0 and the @dev->driver is set, we've found - * a compatible pair. + * Walk the list of devices that the bus has on it and try to + * match the driver with each one. If driver_probe_device() + * returns 0 and the @dev->driver is set, we've found a + * compatible pair. * - * Note that we ignore the -ENODEV error from bus_match(), since it's - * perfectly valid for a driver not to bind to any devices. + * Note that we ignore the -ENODEV error from driver_probe_device(), + * since it's perfectly valid for a driver not to bind to any devices. */ void driver_attach(struct device_driver * drv) { @@ -342,7 +362,7 @@ void driver_attach(struct device_driver * drv) list_for_each(entry, &bus->devices.list) { struct device * dev = container_of(entry, struct device, bus_list); if (!dev->driver) { - error = bus_match(dev, drv); + error = driver_probe_device(drv, dev); if (error && (error != -ENODEV)) /* driver matched but the probe failed */ printk(KERN_WARNING @@ -368,6 +388,7 @@ void device_release_driver(struct device * dev) struct device_driver * drv = dev->driver; if (drv) { sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj)); + sysfs_remove_link(&dev->kobj, "driver"); list_del_init(&dev->driver_list); device_detach_shutdown(dev); if (drv->remove) @@ -515,7 +536,7 @@ int bus_add_driver(struct device_driver * drv) if (bus) { pr_debug("bus %s: add driver %s\n", bus->name, drv->name); - error = kobject_set_name(&drv->kobj, drv->name); + error = kobject_set_name(&drv->kobj, "%s", drv->name); if (error) { put_bus(bus); return error; @@ -529,6 +550,7 @@ int bus_add_driver(struct device_driver * drv) down_write(&bus->subsys.rwsem); driver_attach(drv); up_write(&bus->subsys.rwsem); + module_add_driver(drv->owner, drv); driver_add_attrs(bus, drv); } @@ -553,6 +575,7 @@ void bus_remove_driver(struct device_driver * drv) pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name); driver_detach(drv); up_write(&drv->bus->subsys.rwsem); + module_remove_driver(drv); kobject_unregister(&drv->kobj); put_bus(drv->bus); } @@ -584,7 +607,9 @@ int bus_rescan_devices(struct bus_type * bus) { int count = 0; - bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper); + down_write(&bus->subsys.rwsem); + __bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper); + up_write(&bus->subsys.rwsem); return count; } @@ -664,7 +689,7 @@ int bus_register(struct bus_type * bus) { int retval; - retval = kobject_set_name(&bus->subsys.kset.kobj, bus->name); + retval = kobject_set_name(&bus->subsys.kset.kobj, "%s", bus->name); if (retval) goto out; @@ -721,20 +746,23 @@ int __init buses_init(void) } -EXPORT_SYMBOL(bus_for_each_dev); -EXPORT_SYMBOL(bus_for_each_drv); +EXPORT_SYMBOL_GPL(bus_for_each_dev); +EXPORT_SYMBOL_GPL(bus_for_each_drv); -EXPORT_SYMBOL(device_bind_driver); -EXPORT_SYMBOL(device_release_driver); +EXPORT_SYMBOL_GPL(driver_probe_device); +EXPORT_SYMBOL_GPL(device_bind_driver); +EXPORT_SYMBOL_GPL(device_release_driver); +EXPORT_SYMBOL_GPL(device_attach); +EXPORT_SYMBOL_GPL(driver_attach); -EXPORT_SYMBOL(bus_add_device); -EXPORT_SYMBOL(bus_remove_device); -EXPORT_SYMBOL(bus_register); -EXPORT_SYMBOL(bus_unregister); -EXPORT_SYMBOL(bus_rescan_devices); -EXPORT_SYMBOL(get_bus); -EXPORT_SYMBOL(put_bus); -EXPORT_SYMBOL(find_bus); +EXPORT_SYMBOL_GPL(bus_add_device); +EXPORT_SYMBOL_GPL(bus_remove_device); +EXPORT_SYMBOL_GPL(bus_register); +EXPORT_SYMBOL_GPL(bus_unregister); +EXPORT_SYMBOL_GPL(bus_rescan_devices); +EXPORT_SYMBOL_GPL(get_bus); +EXPORT_SYMBOL_GPL(put_bus); +EXPORT_SYMBOL_GPL(find_bus); -EXPORT_SYMBOL(bus_create_file); -EXPORT_SYMBOL(bus_remove_file); +EXPORT_SYMBOL_GPL(bus_create_file); +EXPORT_SYMBOL_GPL(bus_remove_file); diff --git a/drivers/base/class.c b/drivers/base/class.c index 70be97450..e22fa1fdf 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -139,7 +139,7 @@ int class_register(struct class * cls) INIT_LIST_HEAD(&cls->children); INIT_LIST_HEAD(&cls->interfaces); - error = kobject_set_name(&cls->subsys.kset.kobj, cls->name); + error = kobject_set_name(&cls->subsys.kset.kobj, "%s", cls->name); if (error) return error; @@ -179,6 +179,22 @@ void class_device_remove_file(struct class_device * class_dev, sysfs_remove_file(&class_dev->kobj, &attr->attr); } +int class_device_create_bin_file(struct class_device *class_dev, + struct bin_attribute *attr) +{ + int error = -EINVAL; + if (class_dev) + error = sysfs_create_bin_file(&class_dev->kobj, attr); + return error; +} + +void class_device_remove_bin_file(struct class_device *class_dev, + struct bin_attribute *attr) +{ + if (class_dev) + sysfs_remove_bin_file(&class_dev->kobj, attr); +} + static int class_device_dev_link(struct class_device * class_dev) { if (class_dev->dev) @@ -283,8 +299,40 @@ static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp, { struct class_device *class_dev = to_class_dev(kobj); int retval = 0; + int i = 0; + int length = 0; pr_debug("%s - name = %s\n", __FUNCTION__, class_dev->class_id); + + if (class_dev->dev) { + /* add physical device, backing this device */ + struct device *dev = class_dev->dev; + char *path = kobject_get_path(&dev->kobj, GFP_KERNEL); + + add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, + &length, "PHYSDEVPATH=%s", path); + kfree(path); + + /* add bus name of physical device */ + if (dev->bus) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVBUS=%s", dev->bus->name); + + /* add driver name of physical device */ + if (dev->driver) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVDRIVER=%s", dev->driver->name); + + /* terminate, set to next free slot, shrink available space */ + envp[i] = NULL; + envp = &envp[i]; + num_envp -= i; + buffer = &buffer[length]; + buffer_size -= length; + } + if (class_dev->class->hotplug) { /* have the bus specific function add its stuff */ retval = class_dev->class->hotplug (class_dev, envp, num_envp, @@ -368,7 +416,7 @@ int class_device_add(struct class_device *class_dev) class_dev->class_id); /* first, register with generic layer. */ - kobject_set_name(&class_dev->kobj, class_dev->class_id); + kobject_set_name(&class_dev->kobj, "%s", class_dev->class_id); if (parent) class_dev->kobj.parent = &parent->subsys.kset.kobj; @@ -528,22 +576,24 @@ int __init classes_init(void) return 0; } -EXPORT_SYMBOL(class_create_file); -EXPORT_SYMBOL(class_remove_file); -EXPORT_SYMBOL(class_register); -EXPORT_SYMBOL(class_unregister); -EXPORT_SYMBOL(class_get); -EXPORT_SYMBOL(class_put); - -EXPORT_SYMBOL(class_device_register); -EXPORT_SYMBOL(class_device_unregister); -EXPORT_SYMBOL(class_device_initialize); -EXPORT_SYMBOL(class_device_add); -EXPORT_SYMBOL(class_device_del); -EXPORT_SYMBOL(class_device_get); -EXPORT_SYMBOL(class_device_put); -EXPORT_SYMBOL(class_device_create_file); -EXPORT_SYMBOL(class_device_remove_file); - -EXPORT_SYMBOL(class_interface_register); -EXPORT_SYMBOL(class_interface_unregister); +EXPORT_SYMBOL_GPL(class_create_file); +EXPORT_SYMBOL_GPL(class_remove_file); +EXPORT_SYMBOL_GPL(class_register); +EXPORT_SYMBOL_GPL(class_unregister); +EXPORT_SYMBOL_GPL(class_get); +EXPORT_SYMBOL_GPL(class_put); + +EXPORT_SYMBOL_GPL(class_device_register); +EXPORT_SYMBOL_GPL(class_device_unregister); +EXPORT_SYMBOL_GPL(class_device_initialize); +EXPORT_SYMBOL_GPL(class_device_add); +EXPORT_SYMBOL_GPL(class_device_del); +EXPORT_SYMBOL_GPL(class_device_get); +EXPORT_SYMBOL_GPL(class_device_put); +EXPORT_SYMBOL_GPL(class_device_create_file); +EXPORT_SYMBOL_GPL(class_device_remove_file); +EXPORT_SYMBOL_GPL(class_device_create_bin_file); +EXPORT_SYMBOL_GPL(class_device_remove_bin_file); + +EXPORT_SYMBOL_GPL(class_interface_register); +EXPORT_SYMBOL_GPL(class_interface_unregister); diff --git a/drivers/base/class_simple.c b/drivers/base/class_simple.c index 3410636de..682e73bd3 100644 --- a/drivers/base/class_simple.c +++ b/drivers/base/class_simple.c @@ -27,7 +27,7 @@ struct simple_dev { #define to_simple_dev(d) container_of(d, struct simple_dev, class_dev) static LIST_HEAD(simple_dev_list); -static spinlock_t simple_dev_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(simple_dev_list_lock); static void release_simple_dev(struct class_device *class_dev) { @@ -122,7 +122,7 @@ EXPORT_SYMBOL(class_simple_destroy); * be created, showing the dev_t for the device. The pointer to the struct * class_device will be returned from the call. Any further sysfs files that * might be required can be created using this pointer. - * Note: the struct class_device passed to this function must have previously been + * Note: the struct class_simple passed to this function must have previously been * created with a call to class_simple_create(). */ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...) diff --git a/drivers/base/core.c b/drivers/base/core.c index 153cdc48b..4e6cce8e6 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -116,8 +116,29 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp, int num_envp, char *buffer, int buffer_size) { struct device *dev = to_dev(kobj); + int i = 0; + int length = 0; int retval = 0; + /* add bus name of physical device */ + if (dev->bus) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVBUS=%s", dev->bus->name); + + /* add driver name of physical device */ + if (dev->driver) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVDRIVER=%s", dev->driver->name); + + /* terminate, set to next free slot, shrink available space */ + envp[i] = NULL; + envp = &envp[i]; + num_envp -= i; + buffer = &buffer[length]; + buffer_size -= length; + if (dev->bus->hotplug) { /* have the bus specific function add its stuff */ retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size); @@ -209,19 +230,19 @@ void device_initialize(struct device *dev) */ int device_add(struct device *dev) { - struct device * parent; - int error; + struct device *parent = NULL; + int error = -EINVAL; dev = get_device(dev); if (!dev || !strlen(dev->bus_id)) - return -EINVAL; + goto Error; parent = get_device(dev->parent); pr_debug("DEV: registering device: ID = '%s'\n", dev->bus_id); /* first, register with generic layer. */ - kobject_set_name(&dev->kobj, dev->bus_id); + kobject_set_name(&dev->kobj, "%s", dev->bus_id); if (parent) dev->kobj.parent = &parent->kobj; @@ -293,7 +314,8 @@ struct device * get_device(struct device * dev) */ void put_device(struct device * dev) { - kobject_put(&dev->kobj); + if (dev) + kobject_put(&dev->kobj); } @@ -401,17 +423,17 @@ int __init devices_init(void) return subsystem_register(&devices_subsys); } -EXPORT_SYMBOL(device_for_each_child); +EXPORT_SYMBOL_GPL(device_for_each_child); -EXPORT_SYMBOL(device_initialize); -EXPORT_SYMBOL(device_add); -EXPORT_SYMBOL(device_register); +EXPORT_SYMBOL_GPL(device_initialize); +EXPORT_SYMBOL_GPL(device_add); +EXPORT_SYMBOL_GPL(device_register); -EXPORT_SYMBOL(device_del); -EXPORT_SYMBOL(device_unregister); -EXPORT_SYMBOL(get_device); -EXPORT_SYMBOL(put_device); -EXPORT_SYMBOL(device_find); +EXPORT_SYMBOL_GPL(device_del); +EXPORT_SYMBOL_GPL(device_unregister); +EXPORT_SYMBOL_GPL(get_device); +EXPORT_SYMBOL_GPL(put_device); +EXPORT_SYMBOL_GPL(device_find); -EXPORT_SYMBOL(device_create_file); -EXPORT_SYMBOL(device_remove_file); +EXPORT_SYMBOL_GPL(device_create_file); +EXPORT_SYMBOL_GPL(device_remove_file); diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index aa66d7198..6ef3069b5 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -32,6 +32,8 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, switch (buf[0]) { case '0': ret = cpu_down(cpu->sysdev.id); + if (!ret) + kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); break; case '1': ret = cpu_up(cpu->sysdev.id); @@ -46,10 +48,22 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, } static SYSDEV_ATTR(online, 0600, show_online, store_online); -static void __init register_cpu_control(struct cpu *cpu) +static void __devinit register_cpu_control(struct cpu *cpu) { sysdev_create_file(&cpu->sysdev, &attr_online); } +void unregister_cpu(struct cpu *cpu, struct node *root) +{ + + if (root) + sysfs_remove_link(&root->sysdev.kobj, + kobject_name(&cpu->sysdev.kobj)); + sysdev_remove_file(&cpu->sysdev, &attr_online); + + sysdev_unregister(&cpu->sysdev); + + return; +} #else /* ... !CONFIG_HOTPLUG_CPU */ static inline void register_cpu_control(struct cpu *cpu) { @@ -64,7 +78,7 @@ static inline void register_cpu_control(struct cpu *cpu) * * Initialize and register the CPU device. */ -int __init register_cpu(struct cpu *cpu, int num, struct node *root) +int __devinit register_cpu(struct cpu *cpu, int num, struct node *root) { int error; diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 735bd1702..9556f912f 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -129,11 +129,11 @@ struct device_driver *driver_find(const char *name, struct bus_type *bus) return NULL; } -EXPORT_SYMBOL(driver_register); -EXPORT_SYMBOL(driver_unregister); -EXPORT_SYMBOL(get_driver); -EXPORT_SYMBOL(put_driver); -EXPORT_SYMBOL(driver_find); - -EXPORT_SYMBOL(driver_create_file); -EXPORT_SYMBOL(driver_remove_file); +EXPORT_SYMBOL_GPL(driver_register); +EXPORT_SYMBOL_GPL(driver_unregister); +EXPORT_SYMBOL_GPL(get_driver); +EXPORT_SYMBOL_GPL(put_driver); +EXPORT_SYMBOL_GPL(driver_find); + +EXPORT_SYMBOL_GPL(driver_create_file); +EXPORT_SYMBOL_GPL(driver_remove_file); diff --git a/drivers/base/firmware.c b/drivers/base/firmware.c index 0cff0498e..88ab04493 100644 --- a/drivers/base/firmware.c +++ b/drivers/base/firmware.c @@ -30,5 +30,5 @@ int __init firmware_init(void) return subsystem_register(&firmware_subsys); } -EXPORT_SYMBOL(firmware_register); -EXPORT_SYMBOL(firmware_unregister); +EXPORT_SYMBOL_GPL(firmware_register); +EXPORT_SYMBOL_GPL(firmware_unregister); diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 6e17867db..26c9464af 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -94,19 +94,17 @@ firmware_class_hotplug(struct class_device *class_dev, char **envp, int num_envp, char *buffer, int buffer_size) { struct firmware_priv *fw_priv = class_get_devdata(class_dev); - int i = 0; - char *scratch = buffer; + int i = 0, len = 0; if (!test_bit(FW_STATUS_READY, &fw_priv->status)) return -ENODEV; - if (buffer_size < (FIRMWARE_NAME_MAX + 10)) - return -ENOMEM; - if (num_envp < 1) + if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len, + "FIRMWARE=%s", fw_priv->fw_id)) return -ENOMEM; - envp[i++] = scratch; - scratch += sprintf(scratch, "FIRMWARE=%s", fw_priv->fw_id) + 1; + envp[i] = NULL; + return 0; } @@ -422,7 +420,7 @@ request_firmware(const struct firmware **firmware_p, const char *name, add_timer(&fw_priv->timeout); } - kobject_hotplug("add", &class_dev->kobj); + kobject_hotplug(&class_dev->kobj, KOBJ_ADD); wait_for_completion(&fw_priv->completion); set_bit(FW_STATUS_DONE, &fw_priv->status); @@ -441,6 +439,7 @@ request_firmware(const struct firmware **firmware_p, const char *name, error_kfree_fw: kfree(firmware); + *firmware_p = NULL; out: return retval; } @@ -582,4 +581,3 @@ EXPORT_SYMBOL(release_firmware); EXPORT_SYMBOL(request_firmware); EXPORT_SYMBOL(request_firmware_nowait); EXPORT_SYMBOL(register_firmware); -EXPORT_SYMBOL(firmware_class); diff --git a/drivers/base/init.c b/drivers/base/init.c index 7b86c409c..a76ae5a22 100644 --- a/drivers/base/init.c +++ b/drivers/base/init.c @@ -17,7 +17,7 @@ extern int firmware_init(void); extern int platform_bus_init(void); extern int system_bus_init(void); extern int cpu_dev_init(void); - +extern int attribute_container_init(void); /** * driver_init - initialize driver model. * @@ -39,4 +39,5 @@ void __init driver_init(void) platform_bus_init(); system_bus_init(); cpu_dev_init(); + attribute_container_init(); } diff --git a/drivers/base/node.c b/drivers/base/node.c index df74785ef..583d57ec4 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -10,6 +10,7 @@ #include #include #include +#include static struct sysdev_class node_class = { set_kset_name("node"), @@ -23,7 +24,7 @@ static ssize_t node_read_cpumap(struct sys_device * dev, char * buf) int len; /* 2004/06/03: buf currently PAGE_SIZE, need > 1 char per 4 bits. */ - BUILD_BUG_ON(NR_CPUS/4 > PAGE_SIZE/2); + BUILD_BUG_ON(MAX_NUMNODES/4 > PAGE_SIZE/2); len = cpumask_scnprintf(buf, PAGE_SIZE-1, mask); len += sprintf(buf + len, "\n"); @@ -111,6 +112,24 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf) } static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); +static ssize_t node_read_distance(struct sys_device * dev, char * buf) +{ + int nid = dev->id; + int len = 0; + int i; + + /* buf currently PAGE_SIZE, need ~4 chars per node */ + BUILD_BUG_ON(MAX_NUMNODES*4 > PAGE_SIZE/2); + + for_each_online_node(i) + len += sprintf(buf + len, "%s%d", i ? " " : "", node_distance(nid, i)); + + len += sprintf(buf + len, "\n"); + return len; +} +static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL); + + /* * register_node - Setup a driverfs device for a node. * @num - Node number to use when creating the device. @@ -129,6 +148,7 @@ int __init register_node(struct node *node, int num, struct node *parent) sysdev_create_file(&node->sysdev, &attr_cpumap); sysdev_create_file(&node->sysdev, &attr_meminfo); sysdev_create_file(&node->sysdev, &attr_numastat); + sysdev_create_file(&node->sysdev, &attr_distance); } return error; } diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9f285ed4e..c8c87cebc 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -57,6 +57,41 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) return r ? r->start : 0; } +/** + * platform_get_resource_byname - get a resource for a device by name + * @dev: platform device + * @type: resource type + * @name: resource name + */ +struct resource * +platform_get_resource_byname(struct platform_device *dev, unsigned int type, + char *name) +{ + int i; + + for (i = 0; i < dev->num_resources; i++) { + struct resource *r = &dev->resource[i]; + + if ((r->flags & (IORESOURCE_IO|IORESOURCE_MEM| + IORESOURCE_IRQ|IORESOURCE_DMA)) == type) + if (!strcmp(r->name, name)) + return r; + } + return NULL; +} + +/** + * platform_get_irq - get an IRQ for a device + * @dev: platform device + * @name: IRQ name + */ +int platform_get_irq_byname(struct platform_device *dev, char *name) +{ + struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); + + return r ? r->start : 0; +} + /** * platform_add_devices - add a numbers of platform devices * @devs: array of platform devices to add @@ -103,13 +138,16 @@ int platform_device_register(struct platform_device * pdev) for (i = 0; i < pdev->num_resources; i++) { struct resource *p, *r = &pdev->resource[i]; - r->name = pdev->dev.bus_id; + if (r->name == NULL) + r->name = pdev->dev.bus_id; - p = NULL; - if (r->flags & IORESOURCE_MEM) - p = &iomem_resource; - else if (r->flags & IORESOURCE_IO) - p = &ioport_resource; + p = r->parent; + if (!p) { + if (r->flags & IORESOURCE_MEM) + p = &iomem_resource; + else if (r->flags & IORESOURCE_IO) + p = &ioport_resource; + } if (p && request_resource(p, r)) { printk(KERN_ERR @@ -238,7 +276,7 @@ static int platform_match(struct device * dev, struct device_driver * drv) return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0); } -static int platform_suspend(struct device * dev, u32 state) +static int platform_suspend(struct device * dev, pm_message_t state) { int ret = 0; @@ -298,13 +336,15 @@ u64 dma_get_required_mask(struct device *dev) } return mask & *dev->dma_mask; } -EXPORT_SYMBOL(dma_get_required_mask); +EXPORT_SYMBOL_GPL(dma_get_required_mask); #endif -EXPORT_SYMBOL(platform_bus); -EXPORT_SYMBOL(platform_bus_type); -EXPORT_SYMBOL(platform_device_register); -EXPORT_SYMBOL(platform_device_register_simple); -EXPORT_SYMBOL(platform_device_unregister); -EXPORT_SYMBOL(platform_get_irq); -EXPORT_SYMBOL(platform_get_resource); +EXPORT_SYMBOL_GPL(platform_bus); +EXPORT_SYMBOL_GPL(platform_bus_type); +EXPORT_SYMBOL_GPL(platform_device_register); +EXPORT_SYMBOL_GPL(platform_device_register_simple); +EXPORT_SYMBOL_GPL(platform_device_unregister); +EXPORT_SYMBOL_GPL(platform_get_irq); +EXPORT_SYMBOL_GPL(platform_get_resource); +EXPORT_SYMBOL_GPL(platform_get_irq_byname); +EXPORT_SYMBOL_GPL(platform_get_resource_byname); diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 635ea2001..15e6a8f95 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -28,6 +28,7 @@ LIST_HEAD(dpm_off); LIST_HEAD(dpm_off_irq); DECLARE_MUTEX(dpm_sem); +DECLARE_MUTEX(dpm_list_sem); /* * PM Reference Counting. @@ -66,7 +67,7 @@ void device_pm_set_parent(struct device * dev, struct device * parent) dev->power.pm_parent = parent; device_pm_hold(parent); } -EXPORT_SYMBOL(device_pm_set_parent); +EXPORT_SYMBOL_GPL(device_pm_set_parent); int device_pm_add(struct device * dev) { @@ -75,12 +76,12 @@ int device_pm_add(struct device * dev) pr_debug("PM: Adding info for %s:%s\n", dev->bus ? dev->bus->name : "No Bus", dev->kobj.name); atomic_set(&dev->power.pm_users, 0); - down(&dpm_sem); + down(&dpm_list_sem); list_add_tail(&dev->power.entry, &dpm_active); device_pm_set_parent(dev, dev->parent); if ((error = dpm_sysfs_add(dev))) list_del(&dev->power.entry); - up(&dpm_sem); + up(&dpm_list_sem); return error; } @@ -88,11 +89,11 @@ void device_pm_remove(struct device * dev) { pr_debug("PM: Removing info for %s:%s\n", dev->bus ? dev->bus->name : "No Bus", dev->kobj.name); - down(&dpm_sem); + down(&dpm_list_sem); dpm_sysfs_remove(dev); device_pm_release(dev->power.pm_parent); - list_del(&dev->power.entry); - up(&dpm_sem); + list_del_init(&dev->power.entry); + up(&dpm_list_sem); } diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index 6971cc667..e5eda746f 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -27,6 +27,11 @@ extern void device_shutdown(void); */ extern struct semaphore dpm_sem; +/* + * Used to serialize changes to the dpm_* lists. + */ +extern struct semaphore dpm_list_sem; + /* * The PM lists. */ @@ -66,14 +71,14 @@ extern int resume_device(struct device *); /* * suspend.c */ -extern int suspend_device(struct device *, u32); +extern int suspend_device(struct device *, pm_message_t); /* * runtime.c */ -extern int dpm_runtime_suspend(struct device *, u32); +extern int dpm_runtime_suspend(struct device *, pm_message_t); extern void dpm_runtime_resume(struct device *); #else /* CONFIG_PM */ @@ -88,7 +93,7 @@ static inline void device_pm_remove(struct device * dev) } -static inline int dpm_runtime_suspend(struct device * dev, u32 state) +static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) { return 0; } diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c index 1d830be4c..f8f505575 100644 --- a/drivers/base/power/resume.c +++ b/drivers/base/power/resume.c @@ -31,16 +31,22 @@ int resume_device(struct device * dev) void dpm_resume(void) { + down(&dpm_list_sem); while(!list_empty(&dpm_off)) { struct list_head * entry = dpm_off.next; struct device * dev = to_device(entry); + + get_device(dev); list_del_init(entry); + list_add_tail(entry, &dpm_active); + up(&dpm_list_sem); if (!dev->power.prev_state) resume_device(dev); - - list_add_tail(entry, &dpm_active); + down(&dpm_list_sem); + put_device(dev); } + up(&dpm_list_sem); } @@ -58,7 +64,7 @@ void device_resume(void) up(&dpm_sem); } -EXPORT_SYMBOL(device_resume); +EXPORT_SYMBOL_GPL(device_resume); /** @@ -76,9 +82,13 @@ void dpm_power_up(void) { while(!list_empty(&dpm_off_irq)) { struct list_head * entry = dpm_off_irq.next; + struct device * dev = to_device(entry); + + get_device(dev); list_del_init(entry); - resume_device(to_device(entry)); list_add_tail(entry, &dpm_active); + resume_device(dev); + put_device(dev); } } @@ -97,6 +107,6 @@ void device_power_up(void) dpm_power_up(); } -EXPORT_SYMBOL(device_power_up); +EXPORT_SYMBOL_GPL(device_power_up); diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 5e58f6836..325962d80 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -44,7 +44,7 @@ void dpm_runtime_resume(struct device * dev) * @state: State to enter. */ -int dpm_runtime_suspend(struct device * dev, u32 state) +int dpm_runtime_suspend(struct device * dev, pm_message_t state) { int error = 0; @@ -73,7 +73,7 @@ int dpm_runtime_suspend(struct device * dev, u32 state) * always be able to tell, but we need accurate information to * work reliably. */ -void dpm_set_power_state(struct device * dev, u32 state) +void dpm_set_power_state(struct device * dev, pm_message_t state) { down(&dpm_sem); dev->power.power_state = state; diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 86f9e6ec0..8e1ace2d8 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c @@ -11,7 +11,7 @@ #include #include "power.h" -extern int sysdev_suspend(u32 state); +extern int sysdev_suspend(pm_message_t state); /* * The entries in the dpm_active list are in a depth first order, simply @@ -35,7 +35,7 @@ extern int sysdev_suspend(u32 state); * @state: Power state device is entering. */ -int suspend_device(struct device * dev, u32 state) +int suspend_device(struct device * dev, pm_message_t state) { int error = 0; @@ -63,44 +63,50 @@ int suspend_device(struct device * dev, u32 state) * If we hit a failure with any of the devices, call device_resume() * above to bring the suspended devices back to life. * - * Note this function leaves dpm_sem held to - * a) block other devices from registering. - * b) prevent other PM operations from happening after we've begun. - * c) make sure we're exclusive when we disable interrupts. - * */ -int device_suspend(u32 state) +int device_suspend(pm_message_t state) { int error = 0; down(&dpm_sem); - while(!list_empty(&dpm_active)) { + down(&dpm_list_sem); + while (!list_empty(&dpm_active) && error == 0) { struct list_head * entry = dpm_active.prev; struct device * dev = to_device(entry); + + get_device(dev); + up(&dpm_list_sem); + error = suspend_device(dev, state); - if (!error) { - list_del(&dev->power.entry); - list_add(&dev->power.entry, &dpm_off); - } else if (error == -EAGAIN) { - list_del(&dev->power.entry); - list_add(&dev->power.entry, &dpm_off_irq); - } else { + down(&dpm_list_sem); + + /* Check if the device got removed */ + if (!list_empty(&dev->power.entry)) { + /* Move it to the dpm_off or dpm_off_irq list */ + if (!error) { + list_del(&dev->power.entry); + list_add(&dev->power.entry, &dpm_off); + } else if (error == -EAGAIN) { + list_del(&dev->power.entry); + list_add(&dev->power.entry, &dpm_off_irq); + error = 0; + } + } + if (error) printk(KERN_ERR "Could not suspend device %s: " "error %d\n", kobject_name(&dev->kobj), error); - goto Error; - } + put_device(dev); } - Done: + up(&dpm_list_sem); + if (error) + dpm_resume(); up(&dpm_sem); return error; - Error: - dpm_resume(); - goto Done; } -EXPORT_SYMBOL(device_suspend); +EXPORT_SYMBOL_GPL(device_suspend); /** @@ -112,7 +118,7 @@ EXPORT_SYMBOL(device_suspend); * done, power down system devices. */ -int device_power_down(u32 state) +int device_power_down(pm_message_t state) { int error = 0; struct device * dev; @@ -132,5 +138,5 @@ int device_power_down(u32 state) goto Done; } -EXPORT_SYMBOL(device_power_down); +EXPORT_SYMBOL_GPL(device_power_down); diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9d10500cd..c3a99df3c 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -73,8 +73,8 @@ void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a) sysfs_remove_file(&s->kobj, &a->attr); } -EXPORT_SYMBOL(sysdev_create_file); -EXPORT_SYMBOL(sysdev_remove_file); +EXPORT_SYMBOL_GPL(sysdev_create_file); +EXPORT_SYMBOL_GPL(sysdev_remove_file); /* * declare system_subsys @@ -98,8 +98,8 @@ void sysdev_class_unregister(struct sysdev_class * cls) kset_unregister(&cls->kset); } -EXPORT_SYMBOL(sysdev_class_register); -EXPORT_SYMBOL(sysdev_class_unregister); +EXPORT_SYMBOL_GPL(sysdev_class_register); +EXPORT_SYMBOL_GPL(sysdev_class_unregister); static LIST_HEAD(global_drivers); @@ -157,8 +157,8 @@ void sysdev_driver_unregister(struct sysdev_class * cls, up_write(&system_subsys.rwsem); } -EXPORT_SYMBOL(sysdev_driver_register); -EXPORT_SYMBOL(sysdev_driver_unregister); +EXPORT_SYMBOL_GPL(sysdev_driver_register); +EXPORT_SYMBOL_GPL(sysdev_driver_unregister); @@ -392,5 +392,5 @@ int __init system_bus_init(void) return subsystem_register(&system_subsys); } -EXPORT_SYMBOL(sysdev_register); -EXPORT_SYMBOL(sysdev_unregister); +EXPORT_SYMBOL_GPL(sysdev_register); +EXPORT_SYMBOL_GPL(sysdev_unregister); diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 48c3e6399..2c0946c49 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -2678,7 +2678,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device, DAC960_Controller_T *Controller = NULL; unsigned char DeviceFunction = PCI_Device->devfn; unsigned char ErrorStatus, Parameter0, Parameter1; - unsigned int IRQ_Channel = PCI_Device->irq; + unsigned int IRQ_Channel; void __iomem *BaseAddress; int i; @@ -2738,7 +2738,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device, } init_waitqueue_head(&Controller->CommandWaitQueue); init_waitqueue_head(&Controller->HealthStatusWaitQueue); - Controller->queue_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&Controller->queue_lock); DAC960_AnnounceDriver(Controller); /* Map the Controller Register Window. @@ -2958,6 +2958,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device, /* Acquire shared access to the IRQ Channel. */ + IRQ_Channel = PCI_Device->irq; if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ, Controller->FullModelName, Controller) < 0) { diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index a1d50242b..9db8cf090 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -6,7 +6,7 @@ menu "Block devices" config BLK_DEV_FD tristate "Normal floppy disk support" - depends on (!ARCH_S390 && !M68K && !IA64) || Q40 || (SUN3X && BROKEN) + depends on (!ARCH_S390 && !M68K && !IA64 && !USERMODE) || Q40 || (SUN3X && BROKEN) ---help--- If you want to use the floppy disk drive(s) of your PC under Linux, say Y. Information about this driver, especially important for IBM @@ -170,7 +170,7 @@ config CISS_SCSI_TAPE help When enabled (Y), this option allows SCSI tape drives and SCSI medium changers (tape robots) to be accessed via a Compaq 5xxx array - controller. (See Documentation/cciss.txt for more details.) + controller. (See for more details.) "SCSI support" and "SCSI tape support" must also be enabled for this option to work. @@ -196,7 +196,7 @@ config BLK_DEV_UMEM ---help--- Saying Y here will include support for the MM5415 family of battery backed (Non-volatile) RAM cards. - http://www.umem.com/ + The cards appear as block devices that can be partitioned into as many as 15 partitions. @@ -208,6 +208,56 @@ config BLK_DEV_UMEM one is chosen dynamically. Use "devfs" or look in /proc/devices for the device number +config BLK_DEV_UBD + bool "Virtual block device" + depends on USERMODE + ---help--- + The User-Mode Linux port includes a driver called UBD which will let + you access arbitrary files on the host computer as block devices. + Unless you know that you do not need such virtual block devices say + Y here. + +config BLK_DEV_UBD_SYNC + bool "Always do synchronous disk IO for UBD" + depends on BLK_DEV_UBD + ---help--- + Writes to the virtual block device are not immediately written to the + host's disk; this may cause problems if, for example, the User-Mode + Linux 'Virtual Machine' uses a journalling filesystem and the host + computer crashes. + + Synchronous operation (i.e. always writing data to the host's disk + immediately) is configurable on a per-UBD basis by using a special + kernel command line option. Alternatively, you can say Y here to + turn on synchronous operation by default for all block devices. + + If you're running a journalling file system (like reiserfs, for + example) in your virtual machine, you will want to say Y here. If + you care for the safety of the data in your virtual machine, Y is a + wise choice too. In all other cases (for example, if you're just + playing around with User-Mode Linux) you can choose N. + +config BLK_DEV_COW_COMMON + bool + default BLK_DEV_UBD + +config MMAPPER + tristate "Example IO memory driver (BROKEN)" + depends on USERMODE && BROKEN + ---help--- + The User-Mode Linux port can provide support for IO Memory + emulation with this option. This allows a host file to be + specified as an I/O region on the kernel command line. That file + will be mapped into UML's kernel address space where a driver can + locate it and do whatever it wants with the memory, including + providing an interface to it for UML processes to use. + + For more information, see + . + + If you'd like to be able to provide a simulated IO port space for + User-Mode Linux processes, say Y. If unsure, say N. + config BLK_DEV_LOOP tristate "Loopback device support" ---help--- @@ -265,6 +315,12 @@ config BLK_DEV_CRYPTOLOOP instead, which can be configured to be on-disk compatible with the cryptoloop device. +config BLK_DEV_VROOT + tristate "Virtual Root device support" + ---help--- + Saying Y here will allow you to use quota/fs ioctls on a shared + partition within a virtual server without compromising security. + config BLK_DEV_NBD tristate "Network block device support" depends on NET @@ -308,6 +364,8 @@ config BLK_DEV_UB This driver supports certain USB attached storage devices such as flash keys. + Warning: Enabling this cripples the usb-storage driver. + If unsure, say N. config BLK_DEV_RAM @@ -329,6 +387,14 @@ config BLK_DEV_RAM Most normal users won't need the RAM disk functionality, and can thus say N here. +config BLK_DEV_RAM_COUNT + int "Default number of RAM disks" if BLK_DEV_RAM + default "16" + help + The default value is 16 RAM disks. Change this if you know what + are doing. If you boot from a filesystem that needs to be extracted + in memory, you will need at least one RAM disk (e.g. root on cramfs). + config BLK_DEV_RAM_SIZE int "Default RAM disk size (kbytes)" depends on BLK_DEV_RAM @@ -348,14 +414,102 @@ config BLK_DEV_INITRD "real" root file system, etc. See for details. +config INITRAMFS_SOURCE + string "Initramfs source file(s)" + default "" + help + This can be either a single cpio archive with a .cpio suffix or a + space-separated list of directories and files for building the + initramfs image. A cpio archive should contain a filesystem archive + to be used as an initramfs image. Directories should contain a + filesystem layout to be included in the initramfs image. Files + should contain entries according to the format described by the + "usr/gen_init_cpio" program in the kernel tree. + + When multiple directories and files are specified then the + initramfs image will be the aggregate of all of them. + + See elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; unsigned long flags; spin_lock_irqsave(q->queue_lock, flags); @@ -945,7 +945,7 @@ static void update_write_batch(struct as_data *ad) */ static void as_completed_request(request_queue_t *q, struct request *rq) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(rq); WARN_ON(!list_empty(&rq->queuelist)); @@ -1030,7 +1030,7 @@ static void as_remove_queued_request(request_queue_t *q, struct request *rq) { struct as_rq *arq = RQ_DATA(rq); const int data_dir = arq->is_sync; - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; WARN_ON(arq->state != AS_RQ_QUEUED); @@ -1361,7 +1361,7 @@ fifo_expired: static struct request *as_next_request(request_queue_t *q) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct request *rq = NULL; /* @@ -1469,7 +1469,7 @@ static void as_add_request(struct as_data *ad, struct as_rq *arq) */ static void as_requeue_request(request_queue_t *q, struct request *rq) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(rq); if (arq) { @@ -1509,7 +1509,7 @@ static void as_account_queued_request(struct as_data *ad, struct request *rq) static void as_insert_request(request_queue_t *q, struct request *rq, int where) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(rq); if (arq) { @@ -1562,7 +1562,7 @@ as_insert_request(request_queue_t *q, struct request *rq, int where) */ static int as_queue_empty(request_queue_t *q) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; if (!list_empty(&ad->fifo_list[REQ_ASYNC]) || !list_empty(&ad->fifo_list[REQ_SYNC]) @@ -1601,7 +1601,7 @@ as_latter_request(request_queue_t *q, struct request *rq) static int as_merge(request_queue_t *q, struct request **req, struct bio *bio) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; sector_t rb_key = bio->bi_sector + bio_sectors(bio); struct request *__rq; int ret; @@ -1656,7 +1656,7 @@ out_insert: static void as_merged_request(request_queue_t *q, struct request *req) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(req); /* @@ -1701,7 +1701,7 @@ static void as_merged_requests(request_queue_t *q, struct request *req, struct request *next) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(req); struct as_rq *anext = RQ_DATA(next); @@ -1788,7 +1788,7 @@ static void as_work_handler(void *data) static void as_put_request(request_queue_t *q, struct request *rq) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = RQ_DATA(rq); if (!arq) { @@ -1807,7 +1807,7 @@ static void as_put_request(request_queue_t *q, struct request *rq) static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask) { - struct as_data *ad = q->elevator.elevator_data; + struct as_data *ad = q->elevator->elevator_data; struct as_rq *arq = mempool_alloc(ad->arq_pool, gfp_mask); if (arq) { @@ -1828,21 +1828,21 @@ static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask) static int as_may_queue(request_queue_t *q, int rw) { - int ret = 0; - struct as_data *ad = q->elevator.elevator_data; + int ret = ELV_MQUEUE_MAY; + struct as_data *ad = q->elevator->elevator_data; struct io_context *ioc; if (ad->antic_status == ANTIC_WAIT_REQ || ad->antic_status == ANTIC_WAIT_NEXT) { ioc = as_get_io_context(); if (ad->io_context == ioc) - ret = 1; + ret = ELV_MQUEUE_MUST; put_io_context(ioc); } return ret; } -static void as_exit(request_queue_t *q, elevator_t *e) +static void as_exit_queue(elevator_t *e) { struct as_data *ad = e->elevator_data; @@ -1862,7 +1862,7 @@ static void as_exit(request_queue_t *q, elevator_t *e) * initialize elevator private data (as_data), and alloc a arq for * each request on the free lists */ -static int as_init(request_queue_t *q, elevator_t *e) +static int as_init_queue(request_queue_t *q, elevator_t *e) { struct as_data *ad; int i; @@ -1962,10 +1962,10 @@ static ssize_t as_est_show(struct as_data *ad, char *page) return pos; } -#define SHOW_FUNCTION(__FUNC, __VAR) \ +#define SHOW_FUNCTION(__FUNC, __VAR) \ static ssize_t __FUNC(struct as_data *ad, char *page) \ -{ \ - return as_var_show(__VAR, (page)); \ +{ \ + return as_var_show(jiffies_to_msecs((__VAR)), (page)); \ } SHOW_FUNCTION(as_readexpire_show, ad->fifo_expire[REQ_SYNC]); SHOW_FUNCTION(as_writeexpire_show, ad->fifo_expire[REQ_ASYNC]); @@ -1982,6 +1982,7 @@ static ssize_t __FUNC(struct as_data *ad, const char *page, size_t count) \ *(__PTR) = (MIN); \ else if (*(__PTR) > (MAX)) \ *(__PTR) = (MAX); \ + *(__PTR) = msecs_to_jiffies(*(__PTR)); \ return ret; \ } STORE_FUNCTION(as_readexpire_store, &ad->fifo_expire[REQ_SYNC], 0, INT_MAX); @@ -2070,39 +2071,64 @@ static struct kobj_type as_ktype = { .default_attrs = default_attrs, }; -static int __init as_slab_setup(void) +static struct elevator_type iosched_as = { + .ops = { + .elevator_merge_fn = as_merge, + .elevator_merged_fn = as_merged_request, + .elevator_merge_req_fn = as_merged_requests, + .elevator_next_req_fn = as_next_request, + .elevator_add_req_fn = as_insert_request, + .elevator_remove_req_fn = as_remove_request, + .elevator_requeue_req_fn = as_requeue_request, + .elevator_queue_empty_fn = as_queue_empty, + .elevator_completed_req_fn = as_completed_request, + .elevator_former_req_fn = as_former_request, + .elevator_latter_req_fn = as_latter_request, + .elevator_set_req_fn = as_set_request, + .elevator_put_req_fn = as_put_request, + .elevator_may_queue_fn = as_may_queue, + .elevator_init_fn = as_init_queue, + .elevator_exit_fn = as_exit_queue, + }, + + .elevator_ktype = &as_ktype, + .elevator_name = "anticipatory", + .elevator_owner = THIS_MODULE, +}; + +static int __init as_init(void) { + int ret; + arq_pool = kmem_cache_create("as_arq", sizeof(struct as_rq), 0, 0, NULL, NULL); - if (!arq_pool) - panic("as: can't init slab pool\n"); + return -ENOMEM; - return 0; + ret = elv_register(&iosched_as); + if (!ret) { + /* + * don't allow AS to get unregistered, since we would have + * to browse all tasks in the system and release their + * as_io_context first + */ + __module_get(THIS_MODULE); + return 0; + } + + kmem_cache_destroy(arq_pool); + return ret; } -subsys_initcall(as_slab_setup); - -elevator_t iosched_as = { - .elevator_merge_fn = as_merge, - .elevator_merged_fn = as_merged_request, - .elevator_merge_req_fn = as_merged_requests, - .elevator_next_req_fn = as_next_request, - .elevator_add_req_fn = as_insert_request, - .elevator_remove_req_fn = as_remove_request, - .elevator_requeue_req_fn = as_requeue_request, - .elevator_queue_empty_fn = as_queue_empty, - .elevator_completed_req_fn = as_completed_request, - .elevator_former_req_fn = as_former_request, - .elevator_latter_req_fn = as_latter_request, - .elevator_set_req_fn = as_set_request, - .elevator_put_req_fn = as_put_request, - .elevator_may_queue_fn = as_may_queue, - .elevator_init_fn = as_init, - .elevator_exit_fn = as_exit, - - .elevator_ktype = &as_ktype, - .elevator_name = "anticipatory", -}; +static void __exit as_exit(void) +{ + kmem_cache_destroy(arq_pool); + elv_unregister(&iosched_as); +} + +module_init(as_init); +module_exit(as_exit); -EXPORT_SYMBOL(iosched_as); +MODULE_AUTHOR("Nick Piggin"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("anticipatory IO scheduler"); diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index c5385258d..db05a5a99 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -140,7 +140,7 @@ static int StartDiskType[] = { static int DriveType = TYPE_HD; -static spinlock_t ataflop_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ataflop_lock); /* Array for translating minors into disk formats */ static struct { diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index ccdcfa13b..967c0f31e 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to Cciss-discuss@lists.sourceforge.net + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * */ @@ -46,14 +46,14 @@ #include #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) -#define DRIVER_NAME "HP CISS Driver (v 2.6.2)" -#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,6,2) +#define DRIVER_NAME "HP CISS Driver (v 2.6.4)" +#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,6,4) /* Embedded module documentation macros - see modules.h */ MODULE_AUTHOR("Hewlett-Packard Company"); -MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 2.6.2"); +MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 2.6.4"); MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400" - " SA6i V100"); + " SA6i P600"); MODULE_LICENSE("GPL"); #include "cciss_cmd.h" @@ -80,10 +80,8 @@ const struct pci_device_id cciss_pci_device_id[] = { 0x0E11, 0x409D, 0, 0, 0}, { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC, 0x0E11, 0x4091, 0, 0, 0}, - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC, - 0x0E11, 0x409E, 0, 0, 0}, - { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISS, - 0x103C, 0x3211, 0, 0, 0}, + { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSA, + 0x103C, 0x3225, 0, 0, 0}, {0,} }; MODULE_DEVICE_TABLE(pci, cciss_pci_device_id); @@ -104,8 +102,7 @@ static struct board_type products[] = { { 0x409C0E11, "Smart Array 6400", &SA5_access}, { 0x409D0E11, "Smart Array 6400 EM", &SA5_access}, { 0x40910E11, "Smart Array 6i", &SA5_access}, - { 0x409E0E11, "Smart Array 6422", &SA5_access}, - { 0x3211103C, "Smart Array V100", &SA5_access}, + { 0x3225103C, "Smart Array P600", &SA5_access}, }; /* How long to wait (in millesconds) for board to go into simple mode */ @@ -149,11 +146,18 @@ static void cciss_procinit(int i); static void cciss_procinit(int i) {} #endif /* CONFIG_PROC_FS */ +#ifdef CONFIG_COMPAT +static long cciss_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg); +#endif + static struct block_device_operations cciss_fops = { .owner = THIS_MODULE, .open = cciss_open, .release = cciss_release, .ioctl = cciss_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cciss_compat_ioctl, +#endif .revalidate_disk= cciss_revalidate, }; @@ -185,10 +189,11 @@ static inline CommandList_struct *removeQ(CommandList_struct **Qptr, } return c; } -#ifdef CONFIG_PROC_FS #include "cciss_scsi.c" /* For SCSI tape support */ +#ifdef CONFIG_PROC_FS + /* * Report information about this controller. */ @@ -438,13 +443,22 @@ static int cciss_open(struct inode *inode, struct file *filep) /* * Root is allowed to open raw volume zero even if it's not configured - * so array config can still work. I don't think I really like this, + * so array config can still work. Root is also allowed to open any + * volume that has a LUN ID, so it can issue IOCTL to reread the + * disk information. I don't think I really like this * but I'm already using way to many device nodes to claim another one * for "raw controller". */ if (drv->nr_blocks == 0) { - if (iminor(inode) != 0) + if (iminor(inode) != 0) { /* not node 0? */ + /* if not node 0 make sure it is a partition = 0 */ + if (iminor(inode) & 0x0f) { return -ENXIO; + /* if it is, make sure we have a LUN ID */ + } else if (drv->LunID == 0) { + return -ENXIO; + } + } if (!capable(CAP_SYS_ADMIN)) return -EPERM; } @@ -470,80 +484,50 @@ static int cciss_release(struct inode *inode, struct file *filep) } #ifdef CONFIG_COMPAT -/* for AMD 64 bit kernel compatibility with 32-bit userland ioctls */ -extern long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); -extern int -register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, - unsigned int, unsigned long, struct file *)); -extern int unregister_ioctl32_conversion(unsigned int cmd); - -static int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, struct file *file); -static int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, - struct file *file); - -typedef int (*handler_type) (unsigned int, unsigned int, unsigned long, struct file *); - -static struct ioctl32_map { - unsigned int cmd; - handler_type handler; - int registered; -} cciss_ioctl32_map[] = { - { CCISS_GETPCIINFO, (handler_type) sys_ioctl, 0 }, - { CCISS_GETINTINFO, (handler_type) sys_ioctl, 0 }, - { CCISS_SETINTINFO, (handler_type) sys_ioctl, 0 }, - { CCISS_GETNODENAME, (handler_type) sys_ioctl, 0 }, - { CCISS_SETNODENAME, (handler_type) sys_ioctl, 0 }, - { CCISS_GETHEARTBEAT, (handler_type) sys_ioctl, 0 }, - { CCISS_GETBUSTYPES, (handler_type) sys_ioctl, 0 }, - { CCISS_GETFIRMVER, (handler_type) sys_ioctl, 0 }, - { CCISS_GETDRIVVER, (handler_type) sys_ioctl, 0 }, - { CCISS_REVALIDVOLS, (handler_type) sys_ioctl, 0 }, - { CCISS_PASSTHRU32, cciss_ioctl32_passthru, 0 }, - { CCISS_DEREGDISK, (handler_type) sys_ioctl, 0 }, - { CCISS_REGNEWDISK, (handler_type) sys_ioctl, 0 }, - { CCISS_REGNEWD, (handler_type) sys_ioctl, 0 }, - { CCISS_RESCANDISK, (handler_type) sys_ioctl, 0 }, - { CCISS_GETLUNINFO, (handler_type) sys_ioctl, 0 }, - { CCISS_BIG_PASSTHRU32, cciss_ioctl32_big_passthru, 0 }, -}; -#define NCCISS_IOCTL32_ENTRIES (sizeof(cciss_ioctl32_map) / sizeof(cciss_ioctl32_map[0])) -static void register_cciss_ioctl32(void) + +static int do_ioctl(struct file *f, unsigned cmd, unsigned long arg) { - int i, rc; - - for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) { - rc = register_ioctl32_conversion( - cciss_ioctl32_map[i].cmd, - cciss_ioctl32_map[i].handler); - if (rc != 0) { - printk(KERN_WARNING "cciss: failed to register " - "32 bit compatible ioctl 0x%08x\n", - cciss_ioctl32_map[i].cmd); - cciss_ioctl32_map[i].registered = 0; - } else - cciss_ioctl32_map[i].registered = 1; - } + int ret; + lock_kernel(); + ret = cciss_ioctl(f->f_dentry->d_inode, f, cmd, arg); + unlock_kernel(); + return ret; } -static void unregister_cciss_ioctl32(void) + +static int cciss_ioctl32_passthru(struct file *f, unsigned cmd, unsigned long arg); +static int cciss_ioctl32_big_passthru(struct file *f, unsigned cmd, unsigned long arg); + +static long cciss_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg) { - int i, rc; + switch (cmd) { + case CCISS_GETPCIINFO: + case CCISS_GETINTINFO: + case CCISS_SETINTINFO: + case CCISS_GETNODENAME: + case CCISS_SETNODENAME: + case CCISS_GETHEARTBEAT: + case CCISS_GETBUSTYPES: + case CCISS_GETFIRMVER: + case CCISS_GETDRIVVER: + case CCISS_REVALIDVOLS: + case CCISS_DEREGDISK: + case CCISS_REGNEWDISK: + case CCISS_REGNEWD: + case CCISS_RESCANDISK: + case CCISS_GETLUNINFO: + return do_ioctl(f, cmd, arg); - for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) { - if (!cciss_ioctl32_map[i].registered) - continue; - rc = unregister_ioctl32_conversion( - cciss_ioctl32_map[i].cmd); - if (rc == 0) { - cciss_ioctl32_map[i].registered = 0; - continue; - } - printk(KERN_WARNING "cciss: failed to unregister " - "32 bit compatible ioctl 0x%08x\n", - cciss_ioctl32_map[i].cmd); + case CCISS_PASSTHRU32: + return cciss_ioctl32_passthru(f, cmd, arg); + case CCISS_BIG_PASSTHRU32: + return cciss_ioctl32_big_passthru(f, cmd, arg); + + default: + return -ENOIOCTLCMD; } } -int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, - struct file *file) + +static int cciss_ioctl32_passthru(struct file *f, unsigned cmd, unsigned long arg) { IOCTL32_Command_struct __user *arg32 = (IOCTL32_Command_struct __user *) arg; @@ -564,7 +548,7 @@ int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, if (err) return -EFAULT; - err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) p); + err = do_ioctl(f, CCISS_PASSTHRU, (unsigned long) p); if (err) return err; err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(arg32->error_info)); @@ -573,8 +557,7 @@ int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, return err; } -int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, - struct file *file) +static int cciss_ioctl32_big_passthru(struct file *file, unsigned cmd, unsigned long arg) { BIG_IOCTL32_Command_struct __user *arg32 = (BIG_IOCTL32_Command_struct __user *) arg; @@ -596,7 +579,7 @@ int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, if (err) return -EFAULT; - err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) p); + err = do_ioctl(file, CCISS_BIG_PASSTHRU, (unsigned long) p); if (err) return err; err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(arg32->error_info)); @@ -604,9 +587,6 @@ int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, return -EFAULT; return err; } -#else -static inline void register_cciss_ioctl32(void) {} -static inline void unregister_cciss_ioctl32(void) {} #endif /* * ioctl @@ -799,7 +779,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, luninfo.num_opens = drv->usage_count; luninfo.num_parts = 0; /* count partitions 1 to 15 with sizes > 0 */ - for(i=1; i part[i]) continue; if (disk->part[i]->nr_sects != 0) @@ -1090,18 +1070,11 @@ cleanup1: return(status); } default: - return -EBADRQC; + return -ENOTTY; } } -static int cciss_revalidate(struct gendisk *disk) -{ - drive_info_struct *drv = disk->private_data; - set_capacity(disk, drv->nr_blocks); - return 0; -} - /* * revalidate_allvol is for online array config utilities. After a * utility reconfigures the drives in the array, it can use this function @@ -1153,7 +1126,9 @@ static int revalidate_allvol(ctlr_info_t *host) for (i = 0; i < NWD; i++) { struct gendisk *disk = host->gendisk[i]; drive_info_struct *drv = &(host->drv[i]); - if (!drv->nr_blocks) + /* we must register the controller even if no disks exist */ + /* this is for the online array utilities */ + if (!drv->heads && i) continue; blk_queue_hardsect_size(host->queue, drv->block_size); set_capacity(disk, drv->nr_blocks); @@ -1485,13 +1460,7 @@ static void cciss_geometry_inquiry(int ctlr, int logvol, } } } else { /* Get geometry failed */ - printk(KERN_WARNING "cciss: reading geometry failed, " - "continuing with default geometry\n"); - drv->block_size = block_size; - drv->nr_blocks = total_size; - drv->heads = 255; - drv->sectors = 32; // Sectors per track - drv->cylinders = total_size / 255 / 32; + printk(KERN_WARNING "cciss: reading geometry failed\n"); } printk(KERN_INFO " heads= %d, sectors= %d, cylinders= %d\n\n", drv->heads, drv->sectors, drv->cylinders); @@ -1520,6 +1489,7 @@ cciss_read_capacity(int ctlr, int logvol, ReadCapdata_struct *buf, *total_size, *block_size); return; } + static int register_new_disk(ctlr_info_t *h) { struct gendisk *disk; @@ -1663,7 +1633,9 @@ static int register_new_disk(ctlr_info_t *h) /* setup partitions per disk */ disk = h->gendisk[logvol]; set_capacity(disk, h->drv[logvol].nr_blocks); - add_disk(disk); + /* if it's the controller it's already added */ + if(logvol) + add_disk(disk); freeret: kfree(ld_buff); kfree(size_buff); @@ -1675,6 +1647,53 @@ free_err: logvol = -1; goto freeret; } + +static int cciss_revalidate(struct gendisk *disk) +{ + ctlr_info_t *h = get_host(disk); + drive_info_struct *drv = get_drv(disk); + int logvol; + int FOUND=0; + unsigned int block_size; + unsigned int total_size; + ReadCapdata_struct *size_buff = NULL; + InquiryData_struct *inq_buff = NULL; + + for(logvol=0; logvol < CISS_MAX_LUN; logvol++) + { + if(h->drv[logvol].LunID == drv->LunID) { + FOUND=1; + break; + } + } + + if (!FOUND) return 1; + + size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL); + if (size_buff == NULL) + { + printk(KERN_WARNING "cciss: out of memory\n"); + return 1; + } + inq_buff = kmalloc(sizeof( InquiryData_struct), GFP_KERNEL); + if (inq_buff == NULL) + { + printk(KERN_WARNING "cciss: out of memory\n"); + kfree(size_buff); + return 1; + } + + cciss_read_capacity(h->ctlr, logvol, size_buff, 1, &total_size, &block_size); + cciss_geometry_inquiry(h->ctlr, logvol, 1, total_size, block_size, inq_buff, drv); + + blk_queue_hardsect_size(h->queue, drv->block_size); + set_capacity(disk, drv->nr_blocks); + + kfree(size_buff); + kfree(inq_buff); + return 0; +} + /* * Wait polling for a command to complete. * The memory mapped FIFO is polled for the completion. @@ -2762,7 +2781,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, disk->fops = &cciss_fops; disk->queue = hba[i]->queue; disk->private_data = drv; - if( !(drv->nr_blocks)) + /* we must register the controller even if no disks exist */ + /* this is for the online array utilities */ + if(!drv->heads && j) continue; blk_queue_hardsect_size(hba[i]->queue, drv->block_size); set_capacity(disk, drv->nr_blocks); @@ -2867,7 +2888,6 @@ int __init cciss_init(void) static int __init init_cciss_module(void) { - register_cciss_ioctl32(); return ( cciss_init()); } @@ -2875,7 +2895,6 @@ static void __exit cleanup_cciss_module(void) { int i; - unregister_cciss_ioctl32(); pci_unregister_driver(&cciss_pci_driver); /* double check that all controller entrys have been removed */ for (i=0; i< MAX_CTLR; i++) diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 9df82b8e9..6f6bc09fa 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to arrays@compaq.com + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * * Author: Stephen M. Cameron */ @@ -28,7 +28,9 @@ through the array controller. Note in particular, neither physical nor logical disks are presented through the scsi layer. */ -#include "../scsi/scsi.h" +#include +#include +#include #include #include #include @@ -61,15 +63,8 @@ int cciss_scsi_proc_info( int length, /* length of data in buffer */ int func); /* 0 == read, 1 == write */ -int cciss_scsi_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)); -#if 0 -int cciss_scsi_abort(Scsi_Cmnd *cmd); -#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS -int cciss_scsi_reset(Scsi_Cmnd *cmd, unsigned int reset_flags); -#else -int cciss_scsi_reset(Scsi_Cmnd *cmd); -#endif -#endif +int cciss_scsi_queue_command (struct scsi_cmnd *cmd, + void (* done)(struct scsi_cmnd *)); static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = { { .name = "cciss0", .ndevices = 0 }, @@ -82,7 +77,7 @@ static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = { { .name = "cciss7", .ndevices = 0 }, }; -static Scsi_Host_Template cciss_driver_template = { +static struct scsi_host_template cciss_driver_template = { .module = THIS_MODULE, .name = "cciss", .proc_name = "cciss", @@ -539,7 +534,7 @@ cciss_scsi_setup(int cntl_num) if (shba == NULL) return; shba->scsi_host = NULL; - shba->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&shba->lock); shba->registered = 0; if (scsi_cmd_stack_setup(cntl_num, shba) != 0) { kfree(shba); @@ -552,7 +547,7 @@ cciss_scsi_setup(int cntl_num) static void complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) { - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; ctlr_info_t *ctlr; u64bit addr64; ErrorInfo_struct *ei; @@ -565,7 +560,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) return; } - cmd = (Scsi_Cmnd *) cp->scsi_cmd; + cmd = (struct scsi_cmnd *) cp->scsi_cmd; ctlr = hba[cp->ctlr]; /* undo the DMA mappings */ @@ -573,14 +568,14 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) if (cmd->use_sg) { pci_unmap_sg(ctlr->pdev, cmd->buffer, cmd->use_sg, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); } else if (cmd->request_bufflen) { addr64.val32.lower = cp->SG[0].Addr.lower; addr64.val32.upper = cp->SG[0].Addr.upper; pci_unmap_single(ctlr->pdev, (dma_addr_t) addr64.val, cmd->request_bufflen, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); } cmd->result = (DID_OK << 16); /* host byte */ @@ -696,14 +691,13 @@ static int cciss_scsi_detect(int ctlr) { struct Scsi_Host *sh; + int error; sh = scsi_host_alloc(&cciss_driver_template, sizeof(struct ctlr_info *)); if (sh == NULL) - return 0; - + goto fail; sh->io_port = 0; // good enough? FIXME, sh->n_io_port = 0; // I don't think we use these two... - sh->this_id = SELF_SCSI_ID; ((struct cciss_scsi_adapter_data_t *) @@ -711,10 +705,16 @@ cciss_scsi_detect(int ctlr) sh->hostdata[0] = (unsigned long) hba[ctlr]; sh->irq = hba[ctlr]->intr; sh->unique_id = sh->irq; - scsi_add_host(sh, &hba[ctlr]->pdev->dev); /* XXX handle failure */ + error = scsi_add_host(sh, &hba[ctlr]->pdev->dev); + if (error) + goto fail_host_put; scsi_scan_host(sh); - return 1; + + fail_host_put: + scsi_host_put(sh); + fail: + return 0; } static void __exit cleanup_cciss_module(void); @@ -783,9 +783,8 @@ cciss_scsi_do_simple_cmd(ctlr_info_t *c, cp->Request.Type.Direction = direction; /* Fill in the SG list and do dma mapping */ - cciss_map_one(c->pdev, cp, - (unsigned char *) buf, bufsize, - scsi_to_pci_dma_dir(SCSI_DATA_READ)); + cciss_map_one(c->pdev, cp, (unsigned char *) buf, + bufsize, DMA_FROM_DEVICE); cp->waiting = &wait; @@ -799,9 +798,7 @@ cciss_scsi_do_simple_cmd(ctlr_info_t *c, wait_for_completion(&wait); /* undo the dma mapping */ - cciss_unmap_one(c->pdev, cp, bufsize, - scsi_to_pci_dma_dir(SCSI_DATA_READ)); - + cciss_unmap_one(c->pdev, cp, bufsize, DMA_FROM_DEVICE); return(0); } @@ -1180,14 +1177,14 @@ cciss_scsi_info(struct Scsi_Host *sa) } -/* cciss_scatter_gather takes a Scsi_Cmnd, (cmd), and does the pci +/* cciss_scatter_gather takes a struct scsi_cmnd, (cmd), and does the pci dma mapping and fills in the scatter gather entries of the cciss command, cp. */ static void cciss_scatter_gather(struct pci_dev *pdev, CommandList_struct *cp, - Scsi_Cmnd *cmd) + struct scsi_cmnd *cmd) { unsigned int use_sg, nsegs=0, len; struct scatterlist *scatter = (struct scatterlist *) cmd->buffer; @@ -1200,7 +1197,7 @@ cciss_scatter_gather(struct pci_dev *pdev, addr64 = (__u64) pci_map_single(pdev, cmd->request_buffer, cmd->request_bufflen, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); cp->SG[0].Addr.lower = (__u32) (addr64 & (__u64) 0x00000000FFFFFFFF); @@ -1213,7 +1210,7 @@ cciss_scatter_gather(struct pci_dev *pdev, else if (cmd->use_sg <= MAXSGENTRIES) { /* not too many addrs? */ use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); for (nsegs=0; nsegs < use_sg; nsegs++) { addr64 = (__u64) sg_dma_address(&scatter[nsegs]); @@ -1234,7 +1231,7 @@ cciss_scatter_gather(struct pci_dev *pdev, int -cciss_scsi_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) +cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) { ctlr_info_t **c; int ctlr, rc; @@ -1302,11 +1299,10 @@ cciss_scsi_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) cp->Request.Type.Attribute = ATTR_SIMPLE; switch(cmd->sc_data_direction) { - case SCSI_DATA_WRITE: cp->Request.Type.Direction = XFER_WRITE; break; - case SCSI_DATA_READ: cp->Request.Type.Direction = XFER_READ; break; - case SCSI_DATA_NONE: cp->Request.Type.Direction = XFER_NONE; break; - - case SCSI_DATA_UNKNOWN: + case DMA_TO_DEVICE: cp->Request.Type.Direction = XFER_WRITE; break; + case DMA_FROM_DEVICE: cp->Request.Type.Direction = XFER_READ; break; + case DMA_NONE: cp->Request.Type.Direction = XFER_NONE; break; + case DMA_BIDIRECTIONAL: // This can happen if a buggy application does a scsi passthru // and sets both inlen and outlen to non-zero. ( see // ../scsi/scsi_ioctl.c:scsi_ioctl_send_command() ) diff --git a/drivers/block/cciss_scsi.h b/drivers/block/cciss_scsi.h index a2279b77d..51f1a9b40 100644 --- a/drivers/block/cciss_scsi.h +++ b/drivers/block/cciss_scsi.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to arrays@compaq.com + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * */ #ifdef CONFIG_CISS_SCSI_TAPE diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c index 068f4eae0..423450856 100644 --- a/drivers/block/cfq-iosched.c +++ b/drivers/block/cfq-iosched.c @@ -22,96 +22,211 @@ #include #include +static unsigned long max_elapsed_crq; +static unsigned long max_elapsed_dispatch; + /* * tunables */ -static int cfq_quantum = 4; -static int cfq_queued = 8; +static int cfq_quantum = 4; /* max queue in one round of service */ +static int cfq_queued = 8; /* minimum rq allocate limit per-queue*/ +static int cfq_service = HZ; /* period over which service is avg */ +static int cfq_fifo_expire_r = HZ / 2; /* fifo timeout for sync requests */ +static int cfq_fifo_expire_w = 5 * HZ; /* fifo timeout for async requests */ +static int cfq_fifo_rate = HZ / 8; /* fifo expiry rate */ +static int cfq_back_max = 16 * 1024; /* maximum backwards seek, in KiB */ +static int cfq_back_penalty = 2; /* penalty of a backwards seek */ +/* + * for the hash of cfqq inside the cfqd + */ #define CFQ_QHASH_SHIFT 6 #define CFQ_QHASH_ENTRIES (1 << CFQ_QHASH_SHIFT) -#define list_entry_qhash(entry) list_entry((entry), struct cfq_queue, cfq_hash) +#define list_entry_qhash(entry) hlist_entry((entry), struct cfq_queue, cfq_hash) -#define CFQ_MHASH_SHIFT 8 +/* + * for the hash of crq inside the cfqq + */ +#define CFQ_MHASH_SHIFT 6 #define CFQ_MHASH_BLOCK(sec) ((sec) >> 3) #define CFQ_MHASH_ENTRIES (1 << CFQ_MHASH_SHIFT) -#define CFQ_MHASH_FN(sec) (hash_long(CFQ_MHASH_BLOCK((sec)),CFQ_MHASH_SHIFT)) -#define ON_MHASH(crq) !list_empty(&(crq)->hash) +#define CFQ_MHASH_FN(sec) hash_long(CFQ_MHASH_BLOCK(sec), CFQ_MHASH_SHIFT) #define rq_hash_key(rq) ((rq)->sector + (rq)->nr_sectors) -#define list_entry_hash(ptr) list_entry((ptr), struct cfq_rq, hash) +#define list_entry_hash(ptr) hlist_entry((ptr), struct cfq_rq, hash) #define list_entry_cfqq(ptr) list_entry((ptr), struct cfq_queue, cfq_list) -#define RQ_DATA(rq) ((struct cfq_rq *) (rq)->elevator_private) +#define RQ_DATA(rq) (rq)->elevator_private + +/* + * rb-tree defines + */ +#define RB_NONE (2) +#define RB_EMPTY(node) ((node)->rb_node == NULL) +#define RB_CLEAR_COLOR(node) (node)->rb_color = RB_NONE +#define RB_CLEAR(node) do { \ + (node)->rb_parent = NULL; \ + RB_CLEAR_COLOR((node)); \ + (node)->rb_right = NULL; \ + (node)->rb_left = NULL; \ +} while (0) +#define RB_CLEAR_ROOT(root) ((root)->rb_node = NULL) +#define ON_RB(node) ((node)->rb_color != RB_NONE) +#define rb_entry_crq(node) rb_entry((node), struct cfq_rq, rb_node) +#define rq_rb_key(rq) (rq)->sector + +/* + * threshold for switching off non-tag accounting + */ +#define CFQ_MAX_TAG (4) + +/* + * sort key types and names + */ +enum { + CFQ_KEY_PGID, + CFQ_KEY_TGID, + CFQ_KEY_UID, + CFQ_KEY_GID, + CFQ_KEY_LAST, +}; + +static char *cfq_key_types[] = { "pgid", "tgid", "uid", "gid", NULL }; static kmem_cache_t *crq_pool; static kmem_cache_t *cfq_pool; -static mempool_t *cfq_mpool; +static kmem_cache_t *cfq_ioc_pool; struct cfq_data { struct list_head rr_list; - struct list_head *dispatch; - struct list_head *cfq_hash; + struct list_head empty_list; - struct list_head *crq_hash; + struct hlist_head *cfq_hash; + struct hlist_head *crq_hash; + /* queues on rr_list (ie they have pending requests */ unsigned int busy_queues; + unsigned int max_queued; + atomic_t ref; + + int key_type; + mempool_t *crq_pool; request_queue_t *queue; + sector_t last_sector; + + int rq_in_driver; + /* - * tunables + * tunables, see top of file */ unsigned int cfq_quantum; unsigned int cfq_queued; + unsigned int cfq_fifo_expire_r; + unsigned int cfq_fifo_expire_w; + unsigned int cfq_fifo_batch_expire; + unsigned int cfq_back_penalty; + unsigned int cfq_back_max; + unsigned int find_best_crq; + + unsigned int cfq_tagged; }; struct cfq_queue { - struct list_head cfq_hash; + /* reference count */ + atomic_t ref; + /* parent cfq_data */ + struct cfq_data *cfqd; + /* hash of mergeable requests */ + struct hlist_node cfq_hash; + /* hash key */ + unsigned long key; + /* whether queue is on rr (or empty) list */ + int on_rr; + /* on either rr or empty list of cfqd */ struct list_head cfq_list; + /* sorted list of pending requests */ struct rb_root sort_list; - int pid; + /* if fifo isn't expired, next request to serve */ + struct cfq_rq *next_crq; + /* requests queued in sort_list */ int queued[2]; -#if 0 - /* - * with a simple addition like this, we can do io priorities. almost. - * does need a split request free list, too. - */ - int io_prio -#endif + /* currently allocated requests */ + int allocated[2]; + /* fifo list of requests in sort_list */ + struct list_head fifo[2]; + /* last time fifo expired */ + unsigned long last_fifo_expire; + + int key_type; + + unsigned long service_start; + unsigned long service_used; + + unsigned int max_rate; + + /* number of requests that have been handed to the driver */ + int in_flight; + /* number of currently allocated requests */ + int alloc_limit[2]; }; struct cfq_rq { struct rb_node rb_node; sector_t rb_key; - struct request *request; + struct hlist_node hash; struct cfq_queue *cfq_queue; + struct cfq_io_context *io_context; + + unsigned long service_start; + unsigned long queue_start; - struct list_head hash; + unsigned int in_flight : 1; + unsigned int accounted : 1; + unsigned int is_sync : 1; + unsigned int is_write : 1; }; -static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq); -static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid); -static void cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq, - struct cfq_rq *crq); +static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *, unsigned long); +static void cfq_dispatch_sort(request_queue_t *, struct cfq_rq *); +static void cfq_update_next_crq(struct cfq_rq *); +static void cfq_put_cfqd(struct cfq_data *cfqd); /* - * lots of deadline iosched dupes, can be abstracted later... + * what the fairness is based on (ie how processes are grouped and + * differentiated) */ -static inline void __cfq_del_crq_hash(struct cfq_rq *crq) +static inline unsigned long +cfq_hash_key(struct cfq_data *cfqd, struct task_struct *tsk) { - list_del_init(&crq->hash); + /* + * optimize this so that ->key_type is the offset into the struct + */ + switch (cfqd->key_type) { + case CFQ_KEY_PGID: + return process_group(tsk); + default: + case CFQ_KEY_TGID: + return tsk->tgid; + case CFQ_KEY_UID: + return tsk->uid; + case CFQ_KEY_GID: + return tsk->gid; + } } +/* + * lots of deadline iosched dupes, can be abstracted later... + */ static inline void cfq_del_crq_hash(struct cfq_rq *crq) { - if (ON_MHASH(crq)) - __cfq_del_crq_hash(crq); + hlist_del_init(&crq->hash); } static void cfq_remove_merge_hints(request_queue_t *q, struct cfq_rq *crq) @@ -120,32 +235,32 @@ static void cfq_remove_merge_hints(request_queue_t *q, struct cfq_rq *crq) if (q->last_merge == crq->request) q->last_merge = NULL; + + cfq_update_next_crq(crq); } static inline void cfq_add_crq_hash(struct cfq_data *cfqd, struct cfq_rq *crq) { - struct request *rq = crq->request; + const int hash_idx = CFQ_MHASH_FN(rq_hash_key(crq->request)); - BUG_ON(ON_MHASH(crq)); + BUG_ON(!hlist_unhashed(&crq->hash)); - list_add(&crq->hash, &cfqd->crq_hash[CFQ_MHASH_FN(rq_hash_key(rq))]); + hlist_add_head(&crq->hash, &cfqd->crq_hash[hash_idx]); } static struct request *cfq_find_rq_hash(struct cfq_data *cfqd, sector_t offset) { - struct list_head *hash_list = &cfqd->crq_hash[CFQ_MHASH_FN(offset)]; - struct list_head *entry, *next = hash_list->next; + struct hlist_head *hash_list = &cfqd->crq_hash[CFQ_MHASH_FN(offset)]; + struct hlist_node *entry, *next; - while ((entry = next) != hash_list) { + hlist_for_each_safe(entry, next, hash_list) { struct cfq_rq *crq = list_entry_hash(entry); struct request *__rq = crq->request; - next = entry->next; - - BUG_ON(!ON_MHASH(crq)); + BUG_ON(hlist_unhashed(&crq->hash)); if (!rq_mergeable(__rq)) { - __cfq_del_crq_hash(crq); + cfq_del_crq_hash(crq); continue; } @@ -157,29 +272,257 @@ static struct request *cfq_find_rq_hash(struct cfq_data *cfqd, sector_t offset) } /* - * rb tree support functions + * Lifted from AS - choose which of crq1 and crq2 that is best served now. + * We choose the request that is closest to the head right now. Distance + * behind the head are penalized and only allowed to a certain extent. */ -#define RB_NONE (2) -#define RB_EMPTY(node) ((node)->rb_node == NULL) -#define RB_CLEAR(node) ((node)->rb_color = RB_NONE) -#define RB_CLEAR_ROOT(root) ((root)->rb_node = NULL) -#define ON_RB(node) ((node)->rb_color != RB_NONE) -#define rb_entry_crq(node) rb_entry((node), struct cfq_rq, rb_node) -#define rq_rb_key(rq) (rq)->sector +static struct cfq_rq * +cfq_choose_req(struct cfq_data *cfqd, struct cfq_rq *crq1, struct cfq_rq *crq2) +{ + sector_t last, s1, s2, d1 = 0, d2 = 0; + int r1_wrap = 0, r2_wrap = 0; /* requests are behind the disk head */ + unsigned long back_max; + + if (crq1 == NULL || crq1 == crq2) + return crq2; + if (crq2 == NULL) + return crq1; + + s1 = crq1->request->sector; + s2 = crq2->request->sector; + + last = cfqd->last_sector; + +#if 0 + if (!list_empty(&cfqd->queue->queue_head)) { + struct list_head *entry = &cfqd->queue->queue_head; + unsigned long distance = ~0UL; + struct request *rq; + + while ((entry = entry->prev) != &cfqd->queue->queue_head) { + rq = list_entry_rq(entry); + + if (blk_barrier_rq(rq)) + break; + + if (distance < abs(s1 - rq->sector + rq->nr_sectors)) { + distance = abs(s1 - rq->sector +rq->nr_sectors); + last = rq->sector + rq->nr_sectors; + } + if (distance < abs(s2 - rq->sector + rq->nr_sectors)) { + distance = abs(s2 - rq->sector +rq->nr_sectors); + last = rq->sector + rq->nr_sectors; + } + } + } +#endif + + /* + * by definition, 1KiB is 2 sectors + */ + back_max = cfqd->cfq_back_max * 2; + + /* + * Strict one way elevator _except_ in the case where we allow + * short backward seeks which are biased as twice the cost of a + * similar forward seek. + */ + if (s1 >= last) + d1 = s1 - last; + else if (s1 + back_max >= last) + d1 = (last - s1) * cfqd->cfq_back_penalty; + else + r1_wrap = 1; + + if (s2 >= last) + d2 = s2 - last; + else if (s2 + back_max >= last) + d2 = (last - s2) * cfqd->cfq_back_penalty; + else + r2_wrap = 1; + + /* Found required data */ + if (!r1_wrap && r2_wrap) + return crq1; + else if (!r2_wrap && r1_wrap) + return crq2; + else if (r1_wrap && r2_wrap) { + /* both behind the head */ + if (s1 <= s2) + return crq1; + else + return crq2; + } + + /* Both requests in front of the head */ + if (d1 < d2) + return crq1; + else if (d2 < d1) + return crq2; + else { + if (s1 >= s2) + return crq1; + else + return crq2; + } +} -static inline void cfq_del_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq) +/* + * would be nice to take fifo expire time into account as well + */ +static struct cfq_rq * +cfq_find_next_crq(struct cfq_data *cfqd, struct cfq_queue *cfqq, + struct cfq_rq *last) +{ + struct cfq_rq *crq_next = NULL, *crq_prev = NULL; + struct rb_node *rbnext, *rbprev; + + if (!ON_RB(&last->rb_node)) + return NULL; + + if ((rbnext = rb_next(&last->rb_node)) == NULL) + rbnext = rb_first(&cfqq->sort_list); + + rbprev = rb_prev(&last->rb_node); + + if (rbprev) + crq_prev = rb_entry_crq(rbprev); + if (rbnext) + crq_next = rb_entry_crq(rbnext); + + return cfq_choose_req(cfqd, crq_next, crq_prev); +} + +static void cfq_update_next_crq(struct cfq_rq *crq) { + struct cfq_queue *cfqq = crq->cfq_queue; + + if (cfqq->next_crq == crq) + cfqq->next_crq = cfq_find_next_crq(cfqq->cfqd, cfqq, crq); +} + +static int cfq_check_sort_rr_list(struct cfq_queue *cfqq) +{ + struct list_head *head = &cfqq->cfqd->rr_list; + struct list_head *next, *prev; + + /* + * list might still be ordered + */ + next = cfqq->cfq_list.next; + if (next != head) { + struct cfq_queue *cnext = list_entry_cfqq(next); + + if (cfqq->service_used > cnext->service_used) + return 1; + } + + prev = cfqq->cfq_list.prev; + if (prev != head) { + struct cfq_queue *cprev = list_entry_cfqq(prev); + + if (cfqq->service_used < cprev->service_used) + return 1; + } + + return 0; +} + +static void cfq_sort_rr_list(struct cfq_queue *cfqq, int new_queue) +{ + struct list_head *entry = &cfqq->cfqd->rr_list; + + if (!cfqq->on_rr) + return; + if (!new_queue && !cfq_check_sort_rr_list(cfqq)) + return; + + list_del(&cfqq->cfq_list); + + /* + * sort by our mean service_used, sub-sort by in-flight requests + */ + while ((entry = entry->prev) != &cfqq->cfqd->rr_list) { + struct cfq_queue *__cfqq = list_entry_cfqq(entry); + + if (cfqq->service_used > __cfqq->service_used) + break; + else if (cfqq->service_used == __cfqq->service_used) { + struct list_head *prv; + + while ((prv = entry->prev) != &cfqq->cfqd->rr_list) { + __cfqq = list_entry_cfqq(prv); + + WARN_ON(__cfqq->service_used > cfqq->service_used); + if (cfqq->service_used != __cfqq->service_used) + break; + if (cfqq->in_flight > __cfqq->in_flight) + break; + + entry = prv; + } + } + } + + list_add(&cfqq->cfq_list, entry); +} + +/* + * add to busy list of queues for service, trying to be fair in ordering + * the pending list according to requests serviced + */ +static inline void +cfq_add_cfqq_rr(struct cfq_data *cfqd, struct cfq_queue *cfqq) +{ + /* + * it's currently on the empty list + */ + cfqq->on_rr = 1; + cfqd->busy_queues++; + + if (time_after(jiffies, cfqq->service_start + cfq_service)) + cfqq->service_used >>= 3; + + cfq_sort_rr_list(cfqq, 1); +} + +static inline void +cfq_del_cfqq_rr(struct cfq_data *cfqd, struct cfq_queue *cfqq) +{ + list_move(&cfqq->cfq_list, &cfqd->empty_list); + cfqq->on_rr = 0; + + BUG_ON(!cfqd->busy_queues); + cfqd->busy_queues--; +} + +/* + * rb tree support functions + */ +static inline void cfq_del_crq_rb(struct cfq_rq *crq) +{ + struct cfq_queue *cfqq = crq->cfq_queue; + if (ON_RB(&crq->rb_node)) { - cfqq->queued[rq_data_dir(crq->request)]--; + struct cfq_data *cfqd = cfqq->cfqd; + + BUG_ON(!cfqq->queued[crq->is_sync]); + + cfq_update_next_crq(crq); + + cfqq->queued[crq->is_sync]--; rb_erase(&crq->rb_node, &cfqq->sort_list); - crq->cfq_queue = NULL; + RB_CLEAR_COLOR(&crq->rb_node); + + if (RB_EMPTY(&cfqq->sort_list) && cfqq->on_rr) + cfq_del_cfqq_rr(cfqd, cfqq); } } static struct cfq_rq * -__cfq_add_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq) +__cfq_add_crq_rb(struct cfq_rq *crq) { - struct rb_node **p = &cfqq->sort_list.rb_node; + struct rb_node **p = &crq->cfq_queue->sort_list.rb_node; struct rb_node *parent = NULL; struct cfq_rq *__crq; @@ -199,30 +542,50 @@ __cfq_add_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq) return NULL; } -static void -cfq_add_crq_rb(struct cfq_data *cfqd, struct cfq_queue *cfqq,struct cfq_rq *crq) +static void cfq_add_crq_rb(struct cfq_rq *crq) { + struct cfq_queue *cfqq = crq->cfq_queue; + struct cfq_data *cfqd = cfqq->cfqd; struct request *rq = crq->request; struct cfq_rq *__alias; crq->rb_key = rq_rb_key(rq); - cfqq->queued[rq_data_dir(rq)]++; -retry: - __alias = __cfq_add_crq_rb(cfqq, crq); - if (!__alias) { - rb_insert_color(&crq->rb_node, &cfqq->sort_list); - crq->cfq_queue = cfqq; - return; + cfqq->queued[crq->is_sync]++; + + /* + * looks a little odd, but the first insert might return an alias. + * if that happens, put the alias on the dispatch list + */ + while ((__alias = __cfq_add_crq_rb(crq)) != NULL) + cfq_dispatch_sort(cfqd->queue, __alias); + + rb_insert_color(&crq->rb_node, &cfqq->sort_list); + + if (!cfqq->on_rr) + cfq_add_cfqq_rr(cfqd, cfqq); + + /* + * check if this request is a better next-serve candidate + */ + cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); +} + +static inline void +cfq_reposition_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq) +{ + if (ON_RB(&crq->rb_node)) { + rb_erase(&crq->rb_node, &cfqq->sort_list); + cfqq->queued[crq->is_sync]--; } - cfq_dispatch_sort(cfqd, cfqq, __alias); - goto retry; + cfq_add_crq_rb(crq); } static struct request * cfq_find_rq_rb(struct cfq_data *cfqd, sector_t sector) { - struct cfq_queue *cfqq = cfq_find_cfq_hash(cfqd, current->tgid); + const unsigned long key = cfq_hash_key(cfqd, current); + struct cfq_queue *cfqq = cfq_find_cfq_hash(cfqd, key); struct rb_node *n; if (!cfqq) @@ -244,30 +607,46 @@ out: return NULL; } -static void cfq_remove_request(request_queue_t *q, struct request *rq) +/* + * make sure the service time gets corrected on reissue of this request + */ +static void cfq_requeue_request(request_queue_t *q, struct request *rq) { - struct cfq_data *cfqd = q->elevator.elevator_data; struct cfq_rq *crq = RQ_DATA(rq); if (crq) { struct cfq_queue *cfqq = crq->cfq_queue; + if (cfqq->cfqd->cfq_tagged) { + cfqq->service_used--; + cfq_sort_rr_list(cfqq, 0); + } + + if (crq->accounted) { + crq->accounted = 0; + cfqq->cfqd->rq_in_driver--; + } + } + list_add(&rq->queuelist, &q->queue_head); +} + +static void cfq_remove_request(request_queue_t *q, struct request *rq) +{ + struct cfq_rq *crq = RQ_DATA(rq); + + if (crq) { cfq_remove_merge_hints(q, crq); list_del_init(&rq->queuelist); - if (cfqq) { - cfq_del_crq_rb(cfqq, crq); - - if (RB_EMPTY(&cfqq->sort_list)) - cfq_put_queue(cfqd, cfqq); - } + if (crq->cfq_queue) + cfq_del_crq_rb(crq); } } static int cfq_merge(request_queue_t *q, struct request **req, struct bio *bio) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct request *__rq; int ret; @@ -305,7 +684,7 @@ out_insert: static void cfq_merged_request(request_queue_t *q, struct request *req) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_rq *crq = RQ_DATA(req); cfq_del_crq_hash(crq); @@ -314,234 +693,570 @@ static void cfq_merged_request(request_queue_t *q, struct request *req) if (ON_RB(&crq->rb_node) && (rq_rb_key(req) != crq->rb_key)) { struct cfq_queue *cfqq = crq->cfq_queue; - cfq_del_crq_rb(cfqq, crq); - cfq_add_crq_rb(cfqd, cfqq, crq); + cfq_update_next_crq(crq); + cfq_reposition_crq_rb(cfqq, crq); } q->last_merge = req; } static void -cfq_merged_requests(request_queue_t *q, struct request *req, +cfq_merged_requests(request_queue_t *q, struct request *rq, struct request *next) { - cfq_merged_request(q, req); + struct cfq_rq *crq = RQ_DATA(rq); + struct cfq_rq *cnext = RQ_DATA(next); + + cfq_merged_request(q, rq); + + if (!list_empty(&rq->queuelist) && !list_empty(&next->queuelist)) { + if (time_before(cnext->queue_start, crq->queue_start)) { + list_move(&rq->queuelist, &next->queuelist); + crq->queue_start = cnext->queue_start; + } + } + + cfq_update_next_crq(cnext); cfq_remove_request(q, next); } -static void -cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq, - struct cfq_rq *crq) +/* + * we dispatch cfqd->cfq_quantum requests in total from the rr_list queues, + * this function sector sorts the selected request to minimize seeks. we start + * at cfqd->last_sector, not 0. + */ +static void cfq_dispatch_sort(request_queue_t *q, struct cfq_rq *crq) { - struct list_head *head = cfqd->dispatch, *entry = head; + struct cfq_data *cfqd = q->elevator->elevator_data; + struct cfq_queue *cfqq = crq->cfq_queue; + struct list_head *head = &q->queue_head, *entry = head; struct request *__rq; + sector_t last; - cfq_del_crq_rb(cfqq, crq); - cfq_remove_merge_hints(cfqd->queue, crq); + cfq_del_crq_rb(crq); + cfq_remove_merge_hints(q, crq); + list_del(&crq->request->queuelist); - if (!list_empty(head)) { - __rq = list_entry_rq(head->next); + last = cfqd->last_sector; + while ((entry = entry->prev) != head) { + __rq = list_entry_rq(entry); + + if (blk_barrier_rq(crq->request)) + break; + if (!blk_fs_request(crq->request)) + break; - if (crq->request->sector < __rq->sector) { - entry = head->prev; - goto link; + if (crq->request->sector > __rq->sector) + break; + if (__rq->sector > last && crq->request->sector < last) { + last = crq->request->sector; + break; } } - while ((entry = entry->prev) != head) { - __rq = list_entry_rq(entry); + cfqd->last_sector = last; + crq->in_flight = 1; + cfqq->in_flight++; + list_add(&crq->request->queuelist, entry); +} - if (crq->request->sector <= __rq->sector) - break; +/* + * return expired entry, or NULL to just start from scratch in rbtree + */ +static inline struct cfq_rq *cfq_check_fifo(struct cfq_queue *cfqq) +{ + struct cfq_data *cfqd = cfqq->cfqd; + const int reads = !list_empty(&cfqq->fifo[0]); + const int writes = !list_empty(&cfqq->fifo[1]); + unsigned long now = jiffies; + struct cfq_rq *crq; + + if (time_before(now, cfqq->last_fifo_expire + cfqd->cfq_fifo_batch_expire)) + return NULL; + + crq = RQ_DATA(list_entry(cfqq->fifo[0].next, struct request, queuelist)); + if (reads && time_after(now, crq->queue_start + cfqd->cfq_fifo_expire_r)) { + cfqq->last_fifo_expire = now; + return crq; + } + + crq = RQ_DATA(list_entry(cfqq->fifo[1].next, struct request, queuelist)); + if (writes && time_after(now, crq->queue_start + cfqd->cfq_fifo_expire_w)) { + cfqq->last_fifo_expire = now; + return crq; } -link: - list_add_tail(&crq->request->queuelist, entry); + return NULL; } +/* + * dispatch a single request from given queue + */ static inline void -__cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd, - struct cfq_queue *cfqq) +cfq_dispatch_request(request_queue_t *q, struct cfq_data *cfqd, + struct cfq_queue *cfqq) { - struct cfq_rq *crq = rb_entry_crq(rb_first(&cfqq->sort_list)); + struct cfq_rq *crq; + + /* + * follow expired path, else get first next available + */ + if ((crq = cfq_check_fifo(cfqq)) == NULL) { + if (cfqd->find_best_crq) + crq = cfqq->next_crq; + else + crq = rb_entry_crq(rb_first(&cfqq->sort_list)); + } + + cfqd->last_sector = crq->request->sector + crq->request->nr_sectors; - cfq_dispatch_sort(cfqd, cfqq, crq); + /* + * finally, insert request into driver list + */ + cfq_dispatch_sort(q, crq); } -static int cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd) +static int cfq_dispatch_requests(request_queue_t *q, int max_dispatch) { + struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_queue *cfqq; struct list_head *entry, *tmp; - int ret, queued, good_queues; + int queued, busy_queues, first_round; if (list_empty(&cfqd->rr_list)) return 0; - queued = ret = 0; + queued = 0; + first_round = 1; restart: - good_queues = 0; + busy_queues = 0; list_for_each_safe(entry, tmp, &cfqd->rr_list) { - cfqq = list_entry_cfqq(cfqd->rr_list.next); + cfqq = list_entry_cfqq(entry); BUG_ON(RB_EMPTY(&cfqq->sort_list)); - __cfq_dispatch_requests(q, cfqd, cfqq); + /* + * first round of queueing, only select from queues that + * don't already have io in-flight + */ + if (first_round && cfqq->in_flight) + continue; + + cfq_dispatch_request(q, cfqd, cfqq); - if (RB_EMPTY(&cfqq->sort_list)) - cfq_put_queue(cfqd, cfqq); - else - good_queues++; + if (!RB_EMPTY(&cfqq->sort_list)) + busy_queues++; queued++; - ret = 1; } - if ((queued < cfqd->cfq_quantum) && good_queues) + if ((queued < max_dispatch) && (busy_queues || first_round)) { + first_round = 0; goto restart; + } - return ret; + return queued; +} + +static inline void cfq_account_dispatch(struct cfq_rq *crq) +{ + struct cfq_queue *cfqq = crq->cfq_queue; + struct cfq_data *cfqd = cfqq->cfqd; + unsigned long now, elapsed; + + if (!blk_fs_request(crq->request)) + return; + + /* + * accounted bit is necessary since some drivers will call + * elv_next_request() many times for the same request (eg ide) + */ + if (crq->accounted) + return; + + now = jiffies; + if (cfqq->service_start == ~0UL) + cfqq->service_start = now; + + /* + * on drives with tagged command queueing, command turn-around time + * doesn't necessarily reflect the time spent processing this very + * command inside the drive. so do the accounting differently there, + * by just sorting on the number of requests + */ + if (cfqd->cfq_tagged) { + if (time_after(now, cfqq->service_start + cfq_service)) { + cfqq->service_start = now; + cfqq->service_used /= 10; + } + + cfqq->service_used++; + cfq_sort_rr_list(cfqq, 0); + } + + elapsed = now - crq->queue_start; + if (elapsed > max_elapsed_dispatch) + max_elapsed_dispatch = elapsed; + + crq->accounted = 1; + crq->service_start = now; + + if (++cfqd->rq_in_driver >= CFQ_MAX_TAG && !cfqd->cfq_tagged) { + cfqq->cfqd->cfq_tagged = 1; + printk("cfq: depth %d reached, tagging now on\n", CFQ_MAX_TAG); + } +} + +static inline void +cfq_account_completion(struct cfq_queue *cfqq, struct cfq_rq *crq) +{ + struct cfq_data *cfqd = cfqq->cfqd; + + if (!crq->accounted) + return; + + WARN_ON(!cfqd->rq_in_driver); + cfqd->rq_in_driver--; + + if (!cfqd->cfq_tagged) { + unsigned long now = jiffies; + unsigned long duration = now - crq->service_start; + + if (time_after(now, cfqq->service_start + cfq_service)) { + cfqq->service_start = now; + cfqq->service_used >>= 3; + } + + cfqq->service_used += duration; + cfq_sort_rr_list(cfqq, 0); + + if (duration > max_elapsed_crq) + max_elapsed_crq = duration; + } } static struct request *cfq_next_request(request_queue_t *q) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct request *rq; - if (!list_empty(cfqd->dispatch)) { + if (!list_empty(&q->queue_head)) { struct cfq_rq *crq; dispatch: - rq = list_entry_rq(cfqd->dispatch->next); + rq = list_entry_rq(q->queue_head.next); - crq = RQ_DATA(rq); - if (crq) + if ((crq = RQ_DATA(rq)) != NULL) { cfq_remove_merge_hints(q, crq); + cfq_account_dispatch(crq); + } return rq; } - if (cfq_dispatch_requests(q, cfqd)) + if (cfq_dispatch_requests(q, cfqd->cfq_quantum)) goto dispatch; return NULL; } +/* + * task holds one reference to the queue, dropped when task exits. each crq + * in-flight on this queue also holds a reference, dropped when crq is freed. + * + * queue lock must be held here. + */ +static void cfq_put_queue(struct cfq_queue *cfqq) +{ + BUG_ON(!atomic_read(&cfqq->ref)); + + if (!atomic_dec_and_test(&cfqq->ref)) + return; + + BUG_ON(rb_first(&cfqq->sort_list)); + BUG_ON(cfqq->on_rr); + + cfq_put_cfqd(cfqq->cfqd); + + /* + * it's on the empty list and still hashed + */ + list_del(&cfqq->cfq_list); + hlist_del(&cfqq->cfq_hash); + kmem_cache_free(cfq_pool, cfqq); +} + static inline struct cfq_queue * -__cfq_find_cfq_hash(struct cfq_data *cfqd, int pid, const int hashval) +__cfq_find_cfq_hash(struct cfq_data *cfqd, unsigned long key, const int hashval) { - struct list_head *hash_list = &cfqd->cfq_hash[hashval]; - struct list_head *entry; + struct hlist_head *hash_list = &cfqd->cfq_hash[hashval]; + struct hlist_node *entry, *next; - list_for_each(entry, hash_list) { + hlist_for_each_safe(entry, next, hash_list) { struct cfq_queue *__cfqq = list_entry_qhash(entry); - if (__cfqq->pid == pid) + if (__cfqq->key == key) return __cfqq; } return NULL; } -static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid) +static struct cfq_queue * +cfq_find_cfq_hash(struct cfq_data *cfqd, unsigned long key) +{ + return __cfq_find_cfq_hash(cfqd, key, hash_long(key, CFQ_QHASH_SHIFT)); +} + +static inline void +cfq_rehash_cfqq(struct cfq_data *cfqd, struct cfq_queue **cfqq, + struct cfq_io_context *cic) { - const int hashval = hash_long(current->tgid, CFQ_QHASH_SHIFT); + unsigned long hashkey = cfq_hash_key(cfqd, current); + unsigned long hashval = hash_long(hashkey, CFQ_QHASH_SHIFT); + struct cfq_queue *__cfqq; + unsigned long flags; + + spin_lock_irqsave(cfqd->queue->queue_lock, flags); - return __cfq_find_cfq_hash(cfqd, pid, hashval); + hlist_del(&(*cfqq)->cfq_hash); + + __cfqq = __cfq_find_cfq_hash(cfqd, hashkey, hashval); + if (!__cfqq || __cfqq == *cfqq) { + __cfqq = *cfqq; + hlist_add_head(&__cfqq->cfq_hash, &cfqd->cfq_hash[hashval]); + __cfqq->key_type = cfqd->key_type; + } else { + atomic_inc(&__cfqq->ref); + cic->cfqq = __cfqq; + cfq_put_queue(*cfqq); + *cfqq = __cfqq; + } + + cic->cfqq = __cfqq; + spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); } -static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) +static void cfq_free_io_context(struct cfq_io_context *cic) { - cfqd->busy_queues--; - list_del(&cfqq->cfq_list); - list_del(&cfqq->cfq_hash); - mempool_free(cfqq, cfq_mpool); + kmem_cache_free(cfq_ioc_pool, cic); } -static struct cfq_queue *__cfq_get_queue(struct cfq_data *cfqd, int pid, - int gfp_mask) +/* + * locking hierarchy is: io_context lock -> queue locks + */ +static void cfq_exit_io_context(struct cfq_io_context *cic) { - const int hashval = hash_long(current->tgid, CFQ_QHASH_SHIFT); + struct cfq_queue *cfqq = cic->cfqq; + struct list_head *entry = &cic->list; + request_queue_t *q; + unsigned long flags; + + /* + * put the reference this task is holding to the various queues + */ + spin_lock_irqsave(&cic->ioc->lock, flags); + while ((entry = cic->list.next) != &cic->list) { + struct cfq_io_context *__cic; + + __cic = list_entry(entry, struct cfq_io_context, list); + list_del(entry); + + q = __cic->cfqq->cfqd->queue; + spin_lock(q->queue_lock); + cfq_put_queue(__cic->cfqq); + spin_unlock(q->queue_lock); + } + + q = cfqq->cfqd->queue; + spin_lock(q->queue_lock); + cfq_put_queue(cfqq); + spin_unlock(q->queue_lock); + + cic->cfqq = NULL; + spin_unlock_irqrestore(&cic->ioc->lock, flags); +} + +static struct cfq_io_context *cfq_alloc_io_context(int gfp_flags) +{ + struct cfq_io_context *cic = kmem_cache_alloc(cfq_ioc_pool, gfp_flags); + + if (cic) { + cic->dtor = cfq_free_io_context; + cic->exit = cfq_exit_io_context; + INIT_LIST_HEAD(&cic->list); + cic->cfqq = NULL; + } + + return cic; +} + +/* + * Setup general io context and cfq io context. There can be several cfq + * io contexts per general io context, if this process is doing io to more + * than one device managed by cfq. Note that caller is holding a reference to + * cfqq, so we don't need to worry about it disappearing + */ +static struct cfq_io_context * +cfq_get_io_context(struct cfq_queue **cfqq, int gfp_flags) +{ + struct cfq_data *cfqd = (*cfqq)->cfqd; + struct cfq_queue *__cfqq = *cfqq; + struct cfq_io_context *cic; + struct io_context *ioc; + + might_sleep_if(gfp_flags & __GFP_WAIT); + + ioc = get_io_context(gfp_flags); + if (!ioc) + return NULL; + + if ((cic = ioc->cic) == NULL) { + cic = cfq_alloc_io_context(gfp_flags); + + if (cic == NULL) + goto err; + + ioc->cic = cic; + cic->ioc = ioc; + cic->cfqq = __cfqq; + atomic_inc(&__cfqq->ref); + } else { + struct cfq_io_context *__cic; + unsigned long flags; + + /* + * since the first cic on the list is actually the head + * itself, need to check this here or we'll duplicate an + * cic per ioc for no reason + */ + if (cic->cfqq == __cfqq) + goto out; + + /* + * cic exists, check if we already are there. linear search + * should be ok here, the list will usually not be more than + * 1 or a few entries long + */ + spin_lock_irqsave(&ioc->lock, flags); + list_for_each_entry(__cic, &cic->list, list) { + /* + * this process is already holding a reference to + * this queue, so no need to get one more + */ + if (__cic->cfqq == __cfqq) { + cic = __cic; + spin_unlock_irqrestore(&ioc->lock, flags); + goto out; + } + } + spin_unlock_irqrestore(&ioc->lock, flags); + + /* + * nope, process doesn't have a cic assoicated with this + * cfqq yet. get a new one and add to list + */ + __cic = cfq_alloc_io_context(gfp_flags); + if (__cic == NULL) + goto err; + + __cic->ioc = ioc; + __cic->cfqq = __cfqq; + atomic_inc(&__cfqq->ref); + spin_lock_irqsave(&ioc->lock, flags); + list_add(&__cic->list, &cic->list); + spin_unlock_irqrestore(&ioc->lock, flags); + + cic = __cic; + *cfqq = __cfqq; + } + +out: + /* + * if key_type has been changed on the fly, we lazily rehash + * each queue at lookup time + */ + if ((*cfqq)->key_type != cfqd->key_type) + cfq_rehash_cfqq(cfqd, cfqq, cic); + + return cic; +err: + put_io_context(ioc); + return NULL; +} + +static struct cfq_queue * +__cfq_get_queue(struct cfq_data *cfqd, unsigned long key, int gfp_mask) +{ + const int hashval = hash_long(key, CFQ_QHASH_SHIFT); struct cfq_queue *cfqq, *new_cfqq = NULL; - request_queue_t *q = cfqd->queue; retry: - cfqq = __cfq_find_cfq_hash(cfqd, pid, hashval); + cfqq = __cfq_find_cfq_hash(cfqd, key, hashval); if (!cfqq) { if (new_cfqq) { cfqq = new_cfqq; new_cfqq = NULL; } else if (gfp_mask & __GFP_WAIT) { - spin_unlock_irq(q->queue_lock); - new_cfqq = mempool_alloc(cfq_mpool, gfp_mask); - spin_lock_irq(q->queue_lock); + spin_unlock_irq(cfqd->queue->queue_lock); + new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask); + spin_lock_irq(cfqd->queue->queue_lock); goto retry; } else - return NULL; + goto out; + + memset(cfqq, 0, sizeof(*cfqq)); - INIT_LIST_HEAD(&cfqq->cfq_hash); + INIT_HLIST_NODE(&cfqq->cfq_hash); INIT_LIST_HEAD(&cfqq->cfq_list); RB_CLEAR_ROOT(&cfqq->sort_list); - - cfqq->pid = pid; - cfqq->queued[0] = cfqq->queued[1] = 0; - list_add(&cfqq->cfq_hash, &cfqd->cfq_hash[hashval]); + INIT_LIST_HEAD(&cfqq->fifo[0]); + INIT_LIST_HEAD(&cfqq->fifo[1]); + + cfqq->key = key; + hlist_add_head(&cfqq->cfq_hash, &cfqd->cfq_hash[hashval]); + atomic_set(&cfqq->ref, 0); + cfqq->cfqd = cfqd; + atomic_inc(&cfqd->ref); + cfqq->key_type = cfqd->key_type; + cfqq->service_start = ~0UL; } if (new_cfqq) - mempool_free(new_cfqq, cfq_mpool); - - return cfqq; -} - -static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, int pid, - int gfp_mask) -{ - request_queue_t *q = cfqd->queue; - struct cfq_queue *cfqq; - - spin_lock_irq(q->queue_lock); - cfqq = __cfq_get_queue(cfqd, pid, gfp_mask); - spin_unlock_irq(q->queue_lock); + kmem_cache_free(cfq_pool, new_cfqq); + atomic_inc(&cfqq->ref); +out: + WARN_ON((gfp_mask & __GFP_WAIT) && !cfqq); return cfqq; } static void cfq_enqueue(struct cfq_data *cfqd, struct cfq_rq *crq) { - struct cfq_queue *cfqq; + crq->is_sync = 0; + if (rq_data_dir(crq->request) == READ || current->flags & PF_SYNCWRITE) + crq->is_sync = 1; - cfqq = __cfq_get_queue(cfqd, current->tgid, GFP_ATOMIC); - if (cfqq) { - cfq_add_crq_rb(cfqd, cfqq, crq); + cfq_add_crq_rb(crq); + crq->queue_start = jiffies; - if (list_empty(&cfqq->cfq_list)) { - list_add(&cfqq->cfq_list, &cfqd->rr_list); - cfqd->busy_queues++; - } - } else { - /* - * should can only happen if the request wasn't allocated - * through blk_alloc_request(), eg stack requests from ide-cd - * (those should be removed) _and_ we are in OOM. - */ - list_add_tail(&crq->request->queuelist, cfqd->dispatch); - } + list_add_tail(&crq->request->queuelist, &crq->cfq_queue->fifo[crq->is_sync]); } static void cfq_insert_request(request_queue_t *q, struct request *rq, int where) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_rq *crq = RQ_DATA(rq); switch (where) { case ELEVATOR_INSERT_BACK: - while (cfq_dispatch_requests(q, cfqd)) + while (cfq_dispatch_requests(q, cfqd->cfq_quantum)) ; - list_add_tail(&rq->queuelist, cfqd->dispatch); + list_add_tail(&rq->queuelist, &q->queue_head); break; case ELEVATOR_INSERT_FRONT: - list_add(&rq->queuelist, cfqd->dispatch); + list_add(&rq->queuelist, &q->queue_head); break; case ELEVATOR_INSERT_SORT: BUG_ON(!blk_fs_request(rq)); @@ -562,12 +1277,27 @@ cfq_insert_request(request_queue_t *q, struct request *rq, int where) static int cfq_queue_empty(request_queue_t *q) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; - if (list_empty(cfqd->dispatch) && list_empty(&cfqd->rr_list)) - return 1; + return list_empty(&q->queue_head) && list_empty(&cfqd->rr_list); +} - return 0; +static void cfq_completed_request(request_queue_t *q, struct request *rq) +{ + struct cfq_rq *crq = RQ_DATA(rq); + struct cfq_queue *cfqq; + + if (unlikely(!blk_fs_request(rq))) + return; + + cfqq = crq->cfq_queue; + + if (crq->in_flight) { + WARN_ON(!cfqq->in_flight); + cfqq->in_flight--; + } + + cfq_account_completion(cfqq, crq); } static struct request * @@ -596,101 +1326,171 @@ cfq_latter_request(request_queue_t *q, struct request *rq) static int cfq_may_queue(request_queue_t *q, int rw) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_queue *cfqq; - int ret = 1; + int ret = ELV_MQUEUE_MAY; - if (!cfqd->busy_queues) - goto out; + if (current->flags & PF_MEMALLOC) + return ELV_MQUEUE_MAY; - cfqq = cfq_find_cfq_hash(cfqd, current->tgid); + cfqq = cfq_find_cfq_hash(cfqd, cfq_hash_key(cfqd, current)); if (cfqq) { - int limit = (q->nr_requests - cfqd->cfq_queued) / cfqd->busy_queues; + int limit = cfqd->max_queued; + + if (cfqq->allocated[rw] < cfqd->cfq_queued) + return ELV_MQUEUE_MUST; + + if (cfqd->busy_queues) + limit = q->nr_requests / cfqd->busy_queues; - if (limit < 3) - limit = 3; + if (limit < cfqd->cfq_queued) + limit = cfqd->cfq_queued; else if (limit > cfqd->max_queued) limit = cfqd->max_queued; - if (cfqq->queued[rw] > limit) - ret = 0; + if (cfqq->allocated[rw] >= limit) { + if (limit > cfqq->alloc_limit[rw]) + cfqq->alloc_limit[rw] = limit; + + ret = ELV_MQUEUE_NO; + } } -out: + return ret; } +static void cfq_check_waiters(request_queue_t *q, struct cfq_queue *cfqq) +{ + struct request_list *rl = &q->rq; + const int write = waitqueue_active(&rl->wait[WRITE]); + const int read = waitqueue_active(&rl->wait[READ]); + + if (read && cfqq->allocated[READ] < cfqq->alloc_limit[READ]) + wake_up(&rl->wait[READ]); + if (write && cfqq->allocated[WRITE] < cfqq->alloc_limit[WRITE]) + wake_up(&rl->wait[WRITE]); +} + +/* + * queue lock held here + */ static void cfq_put_request(request_queue_t *q, struct request *rq) { - struct cfq_data *cfqd = q->elevator.elevator_data; + struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_rq *crq = RQ_DATA(rq); - struct request_list *rl; - int other_rw; if (crq) { + struct cfq_queue *cfqq = crq->cfq_queue; + BUG_ON(q->last_merge == rq); - BUG_ON(ON_MHASH(crq)); + BUG_ON(!hlist_unhashed(&crq->hash)); + + if (crq->io_context) + put_io_context(crq->io_context->ioc); + + BUG_ON(!cfqq->allocated[crq->is_write]); + cfqq->allocated[crq->is_write]--; mempool_free(crq, cfqd->crq_pool); rq->elevator_private = NULL; - } - /* - * work-around for may_queue "bug": if a read gets issued and refused - * to queue because writes ate all the allowed slots and no other - * reads are pending for this queue, it could get stuck infinitely - * since freed_request() only checks the waitqueue for writes when - * freeing them. or vice versa for a single write vs many reads. - * so check here whether "the other" data direction might be able - * to queue and wake them - */ - rl = &q->rq; - other_rw = rq_data_dir(rq) ^ 1; - if (rl->count[other_rw] <= q->nr_requests) { smp_mb(); - if (waitqueue_active(&rl->wait[other_rw])) - wake_up(&rl->wait[other_rw]); + cfq_check_waiters(q, cfqq); + cfq_put_queue(cfqq); } } +/* + * Allocate cfq data structures associated with this request. A queue and + */ static int cfq_set_request(request_queue_t *q, struct request *rq, int gfp_mask) { - struct cfq_data *cfqd = q->elevator.elevator_data; - struct cfq_queue *cfqq; + struct cfq_data *cfqd = q->elevator->elevator_data; + struct cfq_io_context *cic; + const int rw = rq_data_dir(rq); + struct cfq_queue *cfqq, *saved_cfqq; struct cfq_rq *crq; + unsigned long flags; + + might_sleep_if(gfp_mask & __GFP_WAIT); + + spin_lock_irqsave(q->queue_lock, flags); + + cfqq = __cfq_get_queue(cfqd, cfq_hash_key(cfqd, current), gfp_mask); + if (!cfqq) + goto out_lock; + +repeat: + if (cfqq->allocated[rw] >= cfqd->max_queued) + goto out_lock; + + cfqq->allocated[rw]++; + spin_unlock_irqrestore(q->queue_lock, flags); /* - * prepare a queue up front, so cfq_enqueue() doesn't have to + * if hashing type has changed, the cfq_queue might change here. */ - cfqq = cfq_get_queue(cfqd, current->tgid, gfp_mask); - if (!cfqq) - return 1; + saved_cfqq = cfqq; + cic = cfq_get_io_context(&cfqq, gfp_mask); + if (!cic) + goto err; + + /* + * repeat allocation checks on queue change + */ + if (unlikely(saved_cfqq != cfqq)) { + spin_lock_irqsave(q->queue_lock, flags); + saved_cfqq->allocated[rw]--; + goto repeat; + } crq = mempool_alloc(cfqd->crq_pool, gfp_mask); if (crq) { - memset(crq, 0, sizeof(*crq)); RB_CLEAR(&crq->rb_node); + crq->rb_key = 0; crq->request = rq; - crq->cfq_queue = NULL; - INIT_LIST_HEAD(&crq->hash); + INIT_HLIST_NODE(&crq->hash); + crq->cfq_queue = cfqq; + crq->io_context = cic; + crq->service_start = crq->queue_start = 0; + crq->in_flight = crq->accounted = crq->is_sync = 0; + crq->is_write = rw; rq->elevator_private = crq; + cfqq->alloc_limit[rw] = 0; return 0; } + put_io_context(cic->ioc); +err: + spin_lock_irqsave(q->queue_lock, flags); + cfqq->allocated[rw]--; + cfq_put_queue(cfqq); +out_lock: + spin_unlock_irqrestore(q->queue_lock, flags); return 1; } -static void cfq_exit(request_queue_t *q, elevator_t *e) +static void cfq_put_cfqd(struct cfq_data *cfqd) { - struct cfq_data *cfqd = e->elevator_data; + request_queue_t *q = cfqd->queue; + + if (!atomic_dec_and_test(&cfqd->ref)) + return; + + blk_put_queue(q); - e->elevator_data = NULL; mempool_destroy(cfqd->crq_pool); kfree(cfqd->crq_hash); kfree(cfqd->cfq_hash); kfree(cfqd); } -static int cfq_init(request_queue_t *q, elevator_t *e) +static void cfq_exit_queue(elevator_t *e) +{ + cfq_put_cfqd(e->elevator_data); +} + +static int cfq_init_queue(request_queue_t *q, elevator_t *e) { struct cfq_data *cfqd; int i; @@ -701,12 +1501,13 @@ static int cfq_init(request_queue_t *q, elevator_t *e) memset(cfqd, 0, sizeof(*cfqd)); INIT_LIST_HEAD(&cfqd->rr_list); + INIT_LIST_HEAD(&cfqd->empty_list); - cfqd->crq_hash = kmalloc(sizeof(struct list_head) * CFQ_MHASH_ENTRIES, GFP_KERNEL); + cfqd->crq_hash = kmalloc(sizeof(struct hlist_head) * CFQ_MHASH_ENTRIES, GFP_KERNEL); if (!cfqd->crq_hash) goto out_crqhash; - cfqd->cfq_hash = kmalloc(sizeof(struct list_head) * CFQ_QHASH_ENTRIES, GFP_KERNEL); + cfqd->cfq_hash = kmalloc(sizeof(struct hlist_head) * CFQ_QHASH_ENTRIES, GFP_KERNEL); if (!cfqd->cfq_hash) goto out_cfqhash; @@ -715,23 +1516,33 @@ static int cfq_init(request_queue_t *q, elevator_t *e) goto out_crqpool; for (i = 0; i < CFQ_MHASH_ENTRIES; i++) - INIT_LIST_HEAD(&cfqd->crq_hash[i]); + INIT_HLIST_HEAD(&cfqd->crq_hash[i]); for (i = 0; i < CFQ_QHASH_ENTRIES; i++) - INIT_LIST_HEAD(&cfqd->cfq_hash[i]); + INIT_HLIST_HEAD(&cfqd->cfq_hash[i]); - cfqd->dispatch = &q->queue_head; e->elevator_data = cfqd; + cfqd->queue = q; + atomic_inc(&q->refcnt); /* * just set it to some high value, we want anyone to be able to queue * some requests. fairness is handled differently */ - cfqd->max_queued = q->nr_requests; - q->nr_requests = 8192; + q->nr_requests = 1024; + cfqd->max_queued = q->nr_requests / 16; + q->nr_batching = cfq_queued; + cfqd->key_type = CFQ_KEY_TGID; + cfqd->find_best_crq = 1; + atomic_set(&cfqd->ref, 1); cfqd->cfq_queued = cfq_queued; cfqd->cfq_quantum = cfq_quantum; + cfqd->cfq_fifo_expire_r = cfq_fifo_expire_r; + cfqd->cfq_fifo_expire_w = cfq_fifo_expire_w; + cfqd->cfq_fifo_batch_expire = cfq_fifo_rate; + cfqd->cfq_back_max = cfq_back_max; + cfqd->cfq_back_penalty = cfq_back_penalty; return 0; out_crqpool: @@ -743,29 +1554,39 @@ out_crqhash: return -ENOMEM; } +static void cfq_slab_kill(void) +{ + if (crq_pool) + kmem_cache_destroy(crq_pool); + if (cfq_pool) + kmem_cache_destroy(cfq_pool); + if (cfq_ioc_pool) + kmem_cache_destroy(cfq_ioc_pool); +} + static int __init cfq_slab_setup(void) { crq_pool = kmem_cache_create("crq_pool", sizeof(struct cfq_rq), 0, 0, NULL, NULL); - if (!crq_pool) - panic("cfq_iosched: can't init crq pool\n"); + goto fail; cfq_pool = kmem_cache_create("cfq_pool", sizeof(struct cfq_queue), 0, 0, NULL, NULL); - if (!cfq_pool) - panic("cfq_iosched: can't init cfq pool\n"); - - cfq_mpool = mempool_create(64, mempool_alloc_slab, mempool_free_slab, cfq_pool); + goto fail; - if (!cfq_mpool) - panic("cfq_iosched: can't init cfq mpool\n"); + cfq_ioc_pool = kmem_cache_create("cfq_ioc_pool", + sizeof(struct cfq_io_context), 0, 0, NULL, NULL); + if (!cfq_ioc_pool) + goto fail; return 0; +fail: + cfq_slab_kill(); + return -ENOMEM; } -subsys_initcall(cfq_slab_setup); /* * sysfs parts below --> @@ -791,27 +1612,86 @@ cfq_var_store(unsigned int *var, const char *page, size_t count) return count; } -#define SHOW_FUNCTION(__FUNC, __VAR) \ +static ssize_t +cfq_clear_elapsed(struct cfq_data *cfqd, const char *page, size_t count) +{ + max_elapsed_dispatch = max_elapsed_crq = 0; + return count; +} + +static ssize_t +cfq_set_key_type(struct cfq_data *cfqd, const char *page, size_t count) +{ + spin_lock_irq(cfqd->queue->queue_lock); + if (!strncmp(page, "pgid", 4)) + cfqd->key_type = CFQ_KEY_PGID; + else if (!strncmp(page, "tgid", 4)) + cfqd->key_type = CFQ_KEY_TGID; + else if (!strncmp(page, "uid", 3)) + cfqd->key_type = CFQ_KEY_UID; + else if (!strncmp(page, "gid", 3)) + cfqd->key_type = CFQ_KEY_GID; + spin_unlock_irq(cfqd->queue->queue_lock); + return count; +} + +static ssize_t +cfq_read_key_type(struct cfq_data *cfqd, char *page) +{ + ssize_t len = 0; + int i; + + for (i = CFQ_KEY_PGID; i < CFQ_KEY_LAST; i++) { + if (cfqd->key_type == i) + len += sprintf(page+len, "[%s] ", cfq_key_types[i]); + else + len += sprintf(page+len, "%s ", cfq_key_types[i]); + } + len += sprintf(page+len, "\n"); + return len; +} + +#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \ static ssize_t __FUNC(struct cfq_data *cfqd, char *page) \ { \ - return cfq_var_show(__VAR, (page)); \ + unsigned int __data = __VAR; \ + if (__CONV) \ + __data = jiffies_to_msecs(__data); \ + return cfq_var_show(__data, (page)); \ } -SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum); -SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued); +SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum, 0); +SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued, 0); +SHOW_FUNCTION(cfq_fifo_expire_r_show, cfqd->cfq_fifo_expire_r, 1); +SHOW_FUNCTION(cfq_fifo_expire_w_show, cfqd->cfq_fifo_expire_w, 1); +SHOW_FUNCTION(cfq_fifo_batch_expire_show, cfqd->cfq_fifo_batch_expire, 1); +SHOW_FUNCTION(cfq_find_best_show, cfqd->find_best_crq, 0); +SHOW_FUNCTION(cfq_back_max_show, cfqd->cfq_back_max, 0); +SHOW_FUNCTION(cfq_back_penalty_show, cfqd->cfq_back_penalty, 0); #undef SHOW_FUNCTION -#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \ +#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ static ssize_t __FUNC(struct cfq_data *cfqd, const char *page, size_t count) \ { \ - int ret = cfq_var_store(__PTR, (page), count); \ - if (*(__PTR) < (MIN)) \ - *(__PTR) = (MIN); \ - else if (*(__PTR) > (MAX)) \ - *(__PTR) = (MAX); \ + unsigned int __data; \ + int ret = cfq_var_store(&__data, (page), count); \ + if (__data < (MIN)) \ + __data = (MIN); \ + else if (__data > (MAX)) \ + __data = (MAX); \ + if (__CONV) \ + *(__PTR) = msecs_to_jiffies(__data); \ + else \ + *(__PTR) = __data; \ return ret; \ } -STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, INT_MAX); -STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, INT_MAX); +STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, UINT_MAX, 0); +STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, UINT_MAX, 0); +STORE_FUNCTION(cfq_fifo_expire_r_store, &cfqd->cfq_fifo_expire_r, 1, UINT_MAX, 1); +STORE_FUNCTION(cfq_fifo_expire_w_store, &cfqd->cfq_fifo_expire_w, 1, UINT_MAX, 1); +STORE_FUNCTION(cfq_fifo_batch_expire_store, &cfqd->cfq_fifo_batch_expire, 0, UINT_MAX, 1); +STORE_FUNCTION(cfq_find_best_store, &cfqd->find_best_crq, 0, 1, 0); +STORE_FUNCTION(cfq_back_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0); +STORE_FUNCTION(cfq_back_penalty_store, &cfqd->cfq_back_penalty, 1, UINT_MAX, 0); #undef STORE_FUNCTION static struct cfq_fs_entry cfq_quantum_entry = { @@ -824,10 +1704,57 @@ static struct cfq_fs_entry cfq_queued_entry = { .show = cfq_queued_show, .store = cfq_queued_store, }; +static struct cfq_fs_entry cfq_fifo_expire_r_entry = { + .attr = {.name = "fifo_expire_sync", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_fifo_expire_r_show, + .store = cfq_fifo_expire_r_store, +}; +static struct cfq_fs_entry cfq_fifo_expire_w_entry = { + .attr = {.name = "fifo_expire_async", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_fifo_expire_w_show, + .store = cfq_fifo_expire_w_store, +}; +static struct cfq_fs_entry cfq_fifo_batch_expire_entry = { + .attr = {.name = "fifo_batch_expire", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_fifo_batch_expire_show, + .store = cfq_fifo_batch_expire_store, +}; +static struct cfq_fs_entry cfq_find_best_entry = { + .attr = {.name = "find_best_crq", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_find_best_show, + .store = cfq_find_best_store, +}; +static struct cfq_fs_entry cfq_back_max_entry = { + .attr = {.name = "back_seek_max", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_back_max_show, + .store = cfq_back_max_store, +}; +static struct cfq_fs_entry cfq_back_penalty_entry = { + .attr = {.name = "back_seek_penalty", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_back_penalty_show, + .store = cfq_back_penalty_store, +}; +static struct cfq_fs_entry cfq_clear_elapsed_entry = { + .attr = {.name = "clear_elapsed", .mode = S_IWUSR }, + .store = cfq_clear_elapsed, +}; +static struct cfq_fs_entry cfq_key_type_entry = { + .attr = {.name = "key_type", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_read_key_type, + .store = cfq_set_key_type, +}; static struct attribute *default_attrs[] = { &cfq_quantum_entry.attr, &cfq_queued_entry.attr, + &cfq_fifo_expire_r_entry.attr, + &cfq_fifo_expire_w_entry.attr, + &cfq_fifo_batch_expire_entry.attr, + &cfq_key_type_entry.attr, + &cfq_find_best_entry.attr, + &cfq_back_max_entry.attr, + &cfq_back_penalty_entry.attr, + &cfq_clear_elapsed_entry.attr, NULL, }; @@ -868,23 +1795,56 @@ struct kobj_type cfq_ktype = { .default_attrs = default_attrs, }; -elevator_t iosched_cfq = { - .elevator_name = "cfq", - .elevator_ktype = &cfq_ktype, - .elevator_merge_fn = cfq_merge, - .elevator_merged_fn = cfq_merged_request, - .elevator_merge_req_fn = cfq_merged_requests, - .elevator_next_req_fn = cfq_next_request, - .elevator_add_req_fn = cfq_insert_request, - .elevator_remove_req_fn = cfq_remove_request, - .elevator_queue_empty_fn = cfq_queue_empty, - .elevator_former_req_fn = cfq_former_request, - .elevator_latter_req_fn = cfq_latter_request, - .elevator_set_req_fn = cfq_set_request, - .elevator_put_req_fn = cfq_put_request, - .elevator_may_queue_fn = cfq_may_queue, - .elevator_init_fn = cfq_init, - .elevator_exit_fn = cfq_exit, +static struct elevator_type iosched_cfq = { + .ops = { + .elevator_merge_fn = cfq_merge, + .elevator_merged_fn = cfq_merged_request, + .elevator_merge_req_fn = cfq_merged_requests, + .elevator_next_req_fn = cfq_next_request, + .elevator_add_req_fn = cfq_insert_request, + .elevator_remove_req_fn = cfq_remove_request, + .elevator_requeue_req_fn = cfq_requeue_request, + .elevator_queue_empty_fn = cfq_queue_empty, + .elevator_completed_req_fn = cfq_completed_request, + .elevator_former_req_fn = cfq_former_request, + .elevator_latter_req_fn = cfq_latter_request, + .elevator_set_req_fn = cfq_set_request, + .elevator_put_req_fn = cfq_put_request, + .elevator_may_queue_fn = cfq_may_queue, + .elevator_init_fn = cfq_init_queue, + .elevator_exit_fn = cfq_exit_queue, + }, + .elevator_ktype = &cfq_ktype, + .elevator_name = "cfq", + .elevator_owner = THIS_MODULE, }; -EXPORT_SYMBOL(iosched_cfq); +static int __init cfq_init(void) +{ + int ret; + + if (cfq_slab_setup()) + return -ENOMEM; + + ret = elv_register(&iosched_cfq); + if (!ret) { + __module_get(THIS_MODULE); + return 0; + } + + cfq_slab_kill(); + return ret; +} + +static void __exit cfq_exit(void) +{ + cfq_slab_kill(); + elv_unregister(&iosched_cfq); +} + +module_init(cfq_init); +module_exit(cfq_exit); + +MODULE_AUTHOR("Jens Axboe"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Completely Fair Queueing IO scheduler"); diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 204b31829..a231daff0 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -16,12 +16,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to Cpqarray-discuss@lists.sourceforge.net + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * */ #include /* CONFIG_PROC_FS */ #include -#include #include #include #include @@ -311,7 +310,7 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset, int lengt } #endif /* CONFIG_PROC_FS */ -MODULE_PARM(eisa, "1-8i"); +module_param_array(eisa, int, NULL, 0); /* This is a bit of a hack, * necessary to support both eisa and pci @@ -569,9 +568,9 @@ int __init cpqarray_init_step2(void) /* detect controllers */ printk(DRIVER_NAME "\n"); -/* TODO: If it's an eisa only system, will rc return negative? */ + rc = pci_register_driver(&cpqarray_pci_driver); - if (rc < 0) + if (rc) return rc; cpqarray_eisa_detect(); @@ -732,7 +731,6 @@ static void __iomem *remap_pci_mem(ulong base, ulong size) } #ifndef MODULE -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) /* * Config string is a comma separated set of i/o addresses of EISA cards. */ @@ -749,18 +747,6 @@ static int cpqarray_setup(char *str) __setup("smart2=", cpqarray_setup); -#else - -/* - * Copy the contents of the ints[] array passed to us by init. - */ -void cpqarray_setup(char *str, int *ints) -{ - int i; - for(i=0; ielevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct deadline_rq *drq = RQ_DATA(rq); const int data_dir = rq_data_dir(drq->request); @@ -317,7 +317,7 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq) struct deadline_rq *drq = RQ_DATA(rq); if (drq) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; list_del_init(&drq->fifo); deadline_remove_merge_hints(q, drq); @@ -328,7 +328,7 @@ static void deadline_remove_request(request_queue_t *q, struct request *rq) static int deadline_merge(request_queue_t *q, struct request **req, struct bio *bio) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct request *__rq; int ret; @@ -383,7 +383,7 @@ out_insert: static void deadline_merged_request(request_queue_t *q, struct request *req) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct deadline_rq *drq = RQ_DATA(req); /* @@ -407,7 +407,7 @@ static void deadline_merged_requests(request_queue_t *q, struct request *req, struct request *next) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct deadline_rq *drq = RQ_DATA(req); struct deadline_rq *dnext = RQ_DATA(next); @@ -604,7 +604,7 @@ dispatch_request: static struct request *deadline_next_request(request_queue_t *q) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct request *rq; /* @@ -625,7 +625,7 @@ dispatch: static void deadline_insert_request(request_queue_t *q, struct request *rq, int where) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; /* barriers must flush the reorder queue */ if (unlikely(rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER) @@ -653,7 +653,7 @@ deadline_insert_request(request_queue_t *q, struct request *rq, int where) static int deadline_queue_empty(request_queue_t *q) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; if (!list_empty(&dd->fifo_list[WRITE]) || !list_empty(&dd->fifo_list[READ]) @@ -687,7 +687,7 @@ deadline_latter_request(request_queue_t *q, struct request *rq) return NULL; } -static void deadline_exit(request_queue_t *q, elevator_t *e) +static void deadline_exit_queue(elevator_t *e) { struct deadline_data *dd = e->elevator_data; @@ -703,7 +703,7 @@ static void deadline_exit(request_queue_t *q, elevator_t *e) * initialize elevator private data (deadline_data), and alloc a drq for * each request on the free lists */ -static int deadline_init(request_queue_t *q, elevator_t *e) +static int deadline_init_queue(request_queue_t *q, elevator_t *e) { struct deadline_data *dd; int i; @@ -748,7 +748,7 @@ static int deadline_init(request_queue_t *q, elevator_t *e) static void deadline_put_request(request_queue_t *q, struct request *rq) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct deadline_rq *drq = RQ_DATA(rq); if (drq) { @@ -760,7 +760,7 @@ static void deadline_put_request(request_queue_t *q, struct request *rq) static int deadline_set_request(request_queue_t *q, struct request *rq, int gfp_mask) { - struct deadline_data *dd = q->elevator.elevator_data; + struct deadline_data *dd = q->elevator->elevator_data; struct deadline_rq *drq; drq = mempool_alloc(dd->drq_pool, gfp_mask); @@ -791,47 +791,55 @@ struct deadline_fs_entry { }; static ssize_t -deadline_var_show(unsigned int var, char *page) +deadline_var_show(int var, char *page) { return sprintf(page, "%d\n", var); } static ssize_t -deadline_var_store(unsigned int *var, const char *page, size_t count) +deadline_var_store(int *var, const char *page, size_t count) { char *p = (char *) page; - *var = simple_strtoul(p, &p, 10); + *var = simple_strtol(p, &p, 10); return count; } -#define SHOW_FUNCTION(__FUNC, __VAR) \ +#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \ static ssize_t __FUNC(struct deadline_data *dd, char *page) \ { \ - return deadline_var_show(__VAR, (page)); \ -} -SHOW_FUNCTION(deadline_readexpire_show, dd->fifo_expire[READ]); -SHOW_FUNCTION(deadline_writeexpire_show, dd->fifo_expire[WRITE]); -SHOW_FUNCTION(deadline_writesstarved_show, dd->writes_starved); -SHOW_FUNCTION(deadline_frontmerges_show, dd->front_merges); -SHOW_FUNCTION(deadline_fifobatch_show, dd->fifo_batch); + int __data = __VAR; \ + if (__CONV) \ + __data = jiffies_to_msecs(__data); \ + return deadline_var_show(__data, (page)); \ +} +SHOW_FUNCTION(deadline_readexpire_show, dd->fifo_expire[READ], 1); +SHOW_FUNCTION(deadline_writeexpire_show, dd->fifo_expire[WRITE], 1); +SHOW_FUNCTION(deadline_writesstarved_show, dd->writes_starved, 0); +SHOW_FUNCTION(deadline_frontmerges_show, dd->front_merges, 0); +SHOW_FUNCTION(deadline_fifobatch_show, dd->fifo_batch, 0); #undef SHOW_FUNCTION -#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \ +#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ static ssize_t __FUNC(struct deadline_data *dd, const char *page, size_t count) \ { \ - int ret = deadline_var_store(__PTR, (page), count); \ - if (*(__PTR) < (MIN)) \ - *(__PTR) = (MIN); \ - else if (*(__PTR) > (MAX)) \ - *(__PTR) = (MAX); \ + int __data; \ + int ret = deadline_var_store(&__data, (page), count); \ + if (__data < (MIN)) \ + __data = (MIN); \ + else if (__data > (MAX)) \ + __data = (MAX); \ + if (__CONV) \ + *(__PTR) = msecs_to_jiffies(__data); \ + else \ + *(__PTR) = __data; \ return ret; \ } -STORE_FUNCTION(deadline_readexpire_store, &dd->fifo_expire[READ], 0, INT_MAX); -STORE_FUNCTION(deadline_writeexpire_store, &dd->fifo_expire[WRITE], 0, INT_MAX); -STORE_FUNCTION(deadline_writesstarved_store, &dd->writes_starved, INT_MIN, INT_MAX); -STORE_FUNCTION(deadline_frontmerges_store, &dd->front_merges, 0, 1); -STORE_FUNCTION(deadline_fifobatch_store, &dd->fifo_batch, 0, INT_MAX); +STORE_FUNCTION(deadline_readexpire_store, &dd->fifo_expire[READ], 0, INT_MAX, 1); +STORE_FUNCTION(deadline_writeexpire_store, &dd->fifo_expire[WRITE], 0, INT_MAX, 1); +STORE_FUNCTION(deadline_writesstarved_store, &dd->writes_starved, INT_MIN, INT_MAX, 0); +STORE_FUNCTION(deadline_frontmerges_store, &dd->front_merges, 0, 1, 0); +STORE_FUNCTION(deadline_fifobatch_store, &dd->fifo_batch, 0, INT_MAX, 0); #undef STORE_FUNCTION static struct deadline_fs_entry deadline_readexpire_entry = { @@ -906,36 +914,54 @@ struct kobj_type deadline_ktype = { .default_attrs = default_attrs, }; -static int __init deadline_slab_setup(void) +static struct elevator_type iosched_deadline = { + .ops = { + .elevator_merge_fn = deadline_merge, + .elevator_merged_fn = deadline_merged_request, + .elevator_merge_req_fn = deadline_merged_requests, + .elevator_next_req_fn = deadline_next_request, + .elevator_add_req_fn = deadline_insert_request, + .elevator_remove_req_fn = deadline_remove_request, + .elevator_queue_empty_fn = deadline_queue_empty, + .elevator_former_req_fn = deadline_former_request, + .elevator_latter_req_fn = deadline_latter_request, + .elevator_set_req_fn = deadline_set_request, + .elevator_put_req_fn = deadline_put_request, + .elevator_init_fn = deadline_init_queue, + .elevator_exit_fn = deadline_exit_queue, + }, + + .elevator_ktype = &deadline_ktype, + .elevator_name = "deadline", + .elevator_owner = THIS_MODULE, +}; + +static int __init deadline_init(void) { + int ret; + drq_pool = kmem_cache_create("deadline_drq", sizeof(struct deadline_rq), 0, 0, NULL, NULL); if (!drq_pool) - panic("deadline: can't init slab pool\n"); + return -ENOMEM; - return 0; + ret = elv_register(&iosched_deadline); + if (ret) + kmem_cache_destroy(drq_pool); + + return ret; } -subsys_initcall(deadline_slab_setup); - -elevator_t iosched_deadline = { - .elevator_merge_fn = deadline_merge, - .elevator_merged_fn = deadline_merged_request, - .elevator_merge_req_fn = deadline_merged_requests, - .elevator_next_req_fn = deadline_next_request, - .elevator_add_req_fn = deadline_insert_request, - .elevator_remove_req_fn = deadline_remove_request, - .elevator_queue_empty_fn = deadline_queue_empty, - .elevator_former_req_fn = deadline_former_request, - .elevator_latter_req_fn = deadline_latter_request, - .elevator_set_req_fn = deadline_set_request, - .elevator_put_req_fn = deadline_put_request, - .elevator_init_fn = deadline_init, - .elevator_exit_fn = deadline_exit, - - .elevator_ktype = &deadline_ktype, - .elevator_name = "deadline", -}; +static void __exit deadline_exit(void) +{ + kmem_cache_destroy(drq_pool); + elv_unregister(&iosched_deadline); +} + +module_init(deadline_init); +module_exit(deadline_exit); -EXPORT_SYMBOL(iosched_deadline); +MODULE_AUTHOR("Jens Axboe"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("deadline IO scheduler"); diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 35c9385ac..35f4079b0 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c @@ -37,6 +37,9 @@ #include +static DEFINE_SPINLOCK(elv_list_lock); +static LIST_HEAD(elv_list); + /* * can we safely merge with this request? */ @@ -60,6 +63,7 @@ inline int elv_rq_merge_ok(struct request *rq, struct bio *bio) return 0; } +EXPORT_SYMBOL(elv_rq_merge_ok); inline int elv_try_merge(struct request *__rq, struct bio *bio) { @@ -77,6 +81,7 @@ inline int elv_try_merge(struct request *__rq, struct bio *bio) return ret; } +EXPORT_SYMBOL(elv_try_merge); inline int elv_try_last_merge(request_queue_t *q, struct bio *bio) { @@ -85,31 +90,134 @@ inline int elv_try_last_merge(request_queue_t *q, struct bio *bio) return ELEVATOR_NO_MERGE; } +EXPORT_SYMBOL(elv_try_last_merge); -/* - * general block -> elevator interface starts here - */ -int elevator_init(request_queue_t *q, elevator_t *type) +struct elevator_type *elevator_find(const char *name) { - elevator_t *e = &q->elevator; + struct elevator_type *e = NULL; + struct list_head *entry; + + spin_lock_irq(&elv_list_lock); + list_for_each(entry, &elv_list) { + struct elevator_type *__e; - memcpy(e, type, sizeof(*e)); + __e = list_entry(entry, struct elevator_type, list); + + if (!strcmp(__e->elevator_name, name)) { + e = __e; + break; + } + } + spin_unlock_irq(&elv_list_lock); + + return e; +} + +static void elevator_put(struct elevator_type *e) +{ + module_put(e->elevator_owner); +} + +static struct elevator_type *elevator_get(const char *name) +{ + struct elevator_type *e = elevator_find(name); + + if (!e) + return NULL; + if (!try_module_get(e->elevator_owner)) + return NULL; + + return e; +} + +static int elevator_attach(request_queue_t *q, struct elevator_type *e, + struct elevator_queue *eq) +{ + int ret = 0; + + memset(eq, 0, sizeof(*eq)); + eq->ops = &e->ops; + eq->elevator_type = e; INIT_LIST_HEAD(&q->queue_head); q->last_merge = NULL; + q->elevator = eq; + + if (eq->ops->elevator_init_fn) + ret = eq->ops->elevator_init_fn(q, eq); + + return ret; +} - if (e->elevator_init_fn) - return e->elevator_init_fn(q, e); +static char chosen_elevator[16]; +static void elevator_setup_default(void) +{ + /* + * check if default is set and exists + */ + if (chosen_elevator[0] && elevator_find(chosen_elevator)) + return; + +#if defined(CONFIG_IOSCHED_AS) + strcpy(chosen_elevator, "anticipatory"); +#elif defined(CONFIG_IOSCHED_DEADLINE) + strcpy(chosen_elevator, "deadline"); +#elif defined(CONFIG_IOSCHED_CFQ) + strcpy(chosen_elevator, "cfq"); +#elif defined(CONFIG_IOSCHED_NOOP) + strcpy(chosen_elevator, "noop"); +#else +#error "You must build at least 1 IO scheduler into the kernel" +#endif +} + +static int __init elevator_setup(char *str) +{ + strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); return 0; } -void elevator_exit(request_queue_t *q) +__setup("elevator=", elevator_setup); + +int elevator_init(request_queue_t *q, char *name) +{ + struct elevator_type *e = NULL; + struct elevator_queue *eq; + int ret = 0; + + elevator_setup_default(); + + if (!name) + name = chosen_elevator; + + e = elevator_get(name); + if (!e) + return -EINVAL; + + eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL); + if (!eq) { + elevator_put(e->elevator_type); + return -ENOMEM; + } + + ret = elevator_attach(q, e, eq); + if (ret) { + kfree(eq); + elevator_put(e->elevator_type); + } + + return ret; +} + +void elevator_exit(elevator_t *e) { - elevator_t *e = &q->elevator; + if (e->ops->elevator_exit_fn) + e->ops->elevator_exit_fn(e); - if (e->elevator_exit_fn) - e->elevator_exit_fn(q, e); + elevator_put(e->elevator_type); + e->elevator_type = NULL; + kfree(e); } int elevator_global_init(void) @@ -119,32 +227,32 @@ int elevator_global_init(void) int elv_merge(request_queue_t *q, struct request **req, struct bio *bio) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_merge_fn) - return e->elevator_merge_fn(q, req, bio); + if (e->ops->elevator_merge_fn) + return e->ops->elevator_merge_fn(q, req, bio); return ELEVATOR_NO_MERGE; } void elv_merged_request(request_queue_t *q, struct request *rq) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_merged_fn) - e->elevator_merged_fn(q, rq); + if (e->ops->elevator_merged_fn) + e->ops->elevator_merged_fn(q, rq); } void elv_merge_requests(request_queue_t *q, struct request *rq, struct request *next) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; if (q->last_merge == next) q->last_merge = NULL; - if (e->elevator_merge_req_fn) - e->elevator_merge_req_fn(q, rq, next); + if (e->ops->elevator_merge_req_fn) + e->ops->elevator_merge_req_fn(q, rq, next); } void elv_requeue_request(request_queue_t *q, struct request *rq) @@ -160,8 +268,8 @@ void elv_requeue_request(request_queue_t *q, struct request *rq) * if iosched has an explicit requeue hook, then use that. otherwise * just put the request at the front of the queue */ - if (q->elevator.elevator_requeue_req_fn) - q->elevator.elevator_requeue_req_fn(q, rq); + if (q->elevator->ops->elevator_requeue_req_fn) + q->elevator->ops->elevator_requeue_req_fn(q, rq); else __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0); } @@ -180,15 +288,24 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where, blk_plug_device(q); rq->q = q; - q->elevator.elevator_add_req_fn(q, rq, where); - if (blk_queue_plugged(q)) { - int nrq = q->rq.count[READ] + q->rq.count[WRITE] - q->in_flight; + if (!test_bit(QUEUE_FLAG_DRAIN, &q->queue_flags)) { + q->elevator->ops->elevator_add_req_fn(q, rq, where); - if (nrq == q->unplug_thresh) - __generic_unplug_device(q); - } + if (blk_queue_plugged(q)) { + int nrq = q->rq.count[READ] + q->rq.count[WRITE] + - q->in_flight; + if (nrq == q->unplug_thresh) + __generic_unplug_device(q); + } + } else + /* + * if drain is set, store the request "locally". when the drain + * is finished, the requests will be handed ordered to the io + * scheduler + */ + list_add_tail(&rq->queuelist, &q->drain_list); } void elv_add_request(request_queue_t *q, struct request *rq, int where, @@ -203,7 +320,7 @@ void elv_add_request(request_queue_t *q, struct request *rq, int where, static inline struct request *__elv_next_request(request_queue_t *q) { - return q->elevator.elevator_next_req_fn(q); + return q->elevator->ops->elevator_next_req_fn(q); } struct request *elv_next_request(request_queue_t *q) @@ -242,7 +359,8 @@ struct request *elv_next_request(request_queue_t *q) end_that_request_chunk(rq, 0, nr_bytes); end_that_request_last(rq); } else { - printk("%s: bad return=%d\n", __FUNCTION__, ret); + printk(KERN_ERR "%s: bad return=%d\n", __FUNCTION__, + ret); break; } } @@ -252,7 +370,7 @@ struct request *elv_next_request(request_queue_t *q) void elv_remove_request(request_queue_t *q, struct request *rq) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; /* * the time frame between a request being removed from the lists @@ -274,16 +392,16 @@ void elv_remove_request(request_queue_t *q, struct request *rq) if (rq == q->last_merge) q->last_merge = NULL; - if (e->elevator_remove_req_fn) - e->elevator_remove_req_fn(q, rq); + if (e->ops->elevator_remove_req_fn) + e->ops->elevator_remove_req_fn(q, rq); } int elv_queue_empty(request_queue_t *q) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_queue_empty_fn) - return e->elevator_queue_empty_fn(q); + if (e->ops->elevator_queue_empty_fn) + return e->ops->elevator_queue_empty_fn(q); return list_empty(&q->queue_head); } @@ -292,10 +410,10 @@ struct request *elv_latter_request(request_queue_t *q, struct request *rq) { struct list_head *next; - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_latter_req_fn) - return e->elevator_latter_req_fn(q, rq); + if (e->ops->elevator_latter_req_fn) + return e->ops->elevator_latter_req_fn(q, rq); next = rq->queuelist.next; if (next != &q->queue_head && next != &rq->queuelist) @@ -308,10 +426,10 @@ struct request *elv_former_request(request_queue_t *q, struct request *rq) { struct list_head *prev; - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_former_req_fn) - return e->elevator_former_req_fn(q, rq); + if (e->ops->elevator_former_req_fn) + return e->ops->elevator_former_req_fn(q, rq); prev = rq->queuelist.prev; if (prev != &q->queue_head && prev != &rq->queuelist) @@ -322,10 +440,10 @@ struct request *elv_former_request(request_queue_t *q, struct request *rq) int elv_set_request(request_queue_t *q, struct request *rq, int gfp_mask) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_set_req_fn) - return e->elevator_set_req_fn(q, rq, gfp_mask); + if (e->ops->elevator_set_req_fn) + return e->ops->elevator_set_req_fn(q, rq, gfp_mask); rq->elevator_private = NULL; return 0; @@ -333,25 +451,25 @@ int elv_set_request(request_queue_t *q, struct request *rq, int gfp_mask) void elv_put_request(request_queue_t *q, struct request *rq) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_put_req_fn) - e->elevator_put_req_fn(q, rq); + if (e->ops->elevator_put_req_fn) + e->ops->elevator_put_req_fn(q, rq); } int elv_may_queue(request_queue_t *q, int rw) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; - if (e->elevator_may_queue_fn) - return e->elevator_may_queue_fn(q, rw); + if (e->ops->elevator_may_queue_fn) + return e->ops->elevator_may_queue_fn(q, rw); - return 0; + return ELV_MQUEUE_MAY; } void elv_completed_request(request_queue_t *q, struct request *rq) { - elevator_t *e = &q->elevator; + elevator_t *e = q->elevator; /* * request is released from the driver, io must be done @@ -359,22 +477,20 @@ void elv_completed_request(request_queue_t *q, struct request *rq) if (blk_account_rq(rq)) q->in_flight--; - if (e->elevator_completed_req_fn) - e->elevator_completed_req_fn(q, rq); + if (e->ops->elevator_completed_req_fn) + e->ops->elevator_completed_req_fn(q, rq); } int elv_register_queue(struct request_queue *q) { - elevator_t *e; - - e = &q->elevator; + elevator_t *e = q->elevator; e->kobj.parent = kobject_get(&q->kobj); if (!e->kobj.parent) return -EBUSY; snprintf(e->kobj.name, KOBJ_NAME_LEN, "%s", "iosched"); - e->kobj.ktype = e->elevator_ktype; + e->kobj.ktype = e->elevator_type->elevator_ktype; return kobject_register(&e->kobj); } @@ -382,12 +498,160 @@ int elv_register_queue(struct request_queue *q) void elv_unregister_queue(struct request_queue *q) { if (q) { - elevator_t * e = &q->elevator; + elevator_t *e = q->elevator; kobject_unregister(&e->kobj); kobject_put(&q->kobj); } } +int elv_register(struct elevator_type *e) +{ + if (elevator_find(e->elevator_name)) + BUG(); + + spin_lock_irq(&elv_list_lock); + list_add_tail(&e->list, &elv_list); + spin_unlock_irq(&elv_list_lock); + + printk(KERN_INFO "io scheduler %s registered", e->elevator_name); + if (!strcmp(e->elevator_name, chosen_elevator)) + printk(" (default)"); + printk("\n"); + return 0; +} +EXPORT_SYMBOL_GPL(elv_register); + +void elv_unregister(struct elevator_type *e) +{ + spin_lock_irq(&elv_list_lock); + list_del_init(&e->list); + spin_unlock_irq(&elv_list_lock); +} +EXPORT_SYMBOL_GPL(elv_unregister); + +/* + * switch to new_e io scheduler. be careful not to introduce deadlocks - + * we don't free the old io scheduler, before we have allocated what we + * need for the new one. this way we have a chance of going back to the old + * one, if the new one fails init for some reason. we also do an intermediate + * switch to noop to ensure safety with stack-allocated requests, since they + * don't originate from the block layer allocator. noop is safe here, because + * it never needs to touch the elevator itself for completion events. DRAIN + * flags will make sure we don't touch it for additions either. + */ +static void elevator_switch(request_queue_t *q, struct elevator_type *new_e) +{ + elevator_t *e = kmalloc(sizeof(elevator_t), GFP_KERNEL); + struct elevator_type *noop_elevator = NULL; + elevator_t *old_elevator; + + if (!e) + goto error; + + /* + * first step, drain requests from the block freelist + */ + blk_wait_queue_drained(q, 0); + + /* + * unregister old elevator data + */ + elv_unregister_queue(q); + old_elevator = q->elevator; + + /* + * next step, switch to noop since it uses no private rq structures + * and doesn't allocate any memory for anything. then wait for any + * non-fs requests in-flight + */ + noop_elevator = elevator_get("noop"); + spin_lock_irq(q->queue_lock); + elevator_attach(q, noop_elevator, e); + spin_unlock_irq(q->queue_lock); + + blk_wait_queue_drained(q, 1); + + /* + * attach and start new elevator + */ + if (elevator_attach(q, new_e, e)) + goto fail; + + if (elv_register_queue(q)) + goto fail_register; + + /* + * finally exit old elevator and start queue again + */ + elevator_exit(old_elevator); + blk_finish_queue_drain(q); + elevator_put(noop_elevator); + return; + +fail_register: + /* + * switch failed, exit the new io scheduler and reattach the old + * one again (along with re-adding the sysfs dir) + */ + elevator_exit(e); +fail: + q->elevator = old_elevator; + elv_register_queue(q); + blk_finish_queue_drain(q); +error: + if (noop_elevator) + elevator_put(noop_elevator); + elevator_put(new_e); + printk(KERN_ERR "elevator: switch to %s failed\n",new_e->elevator_name); +} + +ssize_t elv_iosched_store(request_queue_t *q, const char *name, size_t count) +{ + char elevator_name[ELV_NAME_MAX]; + struct elevator_type *e; + + memset(elevator_name, 0, sizeof(elevator_name)); + strncpy(elevator_name, name, sizeof(elevator_name)); + + if (elevator_name[strlen(elevator_name) - 1] == '\n') + elevator_name[strlen(elevator_name) - 1] = '\0'; + + e = elevator_get(elevator_name); + if (!e) { + printk(KERN_ERR "elevator: type %s not found\n", elevator_name); + return -EINVAL; + } + + if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) + return count; + + elevator_switch(q, e); + return count; +} + +ssize_t elv_iosched_show(request_queue_t *q, char *name) +{ + elevator_t *e = q->elevator; + struct elevator_type *elv = e->elevator_type; + struct list_head *entry; + int len = 0; + + spin_lock_irq(q->queue_lock); + list_for_each(entry, &elv_list) { + struct elevator_type *__e; + + __e = list_entry(entry, struct elevator_type, list); + if (!strcmp(elv->elevator_name, __e->elevator_name)) + len += sprintf(name+len, "[%s] ", elv->elevator_name); + else + len += sprintf(name+len, "%s ", __e->elevator_name); + } + spin_unlock_irq(q->queue_lock); + + len += sprintf(len+name, "\n"); + return len; +} + module_init(elevator_global_init); EXPORT_SYMBOL(elv_add_request); diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 5bf390d1b..0beaf4220 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -155,7 +155,6 @@ static int print_unex = 1; #include #include #include -#include #define FDPATCHES #include @@ -217,7 +216,7 @@ static int use_virtual_dma; * record each buffers capabilities */ -static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(floppy_lock); static struct completion device_release; static unsigned short virtual_dma_port = 0x3f0; @@ -359,7 +358,11 @@ static int inr; /* size of reply buffer, when called from interrupt */ #define R_SECTOR (reply_buffer[5]) #define R_SIZECODE (reply_buffer[6]) +#if HZ < 12800 #define SEL_DLY (2*HZ/100) +#else +#define SEL_DLY (255) +#endif /* * this struct defines the different floppy drive types. @@ -1073,7 +1076,7 @@ static int fd_wait_for_completion(unsigned long delay, timeout_fn function) return 0; } -static spinlock_t floppy_hlt_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(floppy_hlt_lock); static int hlt_disabled; static void floppy_disable_hlt(void) { @@ -1787,10 +1790,11 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs) } while ((ST0 & 0x83) != UNIT(current_drive) && inr == 2 && max_sensei); } - if (handler) - schedule_bh(handler); - else + if (!handler) { FDCS->reset = 1; + return IRQ_NONE; + } + schedule_bh(handler); is_alive("normal interrupt end"); /* FIXME! Was it really for us? */ @@ -3318,11 +3322,6 @@ static int invalidate_drive(struct block_device *bdev) return 0; } -static inline void clear_write_error(int drive) -{ - CLEARSTRUCT(UDRWE); -} - static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, int drive, int type, struct block_device *bdev) { @@ -4089,7 +4088,7 @@ static void __init daring(int *ints, int param, int param2) FD_SILENT_DCL_CLEAR; } else { default_drive_params[i].params.select_delay = - 2 * HZ / 100; + SEL_DLY; default_drive_params[i].params.flags &= ~FD_SILENT_DCL_CLEAR; } @@ -4124,7 +4123,7 @@ static struct param_table { int *var; int def_param; int param2; -} config_params[] = { +} config_params[] __initdata = { {"allowed_drive_mask", NULL, &allowed_drive_mask, 0xff, 0}, /* obsolete */ {"all_drives", NULL, &allowed_drive_mask, 0xff, 0}, /* obsolete */ {"asus_pci", NULL, &allowed_drive_mask, 0x33, 0}, @@ -4286,6 +4285,13 @@ int __init floppy_init(void) } use_virtual_dma = can_use_virtual_dma & 1; +#if defined(CONFIG_PPC64) + if (check_legacy_ioport(FDC1)) { + del_timer(&fd_timeout); + err = -ENODEV; + goto out_unreg_region; + } +#endif fdc_state[0].address = FDC1; if (fdc_state[0].address == -1) { del_timer(&fd_timeout); @@ -4315,6 +4321,12 @@ int __init floppy_init(void) floppy_track_buffer = NULL; max_buffer_sectors = 0; } + /* + * Small 10 msec delay to let through any interrupt that + * initialization might have triggered, to not + * confuse detection: + */ + msleep(10); for (i = 0; i < N_FDC; i++) { fdc = i; @@ -4407,7 +4419,7 @@ out_put_disk: return err; } -static spinlock_t floppy_usage_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(floppy_usage_lock); static int floppy_grab_irq_and_dma(void) { @@ -4582,8 +4594,6 @@ static void __init parse_floppy_cfg_string(char *cfg) int init_module(void) { - printk(KERN_INFO "inserting floppy driver for " UTS_RELEASE "\n"); - if (floppy) parse_floppy_cfg_string(floppy); return floppy_init(); @@ -4623,9 +4633,9 @@ void cleanup_module(void) wait_for_completion(&device_release); } -MODULE_PARM(floppy, "s"); -MODULE_PARM(FLOPPY_IRQ, "i"); -MODULE_PARM(FLOPPY_DMA, "i"); +module_param(floppy, charp, 0); +module_param(FLOPPY_IRQ, int, 0); +module_param(FLOPPY_DMA, int, 0); MODULE_AUTHOR("Alain L. Knaff"); MODULE_SUPPORTED_DEVICE("fd"); MODULE_LICENSE("GPL"); diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index c68215b35..80da35816 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c @@ -19,10 +19,11 @@ static struct subsystem block_subsys; +static DECLARE_MUTEX(block_subsys_sem); + /* * Can be deleted altogether. Later. * - * Modified under both block_subsys.rwsem and major_names_lock. */ static struct blk_major_name { struct blk_major_name *next; @@ -30,14 +31,13 @@ static struct blk_major_name { char name[16]; } *major_names[MAX_PROBE_HASH]; -static spinlock_t major_names_lock = SPIN_LOCK_UNLOCKED; - /* index in the above - for now: assume no multimajor ranges */ static inline int major_to_index(int major) { return major % MAX_PROBE_HASH; } +#ifdef CONFIG_PROC_FS /* get block device names in somewhat random order */ int get_blkdev_list(char *p) { @@ -46,24 +46,24 @@ int get_blkdev_list(char *p) len = sprintf(p, "\nBlock devices:\n"); - down_read(&block_subsys.rwsem); + down(&block_subsys_sem); for (i = 0; i < ARRAY_SIZE(major_names); i++) { for (n = major_names[i]; n; n = n->next) len += sprintf(p+len, "%3d %s\n", n->major, n->name); } - up_read(&block_subsys.rwsem); + up(&block_subsys_sem); return len; } +#endif int register_blkdev(unsigned int major, const char *name) { struct blk_major_name **n, *p; int index, ret = 0; - unsigned long flags; - down_write(&block_subsys.rwsem); + down(&block_subsys_sem); /* temporary */ if (major == 0) { @@ -93,7 +93,6 @@ int register_blkdev(unsigned int major, const char *name) p->next = NULL; index = major_to_index(major); - spin_lock_irqsave(&major_names_lock, flags); for (n = &major_names[index]; *n; n = &(*n)->next) { if ((*n)->major == major) break; @@ -102,7 +101,6 @@ int register_blkdev(unsigned int major, const char *name) *n = p; else ret = -EBUSY; - spin_unlock_irqrestore(&major_names_lock, flags); if (ret < 0) { printk("register_blkdev: cannot get major %d for %s\n", @@ -110,7 +108,7 @@ int register_blkdev(unsigned int major, const char *name) kfree(p); } out: - up_write(&block_subsys.rwsem); + up(&block_subsys_sem); return ret; } @@ -122,11 +120,9 @@ int unregister_blkdev(unsigned int major, const char *name) struct blk_major_name **n; struct blk_major_name *p = NULL; int index = major_to_index(major); - unsigned long flags; int ret = 0; - down_write(&block_subsys.rwsem); - spin_lock_irqsave(&major_names_lock, flags); + down(&block_subsys_sem); for (n = &major_names[index]; *n; n = &(*n)->next) if ((*n)->major == major) break; @@ -136,8 +132,7 @@ int unregister_blkdev(unsigned int major, const char *name) p = *n; *n = p->next; } - spin_unlock_irqrestore(&major_names_lock, flags); - up_write(&block_subsys.rwsem); + up(&block_subsys_sem); kfree(p); return ret; @@ -231,7 +226,7 @@ static void *part_start(struct seq_file *part, loff_t *pos) struct list_head *p; loff_t l = *pos; - down_read(&block_subsys.rwsem); + down(&block_subsys_sem); list_for_each(p, &block_subsys.kset.list) if (!l--) return list_entry(p, struct gendisk, kobj.entry); @@ -248,7 +243,7 @@ static void *part_next(struct seq_file *part, void *v, loff_t *pos) static void part_stop(struct seq_file *part, void *v) { - up_read(&block_subsys.rwsem); + up(&block_subsys_sem); } static int show_partition(struct seq_file *part, void *v) @@ -305,7 +300,7 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data) return NULL; } -int __init device_init(void) +static int __init genhd_device_init(void) { bdev_map = kobj_map_init(base_probe, &block_subsys); blk_dev_init(); @@ -313,19 +308,13 @@ int __init device_init(void) return 0; } -subsys_initcall(device_init); +subsys_initcall(genhd_device_init); /* * kobject & sysfs bindings for block devices */ - -struct disk_attribute { - struct attribute attr; - ssize_t (*show)(struct gendisk *, char *); -}; - static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr, char *page) { @@ -438,8 +427,52 @@ static int block_hotplug_filter(struct kset *kset, struct kobject *kobj) return ((ktype == &ktype_block) || (ktype == &ktype_part)); } +static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp, + int num_envp, char *buffer, int buffer_size) +{ + struct device *dev = NULL; + struct kobj_type *ktype = get_ktype(kobj); + int length = 0; + int i = 0; + + /* get physical device backing disk or partition */ + if (ktype == &ktype_block) { + struct gendisk *disk = container_of(kobj, struct gendisk, kobj); + dev = disk->driverfs_dev; + } else if (ktype == &ktype_part) { + struct gendisk *disk = container_of(kobj->parent, struct gendisk, kobj); + dev = disk->driverfs_dev; + } + + if (dev) { + /* add physical device, backing this device */ + char *path = kobject_get_path(&dev->kobj, GFP_KERNEL); + + add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, + &length, "PHYSDEVPATH=%s", path); + kfree(path); + + /* add bus name of physical device */ + if (dev->bus) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVBUS=%s", dev->bus->name); + + /* add driver name of physical device */ + if (dev->driver) + add_hotplug_env_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVDRIVER=%s", dev->driver->name); + + envp[i] = NULL; + } + + return 0; +} + static struct kset_hotplug_ops block_hotplug_ops = { - .filter = block_hotplug_filter, + .filter = block_hotplug_filter, + .hotplug = block_hotplug, }; /* declare block_subsys. */ @@ -462,7 +495,7 @@ static void *diskstats_start(struct seq_file *part, loff_t *pos) loff_t k = *pos; struct list_head *p; - down_read(&block_subsys.rwsem); + down(&block_subsys_sem); list_for_each(p, &block_subsys.kset.list) if (!k--) return list_entry(p, struct gendisk, kobj.entry); @@ -479,7 +512,7 @@ static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos) static void diskstats_stop(struct seq_file *part, void *v) { - up_read(&block_subsys.rwsem); + up(&block_subsys_sem); } static int diskstats_show(struct seq_file *s, void *v) @@ -627,9 +660,10 @@ int invalidate_partition(struct gendisk *disk, int index) { int res = 0; struct block_device *bdev = bdget_disk(disk, index); - if (bdev) + if (bdev) { res = __invalidate_device(bdev, 1); - bdput(bdev); + bdput(bdev); + } return res; } diff --git a/drivers/block/ida_cmd.h b/drivers/block/ida_cmd.h index e5f096e26..98b5746b3 100644 --- a/drivers/block/ida_cmd.h +++ b/drivers/block/ida_cmd.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to arrays@compaq.com + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * */ #ifndef ARRAYCMD_H diff --git a/drivers/block/ida_ioctl.h b/drivers/block/ida_ioctl.h index 4159e52e8..888fff9ca 100644 --- a/drivers/block/ida_ioctl.h +++ b/drivers/block/ida_ioctl.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to arrays@compaq.com + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * */ #ifndef IDA_IOCTL_H diff --git a/drivers/block/ioctl.c b/drivers/block/ioctl.c index 43ff0c6ed..5e03f5157 100644 --- a/drivers/block/ioctl.c +++ b/drivers/block/ioctl.c @@ -3,6 +3,7 @@ #include #include #include +#include #include static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg) @@ -220,3 +221,19 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, } return -ENOTTY; } + +/* Most of the generic ioctls are handled in the normal fallback path. + This assumes the blkdev's low level compat_ioctl always returns + ENOIOCTLCMD for unknown ioctls. */ +long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) +{ + struct block_device *bdev = file->f_dentry->d_inode->i_bdev; + struct gendisk *disk = bdev->bd_disk; + int ret = -ENOIOCTLCMD; + if (disk->fops->compat_ioctl) { + lock_kernel(); + ret = disk->fops->compat_ioctl(file, cmd, arg); + unlock_kernel(); + } + return ret; +} diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 26fdf6be6..3994af7e5 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -100,7 +100,7 @@ static void blk_queue_congestion_threshold(struct request_queue *q) nr = q->nr_requests; q->nr_congestion_on = nr; - nr = q->nr_requests - (q->nr_requests / 8) - 1; + nr = q->nr_requests - (q->nr_requests / 8) - (q->nr_requests / 16) - 1; if (nr < 1) nr = 1; q->nr_congestion_off = nr; @@ -243,6 +243,7 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn) blk_queue_hardsect_size(q, 512); blk_queue_dma_alignment(q, 511); blk_queue_congestion_threshold(q); + q->nr_batching = BLK_BATCH_REQ; q->unplug_thresh = 4; /* hmm */ q->unplug_delay = (3 * HZ) / 1000; /* 3 milliseconds */ @@ -260,6 +261,8 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn) blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); blk_queue_activity_fn(q, NULL, NULL); + + INIT_LIST_HEAD(&q->drain_list); } EXPORT_SYMBOL(blk_queue_make_request); @@ -1354,9 +1357,29 @@ void blk_stop_queue(request_queue_t *q) blk_remove_plug(q); set_bit(QUEUE_FLAG_STOPPED, &q->queue_flags); } - EXPORT_SYMBOL(blk_stop_queue); +/** + * blk_sync_queue - cancel any pending callbacks on a queue + * @q: the queue + * + * Description: + * The block layer may perform asynchronous callback activity + * on a queue, such as calling the unplug function after a timeout. + * A block device may call blk_sync_queue to ensure that any + * such activity is cancelled, thus allowing it to release resources + * the the callbacks might use. The caller must already have made sure + * that its ->make_request_fn will not re-add plugging prior to calling + * this function. + * + */ +void blk_sync_queue(struct request_queue *q) +{ + del_timer_sync(&q->unplug_timer); + kblockd_flush(); +} +EXPORT_SYMBOL(blk_sync_queue); + /** * blk_run_queue - run a single device queue * @q: The queue to run @@ -1370,7 +1393,6 @@ void blk_run_queue(struct request_queue *q) q->request_fn(q); spin_unlock_irqrestore(q->queue_lock, flags); } - EXPORT_SYMBOL(blk_run_queue); /** @@ -1395,10 +1417,10 @@ void blk_cleanup_queue(request_queue_t * q) if (!atomic_dec_and_test(&q->refcnt)) return; - elevator_exit(q); + if (q->elevator) + elevator_exit(q->elevator); - del_timer_sync(&q->unplug_timer); - kblockd_flush(); + blk_sync_queue(q); if (rl->rq_pool) mempool_destroy(rl->rq_pool); @@ -1416,8 +1438,10 @@ static int blk_init_free_list(request_queue_t *q) struct request_list *rl = &q->rq; rl->count[READ] = rl->count[WRITE] = 0; + rl->starved[READ] = rl->starved[WRITE] = 0; init_waitqueue_head(&rl->wait[READ]); init_waitqueue_head(&rl->wait[WRITE]); + init_waitqueue_head(&rl->drain); rl->rq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, request_cachep); @@ -1429,45 +1453,6 @@ static int blk_init_free_list(request_queue_t *q) static int __make_request(request_queue_t *, struct bio *); -static elevator_t *chosen_elevator = -#if defined(CONFIG_IOSCHED_AS) - &iosched_as; -#elif defined(CONFIG_IOSCHED_DEADLINE) - &iosched_deadline; -#elif defined(CONFIG_IOSCHED_CFQ) - &iosched_cfq; -#elif defined(CONFIG_IOSCHED_NOOP) - &elevator_noop; -#else - NULL; -#error "You must have at least 1 I/O scheduler selected" -#endif - -#if defined(CONFIG_IOSCHED_AS) || defined(CONFIG_IOSCHED_DEADLINE) || defined (CONFIG_IOSCHED_NOOP) -static int __init elevator_setup(char *str) -{ -#ifdef CONFIG_IOSCHED_DEADLINE - if (!strcmp(str, "deadline")) - chosen_elevator = &iosched_deadline; -#endif -#ifdef CONFIG_IOSCHED_AS - if (!strcmp(str, "as")) - chosen_elevator = &iosched_as; -#endif -#ifdef CONFIG_IOSCHED_CFQ - if (!strcmp(str, "cfq")) - chosen_elevator = &iosched_cfq; -#endif -#ifdef CONFIG_IOSCHED_NOOP - if (!strcmp(str, "noop")) - chosen_elevator = &elevator_noop; -#endif - return 1; -} - -__setup("elevator=", elevator_setup); -#endif /* CONFIG_IOSCHED_AS || CONFIG_IOSCHED_DEADLINE || CONFIG_IOSCHED_NOOP */ - request_queue_t *blk_alloc_queue(int gfp_mask) { request_queue_t *q = kmem_cache_alloc(requestq_cachep, gfp_mask); @@ -1520,21 +1505,14 @@ EXPORT_SYMBOL(blk_alloc_queue); **/ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock) { - request_queue_t *q; - static int printed; + request_queue_t *q = blk_alloc_queue(GFP_KERNEL); - q = blk_alloc_queue(GFP_KERNEL); if (!q) return NULL; if (blk_init_free_list(q)) goto out_init; - if (!printed) { - printed = 1; - printk("Using %s io scheduler\n", chosen_elevator->elevator_name); - } - q->request_fn = rfn; q->back_merge_fn = ll_back_merge_fn; q->front_merge_fn = ll_front_merge_fn; @@ -1555,8 +1533,10 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock) /* * all done */ - if (!elevator_init(q, chosen_elevator)) + if (!elevator_init(q, NULL)) { + blk_queue_congestion_threshold(q); return q; + } blk_cleanup_queue(q); out_init: @@ -1584,13 +1564,20 @@ static inline void blk_free_request(request_queue_t *q, struct request *rq) mempool_free(rq, q->rq.rq_pool); } -static inline struct request *blk_alloc_request(request_queue_t *q,int gfp_mask) +static inline struct request *blk_alloc_request(request_queue_t *q, int rw, + int gfp_mask) { struct request *rq = mempool_alloc(q->rq.rq_pool, gfp_mask); if (!rq) return NULL; + /* + * first three bits are identical in rq->flags and bio->bi_rw, + * see bio.h and blkdev.h + */ + rq->flags = rw; + if (!elv_set_request(q, rq, gfp_mask)) return rq; @@ -1602,7 +1589,7 @@ static inline struct request *blk_alloc_request(request_queue_t *q,int gfp_mask) * ioc_batching returns true if the ioc is a valid batching request and * should be given priority access to a request. */ -static inline int ioc_batching(struct io_context *ioc) +static inline int ioc_batching(request_queue_t *q, struct io_context *ioc) { if (!ioc) return 0; @@ -1612,7 +1599,7 @@ static inline int ioc_batching(struct io_context *ioc) * even if the batch times out, otherwise we could theoretically * lose wakeups. */ - return ioc->nr_batch_requests == BLK_BATCH_REQ || + return ioc->nr_batch_requests == q->nr_batching || (ioc->nr_batch_requests > 0 && time_before(jiffies, ioc->last_waited + BLK_BATCH_TIME)); } @@ -1623,15 +1610,31 @@ static inline int ioc_batching(struct io_context *ioc) * is the behaviour we want though - once it gets a wakeup it should be given * a nice run. */ -void ioc_set_batching(struct io_context *ioc) +void ioc_set_batching(request_queue_t *q, struct io_context *ioc) { - if (!ioc || ioc_batching(ioc)) + if (!ioc || ioc_batching(q, ioc)) return; - ioc->nr_batch_requests = BLK_BATCH_REQ; + ioc->nr_batch_requests = q->nr_batching; ioc->last_waited = jiffies; } +static void __freed_request(request_queue_t *q, int rw) +{ + struct request_list *rl = &q->rq; + + if (rl->count[rw] < queue_congestion_off_threshold(q)) + clear_queue_congested(q, rw); + + if (rl->count[rw] + 1 <= q->nr_requests) { + smp_mb(); + if (waitqueue_active(&rl->wait[rw])) + wake_up(&rl->wait[rw]); + + blk_clear_queue_full(q, rw); + } +} + /* * A request has just been released. Account for it, update the full and * congestion status, wake up any waiters. Called under q->queue_lock. @@ -1641,13 +1644,16 @@ static void freed_request(request_queue_t *q, int rw) struct request_list *rl = &q->rq; rl->count[rw]--; - if (rl->count[rw] < queue_congestion_off_threshold(q)) - clear_queue_congested(q, rw); - if (rl->count[rw]+1 <= q->nr_requests) { - if (waitqueue_active(&rl->wait[rw])) - wake_up(&rl->wait[rw]); - if (!waitqueue_active(&rl->wait[rw])) - blk_clear_queue_full(q, rw); + + __freed_request(q, rw); + + if (unlikely(rl->starved[rw ^ 1])) + __freed_request(q, rw ^ 1); + + if (!rl->count[READ] && !rl->count[WRITE]) { + smp_mb(); + if (unlikely(waitqueue_active(&rl->drain))) + wake_up(&rl->drain); } } @@ -1661,6 +1667,9 @@ static struct request *get_request(request_queue_t *q, int rw, int gfp_mask) struct request_list *rl = &q->rq; struct io_context *ioc = get_io_context(gfp_mask); + if (unlikely(test_bit(QUEUE_FLAG_DRAIN, &q->queue_flags))) + goto out; + spin_lock_irq(q->queue_lock); if (rl->count[rw]+1 >= q->nr_requests) { /* @@ -1670,13 +1679,21 @@ static struct request *get_request(request_queue_t *q, int rw, int gfp_mask) * will be blocked. */ if (!blk_queue_full(q, rw)) { - ioc_set_batching(ioc); + ioc_set_batching(q, ioc); blk_set_queue_full(q, rw); } } - if (blk_queue_full(q, rw) - && !ioc_batching(ioc) && !elv_may_queue(q, rw)) { + switch (elv_may_queue(q, rw)) { + case ELV_MQUEUE_NO: + goto rq_starved; + case ELV_MQUEUE_MAY: + break; + case ELV_MQUEUE_MUST: + goto get_rq; + } + + if (blk_queue_full(q, rw) && !ioc_batching(q, ioc)) { /* * The queue is full and the allocating process is not a * "batcher", and not exempted by the IO scheduler @@ -1685,12 +1702,14 @@ static struct request *get_request(request_queue_t *q, int rw, int gfp_mask) goto out; } +get_rq: rl->count[rw]++; + rl->starved[rw] = 0; if (rl->count[rw] >= queue_congestion_on_threshold(q)) set_queue_congested(q, rw); spin_unlock_irq(q->queue_lock); - rq = blk_alloc_request(q, gfp_mask); + rq = blk_alloc_request(q, rw, gfp_mask); if (!rq) { /* * Allocation failed presumably due to memory. Undo anything @@ -1701,21 +1720,27 @@ static struct request *get_request(request_queue_t *q, int rw, int gfp_mask) */ spin_lock_irq(q->queue_lock); freed_request(q, rw); + + /* + * in the very unlikely event that allocation failed and no + * requests for this direction was pending, mark us starved + * so that freeing of a request in the other direction will + * notice us. another possible fix would be to split the + * rq mempool into READ and WRITE + */ +rq_starved: + if (unlikely(rl->count[rw] == 0)) + rl->starved[rw] = 1; + spin_unlock_irq(q->queue_lock); goto out; } - if (ioc_batching(ioc)) + if (ioc_batching(q, ioc)) ioc->nr_batch_requests--; INIT_LIST_HEAD(&rq->queuelist); - /* - * first three bits are identical in rq->flags and bio->bi_rw, - * see bio.h and blkdev.h - */ - rq->flags = rw; - rq->errors = 0; rq->rq_status = RQ_ACTIVE; rq->bio = rq->biotail = NULL; @@ -1764,7 +1789,7 @@ static struct request *get_request_wait(request_queue_t *q, int rw) * See ioc_batching, ioc_set_batching */ ioc = get_io_context(GFP_NOIO); - ioc_set_batching(ioc); + ioc_set_batching(q, ioc); put_io_context(ioc); } finish_wait(&rl->wait[rw], &wait); @@ -2082,13 +2107,13 @@ void drive_stat_acct(struct request *rq, int nr_sectors, int new_io) return; if (rw == READ) { - disk_stat_add(rq->rq_disk, read_sectors, nr_sectors); + __disk_stat_add(rq->rq_disk, read_sectors, nr_sectors); if (!new_io) - disk_stat_inc(rq->rq_disk, read_merges); + __disk_stat_inc(rq->rq_disk, read_merges); } else if (rw == WRITE) { - disk_stat_add(rq->rq_disk, write_sectors, nr_sectors); + __disk_stat_add(rq->rq_disk, write_sectors, nr_sectors); if (!new_io) - disk_stat_inc(rq->rq_disk, write_merges); + __disk_stat_inc(rq->rq_disk, write_merges); } if (new_io) { disk_round_stats(rq->rq_disk); @@ -2134,12 +2159,12 @@ void disk_round_stats(struct gendisk *disk) { unsigned long now = jiffies; - disk_stat_add(disk, time_in_queue, + __disk_stat_add(disk, time_in_queue, disk->in_flight * (now - disk->stamp)); disk->stamp = now; if (disk->in_flight) - disk_stat_add(disk, io_ticks, (now - disk->stamp_idle)); + __disk_stat_add(disk, io_ticks, (now - disk->stamp_idle)); disk->stamp_idle = now; } @@ -2384,9 +2409,7 @@ again: break; bio->bi_next = req->bio; - req->cbio = req->bio = bio; - req->nr_cbio_segments = bio_segments(bio); - req->nr_cbio_sectors = bio_sectors(bio); + req->bio = bio; /* * may not be valid. if the low level driver said @@ -2458,11 +2481,9 @@ get_rq: req->current_nr_sectors = req->hard_cur_sectors = cur_nr_sectors; req->nr_phys_segments = bio_phys_segments(q, bio); req->nr_hw_segments = bio_hw_segments(q, bio); - req->nr_cbio_segments = bio_segments(bio); - req->nr_cbio_sectors = bio_sectors(bio); req->buffer = bio_data(bio); /* see ->buffer comment above */ req->waiting = NULL; - req->cbio = req->bio = req->biotail = bio; + req->bio = req->biotail = bio; req->rq_disk = bio->bi_bdev->bd_disk; req->start_time = jiffies; @@ -2506,6 +2527,106 @@ static inline void blk_partition_remap(struct bio *bio) } } +void blk_finish_queue_drain(request_queue_t *q) +{ + struct request_list *rl = &q->rq; + struct request *rq; + + spin_lock_irq(q->queue_lock); + clear_bit(QUEUE_FLAG_DRAIN, &q->queue_flags); + + while (!list_empty(&q->drain_list)) { + rq = list_entry_rq(q->drain_list.next); + + list_del_init(&rq->queuelist); + __elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); + } + + spin_unlock_irq(q->queue_lock); + + wake_up(&rl->wait[0]); + wake_up(&rl->wait[1]); + wake_up(&rl->drain); +} + +static int wait_drain(request_queue_t *q, struct request_list *rl, int dispatch) +{ + int wait = rl->count[READ] + rl->count[WRITE]; + + if (dispatch) + wait += !list_empty(&q->queue_head); + + return wait; +} + +/* + * We rely on the fact that only requests allocated through blk_alloc_request() + * have io scheduler private data structures associated with them. Any other + * type of request (allocated on stack or through kmalloc()) should not go + * to the io scheduler core, but be attached to the queue head instead. + */ +void blk_wait_queue_drained(request_queue_t *q, int wait_dispatch) +{ + struct request_list *rl = &q->rq; + DEFINE_WAIT(wait); + + spin_lock_irq(q->queue_lock); + set_bit(QUEUE_FLAG_DRAIN, &q->queue_flags); + + while (wait_drain(q, rl, wait_dispatch)) { + prepare_to_wait(&rl->drain, &wait, TASK_UNINTERRUPTIBLE); + + if (wait_drain(q, rl, wait_dispatch)) { + __generic_unplug_device(q); + spin_unlock_irq(q->queue_lock); + io_schedule(); + spin_lock_irq(q->queue_lock); + } + + finish_wait(&rl->drain, &wait); + } + + spin_unlock_irq(q->queue_lock); +} + +/* + * block waiting for the io scheduler being started again. + */ +static inline void block_wait_queue_running(request_queue_t *q) +{ + DEFINE_WAIT(wait); + + while (test_bit(QUEUE_FLAG_DRAIN, &q->queue_flags)) { + struct request_list *rl = &q->rq; + + prepare_to_wait_exclusive(&rl->drain, &wait, + TASK_UNINTERRUPTIBLE); + + /* + * re-check the condition. avoids using prepare_to_wait() + * in the fast path (queue is running) + */ + if (test_bit(QUEUE_FLAG_DRAIN, &q->queue_flags)) + io_schedule(); + + finish_wait(&rl->drain, &wait); + } +} + +static void handle_bad_sector(struct bio *bio) +{ + char b[BDEVNAME_SIZE]; + + printk(KERN_INFO "attempt to access beyond end of device\n"); + printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", + bdevname(bio->bi_bdev, b), + bio->bi_rw, + (unsigned long long)bio->bi_sector + bio_sectors(bio), + (long long)(bio->bi_bdev->bd_inode->i_size >> 9)); + + set_bit(BIO_EOF, &bio->bi_flags); +} + /** * generic_make_request: hand a buffer to its device driver for I/O * @bio: The bio describing the location in memory and on the device. @@ -2542,21 +2663,13 @@ void generic_make_request(struct bio *bio) if (maxsector) { sector_t sector = bio->bi_sector; - if (maxsector < nr_sectors || - maxsector - nr_sectors < sector) { - char b[BDEVNAME_SIZE]; - /* This may well happen - the kernel calls - * bread() without checking the size of the - * device, e.g., when mounting a device. */ - printk(KERN_INFO - "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", - bdevname(bio->bi_bdev, b), - bio->bi_rw, - (unsigned long long) sector + nr_sectors, - (long long) maxsector); - - set_bit(BIO_EOF, &bio->bi_flags); + if (maxsector < nr_sectors || maxsector - nr_sectors < sector) { + /* + * This may well happen - the kernel calls bread() + * without checking the size of the device, e.g., when + * mounting a device. + */ + handle_bad_sector(bio); goto end_io; } } @@ -2595,6 +2708,8 @@ end_io: if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) goto end_io; + block_wait_queue_running(q); + /* * If this device has partitions, remap block n * of partition p to block n+start(p) of the disk. @@ -2643,103 +2758,40 @@ void submit_bio(int rw, struct bio *bio) EXPORT_SYMBOL(submit_bio); -/** - * blk_rq_next_segment - * @rq: the request being processed - * - * Description: - * Points to the next segment in the request if the current segment - * is complete. Leaves things unchanged if this segment is not over - * or if no more segments are left in this request. - * - * Meant to be used for bio traversal during I/O submission - * Does not affect any I/O completions or update completion state - * in the request, and does not modify any bio fields. - * - * Decrementing rq->nr_sectors, rq->current_nr_sectors and - * rq->nr_cbio_sectors as data is transferred is the caller's - * responsibility and should be done before calling this routine. - **/ -void blk_rq_next_segment(struct request *rq) -{ - if (rq->current_nr_sectors > 0) - return; - - if (rq->nr_cbio_sectors > 0) { - --rq->nr_cbio_segments; - rq->current_nr_sectors = blk_rq_vec(rq)->bv_len >> 9; - } else { - if ((rq->cbio = rq->cbio->bi_next)) { - rq->nr_cbio_segments = bio_segments(rq->cbio); - rq->nr_cbio_sectors = bio_sectors(rq->cbio); - rq->current_nr_sectors = bio_cur_sectors(rq->cbio); - } - } - - /* remember the size of this segment before we start I/O */ - rq->hard_cur_sectors = rq->current_nr_sectors; -} - -/** - * process_that_request_first - process partial request submission - * @req: the request being processed - * @nr_sectors: number of sectors I/O has been submitted on - * - * Description: - * May be used for processing bio's while submitting I/O without - * signalling completion. Fails if more data is requested than is - * available in the request in which case it doesn't advance any - * pointers. - * - * Assumes a request is correctly set up. No sanity checks. - * - * Return: - * 0 - no more data left to submit (not processed) - * 1 - data available to submit for this request (processed) - **/ -int process_that_request_first(struct request *req, unsigned int nr_sectors) -{ - unsigned int nsect; - - if (req->nr_sectors < nr_sectors) - return 0; - - req->nr_sectors -= nr_sectors; - req->sector += nr_sectors; - while (nr_sectors) { - nsect = min_t(unsigned, req->current_nr_sectors, nr_sectors); - req->current_nr_sectors -= nsect; - nr_sectors -= nsect; - if (req->cbio) { - req->nr_cbio_sectors -= nsect; - blk_rq_next_segment(req); - } - } - return 1; -} - -EXPORT_SYMBOL(process_that_request_first); - void blk_recalc_rq_segments(struct request *rq) { struct bio *bio, *prevbio = NULL; int nr_phys_segs, nr_hw_segs; + unsigned int phys_size, hw_size; + request_queue_t *q = rq->q; if (!rq->bio) return; - nr_phys_segs = nr_hw_segs = 0; + phys_size = hw_size = nr_phys_segs = nr_hw_segs = 0; rq_for_each_bio(bio, rq) { /* Force bio hw/phys segs to be recalculated. */ bio->bi_flags &= ~(1 << BIO_SEG_VALID); - nr_phys_segs += bio_phys_segments(rq->q, bio); - nr_hw_segs += bio_hw_segments(rq->q, bio); + nr_phys_segs += bio_phys_segments(q, bio); + nr_hw_segs += bio_hw_segments(q, bio); if (prevbio) { - if (blk_phys_contig_segment(rq->q, prevbio, bio)) + int pseg = phys_size + prevbio->bi_size + bio->bi_size; + int hseg = hw_size + prevbio->bi_size + bio->bi_size; + + if (blk_phys_contig_segment(q, prevbio, bio) && + pseg <= q->max_segment_size) { nr_phys_segs--; - if (blk_hw_contig_segment(rq->q, prevbio, bio)) + phys_size += prevbio->bi_size + bio->bi_size; + } else + phys_size = 0; + + if (blk_hw_contig_segment(q, prevbio, bio) && + hseg <= q->max_segment_size) { nr_hw_segs--; + hw_size += prevbio->bi_size + bio->bi_size; + } else + hw_size = 0; } prevbio = bio; } @@ -2755,8 +2807,7 @@ void blk_recalc_rq_sectors(struct request *rq, int nsect) rq->hard_nr_sectors -= nsect; /* - * Move the I/O submission pointers ahead if required, - * i.e. for drivers not aware of rq->cbio. + * Move the I/O submission pointers ahead if required. */ if ((rq->nr_sectors >= rq->hard_nr_sectors) && (rq->sector <= rq->hard_sector)) { @@ -2764,11 +2815,7 @@ void blk_recalc_rq_sectors(struct request *rq, int nsect) rq->nr_sectors = rq->hard_nr_sectors; rq->hard_cur_sectors = bio_cur_sectors(rq->bio); rq->current_nr_sectors = rq->hard_cur_sectors; - rq->nr_cbio_segments = bio_segments(rq->bio); - rq->nr_cbio_sectors = bio_sectors(rq->bio); rq->buffer = bio_data(rq->bio); - - rq->cbio = rq->bio; } /* @@ -2940,12 +2987,12 @@ void end_that_request_last(struct request *req) unsigned long duration = jiffies - req->start_time; switch (rq_data_dir(req)) { case WRITE: - disk_stat_inc(disk, writes); - disk_stat_add(disk, write_ticks, duration); + __disk_stat_inc(disk, writes); + __disk_stat_add(disk, write_ticks, duration); break; case READ: - disk_stat_inc(disk, reads); - disk_stat_add(disk, read_ticks, duration); + __disk_stat_inc(disk, reads); + __disk_stat_add(disk, read_ticks, duration); break; } disk_round_stats(disk); @@ -2980,33 +3027,13 @@ void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio) rq->current_nr_sectors = bio_cur_sectors(bio); rq->hard_cur_sectors = rq->current_nr_sectors; rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio); - rq->nr_cbio_segments = bio_segments(bio); - rq->nr_cbio_sectors = bio_sectors(bio); rq->buffer = bio_data(bio); - rq->cbio = rq->bio = rq->biotail = bio; + rq->bio = rq->biotail = bio; } EXPORT_SYMBOL(blk_rq_bio_prep); -void blk_rq_prep_restart(struct request *rq) -{ - struct bio *bio; - - bio = rq->cbio = rq->bio; - if (bio) { - rq->nr_cbio_segments = bio_segments(bio); - rq->nr_cbio_sectors = bio_sectors(bio); - rq->hard_cur_sectors = bio_cur_sectors(bio); - rq->buffer = bio_data(bio); - } - rq->sector = rq->hard_sector; - rq->nr_sectors = rq->hard_nr_sectors; - rq->current_nr_sectors = rq->hard_cur_sectors; -} - -EXPORT_SYMBOL(blk_rq_prep_restart); - int kblockd_schedule_work(struct work_struct *work) { return queue_work(kblockd_workqueue, work); @@ -3018,6 +3045,7 @@ void kblockd_flush(void) { flush_workqueue(kblockd_workqueue); } +EXPORT_SYMBOL(kblockd_flush); int __init blk_dev_init(void) { @@ -3036,6 +3064,7 @@ int __init blk_dev_init(void) blk_max_low_pfn = max_low_pfn; blk_max_pfn = max_pfn; + return 0; } @@ -3052,9 +3081,13 @@ void put_io_context(struct io_context *ioc) if (atomic_dec_and_test(&ioc->refcount)) { if (ioc->aic && ioc->aic->dtor) ioc->aic->dtor(ioc->aic); + if (ioc->cic && ioc->cic->dtor) + ioc->cic->dtor(ioc->cic); + kmem_cache_free(iocontext_cachep, ioc); } } +EXPORT_SYMBOL(put_io_context); /* Called by the exitting task */ void exit_io_context(void) @@ -3064,14 +3097,15 @@ void exit_io_context(void) local_irq_save(flags); ioc = current->io_context; - if (ioc) { - if (ioc->aic && ioc->aic->exit) - ioc->aic->exit(ioc->aic); - put_io_context(ioc); - current->io_context = NULL; - } else - WARN_ON(1); + current->io_context = NULL; local_irq_restore(flags); + + if (ioc->aic && ioc->aic->exit) + ioc->aic->exit(ioc->aic); + if (ioc->cic && ioc->cic->exit) + ioc->cic->exit(ioc->cic); + + put_io_context(ioc); } /* @@ -3090,22 +3124,42 @@ struct io_context *get_io_context(int gfp_flags) local_irq_save(flags); ret = tsk->io_context; - if (ret == NULL) { - ret = kmem_cache_alloc(iocontext_cachep, GFP_ATOMIC); - if (ret) { - atomic_set(&ret->refcount, 1); - ret->pid = tsk->pid; - ret->last_waited = jiffies; /* doesn't matter... */ - ret->nr_batch_requests = 0; /* because this is 0 */ - ret->aic = NULL; + if (ret) + goto out; + + local_irq_restore(flags); + + ret = kmem_cache_alloc(iocontext_cachep, gfp_flags); + if (ret) { + atomic_set(&ret->refcount, 1); + ret->pid = tsk->pid; + ret->last_waited = jiffies; /* doesn't matter... */ + ret->nr_batch_requests = 0; /* because this is 0 */ + ret->aic = NULL; + ret->cic = NULL; + spin_lock_init(&ret->lock); + + local_irq_save(flags); + + /* + * very unlikely, someone raced with us in setting up the task + * io context. free new context and just grab a reference. + */ + if (!tsk->io_context) tsk->io_context = ret; + else { + kmem_cache_free(iocontext_cachep, ret); + ret = tsk->io_context; } - } - if (ret) + +out: atomic_inc(&ret->refcount); - local_irq_restore(flags); + local_irq_restore(flags); + } + return ret; } +EXPORT_SYMBOL(get_io_context); void copy_io_context(struct io_context **pdst, struct io_context **psrc) { @@ -3119,6 +3173,7 @@ void copy_io_context(struct io_context **pdst, struct io_context **psrc) *pdst = src; } } +EXPORT_SYMBOL(copy_io_context); void swap_io_context(struct io_context **ioc1, struct io_context **ioc2) { @@ -3127,7 +3182,7 @@ void swap_io_context(struct io_context **ioc1, struct io_context **ioc2) *ioc1 = *ioc2; *ioc2 = temp; } - +EXPORT_SYMBOL(swap_io_context); /* * sysfs parts below @@ -3285,11 +3340,18 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = { .show = queue_max_hw_sectors_show, }; +static struct queue_sysfs_entry queue_iosched_entry = { + .attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR }, + .show = elv_iosched_show, + .store = elv_iosched_store, +}; + static struct attribute *default_attrs[] = { &queue_requests_entry.attr, &queue_ra_entry.attr, &queue_max_hw_sectors_entry.attr, &queue_max_sectors_entry.attr, + &queue_iosched_entry.attr, NULL, }; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 946742912..3efc2ea7a 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -47,7 +47,7 @@ #include #include - +#include #include #include #include @@ -622,10 +622,17 @@ static int loop_change_fd(struct loop_device *lo, struct file *lo_file, return error; } +static inline int is_loop_device(struct file *file) +{ + struct inode *i = file->f_mapping->host; + + return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; +} + static int loop_set_fd(struct loop_device *lo, struct file *lo_file, struct block_device *bdev, unsigned int arg) { - struct file *file; + struct file *file, *f; struct inode *inode; struct address_space *mapping; unsigned lo_blocksize; @@ -636,15 +643,31 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, /* This is safe, since we have a reference from open(). */ __module_get(THIS_MODULE); - error = -EBUSY; - if (lo->lo_state != Lo_unbound) - goto out; - error = -EBADF; file = fget(arg); if (!file) goto out; + error = -EBUSY; + if (lo->lo_state != Lo_unbound) + goto out_putf; + + /* Avoid recursion */ + f = file; + while (is_loop_device(f)) { + struct loop_device *l; + + if (f->f_mapping->host->i_rdev == lo_file->f_mapping->host->i_rdev) + goto out_putf; + + l = f->f_mapping->host->i_bdev->bd_disk->private_data; + if (l->lo_state == Lo_unbound) { + error = -EINVAL; + goto out_putf; + } + f = l->lo_backing_file; + } + mapping = file->f_mapping; inode = mapping->host; @@ -1073,7 +1096,7 @@ static struct block_device_operations lo_fops = { /* * And now the modules code and kernel interface. */ -MODULE_PARM(max_loop, "i"); +module_param(max_loop, int, 0); MODULE_PARM_DESC(max_loop, "Maximum number of loop devices (1-256)"); MODULE_LICENSE("GPL"); MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR); diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 75ad39dc6..2f5cc3e25 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -92,7 +92,7 @@ static struct nbd_device nbd_dev[MAX_NBD]; * a single lock. * Thanks go to Jens Axboe and Al Viro for their LKML emails explaining this! */ -static spinlock_t nbd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(nbd_lock); #ifndef NDEBUG static const char *ioctl_cmd_to_ascii(int cmd) @@ -726,6 +726,6 @@ MODULE_DESCRIPTION("Network Block Device"); MODULE_LICENSE("GPL"); #ifndef NDEBUG -MODULE_PARM(debugflags, "i"); +module_param(debugflags, int, 0644); MODULE_PARM_DESC(debugflags, "flags for controlling debug output"); #endif diff --git a/drivers/block/noop-iosched.c b/drivers/block/noop-iosched.c index ffef40be1..888c477e0 100644 --- a/drivers/block/noop-iosched.c +++ b/drivers/block/noop-iosched.c @@ -1,24 +1,17 @@ /* * elevator noop */ -#include -#include #include #include #include -#include #include -#include #include -#include - -#include /* * See if we can find a request that this buffer can be coalesced with. */ -int elevator_noop_merge(request_queue_t *q, struct request **req, - struct bio *bio) +static int elevator_noop_merge(request_queue_t *q, struct request **req, + struct bio *bio) { struct list_head *entry = &q->queue_head; struct request *__rq; @@ -50,21 +43,19 @@ int elevator_noop_merge(request_queue_t *q, struct request **req, return ELEVATOR_NO_MERGE; } -void elevator_noop_merge_requests(request_queue_t *q, struct request *req, - struct request *next) +static void elevator_noop_merge_requests(request_queue_t *q, struct request *req, + struct request *next) { list_del_init(&next->queuelist); } -void elevator_noop_add_request(request_queue_t *q, struct request *rq, - int where) +static void elevator_noop_add_request(request_queue_t *q, struct request *rq, + int where) { - struct list_head *insert = q->queue_head.prev; - if (where == ELEVATOR_INSERT_FRONT) - insert = &q->queue_head; - - list_add_tail(&rq->queuelist, &q->queue_head); + list_add(&rq->queuelist, &q->queue_head); + else + list_add_tail(&rq->queuelist, &q->queue_head); /* * new merges must not precede this barrier @@ -75,7 +66,7 @@ void elevator_noop_add_request(request_queue_t *q, struct request *rq, q->last_merge = rq; } -struct request *elevator_noop_next_request(request_queue_t *q) +static struct request *elevator_noop_next_request(request_queue_t *q) { if (!list_empty(&q->queue_head)) return list_entry_rq(q->queue_head.next); @@ -83,12 +74,31 @@ struct request *elevator_noop_next_request(request_queue_t *q) return NULL; } -elevator_t elevator_noop = { - .elevator_merge_fn = elevator_noop_merge, - .elevator_merge_req_fn = elevator_noop_merge_requests, - .elevator_next_req_fn = elevator_noop_next_request, - .elevator_add_req_fn = elevator_noop_add_request, - .elevator_name = "noop", +static struct elevator_type elevator_noop = { + .ops = { + .elevator_merge_fn = elevator_noop_merge, + .elevator_merge_req_fn = elevator_noop_merge_requests, + .elevator_next_req_fn = elevator_noop_next_request, + .elevator_add_req_fn = elevator_noop_add_request, + }, + .elevator_name = "noop", + .elevator_owner = THIS_MODULE, }; -EXPORT_SYMBOL(elevator_noop); +static int __init noop_init(void) +{ + return elv_register(&elevator_noop); +} + +static void __exit noop_exit(void) +{ + elv_unregister(&elevator_noop); +} + +module_init(noop_init); +module_exit(noop_exit); + + +MODULE_AUTHOR("Jens Axboe"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("No-op IO scheduler"); diff --git a/drivers/block/paride/Kconfig b/drivers/block/paride/Kconfig index 4eebf9121..17ff40561 100644 --- a/drivers/block/paride/Kconfig +++ b/drivers/block/paride/Kconfig @@ -119,7 +119,7 @@ config PARIDE_BPCK before 1999 were Series 5) Series 5 drives will NOT always have the Series noted on the bottom of the drive. Series 6 drivers will. - In other words, if your BACKPACK drive dosen't say "Series 6" on the + In other words, if your BACKPACK drive doesn't say "Series 6" on the bottom, enable this option. If you chose to build PARIDE support into your kernel, you may diff --git a/drivers/block/paride/bpck6.c b/drivers/block/paride/bpck6.c index 354f67ac5..08d858ad6 100644 --- a/drivers/block/paride/bpck6.c +++ b/drivers/block/paride/bpck6.c @@ -277,6 +277,6 @@ static void __exit bpck6_exit(void) MODULE_LICENSE("GPL"); MODULE_AUTHOR("Micro Solutions Inc."); MODULE_DESCRIPTION("BACKPACK Protocol module, compatible with PARIDE"); -MODULE_PARM(verbose,"i"); +module_param(verbose, bool, 0644); module_init(bpck6_init) module_exit(bpck6_exit) diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index 9f9401c1a..1fef136c0 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -46,7 +46,7 @@ MODULE_LICENSE("GPL"); static struct pi_protocol *protocols[MAX_PROTOS]; -static spinlock_t pi_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pi_spinlock); void pi_write_regr(PIA * pi, int cont, int regr, int val) { @@ -140,7 +140,7 @@ static void pi_claim(PIA * pi) #endif } -void pi_unclaim(PIA * pi) +static void pi_unclaim(PIA * pi) { pi->claimed = 0; #ifdef CONFIG_PARPORT @@ -149,8 +149,6 @@ void pi_unclaim(PIA * pi) #endif } -EXPORT_SYMBOL(pi_unclaim); - void pi_connect(PIA * pi) { pi_claim(pi); diff --git a/drivers/block/paride/paride.h b/drivers/block/paride/paride.h index e8e2a934b..c6d98ef09 100644 --- a/drivers/block/paride/paride.h +++ b/drivers/block/paride/paride.h @@ -88,8 +88,6 @@ extern void pi_write_block(PIA *pi, char * buf, int count); extern void pi_read_block(PIA *pi, char * buf, int count); -extern void pi_unclaim(PIA *pi); - extern void pi_connect(PIA *pi); extern void pi_disconnect(PIA *pi); diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 876a23690..c4d537874 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c @@ -162,14 +162,14 @@ void pcd_setup(char *str, int *ints) #endif -MODULE_PARM(verbose, "i"); -MODULE_PARM(major, "i"); -MODULE_PARM(name, "s"); -MODULE_PARM(nice, "i"); -MODULE_PARM(drive0, "1-6i"); -MODULE_PARM(drive1, "1-6i"); -MODULE_PARM(drive2, "1-6i"); -MODULE_PARM(drive3, "1-6i"); +module_param(verbose, bool, 0644); +module_param(major, int, 0); +module_param(name, charp, 0); +module_param(nice, int, 0); +module_param_array(drive0, int, NULL, 0); +module_param_array(drive1, int, NULL, 0); +module_param_array(drive2, int, NULL, 0); +module_param_array(drive3, int, NULL, 0); #include "paride.h" #include "pseudo.h" diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 5f6534daa..4390587b3 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c @@ -155,7 +155,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV}; #include #include -static spinlock_t pd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pd_lock); #ifndef MODULE @@ -178,15 +178,15 @@ void pd_setup(char *str, int *ints) #endif -MODULE_PARM(verbose, "i"); -MODULE_PARM(major, "i"); -MODULE_PARM(name, "s"); -MODULE_PARM(cluster, "i"); -MODULE_PARM(nice, "i"); -MODULE_PARM(drive0, "1-8i"); -MODULE_PARM(drive1, "1-8i"); -MODULE_PARM(drive2, "1-8i"); -MODULE_PARM(drive3, "1-8i"); +module_param(verbose, bool, 0); +module_param(major, int, 0); +module_param(name, charp, 0); +module_param(cluster, int, 0); +module_param(nice, int, 0); +module_param_array(drive0, int, NULL, 0); +module_param_array(drive1, int, NULL, 0); +module_param_array(drive2, int, NULL, 0); +module_param_array(drive3, int, NULL, 0); #include "paride.h" diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index c4fab51d9..a1355ceaa 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -177,15 +177,15 @@ void pf_setup(char *str, int *ints) #endif -MODULE_PARM(verbose, "i"); -MODULE_PARM(major, "i"); -MODULE_PARM(name, "s"); -MODULE_PARM(cluster, "i"); -MODULE_PARM(nice, "i"); -MODULE_PARM(drive0, "1-7i"); -MODULE_PARM(drive1, "1-7i"); -MODULE_PARM(drive2, "1-7i"); -MODULE_PARM(drive3, "1-7i"); +module_param(verbose, bool, 0644); +module_param(major, int, 0); +module_param(name, charp, 0); +module_param(cluster, int, 0); +module_param(nice, int, 0); +module_param_array(drive0, int, NULL, 0); +module_param_array(drive1, int, NULL, 0); +module_param_array(drive2, int, NULL, 0); +module_param_array(drive3, int, NULL, 0); #include "paride.h" #include "pseudo.h" diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index d73e3ec9f..dd8c4d954 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c @@ -184,13 +184,13 @@ void pg_setup(char *str, int *ints) #endif -MODULE_PARM(verbose, "i"); -MODULE_PARM(major, "i"); -MODULE_PARM(name, "s"); -MODULE_PARM(drive0, "1-6i"); -MODULE_PARM(drive1, "1-6i"); -MODULE_PARM(drive2, "1-6i"); -MODULE_PARM(drive3, "1-6i"); +module_param(verbose, bool, 0644); +module_param(major, int, 0); +module_param(name, charp, 0); +module_param_array(drive0, int, NULL, 0); +module_param_array(drive1, int, NULL, 0); +module_param_array(drive2, int, NULL, 0); +module_param_array(drive3, int, NULL, 0); #include "paride.h" @@ -262,7 +262,7 @@ static void pg_init_units(void) int *parm = *drives[unit]; struct pg *dev = &devices[unit]; dev->pi = &dev->pia; - set_bit(0, &dev->access); + clear_bit(0, &dev->access); dev->busy = 0; dev->present = 0; dev->bufptr = NULL; diff --git a/drivers/block/paride/pseudo.h b/drivers/block/paride/pseudo.h index d9818ec32..932342d7a 100644 --- a/drivers/block/paride/pseudo.h +++ b/drivers/block/paride/pseudo.h @@ -43,7 +43,7 @@ static unsigned long ps_timeout; static int ps_tq_active = 0; static int ps_nice = 0; -static spinlock_t ps_spinlock __attribute__((unused)) = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ps_spinlock __attribute__((unused))); static DECLARE_WORK(ps_tq, ps_tq_int, NULL); diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 44b12134d..e37f8b18c 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -169,13 +169,13 @@ pt_setup(char *str, int *ints) #endif -MODULE_PARM(verbose, "i"); -MODULE_PARM(major, "i"); -MODULE_PARM(name, "s"); -MODULE_PARM(drive0, "1-6i"); -MODULE_PARM(drive1, "1-6i"); -MODULE_PARM(drive2, "1-6i"); -MODULE_PARM(drive3, "1-6i"); +module_param(verbose, bool, 0); +module_param(major, int, 0); +module_param(name, charp, 0); +module_param_array(drive0, int, NULL, 0); +module_param_array(drive1, int, NULL, 0); +module_param_array(drive2, int, NULL, 0); +module_param_array(drive3, int, NULL, 0); #include "paride.h" diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 03a938804..7590000b9 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -135,12 +135,10 @@ static struct packet_data *pkt_alloc_packet_data(void) goto no_bio; for (i = 0; i < PAGES_PER_PACKET; i++) { - pkt->pages[i] = alloc_page(GFP_KERNEL); + pkt->pages[i] = alloc_page(GFP_KERNEL|__GFP_ZERO); if (!pkt->pages[i]) goto no_page; } - for (i = 0; i < PAGES_PER_PACKET; i++) - clear_page(page_address(pkt->pages[i])); spin_lock_init(&pkt->lock); @@ -607,8 +605,7 @@ static int pkt_set_segment_merging(struct pktcdvd_device *pd, request_queue_t *q /* * Copy CD_FRAMESIZE bytes from src_bio into a destination page */ -static void pkt_copy_bio_data(struct bio *src_bio, int seg, int offs, - struct page *dst_page, int dst_offs) +static void pkt_copy_bio_data(struct bio *src_bio, int seg, int offs, struct page *dst_page, int dst_offs) { unsigned int copy_size = CD_FRAMESIZE; @@ -1301,8 +1298,7 @@ static void pkt_print_settings(struct pktcdvd_device *pd) printk("Mode-%c disc\n", pd->settings.block_mode == 8 ? '1' : '2'); } -static int pkt_mode_sense(struct pktcdvd_device *pd, struct packet_command *cgc, - int page_code, int page_control) +static int pkt_mode_sense(struct pktcdvd_device *pd, struct packet_command *cgc, int page_code, int page_control) { memset(cgc->cmd, 0, sizeof(cgc->cmd)); @@ -2627,7 +2623,7 @@ static struct miscdevice pkt_misc = { .fops = &pkt_ctl_fops }; -int pkt_init(void) +static int pkt_init(void) { int ret; @@ -2663,7 +2659,7 @@ out2: return ret; } -void pkt_exit(void) +static void pkt_exit(void) { remove_proc_entry("pktcdvd", proc_root_driver); misc_deregister(&pkt_misc); diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c index 82a5f19fd..29548784c 100644 --- a/drivers/block/ps2esdi.c +++ b/drivers/block/ps2esdi.c @@ -108,7 +108,7 @@ static int intg_esdi = 0; /* If integrated adapter */ struct ps2esdi_i_struct { unsigned int head, sect, cyl, wpcom, lzone, ctl; }; -static spinlock_t ps2esdi_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ps2esdi_lock); static struct request_queue *ps2esdi_queue; static struct request *current_req; @@ -177,10 +177,10 @@ static int cyl[MAX_HD] = {-1,-1}; static int head[MAX_HD] = {-1, -1}; static int sect[MAX_HD] = {-1, -1}; -MODULE_PARM(tp720esdi, "i"); -MODULE_PARM(cyl, "i"); -MODULE_PARM(head, "i"); -MODULE_PARM(sect, "i"); +module_param(tp720esdi, bool, 0); +module_param_array(cyl, int, NULL, 0); +module_param_array(head, int, NULL, 0); +module_param_array(sect, int, NULL, 0); MODULE_LICENSE("GPL"); int init_module(void) { diff --git a/drivers/block/rd.c b/drivers/block/rd.c index b3c7f07c1..80848c2a7 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -60,15 +61,12 @@ #include -/* The RAM disk size is now a parameter */ -#define NUM_RAMDISKS 16 /* This cannot be overridden (yet) */ - /* Various static variables go here. Most are used only in the RAM disk code. */ -static struct gendisk *rd_disks[NUM_RAMDISKS]; -static struct block_device *rd_bdev[NUM_RAMDISKS];/* Protected device data */ -static struct request_queue *rd_queue[NUM_RAMDISKS]; +static struct gendisk *rd_disks[CONFIG_BLK_DEV_RAM_COUNT]; +static struct block_device *rd_bdev[CONFIG_BLK_DEV_RAM_COUNT];/* Protected device data */ +static struct request_queue *rd_queue[CONFIG_BLK_DEV_RAM_COUNT]; /* * Parameters for the boot-loading of the RAM disk. These are set by @@ -402,7 +400,7 @@ static void __exit rd_cleanup(void) { int i; - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { struct block_device *bdev = rd_bdev[i]; rd_bdev[i] = NULL; if (bdev) { @@ -432,7 +430,7 @@ static int __init rd_init(void) rd_blocksize = BLOCK_SIZE; } - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { rd_disks[i] = alloc_disk(1); if (!rd_disks[i]) goto out; @@ -445,7 +443,7 @@ static int __init rd_init(void) devfs_mk_dir("rd"); - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { struct gendisk *disk = rd_disks[i]; rd_queue[i] = blk_alloc_queue(GFP_KERNEL); @@ -470,7 +468,7 @@ static int __init rd_init(void) /* rd_size is given in kB */ printk("RAMDISK driver initialized: " "%d RAM disks of %dK size %d blocksize\n", - NUM_RAMDISKS, rd_size, rd_blocksize); + CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize); return 0; out_queue: @@ -508,9 +506,10 @@ __setup("ramdisk_blocksize=", ramdisk_blocksize); #endif /* options - modular */ -MODULE_PARM (rd_size, "1i"); +module_param(rd_size, int, 0); MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); -MODULE_PARM (rd_blocksize, "i"); +module_param(rd_blocksize, int, 0); MODULE_PARM_DESC(rd_blocksize, "Blocksize of each RAM disk in bytes."); +MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); MODULE_LICENSE("GPL"); diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index f8fb5322f..689527a89 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c @@ -107,12 +107,13 @@ static int sg_emulated_host(request_queue_t *q, int __user *p) #define CMD_READ_SAFE 0x01 #define CMD_WRITE_SAFE 0x02 +#define CMD_WARNED 0x04 #define safe_for_read(cmd) [cmd] = CMD_READ_SAFE #define safe_for_write(cmd) [cmd] = CMD_WRITE_SAFE static int verify_command(struct file *file, unsigned char *cmd) { - static const unsigned char cmd_type[256] = { + static unsigned char cmd_type[256] = { /* Basic read-only commands */ safe_for_read(TEST_UNIT_READY), @@ -126,10 +127,10 @@ static int verify_command(struct file *file, unsigned char *cmd) safe_for_read(INQUIRY), safe_for_read(MODE_SENSE), safe_for_read(MODE_SENSE_10), + safe_for_read(LOG_SENSE), safe_for_read(START_STOP), safe_for_read(GPCMD_VERIFY_10), safe_for_read(VERIFY_16), - safe_for_read(READ_BUFFER), /* Audio CD commands */ safe_for_read(GPCMD_PLAY_CD), @@ -139,6 +140,7 @@ static int verify_command(struct file *file, unsigned char *cmd) safe_for_read(GPCMD_PAUSE_RESUME), /* CD/DVD data reading */ + safe_for_read(GPCMD_READ_BUFFER_CAPACITY), safe_for_read(GPCMD_READ_CD), safe_for_read(GPCMD_READ_CD_MSF), safe_for_read(GPCMD_READ_DISC_INFO), @@ -168,6 +170,7 @@ static int verify_command(struct file *file, unsigned char *cmd) safe_for_write(ERASE), safe_for_write(GPCMD_MODE_SELECT_10), safe_for_write(MODE_SELECT), + safe_for_write(LOG_SELECT), safe_for_write(GPCMD_BLANK), safe_for_write(GPCMD_CLOSE_TRACK), safe_for_write(GPCMD_FLUSH_CACHE), @@ -196,6 +199,11 @@ static int verify_command(struct file *file, unsigned char *cmd) return 0; } + if (!type) { + cmd_type[cmd[0]] = CMD_WARNED; + printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]); + } + /* And root can do any command.. */ if (capable(CAP_SYS_RAWIO)) return 0; @@ -293,11 +301,11 @@ static int sg_io(struct file *file, request_queue_t *q, blk_execute_rq(q, bd_disk, rq); /* write to all output members */ - hdr->status = rq->errors; - hdr->masked_status = (hdr->status >> 1) & 0x1f; - hdr->msg_status = 0; - hdr->host_status = 0; - hdr->driver_status = 0; + hdr->status = 0xff & rq->errors; + hdr->masked_status = status_byte(rq->errors); + hdr->msg_status = msg_byte(rq->errors); + hdr->host_status = host_byte(rq->errors); + hdr->driver_status = driver_byte(rq->errors); hdr->info = 0; if (hdr->masked_status || hdr->host_status || hdr->driver_status) hdr->info |= SG_INFO_CHECK; @@ -331,7 +339,8 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic) { struct request *rq; - int err, in_len, out_len, bytes, opcode, cmdlen; + int err; + unsigned int in_len, out_len, bytes, opcode, cmdlen; char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; /* @@ -348,7 +357,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, bytes = max(in_len, out_len); if (bytes) { - buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER); + buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN); if (!buffer) return -ENOMEM; diff --git a/drivers/block/smart1,2.h b/drivers/block/smart1,2.h index 6f9513346..a0b403a6b 100644 --- a/drivers/block/smart1,2.h +++ b/drivers/block/smart1,2.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Questions/Comments/Bugfixes to arrays@compaq.com + * Questions/Comments/Bugfixes to iss_storagedev@hp.com * * If you want to make changes, improve or add functionality to this * driver, you'll probably need the Compaq Array Controller Interface diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index ca17d8373..5b09cf154 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -176,8 +176,8 @@ struct swim3 { struct floppy_state { enum swim_state state; - volatile struct swim3 *swim3; /* hardware registers */ - struct dbdma_regs *dma; /* DMA controller registers */ + struct swim3 __iomem *swim3; /* hardware registers */ + struct dbdma_regs __iomem *dma; /* DMA controller registers */ int swim3_intr; /* interrupt number for SWIM3 */ int dma_intr; /* interrupt number for DMA channel */ int cur_cyl; /* cylinder head is on, or -1 */ @@ -206,7 +206,7 @@ struct floppy_state { static struct floppy_state floppy_states[MAX_FLOPPIES]; static int floppy_count = 0; -static spinlock_t swim3_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(swim3_lock); static unsigned short write_preamble[] = { 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, /* gap field */ @@ -259,7 +259,7 @@ int swim3_init(void); static void swim3_select(struct floppy_state *fs, int sel) { - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; out_8(&sw->select, RELAX); if (sel & 8) @@ -271,7 +271,7 @@ static void swim3_select(struct floppy_state *fs, int sel) static void swim3_action(struct floppy_state *fs, int action) { - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; swim3_select(fs, action); udelay(1); @@ -283,7 +283,7 @@ static void swim3_action(struct floppy_state *fs, int action) static int swim3_readbit(struct floppy_state *fs, int bit) { - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; int stat; swim3_select(fs, bit); @@ -381,7 +381,7 @@ static void set_timeout(struct floppy_state *fs, int nticks, static inline void scan_track(struct floppy_state *fs) { - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; swim3_select(fs, READ_DATA_0); in_8(&sw->intr); /* clear SEEN_SECTOR bit */ @@ -394,7 +394,7 @@ static inline void scan_track(struct floppy_state *fs) static inline void seek_track(struct floppy_state *fs, int n) { - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; if (n >= 0) { swim3_action(fs, SEEK_POSITIVE); @@ -425,9 +425,9 @@ static inline void init_dma(struct dbdma_cmd *cp, int cmd, static inline void setup_transfer(struct floppy_state *fs) { int n; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; struct dbdma_cmd *cp = fs->dma_cmd; - struct dbdma_regs *dr = fs->dma; + struct dbdma_regs __iomem *dr = fs->dma; if (fd_req->current_nr_sectors <= 0) { printk(KERN_ERR "swim3: transfer 0 sectors?\n"); @@ -445,7 +445,7 @@ static inline void setup_transfer(struct floppy_state *fs) out_8(&sw->sector, fs->req_sector); out_8(&sw->nsect, n); out_8(&sw->gap3, 0); - st_le32(&dr->cmdptr, virt_to_bus(cp)); + out_le32(&dr->cmdptr, virt_to_bus(cp)); if (rq_data_dir(fd_req) == WRITE) { /* Set up 3 dma commands: write preamble, data, postamble */ init_dma(cp, OUTPUT_MORE, write_preamble, sizeof(write_preamble)); @@ -537,7 +537,7 @@ static void act(struct floppy_state *fs) static void scan_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; fs->timeout_pending = 0; out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS); @@ -557,7 +557,7 @@ static void scan_timeout(unsigned long data) static void seek_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; fs->timeout_pending = 0; out_8(&sw->control_bic, DO_SEEK); @@ -572,7 +572,7 @@ static void seek_timeout(unsigned long data) static void settle_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; fs->timeout_pending = 0; if (swim3_readbit(fs, SEEK_COMPLETE)) { @@ -596,14 +596,14 @@ static void settle_timeout(unsigned long data) static void xfer_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; - volatile struct swim3 *sw = fs->swim3; - struct dbdma_regs *dr = fs->dma; + struct swim3 __iomem *sw = fs->swim3; + struct dbdma_regs __iomem *dr = fs->dma; struct dbdma_cmd *cp = fs->dma_cmd; unsigned long s; int n; fs->timeout_pending = 0; - st_le32(&dr->control, RUN << 16); + out_le32(&dr->control, RUN << 16); /* We must wait a bit for dbdma to stop */ for (n = 0; (in_le32(&dr->status) & ACTIVE) && n < 1000; n++) udelay(1); @@ -628,10 +628,10 @@ static void xfer_timeout(unsigned long data) static irqreturn_t swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct floppy_state *fs = (struct floppy_state *) dev_id; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; int intr, err, n; int stat, resid; - struct dbdma_regs *dr; + struct dbdma_regs __iomem *dr; struct dbdma_cmd *cp; intr = in_8(&sw->intr); @@ -866,7 +866,7 @@ static int floppy_ioctl(struct inode *inode, struct file *filp, err = fd_eject(fs); return err; case FDGETPRM: - if (copy_to_user((void *) param, (void *)&floppy_type, + if (copy_to_user((void __user *) param, &floppy_type, sizeof(struct floppy_struct))) return -EFAULT; return 0; @@ -877,7 +877,7 @@ static int floppy_ioctl(struct inode *inode, struct file *filp, static int floppy_open(struct inode *inode, struct file *filp) { struct floppy_state *fs = inode->i_bdev->bd_disk->private_data; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; int n, err = 0; if (fs->ref_count == 0) { @@ -946,7 +946,7 @@ static int floppy_open(struct inode *inode, struct file *filp) static int floppy_release(struct inode *inode, struct file *filp) { struct floppy_state *fs = inode->i_bdev->bd_disk->private_data; - volatile struct swim3 *sw = fs->swim3; + struct swim3 __iomem *sw = fs->swim3; if (fs->ref_count > 0 && --fs->ref_count == 0) { swim3_action(fs, MOTOR_OFF); out_8(&sw->control_bic, 0xff); @@ -964,7 +964,7 @@ static int floppy_check_change(struct gendisk *disk) static int floppy_revalidate(struct gendisk *disk) { struct floppy_state *fs = disk->private_data; - volatile struct swim3 *sw; + struct swim3 __iomem *sw; int ret, n; if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD)) @@ -1105,8 +1105,10 @@ static int swim3_add_device(struct device_node *swim) memset(fs, 0, sizeof(*fs)); fs->state = idle; - fs->swim3 = (volatile struct swim3 *) ioremap(swim->addrs[0].address, 0x200); - fs->dma = (struct dbdma_regs *) ioremap(swim->addrs[1].address, 0x200); + fs->swim3 = (struct swim3 __iomem *) + ioremap(swim->addrs[0].address, 0x200); + fs->dma = (struct dbdma_regs __iomem *) + ioremap(swim->addrs[1].address, 0x200); fs->swim3_intr = swim->intrs[0].line; fs->dma_intr = swim->intrs[1].line; fs->cur_cyl = -1; diff --git a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c index 283c5b6bc..a1283f6dc 100644 --- a/drivers/block/swim_iop.c +++ b/drivers/block/swim_iop.c @@ -76,7 +76,7 @@ static struct swim_iop_req *current_req; static int floppy_count; static struct floppy_state floppy_states[MAX_FLOPPIES]; -static spinlock_t swim_iop_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(swim_iop_lock); #define CURRENT elv_next_request(swim_queue) diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c index 02a541ae7..797f5988c 100644 --- a/drivers/block/sx8.c +++ b/drivers/block/sx8.c @@ -1503,7 +1503,8 @@ static int carm_init_disks(struct carm_host *host) } port->disk = disk; - sprintf(disk->disk_name, DRV_NAME "%u_%u", host->id, i); + sprintf(disk->disk_name, DRV_NAME "/%u", + (unsigned int) (host->id * CARM_MAX_PORTS) + i); sprintf(disk->devfs_name, DRV_NAME "/%u_%u", host->id, i); disk->major = host->major; disk->first_minor = i * CARM_MINORS_PER_MAJOR; diff --git a/drivers/block/ub.c b/drivers/block/ub.c index f605535d3..acea9f08e 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -8,13 +8,11 @@ * and is not licensed separately. See file COPYING for details. * * TODO (sorted by decreasing priority) - * -- ZIP does "ub: resid 18 len 0 act 0" and whole transport quits (toggles?) + * -- Do resets with usb_device_reset (needs a thread context, use khubd) * -- set readonly flag for CDs, set removable flag for CF readers * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) * -- support pphaneuf's SDDR-75 with two LUNs (also broken capacity...) * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries - * -- do something about spin-down devices, they are extremely dangerous - * (ZIP is one. Needs spin-up command as well.) * -- verify the 13 conditions and do bulk resets * -- normal pool of commands instead of cmdv[]? * -- kill last_pipe and simply do two-state clearing on both pipes @@ -25,6 +23,7 @@ * -- prune comments, they are too volumnous * -- Exterminate P3 printks * -- Resove XXX's + * -- Redo "benh's retries", perhaps have spin-up code to handle them. V:D=? */ #include #include @@ -37,7 +36,7 @@ #define DRV_NAME "ub" #define DEVFS_NAME DRV_NAME -#define UB_MAJOR 125 /* Stolen from Experimental range for a week - XXX */ +#define UB_MAJOR 180 /* * Definitions which have to be scattered once we understand the layout better. @@ -62,9 +61,9 @@ /* command block wrapper */ struct bulk_cb_wrap { - u32 Signature; /* contains 'USBC' */ + __le32 Signature; /* contains 'USBC' */ u32 Tag; /* unique per command id */ - u32 DataTransferLength; /* size of data */ + __le32 DataTransferLength; /* size of data */ u8 Flags; /* direction in bit 0 */ u8 Lun; /* LUN normally 0 */ u8 Length; /* of of the CDB */ @@ -78,9 +77,9 @@ struct bulk_cb_wrap { /* command status wrapper */ struct bulk_cs_wrap { - u32 Signature; /* should = 'USBS' */ + __le32 Signature; /* should = 'USBS' */ u32 Tag; /* same as original command */ - u32 Residue; /* amount not transferred */ + __le32 Residue; /* amount not transferred */ u8 Status; /* see below */ }; @@ -104,14 +103,13 @@ struct ub_dev; #define UB_MAX_SECTORS 64 /* - * A second ought to be enough for a 32K transfer (UB_MAX_SECTORS) - * even if a webcam hogs the bus (famous last words). - * Some CDs need a second to spin up though. - * ZIP drive rejects commands when it's not spinning, - * so it does not need long timeouts either. + * A second is more than enough for a 32K transfer (UB_MAX_SECTORS) + * even if a webcam hogs the bus, but some devices need time to spin up. */ #define UB_URB_TIMEOUT (HZ*2) -#define UB_CTRL_TIMEOUT (HZ/2) /* 500ms ought to be enough to clear a stall */ +#define UB_DATA_TIMEOUT (HZ*5) /* ZIP does spin-ups in the data phase */ +#define UB_STAT_TIMEOUT (HZ*5) /* Same spinups and eject for a dataless cmd. */ +#define UB_CTRL_TIMEOUT (HZ/2) /* 500ms ought to be enough to clear a stall */ /* * An instance of a SCSI command in transit. @@ -157,7 +155,8 @@ struct ub_scsi_cmd { struct ub_scsi_cmd *next; int error; /* Return code - valid upon done */ - int act_len; /* Return size */ + unsigned int act_len; /* Return size */ + unsigned char key, asc, ascq; /* May be valid if error==-EIO */ int stat_count; /* Retries getting status. */ @@ -186,7 +185,7 @@ struct ub_capacity { */ #define SCMD_ST_HIST_SZ 8 -#define SCMD_TRACE_SZ 15 /* No more than 256 (trace_index) */ +#define SCMD_TRACE_SZ 63 /* Less than 4KB of 61-byte lines */ struct ub_scsi_cmd_trace { int hcur; @@ -265,6 +264,7 @@ struct ub_dev { int changed; /* Media was changed */ int removable; int readonly; + int first_open; /* Kludge. See ub_bd_open. */ char name[8]; struct usb_device *dev; struct usb_interface *intf; @@ -300,6 +300,11 @@ struct ub_dev { /* */ +static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq); +static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, + struct request *rq); +static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd, + struct request *rq); static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_end_rq(struct request *rq, int uptodate); static int ub_submit_scsi(struct ub_dev *sc, struct ub_scsi_cmd *cmd); @@ -308,6 +313,7 @@ static void ub_scsi_action(unsigned long _dev); static void ub_scsi_dispatch(struct ub_dev *sc); static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_state_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd, int rc); +static void __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, @@ -335,7 +341,7 @@ MODULE_DEVICE_TABLE(usb, ub_usb_ids); */ #define UB_MAX_HOSTS 26 static char ub_hostv[UB_MAX_HOSTS]; -static spinlock_t ub_lock = SPIN_LOCK_UNLOCKED; /* Locks globals and ->openc */ +static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */ /* * The SCSI command tracing procedures. @@ -490,6 +496,18 @@ static void ub_id_put(int id) */ static void ub_cleanup(struct ub_dev *sc) { + + /* + * If we zero disk->private_data BEFORE put_disk, we have to check + * for NULL all over the place in open, release, check_media and + * revalidate, because the block level semaphore is well inside the + * put_disk. But we cannot zero after the call, because *disk is gone. + * The sd.c is blatantly racy in this area. + */ + /* disk->private_data = NULL; */ + put_disk(sc->disk); + sc->disk = NULL; + ub_id_put(sc->id); kfree(sc); } @@ -578,40 +596,73 @@ static struct ub_scsi_cmd *ub_cmdq_pop(struct ub_dev *sc) * The request function is our main entry point */ -static inline int ub_bd_rq_fn_1(request_queue_t *q) +static void ub_bd_rq_fn(request_queue_t *q) { -#if 0 - int writing = 0, pci_dir, i, n_elem; - u32 tmp; - unsigned int msg_size; -#endif struct ub_dev *sc = q->queuedata; struct request *rq; -#if 0 /* We use rq->buffer for now */ - struct scatterlist *sg; - int n_elem; -#endif + + while ((rq = elv_next_request(q)) != NULL) { + if (ub_bd_rq_fn_1(sc, rq) != 0) { + blk_stop_queue(q); + break; + } + } +} + +static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq) +{ struct ub_scsi_cmd *cmd; - int ub_dir; - unsigned int block, nblks; int rc; - if ((rq = elv_next_request(q)) == NULL) - return 1; - if (atomic_read(&sc->poison) || sc->changed) { blkdev_dequeue_request(rq); ub_end_rq(rq, 0); return 0; } - if ((cmd = ub_get_cmd(sc)) == NULL) { - blk_stop_queue(q); - return 1; - } + if ((cmd = ub_get_cmd(sc)) == NULL) + return -1; + memset(cmd, 0, sizeof(struct ub_scsi_cmd)); blkdev_dequeue_request(rq); + if (blk_pc_request(rq)) { + rc = ub_cmd_build_packet(sc, cmd, rq); + } else { + rc = ub_cmd_build_block(sc, cmd, rq); + } + if (rc != 0) { + ub_put_cmd(sc, cmd); + ub_end_rq(rq, 0); + blk_start_queue(sc->disk->queue); + return 0; + } + + cmd->state = UB_CMDST_INIT; + cmd->done = ub_rw_cmd_done; + cmd->back = rq; + + cmd->tag = sc->tagcnt++; + if ((rc = ub_submit_scsi(sc, cmd)) != 0) { + ub_put_cmd(sc, cmd); + ub_end_rq(rq, 0); + blk_start_queue(sc->disk->queue); + return 0; + } + + return 0; +} + +static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, + struct request *rq) +{ + int ub_dir; +#if 0 /* We use rq->buffer for now */ + struct scatterlist *sg; + int n_elem; +#endif + unsigned int block, nblks; + if (rq_data_dir(rq) == WRITE) ub_dir = UB_DIR_WRITE; else @@ -639,6 +690,7 @@ static inline int ub_bd_rq_fn_1(request_queue_t *q) return 0; } #endif + /* * XXX Unfortunately, this check does not work. It is quite possible * to get bogus non-null rq->buffer if you allow sg by mistake. @@ -650,22 +702,23 @@ static inline int ub_bd_rq_fn_1(request_queue_t *q) */ static int do_print = 1; if (do_print) { - printk(KERN_WARNING "%s: unmapped request\n", sc->name); + printk(KERN_WARNING "%s: unmapped block request" + " flags 0x%lx sectors %lu\n", + sc->name, rq->flags, rq->nr_sectors); do_print = 0; } - ub_put_cmd(sc, cmd); - ub_end_rq(rq, 0); - blk_start_queue(q); - return 0; + return -1; } /* * build the command + * + * The call to blk_queue_hardsect_size() guarantees that request + * is aligned, but it is given in terms of 512 byte units, always. */ - block = rq->sector; - nblks = rq->nr_sectors; + block = rq->sector >> sc->capacity.bshift; + nblks = rq->nr_sectors >> sc->capacity.bshift; - memset(cmd, 0, sizeof(struct ub_scsi_cmd)); cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10; /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ cmd->cdb[2] = block >> 24; @@ -675,27 +728,44 @@ static inline int ub_bd_rq_fn_1(request_queue_t *q) cmd->cdb[7] = nblks >> 8; cmd->cdb[8] = nblks; cmd->cdb_len = 10; + cmd->dir = ub_dir; - cmd->state = UB_CMDST_INIT; cmd->data = rq->buffer; - cmd->len = nblks * 512; - cmd->done = ub_rw_cmd_done; - cmd->back = rq; - - cmd->tag = sc->tagcnt++; - if ((rc = ub_submit_scsi(sc, cmd)) != 0) { - ub_put_cmd(sc, cmd); - ub_end_rq(rq, 0); - blk_start_queue(q); - return 0; - } + cmd->len = rq->nr_sectors * 512; return 0; } -static void ub_bd_rq_fn(request_queue_t *q) +static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd, + struct request *rq) { - do { } while (ub_bd_rq_fn_1(q) == 0); + + if (rq->data_len != 0 && rq->data == NULL) { + static int do_print = 1; + if (do_print) { + printk(KERN_WARNING "%s: unmapped packet request" + " flags 0x%lx length %d\n", + sc->name, rq->flags, rq->data_len); + do_print = 0; + } + return -1; + } + + memcpy(&cmd->cdb, rq->cmd, rq->cmd_len); + cmd->cdb_len = rq->cmd_len; + + if (rq->data_len == 0) { + cmd->dir = UB_DIR_NONE; + } else { + if (rq_data_dir(rq) == WRITE) + cmd->dir = UB_DIR_WRITE; + else + cmd->dir = UB_DIR_READ; + } + cmd->data = rq->data; + cmd->len = rq->data_len; + + return 0; } static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) @@ -705,6 +775,12 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) request_queue_t *q = disk->queue; int uptodate; + if (blk_pc_request(rq)) { + /* UB_SENSE_SIZE is smaller than SCSI_SENSE_BUFFERSIZE */ + memcpy(rq->sense, sc->top_sense, UB_SENSE_SIZE); + rq->sense_len = UB_SENSE_SIZE; + } + if (cmd->error == 0) uptodate = 1; else @@ -763,6 +839,17 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd) bcb = &sc->work_bcb; + /* + * ``If the allocation length is eighteen or greater, and a device + * server returns less than eithteen bytes of data, the application + * client should assume that the bytes not transferred would have been + * zeroes had the device server returned those bytes.'' + * + * We zero sense for all commands so that when a packet request + * fails it does not return a stale sense. + */ + memset(&sc->top_sense, 0, UB_SENSE_SIZE); + /* set up the command wrapper */ bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); bcb->Tag = cmd->tag; /* Endianness is not important */ @@ -786,17 +873,16 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd) sc->work_urb.error_count = 0; sc->work_urb.status = 0; - sc->work_timer.expires = jiffies + UB_URB_TIMEOUT; - add_timer(&sc->work_timer); - if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { /* XXX Clear stalls */ printk("ub: cmd #%d start failed (%d)\n", cmd->tag, rc); /* P3 */ - del_timer(&sc->work_timer); ub_complete(&sc->work_done); return rc; } + sc->work_timer.expires = jiffies + UB_URB_TIMEOUT; + add_timer(&sc->work_timer); + cmd->state = UB_CMDST_CMD; ub_cmdtr_state(sc, cmd); return 0; @@ -836,6 +922,7 @@ static void ub_scsi_action(unsigned long _dev) unsigned long flags; spin_lock_irqsave(&sc->lock, flags); + del_timer(&sc->work_timer); ub_scsi_dispatch(sc); spin_unlock_irqrestore(&sc->lock, flags); } @@ -871,9 +958,6 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) int pipe; int rc; -/* P3 */ /** printk("ub: urb status %d pipe 0x%08x len %d act %d\n", - urb->status, urb->pipe, urb->transfer_buffer_length, urb->actual_length); **/ - if (atomic_read(&sc->poison)) { /* A little too simplistic, I feel... */ goto Bad_End; @@ -883,7 +967,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) if (urb->status == -EPIPE) { /* * STALL while clearning STALL. - * A STALL is illegal on a control pipe! + * The control pipe clears itself - nothing to do. * XXX Might try to reset the device here and retry. */ printk(KERN_NOTICE "%s: " @@ -906,7 +990,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) if (urb->status == -EPIPE) { /* * STALL while clearning STALL. - * A STALL is illegal on a control pipe! + * The control pipe clears itself - nothing to do. * XXX Might try to reset the device here and retry. */ printk(KERN_NOTICE "%s: " @@ -930,7 +1014,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); if (rc != 0) { printk(KERN_NOTICE "%s: " - "unable to submit clear for device %u (%d)\n", + "unable to submit clear for device %u" + " (code %d)\n", sc->name, sc->dev->devnum, rc); /* * This is typically ENOMEM or some other such shit. @@ -942,9 +1027,12 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) ub_cmdtr_state(sc, cmd); return; } - if (urb->status != 0) + if (urb->status != 0) { + printk("ub: cmd #%d cmd status (%d)\n", cmd->tag, urb->status); /* P3 */ goto Bad_End; + } if (urb->actual_length != US_BULK_CB_WRAP_LEN) { + printk("ub: cmd #%d xferred %d\n", cmd->tag, urb->actual_length); /* P3 */ /* XXX Must do reset here to unconfuse the device */ goto Bad_End; } @@ -968,18 +1056,17 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) sc->work_urb.error_count = 0; sc->work_urb.status = 0; - sc->work_timer.expires = jiffies + UB_URB_TIMEOUT; - add_timer(&sc->work_timer); - if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { /* XXX Clear stalls */ printk("ub: data #%d submit failed (%d)\n", cmd->tag, rc); /* P3 */ - del_timer(&sc->work_timer); ub_complete(&sc->work_done); ub_state_done(sc, cmd, rc); return; } + sc->work_timer.expires = jiffies + UB_DATA_TIMEOUT; + add_timer(&sc->work_timer); + cmd->state = UB_CMDST_DATA; ub_cmdtr_state(sc, cmd); @@ -988,7 +1075,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); if (rc != 0) { printk(KERN_NOTICE "%s: " - "unable to submit clear for device %u (%d)\n", + "unable to submit clear for device %u" + " (code %d)\n", sc->name, sc->dev->devnum, rc); /* * This is typically ENOMEM or some other such shit. @@ -1020,7 +1108,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); if (rc != 0) { printk(KERN_NOTICE "%s: " - "unable to submit clear for device %u (%d)\n", + "unable to submit clear for device %u" + " (code %d)\n", sc->name, sc->dev->devnum, rc); /* * This is typically ENOMEM or some other such shit. @@ -1048,34 +1137,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) sc->name, sc->dev->devnum); goto Bad_End; } - - /* - * ub_state_stat only not dropping the count... - */ - UB_INIT_COMPLETION(sc->work_done); - - sc->last_pipe = sc->recv_bulk_pipe; - usb_fill_bulk_urb(&sc->work_urb, sc->dev, - sc->recv_bulk_pipe, &sc->work_bcs, - US_BULK_CS_WRAP_LEN, ub_urb_complete, sc); - sc->work_urb.transfer_flags = URB_ASYNC_UNLINK; - sc->work_urb.actual_length = 0; - sc->work_urb.error_count = 0; - sc->work_urb.status = 0; - - sc->work_timer.expires = jiffies + UB_URB_TIMEOUT; - add_timer(&sc->work_timer); - - rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC); - if (rc != 0) { - /* XXX Clear stalls */ - printk("%s: CSW #%d submit failed (%d)\n", - sc->name, cmd->tag, rc); /* P3 */ - del_timer(&sc->work_timer); - ub_complete(&sc->work_done); - ub_state_done(sc, cmd, rc); - return; - } + __ub_state_stat(sc, cmd); return; } @@ -1096,17 +1158,31 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) goto Bad_End; } +#if 0 if (bcs->Signature != cpu_to_le32(US_BULK_CS_SIGN) && bcs->Signature != cpu_to_le32(US_BULK_CS_OLYMPUS_SIGN)) { - /* XXX Rate-limit, even for P3 tagged */ - /* P3 */ printk("ub: signature 0x%x\n", bcs->Signature); /* Windows ignores signatures, so do we. */ } +#endif if (bcs->Tag != cmd->tag) { - /* P3 */ printk("%s: tag orig 0x%x reply 0x%x\n", - sc->name, cmd->tag, bcs->Tag); - goto Bad_End; + /* + * This usually happens when we disagree with the + * device's microcode about something. For instance, + * a few of them throw this after timeouts. They buffer + * commands and reply at commands we timed out before. + * Without flushing these replies we loop forever. + */ + if (++cmd->stat_count >= 4) { + printk(KERN_NOTICE "%s: " + "tag mismatch orig 0x%x reply 0x%x " + "on device %u\n", + sc->name, cmd->tag, bcs->Tag, + sc->dev->devnum); + goto Bad_End; + } + __ub_state_stat(sc, cmd); + return; } switch (bcs->Status) { @@ -1132,16 +1208,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) (*cmd->done)(sc, cmd); } else if (cmd->state == UB_CMDST_SENSE) { - /* - * We do not look at sense, because even if there was no sense, - * we get into UB_CMDST_SENSE from a STALL or CSW FAIL only. - * We request sense because we want to clear CHECK CONDITION - * on devices with delusions of SCSI, and not because we - * are curious in any way about the sense itself. - */ - /* if ((cmd->top_sense[2] & 0x0F) == NO_SENSE) { foo } */ - ub_state_done(sc, cmd, -EIO); + } else { printk(KERN_WARNING "%s: " "wrong command state %d on device %u\n", @@ -1170,9 +1238,9 @@ static void ub_state_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd, int rc) /* * Factorization helper for the command state machine: - * Submit a CSW read and go to STAT state. + * Submit a CSW read. */ -static void ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd) +static void __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd) { int rc; @@ -1186,18 +1254,26 @@ static void ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd) sc->work_urb.error_count = 0; sc->work_urb.status = 0; - sc->work_timer.expires = jiffies + UB_URB_TIMEOUT; - add_timer(&sc->work_timer); - if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { /* XXX Clear stalls */ - printk("ub: CSW #%d submit failed (%d)\n", cmd->tag, rc); /* P3 */ - del_timer(&sc->work_timer); + printk("%s: CSW #%d submit failed (%d)\n", sc->name, cmd->tag, rc); /* P3 */ ub_complete(&sc->work_done); ub_state_done(sc, cmd, rc); return; } + sc->work_timer.expires = jiffies + UB_STAT_TIMEOUT; + add_timer(&sc->work_timer); +} + +/* + * Factorization helper for the command state machine: + * Submit a CSW read and go to STAT state. + */ +static void ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd) +{ + __ub_state_stat(sc, cmd); + cmd->stat_count = 0; cmd->state = UB_CMDST_STAT; ub_cmdtr_state(sc, cmd); @@ -1217,9 +1293,9 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd) goto error; } - memset(&sc->top_sense, 0, UB_SENSE_SIZE); scmd = &sc->top_rqs_cmd; scmd->cdb[0] = REQUEST_SENSE; + scmd->cdb[4] = UB_SENSE_SIZE; scmd->cdb_len = 6; scmd->dir = UB_DIR_READ; scmd->state = UB_CMDST_INIT; @@ -1271,14 +1347,13 @@ static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, sc->work_urb.error_count = 0; sc->work_urb.status = 0; - sc->work_timer.expires = jiffies + UB_CTRL_TIMEOUT; - add_timer(&sc->work_timer); - if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { - del_timer(&sc->work_timer); ub_complete(&sc->work_done); return rc; } + + sc->work_timer.expires = jiffies + UB_CTRL_TIMEOUT; + add_timer(&sc->work_timer); return 0; } @@ -1289,8 +1364,15 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd) unsigned char *sense = scmd->data; struct ub_scsi_cmd *cmd; + /* + * Ignoring scmd->act_len, because the buffer was pre-zeroed. + */ ub_cmdtr_sense(sc, scmd, sense); + /* + * Find the command which triggered the unit attention or a check, + * save the sense into it, and advance its state machine. + */ if ((cmd = ub_cmdq_peek(sc)) == NULL) { printk(KERN_WARNING "%s: sense done while idle\n", sc->name); return; @@ -1308,6 +1390,10 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd) return; } + cmd->key = sense[2] & 0x0F; + cmd->asc = sense[12]; + cmd->ascq = sense[13]; + ub_scsi_urb_compl(sc, cmd); } @@ -1355,12 +1441,7 @@ static void ub_revalidate(struct ub_dev *sc) sc->readonly = 0; /* XXX Query this from the device */ - /* - * XXX sd.c sets capacity to zero in such case. However, it doesn't - * work for us. In case of zero capacity, block layer refuses to - * have the /dev/uba opened (why?) Set capacity to some random value. - */ - sc->capacity.nsec = 50; + sc->capacity.nsec = 0; sc->capacity.bsize = 512; sc->capacity.bshift = 0; @@ -1375,7 +1456,7 @@ static void ub_revalidate(struct ub_dev *sc) * We keep this because sd.c has retries for capacity. */ if (ub_sync_read_cap(sc, &sc->capacity) != 0) { - sc->capacity.nsec = 100; + sc->capacity.nsec = 0; sc->capacity.bsize = 512; sc->capacity.bshift = 0; } @@ -1404,10 +1485,38 @@ static int ub_bd_open(struct inode *inode, struct file *filp) sc->openc++; spin_unlock_irqrestore(&ub_lock, flags); + /* + * This is a workaround for a specific problem in our block layer. + * In 2.6.9, register_disk duplicates the code from rescan_partitions. + * However, if we do add_disk with a device which persistently reports + * a changed media, add_disk calls register_disk, which does do_open, + * which will call rescan_paritions for changed media. After that, + * register_disk attempts to do it all again and causes double kobject + * registration and a eventually an oops on module removal. + * + * The bottom line is, Al Viro says that we should not allow + * bdev->bd_invalidated to be set when doing add_disk no matter what. + */ + if (sc->first_open) { + if (sc->changed) { + sc->first_open = 0; + rc = -ENOMEDIUM; + goto err_open; + } + } + if (sc->removable || sc->readonly) check_disk_change(inode->i_bdev); - /* XXX sd.c and floppy.c bail on open if media is not present. */ + /* + * The sd.c considers ->media_present and ->changed not equivalent, + * under some pretty murky conditions (a failure of READ CAPACITY). + * We may need it one day. + */ + if (sc->removable && sc->changed && !(filp->f_flags & O_NDELAY)) { + rc = -ENOMEDIUM; + goto err_open; + } if (sc->readonly && (filp->f_mode & FMODE_WRITE)) { rc = -EROFS; @@ -1435,6 +1544,8 @@ static int ub_bd_release(struct inode *inode, struct file *filp) spin_lock_irqsave(&ub_lock, flags); --sc->openc; + if (sc->openc == 0) + sc->first_open = 0; if (sc->openc == 0 && atomic_read(&sc->poison)) ub_cleanup(sc); spin_unlock_irqrestore(&ub_lock, flags); @@ -1447,30 +1558,10 @@ static int ub_bd_release(struct inode *inode, struct file *filp) static int ub_bd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { -// void __user *usermem = (void *) arg; -// struct carm_port *port = ino->i_bdev->bd_disk->private_data; -// struct hd_geometry geom; - -#if 0 - switch (cmd) { - case HDIO_GETGEO: - if (usermem == NULL) // XXX Bizzare. Why? - return -EINVAL; - - geom.heads = (u8) port->dev_geom_head; - geom.sectors = (u8) port->dev_geom_sect; - geom.cylinders = port->dev_geom_cyl; - geom.start = get_start_sect(ino->i_bdev); - - if (copy_to_user(usermem, &geom, sizeof(geom))) - return -EFAULT; - return 0; - - default: ; - } -#endif + struct gendisk *disk = inode->i_bdev->bd_disk; + void __user *usermem = (void __user *) arg; - return -ENOTTY; + return scsi_cmd_ioctl(filp, disk, cmd, usermem); } /* @@ -1489,11 +1580,17 @@ static int ub_bd_revalidate(struct gendisk *disk) ub_revalidate(sc); /* This is pretty much a long term P3 */ - printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n", - sc->name, sc->dev->devnum, sc->capacity.nsec, sc->capacity.bsize); + if (!atomic_read(&sc->poison)) { /* Cover sc->dev */ + printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n", + sc->name, sc->dev->devnum, + sc->capacity.nsec, sc->capacity.bsize); + } + /* XXX Support sector size switching like in sr.c */ + blk_queue_hardsect_size(disk->queue, sc->capacity.bsize); set_capacity(disk, sc->capacity.nsec); // set_disk_ro(sdkp->disk, sc->readonly); + return 0; } @@ -1524,13 +1621,9 @@ static int ub_bd_media_changed(struct gendisk *disk) */ if (ub_sync_tur(sc) != 0) { sc->changed = 1; - /* P3 */ printk("%s: made changed\n", sc->name); return 1; } - /* The sd.c clears this before returning (one-shot flag). Why? */ - /* P3 */ printk("%s: %s changed\n", sc->name, - sc->changed? "is": "was not"); return sc->changed; } @@ -1592,6 +1685,9 @@ static int ub_sync_tur(struct ub_dev *sc) rc = cmd->error; + if (rc == -EIO && cmd->key != 0) /* Retries for benh's key */ + rc = cmd->key; + err_submit: kfree(cmd); err_alloc: @@ -1654,8 +1750,8 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret) } /* sd.c special-cases sector size of 0 to mean 512. Needed? Safe? */ - nsec = be32_to_cpu(*(u32 *)p) + 1; - bsize = be32_to_cpu(*(u32 *)(p + 4)); + nsec = be32_to_cpu(*(__be32 *)p) + 1; + bsize = be32_to_cpu(*(__be32 *)(p + 4)); switch (bsize) { case 512: shift = 0; break; case 1024: shift = 1; break; @@ -1725,28 +1821,22 @@ static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe) sc->work_urb.error_count = 0; sc->work_urb.status = 0; - init_timer(&timer); - timer.function = ub_probe_timeout; - timer.data = (unsigned long) &compl; - timer.expires = jiffies + UB_CTRL_TIMEOUT; - add_timer(&timer); - if ((rc = usb_submit_urb(&sc->work_urb, GFP_KERNEL)) != 0) { printk(KERN_WARNING "%s: Unable to submit a probe clear (%d)\n", sc->name, rc); - del_timer_sync(&timer); return rc; } + init_timer(&timer); + timer.function = ub_probe_timeout; + timer.data = (unsigned long) &compl; + timer.expires = jiffies + UB_CTRL_TIMEOUT; + add_timer(&timer); + wait_for_completion(&compl); del_timer_sync(&timer); - /* - * Most of the time, URB was done and dev set to NULL, and so - * the unlink bounces out with ENODEV. We do not call usb_kill_urb - * because we still think about a backport to 2.4. - */ - usb_unlink_urb(&sc->work_urb); + usb_kill_urb(&sc->work_urb); /* reset the endpoint toggle */ usb_settoggle(sc->dev, endp, usb_pipeout(sc->last_pipe), 0); @@ -1813,6 +1903,7 @@ static int ub_probe(struct usb_interface *intf, request_queue_t *q; struct gendisk *disk; int rc; + int i; rc = -ENOMEM; if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL) @@ -1879,9 +1970,15 @@ static int ub_probe(struct usb_interface *intf, * has to succeed, so we clear checks with an additional one here. * In any case it's not our business how revaliadation is implemented. */ - ub_sync_tur(sc); + for (i = 0; i < 3; i++) { /* Retries for benh's key */ + if ((rc = ub_sync_tur(sc)) <= 0) break; + if (rc != 0x6) break; + msleep(10); + } sc->removable = 1; /* XXX Query this from the device */ + sc->changed = 1; /* ub_revalidate clears only */ + sc->first_open = 1; ub_revalidate(sc); /* This is pretty much a long term P3 */ @@ -1915,7 +2012,7 @@ static int ub_probe(struct usb_interface *intf, blk_queue_max_phys_segments(q, UB_MAX_REQ_SG); // blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); blk_queue_max_sectors(q, UB_MAX_SECTORS); - // blk_queue_hardsect_size(q, xxxxx); + blk_queue_hardsect_size(q, sc->capacity.bsize); /* * This is a serious infraction, caused by a deficiency in the @@ -2005,17 +2102,6 @@ static void ub_disconnect(struct usb_interface *intf) if (q) blk_cleanup_queue(q); - /* - * If we zero disk->private_data BEFORE put_disk, we have to check - * for NULL all over the place in open, release, check_media and - * revalidate, because the block level semaphore is well inside the - * put_disk. But we cannot zero after the call, because *disk is gone. - * The sd.c is blatantly racy in this area. - */ - /* disk->private_data = NULL; */ - put_disk(disk); - sc->disk = NULL; - /* * We really expect blk_cleanup_queue() to wait, so no amount * of paranoya is too much. @@ -2034,6 +2120,13 @@ static void ub_disconnect(struct usb_interface *intf) } spin_unlock_irqrestore(&sc->lock, flags); + /* + * There is virtually no chance that other CPU runs times so long + * after ub_urb_complete should have called del_timer, but only if HCD + * didn't forget to deliver a callback on unlink. + */ + del_timer_sync(&sc->work_timer); + /* * At this point there must be no commands coming from anyone * and no URBs left in transit. diff --git a/drivers/block/umem.c b/drivers/block/umem.c index db7083a0c..86a21e456 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -83,15 +83,15 @@ static int debug; #define DEBUG_LED_ON_TRANSFER 0x01 #define DEBUG_BATTERY_POLLING 0x02 -MODULE_PARM(debug, "i"); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "Debug bitmask"); static int pci_read_cmd = 0x0C; /* Read Multiple */ -MODULE_PARM(pci_read_cmd, "i"); +module_param(pci_read_cmd, int, 0); MODULE_PARM_DESC(pci_read_cmd, "PCI read command"); static int pci_write_cmd = 0x0F; /* Write and Invalidate */ -MODULE_PARM(pci_write_cmd, "i"); +module_param(pci_write_cmd, int, 0); MODULE_PARM_DESC(pci_write_cmd, "PCI write command"); static int pci_cmds; diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 9534c740e..fbc95a96f 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -72,7 +72,7 @@ enum { MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name) }; -static spinlock_t viodasd_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(viodasd_spinlock); #define VIOMAXREQ 16 #define VIOMAXBLOCKDMA 12 @@ -764,8 +764,8 @@ static int viodasd_remove(struct vio_dev *vdev) d = &viodasd_devices[vdev->unit_address]; if (d->disk) { del_gendisk(d->disk); - put_disk(d->disk); blk_cleanup_queue(d->disk->queue); + put_disk(d->disk); d->disk = NULL; } d->dev = NULL; diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 5ca834fcd..3fbadc82a 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c @@ -123,7 +123,7 @@ static unsigned int xd_bases[] __initdata = 0xE0000 }; -static spinlock_t xd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(xd_lock); static struct gendisk *xd_gendisk[2]; @@ -266,7 +266,7 @@ Enomem: /* xd_detect: scan the possible BIOS ROM locations for the signature strings */ static u_char __init xd_detect (u_char *controller, unsigned int *address) { - u_char i,j,found = 0; + int i, j; if (xd_override) { @@ -275,15 +275,23 @@ static u_char __init xd_detect (u_char *controller, unsigned int *address) return(1); } - for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])) && !found; i++) - for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])) && !found; j++) - if (isa_check_signature(xd_bases[i] + xd_sigs[j].offset,xd_sigs[j].string,strlen(xd_sigs[j].string))) { + for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])); i++) { + void __iomem *p = ioremap(xd_bases[i], 0x2000); + if (!p) + continue; + for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])); j++) { + const char *s = xd_sigs[j].string; + if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) { *controller = j; xd_type = j; *address = xd_bases[i]; - found++; + iounmap(p); + return 1; } - return (found); + } + iounmap(p); + } + return 0; } /* do_xd_request: handle an incoming request */ @@ -1046,9 +1054,9 @@ static void __init xd_setparam (u_char command,u_char drive,u_char heads,u_short #ifdef MODULE -MODULE_PARM(xd, "1-4i"); -MODULE_PARM(xd_geo, "3-6i"); -MODULE_PARM(nodma, "i"); +module_param_array(xd, int, NULL, 0); +module_param_array(xd_geo, int, NULL, 0); +module_param(nodma, bool, 0); MODULE_LICENSE("GPL"); diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index 958a5e1f7..007f6a662 100644 --- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c @@ -32,9 +32,9 @@ #include #include #include +#include #include -#include #include #include @@ -65,7 +65,7 @@ static int chip_count = 0; static int list_count = 0; static int current_device = -1; -static spinlock_t z2ram_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(z2ram_lock); static struct block_device_operations z2_fops; static struct gendisk *z2ram_gendisk; diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 6a465ef62..543f93e0f 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -75,6 +75,17 @@ config BT_HCIBCM203X Say Y here to compile support for HCI BCM203x devices into the kernel or say M to compile it as module (bcm203x). +config BT_HCIBPA10X + tristate "HCI BPA10x USB driver" + depends on USB + help + Bluetooth HCI BPA10x USB driver. + This driver provides support for the Digianswer BPA 100/105 Bluetooth + sniffer devices. + + Say Y here to compile support for HCI BPA10x devices into the + kernel or say M to compile it as module (bpa10x). + config BT_HCIBFUSB tristate "HCI BlueFRITZ! USB driver" depends on USB diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index ec5345fac..08c10e178 100644 --- a/drivers/bluetooth/Makefile +++ b/drivers/bluetooth/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_BT_HCIUSB) += hci_usb.o obj-$(CONFIG_BT_HCIVHCI) += hci_vhci.o obj-$(CONFIG_BT_HCIUART) += hci_uart.o obj-$(CONFIG_BT_HCIBCM203X) += bcm203x.o +obj-$(CONFIG_BT_HCIBPA10X) += bpa10x.o obj-$(CONFIG_BT_HCIBFUSB) += bfusb.o obj-$(CONFIG_BT_HCIDTL1) += dtl1_cs.o obj-$(CONFIG_BT_HCIBT3C) += bt3c_cs.o diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 1de33046e..5fd3e4cb7 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c @@ -2,6 +2,7 @@ * * Broadcom Blutonium firmware driver * + * Copyright (C) 2003 Maxim Krasnyansky * Copyright (C) 2003 Marcel Holtmann * * @@ -45,6 +46,8 @@ #define VERSION "1.0" +static int ignore = 0; + static struct usb_device_id bcm203x_table[] = { /* Broadcom Blutonium (BCM2033) */ { USB_DEVICE(0x0a5c, 0x2033) }, @@ -54,7 +57,6 @@ static struct usb_device_id bcm203x_table[] = { MODULE_DEVICE_TABLE(usb, bcm203x_table); - #define BCM203X_ERROR 0 #define BCM203X_RESET 1 #define BCM203X_LOAD_MINIDRV 2 @@ -174,7 +176,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id BT_DBG("intf %p id %p", intf, id); - if (intf->cur_altsetting->desc.bInterfaceNumber != 0) + if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0)) return -ENODEV; data = kmalloc(sizeof(*data), GFP_KERNEL); @@ -264,7 +266,7 @@ static void bcm203x_disconnect(struct usb_interface *intf) BT_DBG("intf %p", intf); - usb_unlink_urb(data->urb); + usb_kill_urb(data->urb); usb_set_intfdata(intf, NULL); @@ -303,6 +305,9 @@ static void __exit bcm203x_exit(void) module_init(bcm203x_init); module_exit(bcm203x_exit); +module_param(ignore, bool, 0644); +MODULE_PARM_DESC(ignore, "Ignore devices from the matching table"); + MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); MODULE_VERSION(VERSION); diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 79ff338e9..913f49e56 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -47,6 +47,8 @@ #define VERSION "1.1" +static int ignore = 0; + static struct usb_driver bfusb_driver; static struct usb_device_id bfusb_table[] = { @@ -123,7 +125,7 @@ static void bfusb_unlink_urbs(struct bfusb *bfusb) while ((skb = skb_dequeue(&bfusb->pending_q))) { urb = ((struct bfusb_scb *) skb->cb)->urb; - usb_unlink_urb(urb); + usb_kill_urb(urb); skb_queue_tail(&bfusb->completed_q, skb); } @@ -655,6 +657,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i BT_DBG("intf %p id %p", intf, id); + if (ignore) + return -ENODEV; + /* Check number of endpoints */ if (intf->cur_altsetting->desc.bNumEndpoints < 2) return -EIO; @@ -678,9 +683,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i bfusb->udev = udev; bfusb->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; bfusb->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress; - bfusb->bulk_pkt_size = bulk_out_ep->desc.wMaxPacketSize; + bfusb->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize); - bfusb->lock = RW_LOCK_UNLOCKED; + rwlock_init(&bfusb->lock); bfusb->reassembly = NULL; @@ -792,6 +797,9 @@ static void __exit bfusb_exit(void) module_init(bfusb_init); module_exit(bfusb_exit); +module_param(ignore, bool, 0644); +MODULE_PARM_DESC(ignore, "Ignore devices from the matching table"); + MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); MODULE_VERSION(VERSION); diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 54ef5f941..3b6df314a 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c @@ -34,6 +34,8 @@ #include #include #include +#include + #include #include @@ -53,13 +55,6 @@ /* ======================== Module parameters ======================== */ -/* Bit map of interrupts to choose from */ -static u_int irq_mask = 0x86bc; -static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); - MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth driver for the Anycom BlueCard (LSE039/LSE041)"); MODULE_LICENSE("GPL"); @@ -90,14 +85,14 @@ typedef struct bluecard_info_t { } bluecard_info_t; -void bluecard_config(dev_link_t *link); -void bluecard_release(dev_link_t *link); -int bluecard_event(event_t event, int priority, event_callback_args_t *args); +static void bluecard_config(dev_link_t *link); +static void bluecard_release(dev_link_t *link); +static int bluecard_event(event_t event, int priority, event_callback_args_t *args); static dev_info_t dev_info = "bluecard_cs"; -dev_link_t *bluecard_attach(void); -void bluecard_detach(dev_link_t *); +static dev_link_t *bluecard_attach(void); +static void bluecard_detach(dev_link_t *); static dev_link_t *dev_list = NULL; @@ -170,7 +165,7 @@ static dev_link_t *dev_list = NULL; /* ======================== LED handling routines ======================== */ -void bluecard_activity_led_timeout(u_long arg) +static void bluecard_activity_led_timeout(u_long arg) { bluecard_info_t *info = (bluecard_info_t *)arg; unsigned int iobase = info->link.io.BasePort1; @@ -719,7 +714,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l /* ======================== Card services HCI interaction ======================== */ -int bluecard_open(bluecard_info_t *info) +static int bluecard_open(bluecard_info_t *info) { unsigned int iobase = info->link.io.BasePort1; struct hci_dev *hdev; @@ -837,7 +832,7 @@ int bluecard_open(bluecard_info_t *info) } -int bluecard_close(bluecard_info_t *info) +static int bluecard_close(bluecard_info_t *info) { unsigned int iobase = info->link.io.BasePort1; struct hci_dev *hdev = info->hdev; @@ -864,12 +859,12 @@ int bluecard_close(bluecard_info_t *info) return 0; } -dev_link_t *bluecard_attach(void) +static dev_link_t *bluecard_attach(void) { bluecard_info_t *info; client_reg_t client_reg; dev_link_t *link; - int i, ret; + int ret; /* Create new info device */ info = kmalloc(sizeof(*info), GFP_KERNEL); @@ -883,13 +878,7 @@ dev_link_t *bluecard_attach(void) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 8; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.IRQInfo1 = IRQ_LEVEL_ID; link->irq.Handler = bluecard_interrupt; link->irq.Instance = info; @@ -902,7 +891,6 @@ dev_link_t *bluecard_attach(void) link->next = dev_list; dev_list = link; client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | @@ -922,7 +910,7 @@ dev_link_t *bluecard_attach(void) } -void bluecard_detach(dev_link_t *link) +static void bluecard_detach(dev_link_t *link) { bluecard_info_t *info = link->priv; dev_link_t **linkp; @@ -967,7 +955,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse return pcmcia_parse_tuple(handle, tuple, parse); } -void bluecard_config(dev_link_t *link) +static void bluecard_config(dev_link_t *link) { client_handle_t handle = link->handle; bluecard_info_t *info = link->priv; @@ -1042,7 +1030,7 @@ failed: } -void bluecard_release(dev_link_t *link) +static void bluecard_release(dev_link_t *link) { bluecard_info_t *info = link->priv; @@ -1061,7 +1049,7 @@ void bluecard_release(dev_link_t *link) } -int bluecard_event(event_t event, int priority, event_callback_args_t *args) +static int bluecard_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; bluecard_info_t *info = link->priv; @@ -1115,10 +1103,7 @@ static int __init init_bluecard_cs(void) static void __exit exit_bluecard_cs(void) { pcmcia_unregister_driver(&bluecard_driver); - - /* XXX: this really needs to move into generic code.. */ - while (dev_list != NULL) - bluecard_detach(dev_list); + BUG_ON(dev_list != NULL); } module_init(init_bluecard_cs); diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index d67d0385f..f71e5c769 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -34,13 +34,14 @@ #include #include #include +#include #include #include #include #include +#include #include -#include #include #include @@ -62,13 +63,6 @@ /* ======================== Module parameters ======================== */ -/* Bit map of interrupts to choose from */ -static u_int irq_mask = 0xffff; -static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); - MODULE_AUTHOR("Marcel Holtmann , Jose Orlando Pereira "); MODULE_DESCRIPTION("Bluetooth driver for the 3Com Bluetooth PCMCIA card"); MODULE_LICENSE("GPL"); @@ -95,14 +89,14 @@ typedef struct bt3c_info_t { } bt3c_info_t; -void bt3c_config(dev_link_t *link); -void bt3c_release(dev_link_t *link); -int bt3c_event(event_t event, int priority, event_callback_args_t *args); +static void bt3c_config(dev_link_t *link); +static void bt3c_release(dev_link_t *link); +static int bt3c_event(event_t event, int priority, event_callback_args_t *args); static dev_info_t dev_info = "bt3c_cs"; -dev_link_t *bt3c_attach(void); -void bt3c_detach(dev_link_t *); +static dev_link_t *bt3c_attach(void); +static void bt3c_detach(dev_link_t *); static dev_link_t *dev_list = NULL; @@ -131,28 +125,28 @@ static dev_link_t *dev_list = NULL; #define CONTROL 4 -inline void bt3c_address(unsigned int iobase, unsigned short addr) +static inline void bt3c_address(unsigned int iobase, unsigned short addr) { outb(addr & 0xff, iobase + ADDR_L); outb((addr >> 8) & 0xff, iobase + ADDR_H); } -inline void bt3c_put(unsigned int iobase, unsigned short value) +static inline void bt3c_put(unsigned int iobase, unsigned short value) { outb(value & 0xff, iobase + DATA_L); outb((value >> 8) & 0xff, iobase + DATA_H); } -inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value) +static inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value) { bt3c_address(iobase, addr); bt3c_put(iobase, value); } -inline unsigned short bt3c_get(unsigned int iobase) +static inline unsigned short bt3c_get(unsigned int iobase) { unsigned short value = inb(iobase + DATA_L); @@ -162,7 +156,7 @@ inline unsigned short bt3c_get(unsigned int iobase) } -inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr) +static inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr) { bt3c_address(iobase, addr); @@ -489,13 +483,10 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long static struct device *bt3c_device(void) { - static char *kobj_name = "bt3c"; - static struct device dev = { .bus_id = "pcmcia", }; - dev.kobj.k_name = kmalloc(strlen(kobj_name) + 1, GFP_KERNEL); - strcpy(dev.kobj.k_name, kobj_name); + kobject_set_name(&dev.kobj, "bt3c"); kobject_init(&dev.kobj); return &dev; @@ -586,7 +577,7 @@ error: } -int bt3c_open(bt3c_info_t *info) +static int bt3c_open(bt3c_info_t *info) { const struct firmware *firmware; struct hci_dev *hdev; @@ -656,7 +647,7 @@ error: } -int bt3c_close(bt3c_info_t *info) +static int bt3c_close(bt3c_info_t *info) { struct hci_dev *hdev = info->hdev; @@ -673,12 +664,12 @@ int bt3c_close(bt3c_info_t *info) return 0; } -dev_link_t *bt3c_attach(void) +static dev_link_t *bt3c_attach(void) { bt3c_info_t *info; client_reg_t client_reg; dev_link_t *link; - int i, ret; + int ret; /* Create new info device */ info = kmalloc(sizeof(*info), GFP_KERNEL); @@ -692,13 +683,7 @@ dev_link_t *bt3c_attach(void) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 8; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.IRQInfo1 = IRQ_LEVEL_ID; link->irq.Handler = bt3c_interrupt; link->irq.Instance = info; @@ -711,7 +696,6 @@ dev_link_t *bt3c_attach(void) link->next = dev_list; dev_list = link; client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | @@ -731,7 +715,7 @@ dev_link_t *bt3c_attach(void) } -void bt3c_detach(dev_link_t *link) +static void bt3c_detach(dev_link_t *link) { bt3c_info_t *info = link->priv; dev_link_t **linkp; @@ -785,9 +769,9 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) return get_tuple(handle, tuple, parse); } -void bt3c_config(dev_link_t *link) +static void bt3c_config(dev_link_t *link) { - static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; client_handle_t handle = link->handle; bt3c_info_t *info = link->priv; tuple_t tuple; @@ -898,7 +882,7 @@ failed: } -void bt3c_release(dev_link_t *link) +static void bt3c_release(dev_link_t *link) { bt3c_info_t *info = link->priv; @@ -915,7 +899,7 @@ void bt3c_release(dev_link_t *link) } -int bt3c_event(event_t event, int priority, event_callback_args_t *args) +static int bt3c_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; bt3c_info_t *info = link->priv; @@ -969,10 +953,7 @@ static int __init init_bt3c_cs(void) static void __exit exit_bt3c_cs(void) { pcmcia_unregister_driver(&bt3c_driver); - - /* XXX: this really needs to move into generic code.. */ - while (dev_list != NULL) - bt3c_detach(dev_list); + BUG_ON(dev_list != NULL); } module_init(init_bt3c_cs); diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index b44fa7dd3..ad8d97244 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c @@ -33,13 +33,14 @@ #include #include #include +#include #include #include #include #include +#include #include -#include #include #include @@ -58,13 +59,6 @@ /* ======================== Module parameters ======================== */ -/* Bit map of interrupts to choose from */ -static u_int irq_mask = 0xffff; -static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); - MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth driver for Bluetooth PCMCIA cards with HCI UART interface"); MODULE_LICENSE("GPL"); @@ -91,14 +85,14 @@ typedef struct btuart_info_t { } btuart_info_t; -void btuart_config(dev_link_t *link); -void btuart_release(dev_link_t *link); -int btuart_event(event_t event, int priority, event_callback_args_t *args); +static void btuart_config(dev_link_t *link); +static void btuart_release(dev_link_t *link); +static int btuart_event(event_t event, int priority, event_callback_args_t *args); static dev_info_t dev_info = "btuart_cs"; -dev_link_t *btuart_attach(void); -void btuart_detach(dev_link_t *); +static dev_link_t *btuart_attach(void); +static void btuart_detach(dev_link_t *); static dev_link_t *dev_list = NULL; @@ -491,7 +485,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon /* ======================== Card services HCI interaction ======================== */ -int btuart_open(btuart_info_t *info) +static int btuart_open(btuart_info_t *info) { unsigned long flags; unsigned int iobase = info->link.io.BasePort1; @@ -560,7 +554,7 @@ int btuart_open(btuart_info_t *info) } -int btuart_close(btuart_info_t *info) +static int btuart_close(btuart_info_t *info) { unsigned long flags; unsigned int iobase = info->link.io.BasePort1; @@ -589,12 +583,12 @@ int btuart_close(btuart_info_t *info) return 0; } -dev_link_t *btuart_attach(void) +static dev_link_t *btuart_attach(void) { btuart_info_t *info; client_reg_t client_reg; dev_link_t *link; - int i, ret; + int ret; /* Create new info device */ info = kmalloc(sizeof(*info), GFP_KERNEL); @@ -608,13 +602,7 @@ dev_link_t *btuart_attach(void) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 8; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.IRQInfo1 = IRQ_LEVEL_ID; link->irq.Handler = btuart_interrupt; link->irq.Instance = info; @@ -627,7 +615,6 @@ dev_link_t *btuart_attach(void) link->next = dev_list; dev_list = link; client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | @@ -647,7 +634,7 @@ dev_link_t *btuart_attach(void) } -void btuart_detach(dev_link_t *link) +static void btuart_detach(dev_link_t *link) { btuart_info_t *info = link->priv; dev_link_t **linkp; @@ -701,9 +688,9 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) return get_tuple(handle, tuple, parse); } -void btuart_config(dev_link_t *link) +static void btuart_config(dev_link_t *link) { - static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; client_handle_t handle = link->handle; btuart_info_t *info = link->priv; tuple_t tuple; @@ -815,7 +802,7 @@ failed: } -void btuart_release(dev_link_t *link) +static void btuart_release(dev_link_t *link) { btuart_info_t *info = link->priv; @@ -832,7 +819,7 @@ void btuart_release(dev_link_t *link) } -int btuart_event(event_t event, int priority, event_callback_args_t *args) +static int btuart_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; btuart_info_t *info = link->priv; @@ -886,10 +873,7 @@ static int __init init_btuart_cs(void) static void __exit exit_btuart_cs(void) { pcmcia_unregister_driver(&btuart_driver); - - /* XXX: this really needs to move into generic code.. */ - while (dev_list != NULL) - btuart_detach(dev_list); + BUG_ON(dev_list != NULL); } module_init(init_btuart_cs); diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 79ec1ce78..fe954e5d9 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c @@ -33,13 +33,14 @@ #include #include #include +#include #include #include #include #include +#include #include -#include #include #include @@ -58,13 +59,6 @@ /* ======================== Module parameters ======================== */ -/* Bit map of interrupts to choose from */ -static u_int irq_mask = 0xffff; -static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); - MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth driver for Nokia Connectivity Card DTL-1"); MODULE_LICENSE("GPL"); @@ -94,14 +88,14 @@ typedef struct dtl1_info_t { } dtl1_info_t; -void dtl1_config(dev_link_t *link); -void dtl1_release(dev_link_t *link); -int dtl1_event(event_t event, int priority, event_callback_args_t *args); +static void dtl1_config(dev_link_t *link); +static void dtl1_release(dev_link_t *link); +static int dtl1_event(event_t event, int priority, event_callback_args_t *args); static dev_info_t dev_info = "dtl1_cs"; -dev_link_t *dtl1_attach(void); -void dtl1_detach(dev_link_t *); +static dev_link_t *dtl1_attach(void); +static void dtl1_detach(dev_link_t *); static dev_link_t *dev_list = NULL; @@ -468,7 +462,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long /* ======================== Card services HCI interaction ======================== */ -int dtl1_open(dtl1_info_t *info) +static int dtl1_open(dtl1_info_t *info) { unsigned long flags; unsigned int iobase = info->link.io.BasePort1; @@ -539,7 +533,7 @@ int dtl1_open(dtl1_info_t *info) } -int dtl1_close(dtl1_info_t *info) +static int dtl1_close(dtl1_info_t *info) { unsigned long flags; unsigned int iobase = info->link.io.BasePort1; @@ -568,12 +562,12 @@ int dtl1_close(dtl1_info_t *info) return 0; } -dev_link_t *dtl1_attach(void) +static dev_link_t *dtl1_attach(void) { dtl1_info_t *info; client_reg_t client_reg; dev_link_t *link; - int i, ret; + int ret; /* Create new info device */ info = kmalloc(sizeof(*info), GFP_KERNEL); @@ -587,13 +581,7 @@ dev_link_t *dtl1_attach(void) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 8; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.IRQInfo1 = IRQ_LEVEL_ID; link->irq.Handler = dtl1_interrupt; link->irq.Instance = info; @@ -606,7 +594,6 @@ dev_link_t *dtl1_attach(void) link->next = dev_list; dev_list = link; client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | @@ -626,7 +613,7 @@ dev_link_t *dtl1_attach(void) } -void dtl1_detach(dev_link_t *link) +static void dtl1_detach(dev_link_t *link) { dtl1_info_t *info = link->priv; dev_link_t **linkp; @@ -680,7 +667,7 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) return get_tuple(handle, tuple, parse); } -void dtl1_config(dev_link_t *link) +static void dtl1_config(dev_link_t *link) { client_handle_t handle = link->handle; dtl1_info_t *info = link->priv; @@ -767,7 +754,7 @@ failed: } -void dtl1_release(dev_link_t *link) +static void dtl1_release(dev_link_t *link) { dtl1_info_t *info = link->priv; @@ -784,7 +771,7 @@ void dtl1_release(dev_link_t *link) } -int dtl1_event(event_t event, int priority, event_callback_args_t *args) +static int dtl1_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; dtl1_info_t *info = link->priv; @@ -838,10 +825,7 @@ static int __init init_dtl1_cs(void) static void __exit exit_dtl1_cs(void) { pcmcia_unregister_driver(&dtl1_driver); - - /* XXX: this really needs to move into generic code.. */ - while (dev_list != NULL) - dtl1_detach(dev_list); + BUG_ON(dev_list != NULL); } module_init(init_dtl1_cs); diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 4d1f7ea9c..846cdffc4 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -265,7 +265,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, /* This is a rewrite of pkt_avail in ABCSP */ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu) { - struct bcsp_struct *bcsp = (struct bcsp_struct *) hu->priv; + struct bcsp_struct *bcsp = hu->priv; unsigned long flags; struct sk_buff *skb; @@ -629,7 +629,7 @@ static int bcsp_recv(struct hci_uart *hu, void *data, int count) static void bcsp_timed_event(unsigned long arg) { struct hci_uart *hu = (struct hci_uart *) arg; - struct bcsp_struct *bcsp = (struct bcsp_struct *) hu->priv; + struct bcsp_struct *bcsp = hu->priv; struct sk_buff *skb; unsigned long flags; diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index fb990ec38..9075bbb56 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -51,6 +51,7 @@ #include #include + #include "hci_uart.h" #ifndef CONFIG_BT_HCIUART_DEBUG @@ -60,6 +61,8 @@ #define BT_DMP( A... ) #endif +static int reset = 0; + static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO]; int hci_uart_register_proto(struct hci_uart_proto *p) @@ -143,7 +146,7 @@ restart: int len; set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - len = tty->driver->write(tty, 0, skb->data, skb->len); + len = tty->driver->write(tty, skb->data, skb->len); hdev->stat.byte_tx += len; skb_pull(skb, len); @@ -412,7 +415,10 @@ static int hci_uart_register_dev(struct hci_uart *hu) hdev->destruct = hci_uart_destruct; hdev->owner = THIS_MODULE; - + + if (reset) + set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks); + if (hci_register_dev(hdev) < 0) { BT_ERR("Can't register HCI device"); hci_free_dev(hdev); @@ -502,7 +508,7 @@ static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file, unsi { return 0; } -static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char __user *data, size_t count) +static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char *data, size_t count) { return 0; } @@ -577,7 +583,10 @@ static void __exit hci_uart_exit(void) module_init(hci_uart_init); module_exit(hci_uart_exit); -MODULE_AUTHOR("Maxim Krasnyansky "); +module_param(reset, bool, 0644); +MODULE_PARM_DESC(reset, "Send HCI reset command on initialization"); + +MODULE_AUTHOR("Maxim Krasnyansky , Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION); MODULE_VERSION(VERSION); MODULE_LICENSE("GPL"); diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index bca968310..4c8e96865 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -65,7 +66,14 @@ #define URB_ZERO_PACKET 0 #endif -#define VERSION "2.7" +static int ignore = 0; +static int reset = 0; + +#ifdef CONFIG_BT_HCIUSB_SCO +static int isoc = 2; +#endif + +#define VERSION "2.8" static struct usb_driver hci_usb_driver; @@ -97,20 +105,28 @@ static struct usb_device_id blacklist_ids[] = { /* Broadcom BCM2035 */ { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_BROKEN_ISOC }, + { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 }, + + /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ + { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, /* ISSC Bluetooth Adapter v3.1 */ { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, - /* Digianswer device */ - { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER }, - /* RTX Telecom based adapter with buggy SCO support */ { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, + /* Digianswer devices */ + { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER }, + { USB_DEVICE(0x08fd, 0x0002), .driver_info = HCI_IGNORE }, + + /* CSR BlueCore Bluetooth Sniffer */ + { USB_DEVICE(0x0a12, 0x0002), .driver_info = HCI_SNIFFER }, + { } /* Terminating entry */ }; -struct _urb *_urb_alloc(int isoc, int gfp) +static struct _urb *_urb_alloc(int isoc, int gfp) { struct _urb *_urb = kmalloc(sizeof(struct _urb) + sizeof(struct usb_iso_packet_descriptor) * isoc, gfp); @@ -121,7 +137,7 @@ struct _urb *_urb_alloc(int isoc, int gfp) return _urb; } -struct _urb *_urb_dequeue(struct _urb_queue *q) +static struct _urb *_urb_dequeue(struct _urb_queue *q) { struct _urb *_urb = NULL; unsigned long flags; @@ -183,7 +199,7 @@ static int hci_usb_intr_rx_submit(struct hci_usb *husb) BT_DBG("%s", husb->hdev->name); - size = husb->intr_in_ep->desc.wMaxPacketSize; + size = le16_to_cpu(husb->intr_in_ep->desc.wMaxPacketSize); buf = kmalloc(size, GFP_ATOMIC); if (!buf) @@ -258,7 +274,7 @@ static int hci_usb_isoc_rx_submit(struct hci_usb *husb) int err, mtu, size; void *buf; - mtu = husb->isoc_in_ep->desc.wMaxPacketSize; + mtu = le16_to_cpu(husb->isoc_in_ep->desc.wMaxPacketSize); size = mtu * HCI_MAX_ISOC_FRAMES; buf = kmalloc(size, GFP_ATOMIC); @@ -515,7 +531,7 @@ static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb) urb->transfer_buffer = skb->data; urb->transfer_buffer_length = skb->len; - __fill_isoc_desc(urb, skb->len, husb->isoc_out_ep->desc.wMaxPacketSize); + __fill_isoc_desc(urb, skb->len, le16_to_cpu(husb->isoc_out_ep->desc.wMaxPacketSize)); _urb->priv = skb; return __tx_submit(husb, _urb); @@ -790,7 +806,12 @@ static void hci_usb_destruct(struct hci_dev *hdev) kfree(husb); } -int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) +static void hci_usb_notify(struct hci_dev *hdev, unsigned int evt) +{ + BT_DBG("%s evt %d", hdev->name, evt); +} + +static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(intf); struct usb_host_endpoint *bulk_out_ep = NULL; @@ -812,7 +833,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) id = match; } - if (id->driver_info & HCI_IGNORE) + if (ignore || id->driver_info & HCI_IGNORE) return -ENODEV; if (intf->cur_altsetting->desc.bInterfaceNumber > 0) @@ -856,9 +877,9 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) husb->intr_in_ep = intr_in_ep; if (id->driver_info & HCI_DIGIANSWER) - husb->ctrl_req = HCI_DIGI_REQ; + husb->ctrl_req = USB_TYPE_VENDOR; else - husb->ctrl_req = HCI_CTRL_REQ; + husb->ctrl_req = USB_TYPE_CLASS; /* Find isochronous endpoints that we can use */ size = 0; @@ -867,7 +888,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) isoc_ifnum = 1; #ifdef CONFIG_BT_HCIUSB_SCO - if (!(id->driver_info & HCI_BROKEN_ISOC)) + if (isoc && !(id->driver_info & HCI_BROKEN_ISOC)) isoc_iface = usb_ifnum_to_if(udev, isoc_ifnum); if (isoc_iface) { @@ -882,10 +903,10 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { case USB_ENDPOINT_XFER_ISOC: - if (ep->desc.wMaxPacketSize < size || - uif->desc.bAlternateSetting > 2) + if (le16_to_cpu(ep->desc.wMaxPacketSize) < size || + uif->desc.bAlternateSetting != isoc) break; - size = ep->desc.wMaxPacketSize; + size = le16_to_cpu(ep->desc.wMaxPacketSize); isoc_alts = uif->desc.bAlternateSetting; @@ -906,7 +927,9 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) BT_ERR("Can't claim isoc interface"); else if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) { BT_ERR("Can't set isoc interface settings"); + husb->isoc_iface = isoc_iface; usb_driver_release_interface(&hci_usb_driver, isoc_iface); + husb->isoc_iface = NULL; } else { husb->isoc_iface = isoc_iface; husb->isoc_in_ep = isoc_in_ep; @@ -916,7 +939,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) } #endif - husb->completion_lock = RW_LOCK_UNLOCKED; + rwlock_init(&husb->completion_lock); for (i = 0; i < 4; i++) { skb_queue_head_init(&husb->transmit_q[i]); @@ -942,12 +965,29 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) hdev->flush = hci_usb_flush; hdev->send = hci_usb_send_frame; hdev->destruct = hci_usb_destruct; + hdev->notify = hci_usb_notify; hdev->owner = THIS_MODULE; - if (id->driver_info & HCI_RESET) + if (reset || id->driver_info & HCI_RESET) set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks); + if (id->driver_info & HCI_SNIFFER) { + if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997) + set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); + } + + if (id->driver_info & HCI_BCM92035) { + unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 }; + struct sk_buff *skb; + + skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL); + if (skb) { + memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd)); + skb_queue_tail(&hdev->driver_init, skb); + } + } + if (hci_register_dev(hdev) < 0) { BT_ERR("Can't register HCI device"); hci_free_dev(hdev); @@ -1018,6 +1058,17 @@ static void __exit hci_usb_exit(void) module_init(hci_usb_init); module_exit(hci_usb_exit); +module_param(ignore, bool, 0644); +MODULE_PARM_DESC(ignore, "Ignore devices from the matching table"); + +module_param(reset, bool, 0644); +MODULE_PARM_DESC(reset, "Send HCI reset command on initialization"); + +#ifdef CONFIG_BT_HCIUSB_SCO +module_param(isoc, int, 0644); +MODULE_PARM_DESC(isoc, "Set isochronous transfers for SCO over HCI support"); +#endif + MODULE_AUTHOR("Maxim Krasnyansky , Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth HCI USB driver ver " VERSION); MODULE_VERSION(VERSION); diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h index da4561ef7..29936b43d 100644 --- a/drivers/bluetooth/hci_usb.h +++ b/drivers/bluetooth/hci_usb.h @@ -28,13 +28,12 @@ #define HCI_DEV_SUBCLASS 0x01 /* RF subclass */ #define HCI_DEV_PROTOCOL 0x01 /* Bluetooth programming protocol */ -#define HCI_CTRL_REQ 0x20 -#define HCI_DIGI_REQ 0x40 - #define HCI_IGNORE 0x01 #define HCI_RESET 0x02 #define HCI_DIGIANSWER 0x04 -#define HCI_BROKEN_ISOC 0x08 +#define HCI_SNIFFER 0x08 +#define HCI_BROKEN_ISOC 0x10 +#define HCI_BCM92035 0x20 #define HCI_MAX_IFACE_NUM 3 @@ -59,8 +58,6 @@ struct _urb { struct urb urb; }; -struct _urb *_urb_alloc(int isoc, int gfp); - static inline void _urb_free(struct _urb *_urb) { kfree(_urb); @@ -99,8 +96,6 @@ static inline void _urb_unlink(struct _urb *_urb) } } -struct _urb *_urb_dequeue(struct _urb_queue *q); - struct hci_usb { struct hci_dev *hdev; diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index d1df4adff..3b9f7a534 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -338,7 +338,7 @@ static struct miscdevice hci_vhci_miscdev= &hci_vhci_fops }; -int __init hci_vhci_init(void) +static int __init hci_vhci_init(void) { BT_INFO("VHCI driver ver %s", VERSION); @@ -350,7 +350,7 @@ int __init hci_vhci_init(void) return 0; } -void hci_vhci_cleanup(void) +static void hci_vhci_cleanup(void) { misc_deregister(&hci_vhci_miscdev); } diff --git a/drivers/cdrom/Kconfig b/drivers/cdrom/Kconfig index 7529ebb48..455a9a19f 100644 --- a/drivers/cdrom/Kconfig +++ b/drivers/cdrom/Kconfig @@ -18,7 +18,7 @@ config CD_NO_IDESCSI have, say Y and find out whether you have one of the following drives. - For each of these drivers, a file Documentation/cdrom/{driver_name} + For each of these drivers, a exists. Especially in cases where you do not know exactly which kind of drive you have you should read there. Most of these drivers use a file drivers/cdrom/{driver_name}.h where you can define your @@ -105,7 +105,7 @@ config SBPCD config MCD tristate "Mitsumi (standard) [no XA/Multisession] CDROM support" - depends on CD_NO_IDESCSI + depends on CD_NO_IDESCSI && BROKEN ---help--- This is the older of the two drivers for the older Mitsumi models LU-005, FX-001 and FX-001D. This is not the right driver for the diff --git a/drivers/cdrom/Makefile b/drivers/cdrom/Makefile index 5c484f3b3..4a8351753 100644 --- a/drivers/cdrom/Makefile +++ b/drivers/cdrom/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_BLK_DEV_IDECD) += cdrom.o obj-$(CONFIG_BLK_DEV_SR) += cdrom.o obj-$(CONFIG_PARIDE_PCD) += cdrom.o +obj-$(CONFIG_CDROM_PKTCDVD) += cdrom.o obj-$(CONFIG_AZTCD) += aztcd.o obj-$(CONFIG_CDU31A) += cdu31a.o cdrom.o diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index b6a14c80e..43bf1e5dc 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -165,7 +165,6 @@ Torben Mathiasen */ -#include #include #include "aztcd.h" @@ -288,7 +287,7 @@ static volatile int azt_read_count = 1; static int azt_port = AZT_BASE_ADDR; -MODULE_PARM(azt_port, "i"); +module_param(azt_port, int, 0); static int azt_port_auto[16] = AZT_BASE_AUTO; @@ -312,7 +311,7 @@ static unsigned char aztIndatum; static unsigned long aztTimeOutCount; static int aztCmd = 0; -static spinlock_t aztSpin = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(aztSpin); /*########################################################################### Function Prototypes @@ -1708,8 +1707,8 @@ static int __init aztcd_init(void) printk(KERN_INFO "aztcd: (C) 1994-98 W.Zimmermann\n"); if (azt_port == -1) { printk - ("aztcd: KernelVersion=%s DriverVersion=%s For IDE/ATAPI-drives use ide-cd.c\n", - UTS_RELEASE, AZT_VERSION); + ("aztcd: DriverVersion=%s For IDE/ATAPI-drives use ide-cd.c\n", + AZT_VERSION); } else printk ("aztcd: DriverVersion=%s BaseAddress=0x%x For IDE/ATAPI-drives use ide-cd.c\n", diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index e57d19031..9deca49c7 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -234,6 +234,12 @@ -- Mt Rainier support -- DVD-RAM write open fixes + Nov 5 2001, Aug 8 2002. Modified by Andy Polyakov + to support MMC-3 compliant DVD+RW units. + + Modified by Nigel Kukard - support DVD+RW + 2.4.x patch by Andy Polyakov + -------------------------------------------------------------------------*/ #define REVISION "Revision: 3.20" @@ -290,14 +296,14 @@ static int lockdoor = 1; static int check_media_type; /* automatically restart mrw format */ static int mrw_format_restart = 1; -MODULE_PARM(debug, "i"); -MODULE_PARM(autoclose, "i"); -MODULE_PARM(autoeject, "i"); -MODULE_PARM(lockdoor, "i"); -MODULE_PARM(check_media_type, "i"); -MODULE_PARM(mrw_format_restart, "i"); +module_param(debug, bool, 0); +module_param(autoclose, bool, 0); +module_param(autoeject, bool, 0); +module_param(lockdoor, bool, 0); +module_param(check_media_type, bool, 0); +module_param(mrw_format_restart, bool, 0); -static spinlock_t cdrom_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cdrom_lock); static const char *mrw_format_status[] = { "not mrw", @@ -499,7 +505,7 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi, * the first prototypes used 0x2c as the page code for the mrw mode page, * subsequently this was changed to 0x03. probe the one used by this drive */ -int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi) +static int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[16]; @@ -520,7 +526,7 @@ int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi) return 1; } -int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write) +static int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write) { struct packet_command cgc; struct mrw_feature_desc *mfd; @@ -540,6 +546,8 @@ int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write) return ret; mfd = (struct mrw_feature_desc *)&buffer[sizeof(struct feature_header)]; + if (be16_to_cpu(mfd->feature_code) != CDF_MRW) + return 1; *write = mfd->write; if ((ret = cdrom_mrw_probe_pc(cdi))) { @@ -672,7 +680,7 @@ static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space) return 0; } -int cdrom_get_random_writable(struct cdrom_device_info *cdi, +static int cdrom_get_random_writable(struct cdrom_device_info *cdi, struct rwrt_feature_desc *rfd) { struct packet_command cgc; @@ -693,7 +701,7 @@ int cdrom_get_random_writable(struct cdrom_device_info *cdi, return 0; } -int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) +static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[16]; @@ -718,7 +726,7 @@ int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) } -int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write) +static int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write) { struct rwrt_feature_desc rfd; int ret; @@ -848,6 +856,39 @@ static int cdrom_ram_open_write(struct cdrom_device_info *cdi) return ret; } +static void cdrom_mmc3_profile(struct cdrom_device_info *cdi) +{ + struct packet_command cgc; + char buffer[32]; + int ret, mmc3_profile; + + init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); + + cgc.cmd[0] = GPCMD_GET_CONFIGURATION; + cgc.cmd[1] = 0; + cgc.cmd[2] = cgc.cmd[3] = 0; /* Starting Feature Number */ + cgc.cmd[8] = sizeof(buffer); /* Allocation Length */ + cgc.quiet = 1; + + if ((ret = cdi->ops->generic_packet(cdi, &cgc))) + mmc3_profile = 0xffff; + else + mmc3_profile = (buffer[6] << 8) | buffer[7]; + + cdi->mmc3_profile = mmc3_profile; +} + +static int cdrom_is_dvd_rw(struct cdrom_device_info *cdi) +{ + switch (cdi->mmc3_profile) { + case 0x12: /* DVD-RAM */ + case 0x1A: /* DVD+RW */ + return 0; + default: + return 1; + } +} + /* * returns 0 for ok to open write, non-0 to disallow */ @@ -889,10 +930,50 @@ static int cdrom_open_write(struct cdrom_device_info *cdi) ret = cdrom_ram_open_write(cdi); else if (CDROM_CAN(CDC_MO_DRIVE)) ret = mo_open_write(cdi); + else if (!cdrom_is_dvd_rw(cdi)) + ret = 0; return ret; } +static void cdrom_dvd_rw_close_write(struct cdrom_device_info *cdi) +{ + struct packet_command cgc; + + if (cdi->mmc3_profile != 0x1a) { + cdinfo(CD_CLOSE, "%s: No DVD+RW\n", cdi->name); + return; + } + + if (!cdi->media_written) { + cdinfo(CD_CLOSE, "%s: DVD+RW media clean\n", cdi->name); + return; + } + + printk(KERN_INFO "cdrom: %s: dirty DVD+RW media, \"finalizing\"\n", + cdi->name); + + init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); + cgc.cmd[0] = GPCMD_FLUSH_CACHE; + cgc.timeout = 30*HZ; + cdi->ops->generic_packet(cdi, &cgc); + + init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); + cgc.cmd[0] = GPCMD_CLOSE_TRACK; + cgc.timeout = 3000*HZ; + cgc.quiet = 1; + cdi->ops->generic_packet(cdi, &cgc); + + init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); + cgc.cmd[0] = GPCMD_CLOSE_TRACK; + cgc.cmd[2] = 2; /* Close session */ + cgc.quiet = 1; + cgc.timeout = 3000*HZ; + cdi->ops->generic_packet(cdi, &cgc); + + cdi->media_written = 0; +} + static int cdrom_close_write(struct cdrom_device_info *cdi) { #if 0 @@ -925,6 +1006,7 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp) ret = open_for_data(cdi); if (ret) goto err; + cdrom_mmc3_profile(cdi); if (fp->f_mode & FMODE_WRITE) { ret = -EROFS; if (cdrom_open_write(cdi)) @@ -932,6 +1014,7 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp) if (!CDROM_CAN(CDC_RAM)) goto err; ret = 0; + cdi->media_written = 0; } } @@ -993,6 +1076,8 @@ int open_for_data(struct cdrom_device_info * cdi) } cdinfo(CD_OPEN, "the tray is now closed.\n"); } + /* the door should be closed now, check for the disc */ + ret = cdo->drive_status(cdi, CDSL_CURRENT); if (ret!=CDS_DISC_OK) { ret = -ENOMEDIUM; goto clean_up_and_return; @@ -1123,6 +1208,8 @@ int cdrom_release(struct cdrom_device_info *cdi, struct file *fp) cdi->use_count--; if (cdi->use_count == 0) cdinfo(CD_CLOSE, "Use count for \"/dev/%s\" now zero\n", cdi->name); + if (cdi->use_count == 0) + cdrom_dvd_rw_close_write(cdi); if (cdi->use_count == 0 && (cdo->capability & CDC_LOCK) && !keeplocked) { cdinfo(CD_CLOSE, "Unlocking door!\n"); @@ -1329,6 +1416,7 @@ int media_changed(struct cdrom_device_info *cdi, int queue) if (cdi->ops->media_changed(cdi, CDSL_CURRENT)) { cdi->mc_flags = 0x3; /* set bit on both queues */ ret |= 1; + cdi->media_written = 0; } cdi->mc_flags &= ~mask; /* clear bit */ return ret; @@ -1790,7 +1878,7 @@ static int dvd_read_manufact(struct cdrom_device_info *cdi, dvd_struct *s) s->manufact.len = buf[0] << 8 | buf[1]; if (s->manufact.len < 0 || s->manufact.len > 2048) { cdinfo(CD_WARNING, "Received invalid manufacture info length" - " (%d)\n", s->bca.len); + " (%d)\n", s->manufact.len); ret = -EIO; } else { memcpy(s->manufact.value, &buf[4], s->manufact.len); @@ -2988,14 +3076,12 @@ EXPORT_SYMBOL(cdrom_mode_select); EXPORT_SYMBOL(cdrom_mode_sense); EXPORT_SYMBOL(init_cdrom_command); EXPORT_SYMBOL(cdrom_get_media_event); -EXPORT_SYMBOL(cdrom_is_mrw); -EXPORT_SYMBOL(cdrom_is_random_writable); #ifdef CONFIG_SYSCTL #define CDROM_STR_SIZE 1000 -struct cdrom_sysctl_settings { +static struct cdrom_sysctl_settings { char info[CDROM_STR_SIZE]; /* general info */ int autoclose; /* close tray upon mount, etc */ int autoeject; /* eject on umount */ @@ -3004,7 +3090,7 @@ struct cdrom_sysctl_settings { int check; /* check media type */ } cdrom_sysctl_settings; -int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp, +static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp, loff_t *ppos) { int pos; @@ -3107,7 +3193,7 @@ int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp, procfs/sysctl yet. When they are, this will naturally disappear. For now just update all drives. Later this will become the template on which new registered drives will be based. */ -void cdrom_update_settings(void) +static void cdrom_update_settings(void) { struct cdrom_device_info *cdi; @@ -3185,7 +3271,7 @@ static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp, } /* Place files in /proc/sys/dev/cdrom */ -ctl_table cdrom_table[] = { +static ctl_table cdrom_table[] = { { .ctl_name = DEV_CDROM_INFO, .procname = "info", @@ -3237,7 +3323,7 @@ ctl_table cdrom_table[] = { { .ctl_name = 0 } }; -ctl_table cdrom_cdrom_table[] = { +static ctl_table cdrom_cdrom_table[] = { { .ctl_name = DEV_CDROM, .procname = "cdrom", @@ -3249,8 +3335,7 @@ ctl_table cdrom_cdrom_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table cdrom_root_table[] = { -#ifdef CONFIG_PROC_FS +static ctl_table cdrom_root_table[] = { { .ctl_name = CTL_DEV, .procname = "dev", @@ -3258,7 +3343,6 @@ ctl_table cdrom_root_table[] = { .mode = 0555, .child = cdrom_cdrom_table, }, -#endif /* CONFIG_PROC_FS */ { .ctl_name = 0 } }; static struct ctl_table_header *cdrom_sysctl_header; diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c index 09873fa1b..d729ae4b3 100644 --- a/drivers/cdrom/cdu31a.c +++ b/drivers/cdrom/cdu31a.c @@ -65,14 +65,6 @@ * This section describes features beyond the normal audio and CD-ROM * functions of the drive. * - * 2048 byte buffer mode - * - * If a disk is mounted with -o block=2048, data is copied straight - * from the drive data port to the buffer. Otherwise, the readahead - * buffer must be involved to hold the other 1K of data when a 1K - * block operation is done. Note that with 2048 byte blocks you - * cannot execute files from the CD. - * * XA compatibility * * The driver should support XA disks for both the CDU31A and CDU33A. @@ -147,6 +139,13 @@ * Removed init_module & cleanup_module in favor of * module_init & module_exit. * Torben Mathiasen + * + * 22 October 2004 -- Make the driver work in 2.6.X + * Added workaround to fix hard lockups on eject + * Fixed door locking problem after mounting empty drive + * Set double-speed drives to double speed by default + * Removed all readahead things - not needed anymore + * Ondrej Zary */ #include @@ -179,10 +178,9 @@ #define MAJOR_NR CDU31A_CDROM_MAJOR #include -#define CDU31A_READAHEAD 4 /* 128 sector, 64kB, 32 reads read-ahead */ #define CDU31A_MAX_CONSECUTIVE_ATTENTIONS 10 -#define DEBUG 0 +#define DEBUG 1 /* Define the following if you have data corruption problems. */ #undef SONY_POLL_EACH_BYTE @@ -222,7 +220,7 @@ static unsigned int sony_blocks_left = 0; /* Number of 512 byte blocks left /* The base I/O address of the Sony Interface. This is a variable (not a #define) so it can be easily changed via some future ioctl() */ static unsigned int cdu31a_port = 0; -MODULE_PARM(cdu31a_port, "i"); +module_param(cdu31a_port, uint, 0); /* * The following are I/O addresses of the various registers for the drive. The @@ -238,7 +236,7 @@ static volatile unsigned short sony_cd_read_reg; static volatile unsigned short sony_cd_fifost_reg; static struct request_queue *cdu31a_queue; -static spinlock_t cdu31a_lock = SPIN_LOCK_UNLOCKED; /* queue lock */ +static DEFINE_SPINLOCK(cdu31a_lock); /* queue lock */ static int sony_spun_up = 0; /* Has the drive been spun up? */ @@ -279,7 +277,6 @@ static struct task_struct *has_cd_task = NULL; /* The task that is currently NULL if none. */ static int is_double_speed = 0; /* does the drive support double speed ? */ -static int is_a_cdu31a = 1; /* Is the drive a CDU31A? */ static int is_auto_eject = 1; /* Door has been locked? 1=No/0=Yes */ @@ -301,7 +298,7 @@ static unsigned volatile char final_pos_msf[3] = { 0, 0, 0 }; /* What IRQ is the drive using? 0 if none. */ static int cdu31a_irq = 0; -MODULE_PARM(cdu31a_irq, "i"); +module_param(cdu31a_irq, int, 0); /* The interrupt handler will wake this queue up when it gets an interrupts. */ @@ -314,12 +311,8 @@ static int curr_control_reg = 0; /* Current value of the control register */ it will be cleared. */ static char disk_changed; -/* Variable for using the readahead buffer. The readahead buffer - is used for raw sector reads and for blocksizes that are smaller - than 2048 bytes. */ -static char readahead_buffer[CD_FRAMESIZE_RAW]; -static int readahead_dataleft = 0; -static int readahead_bad = 0; +/* This was readahead_buffer once... Now it's used only for audio reads */ +static char audio_buffer[CD_FRAMESIZE_RAW]; /* Used to time a short period to abort an operation after the drive has been idle for a while. This keeps the light on @@ -440,7 +433,6 @@ static inline int is_result_reg_not_empty(void) static inline void reset_drive(void) { curr_control_reg = 0; - readahead_dataleft = 0; sony_toc_read = 0; outb(SONY_DRIVE_RESET_BIT, sony_cd_control_reg); } @@ -556,82 +548,47 @@ static unsigned char *translate_error(unsigned char err_code) static unsigned char errbuf[80]; switch (err_code) { - case 0x10: - return "illegal command "; - case 0x11: - return "illegal parameter "; - - case 0x20: - return "not loaded "; - case 0x21: - return "no disc "; - case 0x22: - return "not spinning "; - case 0x23: - return "spinning "; - case 0x25: - return "spindle servo "; - case 0x26: - return "focus servo "; - case 0x29: - return "eject mechanism "; - case 0x2a: - return "audio playing "; - case 0x2c: - return "emergency eject "; - - case 0x30: - return "focus "; - case 0x31: - return "frame sync "; - case 0x32: - return "subcode address "; - case 0x33: - return "block sync "; - case 0x34: - return "header address "; - - case 0x40: - return "illegal track read "; - case 0x41: - return "mode 0 read "; - case 0x42: - return "illegal mode read "; - case 0x43: - return "illegal block size read "; - case 0x44: - return "mode read "; - case 0x45: - return "form read "; - case 0x46: - return "leadout read "; - case 0x47: - return "buffer overrun "; - - case 0x53: - return "unrecoverable CIRC "; - case 0x57: - return "unrecoverable LECC "; - - case 0x60: - return "no TOC "; - case 0x61: - return "invalid subcode data "; - case 0x63: - return "focus on TOC read "; - case 0x64: - return "frame sync on TOC read "; - case 0x65: - return "TOC data "; - - case 0x70: - return "hardware failure "; - case 0x91: - return "leadin "; - case 0x92: - return "leadout "; - case 0x93: - return "data track "; + case 0x10: return "illegal command "; + case 0x11: return "illegal parameter "; + + case 0x20: return "not loaded "; + case 0x21: return "no disc "; + case 0x22: return "not spinning "; + case 0x23: return "spinning "; + case 0x25: return "spindle servo "; + case 0x26: return "focus servo "; + case 0x29: return "eject mechanism "; + case 0x2a: return "audio playing "; + case 0x2c: return "emergency eject "; + + case 0x30: return "focus "; + case 0x31: return "frame sync "; + case 0x32: return "subcode address "; + case 0x33: return "block sync "; + case 0x34: return "header address "; + + case 0x40: return "illegal track read "; + case 0x41: return "mode 0 read "; + case 0x42: return "illegal mode read "; + case 0x43: return "illegal block size read "; + case 0x44: return "mode read "; + case 0x45: return "form read "; + case 0x46: return "leadout read "; + case 0x47: return "buffer overrun "; + + case 0x53: return "unrecoverable CIRC "; + case 0x57: return "unrecoverable LECC "; + + case 0x60: return "no TOC "; + case 0x61: return "invalid subcode data "; + case 0x63: return "focus on TOC read "; + case 0x64: return "frame sync on TOC read "; + case 0x65: return "TOC data "; + + case 0x70: return "hardware failure "; + case 0x91: return "leadin "; + case 0x92: return "leadout "; + case 0x93: return "data track "; } sprintf(errbuf, "unknown 0x%02x ", err_code); return errbuf; @@ -696,8 +653,7 @@ static int scd_select_speed(struct cdrom_device_info *cdi, int speed) */ static int scd_lock_door(struct cdrom_device_info *cdi, int lock) { - if (lock == 0 && sony_usage == 1) { - /* Unlock the door, only if nobody is using the drive */ + if (lock == 0) { is_auto_eject = 1; } else { is_auto_eject = 0; @@ -1143,10 +1099,9 @@ static void size_to_buf(unsigned int size, unsigned char *buf) operation if the requested sector is not the next one from the drive. */ static int -start_request(unsigned int sector, unsigned int nsect, int read_nsect_only) +start_request(unsigned int sector, unsigned int nsect) { unsigned char params[6]; - unsigned int read_size; unsigned long retry_count; @@ -1154,22 +1109,7 @@ start_request(unsigned int sector, unsigned int nsect, int read_nsect_only) printk("Entering start_request\n"); #endif log_to_msf(sector, params); - /* If requested, read exactly what was asked. */ - if (read_nsect_only) { - read_size = nsect; - } - /* - * If the full read-ahead would go beyond the end of the media, trim - * it back to read just till the end of the media. - */ - else if ((sector + nsect) >= sony_toc.lead_out_start_lba) { - read_size = sony_toc.lead_out_start_lba - sector; - } - /* Read the full readahead amount. */ - else { - read_size = CDU31A_READAHEAD / 4; - } - size_to_buf(read_size, ¶ms[3]); + size_to_buf(nsect, ¶ms[3]); /* * Clear any outstanding attentions and wait for the drive to @@ -1198,10 +1138,8 @@ start_request(unsigned int sector, unsigned int nsect, int read_nsect_only) write_params(params, 6); write_cmd(SONY_READ_BLKERR_STAT_CMD); - sony_blocks_left = read_size * 4; + sony_blocks_left = nsect * 4; sony_next_block = sector * 4; - readahead_dataleft = 0; - readahead_bad = 0; #if DEBUG printk("Leaving start_request at %d\n", __LINE__); #endif @@ -1212,8 +1150,7 @@ start_request(unsigned int sector, unsigned int nsect, int read_nsect_only) #endif } -/* Abort a pending read operation. Clear all the drive status and - readahead variables. */ +/* Abort a pending read operation. Clear all the drive status variables. */ static void abort_read(void) { unsigned char result_reg[2]; @@ -1238,8 +1175,6 @@ static void abort_read(void) } sony_blocks_left = 0; - readahead_dataleft = 0; - readahead_bad = 0; } /* Called when the timer times out. This will abort the @@ -1264,8 +1199,6 @@ static void handle_abort_timeout(unsigned long data) write_cmd(SONY_ABORT_CMD); sony_blocks_left = 0; - readahead_dataleft = 0; - readahead_bad = 0; abort_read_started = 1; } restore_flags(flags); @@ -1274,60 +1207,30 @@ static void handle_abort_timeout(unsigned long data) #endif } -/* Actually get data and status from the drive. */ +/* Actually get one sector of data from the drive. */ static void -input_data(char *buffer, - unsigned int bytesleft, - unsigned int nblocks, unsigned int offset, unsigned int skip) +input_data_sector(char *buffer) { - int i; - volatile unsigned char val; - - #if DEBUG - printk("Entering input_data\n"); + printk("Entering input_data_sector\n"); #endif + /* If an XA disk on a CDU31A, skip the first 12 bytes of data from - the disk. The real data is after that. */ - if (sony_xa_mode) { - for (i = 0; i < CD_XA_HEAD; i++) { - val = read_data_register(); - } - } + the disk. The real data is after that. We can use audio_buffer. */ + if (sony_xa_mode) + insb(sony_cd_read_reg, audio_buffer, CD_XA_HEAD); clear_data_ready(); - if (bytesleft == 2048) { /* 2048 byte direct buffer transfer */ - insb(sony_cd_read_reg, buffer, 2048); - readahead_dataleft = 0; - } else { - /* If the input read did not align with the beginning of the block, - skip the necessary bytes. */ - if (skip != 0) { - insb(sony_cd_read_reg, readahead_buffer, skip); - } - - /* Get the data into the buffer. */ - insb(sony_cd_read_reg, &buffer[offset], bytesleft); - - /* Get the rest of the data into the readahead buffer at the - proper location. */ - readahead_dataleft = (2048 - skip) - bytesleft; - insb(sony_cd_read_reg, - readahead_buffer + bytesleft, readahead_dataleft); - } - sony_blocks_left -= nblocks; - sony_next_block += nblocks; + insb(sony_cd_read_reg, buffer, 2048); /* If an XA disk, we have to clear out the rest of the unused - error correction data. */ - if (sony_xa_mode) { - for (i = 0; i < CD_XA_TAIL; i++) { - val = read_data_register(); - } - } + error correction data. We can use audio_buffer for that. */ + if (sony_xa_mode) + insb(sony_cd_read_reg, audio_buffer, CD_XA_TAIL); + #if DEBUG - printk("Leaving input_data at %d\n", __LINE__); + printk("Leaving input_data_sector\n"); #endif } @@ -1339,10 +1242,6 @@ read_data_block(char *buffer, unsigned char res_reg[], int *res_size) { unsigned long retry_count; - unsigned int bytesleft; - unsigned int offset; - unsigned int skip; - #if DEBUG printk("Entering read_data_block\n"); @@ -1351,67 +1250,6 @@ read_data_block(char *buffer, res_reg[0] = 0; res_reg[1] = 0; *res_size = 0; - bytesleft = nblocks * 512; - offset = 0; - - /* If the data in the read-ahead does not match the block offset, - then fix things up. */ - if (((block % 4) * 512) != ((2048 - readahead_dataleft) % 2048)) { - sony_next_block += block % 4; - sony_blocks_left -= block % 4; - skip = (block % 4) * 512; - } else { - skip = 0; - } - - /* We have readahead data in the buffer, get that first before we - decide if a read is necessary. */ - if (readahead_dataleft != 0) { - if (bytesleft > readahead_dataleft) { - /* The readahead will not fill the requested buffer, but - get the data out of the readahead into the buffer. */ - memcpy(buffer, - readahead_buffer + (2048 - - readahead_dataleft), - readahead_dataleft); - bytesleft -= readahead_dataleft; - offset += readahead_dataleft; - readahead_dataleft = 0; - } else { - /* The readahead will fill the whole buffer, get the data - and return. */ - memcpy(buffer, - readahead_buffer + (2048 - - readahead_dataleft), - bytesleft); - readahead_dataleft -= bytesleft; - bytesleft = 0; - sony_blocks_left -= nblocks; - sony_next_block += nblocks; - - /* If the data in the readahead is bad, return an error so the - driver will abort the buffer. */ - if (readahead_bad) { - res_reg[0] = 0x20; - res_reg[1] = SONY_BAD_DATA_ERR; - *res_size = 2; - } - - if (readahead_dataleft == 0) { - readahead_bad = 0; - } - - /* Final transfer is done for read command, get final result. */ - if (sony_blocks_left == 0) { - get_result(res_reg, res_size); - } -#if DEBUG - printk("Leaving read_data_block at %d\n", - __LINE__); -#endif - return; - } - } /* Wait for the drive to tell us we have something */ retry_count = jiffies + SONY_JIFFIES_TIMEOUT; @@ -1442,7 +1280,9 @@ read_data_block(char *buffer, abort_read(); } } else { - input_data(buffer, bytesleft, nblocks, offset, skip); + input_data_sector(buffer); + sony_blocks_left -= nblocks; + sony_next_block += nblocks; /* Wait for the status from the drive. */ retry_count = jiffies + SONY_JIFFIES_TIMEOUT; @@ -1473,16 +1313,7 @@ read_data_block(char *buffer, SONY_NO_LECC_ERR_BLK_STAT) || (res_reg[0] == SONY_RECOV_LECC_ERR_BLK_STAT)) { - /* The data was successful, but if data was read from - the readahead and it was bad, set the whole - buffer as bad. */ - if (readahead_bad) { - readahead_bad = 0; - res_reg[0] = 0x20; - res_reg[1] = - SONY_BAD_DATA_ERR; - *res_size = 2; - } + /* nothing here */ } else { printk ("CDU31A: Data block error: 0x%x\n", @@ -1490,12 +1321,6 @@ read_data_block(char *buffer, res_reg[0] = 0x20; res_reg[1] = SONY_BAD_DATA_ERR; *res_size = 2; - - /* Data is in the readahead buffer but an error was returned. - Make sure future requests don't use the data. */ - if (bytesleft != 2048) { - readahead_bad = 1; - } } /* Final transfer is done for read command, get final result. */ @@ -1531,11 +1356,9 @@ read_data_block(char *buffer, static void do_cdu31a_request(request_queue_t * q) { struct request *req; - int block; - int nblock; + int block, nblock, num_retries; unsigned char res_reg[12]; unsigned int res_size; - int num_retries; unsigned long flags; @@ -1591,7 +1414,10 @@ static void do_cdu31a_request(request_queue_t * q) block = req->sector; nblock = req->nr_sectors; - +#if DEBUG + printk("CDU31A: request at block %d, length %d blocks\n", + block, nblock); +#endif if (!sony_toc_read) { printk("CDU31A: TOC not read\n"); end_request(req, 0); @@ -1611,17 +1437,14 @@ static void do_cdu31a_request(request_queue_t * q) * If the block address is invalid or the request goes beyond the end of * the media, return an error. */ - if ((block / 4) >= sony_toc.lead_out_start_lba) { - printk("CDU31A: Request past end of media\n"); - end_request(req, 0); - continue; - } if (((block + nblock) / 4) >= sony_toc.lead_out_start_lba) { printk("CDU31A: Request past end of media\n"); end_request(req, 0); continue; } + if (nblock > 4) + nblock = 4; num_retries = 0; try_read_again: @@ -1636,7 +1459,7 @@ static void do_cdu31a_request(request_queue_t * q) /* If no data is left to be read from the drive, start the next request. */ if (sony_blocks_left == 0) { - if (start_request(block / 4, CDU31A_READAHEAD / 4, 0)) { + if (start_request(block / 4, nblock / 4)) { end_request(req, 0); continue; } @@ -1655,7 +1478,7 @@ static void do_cdu31a_request(request_queue_t * q) end_request(req, 0); continue; } - if (start_request(block / 4, CDU31A_READAHEAD / 4, 0)) { + if (start_request(block / 4, nblock / 4)) { printk("CDU31a: start request failed\n"); end_request(req, 0); continue; @@ -1665,7 +1488,12 @@ static void do_cdu31a_request(request_queue_t * q) read_data_block(req->buffer, block, nblock, res_reg, &res_size); if (res_reg[0] != 0x20) { - end_request(req, 1); + if (!end_that_request_first(req, 1, nblock)) { + spin_lock_irq(q->queue_lock); + blkdev_dequeue_request(req); + end_that_request_last(req); + spin_unlock_irq(q->queue_lock); + } continue; } @@ -1774,7 +1602,7 @@ static void sony_get_toc(void) /* This seems to slow things down enough to make it work. This * appears to be a problem in do_sony_cd_cmd. This printk seems * to address the symptoms... -Erik */ -#if 1 +#if DEBUG printk("cdu31a: Trying session %d\n", session); #endif parms[0] = session; @@ -2529,8 +2357,7 @@ static int read_audio(struct cdrom_read_audio *ra) return. */ retval = 0; - /* start_request clears out any readahead data, so it should be safe. */ - if (start_request(ra->addr.lba, ra->nframes, 1)) { + if (start_request(ra->addr.lba, ra->nframes)) { retval = -EIO; goto exit_read_audio; } @@ -2538,7 +2365,7 @@ static int read_audio(struct cdrom_read_audio *ra) /* For every requested frame. */ cframe = 0; while (cframe < ra->nframes) { - read_audio_data(readahead_buffer, res_reg, &res_size); + read_audio_data(audio_buffer, res_reg, &res_size); if ((res_reg[0] & 0xf0) == 0x20) { if (res_reg[1] == SONY_BAD_DATA_ERR) { printk @@ -2567,7 +2394,7 @@ static int read_audio(struct cdrom_read_audio *ra) /* Restart the request on the current frame. */ if (start_request (ra->addr.lba + cframe, - ra->nframes - cframe, 1)) { + ra->nframes - cframe)) { retval = -EIO; goto exit_read_audio; } @@ -2575,7 +2402,7 @@ static int read_audio(struct cdrom_read_audio *ra) /* Don't go back to the top because don't want to get into and infinite loop. A lot of code gets duplicated, but that's no big deal, I don't guess. */ - read_audio_data(readahead_buffer, res_reg, + read_audio_data(audio_buffer, res_reg, &res_size); if ((res_reg[0] & 0xf0) == 0x20) { if (res_reg[1] == @@ -2596,7 +2423,7 @@ static int read_audio(struct cdrom_read_audio *ra) } else if (copy_to_user(ra->buf + (CD_FRAMESIZE_RAW * cframe), - readahead_buffer, + audio_buffer, CD_FRAMESIZE_RAW)) { retval = -EFAULT; goto exit_read_audio; @@ -2610,7 +2437,7 @@ static int read_audio(struct cdrom_read_audio *ra) goto exit_read_audio; } } else if (copy_to_user(ra->buf + (CD_FRAMESIZE_RAW * cframe), - (char *)readahead_buffer, + (char *)audio_buffer, CD_FRAMESIZE_RAW)) { retval = -EFAULT; goto exit_read_audio; @@ -3061,12 +2888,18 @@ static int scd_spinup(void) * Open the drive for operations. Spin the drive up and read the table of * contents if these have not already been done. */ -static int scd_open(struct cdrom_device_info *cdi, int openmode) +static int scd_open(struct cdrom_device_info *cdi, int purpose) { unsigned char res_reg[12]; unsigned int res_size; unsigned char params[2]; + if (purpose == 1) { + /* Open for IOCTLs only - no media check */ + sony_usage++; + return 0; + } + if (sony_usage == 0) { if (scd_spinup() != 0) return -EIO; @@ -3151,8 +2984,7 @@ static struct cdrom_device_ops scd_dops = { .dev_ioctl = scd_dev_ioctl, .capability = CDC_OPEN_TRAY | CDC_CLOSE_TRAY | CDC_LOCK | CDC_SELECT_SPEED | CDC_MULTI_SESSION | - CDC_MULTI_SESSION | CDC_MCN | - CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | + CDC_MCN | CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET | CDC_IOCTLS | CDC_DRIVE_STATUS, .n_minors = 1, }; @@ -3177,7 +3009,19 @@ static int scd_block_release(struct inode *inode, struct file *file) static int scd_block_ioctl(struct inode *inode, struct file *file, unsigned cmd, unsigned long arg) { - return cdrom_ioctl(file, &scd_info, inode, cmd, arg); + /* The eject and close commands should be handled by Uniform CD-ROM + * driver - but I always got hard lockup instead of eject + * until I put this here. + */ + switch (cmd) { + case CDROMEJECT: + scd_lock_door(&scd_info, 0); + return scd_tray_move(&scd_info, 1); + case CDROMCLOSETRAY: + return scd_tray_move(&scd_info, 0); + default: + return cdrom_ioctl(file, &scd_info, inode, cmd, arg); + } } static int scd_block_media_changed(struct gendisk *disk) @@ -3372,6 +3216,7 @@ int __init cdu31a_init(void) tmp_irq = cdu31a_irq; /* Need IRQ 0 because we can't sleep here. */ cdu31a_irq = 0; + sony_speed = is_double_speed; /* Set 2X drives to 2X by default */ set_drive_params(sony_speed); cdu31a_irq = tmp_irq; @@ -3417,13 +3262,12 @@ int __init cdu31a_init(void) strcat(msg, buf); } strcat(msg, "\n"); - - is_a_cdu31a = - strcmp("CD-ROM CDU31A", drive_config.product_id) == 0; - + printk("%s",msg); + cdu31a_queue = blk_init_queue(do_cdu31a_request, &cdu31a_lock); if (!cdu31a_queue) goto errout0; + blk_queue_hardsect_size(cdu31a_queue, 2048); init_timer(&cdu31a_abort_timer); cdu31a_abort_timer.function = handle_abort_timeout; diff --git a/drivers/cdrom/cdu31a.h b/drivers/cdrom/cdu31a.h index a04d0b3a2..61d4768c4 100644 --- a/drivers/cdrom/cdu31a.h +++ b/drivers/cdrom/cdu31a.h @@ -72,10 +72,10 @@ from drive (in 1/100th's of seconds). */ -#define SONY_JIFFIES_TIMEOUT 1000 /* Maximum number of times the +#define SONY_JIFFIES_TIMEOUT (10*HZ) /* Maximum number of times the drive will wait/try for an operation */ -#define SONY_RESET_TIMEOUT 100 /* Maximum number of times the +#define SONY_RESET_TIMEOUT HZ /* Maximum number of times the drive will wait/try a reset operation */ #define SONY_READY_RETRIES 20000 /* How many times to retry a diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index ccd260362..da80b1433 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -302,7 +302,7 @@ struct cm206_struct { static struct cm206_struct *cd; /* the main memory structure */ static struct request_queue *cm206_queue; -static spinlock_t cm206_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cm206_lock); /* First, we define some polling functions. These are actually only being used in the initialization. */ diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c index a89cc98c1..7eac10e63 100644 --- a/drivers/cdrom/gscd.c +++ b/drivers/cdrom/gscd.c @@ -70,7 +70,6 @@ #define MAJOR_NR GOLDSTAR_CDROM_MAJOR #include -#define gscd_port gscd /* for compatible parameter passing with "insmod" */ #include "gscd.h" static int gscdPresent = 0; @@ -78,7 +77,7 @@ static int gscdPresent = 0; static unsigned char gscd_buf[2048]; /* buffer for block size conversion */ static int gscd_bn = -1; static short gscd_port = GSCD_BASE_ADDR; -MODULE_PARM(gscd, "h"); +module_param_named(gscd, gscd_port, short, 0); /* Kommt spaeter vielleicht noch mal dran ... * static DECLARE_WAIT_QUEUE_HEAD(gscd_waitq); @@ -148,7 +147,7 @@ static int AudioEnd_m; static int AudioEnd_f; static struct timer_list gscd_timer = TIMER_INITIALIZER(NULL, 0, 0); -static spinlock_t gscd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(gscd_lock); static struct request_queue *gscd_queue; static struct block_device_operations gscd_fops = { diff --git a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c index ff89164bc..8e68d858c 100644 --- a/drivers/cdrom/isp16.c +++ b/drivers/cdrom/isp16.c @@ -72,14 +72,10 @@ static int isp16_cdrom_irq = ISP16_CDROM_IRQ; static int isp16_cdrom_dma = ISP16_CDROM_DMA; static char *isp16_cdrom_type = ISP16_CDROM_TYPE; -MODULE_PARM(isp16_cdrom_base, "i"); -MODULE_PARM(isp16_cdrom_irq, "i"); -MODULE_PARM(isp16_cdrom_dma, "i"); -MODULE_PARM(isp16_cdrom_type, "s"); - -#ifdef MODULE -void isp16_exit(void); -#endif +module_param(isp16_cdrom_base, int, 0); +module_param(isp16_cdrom_irq, int, 0); +module_param(isp16_cdrom_dma, int, 0); +module_param(isp16_cdrom_type, charp, 0); #define ISP16_IN(p) (outb(isp16_ctrl,ISP16_CTRL_PORT), inb(p)) #define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p)) @@ -112,7 +108,7 @@ __setup("isp16=", isp16_setup); * ISP16 initialisation. * */ -int __init isp16_init(void) +static int __init isp16_init(void) { u_char expected_drive; @@ -366,15 +362,13 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma) return 0; } -void __exit isp16_exit(void) +static void __exit isp16_exit(void) { release_region(ISP16_IO_BASE, ISP16_IO_SIZE); printk(KERN_INFO "ISP16: module released.\n"); } -#ifdef MODULE module_init(isp16_init); -#endif module_exit(isp16_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/cdrom/isp16.h b/drivers/cdrom/isp16.h index 7fc74b8e4..5bd22c8f7 100644 --- a/drivers/cdrom/isp16.h +++ b/drivers/cdrom/isp16.h @@ -70,5 +70,3 @@ #define ISP16_IO_BASE 0xF8D #define ISP16_IO_SIZE 5 /* ports used from 0xF8D up to 0xF91 */ - -int isp16_init(void); diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c index b4f5e0295..55db09b9c 100644 --- a/drivers/cdrom/mcd.c +++ b/drivers/cdrom/mcd.c @@ -103,7 +103,6 @@ #include #include -#define mcd_port mcd /* for compatible parameter passing with "insmod" */ #include "mcd.h" /* I added A flag to drop to 1x speed if too many errors 0 = 1X ; 1 = 2X */ @@ -157,7 +156,6 @@ int mitsumi_bug_93_wait; static short mcd_port = CONFIG_MCD_BASE; /* used as "mcd" by "insmod" */ static int mcd_irq = CONFIG_MCD_IRQ; /* must directly follow mcd_port */ -MODULE_PARM(mcd, "1-2i"); static int McdTimeout, McdTries; static DECLARE_WAIT_QUEUE_HEAD(mcd_waitq); @@ -189,7 +187,7 @@ static int mcd_open(struct cdrom_device_info *cdi, int purpose); static void mcd_release(struct cdrom_device_info *cdi); static int mcd_media_changed(struct cdrom_device_info *cdi, int disc_nr); static int mcd_tray_move(struct cdrom_device_info *cdi, int position); -static spinlock_t mcd_spinlock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mcd_spinlock); static int mcd_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg); static int mcd_drive_status(struct cdrom_device_info *cdi, int slot_nr); @@ -246,7 +244,6 @@ static struct block_device_operations mcd_bdops = static struct gendisk *mcd_gendisk; -#ifndef MODULE static int __init mcd_setup(char *str) { int ints[9]; @@ -265,7 +262,14 @@ static int __init mcd_setup(char *str) __setup("mcd=", mcd_setup); -#endif /* MODULE */ +#ifdef MODULE +static int __init param_set_mcd(const char *val, struct kernel_param *kp) +{ + mcd_setup(val); + return 0; +} +module_param_call(mcd, param_set_mcd, NULL, NULL, 0); +#endif static int mcd_media_changed(struct cdrom_device_info *cdi, int disc_nr) { diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 01b4e9a56..ccde7ab49 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -56,7 +56,6 @@ static const char *mcdx_c_version = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $"; #endif -#include #include #include @@ -77,8 +76,6 @@ static const char *mcdx_c_version #include #include -/* for compatible parameter passing with "insmod" */ -#define mcdx_drive_map mcdx #include "mcdx.h" #ifndef HZ @@ -307,9 +304,16 @@ static int mcdx_setattentuator(struct s_drive_stuff *, static int mcdx_drive_map[][2] = MCDX_DRIVEMAP; static struct s_drive_stuff *mcdx_stuffp[MCDX_NDRIVES]; -static spinlock_t mcdx_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mcdx_lock); static struct request_queue *mcdx_queue; -MODULE_PARM(mcdx, "1-4i"); + +/* You can only set the first two pairs, from old MODULE_PARM code. */ +static int mcdx_set(const char *val, struct kernel_param *kp) +{ + get_options((char *)val, 4, (int *)mcdx_drive_map); + return 0; +} +module_param_call(mcdx, mcdx_set, NULL, NULL, 0); static struct cdrom_device_ops mcdx_dops = { .open = mcdx_open, @@ -1260,11 +1264,7 @@ int __init mcdx_init_drive(int drive) int __init mcdx_init(void) { int drive; -#ifdef MODULE - xwarn("Version 2.14(hs) for " UTS_RELEASE "\n"); -#else xwarn("Version 2.14(hs) \n"); -#endif xwarn("$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $\n"); diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index caaeb724a..7e69c5456 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c @@ -116,7 +116,7 @@ static void debug(int debug_this, const char* fmt, ...) #define optcd_port optcd /* Needed for the modutils. */ static short optcd_port = OPTCD_PORTBASE; /* I/O base of drive. */ -MODULE_PARM(optcd_port, "h"); +module_param(optcd_port, short, 0); /* Drive registers, read */ #define DATA_PORT optcd_port /* Read data/status */ #define STATUS_PORT optcd_port+1 /* Indicate data/status availability */ @@ -265,7 +265,7 @@ static int sleep_timeout; /* max # of ticks to sleep */ static DECLARE_WAIT_QUEUE_HEAD(waitq); static void sleep_timer(unsigned long data); static struct timer_list delay_timer = TIMER_INITIALIZER(sleep_timer, 0, 0); -static spinlock_t optcd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(optcd_lock); static struct request_queue *opt_queue; /* Timer routine: wake up when desired flag goes low, diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 884674959..31e563f97 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -461,7 +461,7 @@ static int sbpcd[] = /* * Protects access to global structures etc. */ -static spinlock_t sbpcd_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(sbpcd_lock); static struct request_queue *sbpcd_queue; MODULE_PARM(sbpcd, "2i"); @@ -1161,11 +1161,11 @@ static void EvaluateStatus(int st) return; } /*==========================================================================*/ +static int cmd_out_T(void); + static int get_state_T(void) { int i; - - static int cmd_out_T(void); clr_cmdbuf(); current_drive->n_bytes=1; @@ -1308,13 +1308,14 @@ static int cc_ReadError(void) return (i); } /*==========================================================================*/ +static int cc_DriveReset(void); + static int cmd_out_T(void) { #undef CMDT_TRIES #define CMDT_TRIES 1000 #define TEST_FALSE_FF 1 - - static int cc_DriveReset(void); + int i, j, l=0, m, ntries; unsigned long flags; diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index 0e60b5c6a..f444b2548 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c @@ -107,7 +107,7 @@ static volatile unsigned char sjcd_completion_status = 0; static volatile unsigned char sjcd_completion_error = 0; static unsigned short sjcd_command_is_in_progress = 0; static unsigned short sjcd_error_reported = 0; -static spinlock_t sjcd_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sjcd_lock); static int sjcd_open_count; @@ -116,7 +116,7 @@ static struct sjcd_play_msf sjcd_playing; static int sjcd_base = SJCD_BASE_ADDR; -MODULE_PARM(sjcd_base, "i"); +module_param(sjcd_base, int, 0); static DECLARE_WAIT_QUEUE_HEAD(sjcd_waitq); diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index a0c9c8d42..f4be7bfd6 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -210,7 +210,7 @@ static int do_sony_cmd(Byte * cmd, int nCmd, Byte status[2], /* The base I/O address of the Sony Interface. This is a variable (not a #define) so it can be easily changed via some future ioctl() */ static unsigned int sony535_cd_base_io = CDU535_ADDRESS; -MODULE_PARM(sony535_cd_base_io, "i"); +module_param(sony535_cd_base_io, int, 0); /* * The following are I/O addresses of the various registers for the drive. The @@ -222,7 +222,7 @@ static unsigned short command_reg; static unsigned short read_status_reg; static unsigned short data_reg; -static spinlock_t sonycd535_lock = SPIN_LOCK_UNLOCKED; /* queue lock */ +static DEFINE_SPINLOCK(sonycd535_lock); /* queue lock */ static struct request_queue *sonycd535_queue; static int initialized; /* Has the drive been initialized? */ diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 0509ae21e..fcca26c89 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -154,7 +154,6 @@ static struct disk_info viocd_diskinfo[VIOCD_MAX_CD]; #define DEVICE_NR(di) ((di) - &viocd_diskinfo[0]) -static request_queue_t *viocd_queue; static spinlock_t viocd_reqlock; #define MAX_CD_REQ 1 @@ -503,6 +502,18 @@ static int viocd_packet(struct cdrom_device_info *cdi, return ret; } +static void restart_all_queues(int first_index) +{ + int i; + + for (i = first_index + 1; i < viocd_numdev; i++) + if (viocd_diskinfo[i].viocd_disk) + blk_run_queue(viocd_diskinfo[i].viocd_disk->queue); + for (i = 0; i <= first_index; i++) + if (viocd_diskinfo[i].viocd_disk) + blk_run_queue(viocd_diskinfo[i].viocd_disk->queue); +} + /* This routine handles incoming CD LP events */ static void vio_handle_cd_event(struct HvLpEvent *event) { @@ -532,7 +543,7 @@ static void vio_handle_cd_event(struct HvLpEvent *event) case viocdopen: if (event->xRc == 0) { di = &viocd_diskinfo[bevent->disk]; - blk_queue_hardsect_size(viocd_queue, + blk_queue_hardsect_size(di->viocd_disk->queue, bevent->block_size); set_capacity(di->viocd_disk, bevent->media_size * @@ -584,7 +595,7 @@ return_complete: /* restart handling of incoming requests */ spin_unlock_irqrestore(&viocd_reqlock, flags); - blk_run_queue(viocd_queue); + restart_all_queues(bevent->disk); break; default: @@ -624,6 +635,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id) struct disk_info *d; struct cdrom_device_info *c; struct cdrom_info *ci; + struct request_queue *q; deviceno = vdev->unit_address; if (deviceno >= viocd_numdev) @@ -643,17 +655,22 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (register_cdrom(c) != 0) { printk(VIOCD_KERN_WARNING "Cannot register viocd CD-ROM %s!\n", c->name); - return 0; + goto out; } printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s " "type %4.4s, model %3.3s\n", c->name, ci->rsrcname, ci->type, ci->model); + q = blk_init_queue(do_viocd_request, &viocd_reqlock); + if (q == NULL) { + printk(VIOCD_KERN_WARNING "Cannot allocate queue for %s!\n", + c->name); + goto out_unregister_cdrom; + } gendisk = alloc_disk(1); if (gendisk == NULL) { printk(VIOCD_KERN_WARNING "Cannot create gendisk for %s!\n", c->name); - unregister_cdrom(c); - return 0; + goto out_cleanup_queue; } gendisk->major = VIOCD_MAJOR; gendisk->first_minor = deviceno; @@ -661,7 +678,10 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id) sizeof(gendisk->disk_name)); snprintf(gendisk->devfs_name, sizeof(gendisk->devfs_name), VIOCD_DEVICE_DEVFS "%d", deviceno); - gendisk->queue = viocd_queue; + blk_queue_max_hw_segments(q, 1); + blk_queue_max_phys_segments(q, 1); + blk_queue_max_sectors(q, 4096 / 512); + gendisk->queue = q; gendisk->fops = &viocd_fops; gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE; set_capacity(gendisk, 0); @@ -670,8 +690,14 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id) d->dev = &vdev->dev; gendisk->driverfs_dev = d->dev; add_disk(gendisk); - return 0; + +out_cleanup_queue: + blk_cleanup_queue(q); +out_unregister_cdrom: + unregister_cdrom(c); +out: + return -ENODEV; } static int viocd_remove(struct vio_dev *vdev) @@ -683,6 +709,7 @@ static int viocd_remove(struct vio_dev *vdev) "Cannot unregister viocd CD-ROM %s!\n", d->viocd_info.name); del_gendisk(d->viocd_disk); + blk_cleanup_queue(d->viocd_disk->queue); put_disk(d->viocd_disk); return 0; } @@ -738,22 +765,12 @@ static int __init viocd_init(void) vio_setHandler(viomajorsubtype_cdio, vio_handle_cd_event); get_viocd_info(); - if (viocd_numdev == 0) - goto out_undo_vio; spin_lock_init(&viocd_reqlock); - viocd_queue = blk_init_queue(do_viocd_request, &viocd_reqlock); - if (viocd_queue == NULL) { - ret = -ENOMEM; - goto out_free_info; - } - blk_queue_max_hw_segments(viocd_queue, 1); - blk_queue_max_phys_segments(viocd_queue, 1); - blk_queue_max_sectors(viocd_queue, 4096 / 512); ret = vio_register_driver(&viocd_driver); if (ret) - goto out_cleanup_queue; + goto out_free_info; e = create_proc_entry("iSeries/viocd", S_IFREG|S_IRUGO, NULL); if (e) { @@ -763,13 +780,10 @@ static int __init viocd_init(void) return 0; -out_cleanup_queue: - blk_cleanup_queue(viocd_queue); out_free_info: dma_free_coherent(iSeries_vio_dev, sizeof(*viocd_unitinfo) * VIOCD_MAX_CD, viocd_unitinfo, unitinfo_dmaaddr); -out_undo_vio: vio_clearHandler(viomajorsubtype_cdio); viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2); out_unregister: @@ -781,7 +795,6 @@ static void __exit viocd_exit(void) { remove_proc_entry("iSeries/viocd", NULL); vio_unregister_driver(&viocd_driver); - blk_cleanup_queue(viocd_queue); if (viocd_unitinfo != NULL) dma_free_coherent(iSeries_vio_dev, sizeof(*viocd_unitinfo) * VIOCD_MAX_CD, diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index f7bfe2059..e2579ef90 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -192,7 +192,7 @@ config MOXA_INTELLIO config MOXA_SMARTIO tristate "Moxa SmartIO support" - depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP + depends on SERIAL_NONSTANDARD help Say Y here if you have a Moxa SmartIO multiport serial card. @@ -203,7 +203,7 @@ config MOXA_SMARTIO config ISI tristate "Multi-Tech multiport card support (EXPERIMENTAL)" - depends on SERIAL_NONSTANDARD && PCI && EXPERIMENTAL && BROKEN_ON_SMP && m + depends on SERIAL_NONSTANDARD help This is a driver for the Multi-Tech cards which provide several serial ports. The driver is experimental and can currently only be @@ -348,22 +348,6 @@ config ISTALLION To compile this driver as a module, choose M here: the module will be called istallion. -config SERIAL_TX3912 - bool "TX3912/PR31700 serial port support" - depends on SERIAL_NONSTANDARD && MIPS && BROKEN_ON_SMP - help - The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core; - see . - Say Y here to enable kernel support for the on-board serial port. - -config SERIAL_TX3912_CONSOLE - bool "Console on TX3912/PR31700 serial port" - depends on SERIAL_TX3912 - help - The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core; - see . - Say Y here to direct console I/O to the on-board serial port. - config AU1000_UART bool "Enable Au1000 UART Support" depends on SERIAL_NONSTANDARD && MIPS @@ -478,6 +462,7 @@ config LEGACY_PTYS config LEGACY_PTY_COUNT int "Maximum number of legacy PTY in use" depends on LEGACY_PTYS + range 1 256 default "256" ---help--- The maximum number of legacy PTYs that can be used at any one time. @@ -780,6 +765,23 @@ config EFI_RTC bool "EFI Real Time Clock Services" depends on IA64 +config DS1302 + tristate "DS1302 RTC support" + depends on M32R && (PLAT_M32700UT || PLAT_OPSPUT) + help + If you say Y here and create a character special file /dev/rtc with + major number 121 and minor number 0 using mknod ("man mknod"), you + will get access to the real time clock (or hardware clock) built + into your computer. + +config S3C2410_RTC + bool "S3C2410 RTC Driver" + depends on ARCH_S3C2410 + help + RTC (Realtime Clock) driver for the clock inbuilt into the + Samsung S3C2410. This can provide periodic interrupt rates + from 1Hz to 64Hz for user programs, and wakeup from Alarm. + config COBALT_LCD bool "Support for Cobalt LCD" depends on MIPS_COBALT @@ -826,7 +828,7 @@ config APPLICOM config SONYPI tristate "Sony Vaio Programmable I/O Control Device support (EXPERIMENTAL)" - depends on EXPERIMENTAL && X86 && PCI && !64BIT + depends on EXPERIMENTAL && X86 && PCI && INPUT && !64BIT ---help--- This driver enables access to the Sony Programmable I/O Control Device which can be found in many (all ?) Sony Vaio laptops. diff --git a/drivers/char/Makefile b/drivers/char/Makefile index c95223457..a68bd73db 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -20,7 +20,6 @@ obj-$(CONFIG_ESPSERIAL) += esp.o obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o -obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o obj-$(CONFIG_ROCKETPORT) += rocket.o obj-$(CONFIG_SERIAL167) += serial167.o obj-$(CONFIG_CYCLADES) += cyclades.o @@ -63,6 +62,8 @@ obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_SGI_DS1286) += ds1286.o obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o +obj-$(CONFIG_DS1302) += ds1302.o +obj-$(CONFIG_S3C2410_RTC) += s3c2410-rtc.o ifeq ($(CONFIG_GENERIC_NVRAM),y) obj-$(CONFIG_NVRAM) += generic_nvram.o else diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index d9b4a6e7f..4e673b0d6 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig @@ -1,5 +1,6 @@ config AGP - tristate "/dev/agpgart (AGP Support)" if !GART_IOMMU && !M68K && !ARM + tristate "/dev/agpgart (AGP Support)" if !GART_IOMMU + depends on ALPHA || IA64 || PPC32 || X86 default y if GART_IOMMU ---help--- AGP (Accelerated Graphics Port) is a bus system mainly used to @@ -144,7 +145,7 @@ config AGP_I460 config AGP_HP_ZX1 tristate "HP ZX1 chipset AGP support" - depends on AGP && (IA64_HP_ZX1 || IA64_GENERIC) + depends on AGP && (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC) help This option gives you AGP GART support for the HP ZX1 chipset for IA64 processors. diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index f83e3e342..aaa2df812 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h @@ -141,16 +141,6 @@ struct agp_bridge_data { char minor_version; }; -#define OUTREG64(mmap, addr, val) __raw_writeq((val), (mmap)+(addr)) -#define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr)) -#define OUTREG16(mmap, addr, val) __raw_writew((val), (mmap)+(addr)) -#define OUTREG8(mmap, addr, val) __raw_writeb((val), (mmap)+(addr)) - -#define INREG64(mmap, addr) __raw_readq((mmap)+(addr)) -#define INREG32(mmap, addr) __raw_readl((mmap)+(addr)) -#define INREG16(mmap, addr) __raw_readw((mmap)+(addr)) -#define INREG8(mmap, addr) __raw_readb((mmap)+(addr)) - #define KB(x) ((x) * 1024) #define MB(x) (KB (KB (x))) #define GB(x) (MB (KB (x))) diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index 005b82019..d5bce320e 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c @@ -277,6 +277,15 @@ static struct agp_device_ids ali_agp_device_ids[] __devinitdata = .device_id = PCI_DEVICE_ID_AL_M1671, .chipset_name = "M1671", }, + { + .device_id = PCI_DEVICE_ID_AL_M1681, + .chipset_name = "M1681", + }, + { + .device_id = PCI_DEVICE_ID_AL_M1683, + .chipset_name = "M1683", + }, + { }, /* dummy final entry, always present */ }; @@ -387,6 +396,8 @@ static struct pci_driver agp_ali_pci_driver = { static int __init agp_ali_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_ali_pci_driver); } diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c index edca77d1d..8b7ed6b86 100644 --- a/drivers/char/agp/alpha-agp.c +++ b/drivers/char/agp/alpha-agp.c @@ -195,6 +195,8 @@ alpha_core_agp_setup(void) static int __init agp_alpha_core_init(void) { + if (agp_off) + return -EINVAL; if (alpha_mv.agp_info) return alpha_core_agp_setup(); return -ENODEV; diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index a45d36c3b..52c25243e 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -53,8 +53,10 @@ static int amd_create_page_map(struct amd_page_map *page_map) } global_cache_flush(); - for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) + for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { writel(agp_bridge->scratch_page, page_map->remapped+i); + readl(page_map->remapped+i); /* PCI Posting. */ + } return 0; } @@ -167,6 +169,7 @@ static int amd_create_gatt_table(void) for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, page_dir.remapped+GET_PAGE_DIR_OFF(addr)); + readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ } return 0; @@ -220,8 +223,8 @@ static int amd_irongate_configure(void) amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); /* Write out the address of the gatt table */ - OUTREG32(amd_irongate_private.registers, AMD_ATTBASE, - agp_bridge->gatt_bus_addr); + writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE); + readl(amd_irongate_private.registers+AMD_ATTBASE); /* PCI Posting. */ /* Write the Sync register */ pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL, 0x80); @@ -230,19 +233,19 @@ static int amd_irongate_configure(void) pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL2, 0x00); /* Write the enable register */ - enable_reg = INREG16(amd_irongate_private.registers, AMD_GARTENABLE); + enable_reg = readw(amd_irongate_private.registers+AMD_GARTENABLE); enable_reg = (enable_reg | 0x0004); - OUTREG16(amd_irongate_private.registers, AMD_GARTENABLE, enable_reg); + writew(enable_reg, amd_irongate_private.registers+AMD_GARTENABLE); + readw(amd_irongate_private.registers+AMD_GARTENABLE); /* PCI Posting. */ /* Write out the size register */ pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); - temp = (((temp & ~(0x0000000e)) | current_size->size_value) - | 0x00000001); + temp = (((temp & ~(0x0000000e)) | current_size->size_value) | 1); pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); /* Flush the tlb */ - OUTREG32(amd_irongate_private.registers, AMD_TLBFLUSH, 0x00000001); - + writel(1, amd_irongate_private.registers+AMD_TLBFLUSH); + readl(amd_irongate_private.registers+AMD_TLBFLUSH); /* PCI Posting.*/ return 0; } @@ -254,9 +257,10 @@ static void amd_irongate_cleanup(void) previous_size = A_SIZE_LVL2(agp_bridge->previous_size); - enable_reg = INREG16(amd_irongate_private.registers, AMD_GARTENABLE); + enable_reg = readw(amd_irongate_private.registers+AMD_GARTENABLE); enable_reg = (enable_reg & ~(0x0004)); - OUTREG16(amd_irongate_private.registers, AMD_GARTENABLE, enable_reg); + writew(enable_reg, amd_irongate_private.registers+AMD_GARTENABLE); + readw(amd_irongate_private.registers+AMD_GARTENABLE); /* PCI Posting. */ /* Write back the previous size and disable gart translation */ pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); @@ -275,7 +279,8 @@ static void amd_irongate_cleanup(void) static void amd_irongate_tlbflush(struct agp_memory *temp) { - OUTREG32(amd_irongate_private.registers, AMD_TLBFLUSH, 0x00000001); + writel(1, amd_irongate_private.registers+AMD_TLBFLUSH); + readl(amd_irongate_private.registers+AMD_TLBFLUSH); /* PCI Posting. */ } static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) @@ -310,6 +315,7 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); writel(agp_generic_mask_memory(mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr)); + readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */ } amd_irongate_tlbflush(mem); return 0; @@ -328,6 +334,7 @@ static int amd_remove_memory(struct agp_memory *mem, off_t pg_start, int type) addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); + readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */ } amd_irongate_tlbflush(mem); @@ -471,6 +478,8 @@ static struct pci_driver agp_amdk7_pci_driver = { static int __init agp_amdk7_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_amdk7_pci_driver); } diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 2e8b2aee9..eca1c4f7a 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -46,6 +46,11 @@ #define NVIDIA_X86_64_1_APBASE2 0xd8 #define NVIDIA_X86_64_1_APLIMIT2 0xdc +/* ULi K8 registers */ +#define ULI_X86_64_BASE_ADDR 0x10 +#define ULI_X86_64_HTT_FEA_REG 0x50 +#define ULI_X86_64_ENU_SCR_REG 0x54 + static int nr_garts; static struct pci_dev * hammers[MAX_HAMMER_GARTS]; @@ -109,6 +114,7 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type) pte |= GPTE_VALID | GPTE_COHERENT; writel(pte, agp_bridge->gatt_table+j); + readl(agp_bridge->gatt_table+j); /* PCI Posting. */ } amd64_tlbflush(mem); return 0; @@ -355,7 +361,7 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr) int i = 0; /* cache pci_devs of northbridges. */ - while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) + while ((loop_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) != NULL) { if (i == MAX_HAMMER_GARTS) { printk(KERN_ERR PFX "Too many northbridges for AGP\n"); @@ -405,6 +411,61 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data } } + +static struct aper_size_info_32 uli_sizes[7] = +{ + {256, 65536, 6, 10}, + {128, 32768, 5, 9}, + {64, 16384, 4, 8}, + {32, 8192, 3, 7}, + {16, 4096, 2, 6}, + {8, 2048, 1, 4}, + {4, 1024, 0, 3} +}; +static int __devinit uli_agp_init(struct pci_dev *pdev) +{ + u32 httfea,baseaddr,enuscr; + struct pci_dev *dev1; + int i; + unsigned size = amd64_fetch_size(); + printk(KERN_INFO "Setting up ULi AGP. \n"); + dev1 = pci_find_slot ((unsigned int)pdev->bus->number,PCI_DEVFN(0,0)); + if (dev1 == NULL) { + printk(KERN_INFO PFX "Detected a ULi chipset, " + "but could not fine the secondary device.\n"); + return -ENODEV; + } + + for (i = 0; i < ARRAY_SIZE(uli_sizes); i++) + if (uli_sizes[i].size == size) + break; + + if (i == ARRAY_SIZE(uli_sizes)) { + printk(KERN_INFO PFX "No ULi size found for %d\n", size); + return -ENODEV; + } + + /* shadow x86-64 registers into ULi registers */ + pci_read_config_dword (hammers[0], AMD64_GARTAPERTUREBASE, &httfea); + + /* if x86-64 aperture base is beyond 4G, exit here */ + if ((httfea & 0x7fff) >> (32 - 25)) + return -ENODEV; + + httfea = (httfea& 0x7fff) << 25; + + pci_read_config_dword(pdev, ULI_X86_64_BASE_ADDR, &baseaddr); + baseaddr&= ~PCI_BASE_ADDRESS_MEM_MASK; + baseaddr|= httfea; + pci_write_config_dword(pdev, ULI_X86_64_BASE_ADDR, baseaddr); + + enuscr= httfea+ (size * 1024 * 1024) - 1; + pci_write_config_dword(dev1, ULI_X86_64_HTT_FEA_REG, httfea); + pci_write_config_dword(dev1, ULI_X86_64_ENU_SCR_REG, enuscr); + return 0; +} + + static struct aper_size_info_32 nforce3_sizes[5] = { {512, 131072, 7, 0x00000000 }, @@ -513,6 +574,14 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev, } } + if (pdev->vendor == PCI_VENDOR_ID_AL) { + int ret = uli_agp_init(pdev); + if (ret) { + agp_put_bridge(bridge); + return ret; + } + } + pci_set_drvdata(pdev, bridge); return agp_add_bridge(bridge); } @@ -536,6 +605,15 @@ static struct pci_device_id agp_amd64_pci_table[] = { .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, }, + /* ULi M1689 */ + { + .class = (PCI_CLASS_BRIDGE_HOST << 8), + .class_mask = ~0, + .vendor = PCI_VENDOR_ID_AL, + .device = PCI_DEVICE_ID_AL_M1689, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + }, /* VIA K8T800Pro */ { .class = (PCI_CLASS_BRIDGE_HOST << 8), @@ -581,7 +659,6 @@ static struct pci_device_id agp_amd64_pci_table[] = { .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, }, - /* NForce3 */ { .class = (PCI_CLASS_BRIDGE_HOST << 8), @@ -625,6 +702,11 @@ static struct pci_driver agp_amd64_pci_driver = { int __init agp_amd64_init(void) { int err = 0; + static struct pci_device_id amd64nb[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) }, + { }, + }; + if (agp_off) return -EINVAL; if (pci_module_init(&agp_amd64_pci_driver) > 0) { @@ -640,13 +722,13 @@ int __init agp_amd64_init(void) } /* First check that we have at least one AMD64 NB */ - if (!pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, NULL)) + if (!pci_dev_present(amd64nb)) return -ENODEV; /* Look for any AGP bridge */ dev = NULL; err = -ENODEV; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) { + for_each_pci_dev(dev) { if (!pci_find_capability(dev, PCI_CAP_ID_AGP)) continue; /* Only one bridge supported right now */ @@ -674,5 +756,5 @@ module_exit(agp_amd64_cleanup); #endif MODULE_AUTHOR("Dave Jones , Andi Kleen"); -MODULE_PARM(agp_try_unsupported, "1i"); +module_param(agp_try_unsupported, bool, 0); MODULE_LICENSE("GPL"); diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 8bf71c182..ab17cfdd6 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c @@ -61,9 +61,6 @@ static int ati_create_page_map(ati_page_map *page_map) SetPageReserved(virt_to_page(page_map->real)); err = map_page_into_agp(virt_to_page(page_map->real)); - - /* CACHE_FLUSH(); */ - global_cache_flush(); page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), PAGE_SIZE); if (page_map->remapped == NULL || err) { @@ -75,8 +72,10 @@ static int ati_create_page_map(ati_page_map *page_map) /*CACHE_FLUSH();*/ global_cache_flush(); - for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) + for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { writel(agp_bridge->scratch_page, page_map->remapped+i); + readl(page_map->remapped+i); /* PCI Posting. */ + } return 0; } @@ -186,7 +185,8 @@ static int ati_fetch_size(void) static void ati_tlbflush(struct agp_memory * mem) { - OUTREG32(ati_generic_private.registers, ATI_GART_CACHE_CNTRL, 1); + writel(1, ati_generic_private.registers+ATI_GART_CACHE_CNTRL); + readl(ati_generic_private.registers+ATI_GART_CACHE_CNTRL); /* PCI Posting. */ } static void ati_cleanup(void) @@ -230,15 +230,16 @@ static int ati_configure(void) agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); printk(KERN_INFO PFX "IGP320 gart_bus_addr: %x\n", agp_bridge.gart_bus_addr); */ - OUTREG32(ati_generic_private.registers, ATI_GART_FEATURE_ID, 0x60000); + writel(0x60000, ati_generic_private.registers+ATI_GART_FEATURE_ID); + readl(ati_generic_private.registers+ATI_GART_FEATURE_ID); /* PCI Posting.*/ /* SIGNALED_SYSTEM_ERROR @ NB_STATUS */ pci_read_config_dword(agp_bridge->dev, 4, &temp); pci_write_config_dword(agp_bridge->dev, 4, temp | (1<<14)); /* Write out the address of the gatt table */ - OUTREG32(ati_generic_private.registers, ATI_GART_BASE, - agp_bridge->gatt_bus_addr); + writel(agp_bridge->gatt_bus_addr, ati_generic_private.registers+ATI_GART_BASE); + readl(ati_generic_private.registers+ATI_GART_BASE); /* PCI Posting. */ return 0; } @@ -291,6 +292,7 @@ static int ati_insert_memory(struct agp_memory * mem, addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr)); + readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */ } agp_bridge->driver->tlb_flush(mem); return 0; @@ -310,6 +312,7 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start, addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); + readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */ } agp_bridge->driver->tlb_flush(mem); @@ -371,6 +374,7 @@ static int ati_create_gatt_table(void) for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1, page_dir.remapped+GET_PAGE_DIR_OFF(addr)); + readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ } return 0; @@ -525,6 +529,8 @@ static struct pci_driver agp_ati_pci_driver = { static int __init agp_ati_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_ati_pci_driver); } diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 33e1c707d..9eeaeea49 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -214,17 +214,6 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) phys_to_virt(bridge->scratch_page_real)); } -static const drm_agp_t drm_agp = { - &agp_free_memory, - &agp_allocate_memory, - &agp_bind_memory, - &agp_unbind_memory, - &agp_enable, - &agp_backend_acquire, - &agp_backend_release, - &agp_copy_info -}; - /* XXX Kludge alert: agpgart isn't ready for multiple bridges yet */ struct agp_bridge_data *agp_alloc_bridge(void) { @@ -277,9 +266,6 @@ int agp_add_bridge(struct agp_bridge_data *bridge) goto frontend_err; } - /* FIXME: What to do with this? */ - inter_module_register("drm_agp", THIS_MODULE, &drm_agp); - agp_count++; return 0; @@ -298,7 +284,6 @@ void agp_remove_bridge(struct agp_bridge_data *bridge) bridge->type = NOT_SUPPORTED; agp_frontend_cleanup(); agp_backend_cleanup(bridge); - inter_module_unregister("drm_agp"); agp_count--; module_put(bridge->driver->owner); } diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index 6944d17be..3346da472 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c @@ -375,7 +375,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev, if (!r->start && r->end) { if(pci_assign_resource(pdev, 0)) { printk(KERN_ERR PFX "could not assign resource 0\n"); - return (-ENODEV); + return -ENODEV; } } @@ -386,7 +386,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev, */ if (pci_enable_device(pdev)) { printk(KERN_ERR PFX "Unable to Enable PCI device\n"); - return (-ENODEV); + return -ENODEV; } /* Fill in the mode register */ @@ -441,6 +441,9 @@ static int __init agp_efficeon_init(void) { static int agp_initialised=0; + if (agp_off) + return -EINVAL; + if (agp_initialised == 1) return 0; agp_initialised=1; diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index ef1fa6db9..471748a71 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -627,8 +627,8 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) DBG("client vm_ops=%p", kerninfo.vm_ops); if (kerninfo.vm_ops) { vma->vm_ops = kerninfo.vm_ops; - } else if (remap_page_range(vma, vma->vm_start, - (kerninfo.aper_base + offset), + } else if (remap_pfn_range(vma, vma->vm_start, + (kerninfo.aper_base + offset) >> PAGE_SHIFT, size, vma->vm_page_prot)) { goto out_again; } @@ -643,8 +643,8 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) DBG("controller vm_ops=%p", kerninfo.vm_ops); if (kerninfo.vm_ops) { vma->vm_ops = kerninfo.vm_ops; - } else if (remap_page_range(vma, vma->vm_start, - kerninfo.aper_base, + } else if (remap_pfn_range(vma, vma->vm_start, + kerninfo.aper_base >> PAGE_SHIFT, size, vma->vm_page_prot)) { goto out_again; } diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 83498820c..d62a51d6b 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -35,7 +35,10 @@ #include #include #include +#include #include +#include +#include #include "agp.h" __u32 *agp_gatt_table; @@ -47,6 +50,26 @@ int agp_memory_reserved; */ EXPORT_SYMBOL_GPL(agp_memory_reserved); +#if defined(CONFIG_X86) +int map_page_into_agp(struct page *page) +{ + int i; + i = change_page_attr(page, 1, PAGE_KERNEL_NOCACHE); + global_flush_tlb(); + return i; +} +EXPORT_SYMBOL_GPL(map_page_into_agp); + +int unmap_page_from_agp(struct page *page) +{ + int i; + i = change_page_attr(page, 1, PAGE_KERNEL); + global_flush_tlb(); + return i; +} +EXPORT_SYMBOL_GPL(unmap_page_from_agp); +#endif + /* * Generic routines for handling agp_memory structures - * They use the basic page allocation routines to do the brunt of the work. @@ -181,8 +204,7 @@ struct agp_memory *agp_allocate_memory(size_t page_count, u32 type) agp_free_memory(new); return NULL; } - new->memory[i] = - agp_bridge->driver->mask_memory(virt_to_phys(addr), type); + new->memory[i] = virt_to_phys(addr); new->page_count++; } @@ -507,7 +529,7 @@ u32 agp_collect_device_status(u32 mode, u32 cmd) u32 tmp; u32 agp3; - while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) { + for_each_pci_dev(device) { cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP); if (!cap_ptr) continue; @@ -551,7 +573,7 @@ void agp_device_command(u32 command, int agp_v3) if (agp_v3) mode *= 4; - while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) { + for_each_pci_dev(device) { u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP); if (!agp) continue; @@ -737,8 +759,10 @@ int agp_generic_create_gatt_table(void) agp_bridge->gatt_bus_addr = virt_to_phys(agp_bridge->gatt_table_real); /* AK: bogus, should encode addresses > 4GB */ - for (i = 0; i < num_entries; i++) + for (i = 0; i < num_entries; i++) { writel(agp_bridge->scratch_page, agp_bridge->gatt_table+i); + readl(agp_bridge->gatt_table+i); /* PCI Posting. */ + } return 0; } @@ -854,8 +878,10 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) mem->is_flushed = TRUE; } - for (i = 0, j = pg_start; i < mem->page_count; i++, j++) + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), agp_bridge->gatt_table+j); + readl(agp_bridge->gatt_table+j); /* PCI Posting. */ + } agp_bridge->driver->tlb_flush(mem); return 0; @@ -873,9 +899,12 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type) } /* AK: bogus, should encode addresses > 4GB */ - for (i = pg_start; i < (mem->page_count + pg_start); i++) + for (i = pg_start; i < (mem->page_count + pg_start); i++) { writel(agp_bridge->scratch_page, agp_bridge->gatt_table+i); + readl(agp_bridge->gatt_table+i); /* PCI Posting. */ + } + global_cache_flush(); agp_bridge->driver->tlb_flush(mem); return 0; } @@ -958,21 +987,15 @@ void agp_enable(u32 mode) EXPORT_SYMBOL(agp_enable); -#ifdef CONFIG_SMP static void ipi_handler(void *null) { flush_agp_cache(); } -#endif void global_cache_flush(void) { -#ifdef CONFIG_SMP if (on_each_cpu(ipi_handler, NULL, 1, 1) != 0) panic(PFX "timed out waiting for the other CPUs!\n"); -#else - flush_agp_cache(); -#endif } EXPORT_SYMBOL(global_cache_flush); diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 323a6b68d..3f8c2d41b 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c @@ -88,7 +88,7 @@ static int __init hp_zx1_ioc_shared(void) * - IOVA space is 1Gb in size * - first 512Mb is IOMMU, second 512Mb is GART */ - hp->io_tlb_ps = INREG64(hp->ioc_regs, HP_ZX1_TCNFG); + hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG); switch (hp->io_tlb_ps) { case 0: hp->io_tlb_shift = 12; break; case 1: hp->io_tlb_shift = 13; break; @@ -104,13 +104,13 @@ static int __init hp_zx1_ioc_shared(void) hp->io_page_size = 1 << hp->io_tlb_shift; hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; - hp->iova_base = INREG64(hp->ioc_regs, HP_ZX1_IBASE) & ~0x1; + hp->iova_base = readq(hp->ioc_regs+HP_ZX1_IBASE) & ~0x1; hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - HP_ZX1_GART_SIZE; hp->gart_size = HP_ZX1_GART_SIZE; hp->gatt_entries = hp->gart_size / hp->io_page_size; - hp->io_pdir = phys_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE)); + hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { @@ -174,7 +174,7 @@ hp_zx1_ioc_init (u64 hpa) * If the IOTLB is currently disabled, we can take it over. * Otherwise, we have to share with sba_iommu. */ - hp->io_pdir_owner = (INREG64(hp->ioc_regs, HP_ZX1_IBASE) & 0x1) == 0; + hp->io_pdir_owner = (readq(hp->ioc_regs+HP_ZX1_IBASE) & 0x1) == 0; if (hp->io_pdir_owner) return hp_zx1_ioc_owner(); @@ -189,18 +189,18 @@ hp_zx1_lba_find_capability (volatile u8 __iomem *hpa, int cap) u8 pos, id; int ttl = 48; - status = INREG16(hpa, PCI_STATUS); + status = readw(hpa+PCI_STATUS); if (!(status & PCI_STATUS_CAP_LIST)) return 0; - pos = INREG8(hpa, PCI_CAPABILITY_LIST); + pos = readb(hpa+PCI_CAPABILITY_LIST); while (ttl-- && pos >= 0x40) { pos &= ~3; - id = INREG8(hpa, pos + PCI_CAP_LIST_ID); + id = readb(hpa+pos+PCI_CAP_LIST_ID); if (id == 0xff) break; if (id == cap) return pos; - pos = INREG8(hpa, pos + PCI_CAP_LIST_NEXT); + pos = readb(hpa+pos+PCI_CAP_LIST_NEXT); } return 0; } @@ -217,7 +217,7 @@ hp_zx1_lba_init (u64 hpa) hp->lba_cap_offset = hp_zx1_lba_find_capability(hp->lba_regs, PCI_CAP_ID_AGP); - cap = INREG32(hp->lba_regs, hp->lba_cap_offset) & 0xff; + cap = readl(hp->lba_regs+hp->lba_cap_offset) & 0xff; if (cap != PCI_CAP_ID_AGP) { printk(KERN_ERR PFX "Invalid capability ID 0x%02x at 0x%x\n", cap, hp->lba_cap_offset); @@ -245,15 +245,19 @@ hp_zx1_configure (void) agp_bridge->gart_bus_addr = hp->gart_base; agp_bridge->capndx = hp->lba_cap_offset; - agp_bridge->mode = INREG32(hp->lba_regs, hp->lba_cap_offset + PCI_AGP_STATUS); + agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); if (hp->io_pdir_owner) { - OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_phys(hp->io_pdir)); - OUTREG64(hp->ioc_regs, HP_ZX1_TCNFG, hp->io_tlb_ps); - OUTREG64(hp->ioc_regs, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1)); - OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, hp->iova_base | 0x1); - OUTREG64(hp->ioc_regs, HP_ZX1_PCOM, hp->iova_base | log2(HP_ZX1_IOVA_SIZE)); - INREG64(hp->ioc_regs, HP_ZX1_PCOM); + writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); + readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); + writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); + readl(hp->ioc_regs+HP_ZX1_TCNFG); + writel(~(HP_ZX1_IOVA_SIZE-1), hp->ioc_regs+HP_ZX1_IMASK); + readl(hp->ioc_regs+HP_ZX1_IMASK); + writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); + readl(hp->ioc_regs+HP_ZX1_IBASE); + writel(hp->iova_base|log2(HP_ZX1_IOVA_SIZE), hp->ioc_regs+HP_ZX1_PCOM); + readl(hp->ioc_regs+HP_ZX1_PCOM); } return 0; @@ -265,8 +269,10 @@ hp_zx1_cleanup (void) struct _hp_private *hp = &hp_private; if (hp->ioc_regs) { - if (hp->io_pdir_owner) - OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, 0); + if (hp->io_pdir_owner) { + writeq(0, hp->ioc_regs+HP_ZX1_IBASE); + readq(hp->ioc_regs+HP_ZX1_IBASE); + } iounmap(hp->ioc_regs); } if (hp->lba_regs) @@ -278,8 +284,8 @@ hp_zx1_tlbflush (struct agp_memory *mem) { struct _hp_private *hp = &hp_private; - OUTREG64(hp->ioc_regs, HP_ZX1_PCOM, hp->gart_base | log2(hp->gart_size)); - INREG64(hp->ioc_regs, HP_ZX1_PCOM); + writeq(hp->gart_base | log2(hp->gart_size), hp->ioc_regs+HP_ZX1_PCOM); + readq(hp->ioc_regs+HP_ZX1_PCOM); } static int @@ -401,12 +407,11 @@ hp_zx1_enable (u32 mode) struct _hp_private *hp = &hp_private; u32 command; - command = INREG32(hp->lba_regs, hp->lba_cap_offset + PCI_AGP_STATUS); - + command = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); command = agp_collect_device_status(mode, command); command |= 0x00000100; - OUTREG32(hp->lba_regs, hp->lba_cap_offset + PCI_AGP_COMMAND, command); + writel(command, hp->lba_regs+hp->lba_cap_offset+PCI_AGP_COMMAND); agp_device_command(command, (mode & AGP8X_MODE) != 0); } @@ -519,6 +524,8 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) static int __init agp_hp_init (void) { + if (agp_off) + return -EINVAL; acpi_get_devices("HWP0003", zx1_gart_probe, "HWP0003", NULL); if (hp_zx1_gart_found) diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index b8ab24f73..c55fa1df6 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c @@ -532,8 +532,8 @@ static void i460_destroy_page (void *page) static unsigned long i460_mask_memory (unsigned long addr, int type) { /* Make sure the returned address is a valid GATT entry */ - return (agp_bridge->driver->masks[0].mask - | (((addr & ~((1 << I460_IO_PAGE_SHIFT) - 1)) & 0xffffff000) >> 12)); + return agp_bridge->driver->masks[0].mask + | (((addr & ~((1 << I460_IO_PAGE_SHIFT) - 1)) & 0xffffff000) >> 12); } struct agp_bridge_driver intel_i460_driver = { @@ -585,6 +585,8 @@ static int __devinit agp_intel_i460_probe(struct pci_dev *pdev, bridge->dev = pdev; bridge->capndx = cap_ptr; + printk(KERN_INFO PFX "Detected Intel 460GX chipset\n"); + pci_set_drvdata(pdev, bridge); return agp_add_bridge(bridge); } @@ -620,6 +622,8 @@ static struct pci_driver agp_intel_i460_pci_driver = { static int __init agp_intel_i460_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_intel_i460_pci_driver); } diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 7bec505ad..06e791f3b 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -6,7 +6,7 @@ * Intel(R) 855GM/852GM and 865G support added by David Dawes * . * - * Intel(R) 915G support added by Alan Hourihane + * Intel(R) 915G/915GM support added by Alan Hourihane * . */ @@ -117,7 +117,7 @@ static int intel_i810_configure(void) return -ENOMEM; } - if ((INREG32(intel_i810_private.registers, I810_DRAM_CTL) + if ((readl(intel_i810_private.registers+I810_DRAM_CTL) & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { /* This will need to be dynamically assigned */ printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n"); @@ -125,23 +125,23 @@ static int intel_i810_configure(void) } pci_read_config_dword(intel_i810_private.i810_dev, I810_GMADDR, &temp); agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); - OUTREG32(intel_i810_private.registers, I810_PGETBL_CTL, - agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED); - global_cache_flush(); + writel(agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED, intel_i810_private.registers+I810_PGETBL_CTL); + readl(intel_i810_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ if (agp_bridge->driver->needs_scratch_page) { for (i = 0; i < current_size->num_entries; i++) { - OUTREG32(intel_i810_private.registers, - I810_PTE_BASE + (i * 4), - agp_bridge->scratch_page); + writel(agp_bridge->scratch_page, intel_i810_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i810_private.registers+I810_PTE_BASE+(i*4)); /* PCI posting. */ } } + global_cache_flush(); return 0; } static void intel_i810_cleanup(void) { - OUTREG32(intel_i810_private.registers, I810_PGETBL_CTL, 0); + writel(0, intel_i810_private.registers+I810_PGETBL_CTL); + readl(intel_i810_private.registers); /* PCI Posting. */ iounmap(intel_i810_private.registers); } @@ -161,13 +161,15 @@ static void *i8xx_alloc_pages(void) struct page * page; page = alloc_pages(GFP_KERNEL, 2); - if (page == NULL) { + if (page == NULL) return NULL; - } + if (change_page_attr(page, 4, PAGE_KERNEL_NOCACHE) < 0) { + global_flush_tlb(); __free_page(page); return NULL; } + global_flush_tlb(); get_page(page); SetPageLocked(page); atomic_inc(&agp_bridge->current_memory_agp); @@ -183,6 +185,7 @@ static void i8xx_destroy_pages(void *addr) page = virt_to_page(addr); change_page_attr(page, 4, PAGE_KERNEL); + global_flush_tlb(); put_page(page); unlock_page(page); free_pages((unsigned long)addr, 2); @@ -211,10 +214,8 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, /* special insert */ global_cache_flush(); for (i = pg_start; i < (pg_start + mem->page_count); i++) { - OUTREG32(intel_i810_private.registers, - I810_PTE_BASE + (i * 4), - (i * 4096) | I810_PTE_LOCAL | - I810_PTE_VALID); + writel((i*4096)|I810_PTE_LOCAL|I810_PTE_VALID, intel_i810_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i810_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ } global_cache_flush(); agp_bridge->driver->tlb_flush(mem); @@ -228,9 +229,9 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, insert: global_cache_flush(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { - OUTREG32(intel_i810_private.registers, - I810_PTE_BASE + (j * 4), - agp_bridge->driver->mask_memory(mem->memory[i], mem->type)); + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), + intel_i810_private.registers+I810_PTE_BASE+(j*4)); + readl(intel_i810_private.registers+I810_PTE_BASE+(j*4)); /* PCI Posting. */ } global_cache_flush(); @@ -244,9 +245,8 @@ static int intel_i810_remove_entries(struct agp_memory *mem, off_t pg_start, int i; for (i = pg_start; i < (mem->page_count + pg_start); i++) { - OUTREG32(intel_i810_private.registers, - I810_PTE_BASE + (i * 4), - agp_bridge->scratch_page); + writel(agp_bridge->scratch_page, intel_i810_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i810_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ } global_cache_flush(); @@ -318,7 +318,7 @@ static struct agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type) return new; } if (type == AGP_PHYS_MEMORY) - return(alloc_agpphysmem_i8xx(pg_count, type)); + return alloc_agpphysmem_i8xx(pg_count, type); return NULL; } @@ -387,8 +387,7 @@ static void intel_i830_init_gtt_entries(void) gtt_entries = MB(8) - KB(size); break; case I830_GMCH_GMS_LOCAL: - rdct = INREG8(intel_i830_private.registers, - I830_RDRAM_CHANNEL_TYPE); + rdct = readb(intel_i830_private.registers+I830_RDRAM_CHANNEL_TYPE); gtt_entries = (I830_RDRAM_ND(rdct) + 1) * MB(ddt[I830_RDRAM_DDT(rdct)]); local = 1; @@ -416,14 +415,16 @@ static void intel_i830_init_gtt_entries(void) break; case I915_GMCH_GMS_STOLEN_48M: /* Check it's really I915G */ - if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB) + if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) gtt_entries = MB(48) - KB(size); else gtt_entries = 0; break; case I915_GMCH_GMS_STOLEN_64M: /* Check it's really I915G */ - if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB) + if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) gtt_entries = MB(64) - KB(size); else gtt_entries = 0; @@ -463,10 +464,10 @@ static int intel_i830_create_gatt_table(void) intel_i830_private.registers = ioremap(temp,128 * 4096); if (!intel_i830_private.registers) - return (-ENOMEM); + return -ENOMEM; - temp = INREG32(intel_i830_private.registers,I810_PGETBL_CTL) & 0xfffff000; - global_cache_flush(); + temp = readl(intel_i830_private.registers+I810_PGETBL_CTL) & 0xfffff000; + global_cache_flush(); /* FIXME: ?? */ /* we have to call this as early as possible after the MMIO base address is known */ intel_i830_init_gtt_entries(); @@ -475,7 +476,7 @@ static int intel_i830_create_gatt_table(void) agp_bridge->gatt_bus_addr = temp; - return(0); + return 0; } /* Return the gatt table to a sane state. Use the top of stolen @@ -483,7 +484,7 @@ static int intel_i830_create_gatt_table(void) */ static int intel_i830_free_gatt_table(void) { - return(0); + return 0; } static int intel_i830_fetch_size(void) @@ -498,7 +499,7 @@ static int intel_i830_fetch_size(void) /* 855GM/852GM/865G has 128MB aperture size */ agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 0; - return(values[0].size); + return values[0].size; } pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl); @@ -506,14 +507,14 @@ static int intel_i830_fetch_size(void) if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 0; - return(values[0].size); + return values[0].size; } else { agp_bridge->previous_size = agp_bridge->current_size = (void *) (values + 1); agp_bridge->aperture_size_idx = 1; - return(values[1].size); + return values[1].size; } - return(0); + return 0; } static int intel_i830_configure(void) @@ -532,14 +533,18 @@ static int intel_i830_configure(void) gmch_ctrl |= I830_GMCH_ENABLED; pci_write_config_word(agp_bridge->dev,I830_GMCH_CTRL,gmch_ctrl); - OUTREG32(intel_i830_private.registers,I810_PGETBL_CTL,agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED); - global_cache_flush(); + writel(agp_bridge->gatt_bus_addr|I810_PGETBL_ENABLED, intel_i830_private.registers+I810_PGETBL_CTL); + readl(intel_i830_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ - if (agp_bridge->driver->needs_scratch_page) - for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (i * 4),agp_bridge->scratch_page); + if (agp_bridge->driver->needs_scratch_page) { + for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) { + writel(agp_bridge->scratch_page, intel_i830_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ + } + } - return (0); + global_cache_flush(); + return 0; } static void intel_i830_cleanup(void) @@ -547,8 +552,7 @@ static void intel_i830_cleanup(void) iounmap(intel_i830_private.registers); } -static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, - int type) +static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, int type) { int i,j,num_entries; void *temp; @@ -561,11 +565,11 @@ static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, pg_start,intel_i830_private.gtt_entries); printk (KERN_INFO PFX "Trying to insert into local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } if ((pg_start + mem->page_count) > num_entries) - return (-EINVAL); + return -EINVAL; /* The i830 can't check the GTT for entries since its read only, * depend on the caller to make the correct offset decisions. @@ -573,19 +577,19 @@ static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, if ((type != 0 && type != AGP_PHYS_MEMORY) || (mem->type != 0 && mem->type != AGP_PHYS_MEMORY)) - return (-EINVAL); + return -EINVAL; - global_cache_flush(); + global_cache_flush(); /* FIXME: Necessary ?*/ - for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (j * 4), - agp_bridge->driver->mask_memory(mem->memory[i], mem->type)); + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), + intel_i830_private.registers+I810_PTE_BASE+(j*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(j*4)); /* PCI Posting. */ + } global_cache_flush(); - agp_bridge->driver->tlb_flush(mem); - - return(0); + return 0; } static int intel_i830_remove_entries(struct agp_memory *mem,off_t pg_start, @@ -597,26 +601,26 @@ static int intel_i830_remove_entries(struct agp_memory *mem,off_t pg_start, if (pg_start < intel_i830_private.gtt_entries) { printk (KERN_INFO PFX "Trying to disable local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } - for (i = pg_start; i < (mem->page_count + pg_start); i++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (i * 4),agp_bridge->scratch_page); + for (i = pg_start; i < (mem->page_count + pg_start); i++) { + writel(agp_bridge->scratch_page, intel_i830_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ + } global_cache_flush(); - agp_bridge->driver->tlb_flush(mem); - - return (0); + return 0; } static struct agp_memory *intel_i830_alloc_by_type(size_t pg_count,int type) { if (type == AGP_PHYS_MEMORY) - return(alloc_agpphysmem_i8xx(pg_count, type)); + return alloc_agpphysmem_i8xx(pg_count, type); /* always return NULL for other allocation types for now */ - return(NULL); + return NULL; } static int intel_i915_configure(void) @@ -636,15 +640,18 @@ static int intel_i915_configure(void) gmch_ctrl |= I830_GMCH_ENABLED; pci_write_config_word(agp_bridge->dev,I830_GMCH_CTRL,gmch_ctrl); - OUTREG32(intel_i830_private.registers,I810_PGETBL_CTL,agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED); - global_cache_flush(); + writel(agp_bridge->gatt_bus_addr|I810_PGETBL_ENABLED, intel_i830_private.registers+I810_PGETBL_CTL); + readl(intel_i830_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ if (agp_bridge->driver->needs_scratch_page) { - for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) - OUTREG32(intel_i830_private.gtt, i, agp_bridge->scratch_page); + for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) { + writel(agp_bridge->scratch_page, intel_i830_private.gtt+i); + readl(intel_i830_private.gtt+i); /* PCI Posting. */ + } } - return (0); + global_cache_flush(); + return 0; } static void intel_i915_cleanup(void) @@ -667,11 +674,11 @@ static int intel_i915_insert_entries(struct agp_memory *mem,off_t pg_start, pg_start,intel_i830_private.gtt_entries); printk (KERN_INFO PFX "Trying to insert into local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } if ((pg_start + mem->page_count) > num_entries) - return (-EINVAL); + return -EINVAL; /* The i830 can't check the GTT for entries since its read only, * depend on the caller to make the correct offset decisions. @@ -679,18 +686,18 @@ static int intel_i915_insert_entries(struct agp_memory *mem,off_t pg_start, if ((type != 0 && type != AGP_PHYS_MEMORY) || (mem->type != 0 && mem->type != AGP_PHYS_MEMORY)) - return (-EINVAL); + return -EINVAL; global_cache_flush(); - for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - OUTREG32(intel_i830_private.gtt, j, agp_bridge->driver->mask_memory(mem->memory[i], mem->type)); + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), intel_i830_private.gtt+j); + readl(intel_i830_private.gtt+j); /* PCI Posting. */ + } global_cache_flush(); - agp_bridge->driver->tlb_flush(mem); - - return(0); + return 0; } static int intel_i915_remove_entries(struct agp_memory *mem,off_t pg_start, @@ -702,17 +709,17 @@ static int intel_i915_remove_entries(struct agp_memory *mem,off_t pg_start, if (pg_start < intel_i830_private.gtt_entries) { printk (KERN_INFO PFX "Trying to disable local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } - for (i = pg_start; i < (mem->page_count + pg_start); i++) - OUTREG32(intel_i830_private.gtt, i, agp_bridge->scratch_page); + for (i = pg_start; i < (mem->page_count + pg_start); i++) { + writel(agp_bridge->scratch_page, intel_i830_private.gtt+i); + readl(intel_i830_private.gtt+i); + } global_cache_flush(); - agp_bridge->driver->tlb_flush(mem); - - return (0); + return 0; } static int intel_i915_fetch_size(void) @@ -730,7 +737,7 @@ static int intel_i915_fetch_size(void) else offset = 2; /* 256MB aperture */ agp_bridge->previous_size = agp_bridge->current_size = (void *)(values + offset); - return(values[offset].size); + return values[offset].size; } /* The intel i915 automatically initializes the agp aperture during POST. @@ -753,16 +760,16 @@ static int intel_i915_create_gatt_table(void) intel_i830_private.gtt = ioremap(temp2, 256 * 1024); if (!intel_i830_private.gtt) - return (-ENOMEM); + return -ENOMEM; temp &= 0xfff80000; intel_i830_private.registers = ioremap(temp,128 * 4096); if (!intel_i830_private.registers) - return (-ENOMEM); + return -ENOMEM; - temp = INREG32(intel_i830_private.registers,I810_PGETBL_CTL) & 0xfffff000; - global_cache_flush(); + temp = readl(intel_i830_private.registers+I810_PGETBL_CTL) & 0xfffff000; + global_cache_flush(); /* FIXME: ? */ /* we have to call this as early as possible after the MMIO base address is known */ intel_i830_init_gtt_entries(); @@ -771,7 +778,7 @@ static int intel_i915_create_gatt_table(void) agp_bridge->gatt_bus_addr = temp; - return(0); + return 0; } static int intel_fetch_size(void) @@ -1493,7 +1500,7 @@ static int find_i810(u16 device) { struct pci_dev *i810_dev; - i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL); + i810_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); if (!i810_dev) return 0; intel_i810_private.i810_dev = i810_dev; @@ -1504,9 +1511,9 @@ static int find_i830(u16 device) { struct pci_dev *i830_dev; - i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL); + i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); if (i830_dev && PCI_FUNC(i830_dev->devfn) != 0) { - i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, + i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, i830_dev); } @@ -1643,6 +1650,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, } name = "915G"; break; + case PCI_DEVICE_ID_INTEL_82915GM_HB: + if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG)) { + bridge->driver = &intel_915_driver; + } else { + bridge->driver = &intel_845_driver; + } + name = "915GM"; + break; case PCI_DEVICE_ID_INTEL_7505_0: bridge->driver = &intel_7505_driver; name = "E7505"; @@ -1716,6 +1731,12 @@ static void __devexit agp_intel_remove(struct pci_dev *pdev) struct agp_bridge_data *bridge = pci_get_drvdata(pdev); agp_remove_bridge(bridge); + + if (intel_i810_private.i810_dev) + pci_dev_put(intel_i810_private.i810_dev); + if (intel_i830_private.i830_dev) + pci_dev_put(intel_i830_private.i830_dev); + agp_put_bridge(bridge); } @@ -1723,16 +1744,20 @@ static int agp_intel_resume(struct pci_dev *pdev) { struct agp_bridge_data *bridge = pci_get_drvdata(pdev); - pci_restore_state(pdev, pdev->saved_config_space); + pci_restore_state(pdev); if (bridge->driver == &intel_generic_driver) intel_configure(); + else if (bridge->driver == &intel_850_driver) + intel_850_configure(); else if (bridge->driver == &intel_845_driver) intel_845_configure(); else if (bridge->driver == &intel_830mp_driver) intel_830mp_configure(); else if (bridge->driver == &intel_915_driver) intel_i915_configure(); + else if (bridge->driver == &intel_830_driver) + intel_i830_configure(); return 0; } @@ -1769,6 +1794,7 @@ static struct pci_device_id agp_intel_pci_table[] = { ID(PCI_DEVICE_ID_INTEL_7505_0), ID(PCI_DEVICE_ID_INTEL_7205_0), ID(PCI_DEVICE_ID_INTEL_82915G_HB), + ID(PCI_DEVICE_ID_INTEL_82915GM_HB), { } }; @@ -1782,16 +1808,8 @@ static struct pci_driver agp_intel_pci_driver = { .resume = agp_intel_resume, }; -/* intel_agp_init() must not be declared static for explicit - early initialization to work (ie i810fb) */ -int __init agp_intel_init(void) +static int __init agp_intel_init(void) { - static int agp_initialised=0; - - if (agp_initialised == 1) - return 0; - agp_initialised=1; - return pci_module_init(&agp_intel_pci_driver); } diff --git a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c index fd1d1ac1a..5902726d8 100644 --- a/drivers/char/agp/intel-mch-agp.c +++ b/drivers/char/agp/intel-mch-agp.c @@ -51,7 +51,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type) if (new == NULL) return NULL; - new->memory[0] = agp_bridge->driver->mask_memory(virt_to_phys(addr), type); + new->memory[0] = virt_to_phys(addr); new->page_count = 1; new->num_scratch_pages = 1; new->type = AGP_PHYS_MEMORY; @@ -111,8 +111,7 @@ static void intel_i830_init_gtt_entries(void) gtt_entries = MB(8) - KB(132); break; case I830_GMCH_GMS_LOCAL: - rdct = INREG8(intel_i830_private.registers, - I830_RDRAM_CHANNEL_TYPE); + rdct = readb(intel_i830_private.registers+I830_RDRAM_CHANNEL_TYPE); gtt_entries = (I830_RDRAM_ND(rdct) + 1) * MB(ddt[I830_RDRAM_DDT(rdct)]); local = 1; @@ -174,10 +173,10 @@ static int intel_i830_create_gatt_table(void) intel_i830_private.registers = (volatile u8 __iomem*) ioremap(temp,128 * 4096); if (!intel_i830_private.registers) - return (-ENOMEM); + return -ENOMEM; - temp = INREG32(intel_i830_private.registers,I810_PGETBL_CTL) & 0xfffff000; - global_cache_flush(); + temp = readl(intel_i830_private.registers+I810_PGETBL_CTL) & 0xfffff000; + global_cache_flush(); /* FIXME: ?? */ /* we have to call this as early as possible after the MMIO base address is known */ intel_i830_init_gtt_entries(); @@ -186,7 +185,7 @@ static int intel_i830_create_gatt_table(void) agp_bridge->gatt_bus_addr = temp; - return(0); + return 0; } /* Return the gatt table to a sane state. Use the top of stolen @@ -194,7 +193,7 @@ static int intel_i830_create_gatt_table(void) */ static int intel_i830_free_gatt_table(void) { - return(0); + return 0; } static int intel_i830_fetch_size(void) @@ -209,7 +208,7 @@ static int intel_i830_fetch_size(void) /* 855GM/852GM/865G has 128MB aperture size */ agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 0; - return(values[0].size); + return values[0].size; } pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl); @@ -217,14 +216,14 @@ static int intel_i830_fetch_size(void) if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 0; - return(values[0].size); + return values[0].size; } else { agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 1; - return(values[1].size); + return values[1].size; } - return(0); + return 0; } static int intel_i830_configure(void) @@ -243,14 +242,17 @@ static int intel_i830_configure(void) gmch_ctrl |= I830_GMCH_ENABLED; pci_write_config_word(agp_bridge->dev,I830_GMCH_CTRL,gmch_ctrl); - OUTREG32(intel_i830_private.registers,I810_PGETBL_CTL,agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED); - global_cache_flush(); - - if (agp_bridge->driver->needs_scratch_page) - for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (i * 4),agp_bridge->scratch_page); + writel(agp_bridge->gatt_bus_addr|I810_PGETBL_ENABLED, intel_i830_private.registers+I810_PGETBL_CTL); + readl(intel_i830_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ - return (0); + if (agp_bridge->driver->needs_scratch_page) { + for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++) { + writel(agp_bridge->scratch_page, intel_i830_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ + } + } + global_cache_flush(); + return 0; } static void intel_i830_cleanup(void) @@ -272,11 +274,11 @@ static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, pg_start,intel_i830_private.gtt_entries); printk (KERN_INFO PFX "Trying to insert into local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } if ((pg_start + mem->page_count) > num_entries) - return (-EINVAL); + return -EINVAL; /* The i830 can't check the GTT for entries since its read only, * depend on the caller to make the correct offset decisions. @@ -284,19 +286,21 @@ static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, if ((type != 0 && type != AGP_PHYS_MEMORY) || (mem->type != 0 && mem->type != AGP_PHYS_MEMORY)) - return (-EINVAL); + return -EINVAL; - global_cache_flush(); + global_cache_flush(); /* FIXME: ?? */ - for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (j * 4), - agp_bridge->driver->mask_memory(mem->memory[i], mem->type)); + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), + intel_i830_private.registers+I810_PTE_BASE+(j*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(j*4)); /* PCI Posting. */ + } global_cache_flush(); agp_bridge->driver->tlb_flush(mem); - return(0); + return 0; } static int intel_i830_remove_entries(struct agp_memory *mem,off_t pg_start, @@ -308,26 +312,26 @@ static int intel_i830_remove_entries(struct agp_memory *mem,off_t pg_start, if (pg_start < intel_i830_private.gtt_entries) { printk (KERN_INFO PFX "Trying to disable local/stolen memory\n"); - return (-EINVAL); + return -EINVAL; } - for (i = pg_start; i < (mem->page_count + pg_start); i++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (i * 4),agp_bridge->scratch_page); + for (i = pg_start; i < (mem->page_count + pg_start); i++) { + writel(agp_bridge->scratch_page, intel_i830_private.registers+I810_PTE_BASE+(i*4)); + readl(intel_i830_private.registers+I810_PTE_BASE+(i*4)); /* PCI Posting. */ + } global_cache_flush(); - agp_bridge->driver->tlb_flush(mem); - - return (0); + return 0; } static struct agp_memory *intel_i830_alloc_by_type(size_t pg_count,int type) { if (type == AGP_PHYS_MEMORY) - return(alloc_agpphysmem_i8xx(pg_count, type)); + return alloc_agpphysmem_i8xx(pg_count, type); /* always return NULL for other allocation types for now */ - return(NULL); + return NULL; } static int intel_8xx_fetch_size(void) @@ -470,9 +474,9 @@ static int find_i830(u16 device) { struct pci_dev *i830_dev; - i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL); + i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); if (i830_dev && PCI_FUNC(i830_dev->devfn) != 0) { - i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, + i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, i830_dev); } @@ -536,7 +540,7 @@ static int __devinit agp_intelmch_probe(struct pci_dev *pdev, if (!r->start && r->end) { if(pci_assign_resource(pdev, 0)) { printk(KERN_ERR PFX "could not assign resource 0\n"); - return (-ENODEV); + return -ENODEV; } } @@ -547,7 +551,7 @@ static int __devinit agp_intelmch_probe(struct pci_dev *pdev, */ if (pci_enable_device(pdev)) { printk(KERN_ERR PFX "Unable to Enable PCI device\n"); - return (-ENODEV); + return -ENODEV; } /* Fill in the mode register */ @@ -566,14 +570,16 @@ static void __devexit agp_intelmch_remove(struct pci_dev *pdev) struct agp_bridge_data *bridge = pci_get_drvdata(pdev); agp_remove_bridge(bridge); + if (intel_i830_private.i830_dev) + pci_dev_put(intel_i830_private.i830_dev); agp_put_bridge(bridge); } static int agp_intelmch_resume(struct pci_dev *pdev) { struct agp_bridge_data *bridge = pci_get_drvdata(pdev); - - pci_restore_state(pdev, pdev->saved_config_space); + + pci_restore_state(pdev); if (bridge->driver == &intel_845_driver) intel_845_configure(); diff --git a/drivers/char/agp/isoch.c b/drivers/char/agp/isoch.c index 97e179ab3..c9ac73150 100644 --- a/drivers/char/agp/isoch.c +++ b/drivers/char/agp/isoch.c @@ -347,7 +347,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge) INIT_LIST_HEAD(head); /* Find all AGP devices, and add them to dev_list. */ - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { mcapndx = pci_find_capability(dev, PCI_CAP_ID_AGP); if (mcapndx == 0) continue; diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 16d8bdcb4..936d366d7 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c @@ -214,9 +214,11 @@ static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type global_cache_flush(); mem->is_flushed = TRUE; } - for (i = 0, j = pg_start; i < mem->page_count; i++, j++) + for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), agp_bridge->gatt_table+nvidia_private.pg_offset+j); + readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j); /* PCI Posting. */ + } agp_bridge->driver->tlb_flush(mem); return 0; } @@ -403,6 +405,8 @@ static struct pci_driver agp_nvidia_pci_driver = { static int __init agp_nvidia_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_nvidia_pci_driver); } diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c index 019a31c36..e70999aa8 100644 --- a/drivers/char/agp/sis-agp.c +++ b/drivers/char/agp/sis-agp.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "agp.h" #define SIS_ATTBASE 0x90 @@ -85,7 +86,7 @@ static void sis_delayed_enable(u32 mode) command |= AGPSTAT_AGP_ENABLE; rate = (command & 0x7) << 2; - while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) { + for_each_pci_dev(device) { u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP); if (!agp) continue; @@ -102,8 +103,7 @@ static void sis_delayed_enable(u32 mode) */ if (device->device == agp_bridge->dev->device) { printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n"); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout (1+(HZ*10)/1000); + msleep(10); } } } @@ -340,6 +340,8 @@ static struct pci_driver agp_sis_pci_driver = { static int __init agp_sis_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_sis_pci_driver); } @@ -351,8 +353,8 @@ static void __exit agp_sis_cleanup(void) module_init(agp_sis_init); module_exit(agp_sis_cleanup); -MODULE_PARM(agp_sis_force_delay,"i"); +module_param(agp_sis_force_delay, bool, 0); MODULE_PARM_DESC(agp_sis_force_delay,"forces sis delay hack"); -MODULE_PARM(agp_sis_agp_spec,"i"); +module_param(agp_sis_agp_spec, int, 0); MODULE_PARM_DESC(agp_sis_agp_spec,"0=force sis init, 1=force generic agp3 init, default: autodetect"); MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index ae20fcaa4..44b24fa6f 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c @@ -242,12 +242,12 @@ static int serverworks_fetch_size(void) */ static void serverworks_tlbflush(struct agp_memory *temp) { - OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 1); - while(INREG8(serverworks_private.registers, SVWRKS_POSTFLUSH) == 1) + writeb(1, serverworks_private.registers+SVWRKS_POSTFLUSH); + while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) cpu_relax(); - OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 1); - while(INREG32(serverworks_private.registers, SVWRKS_DIRFLUSH) == 1) + writel(1, serverworks_private.registers+SVWRKS_DIRFLUSH); + while(readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) cpu_relax(); } @@ -269,21 +269,21 @@ static int serverworks_configure(void) return -ENOMEM; } - OUTREG8(serverworks_private.registers, SVWRKS_GART_CACHE, 0x0a); + writeb(0xA, serverworks_private.registers+SVWRKS_GART_CACHE); + readb(serverworks_private.registers+SVWRKS_GART_CACHE); /* PCI Posting. */ - OUTREG32(serverworks_private.registers, SVWRKS_GATTBASE, - agp_bridge->gatt_bus_addr); + writel(agp_bridge->gatt_bus_addr, serverworks_private.registers+SVWRKS_GATTBASE); + readl(serverworks_private.registers+SVWRKS_GATTBASE); /* PCI Posting. */ - cap_reg = INREG16(serverworks_private.registers, SVWRKS_COMMAND); + cap_reg = readw(serverworks_private.registers+SVWRKS_COMMAND); cap_reg &= ~0x0007; cap_reg |= 0x4; - OUTREG16(serverworks_private.registers, SVWRKS_COMMAND, cap_reg); + writew(cap_reg, serverworks_private.registers+SVWRKS_COMMAND); + readw(serverworks_private.registers+SVWRKS_COMMAND); - pci_read_config_byte(serverworks_private.svrwrks_dev, - SVWRKS_AGP_ENABLE, &enable_reg); + pci_read_config_byte(serverworks_private.svrwrks_dev,SVWRKS_AGP_ENABLE, &enable_reg); enable_reg |= 0x1; /* Agp Enable bit */ - pci_write_config_byte(serverworks_private.svrwrks_dev, - SVWRKS_AGP_ENABLE, enable_reg); + pci_write_config_byte(serverworks_private.svrwrks_dev,SVWRKS_AGP_ENABLE, enable_reg); serverworks_tlbflush(NULL); agp_bridge->capndx = pci_find_capability(serverworks_private.svrwrks_dev, PCI_CAP_ID_AGP); @@ -539,6 +539,8 @@ static struct pci_driver agp_serverworks_pci_driver = { static int __init agp_serverworks_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_serverworks_pci_driver); } diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 14dfb59ff..4eb72b710 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -373,6 +373,8 @@ static struct pci_driver agp_uninorth_pci_driver = { static int __init agp_uninorth_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_uninorth_pci_driver); } diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index bcaea8ec3..b15dcd941 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c @@ -442,7 +442,7 @@ static void __devexit agp_via_remove(struct pci_dev *pdev) static int agp_via_suspend(struct pci_dev *pdev, u32 state) { - pci_save_state (pdev, pdev->saved_config_space); + pci_save_state (pdev); pci_set_power_state (pdev, 3); return 0; @@ -453,7 +453,7 @@ static int agp_via_resume(struct pci_dev *pdev) struct agp_bridge_data *bridge = pci_get_drvdata(pdev); pci_set_power_state (pdev, 0); - pci_restore_state(pdev, pdev->saved_config_space); + pci_restore_state(pdev); if (bridge->driver == &via_agp3_driver) return via_configure_agp3(); @@ -523,6 +523,8 @@ static struct pci_driver agp_via_pci_driver = { static int __init agp_via_init(void) { + if (agp_off) + return -EINVAL; return pci_module_init(&agp_via_pci_driver); } diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index f11cf4ea0..1dc425921 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -32,6 +32,7 @@ */ #include +#include #undef SERIAL_PARANOIA_CHECK #define SERIAL_DO_RESTART @@ -83,14 +84,13 @@ static char *serial_version = "4.30"; #include #include #include -#include +#include #include #include #include -#include #include #include @@ -645,7 +645,7 @@ static int startup(struct async_struct * info) /* * and set the speed of the serial port */ - change_speed(info, 0); + change_speed(info, NULL); info->flags |= ASYNC_INITIALIZED; local_irq_restore(flags); @@ -691,7 +691,7 @@ static void shutdown(struct async_struct * info) if (info->xmit.buf) { free_page((unsigned long) info->xmit.buf); - info->xmit.buf = 0; + info->xmit.buf = NULL; } info->IER = 0; @@ -907,8 +907,7 @@ static void rs_flush_chars(struct tty_struct *tty) local_irq_restore(flags); } -static int rs_write(struct tty_struct * tty, int from_user, - const unsigned char *buf, int count) +static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) { int c, ret = 0; struct async_struct *info = (struct async_struct *)tty->driver_data; @@ -921,57 +920,25 @@ static int rs_write(struct tty_struct * tty, int from_user, return 0; local_save_flags(flags); - if (from_user) { - down(&tmp_buf_sem); - while (1) { - int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (count < c) - c = count; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!ret) - ret = -EFAULT; - break; - } - local_irq_disable(); - c1 = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (c1 < c) - c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - local_irq_restore(flags); - buf += c; - count -= c; - ret += c; - } - up(&tmp_buf_sem); - } else { - local_irq_disable(); - while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) { - break; - } - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - buf += c; - count -= c; - ret += c; + local_irq_disable(); + while (1) { + c = CIRC_SPACE_TO_END(info->xmit.head, + info->xmit.tail, + SERIAL_XMIT_SIZE); + if (count < c) + c = count; + if (c <= 0) { + break; } - local_irq_restore(flags); + memcpy(info->xmit.buf + info->xmit.head, buf, c); + info->xmit.head = ((info->xmit.head + c) & + (SERIAL_XMIT_SIZE-1)); + buf += c; + count -= c; + ret += c; } + local_irq_restore(flags); + if (info->xmit.head != info->xmit.tail && !tty->stopped && !tty->hw_stopped @@ -1205,7 +1172,7 @@ check_and_exit: info->tty->alt_speed = 230400; if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) info->tty->alt_speed = 460800; - change_speed(info, 0); + change_speed(info, NULL); } } else retval = startup(info); @@ -1560,11 +1527,10 @@ static void rs_close(struct tty_struct *tty, struct file * filp) tty_ldisc_flush(tty); tty->closing = 0; info->event = 0; - info->tty = 0; + info->tty = NULL; if (info->blocked_open) { if (info->close_delay) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(info->close_delay); + msleep_interruptible(jiffies_to_msecs(info->close_delay)); } wake_up_interruptible(&info->open_wait); } @@ -1622,8 +1588,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("serdatr = %d (jiff=%lu)...", lsr, jiffies); #endif - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(char_time); + msleep_interruptible(jiffies_to_msecs(char_time)); if (signal_pending(current)) break; if (timeout && time_after(jiffies, orig_jiffies + timeout)) @@ -1653,7 +1618,7 @@ static void rs_hangup(struct tty_struct *tty) info->event = 0; state->count = 0; info->flags &= ~ASYNC_NORMAL_ACTIVE; - info->tty = 0; + info->tty = NULL; wake_up_interruptible(&info->open_wait); } @@ -1909,7 +1874,7 @@ static inline int line_info(char *buf, struct serial_state *state) info->magic = SERIAL_MAGIC; info->flags = state->flags; info->quot = 0; - info->tty = 0; + info->tty = NULL; } local_irq_save(flags); status = ciab.pra; diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index 148ea2932..6bf2e27dc 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -1,6 +1,6 @@ /* Derived from Applicom driver ac.c for SCO Unix */ /* Ported by David Woodhouse, Axiom (Cambridge) Ltd. */ -/* dwmw2@redhat.com 30/8/98 */ +/* dwmw2@infradead.org 30/8/98 */ /* $Id: ac.c,v 1.30 2000/03/22 16:03:57 dwmw2 Exp $ */ /* This module is for Linux 2.1 and 2.2 series kernels. */ /*****************************************************************************/ @@ -79,10 +79,6 @@ MODULE_DEVICE_TABLE(pci, applicom_pci_tbl); MODULE_AUTHOR("David Woodhouse & Applicom International"); MODULE_DESCRIPTION("Driver for Applicom Profibus card"); MODULE_LICENSE("GPL"); -MODULE_PARM(irq, "i"); -MODULE_PARM_DESC(irq, "IRQ of the Applicom board"); -MODULE_PARM(mem, "i"); -MODULE_PARM_DESC(mem, "Shared Memory Address of Applicom board"); MODULE_SUPPORTED_DEVICE("ac"); @@ -98,6 +94,11 @@ static struct applicom_board { static unsigned int irq = 0; /* interrupt number IRQ */ static unsigned long mem = 0; /* physical segment of board */ +module_param(irq, uint, 0); +MODULE_PARM_DESC(irq, "IRQ of the Applicom board"); +module_param(mem, ulong, 0); +MODULE_PARM_DESC(mem, "Shared Memory Address of Applicom board"); + static unsigned int numboards; /* number of installed boards */ static volatile unsigned char Dummy; static DECLARE_WAIT_QUEUE_HEAD(FlagSleepRec); @@ -200,7 +201,7 @@ int __init applicom_init(void) /* No mem and irq given - check for a PCI card */ - while ( (dev = pci_find_class(PCI_CLASS_OTHERS << 16, dev))) { + while ( (dev = pci_get_class(PCI_CLASS_OTHERS << 16, dev))) { if (dev->vendor != PCI_VENDOR_ID_APPLICOM) continue; diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index bfe300b42..6f96e3ce0 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c @@ -74,8 +74,8 @@ static unsigned short translations[][256] = { 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x00a0, 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, - 0x2591, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0xf800, - 0xf801, 0x2500, 0xf803, 0xf804, 0x251c, 0x2524, 0x2534, 0x252c, + 0x2591, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, + 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, diff --git a/drivers/char/cp437.uni b/drivers/char/cp437.uni index b6c0fa040..1f06889a9 100644 --- a/drivers/char/cp437.uni +++ b/drivers/char/cp437.uni @@ -111,7 +111,7 @@ 0x5c U+005c 0x5d U+005d 0x5e U+005e -0x5f U+005f U+f804 +0x5f U+005f U+23bd U+f804 0x60 U+0060 0x61 U+0061 U+00e3 0x62 U+0062 diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 6ceaee64b..6a5337bf0 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -652,12 +652,12 @@ static char rcsid[] = #include #include #include +#include #include #include #include #include -#include #define CY_LOCK(info,flags) \ do { \ @@ -729,8 +729,8 @@ static unsigned int cy_isa_addresses[] = { static long maddr[NR_CARDS] = { 0, }; static int irq[NR_CARDS] = { 0, }; -MODULE_PARM(maddr, "1-" __MODULE_STRING(NR_CARDS) "l"); -MODULE_PARM(irq, "1-" __MODULE_STRING(NR_CARDS) "i"); +module_param_array(maddr, long, NULL, 0); +module_param_array(irq, int, NULL, 0); #endif #endif /* CONFIG_ISA */ @@ -758,7 +758,6 @@ static int cy_next_channel; /* next minor available */ * allocated when the first cy_open occurs. */ static unsigned char *tmp_buf; -DECLARE_MUTEX(tmp_buf_sem); /* * This is used to look up the divisor speeds and the timeouts @@ -2690,20 +2689,16 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout) #ifdef CY_DEBUG_WAIT_UNTIL_SENT printk("Not clean (jiff=%lu)...", jiffies); #endif - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(char_time); - if (signal_pending(current)) + if (msleep_interruptible(jiffies_to_msecs(char_time))) break; if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } - current->state = TASK_RUNNING; } else { // Nothing to do! } /* Run one more char cycle */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(char_time * 5); + msleep_interruptible(jiffies_to_msecs(char_time * 5)); #ifdef CY_DEBUG_WAIT_UNTIL_SENT printk("Clean (jiff=%lu)...done\n", jiffies); #endif @@ -2828,8 +2823,7 @@ cy_close(struct tty_struct *tty, struct file *filp) if (info->blocked_open) { CY_UNLOCK(info, flags); if (info->close_delay) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(info->close_delay); + msleep_interruptible(jiffies_to_msecs(info->close_delay)); } wake_up_interruptible(&info->open_wait); CY_LOCK(info, flags); @@ -2860,8 +2854,7 @@ cy_close(struct tty_struct *tty, struct file *filp) * */ static int -cy_write(struct tty_struct * tty, int from_user, - const unsigned char *buf, int count) +cy_write(struct tty_struct * tty, const unsigned char *buf, int count) { struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; unsigned long flags; @@ -2879,56 +2872,22 @@ cy_write(struct tty_struct * tty, int from_user, return 0; } - if (from_user) { - down(&tmp_buf_sem); - while (1) { - int c1; - - c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1), - (int)(SERIAL_XMIT_SIZE - info->xmit_head))); - if (c <= 0) - break; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!ret) { - ret = -EFAULT; - } - break; - } - CY_LOCK(info, flags); - c1 = min(c, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1), - (int)(SERIAL_XMIT_SIZE - info->xmit_head))); - - if (c1 < c) - c = c1; - memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c); - info->xmit_head = ((info->xmit_head + c) & (SERIAL_XMIT_SIZE-1)); - info->xmit_cnt += c; - CY_UNLOCK(info, flags); - buf += c; - count -= c; - ret += c; - } - up(&tmp_buf_sem); - } else { - CY_LOCK(info, flags); - while (1) { - c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1), + CY_LOCK(info, flags); + while (1) { + c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1), (int)(SERIAL_XMIT_SIZE - info->xmit_head))); - if (c <= 0) - break; + if (c <= 0) + break; - memcpy(info->xmit_buf + info->xmit_head, buf, c); - info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); - info->xmit_cnt += c; - buf += c; - count -= c; - ret += c; - } - CY_UNLOCK(info, flags); + memcpy(info->xmit_buf + info->xmit_head, buf, c); + info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); + info->xmit_cnt += c; + buf += c; + count -= c; + ret += c; } + CY_UNLOCK(info, flags); info->idle_stats.xmit_bytes += ret; info->idle_stats.xmit_idle = jiffies; @@ -4765,7 +4724,7 @@ cy_detect_pci(void) for (i = 0; i < NR_CARDS; i++) { /* look for a Cyclades card by vendor and device id */ while((device_id = cy_pci_dev_id[dev_index]) != 0) { - if((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES, + if((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES, device_id, pdev)) == NULL) { dev_index++; /* try next device id */ } else { @@ -5578,24 +5537,4 @@ cy_cleanup_module(void) module_init(cy_init); module_exit(cy_cleanup_module); -#ifndef MODULE -/* called by linux/init/main.c to parse command line options */ -void -cy_setup(char *str, int *ints) -{ -#ifdef CONFIG_ISA - int i, j; - - for (i = 0 ; i < NR_ISA_ADDRS ; i++) { - if (cy_isa_addresses[i] == 0) break; - } - for (j = 1; j <= ints[0]; j++){ - if ( i < NR_ISA_ADDRS ){ - cy_isa_addresses[i++] = (unsigned char *)(ints[j]); - } - } -#endif /* CONFIG_ISA */ -} /* cy_setup */ -#endif /* MODULE */ - MODULE_LICENSE("GPL"); diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig index 0f210ceaf..4caf68304 100644 --- a/drivers/char/drm/Kconfig +++ b/drivers/char/drm/Kconfig @@ -5,7 +5,8 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. # config DRM - bool "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" + tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" + depends on AGP || AGP=n help Kernel-level support for the Direct Rendering Infrastructure (DRI) introduced in XFree86 4.0. If you say Y here, you need to select @@ -81,7 +82,7 @@ endchoice config DRM_MGA tristate "Matrox g200/g400" - depends on DRM && AGP && (!X86_64 || BROKEN) + depends on DRM && AGP help Choose this option if you have a Matrox G200, G400 or G450 graphics card. If M is selected, the module will be called mga. AGP diff --git a/drivers/char/drm/Makefile b/drivers/char/drm/Makefile index d59102e2e..23ab26321 100644 --- a/drivers/char/drm/Makefile +++ b/drivers/char/drm/Makefile @@ -2,6 +2,12 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. +drm-objs := drm_auth.o drm_bufs.o drm_context.o drm_dma.o drm_drawable.o \ + drm_drv.o drm_fops.o drm_init.o drm_ioctl.o drm_irq.o \ + drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \ + drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \ + drm_sysfs.o + gamma-objs := gamma_drv.o gamma_dma.o tdfx-objs := tdfx_drv.o r128-objs := r128_drv.o r128_cce.o r128_state.o r128_irq.o @@ -13,6 +19,7 @@ radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o ffb-objs := ffb_drv.o ffb_context.o sis-objs := sis_drv.o sis_ds.o sis_mm.o +obj-$(CONFIG_DRM) += drm.o obj-$(CONFIG_DRM_GAMMA) += gamma.o obj-$(CONFIG_DRM_TDFX) += tdfx.o obj-$(CONFIG_DRM_R128) += r128.o diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index 65351d518..ab61660e6 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h @@ -34,6 +34,8 @@ #ifndef _DRM_P_H_ #define _DRM_P_H_ +/* If you want the memory alloc debug functionality, change define below */ +/* #define DEBUG_MEMORY */ #ifdef __KERNEL__ #ifdef __alpha__ @@ -55,6 +57,7 @@ #include #include /* For (un)lock_kernel */ #include +#include #if defined(__alpha__) || defined(__powerpc__) #include /* For pte_wrprotect */ #endif @@ -215,7 +218,8 @@ static inline struct page * vmalloc_to_page(void * vmalloc_addr) */ #define DRM_MEM_ERROR(area, fmt, arg...) \ printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __FUNCTION__, \ - DRM(mem_stats)[area].name , ##arg) + drm_mem_stats[area].name , ##arg) + #define DRM_INFO(fmt, arg...) printk(KERN_INFO "[" DRM_NAME "] " fmt , ##arg) /** @@ -227,7 +231,7 @@ static inline struct page * vmalloc_to_page(void * vmalloc_addr) #if DRM_DEBUG_CODE #define DRM_DEBUG(fmt, arg...) \ do { \ - if ( DRM(flags) & DRM_FLAG_DEBUG ) \ + if ( drm_debug ) \ printk(KERN_DEBUG \ "[" DRM_NAME ":%s] " fmt , \ __FUNCTION__ , ##arg); \ @@ -289,6 +293,18 @@ do { \ } \ } while (0) +/** + * Copy and IOCTL return string to user space + */ +#define DRM_COPY( name, value ) \ + len = strlen( value ); \ + if ( len > name##_len ) len = name##_len; \ + name##_len = strlen( value ); \ + if ( len && name ) { \ + if ( copy_to_user( name, value, len ) ) \ + return -EFAULT; \ + } + /** * Ioctl function type. * @@ -475,7 +491,7 @@ typedef struct drm_agp_mem { /** * AGP data. * - * \sa DRM(agp_init)() and drm_device::agp. + * \sa drm_agp_init() and drm_device::agp. */ typedef struct drm_agp_head { DRM_AGP_KERN agp_info; /**< AGP device information */ @@ -533,19 +549,21 @@ typedef struct drm_vbl_sig { } drm_vbl_sig_t; -/** - * DRM device functions structure +/** + * DRM driver structure. This structure represent the common code for + * a family of cards. There will one drm_device for each card present + * in this family */ struct drm_device; -struct drm_driver_fn { - int (*preinit)(struct drm_device *); - int (*postinit)(struct drm_device *); +struct drm_driver { + int (*preinit)(struct drm_device *, unsigned long flags); void (*prerelease)(struct drm_device *, struct file *filp); void (*pretakedown)(struct drm_device *); int (*postcleanup)(struct drm_device *); int (*presetup)(struct drm_device *); int (*postsetup)(struct drm_device *); + int (*dma_ioctl)( DRM_IOCTL_ARGS ); int (*open_helper)(struct drm_device *, drm_file_t *); void (*free_filp_priv)(struct drm_device *, drm_file_t *); void (*release)(struct drm_device *, struct file *filp); @@ -557,20 +575,27 @@ struct drm_driver_fn { void (*kernel_context_switch_unlock)(struct drm_device *dev, drm_lock_t *lock); int (*vblank_wait)(struct drm_device *dev, unsigned int *sequence); /* these have to be filled in */ + int (*postinit)(struct drm_device *, unsigned long flags); irqreturn_t (*irq_handler)( DRM_IRQ_ARGS ); void (*irq_preinstall)(struct drm_device *dev); void (*irq_postinstall)(struct drm_device *dev); void (*irq_uninstall)(struct drm_device *dev); - void (*reclaim_buffers)(struct file *filp); + void (*reclaim_buffers)(struct drm_device *dev, struct file *filp); unsigned long (*get_map_ofs)(drm_map_t *map); unsigned long (*get_reg_ofs)(struct drm_device *dev); void (*set_version)(struct drm_device *dev, drm_set_version_t *sv); + int (*version)(drm_version_t *version); + u32 driver_features; + int dev_priv_size; + drm_ioctl_desc_t *ioctls; + int num_ioctls; + struct file_operations fops; + struct pci_driver pci_driver; }; /** * DRM device structure. */ typedef struct drm_device { - const char *name; /**< Simple driver name */ char *unique; /**< Unique identifier: e.g., busid */ int unique_len; /**< Length of unique field */ dev_t device; /**< Device number for mknod */ @@ -693,15 +718,22 @@ typedef struct drm_device { drm_sigdata_t sigdata; /**< For block_all_signals */ sigset_t sigmask; - struct drm_driver_fn fn_tbl; + struct drm_driver *driver; drm_local_map_t *agp_buffer_map; - int dev_priv_size; - u32 driver_features; } drm_device_t; +typedef struct drm_minor { + enum { + DRM_MINOR_FREE = 0, + DRM_MINOR_PRIMARY, + } type; + drm_device_t *dev; + struct proc_dir_entry *dev_root; /**< proc directory entry */ +} drm_minor_t; + static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature) { - return ((dev->driver_features & feature) ? 1 : 0); + return ((dev->driver->driver_features & feature) ? 1 : 0); } #if __OS_HAS_AGP @@ -722,250 +754,273 @@ static inline int drm_core_has_MTRR(struct drm_device *dev) #define drm_core_has_MTRR(dev) (0) #endif -extern void DRM(driver_register_fns)(struct drm_device *dev); - /******************************************************************/ /** \name Internal function definitions */ /*@{*/ /* Misc. support (drm_init.h) */ -extern int DRM(flags); -extern void DRM(parse_options)( char *s ); -extern int DRM(cpu_valid)( void ); +extern int drm_flags; +extern void drm_parse_options( char *s ); +extern int drm_cpu_valid( void ); /* Driver support (drm_drv.h) */ -extern int DRM(version)(struct inode *inode, struct file *filp, +extern int drm_init(struct drm_driver *driver); +extern void drm_exit(struct drm_driver *driver); +extern int drm_version(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(open)(struct inode *inode, struct file *filp); -extern int DRM(release)(struct inode *inode, struct file *filp); -extern int DRM(ioctl)(struct inode *inode, struct file *filp, +extern int drm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(lock)(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int DRM(unlock)(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); +extern int drm_takedown(drm_device_t * dev); /* Device support (drm_fops.h) */ -extern int DRM(open_helper)(struct inode *inode, struct file *filp, +extern int drm_open(struct inode *inode, struct file *filp); +extern int drm_stub_open(struct inode *inode, struct file *filp); +extern int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev); -extern int DRM(flush)(struct file *filp); -extern int DRM(fasync)(int fd, struct file *filp, int on); +extern int drm_flush(struct file *filp); +extern int drm_fasync(int fd, struct file *filp, int on); +extern int drm_release(struct inode *inode, struct file *filp); /* Mapping support (drm_vm.h) */ -extern void DRM(vm_open)(struct vm_area_struct *vma); -extern void DRM(vm_close)(struct vm_area_struct *vma); -extern void DRM(vm_shm_close)(struct vm_area_struct *vma); -extern int DRM(mmap_dma)(struct file *filp, +extern void drm_vm_open(struct vm_area_struct *vma); +extern void drm_vm_close(struct vm_area_struct *vma); +extern void drm_vm_shm_close(struct vm_area_struct *vma); +extern int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma); -extern int DRM(mmap)(struct file *filp, struct vm_area_struct *vma); -extern unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait); -extern ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off); +extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); +extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); +extern ssize_t drm_read(struct file *filp, char __user *buf, size_t count, loff_t *off); /* Memory management support (drm_memory.h) */ -extern void DRM(mem_init)(void); -extern int DRM(mem_info)(char *buf, char **start, off_t offset, +#include "drm_memory.h" +extern void drm_mem_init(void); +extern int drm_mem_info(char *buf, char **start, off_t offset, int request, int *eof, void *data); -extern void *DRM(alloc)(size_t size, int area); -extern void *DRM(calloc)(size_t nmemb, size_t size, int area); -extern void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, +extern void *drm_calloc(size_t nmemb, size_t size, int area); +extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); -extern void DRM(free)(void *pt, size_t size, int area); -extern unsigned long DRM(alloc_pages)(int order, int area); -extern void DRM(free_pages)(unsigned long address, int order, +extern unsigned long drm_alloc_pages(int order, int area); +extern void drm_free_pages(unsigned long address, int order, int area); -extern void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev); -extern void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, +extern void *drm_ioremap(unsigned long offset, unsigned long size, drm_device_t *dev); +extern void *drm_ioremap_nocache(unsigned long offset, unsigned long size, drm_device_t *dev); -extern void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev); +extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev); -extern DRM_AGP_MEM *DRM(alloc_agp)(int pages, u32 type); -extern int DRM(free_agp)(DRM_AGP_MEM *handle, int pages); -extern int DRM(bind_agp)(DRM_AGP_MEM *handle, unsigned int start); -extern int DRM(unbind_agp)(DRM_AGP_MEM *handle); +extern DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type); +extern int drm_free_agp(DRM_AGP_MEM *handle, int pages); +extern int drm_bind_agp(DRM_AGP_MEM *handle, unsigned int start); +extern int drm_unbind_agp(DRM_AGP_MEM *handle); /* Misc. IOCTL support (drm_ioctl.h) */ -extern int DRM(irq_by_busid)(struct inode *inode, struct file *filp, +extern int drm_irq_by_busid(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(getunique)(struct inode *inode, struct file *filp, +extern int drm_getunique(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(setunique)(struct inode *inode, struct file *filp, +extern int drm_setunique(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(getmap)(struct inode *inode, struct file *filp, +extern int drm_getmap(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(getclient)(struct inode *inode, struct file *filp, +extern int drm_getclient(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(getstats)(struct inode *inode, struct file *filp, +extern int drm_getstats(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(setversion)(struct inode *inode, struct file *filp, +extern int drm_setversion(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* Context IOCTL support (drm_context.h) */ -extern int DRM(resctx)( struct inode *inode, struct file *filp, +extern int drm_resctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(addctx)( struct inode *inode, struct file *filp, +extern int drm_addctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(modctx)( struct inode *inode, struct file *filp, +extern int drm_modctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(getctx)( struct inode *inode, struct file *filp, +extern int drm_getctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(switchctx)( struct inode *inode, struct file *filp, +extern int drm_switchctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(newctx)( struct inode *inode, struct file *filp, +extern int drm_newctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(rmctx)( struct inode *inode, struct file *filp, +extern int drm_rmctx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(context_switch)(drm_device_t *dev, int old, int new); -extern int DRM(context_switch_complete)(drm_device_t *dev, int new); +extern int drm_context_switch(drm_device_t *dev, int old, int new); +extern int drm_context_switch_complete(drm_device_t *dev, int new); -extern int DRM(ctxbitmap_init)( drm_device_t *dev ); -extern void DRM(ctxbitmap_cleanup)( drm_device_t *dev ); +extern int drm_ctxbitmap_init( drm_device_t *dev ); +extern void drm_ctxbitmap_cleanup( drm_device_t *dev ); +extern void drm_ctxbitmap_free( drm_device_t *dev, int ctx_handle ); -extern int DRM(setsareactx)( struct inode *inode, struct file *filp, +extern int drm_setsareactx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(getsareactx)( struct inode *inode, struct file *filp, +extern int drm_getsareactx( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); /* Drawable IOCTL support (drm_drawable.h) */ -extern int DRM(adddraw)(struct inode *inode, struct file *filp, +extern int drm_adddraw(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(rmdraw)(struct inode *inode, struct file *filp, +extern int drm_rmdraw(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* Authentication IOCTL support (drm_auth.h) */ -extern int DRM(add_magic)(drm_device_t *dev, drm_file_t *priv, +extern int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic); -extern int DRM(remove_magic)(drm_device_t *dev, drm_magic_t magic); -extern int DRM(getmagic)(struct inode *inode, struct file *filp, +extern int drm_remove_magic(drm_device_t *dev, drm_magic_t magic); +extern int drm_getmagic(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(authmagic)(struct inode *inode, struct file *filp, +extern int drm_authmagic(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* Placeholder for ioctls past */ -extern int DRM(noop)(struct inode *inode, struct file *filp, +extern int drm_noop(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* Locking IOCTL support (drm_lock.h) */ -extern int DRM(lock_take)(__volatile__ unsigned int *lock, +extern int drm_lock(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg); +extern int drm_unlock(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg); +extern int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context); -extern int DRM(lock_transfer)(drm_device_t *dev, +extern int drm_lock_transfer(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context); -extern int DRM(lock_free)(drm_device_t *dev, +extern int drm_lock_free(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context); -extern int DRM(notifier)(void *priv); +extern int drm_notifier(void *priv); /* Buffer management support (drm_bufs.h) */ -extern int DRM(order)( unsigned long size ); -extern int DRM(addmap)( struct inode *inode, struct file *filp, +extern int drm_order( unsigned long size ); +extern int drm_addmap( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(rmmap)( struct inode *inode, struct file *filp, +extern int drm_rmmap( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(addbufs)( struct inode *inode, struct file *filp, +extern int drm_addbufs( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(infobufs)( struct inode *inode, struct file *filp, +extern int drm_infobufs( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(markbufs)( struct inode *inode, struct file *filp, +extern int drm_markbufs( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(freebufs)( struct inode *inode, struct file *filp, +extern int drm_freebufs( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(mapbufs)( struct inode *inode, struct file *filp, +extern int drm_mapbufs( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); /* DMA support (drm_dma.h) */ -extern int DRM(dma_setup)(drm_device_t *dev); -extern void DRM(dma_takedown)(drm_device_t *dev); -extern void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf); -extern void DRM(reclaim_buffers)( struct file *filp ); +extern int drm_dma_setup(drm_device_t *dev); +extern void drm_dma_takedown(drm_device_t *dev); +extern void drm_free_buffer(drm_device_t *dev, drm_buf_t *buf); +extern void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp); /* IRQ support (drm_irq.h) */ -extern int DRM(control)( struct inode *inode, struct file *filp, +extern int drm_control( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); -extern int DRM(irq_install)( drm_device_t *dev ); -extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS ); -extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); -extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); -extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); - -extern int DRM(wait_vblank)(struct inode *inode, struct file *filp, +extern int drm_irq_install( drm_device_t *dev ); +extern int drm_irq_uninstall( drm_device_t *dev ); +extern irqreturn_t drm_irq_handler( DRM_IRQ_ARGS ); +extern void drm_driver_irq_preinstall( drm_device_t *dev ); +extern void drm_driver_irq_postinstall( drm_device_t *dev ); +extern void drm_driver_irq_uninstall( drm_device_t *dev ); + +extern int drm_wait_vblank(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq); -extern void DRM(vbl_send_signals)( drm_device_t *dev ); +extern int drm_vblank_wait(drm_device_t *dev, unsigned int *vbl_seq); +extern void drm_vbl_send_signals( drm_device_t *dev ); /* AGP/GART support (drm_agpsupport.h) */ -extern drm_agp_head_t *DRM(agp_init)(void); -extern void DRM(agp_uninit)(void); -extern int DRM(agp_acquire)(struct inode *inode, struct file *filp, +extern drm_agp_head_t *drm_agp_init(void); +extern int drm_agp_acquire(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void DRM(agp_do_release)(void); -extern int DRM(agp_release)(struct inode *inode, struct file *filp, +extern void drm_agp_do_release(void); +extern int drm_agp_release(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_enable)(struct inode *inode, struct file *filp, +extern int drm_agp_enable(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_info)(struct inode *inode, struct file *filp, +extern int drm_agp_info(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_alloc)(struct inode *inode, struct file *filp, +extern int drm_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_free)(struct inode *inode, struct file *filp, +extern int drm_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_unbind)(struct inode *inode, struct file *filp, +extern int drm_agp_unbind(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(agp_bind)(struct inode *inode, struct file *filp, +extern int drm_agp_bind(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern DRM_AGP_MEM *DRM(agp_allocate_memory)(size_t pages, u32 type); -extern int DRM(agp_free_memory)(DRM_AGP_MEM *handle); -extern int DRM(agp_bind_memory)(DRM_AGP_MEM *handle, off_t start); -extern int DRM(agp_unbind_memory)(DRM_AGP_MEM *handle); +extern DRM_AGP_MEM *drm_agp_allocate_memory(size_t pages, u32 type); +extern int drm_agp_free_memory(DRM_AGP_MEM *handle); +extern int drm_agp_bind_memory(DRM_AGP_MEM *handle, off_t start); +extern int drm_agp_unbind_memory(DRM_AGP_MEM *handle); /* Stub support (drm_stub.h) */ -int DRM(stub_register)(const char *name, - struct file_operations *fops, - drm_device_t *dev); -int DRM(stub_unregister)(int minor); +extern int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); + +extern int drm_put_minor(drm_device_t *dev); +extern unsigned int drm_debug; +extern unsigned int drm_cards_limit; +extern drm_minor_t *drm_minors; +extern struct drm_sysfs_class *drm_class; +extern struct proc_dir_entry *drm_proc_root; /* Proc support (drm_proc.h) */ -extern struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, +extern int drm_proc_init(drm_device_t *dev, int minor, struct proc_dir_entry *root, struct proc_dir_entry **dev_root); -extern int DRM(proc_cleanup)(int minor, +extern int drm_proc_cleanup(int minor, struct proc_dir_entry *root, struct proc_dir_entry *dev_root); /* Scatter Gather Support (drm_scatter.h) */ -extern void DRM(sg_cleanup)(drm_sg_mem_t *entry); -extern int DRM(sg_alloc)(struct inode *inode, struct file *filp, +extern void drm_sg_cleanup(drm_sg_mem_t *entry); +extern int drm_sg_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern int DRM(sg_free)(struct inode *inode, struct file *filp, +extern int drm_sg_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* ATI PCIGART support (ati_pcigart.h) */ -extern int DRM(ati_pcigart_init)(drm_device_t *dev, +extern int drm_ati_pcigart_init(drm_device_t *dev, unsigned long *addr, dma_addr_t *bus_addr); -extern int DRM(ati_pcigart_cleanup)(drm_device_t *dev, +extern int drm_ati_pcigart_cleanup(drm_device_t *dev, unsigned long addr, dma_addr_t bus_addr); +extern void *drm_pci_alloc(drm_device_t * dev, size_t size, + size_t align, dma_addr_t maxaddr, + dma_addr_t * busaddr); + +extern void drm_pci_free(drm_device_t * dev, size_t size, + void *vaddr, dma_addr_t busaddr); + + /* sysfs support (drm_sysfs.c) */ +struct drm_sysfs_class; +extern struct drm_sysfs_class *drm_sysfs_create(struct module *owner, + char *name); +extern void drm_sysfs_destroy(struct drm_sysfs_class *cs); +extern struct class_device *drm_sysfs_device_add(struct drm_sysfs_class *cs, + dev_t dev, + struct device *device, + const char *fmt, ...); +extern void drm_sysfs_device_remove(dev_t dev); + /* Inline replacements for DRM_IOREMAP macros */ static __inline__ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev) { - map->handle = DRM(ioremap)( map->offset, map->size, dev ); + map->handle = drm_ioremap( map->offset, map->size, dev ); } static __inline__ void drm_core_ioremap_nocache(struct drm_map *map, struct drm_device *dev) { - map->handle = DRM(ioremap_nocache)(map->offset, map->size, dev); + map->handle = drm_ioremap_nocache(map->offset, map->size, dev); } static __inline__ void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev) { if ( map->handle && map->size ) - DRM(ioremapfree)( map->handle, map->size, dev ); + drm_ioremapfree( map->handle, map->size, dev ); } static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned long offset) @@ -984,10 +1039,28 @@ static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsig static __inline__ void drm_core_dropmap(struct drm_map *map) { } + +#ifndef DEBUG_MEMORY +/** Wrapper around kmalloc() */ +static __inline__ void *drm_alloc(size_t size, int area) +{ + return kmalloc(size, GFP_KERNEL); +} + +/** Wrapper around kfree() */ +static __inline__ void drm_free(void *pt, size_t size, int area) +{ + kfree(pt); +} +#else +extern void *drm_alloc(size_t size, int area); +extern void drm_free(void *pt, size_t size, int area); +#endif + /*@}*/ -extern unsigned long DRM(core_get_map_ofs)(drm_map_t *map); -extern unsigned long DRM(core_get_reg_ofs)(struct drm_device *dev); +extern unsigned long drm_core_get_map_ofs(drm_map_t *map); +extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); #endif /* __KERNEL__ */ #endif diff --git a/drivers/char/drm/drm_core.h b/drivers/char/drm/drm_core.h index 8ebab5a7e..d4c612e2e 100644 --- a/drivers/char/drm/drm_core.h +++ b/drivers/char/drm/drm_core.h @@ -20,21 +20,15 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ +#define DRIVER_AUTHOR "Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl" -#include "drm_auth.h" -#include "drm_agpsupport.h" -#include "drm_bufs.h" -#include "drm_context.h" -#include "drm_dma.h" -#include "drm_irq.h" -#include "drm_drawable.h" -#include "drm_drv.h" -#include "drm_fops.h" -#include "drm_init.h" -#include "drm_ioctl.h" -#include "drm_lock.h" -#include "drm_memory.h" -#include "drm_proc.h" -#include "drm_vm.h" -#include "drm_stub.h" -#include "drm_scatter.h" +#define DRIVER_NAME "drm" +#define DRIVER_DESC "DRM shared core routines" +#define DRIVER_DATE "20040925" + +#define DRM_IF_MAJOR 1 +#define DRM_IF_MINOR 2 + +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 0 +#define DRIVER_PATCHLEVEL 0 diff --git a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h index c68e8d5eb..422b94268 100644 --- a/drivers/char/drm/drm_memory.h +++ b/drivers/char/drm/drm_memory.h @@ -35,14 +35,13 @@ #include #include +#include #include "drmP.h" /** * Cut down version of drm_memory_debug.h, which used to be called - * drm_memory.h. If you want the debug functionality, change 0 to 1 - * below. + * drm_memory.h. */ -#define DEBUG_MEMORY 0 #if __OS_HAS_AGP @@ -58,8 +57,6 @@ # endif #endif -#include - /* * Find the drm_map that covers the range [offset, offset+size). */ @@ -125,7 +122,8 @@ static inline unsigned long drm_follow_page (void *vaddr) { pgd_t *pgd = pgd_offset_k((unsigned long) vaddr); - pmd_t *pmd = pmd_offset(pgd, (unsigned long) vaddr); + pud_t *pud = pud_offset(pgd, (unsigned long) vaddr); + pmd_t *pmd = pmd_offset(pud, (unsigned long) vaddr); pte_t *ptep = pte_offset_kernel(pmd, (unsigned long) vaddr); return pte_pfn(*ptep) << PAGE_SHIFT; } @@ -197,173 +195,3 @@ static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *d } -#if DEBUG_MEMORY -#include "drm_memory_debug.h" -#else - -/** No-op. */ -void DRM(mem_init)(void) -{ -} - -/** - * Called when "/proc/dri/%dev%/mem" is read. - * - * \param buf output buffer. - * \param start start of output data. - * \param offset requested start offset. - * \param len requested number of bytes. - * \param eof whether there is no more data to return. - * \param data private data. - * \return number of written bytes. - * - * No-op. - */ -int DRM(mem_info)(char *buf, char **start, off_t offset, - int len, int *eof, void *data) -{ - return 0; -} - -/** Wrapper around kmalloc() */ -void *DRM(alloc)(size_t size, int area) -{ - return kmalloc(size, GFP_KERNEL); -} - -/** Wrapper around kmalloc() */ -void *DRM(calloc)(size_t size, size_t nmemb, int area) -{ - void *addr; - - addr = kmalloc(size * nmemb, GFP_KERNEL); - if (addr != NULL) - memset((void *)addr, 0, size * nmemb); - - return addr; -} - -/** Wrapper around kmalloc() and kfree() */ -void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area) -{ - void *pt; - - if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL; - if (oldpt && oldsize) { - memcpy(pt, oldpt, oldsize); - kfree(oldpt); - } - return pt; -} - -/** Wrapper around kfree() */ -void DRM(free)(void *pt, size_t size, int area) -{ - kfree(pt); -} - -/** - * Allocate pages. - * - * \param order size order. - * \param area memory area. (Not used.) - * \return page address on success, or zero on failure. - * - * Allocate and reserve free pages. - */ -unsigned long DRM(alloc_pages)(int order, int area) -{ - unsigned long address; - unsigned long bytes = PAGE_SIZE << order; - unsigned long addr; - unsigned int sz; - - address = __get_free_pages(GFP_KERNEL, order); - if (!address) - return 0; - - /* Zero */ - memset((void *)address, 0, bytes); - - /* Reserve */ - for (addr = address, sz = bytes; - sz > 0; - addr += PAGE_SIZE, sz -= PAGE_SIZE) { - SetPageReserved(virt_to_page(addr)); - } - - return address; -} - -/** - * Free pages. - * - * \param address address of the pages to free. - * \param order size order. - * \param area memory area. (Not used.) - * - * Unreserve and free pages allocated by alloc_pages(). - */ -void DRM(free_pages)(unsigned long address, int order, int area) -{ - unsigned long bytes = PAGE_SIZE << order; - unsigned long addr; - unsigned int sz; - - if (!address) - return; - - /* Unreserve */ - for (addr = address, sz = bytes; - sz > 0; - addr += PAGE_SIZE, sz -= PAGE_SIZE) { - ClearPageReserved(virt_to_page(addr)); - } - - free_pages(address, order); -} - -/** Wrapper around drm_ioremap() */ -void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev) -{ - return drm_ioremap(offset, size, dev); -} - -/** Wrapper around drm_ioremap_nocache() */ -void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_t *dev) -{ - return drm_ioremap_nocache(offset, size, dev); -} - -/** Wrapper around drm_iounmap() */ -void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) -{ - drm_ioremapfree(pt, size, dev); -} - -#if __OS_HAS_AGP -/** Wrapper around agp_allocate_memory() */ -DRM_AGP_MEM *DRM(alloc_agp)(int pages, u32 type) -{ - return DRM(agp_allocate_memory)(pages, type); -} - -/** Wrapper around agp_free_memory() */ -int DRM(free_agp)(DRM_AGP_MEM *handle, int pages) -{ - return DRM(agp_free_memory)(handle) ? 0 : -EINVAL; -} - -/** Wrapper around agp_bind_memory() */ -int DRM(bind_agp)(DRM_AGP_MEM *handle, unsigned int start) -{ - return DRM(agp_bind_memory)(handle, start); -} - -/** Wrapper around agp_unbind_memory() */ -int DRM(unbind_agp)(DRM_AGP_MEM *handle) -{ - return DRM(agp_unbind_memory)(handle); -} -#endif /* agp */ -#endif /* debug_memory */ diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h index 0053679a8..2c82e69a7 100644 --- a/drivers/char/drm/drm_memory_debug.h +++ b/drivers/char/drm/drm_memory_debug.h @@ -43,7 +43,7 @@ typedef struct drm_mem_stats { unsigned long bytes_freed; } drm_mem_stats_t; -static spinlock_t DRM(mem_lock) = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(DRM(mem_lock)); static unsigned long DRM(ram_available) = 0; /* In pages */ static unsigned long DRM(ram_used) = 0; static drm_mem_stats_t DRM(mem_stats)[] = { @@ -167,7 +167,7 @@ void *DRM(alloc)(size_t size, int area) return pt; } -void *DRM(calloc)(size_t size, size_t nmemb, int area) +void *DRM(calloc)(size_t nmemb, size_t size, int area) { void *addr; diff --git a/drivers/char/drm/drm_os_linux.h b/drivers/char/drm/drm_os_linux.h index 242e311a2..3247e14b5 100644 --- a/drivers/char/drm/drm_os_linux.h +++ b/drivers/char/drm/drm_os_linux.h @@ -96,14 +96,6 @@ static __inline__ int mtrr_del (int reg, unsigned long base, __copy_to_user(arg1, arg2, arg3) #define DRM_GET_USER_UNCHECKED(val, uaddr) \ __get_user(val, uaddr) -#define DRM_PUT_USER_UNCHECKED(uaddr, val) \ - __put_user(val, uaddr) - - -/** 'malloc' without the overhead of DRM(alloc)() */ -#define DRM_MALLOC(x) kmalloc(x, GFP_KERNEL) -/** 'free' without the overhead of DRM(free)() */ -#define DRM_FREE(x,size) kfree(x) #define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h index 768c131d2..5d10ae302 100644 --- a/drivers/char/drm/drm_pciids.h +++ b/drivers/char/drm/drm_pciids.h @@ -3,64 +3,75 @@ Please contact dri-devel@lists.sf.net to add new cards to this list */ #define radeon_PCI_IDS \ - {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4137, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4966, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4967, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C57, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C58, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C59, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C5A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C65, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5144, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5145, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5146, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5147, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5148, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x514F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5158, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5159, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x515A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5168, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x516A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x516B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x516C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5963, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5968, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x596A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x596B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5c62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ - {0x1002, 0x5c64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|CHIP_IS_IGP}, \ + {0x1002, 0x4137, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|CHIP_IS_IGP}, \ + {0x1002, 0x4144, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4145, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4146, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4147, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ + {0x1002, 0x4150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4153, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ + {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS250|CHIP_IS_IGP}, \ + {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x4243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|CHIP_IS_IGP|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|CHIP_IS_IGP|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS250|CHIP_IS_IGP|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250}, \ + {0x1002, 0x4965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250}, \ + {0x1002, 0x4966, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250}, \ + {0x1002, 0x4967, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250}, \ + {0x1002, 0x4C57, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV200|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C58, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV200|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C59, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C5A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C65, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R250|CHIP_IS_MOBILITY}, \ + {0x1002, 0x4E50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350|CHIP_IS_MOBILITY}, \ + {0x1002, 0x5144, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R100|CHIP_SINGLE_CRTC}, \ + {0x1002, 0x5145, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R100|CHIP_SINGLE_CRTC}, \ + {0x1002, 0x5146, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R100|CHIP_SINGLE_CRTC}, \ + {0x1002, 0x5147, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R100|CHIP_SINGLE_CRTC}, \ + {0x1002, 0x5148, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x5149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x514F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x5157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV200}, \ + {0x1002, 0x5158, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV200}, \ + {0x1002, 0x5159, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ + {0x1002, 0x515A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ + {0x1002, 0x5168, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x5169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x516A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x516B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x516C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ + {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|CHIP_IS_IGP}, \ + {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|CHIP_IS_IGP|CHIP_IS_MOBILITY}, \ + {0x1002, 0x5836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|CHIP_IS_IGP}, \ + {0x1002, 0x5837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|CHIP_IS_IGP}, \ + {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5963, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5968, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x596A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x596B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \ + {0x1002, 0x5c62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ + {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \ + {0x1002, 0x5c64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ {0, 0, 0} #define r128_PCI_IDS \ @@ -207,5 +218,6 @@ {0x8086, 0x3582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ + {0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ {0, 0, 0} diff --git a/drivers/char/drm/ffb_drv.c b/drivers/char/drm/ffb_drv.c index 2e1522e7c..ec614fff8 100644 --- a/drivers/char/drm/ffb_drv.c +++ b/drivers/char/drm/ffb_drv.c @@ -210,32 +210,17 @@ unsigned long ffb_get_unmapped_area(struct file *filp, return addr; } -#include "drm_core.h" - -/* This functions must be here since it references DRM(numdevs) - * which drm_drv.h declares. - */ static int ffb_presetup(drm_device_t *dev) { ffb_dev_priv_t *ffb_priv; - drm_device_t *temp_dev; int ret = 0; - int i; + int i = 0; /* Check for the case where no device was found. */ if (ffb_position == NULL) return -ENODEV; - /* Find our instance number by finding our device in dev structure */ - for (i = 0; i < DRM(numdevs); i++) { - temp_dev = &(DRM(device)[i]); - if(temp_dev == dev) - break; - } - - if (i == DRM(numdevs)) - return -ENODEV; - + /* code used to use numdevs no numdevs anymore */ ffb_priv = kmalloc(sizeof(ffb_dev_priv_t), GFP_KERNEL); if (!ffb_priv) return -ENOMEM; @@ -307,16 +292,74 @@ static unsigned long ffb_driver_get_reg_ofs(drm_device_t *dev) return 0; } -void ffb_driver_register_fns(drm_device_t *dev) +static int postinit( struct drm_device *dev, unsigned long flags ) { - ffb_set_context_ioctls(); - DRM(fops).get_unmapped_area = ffb_get_unmapped_area; - dev->fn_tbl.release = ffb_driver_release; - dev->fn_tbl.presetup = ffb_presetup; - dev->fn_tbl.pretakedown = ffb_driver_pretakedown; - dev->fn_tbl.postcleanup = ffb_driver_postcleanup; - dev->fn_tbl.kernel_context_switch = ffb_context_switch; - dev->fn_tbl.kernel_context_switch_unlock = ffb_driver_kernel_context_switch_unlock; - dev->fn_tbl.get_map_ofs = ffb_driver_get_map_ofs; - dev->fn_tbl.get_reg_ofs = ffb_driver_get_reg_ofs; + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor + ); + return 0; } + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static drm_ioctl_desc_t ioctls[] = { + +}; + +static struct drm_driver driver = { + .driver_features = 0, + .dev_priv_size = sizeof(u32), + .release = ffb_driver_release, + .presetup = ffb_presetup, + .pretakedown = ffb_driver_pretakedown, + .postcleanup = ffb_driver_postcleanup, + .kernel_context_switch = ffb_driver_context_switch, + .kernel_context_switch_unlock = ffb_driver_kernel_context_switch_unlock, + .get_map_ofs = ffb_driver_get_map_ofs, + .get_reg_ofs = ffb_driver_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = ioctls, + .num_ioctls = DRM_ARRAY_SIZE(ioctls), + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, +}; + +static int __init ffb_init(void) +{ + return -ENODEV; +} + +static void __exit ffb_exit(void) +{ +} + +module_init(ffb_init); +module_exit(ffb_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/ffb_drv.h b/drivers/char/drm/ffb_drv.h index 3b3546715..8bf7f1e14 100644 --- a/drivers/char/drm/ffb_drv.h +++ b/drivers/char/drm/ffb_drv.h @@ -275,7 +275,6 @@ typedef struct ffb_dev_priv { struct ffb_hw_context *hw_state[FFB_MAX_CTXS]; } ffb_dev_priv_t; -extern struct file_operations DRM(fops); extern unsigned long ffb_get_unmapped_area(struct file *filp, unsigned long hint, unsigned long len, @@ -284,3 +283,4 @@ extern unsigned long ffb_get_unmapped_area(struct file *filp, extern void ffb_set_context_ioctls(void); extern drm_ioctl_desc_t DRM(ioctls)[]; +extern int ffb_driver_context_switch(drm_device_t *dev, int old, int new); diff --git a/drivers/char/drm/gamma_dma.c b/drivers/char/drm/gamma_dma.c index 7e01ca182..e486fb8d3 100644 --- a/drivers/char/drm/gamma_dma.c +++ b/drivers/char/drm/gamma_dma.c @@ -937,10 +937,10 @@ void gamma_driver_register_fns(drm_device_t *dev) dev->driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ; DRM(fops).read = gamma_fops_read; DRM(fops).poll = gamma_fops_poll; - dev->fn_tbl.preinit = gamma_driver_preinit; - dev->fn_tbl.pretakedown = gamma_driver_pretakedown; - dev->fn_tbl.dma_ready = gamma_driver_dma_ready; - dev->fn_tbl.dma_quiescent = gamma_driver_dma_quiescent; - dev->fn_tbl.dma_flush_block_and_flush = gamma_flush_block_and_flush; - dev->fn_tbl.dma_flush_unblock = gamma_flush_unblock; + dev->driver.preinit = gamma_driver_preinit; + dev->driver.pretakedown = gamma_driver_pretakedown; + dev->driver.dma_ready = gamma_driver_dma_ready; + dev->driver.dma_quiescent = gamma_driver_dma_quiescent; + dev->driver.dma_flush_block_and_flush = gamma_flush_block_and_flush; + dev->driver.dma_flush_unblock = gamma_flush_unblock; } diff --git a/drivers/char/drm/gamma_lists.h b/drivers/char/drm/gamma_lists.h index d42d7d3a5..2d93f412b 100644 --- a/drivers/char/drm/gamma_lists.h +++ b/drivers/char/drm/gamma_lists.h @@ -45,8 +45,8 @@ int DRM(waitlist_create)(drm_waitlist_t *bl, int count) bl->rp = bl->bufs; bl->wp = bl->bufs; bl->end = &bl->bufs[bl->count+1]; - bl->write_lock = SPIN_LOCK_UNLOCKED; - bl->read_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&bl->write_lock); + spin_lock_init(&bl->read_lock); return 0; } @@ -110,7 +110,7 @@ int DRM(freelist_create)(drm_freelist_t *bl, int count) bl->low_mark = 0; bl->high_mark = 0; atomic_set(&bl->wfh, 0); - bl->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&bl->lock); ++bl->initialized; return 0; } diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c index d9348ac71..3d6200ccd 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/char/drm/i810_dma.c @@ -30,7 +30,6 @@ * */ -#include "i810.h" #include "drmP.h" #include "drm.h" #include "i810_drm.h" @@ -51,23 +50,25 @@ #define up_write up #endif -static inline void i810_print_status_page(drm_device_t *dev) -{ - drm_device_dma_t *dma = dev->dma; - drm_i810_private_t *dev_priv = dev->dev_private; - u32 *temp = dev_priv->hw_status_page; - int i; +drm_ioctl_desc_t i810_ioctls[] = { + [DRM_IOCTL_NR(DRM_I810_INIT)] = { i810_dma_init, 1, 1 }, + [DRM_IOCTL_NR(DRM_I810_VERTEX)] = { i810_dma_vertex, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_CLEAR)] = { i810_clear_bufs, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_FLUSH)] = { i810_flush_ioctl, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_GETAGE)] = { i810_getage, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_GETBUF)] = { i810_getbuf, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_SWAP)] = { i810_swap_bufs, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_COPY)] = { i810_copybuf, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_DOCOPY)] = { i810_docopy, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_OV0INFO)] = { i810_ov0_info, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_FSTATUS)] = { i810_fstatus, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_OV0FLIP)] = { i810_ov0_flip, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_MC)] = { i810_dma_mc, 1, 1 }, + [DRM_IOCTL_NR(DRM_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, + [DRM_IOCTL_NR(DRM_I810_FLIP)] = { i810_flip_bufs, 1, 0 } +}; - DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]); - DRM_DEBUG( "hw_status: LpRing Head ptr : %x\n", temp[1]); - DRM_DEBUG( "hw_status: IRing Head ptr : %x\n", temp[2]); - DRM_DEBUG( "hw_status: Reserved : %x\n", temp[3]); - DRM_DEBUG( "hw_status: Last Render: %x\n", temp[4]); - DRM_DEBUG( "hw_status: Driver Counter : %d\n", temp[5]); - for(i = 6; i < dma->buf_count + 6; i++) { - DRM_DEBUG( "buffer status idx : %d used: %d\n", i - 6, temp[i]); - } -} +int i810_max_ioctl = DRM_ARRAY_SIZE(i810_ioctls); static drm_buf_t *i810_freelist_get(drm_device_t *dev) { @@ -110,12 +111,12 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf) } static struct file_operations i810_buffer_fops = { - .open = DRM(open), - .flush = DRM(flush), - .release = DRM(release), - .ioctl = DRM(ioctl), + .open = drm_open, + .flush = drm_flush, + .release = drm_release, + .ioctl = drm_ioctl, .mmap = i810_mmap_buffers, - .fasync = DRM(fasync), + .fasync = drm_fasync, }; int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) @@ -138,8 +139,8 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) buf_priv->currently_mapped = I810_BUF_MAPPED; unlock_kernel(); - if (remap_page_range(DRM_RPR_ARG(vma) vma->vm_start, - VM_OFFSET(vma), + if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start, + VM_OFFSET(vma) >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; return 0; @@ -237,7 +238,7 @@ int i810_dma_cleanup(drm_device_t *dev) * is freed, it's too late. */ if (drm_core_check_feature(dev, DRIVER_HAVE_IRQ) && dev->irq_enabled) - DRM(irq_uninstall)(dev); + drm_irq_uninstall(dev); if (dev->dev_private) { int i; @@ -245,7 +246,7 @@ int i810_dma_cleanup(drm_device_t *dev) (drm_i810_private_t *) dev->dev_private; if (dev_priv->ring.virtual_start) { - DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, + drm_ioremapfree((void *) dev_priv->ring.virtual_start, dev_priv->ring.Size, dev); } if (dev_priv->hw_status_page) { @@ -255,7 +256,7 @@ int i810_dma_cleanup(drm_device_t *dev) /* Need to rewrite hardware status page */ I810_WRITE(0x02080, 0x1ffff000); } - DRM(free)(dev->dev_private, sizeof(drm_i810_private_t), + drm_free(dev->dev_private, sizeof(drm_i810_private_t), DRM_MEM_DRIVER); dev->dev_private = NULL; @@ -263,7 +264,7 @@ int i810_dma_cleanup(drm_device_t *dev) drm_buf_t *buf = dma->buflist[ i ]; drm_i810_buf_priv_t *buf_priv = buf->dev_private; if ( buf_priv->kernel_virtual && buf->total ) - DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total, dev); + drm_ioremapfree(buf_priv->kernel_virtual, buf->total, dev); } } return 0; @@ -334,7 +335,7 @@ static int i810_freelist_init(drm_device_t *dev, drm_i810_private_t *dev_priv) *buf_priv->in_use = I810_BUF_FREE; - buf_priv->kernel_virtual = DRM(ioremap)(buf->bus_address, + buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, buf->total, dev); } return 0; @@ -386,7 +387,7 @@ static int i810_dma_initialize(drm_device_t *dev, dev_priv->ring.End = init->ring_end; dev_priv->ring.Size = init->ring_size; - dev_priv->ring.virtual_start = DRM(ioremap)(dev->agp->base + + dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + init->ring_start, init->ring_size, dev); @@ -510,7 +511,7 @@ int i810_dma_init(struct inode *inode, struct file *filp, if (retcode) return retcode; - dev_priv = DRM(alloc)(sizeof(drm_i810_private_t), + dev_priv = drm_alloc(sizeof(drm_i810_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) return -ENOMEM; @@ -524,7 +525,7 @@ int i810_dma_init(struct inode *inode, struct file *filp, sizeof(drm_i810_init_t))) { return -EFAULT; } - dev_priv = DRM(alloc)(sizeof(drm_i810_private_t), + dev_priv = drm_alloc(sizeof(drm_i810_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) return -ENOMEM; @@ -995,10 +996,8 @@ static int i810_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i810_reclaim_buffers(struct file *filp) +void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1030,10 +1029,7 @@ int i810_flush_ioctl(struct inode *inode, struct file *filp, drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_flush_ioctl called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); i810_flush_queue(dev); return 0; @@ -1055,10 +1051,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp, if (copy_from_user(&vertex, (drm_i810_vertex_t __user *)arg, sizeof(vertex))) return -EFAULT; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_dma_vertex called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", vertex.idx, vertex.used, vertex.discard); @@ -1090,10 +1083,7 @@ int i810_clear_bufs(struct inode *inode, struct file *filp, if (copy_from_user(&clear, (drm_i810_clear_t __user *)arg, sizeof(clear))) return -EFAULT; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_clear_bufs called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); /* GH: Someone's doing nasty things... */ if (!dev->dev_private) { @@ -1114,10 +1104,7 @@ int i810_swap_bufs(struct inode *inode, struct file *filp, DRM_DEBUG("i810_swap_bufs\n"); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_swap_buf called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); i810_dma_dispatch_swap( dev ); return 0; @@ -1152,10 +1139,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, if (copy_from_user(&d, (drm_i810_dma_t __user *)arg, sizeof(d))) return -EFAULT; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_dma called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); d.granted = 0; @@ -1265,11 +1249,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp, if (copy_from_user(&mc, (drm_i810_mc_t __user *)arg, sizeof(mc))) return -EFAULT; - - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_dma_mc called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); if (mc.idx >= dma->buf_count || mc.idx < 0) return -EINVAL; @@ -1317,10 +1297,8 @@ int i810_fstatus(struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_fstatus called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); + return I810_READ(0x30008); } @@ -1331,10 +1309,7 @@ int i810_ov0_flip(struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_ov0_flip called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); //Tell the overlay to update I810_WRITE(0x30000,dev_priv->overlay_physical | 0x80000000); @@ -1376,10 +1351,7 @@ int i810_flip_bufs(struct inode *inode, struct file *filp, DRM_DEBUG("%s\n", __FUNCTION__); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i810_flip_buf called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); if (!dev_priv->page_flipping) i810_do_init_pageflip( dev ); @@ -1388,35 +1360,20 @@ int i810_flip_bufs(struct inode *inode, struct file *filp, return 0; } -static void i810_driver_pretakedown(drm_device_t *dev) +void i810_driver_pretakedown(drm_device_t *dev) { i810_dma_cleanup( dev ); } -static void i810_driver_release(drm_device_t *dev, struct file *filp) +void i810_driver_release(drm_device_t *dev, struct file *filp) { - i810_reclaim_buffers(filp); + i810_reclaim_buffers(dev, filp); } -static int i810_driver_dma_quiescent(drm_device_t *dev) +int i810_driver_dma_quiescent(drm_device_t *dev) { i810_dma_quiescent( dev ); return 0; } -void i810_driver_register_fns(drm_device_t *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE; - dev->dev_priv_size = sizeof(drm_i810_buf_priv_t); - dev->fn_tbl.pretakedown = i810_driver_pretakedown; - dev->fn_tbl.release = i810_driver_release; - dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent; - dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers; - - dev->counters += 4; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - dev->types[9] = _DRM_STAT_DMA; -} diff --git a/drivers/char/drm/i810_drm.h b/drivers/char/drm/i810_drm.h index c1d08efa7..73ac40563 100644 --- a/drivers/char/drm/i810_drm.h +++ b/drivers/char/drm/i810_drm.h @@ -199,21 +199,37 @@ typedef struct _drm_i810_sarea { /* i810 specific ioctls * The device specific ioctl range is 0x40 to 0x79. */ -#define DRM_IOCTL_I810_INIT DRM_IOW( 0x40, drm_i810_init_t) -#define DRM_IOCTL_I810_VERTEX DRM_IOW( 0x41, drm_i810_vertex_t) -#define DRM_IOCTL_I810_CLEAR DRM_IOW( 0x42, drm_i810_clear_t) -#define DRM_IOCTL_I810_FLUSH DRM_IO( 0x43) -#define DRM_IOCTL_I810_GETAGE DRM_IO( 0x44) -#define DRM_IOCTL_I810_GETBUF DRM_IOWR(0x45, drm_i810_dma_t) -#define DRM_IOCTL_I810_SWAP DRM_IO( 0x46) -#define DRM_IOCTL_I810_COPY DRM_IOW( 0x47, drm_i810_copy_t) -#define DRM_IOCTL_I810_DOCOPY DRM_IO( 0x48) -#define DRM_IOCTL_I810_OV0INFO DRM_IOR( 0x49, drm_i810_overlay_t) -#define DRM_IOCTL_I810_FSTATUS DRM_IO ( 0x4a) -#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( 0x4b) -#define DRM_IOCTL_I810_MC DRM_IOW( 0x4c, drm_i810_mc_t) -#define DRM_IOCTL_I810_RSTATUS DRM_IO ( 0x4d ) -#define DRM_IOCTL_I810_FLIP DRM_IO ( 0x4e ) +#define DRM_I810_INIT 0x00 +#define DRM_I810_VERTEX 0x01 +#define DRM_I810_CLEAR 0x02 +#define DRM_I810_FLUSH 0x03 +#define DRM_I810_GETAGE 0x04 +#define DRM_I810_GETBUF 0x05 +#define DRM_I810_SWAP 0x06 +#define DRM_I810_COPY 0x07 +#define DRM_I810_DOCOPY 0x08 +#define DRM_I810_OV0INFO 0x09 +#define DRM_I810_FSTATUS 0x0a +#define DRM_I810_OV0FLIP 0x0b +#define DRM_I810_MC 0x0c +#define DRM_I810_RSTATUS 0x0d +#define DRM_I810_FLIP 0x0e + +#define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t) +#define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t) +#define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t) +#define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH) +#define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE) +#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t) +#define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP) +#define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t) +#define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY) +#define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t) +#define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS) +#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP) +#define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t) +#define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS) +#define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP) typedef struct _drm_i810_clear { int clear_color; diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c index 00ca55166..2929ad277 100644 --- a/drivers/char/drm/i810_drv.c +++ b/drivers/char/drm/i810_drv.c @@ -31,10 +31,95 @@ */ #include -#include "i810.h" #include "drmP.h" #include "drm.h" #include "i810_drm.h" #include "i810_drv.h" -#include "drm_core.h" +#include "drm_pciids.h" + +static int postinit( struct drm_device *dev, unsigned long flags ) +{ + /* i810 has 4 more counters */ + dev->counters += 4; + dev->types[6] = _DRM_STAT_IRQ; + dev->types[7] = _DRM_STAT_PRIMARY; + dev->types[8] = _DRM_STAT_SECONDARY; + dev->types[9] = _DRM_STAT_DMA; + + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + i810_PCI_IDS +}; + +extern drm_ioctl_desc_t i810_ioctls[]; +extern int i810_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE, + .dev_priv_size = sizeof(drm_i810_buf_priv_t), + .pretakedown = i810_driver_pretakedown, + .release = i810_driver_release, + .dma_quiescent = i810_driver_dma_quiescent, + .reclaim_buffers = i810_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = i810_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + }, +}; + +static int __init i810_init(void) +{ + driver.num_ioctls = i810_max_ioctl; + return drm_init(&driver); +} + +static void __exit i810_exit(void) +{ + drm_exit(&driver); +} + +module_init(i810_init); +module_exit(i810_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/i810_drv.h b/drivers/char/drm/i810_drv.h index 67c5c88bf..49b3c95e0 100644 --- a/drivers/char/drm/i810_drv.h +++ b/drivers/char/drm/i810_drv.h @@ -32,6 +32,29 @@ #ifndef _I810_DRV_H_ #define _I810_DRV_H_ +/* General customization: + */ + +#define DRIVER_AUTHOR "VA Linux Systems Inc." + +#define DRIVER_NAME "i810" +#define DRIVER_DESC "Intel i810" +#define DRIVER_DATE "20030605" + +/* Interface history + * + * 1.1 - XFree86 4.1 + * 1.2 - XvMC interfaces + * - XFree86 4.2 + * 1.2.1 - Disable copying code (leave stub ioctls for backwards compatibility) + * - Remove requirement for interrupt (leave stubs again) + * 1.3 - Add page flipping. + * 1.4 - fix DRM interface + */ +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 4 +#define DRIVER_PATCHLEVEL 0 + typedef struct drm_i810_buf_priv { u32 *in_use; int my_use_idx; @@ -99,7 +122,7 @@ extern int i810_dma_init(struct inode *inode, struct file *filp, extern int i810_dma_cleanup(drm_device_t *dev); extern int i810_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i810_reclaim_buffers(struct file *filp); +extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); @@ -127,18 +150,22 @@ extern int i810_dma_mc(struct inode *inode, struct file *filp, extern void i810_dma_quiescent(drm_device_t *dev); -int i810_dma_vertex(struct inode *inode, struct file *filp, +extern int i810_dma_vertex(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -int i810_swap_bufs(struct inode *inode, struct file *filp, +extern int i810_swap_bufs(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -int i810_clear_bufs(struct inode *inode, struct file *filp, +extern int i810_clear_bufs(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -int i810_flip_bufs(struct inode *inode, struct file *filp, +extern int i810_flip_bufs(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); +extern int i810_driver_dma_quiescent(drm_device_t *dev); +extern void i810_driver_release(drm_device_t *dev, struct file *filp); +extern void i810_driver_pretakedown(drm_device_t *dev); + #define I810_BASE(reg) ((unsigned long) \ dev_priv->mmio_map->handle) #define I810_ADDR(reg) (I810_BASE(reg) + reg) diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 084e9da08..9afb67705 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c @@ -31,7 +31,6 @@ * */ -#include "i830.h" #include "drmP.h" #include "drm.h" #include "i830_drm.h" @@ -53,6 +52,25 @@ #define up_write up #endif +drm_ioctl_desc_t i830_ioctls[] = { + [DRM_IOCTL_NR(DRM_I830_INIT)] = { i830_dma_init, 1, 1 }, + [DRM_IOCTL_NR(DRM_I830_VERTEX)] = { i830_dma_vertex, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_CLEAR)] = { i830_clear_bufs, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_FLUSH)] = { i830_flush_ioctl, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_GETAGE)] = { i830_getage, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_GETBUF)] = { i830_getbuf, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_SWAP)] = { i830_swap_bufs, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_COPY)] = { i830_copybuf, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_DOCOPY)] = { i830_docopy, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_FLIP)] = { i830_flip_bufs, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_IRQ_EMIT)] = { i830_irq_emit, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_IRQ_WAIT)] = { i830_irq_wait, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_GETPARAM)] = { i830_getparam, 1, 0 }, + [DRM_IOCTL_NR(DRM_I830_SETPARAM)] = { i830_setparam, 1, 0 } +}; + +int i830_max_ioctl = DRM_ARRAY_SIZE(i830_ioctls); + static inline void i830_print_status_page(drm_device_t *dev) { drm_device_dma_t *dma = dev->dma; @@ -111,12 +129,12 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf) } static struct file_operations i830_buffer_fops = { - .open = DRM(open), - .flush = DRM(flush), - .release = DRM(release), - .ioctl = DRM(ioctl), + .open = drm_open, + .flush = drm_flush, + .release = drm_release, + .ioctl = drm_ioctl, .mmap = i830_mmap_buffers, - .fasync = DRM(fasync), + .fasync = drm_fasync, }; int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) @@ -139,8 +157,8 @@ int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) buf_priv->currently_mapped = I830_BUF_MAPPED; unlock_kernel(); - if (remap_page_range(DRM_RPR_ARG(vma) vma->vm_start, - VM_OFFSET(vma), + if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start, + VM_OFFSET(vma) >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; return 0; @@ -237,7 +255,7 @@ int i830_dma_cleanup(drm_device_t *dev) * may not have been called from userspace and after dev_private * is freed, it's too late. */ - if ( dev->irq_enabled ) DRM(irq_uninstall)(dev); + if ( dev->irq_enabled ) drm_irq_uninstall(dev); if (dev->dev_private) { int i; @@ -245,7 +263,7 @@ int i830_dma_cleanup(drm_device_t *dev) (drm_i830_private_t *) dev->dev_private; if (dev_priv->ring.virtual_start) { - DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, + drm_ioremapfree((void *) dev_priv->ring.virtual_start, dev_priv->ring.Size, dev); } if (dev_priv->hw_status_page) { @@ -256,7 +274,7 @@ int i830_dma_cleanup(drm_device_t *dev) I830_WRITE(0x02080, 0x1ffff000); } - DRM(free)(dev->dev_private, sizeof(drm_i830_private_t), + drm_free(dev->dev_private, sizeof(drm_i830_private_t), DRM_MEM_DRIVER); dev->dev_private = NULL; @@ -264,7 +282,7 @@ int i830_dma_cleanup(drm_device_t *dev) drm_buf_t *buf = dma->buflist[ i ]; drm_i830_buf_priv_t *buf_priv = buf->dev_private; if ( buf_priv->kernel_virtual && buf->total ) - DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total, dev); + drm_ioremapfree(buf_priv->kernel_virtual, buf->total, dev); } } return 0; @@ -339,7 +357,7 @@ static int i830_freelist_init(drm_device_t *dev, drm_i830_private_t *dev_priv) *buf_priv->in_use = I830_BUF_FREE; - buf_priv->kernel_virtual = DRM(ioremap)(buf->bus_address, + buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, buf->total, dev); } return 0; @@ -392,7 +410,7 @@ static int i830_dma_initialize(drm_device_t *dev, dev_priv->ring.End = init->ring_end; dev_priv->ring.Size = init->ring_size; - dev_priv->ring.virtual_start = DRM(ioremap)(dev->agp->base + + dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + init->ring_start, init->ring_size, dev); @@ -475,7 +493,7 @@ int i830_dma_init(struct inode *inode, struct file *filp, switch(init.func) { case I830_INIT_DMA: - dev_priv = DRM(alloc)(sizeof(drm_i830_private_t), + dev_priv = drm_alloc(sizeof(drm_i830_private_t), DRM_MEM_DRIVER); if(dev_priv == NULL) return -ENOMEM; retcode = i830_dma_initialize(dev, dev_priv, &init); @@ -1284,10 +1302,8 @@ static int i830_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i830_reclaim_buffers( struct file *filp ) +void i830_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1319,10 +1335,7 @@ int i830_flush_ioctl(struct inode *inode, struct file *filp, drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_flush_ioctl called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); i830_flush_queue(dev); return 0; @@ -1343,10 +1356,7 @@ int i830_dma_vertex(struct inode *inode, struct file *filp, if (copy_from_user(&vertex, (drm_i830_vertex_t __user *)arg, sizeof(vertex))) return -EFAULT; - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_dma_vertex called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); DRM_DEBUG("i830 dma vertex, idx %d used %d discard %d\n", vertex.idx, vertex.used, vertex.discard); @@ -1373,10 +1383,7 @@ int i830_clear_bufs(struct inode *inode, struct file *filp, if (copy_from_user(&clear, (drm_i830_clear_t __user *)arg, sizeof(clear))) return -EFAULT; - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_clear_bufs called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); /* GH: Someone's doing nasty things... */ if (!dev->dev_private) { @@ -1398,10 +1405,7 @@ int i830_swap_bufs(struct inode *inode, struct file *filp, DRM_DEBUG("i830_swap_bufs\n"); - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_swap_buf called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); i830_dma_dispatch_swap( dev ); return 0; @@ -1442,10 +1446,7 @@ int i830_flip_bufs(struct inode *inode, struct file *filp, DRM_DEBUG("%s\n", __FUNCTION__); - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_flip_buf called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); if (!dev_priv->page_flipping) i830_do_init_pageflip( dev ); @@ -1484,10 +1485,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, if (copy_from_user(&d, (drm_i830_dma_t __user *)arg, sizeof(d))) return -EFAULT; - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_dma called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); d.granted = 0; @@ -1582,43 +1580,19 @@ int i830_setparam( struct inode *inode, struct file *filp, unsigned int cmd, } -static void i830_driver_pretakedown(drm_device_t *dev) +void i830_driver_pretakedown(drm_device_t *dev) { i830_dma_cleanup( dev ); } -static void i830_driver_release(drm_device_t *dev, struct file *filp) +void i830_driver_release(drm_device_t *dev, struct file *filp) { - i830_reclaim_buffers(filp); + i830_reclaim_buffers(dev, filp); } -static int i830_driver_dma_quiescent(drm_device_t *dev) +int i830_driver_dma_quiescent(drm_device_t *dev) { i830_dma_quiescent( dev ); return 0; } -void i830_driver_register_fns(drm_device_t *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE; -#if USE_IRQS - dev->driver_features |= DRIVER_HAVE_IRQ | DRIVER_SHARED_IRQ; -#endif - dev->dev_priv_size = sizeof(drm_i830_buf_priv_t); - dev->fn_tbl.pretakedown = i830_driver_pretakedown; - dev->fn_tbl.release = i830_driver_release; - dev->fn_tbl.dma_quiescent = i830_driver_dma_quiescent; - dev->fn_tbl.reclaim_buffers = i830_reclaim_buffers; -#if USE_IRQS - dev->fn_tbl.irq_preinstall = i830_driver_irq_preinstall; - dev->fn_tbl.irq_postinstall = i830_driver_irq_postinstall; - dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall; - dev->fn_tbl.irq_handler = i830_driver_irq_handler; -#endif - dev->counters += 4; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - dev->types[9] = _DRM_STAT_DMA; -} - diff --git a/drivers/char/drm/i830_drm.h b/drivers/char/drm/i830_drm.h index 1bd45994e..03382c0be 100644 --- a/drivers/char/drm/i830_drm.h +++ b/drivers/char/drm/i830_drm.h @@ -251,20 +251,35 @@ typedef struct _drm_i830_sarea { /* I830 specific ioctls * The device specific ioctl range is 0x40 to 0x79. */ -#define DRM_IOCTL_I830_INIT DRM_IOW( 0x40, drm_i830_init_t) -#define DRM_IOCTL_I830_VERTEX DRM_IOW( 0x41, drm_i830_vertex_t) -#define DRM_IOCTL_I830_CLEAR DRM_IOW( 0x42, drm_i830_clear_t) -#define DRM_IOCTL_I830_FLUSH DRM_IO ( 0x43) -#define DRM_IOCTL_I830_GETAGE DRM_IO ( 0x44) -#define DRM_IOCTL_I830_GETBUF DRM_IOWR(0x45, drm_i830_dma_t) -#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46) -#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t) -#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48) -#define DRM_IOCTL_I830_FLIP DRM_IO ( 0x49) -#define DRM_IOCTL_I830_IRQ_EMIT DRM_IOWR(0x4a, drm_i830_irq_emit_t) -#define DRM_IOCTL_I830_IRQ_WAIT DRM_IOW( 0x4b, drm_i830_irq_wait_t) -#define DRM_IOCTL_I830_GETPARAM DRM_IOWR(0x4c, drm_i830_getparam_t) -#define DRM_IOCTL_I830_SETPARAM DRM_IOWR(0x4d, drm_i830_setparam_t) +#define DRM_I830_INIT 0x00 +#define DRM_I830_VERTEX 0x01 +#define DRM_I830_CLEAR 0x02 +#define DRM_I830_FLUSH 0x03 +#define DRM_I830_GETAGE 0x04 +#define DRM_I830_GETBUF 0x05 +#define DRM_I830_SWAP 0x06 +#define DRM_I830_COPY 0x07 +#define DRM_I830_DOCOPY 0x08 +#define DRM_I830_FLIP 0x09 +#define DRM_I830_IRQ_EMIT 0x0a +#define DRM_I830_IRQ_WAIT 0x0b +#define DRM_I830_GETPARAM 0x0c +#define DRM_I830_SETPARAM 0x0d + +#define DRM_IOCTL_I830_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_INIT, drm_i830_init_t) +#define DRM_IOCTL_I830_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_VERTEX, drm_i830_vertex_t) +#define DRM_IOCTL_I830_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_CLEAR, drm_i830_clear_t) +#define DRM_IOCTL_I830_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_FLUSH) +#define DRM_IOCTL_I830_GETAGE DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_GETAGE) +#define DRM_IOCTL_I830_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_GETBUF, drm_i830_dma_t) +#define DRM_IOCTL_I830_SWAP DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_SWAP) +#define DRM_IOCTL_I830_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_COPY, drm_i830_copy_t) +#define DRM_IOCTL_I830_DOCOPY DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_DOCOPY) +#define DRM_IOCTL_I830_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_FLIP) +#define DRM_IOCTL_I830_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_IRQ_EMIT, drm_i830_irq_emit_t) +#define DRM_IOCTL_I830_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_IRQ_WAIT, drm_i830_irq_wait_t) +#define DRM_IOCTL_I830_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_GETPARAM, drm_i830_getparam_t) +#define DRM_IOCTL_I830_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_SETPARAM, drm_i830_setparam_t) typedef struct _drm_i830_clear { int clear_color; diff --git a/drivers/char/drm/i830_drv.c b/drivers/char/drm/i830_drv.c index eb45b2726..da41a973a 100644 --- a/drivers/char/drm/i830_drv.c +++ b/drivers/char/drm/i830_drv.c @@ -33,10 +33,104 @@ */ #include -#include "i830.h" #include "drmP.h" #include "drm.h" #include "i830_drm.h" #include "i830_drv.h" -#include "drm_core.h" +#include "drm_pciids.h" + +int postinit( struct drm_device *dev, unsigned long flags ) +{ + dev->counters += 4; + dev->types[6] = _DRM_STAT_IRQ; + dev->types[7] = _DRM_STAT_PRIMARY; + dev->types[8] = _DRM_STAT_SECONDARY; + dev->types[9] = _DRM_STAT_DMA; + + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + i830_PCI_IDS +}; + +extern drm_ioctl_desc_t i830_ioctls[]; +extern int i830_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE, +#if USE_IRQS + .driver_features |= DRIVER_HAVE_IRQ | DRIVER_SHARED_IRQ, +#endif + .dev_priv_size = sizeof(drm_i830_buf_priv_t), + .pretakedown = i830_driver_pretakedown, + .release = i830_driver_release, + .dma_quiescent = i830_driver_dma_quiescent, + .reclaim_buffers = i830_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, +#if USE_IRQS + .irq_preinstall = i830_driver_irq_preinstall, + .irq_postinstall = i830_driver_irq_postinstall, + .irq_uninstall = i830_driver_irq_uninstall, + .irq_handler = i830_driver_irq_handler, +#endif + .postinit = postinit, + .version = version, + .ioctls = i830_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } + +}; + +static int __init i830_init(void) +{ + driver.num_ioctls = i830_max_ioctl; + return drm_init(&driver); +} + +static void __exit i830_exit(void) +{ + drm_exit(&driver); +} + +module_init(i830_init); +module_exit(i830_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/i830_drv.h b/drivers/char/drm/i830_drv.h index c3cab2d83..0535cb9e5 100644 --- a/drivers/char/drm/i830_drv.h +++ b/drivers/char/drm/i830_drv.h @@ -32,6 +32,36 @@ #ifndef _I830_DRV_H_ #define _I830_DRV_H_ +/* General customization: + */ + +#define DRIVER_AUTHOR "VA Linux Systems Inc." + +#define DRIVER_NAME "i830" +#define DRIVER_DESC "Intel 830M" +#define DRIVER_DATE "20021108" + +/* Interface history: + * + * 1.1: Original. + * 1.2: ? + * 1.3: New irq emit/wait ioctls. + * New pageflip ioctl. + * New getparam ioctl. + * State for texunits 3&4 in sarea. + * New (alternative) layout for texture state. + */ +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 3 +#define DRIVER_PATCHLEVEL 2 + +/* Driver will work either way: IRQ's save cpu time when waiting for + * the card, but are subject to subtle interactions between bios, + * hardware and the driver. + */ +/* XXX: Add vblank support? */ +#define USE_IRQS 0 + typedef struct drm_i830_buf_priv { u32 *in_use; int my_use_idx; @@ -99,7 +129,7 @@ extern int i830_dma_init(struct inode *inode, struct file *filp, extern int i830_dma_cleanup(drm_device_t *dev); extern int i830_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i830_reclaim_buffers(struct file *filp); +extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma); @@ -140,6 +170,9 @@ extern irqreturn_t i830_driver_irq_handler( DRM_IRQ_ARGS ); extern void i830_driver_irq_preinstall( drm_device_t *dev ); extern void i830_driver_irq_postinstall( drm_device_t *dev ); extern void i830_driver_irq_uninstall( drm_device_t *dev ); +extern void i830_driver_pretakedown(drm_device_t *dev); +extern void i830_driver_release(drm_device_t *dev, struct file *filp); +extern int i830_driver_dma_quiescent(drm_device_t *dev); #define I830_BASE(reg) ((unsigned long) \ dev_priv->mmio_map->handle) diff --git a/drivers/char/drm/i830_irq.c b/drivers/char/drm/i830_irq.c index 6a0e25c26..097744550 100644 --- a/drivers/char/drm/i830_irq.c +++ b/drivers/char/drm/i830_irq.c @@ -26,7 +26,6 @@ * */ -#include "i830.h" #include "drmP.h" #include "drm.h" #include "i830_drm.h" @@ -129,10 +128,7 @@ int i830_irq_emit( struct inode *inode, struct file *filp, unsigned int cmd, drm_i830_irq_emit_t emit; int result; - if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i830_irq_emit called without lock held\n"); - return -EINVAL; - } + LOCK_TEST_WITH_RETURN(dev, filp); if ( !dev_priv ) { DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c index e33853b5a..7300a09db 100644 --- a/drivers/char/drm/i915_dma.c +++ b/drivers/char/drm/i915_dma.c @@ -7,29 +7,27 @@ * **************************************************************************/ -#include "i915.h" #include "drmP.h" #include "drm.h" #include "i915_drm.h" #include "i915_drv.h" -static inline void i915_print_status_page(drm_device_t * dev) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - u32 *temp = dev_priv->hw_status_page; - - if (!temp) { - DRM_DEBUG("no status page\n"); - return; - } - - DRM_DEBUG("hw_status: Interrupt Status : %x\n", temp[0]); - DRM_DEBUG("hw_status: LpRing Head ptr : %x\n", temp[1]); - DRM_DEBUG("hw_status: IRing Head ptr : %x\n", temp[2]); - DRM_DEBUG("hw_status: Reserved : %x\n", temp[3]); - DRM_DEBUG("hw_status: Driver Counter : %d\n", temp[5]); - -} +drm_ioctl_desc_t i915_ioctls[] = { + [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, 1, 1}, + [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, 1, 1}, + [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, 1, 0}, + [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, 1, 1}, + [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, 1, 0} +}; + +int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); /* Really want an OS-independent resettable timer. Would like to have * this loop run for (eg) 3 sec, but have the timer reset every time @@ -84,7 +82,7 @@ int i915_dma_cleanup(drm_device_t * dev) * is freed, it's too late. */ if (dev->irq) - DRM(irq_uninstall) (dev); + drm_irq_uninstall (dev); if (dev->dev_private) { drm_i915_private_t *dev_priv = @@ -95,14 +93,13 @@ int i915_dma_cleanup(drm_device_t * dev) } if (dev_priv->hw_status_page) { - pci_free_consistent(dev->pdev, PAGE_SIZE, - dev_priv->hw_status_page, - dev_priv->dma_status_page); + drm_pci_free(dev, PAGE_SIZE, dev_priv->hw_status_page, + dev_priv->dma_status_page); /* Need to rewrite hardware status page */ I915_WRITE(0x02080, 0x1ffff000); } - DRM(free) (dev->dev_private, sizeof(drm_i915_private_t), + drm_free (dev->dev_private, sizeof(drm_i915_private_t), DRM_MEM_DRIVER); dev->dev_private = NULL; @@ -174,9 +171,9 @@ static int i915_initialize(drm_device_t * dev, dev_priv->allow_batchbuffer = 1; /* Program Hardware Status Page */ - dev_priv->hw_status_page = - pci_alloc_consistent(dev->pdev, PAGE_SIZE, - &dev_priv->dma_status_page); + dev_priv->hw_status_page = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, + 0xffffffff, + &dev_priv->dma_status_page); if (!dev_priv->hw_status_page) { dev->dev_private = (void *)dev_priv; @@ -242,7 +239,7 @@ int i915_dma_init(DRM_IOCTL_ARGS) switch (init.func) { case I915_INIT_DMA: - dev_priv = DRM(alloc) (sizeof(drm_i915_private_t), + dev_priv = drm_alloc (sizeof(drm_i915_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) return DRM_ERR(ENOMEM); @@ -545,10 +542,7 @@ int i915_flush_ioctl(DRM_IOCTL_ARGS) { DRM_DEVICE; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_flush_ioctl called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); return i915_quiescent(dev); } @@ -574,10 +568,7 @@ int i915_batchbuffer(DRM_IOCTL_ARGS) DRM_DEBUG("i915 batchbuffer, start %x used %d cliprects %d\n", batch.start, batch.used, batch.num_cliprects); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_batchbuffer called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects, batch.num_cliprects * @@ -606,10 +597,7 @@ int i915_cmdbuffer(DRM_IOCTL_ARGS) DRM_DEBUG("i915 cmdbuffer, buf %p sz %d cliprects %d\n", cmdbuf.buf, cmdbuf.sz, cmdbuf.num_cliprects); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_cmdbuffer called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (cmdbuf.num_cliprects && DRM_VERIFYAREA_READ(cmdbuf.cliprects, @@ -645,10 +633,8 @@ int i915_flip_bufs(DRM_IOCTL_ARGS) DRM_DEVICE; DRM_DEBUG("%s\n", __FUNCTION__); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_flip_buf called without lock held\n"); - return DRM_ERR(EINVAL); - } + + LOCK_TEST_WITH_RETURN(dev, filp); return i915_dispatch_flip(dev); } @@ -720,7 +706,7 @@ int i915_setparam(DRM_IOCTL_ARGS) return 0; } -static void i915_driver_pretakedown(drm_device_t *dev) +void i915_driver_pretakedown(drm_device_t *dev) { if ( dev->dev_private ) { drm_i915_private_t *dev_priv = dev->dev_private; @@ -729,7 +715,7 @@ static void i915_driver_pretakedown(drm_device_t *dev) i915_dma_cleanup( dev ); } -static void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp) +void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp) { if ( dev->dev_private ) { drm_i915_private_t *dev_priv = dev->dev_private; @@ -737,19 +723,3 @@ static void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp) } } -void i915_driver_register_fns(drm_device_t *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED; - dev->fn_tbl.pretakedown = i915_driver_pretakedown; - dev->fn_tbl.prerelease = i915_driver_prerelease; - dev->fn_tbl.irq_preinstall = i915_driver_irq_preinstall; - dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall; - dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall; - dev->fn_tbl.irq_handler = i915_driver_irq_handler; - - dev->counters += 4; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - dev->types[9] = _DRM_STAT_DMA; -} diff --git a/drivers/char/drm/i915_drm.h b/drivers/char/drm/i915_drm.h index 24f4cd622..7e55edf45 100644 --- a/drivers/char/drm/i915_drm.h +++ b/drivers/char/drm/i915_drm.h @@ -61,18 +61,31 @@ typedef struct _drm_i915_sarea { /* I915 specific ioctls * The device specific ioctl range is 0x40 to 0x79. */ -#define DRM_IOCTL_I915_INIT DRM_IOW( 0x40, drm_i915_init_t) -#define DRM_IOCTL_I915_FLUSH DRM_IO ( 0x41) -#define DRM_IOCTL_I915_FLIP DRM_IO ( 0x42) -#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( 0x43, drm_i915_batchbuffer_t) -#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(0x44, drm_i915_irq_emit_t) -#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( 0x45, drm_i915_irq_wait_t) -#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(0x46, drm_i915_getparam_t) -#define DRM_IOCTL_I915_SETPARAM DRM_IOW( 0x47, drm_i915_setparam_t) -#define DRM_IOCTL_I915_ALLOC DRM_IOWR(0x48, drm_i915_mem_alloc_t) -#define DRM_IOCTL_I915_FREE DRM_IOW( 0x49, drm_i915_mem_free_t) -#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( 0x4a, drm_i915_mem_init_heap_t) -#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( 0x4b, drm_i915_cmdbuffer_t) +#define DRM_I915_INIT 0x00 +#define DRM_I915_FLUSH 0x01 +#define DRM_I915_FLIP 0x02 +#define DRM_I915_BATCHBUFFER 0x03 +#define DRM_I915_IRQ_EMIT 0x04 +#define DRM_I915_IRQ_WAIT 0x05 +#define DRM_I915_GETPARAM 0x06 +#define DRM_I915_SETPARAM 0x07 +#define DRM_I915_ALLOC 0x08 +#define DRM_I915_FREE 0x09 +#define DRM_I915_INIT_HEAP 0x0a +#define DRM_I915_CMDBUFFER 0x0b + +#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) +#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) +#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) +#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) +#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) +#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) +#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) +#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) +#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) +#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) +#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) +#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) /* Allow drivers to submit batchbuffers directly to hardware, relying * on the security mechanisms provided by hardware. diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c index becce4d70..896780521 100644 --- a/drivers/char/drm/i915_drv.c +++ b/drivers/char/drm/i915_drv.c @@ -8,10 +8,97 @@ * **************************************************************************/ -#include "i915.h" #include "drmP.h" #include "drm.h" #include "i915_drm.h" #include "i915_drv.h" -#include "drm_core.h" +#include "drm_pciids.h" + +int postinit( struct drm_device *dev, unsigned long flags ) +{ + dev->counters += 4; + dev->types[6] = _DRM_STAT_IRQ; + dev->types[7] = _DRM_STAT_PRIMARY; + dev->types[8] = _DRM_STAT_SECONDARY; + dev->types[9] = _DRM_STAT_DMA; + + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + i915_PCI_IDS +}; + +extern drm_ioctl_desc_t i915_ioctls[]; +extern int i915_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | + DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, + .pretakedown = i915_driver_pretakedown, + .prerelease = i915_driver_prerelease, + .irq_preinstall = i915_driver_irq_preinstall, + .irq_postinstall = i915_driver_irq_postinstall, + .irq_uninstall = i915_driver_irq_uninstall, + .irq_handler = i915_driver_irq_handler, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = i915_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } +}; + +static int __init i915_init(void) +{ + driver.num_ioctls = i915_max_ioctl; + return drm_init(&driver); +} + +static void __exit i915_exit(void) +{ + drm_exit(&driver); +} + +module_init(i915_init); +module_exit(i915_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h index 7564cd090..f6ca92a56 100644 --- a/drivers/char/drm/i915_drv.h +++ b/drivers/char/drm/i915_drv.h @@ -10,6 +10,28 @@ #ifndef _I915_DRV_H_ #define _I915_DRV_H_ +/* General customization: + */ + +#define DRIVER_AUTHOR "Tungsten Graphics, Inc." + +#define DRIVER_NAME "i915" +#define DRIVER_DESC "Intel Graphics" +#define DRIVER_DATE "20040405" + +/* Interface history: + * + * 1.1: Original. + */ +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 1 +#define DRIVER_PATCHLEVEL 0 + +/* We use our own dma mechanisms, not the drm template code. However, + * the shared IRQ code is useful to us: + */ +#define __HAVE_PM 1 + typedef struct _drm_i915_ring_buffer { int tail_mask; unsigned long Start; @@ -66,6 +88,8 @@ extern int i915_getparam(DRM_IOCTL_ARGS); extern int i915_setparam(DRM_IOCTL_ARGS); extern int i915_cmdbuffer(DRM_IOCTL_ARGS); extern void i915_kernel_lost_context(drm_device_t * dev); +extern void i915_driver_pretakedown(drm_device_t *dev); +extern void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp); /* i915_irq.c */ extern int i915_irq_emit(DRM_IOCTL_ARGS); diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c index de91aba58..b0239262a 100644 --- a/drivers/char/drm/i915_irq.c +++ b/drivers/char/drm/i915_irq.c @@ -7,7 +7,6 @@ * **************************************************************************/ -#include "i915.h" #include "drmP.h" #include "drm.h" #include "i915_drm.h" @@ -92,10 +91,7 @@ int i915_irq_emit(DRM_IOCTL_ARGS) drm_i915_irq_emit_t emit; int result; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_irq_emit called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); diff --git a/drivers/char/drm/i915_mem.c b/drivers/char/drm/i915_mem.c index 42c1e3535..d54a30059 100644 --- a/drivers/char/drm/i915_mem.c +++ b/drivers/char/drm/i915_mem.c @@ -7,7 +7,6 @@ * **************************************************************************/ -#include "i915.h" #include "drmP.h" #include "drm.h" #include "i915_drm.h" @@ -75,7 +74,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, { /* Maybe cut off the start of an existing block */ if (start > p->start) { - struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock)); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); if (!newblock) goto out; newblock->start = start; @@ -91,7 +90,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, /* Maybe cut off the end of an existing block */ if (size < p->size) { - struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock)); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); if (!newblock) goto out; newblock->start = start + size; @@ -148,7 +147,7 @@ static void free_block(struct mem_block *p) p->size += q->size; p->next = q->next; p->next->prev = p; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } if (p->prev->filp == NULL) { @@ -156,7 +155,7 @@ static void free_block(struct mem_block *p) q->size += p->size; q->next = p->next; q->next->prev = q; - DRM_FREE(p, sizeof(*q)); + drm_free(p, sizeof(*q), DRM_MEM_BUFLISTS); } } @@ -164,14 +163,14 @@ static void free_block(struct mem_block *p) */ static int init_heap(struct mem_block **heap, int start, int size) { - struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks)); + struct mem_block *blocks = drm_alloc(sizeof(*blocks), DRM_MEM_BUFLISTS); if (!blocks) return -ENOMEM; - *heap = DRM_MALLOC(sizeof(**heap)); + *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS); if (!*heap) { - DRM_FREE(blocks, sizeof(*blocks)); + drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFLISTS); return -ENOMEM; } @@ -211,7 +210,7 @@ void i915_mem_release(drm_device_t * dev, DRMFILE filp, struct mem_block *heap) p->size += q->size; p->next = q->next; p->next->prev = p; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } } } @@ -228,10 +227,10 @@ void i915_mem_takedown(struct mem_block **heap) for (p = (*heap)->next; p != *heap;) { struct mem_block *q = p; p = p->next; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } - DRM_FREE(*heap, sizeof(**heap)); + drm_free(*heap, sizeof(**heap), DRM_MEM_BUFLISTS); *heap = NULL; } diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c index 54b64c782..5e3c3133d 100644 --- a/drivers/char/drm/mga_dma.c +++ b/drivers/char/drm/mga_dma.c @@ -33,7 +33,6 @@ * Gareth Hughes */ -#include "mga.h" #include "drmP.h" #include "drm.h" #include "mga_drm.h" @@ -308,7 +307,7 @@ static int mga_freelist_init( drm_device_t *dev, drm_mga_private_t *dev_priv ) int i; DRM_DEBUG( "count=%d\n", dma->buf_count ); - dev_priv->head = DRM(alloc)( sizeof(drm_mga_freelist_t), + dev_priv->head = drm_alloc( sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER ); if ( dev_priv->head == NULL ) return DRM_ERR(ENOMEM); @@ -320,7 +319,7 @@ static int mga_freelist_init( drm_device_t *dev, drm_mga_private_t *dev_priv ) buf = dma->buflist[i]; buf_priv = buf->dev_private; - entry = DRM(alloc)( sizeof(drm_mga_freelist_t), + entry = drm_alloc( sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER ); if ( entry == NULL ) return DRM_ERR(ENOMEM); @@ -357,7 +356,7 @@ static void mga_freelist_cleanup( drm_device_t *dev ) entry = dev_priv->head; while ( entry ) { next = entry->next; - DRM(free)( entry, sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER ); + drm_free( entry, sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER ); entry = next; } @@ -458,7 +457,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init ) int ret; DRM_DEBUG( "\n" ); - dev_priv = DRM(alloc)( sizeof(drm_mga_private_t), DRM_MEM_DRIVER ); + dev_priv = drm_alloc( sizeof(drm_mga_private_t), DRM_MEM_DRIVER ); if ( !dev_priv ) return DRM_ERR(ENOMEM); @@ -634,7 +633,7 @@ int mga_do_cleanup_dma( drm_device_t *dev ) * may not have been called from userspace and after dev_private * is freed, it's too late. */ - if ( dev->irq_enabled ) DRM(irq_uninstall)(dev); + if ( dev->irq_enabled ) drm_irq_uninstall(dev); if ( dev->dev_private ) { drm_mga_private_t *dev_priv = dev->dev_private; @@ -650,7 +649,7 @@ int mga_do_cleanup_dma( drm_device_t *dev ) mga_freelist_cleanup( dev ); } - DRM(free)( dev->dev_private, sizeof(drm_mga_private_t), + drm_free( dev->dev_private, sizeof(drm_mga_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; } @@ -798,30 +797,13 @@ int mga_dma_buffers( DRM_IOCTL_ARGS ) return ret; } -static void mga_driver_pretakedown(drm_device_t *dev) +void mga_driver_pretakedown(drm_device_t *dev) { mga_do_cleanup_dma( dev ); } -static int mga_driver_dma_quiescent(drm_device_t *dev) +int mga_driver_dma_quiescent(drm_device_t *dev) { drm_mga_private_t *dev_priv = dev->dev_private; return mga_do_wait_for_idle( dev_priv ); } - -void mga_driver_register_fns(drm_device_t *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL; - dev->fn_tbl.pretakedown = mga_driver_pretakedown; - dev->fn_tbl.dma_quiescent = mga_driver_dma_quiescent; - dev->fn_tbl.vblank_wait = mga_driver_vblank_wait; - dev->fn_tbl.irq_preinstall = mga_driver_irq_preinstall; - dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall; - dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall; - dev->fn_tbl.irq_handler = mga_driver_irq_handler; - - dev->counters += 3; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; -} diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c index aa27a2c4b..bc5fb9db6 100644 --- a/drivers/char/drm/mga_drv.c +++ b/drivers/char/drm/mga_drv.c @@ -30,9 +30,98 @@ */ #include -#include "mga.h" #include "drmP.h" #include "drm.h" #include "mga_drm.h" #include "mga_drv.h" -#include "drm_core.h" + + +#include "drm_pciids.h" + +static int postinit( struct drm_device *dev, unsigned long flags ) +{ + dev->counters += 3; + dev->types[6] = _DRM_STAT_IRQ; + dev->types[7] = _DRM_STAT_PRIMARY; + dev->types[8] = _DRM_STAT_SECONDARY; + + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + mga_PCI_IDS +}; + +extern drm_ioctl_desc_t mga_ioctls[]; +extern int mga_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, + .pretakedown = mga_driver_pretakedown, + .dma_quiescent = mga_driver_dma_quiescent, + .vblank_wait = mga_driver_vblank_wait, + .irq_preinstall = mga_driver_irq_preinstall, + .irq_postinstall = mga_driver_irq_postinstall, + .irq_uninstall = mga_driver_irq_uninstall, + .irq_handler = mga_driver_irq_handler, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = mga_ioctls, + .dma_ioctl = mga_dma_buffers, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } +}; + +static int __init mga_init(void) +{ + driver.num_ioctls = mga_max_ioctl; + return drm_init(&driver); +} + +static void __exit mga_exit(void) +{ + drm_exit(&driver); +} + +module_init(mga_init); +module_exit(mga_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h index 75dcb0e93..3d8e9aefd 100644 --- a/drivers/char/drm/mga_drv.h +++ b/drivers/char/drm/mga_drv.h @@ -31,6 +31,19 @@ #ifndef __MGA_DRV_H__ #define __MGA_DRV_H__ +/* General customization: + */ + +#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc." + +#define DRIVER_NAME "mga" +#define DRIVER_DESC "Matrox G200/G400" +#define DRIVER_DATE "20021029" + +#define DRIVER_MAJOR 3 +#define DRIVER_MINOR 1 +#define DRIVER_PATCHLEVEL 0 + typedef struct drm_mga_primary_buffer { u8 *start; u8 *end; @@ -104,6 +117,8 @@ extern int mga_dma_init( DRM_IOCTL_ARGS ); extern int mga_dma_flush( DRM_IOCTL_ARGS ); extern int mga_dma_reset( DRM_IOCTL_ARGS ); extern int mga_dma_buffers( DRM_IOCTL_ARGS ); +extern void mga_driver_pretakedown(drm_device_t *dev); +extern int mga_driver_dma_quiescent(drm_device_t *dev); extern int mga_do_wait_for_idle( drm_mga_private_t *dev_priv ); extern int mga_do_dma_idle( drm_mga_private_t *dev_priv ); diff --git a/drivers/char/drm/mga_irq.c b/drivers/char/drm/mga_irq.c index c3185b0b8..bc0b6b5d4 100644 --- a/drivers/char/drm/mga_irq.c +++ b/drivers/char/drm/mga_irq.c @@ -30,7 +30,6 @@ * Eric Anholt */ -#include "mga.h" #include "drmP.h" #include "drm.h" #include "mga_drm.h" @@ -50,7 +49,7 @@ irqreturn_t mga_driver_irq_handler( DRM_IRQ_ARGS ) MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR ); atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); - DRM(vbl_send_signals)( dev ); + drm_vbl_send_signals( dev ); return IRQ_HANDLED; } return IRQ_NONE; diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c index 436598252..dbc878f84 100644 --- a/drivers/char/drm/mga_state.c +++ b/drivers/char/drm/mga_state.c @@ -32,12 +32,25 @@ * Gareth Hughes */ -#include "mga.h" #include "drmP.h" #include "drm.h" #include "mga_drm.h" #include "mga_drv.h" +drm_ioctl_desc_t mga_ioctls[] = { + [DRM_IOCTL_NR(DRM_MGA_INIT)] = { mga_dma_init, 1, 1 }, + [DRM_IOCTL_NR(DRM_MGA_FLUSH)] = { mga_dma_flush, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_RESET)] = { mga_dma_reset, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_SWAP)] = { mga_dma_swap, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_CLEAR)] = { mga_dma_clear, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_VERTEX)] = { mga_dma_vertex, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_INDICES)] = { mga_dma_indices, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_ILOAD)] = { mga_dma_iload, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, + [DRM_IOCTL_NR(DRM_MGA_GETPARAM)]= { mga_getparam, 1, 0 }, +}; + +int mga_max_ioctl = DRM_ARRAY_SIZE(mga_ioctls); /* ================================================================ * DMA hardware state programming functions diff --git a/drivers/char/drm/mga_warp.c b/drivers/char/drm/mga_warp.c index de1b911f8..0a3a0cc70 100644 --- a/drivers/char/drm/mga_warp.c +++ b/drivers/char/drm/mga_warp.c @@ -27,7 +27,6 @@ * Gareth Hughes */ -#include "mga.h" #include "drmP.h" #include "drm.h" #include "mga_drm.h" diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c index 5fbea8ca6..379f83230 100644 --- a/drivers/char/drm/r128_cce.c +++ b/drivers/char/drm/r128_cce.c @@ -28,7 +28,6 @@ * Gareth Hughes */ -#include "r128.h" #include "drmP.h" #include "drm.h" #include "r128_drm.h" @@ -355,7 +354,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init ) DRM_DEBUG( "\n" ); - dev_priv = DRM(alloc)( sizeof(drm_r128_private_t), DRM_MEM_DRIVER ); + dev_priv = drm_alloc( sizeof(drm_r128_private_t), DRM_MEM_DRIVER ); if ( dev_priv == NULL ) return DRM_ERR(ENOMEM); @@ -544,7 +543,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init ) dev_priv->ring.end = ((u32 *)dev_priv->cce_ring->handle + init->ring_size / sizeof(u32)); dev_priv->ring.size = init->ring_size; - dev_priv->ring.size_l2qw = DRM(order)( init->ring_size / 8 ); + dev_priv->ring.size_l2qw = drm_order( init->ring_size / 8 ); dev_priv->ring.tail_mask = (dev_priv->ring.size / sizeof(u32)) - 1; @@ -561,7 +560,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init ) #if __OS_HAS_AGP if ( dev_priv->is_pci ) { #endif - if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart, + if (!drm_ati_pcigart_init( dev, &dev_priv->phys_pci_gart, &dev_priv->bus_pci_gart) ) { DRM_ERROR( "failed to init PCI GART!\n" ); dev->dev_private = (void *)dev_priv; @@ -590,7 +589,7 @@ int r128_do_cleanup_cce( drm_device_t *dev ) * may not have been called from userspace and after dev_private * is freed, it's too late. */ - if ( dev->irq_enabled ) DRM(irq_uninstall)(dev); + if ( dev->irq_enabled ) drm_irq_uninstall(dev); if ( dev->dev_private ) { drm_r128_private_t *dev_priv = dev->dev_private; @@ -606,13 +605,13 @@ int r128_do_cleanup_cce( drm_device_t *dev ) } else #endif { - if (!DRM(ati_pcigart_cleanup)( dev, + if (!drm_ati_pcigart_cleanup( dev, dev_priv->phys_pci_gart, dev_priv->bus_pci_gart )) DRM_ERROR( "failed to cleanup PCI GART!\n" ); } - DRM(free)( dev->dev_private, sizeof(drm_r128_private_t), + drm_free( dev->dev_private, sizeof(drm_r128_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; } @@ -771,7 +770,7 @@ static int r128_freelist_init( drm_device_t *dev ) drm_r128_freelist_t *entry; int i; - dev_priv->head = DRM(alloc)( sizeof(drm_r128_freelist_t), + dev_priv->head = drm_alloc( sizeof(drm_r128_freelist_t), DRM_MEM_DRIVER ); if ( dev_priv->head == NULL ) return DRM_ERR(ENOMEM); @@ -783,7 +782,7 @@ static int r128_freelist_init( drm_device_t *dev ) buf = dma->buflist[i]; buf_priv = buf->dev_private; - entry = DRM(alloc)( sizeof(drm_r128_freelist_t), + entry = drm_alloc( sizeof(drm_r128_freelist_t), DRM_MEM_DRIVER ); if ( !entry ) return DRM_ERR(ENOMEM); diff --git a/drivers/char/drm/r128_drv.c b/drivers/char/drm/r128_drv.c index 8cfc9966c..998324105 100644 --- a/drivers/char/drm/r128_drv.c +++ b/drivers/char/drm/r128_drv.c @@ -30,11 +30,93 @@ */ #include -#include "r128.h" #include "drmP.h" #include "drm.h" #include "r128_drm.h" #include "r128_drv.h" -#include "ati_pcigart.h" -#include "drm_core.h" +#include "drm_pciids.h" + +static int postinit( struct drm_device *dev, unsigned long flags ) +{ + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + r128_PCI_IDS +}; + +extern drm_ioctl_desc_t r128_ioctls[]; +extern int r128_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, + .dev_priv_size = sizeof(drm_r128_buf_priv_t), + .prerelease = r128_driver_prerelease, + .pretakedown = r128_driver_pretakedown, + .vblank_wait = r128_driver_vblank_wait, + .irq_preinstall = r128_driver_irq_preinstall, + .irq_postinstall = r128_driver_irq_postinstall, + .irq_uninstall = r128_driver_irq_uninstall, + .irq_handler = r128_driver_irq_handler, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = r128_ioctls, + .dma_ioctl = r128_cce_buffers, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } +}; + +static int __init r128_init(void) +{ + driver.num_ioctls = r128_max_ioctl; + return drm_init(&driver); +} + +static void __exit r128_exit(void) +{ + drm_exit(&driver); +} + +module_init(r128_init); +module_exit(r128_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h index 5b91256c1..e04d87dfb 100644 --- a/drivers/char/drm/r128_drv.h +++ b/drivers/char/drm/r128_drv.h @@ -28,12 +28,31 @@ * Rickard E. (Rik) Faith * Kevin E. Martin * Gareth Hughes - * Michel Dänzer + * Michel D�zer */ #ifndef __R128_DRV_H__ #define __R128_DRV_H__ +/* General customization: + */ +#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc." + +#define DRIVER_NAME "r128" +#define DRIVER_DESC "ATI Rage 128" +#define DRIVER_DATE "20030725" + +/* Interface history: + * + * ?? - ?? + * 2.4 - Add support for ycbcr textures (no new ioctls) + * 2.5 - Add FLIP ioctl, disable FULLSCREEN. + */ +#define DRIVER_MAJOR 2 +#define DRIVER_MINOR 5 +#define DRIVER_PATCHLEVEL 0 + + #define GET_RING_HEAD(dev_priv) R128_READ( R128_PM4_BUFFER_DL_RPTR ) typedef struct drm_r128_freelist { @@ -148,6 +167,8 @@ extern irqreturn_t r128_driver_irq_handler( DRM_IRQ_ARGS ); extern void r128_driver_irq_preinstall( drm_device_t *dev ); extern void r128_driver_irq_postinstall( drm_device_t *dev ); extern void r128_driver_irq_uninstall( drm_device_t *dev ); +extern void r128_driver_pretakedown(drm_device_t *dev); +extern void r128_driver_prerelease(drm_device_t *dev, DRMFILE filp); /* Register definitions, register access macros and drmAddMap constants * for Rage 128 kernel driver. diff --git a/drivers/char/drm/r128_irq.c b/drivers/char/drm/r128_irq.c index be1b9dac6..643a30785 100644 --- a/drivers/char/drm/r128_irq.c +++ b/drivers/char/drm/r128_irq.c @@ -30,7 +30,6 @@ * Eric Anholt */ -#include "r128.h" #include "drmP.h" #include "drm.h" #include "r128_drm.h" @@ -50,7 +49,7 @@ irqreturn_t r128_driver_irq_handler( DRM_IRQ_ARGS ) R128_WRITE( R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK ); atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); - DRM(vbl_send_signals)( dev ); + drm_vbl_send_signals( dev ); return IRQ_HANDLED; } return IRQ_NONE; diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c index adc326698..60c774312 100644 --- a/drivers/char/drm/r128_state.c +++ b/drivers/char/drm/r128_state.c @@ -27,12 +27,32 @@ * Gareth Hughes */ -#include "r128.h" #include "drmP.h" #include "drm.h" #include "r128_drm.h" #include "r128_drv.h" +drm_ioctl_desc_t r128_ioctls[] = { + [DRM_IOCTL_NR(DRM_R128_INIT)] = { r128_cce_init, 1, 1 }, + [DRM_IOCTL_NR(DRM_R128_CCE_START)] = { r128_cce_start, 1, 1 }, + [DRM_IOCTL_NR(DRM_R128_CCE_STOP)] = { r128_cce_stop, 1, 1 }, + [DRM_IOCTL_NR(DRM_R128_CCE_RESET)] = { r128_cce_reset, 1, 1 }, + [DRM_IOCTL_NR(DRM_R128_CCE_IDLE)] = { r128_cce_idle, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_RESET)] = { r128_engine_reset, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_FULLSCREEN)] = { r128_fullscreen, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_SWAP)] = { r128_cce_swap, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_FLIP)] = { r128_cce_flip, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_CLEAR)] = { r128_cce_clear, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_VERTEX)] = { r128_cce_vertex, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_INDICES)] = { r128_cce_indices, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_BLIT)] = { r128_cce_blit, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_DEPTH)] = { r128_cce_depth, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_STIPPLE)] = { r128_cce_stipple, 1, 0 }, + [DRM_IOCTL_NR(DRM_R128_INDIRECT)] = { r128_cce_indirect, 1, 1 }, + [DRM_IOCTL_NR(DRM_R128_GETPARAM)] = { r128_getparam, 1, 0 }, +}; + +int r128_max_ioctl = DRM_ARRAY_SIZE(r128_ioctls); /* ================================================================ * CCE hardware state programming functions @@ -926,24 +946,24 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev, } buffer_size = depth->n * sizeof(u32); - buffer = DRM_MALLOC( buffer_size ); + buffer = drm_alloc( buffer_size, DRM_MEM_BUFS ); if ( buffer == NULL ) return DRM_ERR(ENOMEM); if ( DRM_COPY_FROM_USER( buffer, depth->buffer, buffer_size ) ) { - DRM_FREE( buffer, buffer_size); + drm_free( buffer, buffer_size, DRM_MEM_BUFS); return DRM_ERR(EFAULT); } mask_size = depth->n * sizeof(u8); if ( depth->mask ) { - mask = DRM_MALLOC( mask_size ); + mask = drm_alloc( mask_size, DRM_MEM_BUFS ); if ( mask == NULL ) { - DRM_FREE( buffer, buffer_size ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } if ( DRM_COPY_FROM_USER( mask, depth->mask, mask_size ) ) { - DRM_FREE( buffer, buffer_size ); - DRM_FREE( mask, mask_size ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); + drm_free( mask, mask_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } @@ -970,7 +990,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev, } } - DRM_FREE( mask, mask_size ); + drm_free( mask, mask_size, DRM_MEM_BUFS ); } else { for ( i = 0 ; i < count ; i++, x++ ) { BEGIN_RING( 6 ); @@ -994,7 +1014,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev, } } - DRM_FREE( buffer, buffer_size ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); return 0; } @@ -1016,54 +1036,54 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev, xbuf_size = count * sizeof(*x); ybuf_size = count * sizeof(*y); - x = DRM_MALLOC( xbuf_size ); + x = drm_alloc( xbuf_size, DRM_MEM_BUFS ); if ( x == NULL ) { return DRM_ERR(ENOMEM); } - y = DRM_MALLOC( ybuf_size ); + y = drm_alloc( ybuf_size, DRM_MEM_BUFS ); if ( y == NULL ) { - DRM_FREE( x, xbuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } if ( DRM_COPY_FROM_USER( x, depth->x, xbuf_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } if ( DRM_COPY_FROM_USER( y, depth->y, xbuf_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } buffer_size = depth->n * sizeof(u32); - buffer = DRM_MALLOC( buffer_size ); + buffer = drm_alloc( buffer_size, DRM_MEM_BUFS ); if ( buffer == NULL ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } if ( DRM_COPY_FROM_USER( buffer, depth->buffer, buffer_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); - DRM_FREE( buffer, buffer_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } if ( depth->mask ) { mask_size = depth->n * sizeof(u8); - mask = DRM_MALLOC( mask_size ); + mask = drm_alloc( mask_size, DRM_MEM_BUFS ); if ( mask == NULL ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); - DRM_FREE( buffer, buffer_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } if ( DRM_COPY_FROM_USER( mask, depth->mask, mask_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); - DRM_FREE( buffer, buffer_size ); - DRM_FREE( mask, mask_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); + drm_free( mask, mask_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } @@ -1090,7 +1110,7 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev, } } - DRM_FREE( mask, mask_size ); + drm_free( mask, mask_size, DRM_MEM_BUFS ); } else { for ( i = 0 ; i < count ; i++ ) { BEGIN_RING( 6 ); @@ -1114,9 +1134,9 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev, } } - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); - DRM_FREE( buffer, buffer_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); + drm_free( buffer, buffer_size, DRM_MEM_BUFS ); return 0; } @@ -1184,23 +1204,23 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev, xbuf_size = count * sizeof(*x); ybuf_size = count * sizeof(*y); - x = DRM_MALLOC( xbuf_size ); + x = drm_alloc( xbuf_size, DRM_MEM_BUFS ); if ( x == NULL ) { return DRM_ERR(ENOMEM); } - y = DRM_MALLOC( ybuf_size ); + y = drm_alloc( ybuf_size, DRM_MEM_BUFS ); if ( y == NULL ) { - DRM_FREE( x, xbuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } if ( DRM_COPY_FROM_USER( x, depth->x, xbuf_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } if ( DRM_COPY_FROM_USER( y, depth->y, ybuf_size ) ) { - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return DRM_ERR(EFAULT); } @@ -1228,8 +1248,8 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev, ADVANCE_RING(); } - DRM_FREE( x, xbuf_size ); - DRM_FREE( y, ybuf_size ); + drm_free( x, xbuf_size, DRM_MEM_BUFS ); + drm_free( y, ybuf_size, DRM_MEM_BUFS ); return 0; } @@ -1695,7 +1715,7 @@ int r128_getparam( DRM_IOCTL_ARGS ) return 0; } -static void r128_driver_prerelease(drm_device_t *dev, DRMFILE filp) +void r128_driver_prerelease(drm_device_t *dev, DRMFILE filp) { if ( dev->dev_private ) { drm_r128_private_t *dev_priv = dev->dev_private; @@ -1705,20 +1725,8 @@ static void r128_driver_prerelease(drm_device_t *dev, DRMFILE filp) } } -static void r128_driver_pretakedown(drm_device_t *dev) +void r128_driver_pretakedown(drm_device_t *dev) { r128_do_cleanup_cce( dev ); } -void r128_driver_register_fns(drm_device_t *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL; - dev->dev_priv_size = sizeof(drm_r128_buf_priv_t); - dev->fn_tbl.prerelease = r128_driver_prerelease; - dev->fn_tbl.pretakedown = r128_driver_pretakedown; - dev->fn_tbl.vblank_wait = r128_driver_vblank_wait; - dev->fn_tbl.irq_preinstall = r128_driver_irq_preinstall; - dev->fn_tbl.irq_postinstall = r128_driver_irq_postinstall; - dev->fn_tbl.irq_uninstall = r128_driver_irq_uninstall; - dev->fn_tbl.irq_handler = r128_driver_irq_handler; -} diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c index 43834b906..9176d9d8e 100644 --- a/drivers/char/drm/radeon_cp.c +++ b/drivers/char/drm/radeon_cp.c @@ -28,7 +28,6 @@ * Gareth Hughes */ -#include "radeon.h" #include "drmP.h" #include "drm.h" #include "radeon_drm.h" @@ -557,6 +556,264 @@ static u32 radeon_cp_microcode[][2] = { { 0000000000, 0000000000 }, }; +static u32 R300_cp_microcode[][2] = { + { 0x4200e000, 0000000000 }, + { 0x4000e000, 0000000000 }, + { 0x000000af, 0x00000008 }, + { 0x000000b3, 0x00000008 }, + { 0x6c5a504f, 0000000000 }, + { 0x4f4f497a, 0000000000 }, + { 0x5a578288, 0000000000 }, + { 0x4f91906a, 0000000000 }, + { 0x4f4f4f4f, 0000000000 }, + { 0x4fe24f44, 0000000000 }, + { 0x4f9c9c9c, 0000000000 }, + { 0xdc4f4fde, 0000000000 }, + { 0xa1cd4f4f, 0000000000 }, + { 0xd29d9d9d, 0000000000 }, + { 0x4f0f9fd7, 0000000000 }, + { 0x000ca000, 0x00000004 }, + { 0x000d0012, 0x00000038 }, + { 0x0000e8b4, 0x00000004 }, + { 0x000d0014, 0x00000038 }, + { 0x0000e8b6, 0x00000004 }, + { 0x000d0016, 0x00000038 }, + { 0x0000e854, 0x00000004 }, + { 0x000d0018, 0x00000038 }, + { 0x0000e855, 0x00000004 }, + { 0x000d001a, 0x00000038 }, + { 0x0000e856, 0x00000004 }, + { 0x000d001c, 0x00000038 }, + { 0x0000e857, 0x00000004 }, + { 0x000d001e, 0x00000038 }, + { 0x0000e824, 0x00000004 }, + { 0x000d0020, 0x00000038 }, + { 0x0000e825, 0x00000004 }, + { 0x000d0022, 0x00000038 }, + { 0x0000e830, 0x00000004 }, + { 0x000d0024, 0x00000038 }, + { 0x0000f0c0, 0x00000004 }, + { 0x000d0026, 0x00000038 }, + { 0x0000f0c1, 0x00000004 }, + { 0x000d0028, 0x00000038 }, + { 0x0000f041, 0x00000004 }, + { 0x000d002a, 0x00000038 }, + { 0x0000f184, 0x00000004 }, + { 0x000d002c, 0x00000038 }, + { 0x0000f185, 0x00000004 }, + { 0x000d002e, 0x00000038 }, + { 0x0000f186, 0x00000004 }, + { 0x000d0030, 0x00000038 }, + { 0x0000f187, 0x00000004 }, + { 0x000d0032, 0x00000038 }, + { 0x0000f180, 0x00000004 }, + { 0x000d0034, 0x00000038 }, + { 0x0000f393, 0x00000004 }, + { 0x000d0036, 0x00000038 }, + { 0x0000f38a, 0x00000004 }, + { 0x000d0038, 0x00000038 }, + { 0x0000f38e, 0x00000004 }, + { 0x0000e821, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x00000043, 0x00000018 }, + { 0x00cce800, 0x00000004 }, + { 0x001b0001, 0x00000004 }, + { 0x08004800, 0x00000004 }, + { 0x001b0001, 0x00000004 }, + { 0x08004800, 0x00000004 }, + { 0x001b0001, 0x00000004 }, + { 0x08004800, 0x00000004 }, + { 0x0000003a, 0x00000008 }, + { 0x0000a000, 0000000000 }, + { 0x02c0a000, 0x00000004 }, + { 0x000ca000, 0x00000004 }, + { 0x00130000, 0x00000004 }, + { 0x000c2000, 0x00000004 }, + { 0xc980c045, 0x00000008 }, + { 0x2000451d, 0x00000004 }, + { 0x0000e580, 0x00000004 }, + { 0x000ce581, 0x00000004 }, + { 0x08004580, 0x00000004 }, + { 0x000ce581, 0x00000004 }, + { 0x0000004c, 0x00000008 }, + { 0x0000a000, 0000000000 }, + { 0x000c2000, 0x00000004 }, + { 0x0000e50e, 0x00000004 }, + { 0x00032000, 0x00000004 }, + { 0x00022056, 0x00000028 }, + { 0x00000056, 0x00000024 }, + { 0x0800450f, 0x00000004 }, + { 0x0000a050, 0x00000008 }, + { 0x0000e565, 0x00000004 }, + { 0x0000e566, 0x00000004 }, + { 0x00000057, 0x00000008 }, + { 0x03cca5b4, 0x00000004 }, + { 0x05432000, 0x00000004 }, + { 0x00022000, 0x00000004 }, + { 0x4ccce063, 0x00000030 }, + { 0x08274565, 0x00000004 }, + { 0x00000063, 0x00000030 }, + { 0x08004564, 0x00000004 }, + { 0x0000e566, 0x00000004 }, + { 0x0000005a, 0x00000008 }, + { 0x00802066, 0x00000010 }, + { 0x00202000, 0x00000004 }, + { 0x001b00ff, 0x00000004 }, + { 0x01000069, 0x00000010 }, + { 0x001f2000, 0x00000004 }, + { 0x001c00ff, 0x00000004 }, + { 0000000000, 0x0000000c }, + { 0x00000085, 0x00000030 }, + { 0x0000005a, 0x00000008 }, + { 0x0000e576, 0x00000004 }, + { 0x000ca000, 0x00000004 }, + { 0x00012000, 0x00000004 }, + { 0x00082000, 0x00000004 }, + { 0x1800650e, 0x00000004 }, + { 0x00092000, 0x00000004 }, + { 0x000a2000, 0x00000004 }, + { 0x000f0000, 0x00000004 }, + { 0x00400000, 0x00000004 }, + { 0x00000079, 0x00000018 }, + { 0x0000e563, 0x00000004 }, + { 0x00c0e5f9, 0x000000c2 }, + { 0x0000006e, 0x00000008 }, + { 0x0000a06e, 0x00000008 }, + { 0x0000e576, 0x00000004 }, + { 0x0000e577, 0x00000004 }, + { 0x0000e50e, 0x00000004 }, + { 0x0000e50f, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x0000007c, 0x00000018 }, + { 0x00c0e5f9, 0x000000c2 }, + { 0x0000007c, 0x00000008 }, + { 0x0014e50e, 0x00000004 }, + { 0x0040e50f, 0x00000004 }, + { 0x00c0007f, 0x00000008 }, + { 0x0000e570, 0x00000004 }, + { 0x0000e571, 0x00000004 }, + { 0x0000e572, 0x0000000c }, + { 0x0000a000, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x0000e568, 0x00000004 }, + { 0x000c2000, 0x00000004 }, + { 0x00000089, 0x00000018 }, + { 0x000b0000, 0x00000004 }, + { 0x18c0e562, 0x00000004 }, + { 0x0000008b, 0x00000008 }, + { 0x00c0008a, 0x00000008 }, + { 0x000700e4, 0x00000004 }, + { 0x00000097, 0x00000038 }, + { 0x000ca099, 0x00000030 }, + { 0x080045bb, 0x00000004 }, + { 0x000c209a, 0x00000030 }, + { 0x0800e5bc, 0000000000 }, + { 0x0000e5bb, 0x00000004 }, + { 0x0000e5bc, 0000000000 }, + { 0x00120000, 0x0000000c }, + { 0x00120000, 0x00000004 }, + { 0x001b0002, 0x0000000c }, + { 0x0000a000, 0x00000004 }, + { 0x0000e821, 0x00000004 }, + { 0x0000e800, 0000000000 }, + { 0x0000e821, 0x00000004 }, + { 0x0000e82e, 0000000000 }, + { 0x02cca000, 0x00000004 }, + { 0x00140000, 0x00000004 }, + { 0x000ce1cc, 0x00000004 }, + { 0x050de1cd, 0x00000004 }, + { 0x000000a7, 0x00000020 }, + { 0x4200e000, 0000000000 }, + { 0x000000ae, 0x00000038 }, + { 0x000ca000, 0x00000004 }, + { 0x00140000, 0x00000004 }, + { 0x000c2000, 0x00000004 }, + { 0x00160000, 0x00000004 }, + { 0x700ce000, 0x00000004 }, + { 0x001400aa, 0x00000008 }, + { 0x4000e000, 0000000000 }, + { 0x02400000, 0x00000004 }, + { 0x400ee000, 0x00000004 }, + { 0x02400000, 0x00000004 }, + { 0x4000e000, 0000000000 }, + { 0x000c2000, 0x00000004 }, + { 0x0240e51b, 0x00000004 }, + { 0x0080e50a, 0x00000005 }, + { 0x0080e50b, 0x00000005 }, + { 0x00220000, 0x00000004 }, + { 0x000700e4, 0x00000004 }, + { 0x000000c1, 0x00000038 }, + { 0x000c209a, 0x00000030 }, + { 0x0880e5bd, 0x00000005 }, + { 0x000c2099, 0x00000030 }, + { 0x0800e5bb, 0x00000005 }, + { 0x000c209a, 0x00000030 }, + { 0x0880e5bc, 0x00000005 }, + { 0x000000c4, 0x00000008 }, + { 0x0080e5bd, 0x00000005 }, + { 0x0000e5bb, 0x00000005 }, + { 0x0080e5bc, 0x00000005 }, + { 0x00210000, 0x00000004 }, + { 0x02800000, 0x00000004 }, + { 0x00c000c8, 0x00000018 }, + { 0x4180e000, 0x00000040 }, + { 0x000000ca, 0x00000024 }, + { 0x01000000, 0x0000000c }, + { 0x0100e51d, 0x0000000c }, + { 0x000045bb, 0x00000004 }, + { 0x000080c4, 0x00000008 }, + { 0x0000f3ce, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x00cc2000, 0x00000004 }, + { 0x08c053cf, 0x00000040 }, + { 0x00008000, 0000000000 }, + { 0x0000f3d2, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x00cc2000, 0x00000004 }, + { 0x08c053d3, 0x00000040 }, + { 0x00008000, 0000000000 }, + { 0x0000f39d, 0x00000004 }, + { 0x0140a000, 0x00000004 }, + { 0x00cc2000, 0x00000004 }, + { 0x08c0539e, 0x00000040 }, + { 0x00008000, 0000000000 }, + { 0x03c00830, 0x00000004 }, + { 0x4200e000, 0000000000 }, + { 0x0000a000, 0x00000004 }, + { 0x200045e0, 0x00000004 }, + { 0x0000e5e1, 0000000000 }, + { 0x00000001, 0000000000 }, + { 0x000700e1, 0x00000004 }, + { 0x0800e394, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, + { 0000000000, 0000000000 }, +}; int RADEON_READ_PLL(drm_device_t *dev, int addr) { @@ -681,8 +938,7 @@ static void radeon_cp_load_microcode( drm_radeon_private_t *dev_priv ) RADEON_WRITE( RADEON_CP_ME_RAM_ADDR, 0 ); - if (dev_priv->is_r200) - { + if (dev_priv->microcode_version==UCODE_R200) { DRM_INFO("Loading R200 Microcode\n"); for ( i = 0 ; i < 256 ; i++ ) { @@ -691,9 +947,16 @@ static void radeon_cp_load_microcode( drm_radeon_private_t *dev_priv ) RADEON_WRITE( RADEON_CP_ME_RAM_DATAL, R200_cp_microcode[i][0] ); } - } - else - { + } else if (dev_priv->microcode_version==UCODE_R300) { + DRM_INFO("Loading R300 Microcode\n"); + for ( i = 0 ; i < 256 ; i++ ) + { + RADEON_WRITE( RADEON_CP_ME_RAM_DATAH, + R300_cp_microcode[i][1] ); + RADEON_WRITE( RADEON_CP_ME_RAM_DATAL, + R300_cp_microcode[i][0] ); + } + } else { for ( i = 0 ; i < 256 ; i++ ) { RADEON_WRITE( RADEON_CP_ME_RAM_DATAH, radeon_cp_microcode[i][1] ); @@ -1003,15 +1266,9 @@ static void radeon_set_pcigart( drm_radeon_private_t *dev_priv, int on ) static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) { - drm_radeon_private_t *dev_priv; + drm_radeon_private_t *dev_priv = dev->dev_private;; DRM_DEBUG( "\n" ); - dev_priv = DRM(alloc)( sizeof(drm_radeon_private_t), DRM_MEM_DRIVER ); - if ( dev_priv == NULL ) - return DRM_ERR(ENOMEM); - - memset( dev_priv, 0, sizeof(drm_radeon_private_t) ); - dev_priv->is_pci = init->is_pci; if ( dev_priv->is_pci && !dev->sg ) { @@ -1030,7 +1287,17 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) return DRM_ERR(EINVAL); } - dev_priv->is_r200 = (init->func == RADEON_INIT_R200_CP); + switch(init->func) { + case RADEON_INIT_R200_CP: + dev_priv->microcode_version=UCODE_R200; + break; + case RADEON_INIT_R300_CP: + dev_priv->microcode_version=UCODE_R300; + break; + default: + dev_priv->microcode_version=UCODE_R100; + } + dev_priv->do_boxes = 0; dev_priv->cp_mode = init->cp_mode; @@ -1079,7 +1346,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) */ dev_priv->depth_clear.rb3d_cntl = (RADEON_PLANE_MASK_ENABLE | (dev_priv->color_fmt << 10) | - (1<<15)); + (dev_priv->microcode_version == UCODE_R100 ? RADEON_ZBLOCK16 : 0)); dev_priv->depth_clear.rb3d_zstencilcntl = (dev_priv->depth_fmt | @@ -1233,7 +1500,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) dev_priv->ring.end = ((u32 *)dev_priv->cp_ring->handle + init->ring_size / sizeof(u32)); dev_priv->ring.size = init->ring_size; - dev_priv->ring.size_l2qw = DRM(order)( init->ring_size / 8 ); + dev_priv->ring.size_l2qw = drm_order( init->ring_size / 8 ); dev_priv->ring.tail_mask = (dev_priv->ring.size / sizeof(u32)) - 1; @@ -1247,7 +1514,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) } else #endif { - if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart, + if (!drm_ati_pcigart_init( dev, &dev_priv->phys_pci_gart, &dev_priv->bus_pci_gart)) { DRM_ERROR( "failed to init PCI GART!\n" ); dev->dev_private = (void *)dev_priv; @@ -1273,38 +1540,37 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) int radeon_do_cleanup_cp( drm_device_t *dev ) { + drm_radeon_private_t *dev_priv = dev->dev_private; DRM_DEBUG( "\n" ); /* Make sure interrupts are disabled here because the uninstall ioctl * may not have been called from userspace and after dev_private * is freed, it's too late. */ - if ( dev->irq_enabled ) DRM(irq_uninstall)(dev); - - if ( dev->dev_private ) { - drm_radeon_private_t *dev_priv = dev->dev_private; + if ( dev->irq_enabled ) drm_irq_uninstall(dev); #if __OS_HAS_AGP - if ( !dev_priv->is_pci ) { - if ( dev_priv->cp_ring != NULL ) - drm_core_ioremapfree( dev_priv->cp_ring, dev ); - if ( dev_priv->ring_rptr != NULL ) - drm_core_ioremapfree( dev_priv->ring_rptr, dev ); - if ( dev->agp_buffer_map != NULL ) - drm_core_ioremapfree( dev->agp_buffer_map, dev ); - } else -#endif + if ( !dev_priv->is_pci ) { + if ( dev_priv->cp_ring != NULL ) + drm_core_ioremapfree( dev_priv->cp_ring, dev ); + if ( dev_priv->ring_rptr != NULL ) + drm_core_ioremapfree( dev_priv->ring_rptr, dev ); + if ( dev->agp_buffer_map != NULL ) { - if (!DRM(ati_pcigart_cleanup)( dev, - dev_priv->phys_pci_gart, - dev_priv->bus_pci_gart )) - DRM_ERROR( "failed to cleanup PCI GART!\n" ); + drm_core_ioremapfree( dev->agp_buffer_map, dev ); + dev->agp_buffer_map = NULL; } - - DRM(free)( dev->dev_private, sizeof(drm_radeon_private_t), - DRM_MEM_DRIVER ); - dev->dev_private = NULL; + } else +#endif + { + if (!drm_ati_pcigart_cleanup( dev, + dev_priv->phys_pci_gart, + dev_priv->bus_pci_gart )) + DRM_ERROR( "failed to cleanup PCI GART!\n" ); } + + /* only clear to the start of flags */ + memset(dev_priv, 0, offsetof(drm_radeon_private_t, flags)); return 0; } @@ -1361,6 +1627,7 @@ int radeon_cp_init( DRM_IOCTL_ARGS ) switch ( init.func ) { case RADEON_INIT_CP: case RADEON_INIT_R200_CP: + case RADEON_INIT_R300_CP: return radeon_do_init_cp( dev, &init ); case RADEON_CLEANUP_CP: return radeon_do_cleanup_cp( dev ); @@ -1441,7 +1708,7 @@ int radeon_cp_stop( DRM_IOCTL_ARGS ) void radeon_do_release( drm_device_t *dev ) { drm_radeon_private_t *dev_priv = dev->dev_private; - int ret; + int i, ret; if (dev_priv) { if (dev_priv->cp_running) { @@ -1459,7 +1726,16 @@ void radeon_do_release( drm_device_t *dev ) } /* Disable *all* interrupts */ - RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 ); + if (dev_priv->mmio) /* remove this after permanent addmaps */ + RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 ); + + if (dev_priv->mmio) {/* remove all surfaces */ + for (i = 0; i < RADEON_MAX_SURFACES; i++) { + RADEON_WRITE(RADEON_SURFACE0_INFO + 16*i, 0); + RADEON_WRITE(RADEON_SURFACE0_LOWER_BOUND + 16*i, 0); + RADEON_WRITE(RADEON_SURFACE0_UPPER_BOUND + 16*i, 0); + } + } /* Free memory heap structures */ radeon_mem_takedown( &(dev_priv->gart_heap) ); @@ -1743,3 +2019,42 @@ int radeon_cp_buffers( DRM_IOCTL_ARGS ) return ret; } + +int radeon_driver_preinit(struct drm_device *dev, unsigned long flags) +{ + drm_radeon_private_t *dev_priv; + int ret = 0; + + dev_priv = drm_alloc(sizeof(drm_radeon_private_t), DRM_MEM_DRIVER); + if (dev_priv == NULL) + return DRM_ERR(ENOMEM); + + memset(dev_priv, 0, sizeof(drm_radeon_private_t)); + dev->dev_private = (void *)dev_priv; + dev_priv->flags = flags; + + switch (flags & CHIP_FAMILY_MASK) { + case CHIP_R100: + case CHIP_RV200: + case CHIP_R200: + case CHIP_R300: + dev_priv->flags |= CHIP_HAS_HIERZ; + break; + default: + /* all other chips have no hierarchical z buffer */ + break; + } + return ret; +} + +int radeon_driver_postcleanup(struct drm_device *dev) +{ + drm_radeon_private_t *dev_priv = dev->dev_private; + + DRM_DEBUG("\n"); + + drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); + + dev->dev_private = NULL; + return 0; +} diff --git a/drivers/char/drm/radeon_drm.h b/drivers/char/drm/radeon_drm.h index e447308b7..f51c11917 100644 --- a/drivers/char/drm/radeon_drm.h +++ b/drivers/char/drm/radeon_drm.h @@ -145,7 +145,8 @@ #define RADEON_EMIT_PP_TEX_SIZE_1 74 #define RADEON_EMIT_PP_TEX_SIZE_2 75 #define R200_EMIT_RB3D_BLENDCOLOR 76 -#define RADEON_MAX_STATE_PACKETS 77 +#define R200_EMIT_TCL_POINT_SPRITE_CNTL 77 +#define RADEON_MAX_STATE_PACKETS 78 /* Commands understood by cmd_buffer ioctl. More can be added but @@ -192,7 +193,10 @@ typedef union { #define RADEON_FRONT 0x1 #define RADEON_BACK 0x2 #define RADEON_DEPTH 0x4 -#define RADEON_STENCIL 0x8 +#define RADEON_STENCIL 0x8 +#define RADEON_CLEAR_FASTZ 0x80000000 +#define RADEON_USE_HIERZ 0x40000000 +#define RADEON_USE_COMP_ZBUF 0x20000000 /* Primitive types */ @@ -227,6 +231,8 @@ typedef union { #define RADEON_MAX_TEXTURE_LEVELS 12 #define RADEON_MAX_TEXTURE_UNITS 3 +#define RADEON_MAX_SURFACES 8 + /* Blits have strict offset rules. All blit offset must be aligned on * a 1K-byte boundary. */ @@ -361,6 +367,7 @@ typedef struct { int pfState; /* number of 3d windows (0,1,2ormore) */ int pfCurrentPage; /* which buffer is being displayed? */ int crtc2_base; /* CRTC2 frame offset */ + int tiling_enabled; /* set by drm, read by 2d + 3d clients */ } drm_radeon_sarea_t; @@ -399,6 +406,8 @@ typedef struct { #define DRM_RADEON_IRQ_WAIT 0x17 #define DRM_RADEON_CP_RESUME 0x18 #define DRM_RADEON_SETPARAM 0x19 +#define DRM_RADEON_SURF_ALLOC 0x1a +#define DRM_RADEON_SURF_FREE 0x1b #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) @@ -425,12 +434,15 @@ typedef struct { #define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t) #define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME) #define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t) +#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t) +#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t) typedef struct drm_radeon_init { enum { RADEON_INIT_CP = 0x01, RADEON_CLEANUP_CP = 0x02, - RADEON_INIT_R200_CP = 0x03 + RADEON_INIT_R200_CP = 0x03, + RADEON_INIT_R300_CP = 0x04 } func; unsigned long sarea_priv_offset; int is_pci; @@ -623,7 +635,19 @@ typedef struct drm_radeon_setparam { int64_t value; } drm_radeon_setparam_t; -#define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */ +#define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */ +#define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */ + +/* 1.14: Clients can allocate/free a surface + */ +typedef struct drm_radeon_surface_alloc { + unsigned int address; + unsigned int size; + unsigned int flags; +} drm_radeon_surface_alloc_t; +typedef struct drm_radeon_surface_free { + unsigned int address; +} drm_radeon_surface_free_t; #endif diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c index 965abc449..bb4e06fb5 100644 --- a/drivers/char/drm/radeon_drv.c +++ b/drivers/char/drm/radeon_drv.c @@ -31,11 +31,97 @@ #include -#include "radeon.h" #include "drmP.h" #include "drm.h" #include "radeon_drm.h" #include "radeon_drv.h" -#include "ati_pcigart.h" -#include "drm_core.h" +#include "drm_pciids.h" + +static int postinit( struct drm_device *dev, unsigned long flags ) +{ + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + radeon_PCI_IDS +}; + +extern drm_ioctl_desc_t radeon_ioctls[]; +extern int radeon_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, + .dev_priv_size = sizeof(drm_radeon_buf_priv_t), + .preinit = radeon_driver_preinit, + .postcleanup = radeon_driver_postcleanup, + .prerelease = radeon_driver_prerelease, + .pretakedown = radeon_driver_pretakedown, + .open_helper = radeon_driver_open_helper, + .vblank_wait = radeon_driver_vblank_wait, + .irq_preinstall = radeon_driver_irq_preinstall, + .irq_postinstall = radeon_driver_irq_postinstall, + .irq_uninstall = radeon_driver_irq_uninstall, + .irq_handler = radeon_driver_irq_handler, + .free_filp_priv = radeon_driver_free_filp_priv, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = radeon_ioctls, + .dma_ioctl = radeon_cp_buffers, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } +}; + +static int __init radeon_init(void) +{ + driver.num_ioctls = radeon_max_ioctl; + return drm_init(&driver); +} + +static void __exit radeon_exit(void) +{ + drm_exit(&driver); +} + +module_init(radeon_init); +module_exit(radeon_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h index 5df72332e..ce4ea6969 100644 --- a/drivers/char/drm/radeon_drv.h +++ b/drivers/char/drm/radeon_drv.h @@ -31,9 +31,100 @@ #ifndef __RADEON_DRV_H__ #define __RADEON_DRV_H__ +/* General customization: + */ + +#define DRIVER_AUTHOR "Gareth Hughes, Keith Whitwell, others." + +#define DRIVER_NAME "radeon" +#define DRIVER_DESC "ATI Radeon" +#define DRIVER_DATE "20050125" + +/* Interface history: + * + * 1.1 - ?? + * 1.2 - Add vertex2 ioctl (keith) + * - Add stencil capability to clear ioctl (gareth, keith) + * - Increase MAX_TEXTURE_LEVELS (brian) + * 1.3 - Add cmdbuf ioctl (keith) + * - Add support for new radeon packets (keith) + * - Add getparam ioctl (keith) + * - Add flip-buffers ioctl, deprecate fullscreen foo (keith). + * 1.4 - Add scratch registers to get_param ioctl. + * 1.5 - Add r200 packets to cmdbuf ioctl + * - Add r200 function to init ioctl + * - Add 'scalar2' instruction to cmdbuf + * 1.6 - Add static GART memory manager + * Add irq handler (won't be turned on unless X server knows to) + * Add irq ioctls and irq_active getparam. + * Add wait command for cmdbuf ioctl + * Add GART offset query for getparam + * 1.7 - Add support for cube map registers: R200_PP_CUBIC_FACES_[0..5] + * and R200_PP_CUBIC_OFFSET_F1_[0..5]. + * Added packets R200_EMIT_PP_CUBIC_FACES_[0..5] and + * R200_EMIT_PP_CUBIC_OFFSETS_[0..5]. (brian) + * 1.8 - Remove need to call cleanup ioctls on last client exit (keith) + * Add 'GET' queries for starting additional clients on different VT's. + * 1.9 - Add DRM_IOCTL_RADEON_CP_RESUME ioctl. + * Add texture rectangle support for r100. + * 1.10- Add SETPARAM ioctl; first parameter to set is FB_LOCATION, which + * clients use to tell the DRM where they think the framebuffer is + * located in the card's address space + * 1.11- Add packet R200_EMIT_RB3D_BLENDCOLOR to support GL_EXT_blend_color + * and GL_EXT_blend_[func|equation]_separate on r200 + * 1.12- Add R300 CP microcode support - this just loads the CP on r300 + * (No 3D support yet - just microcode loading) + * 1.13- Add packet R200_EMIT_TCL_POINT_SPRITE_CNTL for ARB_point_parameters + * - Add hyperz support, add hyperz flags to clear ioctl. + * 1.14- Add support for color tiling + * - Add R100/R200 surface allocation/free support + */ +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 14 +#define DRIVER_PATCHLEVEL 0 + #define GET_RING_HEAD(dev_priv) DRM_READ32( (dev_priv)->ring_rptr, 0 ) #define SET_RING_HEAD(dev_priv,val) DRM_WRITE32( (dev_priv)->ring_rptr, 0, (val) ) +/* + * Radeon chip families + */ +enum radeon_family { + CHIP_R100, + CHIP_RS100, + CHIP_RV100, + CHIP_R200, + CHIP_RV200, + CHIP_RS200, + CHIP_R250, + CHIP_RS250, + CHIP_RV250, + CHIP_RV280, + CHIP_R300, + CHIP_RS300, + CHIP_RV350, + CHIP_LAST, +}; + +enum radeon_cp_microcode_version { + UCODE_R100, + UCODE_R200, + UCODE_R300, +}; + +/* + * Chip flags + */ +enum radeon_chip_flags { + CHIP_FAMILY_MASK = 0x0000ffffUL, + CHIP_FLAGS_MASK = 0xffff0000UL, + CHIP_IS_MOBILITY = 0x00010000UL, + CHIP_IS_IGP = 0x00020000UL, + CHIP_SINGLE_CRTC = 0x00040000UL, + CHIP_IS_AGP = 0x00080000UL, + CHIP_HAS_HIERZ = 0x00100000UL, +}; + typedef struct drm_radeon_freelist { unsigned int age; drm_buf_t *buf; @@ -72,6 +163,21 @@ struct mem_block { DRMFILE filp; /* 0: free, -1: heap, other: real files */ }; +struct radeon_surface { + int refcount; + u32 lower; + u32 upper; + u32 flags; +}; + +struct radeon_virt_surface { + int surface_index; + u32 lower; + u32 upper; + u32 flags; + DRMFILE filp; +}; + typedef struct drm_radeon_private { drm_radeon_ring_buffer_t ring; drm_radeon_sarea_t *sarea_priv; @@ -93,7 +199,7 @@ typedef struct drm_radeon_private { int usec_timeout; - int is_r200; + int microcode_version; int is_pci; unsigned long phys_pci_gart; @@ -150,6 +256,11 @@ typedef struct drm_radeon_private { wait_queue_head_t swi_queue; atomic_t swi_emitted; + struct radeon_surface surfaces[RADEON_MAX_SURFACES]; + struct radeon_virt_surface virt_surfaces[2*RADEON_MAX_SURFACES]; + + /* starting from here on, data is preserved accross an open */ + uint32_t flags; /* see radeon_chip_flags */ } drm_radeon_private_t; typedef struct drm_radeon_buf_priv { @@ -176,6 +287,9 @@ extern int radeon_do_cp_idle( drm_radeon_private_t *dev_priv ); extern int radeon_do_cleanup_cp( drm_device_t *dev ); extern int radeon_do_cleanup_pageflip( drm_device_t *dev ); +extern int radeon_driver_preinit(struct drm_device *dev, unsigned long flags); +extern int radeon_driver_postcleanup(struct drm_device *dev); + /* radeon_state.c */ extern int radeon_cp_clear( DRM_IOCTL_ARGS ); extern int radeon_cp_swap( DRM_IOCTL_ARGS ); @@ -195,6 +309,8 @@ extern int radeon_mem_free( DRM_IOCTL_ARGS ); extern int radeon_mem_init_heap( DRM_IOCTL_ARGS ); extern void radeon_mem_takedown( struct mem_block **heap ); extern void radeon_mem_release( DRMFILE filp, struct mem_block *heap ); +extern int radeon_surface_alloc(DRM_IOCTL_ARGS); +extern int radeon_surface_free(DRM_IOCTL_ARGS); /* radeon_irq.c */ extern int radeon_irq_emit( DRM_IOCTL_ARGS ); @@ -210,6 +326,14 @@ extern irqreturn_t radeon_driver_irq_handler( DRM_IRQ_ARGS ); extern void radeon_driver_irq_preinstall( drm_device_t *dev ); extern void radeon_driver_irq_postinstall( drm_device_t *dev ); extern void radeon_driver_irq_uninstall( drm_device_t *dev ); +extern void radeon_driver_prerelease(drm_device_t *dev, DRMFILE filp); +extern void radeon_driver_pretakedown(drm_device_t *dev); +extern int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv); +extern void radeon_driver_free_filp_priv(drm_device_t *dev, drm_file_t *filp_priv); + +extern int radeon_preinit( struct drm_device *dev, unsigned long flags ); +extern int radeon_postinit( struct drm_device *dev, unsigned long flags ); +extern int radeon_postcleanup( struct drm_device *dev ); /* Flags for stats.boxes */ @@ -361,7 +485,9 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); # define RADEON_ROP_ENABLE (1 << 6) # define RADEON_STENCIL_ENABLE (1 << 7) # define RADEON_Z_ENABLE (1 << 8) +# define RADEON_ZBLOCK16 (1 << 15) #define RADEON_RB3D_DEPTHOFFSET 0x1c24 +#define RADEON_RB3D_DEPTHCLEARVALUE 0x3230 #define RADEON_RB3D_DEPTHPITCH 0x1c28 #define RADEON_RB3D_PLANEMASK 0x1d84 #define RADEON_RB3D_STENCILREFMASK 0x1d7c @@ -374,11 +500,15 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); #define RADEON_RB3D_ZSTENCILCNTL 0x1c2c # define RADEON_Z_TEST_MASK (7 << 4) # define RADEON_Z_TEST_ALWAYS (7 << 4) +# define RADEON_Z_HIERARCHY_ENABLE (1 << 8) # define RADEON_STENCIL_TEST_ALWAYS (7 << 12) # define RADEON_STENCIL_S_FAIL_REPLACE (2 << 16) # define RADEON_STENCIL_ZPASS_REPLACE (2 << 20) # define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24) +# define RADEON_Z_COMPRESSION_ENABLE (1 << 28) +# define RADEON_FORCE_Z_DIRTY (1 << 29) # define RADEON_Z_WRITE_ENABLE (1 << 30) +# define RADEON_Z_DECOMPRESSION_ENABLE (1 << 31) #define RADEON_RBBM_SOFT_RESET 0x00f0 # define RADEON_SOFT_RESET_CP (1 << 0) # define RADEON_SOFT_RESET_HI (1 << 1) @@ -457,6 +587,7 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); # define RADEON_SURF_TILE_MODE_16BIT_Z (3 << 16) #define RADEON_SURFACE0_LOWER_BOUND 0x0b04 #define RADEON_SURFACE0_UPPER_BOUND 0x0b08 +# define RADEON_SURF_ADDRESS_FIXED_MASK (0x3ff << 0) #define RADEON_SURFACE1_INFO 0x0b1c #define RADEON_SURFACE1_LOWER_BOUND 0x0b14 #define RADEON_SURFACE1_UPPER_BOUND 0x0b18 @@ -486,7 +617,7 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); # define RADEON_WAIT_3D_IDLECLEAN (1 << 17) # define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) -#define RADEON_RB3D_ZMASKOFFSET 0x1c34 +#define RADEON_RB3D_ZMASKOFFSET 0x3234 #define RADEON_RB3D_ZSTENCILCNTL 0x1c2c # define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) # define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) @@ -541,6 +672,8 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); # define RADEON_3D_DRAW_IMMD 0x00002900 # define RADEON_3D_DRAW_INDX 0x00002A00 # define RADEON_3D_LOAD_VBPNTR 0x00002F00 +# define RADEON_3D_CLEAR_ZMASK 0x00003200 +# define RADEON_3D_CLEAR_HIZ 0x00003700 # define RADEON_CNTL_HOSTDATA_BLT 0x00009400 # define RADEON_CNTL_PAINT_MULTI 0x00009A00 # define RADEON_CNTL_BITBLT_MULTI 0x00009B00 @@ -699,6 +832,8 @@ extern void radeon_driver_irq_uninstall( drm_device_t *dev ); #define R200_RB3D_BLENDCOLOR 0x3218 +#define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4 + /* Constants */ #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ @@ -892,25 +1027,27 @@ do { \ } while (0) -#define OUT_RING_USER_TABLE( tab, sz ) do { \ +#define OUT_RING_TABLE( tab, sz ) do { \ int _size = (sz); \ - int __user *_tab = (tab); \ + int *_tab = (int *)(tab); \ \ if (write + _size > mask) { \ - int i = (mask+1) - write; \ - if (DRM_COPY_FROM_USER_UNCHECKED( (int *)(ring+write), \ - _tab, i*4 )) \ - return DRM_ERR(EFAULT); \ + int _i = (mask+1) - write; \ + _size -= _i; \ + while (_i > 0 ) { \ + *(int *)(ring + write) = *_tab++; \ + write++; \ + _i--; \ + } \ write = 0; \ - _size -= i; \ - _tab += i; \ + _tab += _i; \ } \ \ - if (_size && DRM_COPY_FROM_USER_UNCHECKED( (int *)(ring+write), \ - _tab, _size*4 )) \ - return DRM_ERR(EFAULT); \ - \ - write += _size; \ + while (_size > 0) { \ + *(ring + write) = *_tab++; \ + write++; \ + _size--; \ + } \ write &= mask; \ } while (0) diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c index bdb3cc168..b7deca73b 100644 --- a/drivers/char/drm/radeon_irq.c +++ b/drivers/char/drm/radeon_irq.c @@ -27,10 +27,9 @@ * * Authors: * Keith Whitwell - * Michel Dänzer + * Michel D�zer */ -#include "radeon.h" #include "drmP.h" #include "drm.h" #include "radeon_drm.h" @@ -78,7 +77,7 @@ irqreturn_t radeon_driver_irq_handler( DRM_IRQ_ARGS ) if (stat & RADEON_CRTC_VBLANK_STAT) { atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); - DRM(vbl_send_signals)( dev ); + drm_vbl_send_signals( dev ); } /* Acknowledge interrupts we handle */ @@ -223,7 +222,7 @@ int radeon_irq_wait( DRM_IOCTL_ARGS ) /* drm_dma.h hooks */ -void DRM(driver_irq_preinstall)( drm_device_t *dev ) { +void radeon_driver_irq_preinstall( drm_device_t *dev ) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *)dev->dev_private; @@ -234,7 +233,7 @@ void DRM(driver_irq_preinstall)( drm_device_t *dev ) { radeon_acknowledge_irqs( dev_priv ); } -void DRM(driver_irq_postinstall)( drm_device_t *dev ) { +void radeon_driver_irq_postinstall( drm_device_t *dev ) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *)dev->dev_private; @@ -247,7 +246,7 @@ void DRM(driver_irq_postinstall)( drm_device_t *dev ) { RADEON_SW_INT_ENABLE ); } -void DRM(driver_irq_uninstall)( drm_device_t *dev ) { +void radeon_driver_irq_uninstall( drm_device_t *dev ) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *)dev->dev_private; if (!dev_priv) diff --git a/drivers/char/drm/radeon_mem.c b/drivers/char/drm/radeon_mem.c index 289957406..134f894e6 100644 --- a/drivers/char/drm/radeon_mem.c +++ b/drivers/char/drm/radeon_mem.c @@ -29,7 +29,6 @@ * Keith Whitwell */ -#include "radeon.h" #include "drmP.h" #include "drm.h" #include "radeon_drm.h" @@ -44,7 +43,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, { /* Maybe cut off the start of an existing block */ if (start > p->start) { - struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock)); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFS ); if (!newblock) goto out; newblock->start = start; @@ -60,7 +59,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, /* Maybe cut off the end of an existing block */ if (size < p->size) { - struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock)); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFS ); if (!newblock) goto out; newblock->start = start + size; @@ -85,7 +84,7 @@ static struct mem_block *alloc_block( struct mem_block *heap, int size, struct mem_block *p; int mask = (1 << align2)-1; - for (p = heap->next ; p != heap ; p = p->next) { + list_for_each(p, heap) { int start = (p->start + mask) & ~mask; if (p->filp == 0 && start + size <= p->start + p->size) return split_block( p, start, size, filp ); @@ -98,7 +97,7 @@ static struct mem_block *find_block( struct mem_block *heap, int start ) { struct mem_block *p; - for (p = heap->next ; p != heap ; p = p->next) + list_for_each(p, heap) if (p->start == start) return p; @@ -118,7 +117,7 @@ static void free_block( struct mem_block *p ) p->size += q->size; p->next = q->next; p->next->prev = p; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q), DRM_MEM_BUFS ); } if (p->prev->filp == 0) { @@ -126,7 +125,7 @@ static void free_block( struct mem_block *p ) q->size += p->size; q->next = p->next; q->next->prev = q; - DRM_FREE(p, sizeof(*q)); + drm_free(p, sizeof(*q), DRM_MEM_BUFS ); } } @@ -134,14 +133,14 @@ static void free_block( struct mem_block *p ) */ static int init_heap(struct mem_block **heap, int start, int size) { - struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks)); + struct mem_block *blocks = drm_alloc(sizeof(*blocks), DRM_MEM_BUFS ); if (!blocks) return DRM_ERR(ENOMEM); - *heap = DRM_MALLOC(sizeof(**heap)); + *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFS ); if (!*heap) { - DRM_FREE( blocks, sizeof(*blocks) ); + drm_free( blocks, sizeof(*blocks), DRM_MEM_BUFS ); return DRM_ERR(ENOMEM); } @@ -166,7 +165,7 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap ) if (!heap || !heap->next) return; - for (p = heap->next ; p != heap ; p = p->next) { + list_for_each(p, heap) { if (p->filp == filp) p->filp = NULL; } @@ -174,13 +173,13 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap ) /* Assumes a single contiguous range. Needs a special filp in * 'heap' to stop it being subsumed. */ - for (p = heap->next ; p != heap ; p = p->next) { + list_for_each(p, heap) { while (p->filp == 0 && p->next->filp == 0) { struct mem_block *q = p->next; p->size += q->size; p->next = q->next; p->next->prev = p; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q),DRM_MEM_DRIVER); } } } @@ -197,10 +196,10 @@ void radeon_mem_takedown( struct mem_block **heap ) for (p = (*heap)->next ; p != *heap ; ) { struct mem_block *q = p; p = p->next; - DRM_FREE(q, sizeof(*q)); + drm_free(q, sizeof(*q),DRM_MEM_DRIVER); } - DRM_FREE( *heap, sizeof(**heap) ); + drm_free( *heap, sizeof(**heap),DRM_MEM_DRIVER ); *heap = NULL; } diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c index f3cc86eea..b8d38e106 100644 --- a/drivers/char/drm/radeon_state.c +++ b/drivers/char/drm/radeon_state.c @@ -27,13 +27,43 @@ * Kevin E. Martin */ -#include "radeon.h" #include "drmP.h" #include "drm.h" #include "drm_sarea.h" #include "radeon_drm.h" #include "radeon_drv.h" +drm_ioctl_desc_t radeon_ioctls[] = { + [DRM_IOCTL_NR(DRM_RADEON_CP_INIT)] = { radeon_cp_init, 1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_CP_START)] = { radeon_cp_start, 1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_CP_STOP)] = { radeon_cp_stop, 1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_CP_RESET)] = { radeon_cp_reset, 1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_CP_IDLE)] = { radeon_cp_idle, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_CP_RESUME)] = { radeon_cp_resume, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_RESET)] = { radeon_engine_reset, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_FULLSCREEN)] = { radeon_fullscreen, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_SWAP)] = { radeon_cp_swap, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_CLEAR)] = { radeon_cp_clear, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_VERTEX)] = { radeon_cp_vertex, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_INDICES)] = { radeon_cp_indices, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_TEXTURE)] = { radeon_cp_texture, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_STIPPLE)] = { radeon_cp_stipple, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_INDIRECT)] = { radeon_cp_indirect, 1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_VERTEX2)] = { radeon_cp_vertex2, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_CMDBUF)] = { radeon_cp_cmdbuf, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_GETPARAM)] = { radeon_cp_getparam, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_FLIP)] = { radeon_cp_flip, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_ALLOC)] = { radeon_mem_alloc, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_FREE)] = { radeon_mem_free, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_INIT_HEAP)] = { radeon_mem_init_heap,1, 1 }, + [DRM_IOCTL_NR(DRM_RADEON_IRQ_EMIT)] = { radeon_irq_emit, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_IRQ_WAIT)] = { radeon_irq_wait, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_SETPARAM)] = { radeon_cp_setparam, 1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_SURF_ALLOC)] = { radeon_surface_alloc,1, 0 }, + [DRM_IOCTL_NR(DRM_RADEON_SURF_FREE)] = { radeon_surface_free, 1, 0 } +}; + +int radeon_max_ioctl = DRM_ARRAY_SIZE(radeon_ioctls); /* ================================================================ * Helper functions for client state checking and fixup @@ -63,21 +93,6 @@ static __inline__ int radeon_check_and_fixup_offset( drm_radeon_private_t *dev_p return 0; } -static __inline__ int radeon_check_and_fixup_offset_user( drm_radeon_private_t *dev_priv, - drm_file_t *filp_priv, - u32 __user *offset ) { - u32 off; - - DRM_GET_USER_UNCHECKED( off, offset ); - - if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &off ) ) - return DRM_ERR( EINVAL ); - - DRM_PUT_USER_UNCHECKED( offset, off ); - - return 0; -} - static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_priv, drm_file_t *filp_priv, int id, @@ -85,18 +100,18 @@ static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_ switch ( id ) { case RADEON_EMIT_PP_MISC: - if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv, - &data[( RADEON_RB3D_DEPTHOFFSET - - RADEON_PP_MISC ) / 4] ) ) { + if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, + &data[( RADEON_RB3D_DEPTHOFFSET + - RADEON_PP_MISC ) / 4] ) ) { DRM_ERROR( "Invalid depth buffer offset\n" ); return DRM_ERR( EINVAL ); } break; case RADEON_EMIT_PP_CNTL: - if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv, - &data[( RADEON_RB3D_COLOROFFSET - - RADEON_PP_CNTL ) / 4] ) ) { + if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, + &data[( RADEON_RB3D_COLOROFFSET + - RADEON_PP_CNTL ) / 4] ) ) { DRM_ERROR( "Invalid colour buffer offset\n" ); return DRM_ERR( EINVAL ); } @@ -108,8 +123,8 @@ static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_ case R200_EMIT_PP_TXOFFSET_3: case R200_EMIT_PP_TXOFFSET_4: case R200_EMIT_PP_TXOFFSET_5: - if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv, - &data[0] ) ) { + if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, + &data[0] ) ) { DRM_ERROR( "Invalid R200 texture offset\n" ); return DRM_ERR( EINVAL ); } @@ -118,9 +133,9 @@ static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_ case RADEON_EMIT_PP_TXFILTER_0: case RADEON_EMIT_PP_TXFILTER_1: case RADEON_EMIT_PP_TXFILTER_2: - if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv, - &data[( RADEON_PP_TXOFFSET_0 - - RADEON_PP_TXFILTER_0 ) / 4] ) ) { + if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, + &data[( RADEON_PP_TXOFFSET_0 + - RADEON_PP_TXFILTER_0 ) / 4] ) ) { DRM_ERROR( "Invalid R100 texture offset\n" ); return DRM_ERR( EINVAL ); } @@ -134,9 +149,8 @@ static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_ case R200_EMIT_PP_CUBIC_OFFSETS_5: { int i; for ( i = 0; i < 5; i++ ) { - if ( radeon_check_and_fixup_offset_user( dev_priv, - filp_priv, - &data[i] ) ) { + if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, + &data[i] ) ) { DRM_ERROR( "Invalid R200 cubic texture offset\n" ); return DRM_ERR( EINVAL ); } @@ -204,6 +218,7 @@ static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_ case RADEON_EMIT_PP_TEX_SIZE_1: case RADEON_EMIT_PP_TEX_SIZE_2: case R200_EMIT_RB3D_BLENDCOLOR: + case R200_EMIT_TCL_POINT_SPRITE_CNTL: /* These packets don't contain memory offsets */ break; @@ -219,17 +234,11 @@ static __inline__ int radeon_check_and_fixup_packet3( drm_radeon_private_t *dev_ drm_file_t *filp_priv, drm_radeon_cmd_buffer_t *cmdbuf, unsigned int *cmdsz ) { - u32 tmp[4]; - u32 __user *cmd = (u32 __user *)cmdbuf->buf; - - if ( DRM_COPY_FROM_USER_UNCHECKED( tmp, cmd, sizeof( tmp ) ) ) { - DRM_ERROR( "Failed to copy data from user space\n" ); - return DRM_ERR( EFAULT ); - } + u32 *cmd = (u32 *) cmdbuf->buf; - *cmdsz = 2 + ( ( tmp[0] & RADEON_CP_PACKET_COUNT_MASK ) >> 16 ); + *cmdsz = 2 + ( ( cmd[0] & RADEON_CP_PACKET_COUNT_MASK ) >> 16 ); - if ( ( tmp[0] & 0xc0000000 ) != RADEON_CP_PACKET3 ) { + if ( ( cmd[0] & 0xc0000000 ) != RADEON_CP_PACKET3 ) { DRM_ERROR( "Not a type 3 packet\n" ); return DRM_ERR( EINVAL ); } @@ -240,32 +249,27 @@ static __inline__ int radeon_check_and_fixup_packet3( drm_radeon_private_t *dev_ } /* Check client state and fix it up if necessary */ - if ( tmp[0] & 0x8000 ) { /* MSB of opcode: next DWORD GUI_CNTL */ + if ( cmd[0] & 0x8000 ) { /* MSB of opcode: next DWORD GUI_CNTL */ u32 offset; - if ( tmp[1] & ( RADEON_GMC_SRC_PITCH_OFFSET_CNTL + if ( cmd[1] & ( RADEON_GMC_SRC_PITCH_OFFSET_CNTL | RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) { - offset = tmp[2] << 10; + offset = cmd[2] << 10; if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) { DRM_ERROR( "Invalid first packet offset\n" ); return DRM_ERR( EINVAL ); } - tmp[2] = ( tmp[2] & 0xffc00000 ) | offset >> 10; + cmd[2] = ( cmd[2] & 0xffc00000 ) | offset >> 10; } - if ( ( tmp[1] & RADEON_GMC_SRC_PITCH_OFFSET_CNTL ) && - ( tmp[1] & RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) { - offset = tmp[3] << 10; + if ( ( cmd[1] & RADEON_GMC_SRC_PITCH_OFFSET_CNTL ) && + ( cmd[1] & RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) { + offset = cmd[3] << 10; if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) { DRM_ERROR( "Invalid second packet offset\n" ); return DRM_ERR( EINVAL ); } - tmp[3] = ( tmp[3] & 0xffc00000 ) | offset >> 10; - } - - if ( DRM_COPY_TO_USER_UNCHECKED( cmd, tmp, sizeof( tmp ) ) ) { - DRM_ERROR( "Failed to copy data to user space\n" ); - return DRM_ERR( EFAULT ); + cmd[3] = ( cmd[3] & 0xffc00000 ) | offset >> 10; } } @@ -568,6 +572,7 @@ static struct { { RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" }, { RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_2" }, { R200_RB3D_BLENDCOLOR, 3, "R200_RB3D_BLENDCOLOR" }, + { R200_SE_TCL_POINT_SPRITE_CNTL, 1, "R200_SE_TCL_POINT_SPRITE_CNTL" }, }; @@ -778,13 +783,160 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, } } } + + /* hyper z clear */ + /* no docs available, based on reverse engeneering by Stephane Marchesin */ + if ((flags & (RADEON_DEPTH | RADEON_STENCIL)) && (flags & RADEON_CLEAR_FASTZ)) { + + int i; + int depthpixperline = dev_priv->depth_fmt==RADEON_DEPTH_FORMAT_16BIT_INT_Z? + (dev_priv->depth_pitch / 2): (dev_priv->depth_pitch / 4); + + u32 clearmask; + + u32 tempRB3D_DEPTHCLEARVALUE = clear->clear_depth | + ((clear->depth_mask & 0xff) << 24); + + + /* Make sure we restore the 3D state next time. + * we haven't touched any "normal" state - still need this? + */ + dev_priv->sarea_priv->ctx_owner = 0; + + if ((dev_priv->flags & CHIP_HAS_HIERZ) && (flags & RADEON_USE_HIERZ)) { + /* FIXME : reverse engineer that for Rx00 cards */ + /* FIXME : the mask supposedly contains low-res z values. So can't set + just to the max (0xff? or actually 0x3fff?), need to take z clear + value into account? */ + /* pattern seems to work for r100, though get slight + rendering errors with glxgears. If hierz is not enabled for r100, + only 4 bits which indicate clear (15,16,31,32, all zero) matter, the + other ones are ignored, and the same clear mask can be used. That's + very different behaviour than R200 which needs different clear mask + and different number of tiles to clear if hierz is enabled or not !?! + */ + clearmask = (0xff<<22)|(0xff<<6)| 0x003f003f; + } + else { + /* clear mask : chooses the clearing pattern. + rv250: could be used to clear only parts of macrotiles + (but that would get really complicated...)? + bit 0 and 1 (either or both of them ?!?!) are used to + not clear tile (or maybe one of the bits indicates if the tile is + compressed or not), bit 2 and 3 to not clear tile 1,...,. + Pattern is as follows: + | 0,1 | 4,5 | 8,9 |12,13|16,17|20,21|24,25|28,29| + bits ------------------------------------------------- + | 2,3 | 6,7 |10,11|14,15|18,19|22,23|26,27|30,31| + rv100: clearmask covers 2x8 4x1 tiles, but one clear still + covers 256 pixels ?!? + */ + clearmask = 0x0; + } + + BEGIN_RING( 8 ); + RADEON_WAIT_UNTIL_2D_IDLE(); + OUT_RING_REG( RADEON_RB3D_DEPTHCLEARVALUE, + tempRB3D_DEPTHCLEARVALUE); + /* what offset is this exactly ? */ + OUT_RING_REG( RADEON_RB3D_ZMASKOFFSET, 0 ); + /* need ctlstat, otherwise get some strange black flickering */ + OUT_RING_REG( RADEON_RB3D_ZCACHE_CTLSTAT, RADEON_RB3D_ZC_FLUSH_ALL ); + ADVANCE_RING(); + + for (i = 0; i < nbox; i++) { + int tileoffset, nrtilesx, nrtilesy, j; + /* it looks like r200 needs rv-style clears, at least if hierz is not enabled? */ + if ((dev_priv->flags&CHIP_HAS_HIERZ) && !(dev_priv->microcode_version==UCODE_R200)) { + /* FIXME : figure this out for r200 (when hierz is enabled). Or + maybe r200 actually doesn't need to put the low-res z value into + the tile cache like r100, but just needs to clear the hi-level z-buffer? + Works for R100, both with hierz and without. + R100 seems to operate on 2x1 8x8 tiles, but... + odd: offset/nrtiles need to be 64 pix (4 block) aligned? Potentially + problematic with resolutions which are not 64 pix aligned? */ + tileoffset = ((pbox[i].y1 >> 3) * depthpixperline + pbox[i].x1) >> 6; + nrtilesx = ((pbox[i].x2 & ~63) - (pbox[i].x1 & ~63)) >> 4; + nrtilesy = (pbox[i].y2 >> 3) - (pbox[i].y1 >> 3); + for (j = 0; j <= nrtilesy; j++) { + BEGIN_RING( 4 ); + OUT_RING( CP_PACKET3( RADEON_3D_CLEAR_ZMASK, 2 ) ); + /* first tile */ + OUT_RING( tileoffset * 8 ); + /* the number of tiles to clear */ + OUT_RING( nrtilesx + 4 ); + /* clear mask : chooses the clearing pattern. */ + OUT_RING( clearmask ); + ADVANCE_RING(); + tileoffset += depthpixperline >> 6; + } + } + else if (dev_priv->microcode_version==UCODE_R200) { + /* works for rv250. */ + /* find first macro tile (8x2 4x4 z-pixels on rv250) */ + tileoffset = ((pbox[i].y1 >> 3) * depthpixperline + pbox[i].x1) >> 5; + nrtilesx = (pbox[i].x2 >> 5) - (pbox[i].x1 >> 5); + nrtilesy = (pbox[i].y2 >> 3) - (pbox[i].y1 >> 3); + for (j = 0; j <= nrtilesy; j++) { + BEGIN_RING( 4 ); + OUT_RING( CP_PACKET3( RADEON_3D_CLEAR_ZMASK, 2 ) ); + /* first tile */ + /* judging by the first tile offset needed, could possibly + directly address/clear 4x4 tiles instead of 8x2 * 4x4 + macro tiles, though would still need clear mask for + right/bottom if truely 4x4 granularity is desired ? */ + OUT_RING( tileoffset * 16 ); + /* the number of tiles to clear */ + OUT_RING( nrtilesx + 1 ); + /* clear mask : chooses the clearing pattern. */ + OUT_RING( clearmask ); + ADVANCE_RING(); + tileoffset += depthpixperline >> 5; + } + } + else { /* rv 100 */ + /* rv100 might not need 64 pix alignment, who knows */ + /* offsets are, hmm, weird */ + tileoffset = ((pbox[i].y1 >> 4) * depthpixperline + pbox[i].x1) >> 6; + nrtilesx = ((pbox[i].x2 & ~63) - (pbox[i].x1 & ~63)) >> 4; + nrtilesy = (pbox[i].y2 >> 4) - (pbox[i].y1 >> 4); + for (j = 0; j <= nrtilesy; j++) { + BEGIN_RING( 4 ); + OUT_RING( CP_PACKET3( RADEON_3D_CLEAR_ZMASK, 2 ) ); + OUT_RING( tileoffset * 128 ); + /* the number of tiles to clear */ + OUT_RING( nrtilesx + 4 ); + /* clear mask : chooses the clearing pattern. */ + OUT_RING( clearmask ); + ADVANCE_RING(); + tileoffset += depthpixperline >> 6; + } + } + } + + /* TODO don't always clear all hi-level z tiles */ + if ((dev_priv->flags & CHIP_HAS_HIERZ) && (dev_priv->microcode_version==UCODE_R200) + && (flags & RADEON_USE_HIERZ)) + /* r100 and cards without hierarchical z-buffer have no high-level z-buffer */ + /* FIXME : the mask supposedly contains low-res z values. So can't set + just to the max (0xff? or actually 0x3fff?), need to take z clear + value into account? */ + { + BEGIN_RING( 4 ); + OUT_RING( CP_PACKET3( RADEON_3D_CLEAR_HIZ, 2 ) ); + OUT_RING( 0x0 ); /* First tile */ + OUT_RING( 0x3cc0 ); + OUT_RING( (0xff<<22)|(0xff<<6)| 0x003f003f); + ADVANCE_RING(); + } + } /* We have to clear the depth and/or stencil buffers by * rendering a quad into just those buffers. Thus, we have to * make sure the 3D engine is configured correctly. */ - if ( dev_priv->is_r200 && - (flags & (RADEON_DEPTH | RADEON_STENCIL)) ) { + if ((dev_priv->microcode_version == UCODE_R200) && + (flags & (RADEON_DEPTH | RADEON_STENCIL))) { int tempPP_CNTL; int tempRE_CNTL; @@ -803,7 +955,6 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, tempRE_CNTL = 0; tempRB3D_CNTL = depth_clear->rb3d_cntl; - tempRB3D_CNTL &= ~(1<<15); /* unset radeon magic flag */ tempRB3D_ZSTENCILCNTL = depth_clear->rb3d_zstencilcntl; tempRB3D_STENCILREFMASK = 0x0; @@ -854,6 +1005,14 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, tempRB3D_STENCILREFMASK = 0x00000000; } + if (flags & RADEON_USE_COMP_ZBUF) { + tempRB3D_ZSTENCILCNTL |= RADEON_Z_COMPRESSION_ENABLE | + RADEON_Z_DECOMPRESSION_ENABLE; + } + if (flags & RADEON_USE_HIERZ) { + tempRB3D_ZSTENCILCNTL |= RADEON_Z_HIERARCHY_ENABLE; + } + BEGIN_RING( 26 ); RADEON_WAIT_UNTIL_2D_IDLE(); @@ -908,6 +1067,8 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, } else if ( (flags & (RADEON_DEPTH | RADEON_STENCIL)) ) { + int tempRB3D_ZSTENCILCNTL = depth_clear->rb3d_zstencilcntl; + rb3d_cntl = depth_clear->rb3d_cntl; if ( flags & RADEON_DEPTH ) { @@ -924,6 +1085,14 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, rb3d_stencilrefmask = 0x00000000; } + if (flags & RADEON_USE_COMP_ZBUF) { + tempRB3D_ZSTENCILCNTL |= RADEON_Z_COMPRESSION_ENABLE | + RADEON_Z_DECOMPRESSION_ENABLE; + } + if (flags & RADEON_USE_HIERZ) { + tempRB3D_ZSTENCILCNTL |= RADEON_Z_HIERARCHY_ENABLE; + } + BEGIN_RING( 13 ); RADEON_WAIT_UNTIL_2D_IDLE(); @@ -931,8 +1100,7 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, OUT_RING( 0x00000000 ); OUT_RING( rb3d_cntl ); - OUT_RING_REG( RADEON_RB3D_ZSTENCILCNTL, - depth_clear->rb3d_zstencilcntl ); + OUT_RING_REG( RADEON_RB3D_ZSTENCILCNTL, tempRB3D_ZSTENCILCNTL ); OUT_RING_REG( RADEON_RB3D_STENCILREFMASK, rb3d_stencilrefmask ); OUT_RING_REG( RADEON_RB3D_PLANEMASK, @@ -1440,7 +1608,8 @@ static int radeon_cp_dispatch_texture( DRMFILE filp, } if ( !buf ) { DRM_DEBUG("radeon_cp_dispatch_texture: EAGAIN\n"); - DRM_COPY_TO_USER( tex->image, image, sizeof(*image) ); + if (DRM_COPY_TO_USER( tex->image, image, sizeof(*image) )) + return DRM_ERR(EFAULT); return DRM_ERR(EAGAIN); } @@ -1537,10 +1706,203 @@ static void radeon_cp_dispatch_stipple( drm_device_t *dev, u32 *stipple ) ADVANCE_RING(); } +static void radeon_apply_surface_regs(int surf_index, drm_radeon_private_t *dev_priv) +{ + if (!dev_priv->mmio) + return; + + radeon_do_cp_idle(dev_priv); + + RADEON_WRITE(RADEON_SURFACE0_INFO + 16*surf_index, + dev_priv->surfaces[surf_index].flags); + RADEON_WRITE(RADEON_SURFACE0_LOWER_BOUND + 16*surf_index, + dev_priv->surfaces[surf_index].lower); + RADEON_WRITE(RADEON_SURFACE0_UPPER_BOUND + 16*surf_index, + dev_priv->surfaces[surf_index].upper); +} + + +/* Allocates a virtual surface + * doesn't always allocate a real surface, will stretch an existing + * surface when possible. + * + * Note that refcount can be at most 2, since during a free refcount=3 + * might mean we have to allocate a new surface which might not always + * be available. + * For example : we allocate three contigous surfaces ABC. If B is + * freed, we suddenly need two surfaces to store A and C, which might + * not always be available. + */ +static int alloc_surface(drm_radeon_surface_alloc_t* new, drm_radeon_private_t *dev_priv, DRMFILE filp) +{ + struct radeon_virt_surface *s; + int i; + int virt_surface_index; + uint32_t new_upper, new_lower; + + new_lower = new->address; + new_upper = new_lower + new->size - 1; + + /* sanity check */ + if ((new_lower >= new_upper) || (new->flags == 0) || (new->size == 0) || + ((new_upper & RADEON_SURF_ADDRESS_FIXED_MASK) != RADEON_SURF_ADDRESS_FIXED_MASK) || + ((new_lower & RADEON_SURF_ADDRESS_FIXED_MASK) != 0)) + return -1; + + /* make sure there is no overlap with existing surfaces */ + for (i = 0; i < RADEON_MAX_SURFACES; i++) { + if ((dev_priv->surfaces[i].refcount != 0) && + (( (new_lower >= dev_priv->surfaces[i].lower) && + (new_lower < dev_priv->surfaces[i].upper) ) || + ( (new_lower < dev_priv->surfaces[i].lower) && + (new_upper > dev_priv->surfaces[i].lower) )) ){ + return -1;} + } + + /* find a virtual surface */ + for (i = 0; i < 2*RADEON_MAX_SURFACES; i++) + if (dev_priv->virt_surfaces[i].filp == 0) + break; + if (i == 2*RADEON_MAX_SURFACES) { + return -1;} + virt_surface_index = i; + + /* try to reuse an existing surface */ + for (i = 0; i < RADEON_MAX_SURFACES; i++) { + /* extend before */ + if ((dev_priv->surfaces[i].refcount == 1) && + (new->flags == dev_priv->surfaces[i].flags) && + (new_upper + 1 == dev_priv->surfaces[i].lower)) { + s = &(dev_priv->virt_surfaces[virt_surface_index]); + s->surface_index = i; + s->lower = new_lower; + s->upper = new_upper; + s->flags = new->flags; + s->filp = filp; + dev_priv->surfaces[i].refcount++; + dev_priv->surfaces[i].lower = s->lower; + radeon_apply_surface_regs(s->surface_index, dev_priv); + return virt_surface_index; + } + + /* extend after */ + if ((dev_priv->surfaces[i].refcount == 1) && + (new->flags == dev_priv->surfaces[i].flags) && + (new_lower == dev_priv->surfaces[i].upper + 1)) { + s = &(dev_priv->virt_surfaces[virt_surface_index]); + s->surface_index = i; + s->lower = new_lower; + s->upper = new_upper; + s->flags = new->flags; + s->filp = filp; + dev_priv->surfaces[i].refcount++; + dev_priv->surfaces[i].upper = s->upper; + radeon_apply_surface_regs(s->surface_index, dev_priv); + return virt_surface_index; + } + } + + /* okay, we need a new one */ + for (i = 0; i < RADEON_MAX_SURFACES; i++) { + if (dev_priv->surfaces[i].refcount == 0) { + s = &(dev_priv->virt_surfaces[virt_surface_index]); + s->surface_index = i; + s->lower = new_lower; + s->upper = new_upper; + s->flags = new->flags; + s->filp = filp; + dev_priv->surfaces[i].refcount = 1; + dev_priv->surfaces[i].lower = s->lower; + dev_priv->surfaces[i].upper = s->upper; + dev_priv->surfaces[i].flags = s->flags; + radeon_apply_surface_regs(s->surface_index, dev_priv); + return virt_surface_index; + } + } + + /* we didn't find anything */ + return -1; +} + +static int free_surface(DRMFILE filp, drm_radeon_private_t *dev_priv, int lower) +{ + struct radeon_virt_surface *s; + int i; + /* find the virtual surface */ + for(i = 0; i < 2*RADEON_MAX_SURFACES; i++) { + s = &(dev_priv->virt_surfaces[i]); + if (s->filp) { + if ((lower == s->lower) && (filp == s->filp)) { + if (dev_priv->surfaces[s->surface_index].lower == s->lower) + dev_priv->surfaces[s->surface_index].lower = s->upper; + + if (dev_priv->surfaces[s->surface_index].upper == s->upper) + dev_priv->surfaces[s->surface_index].upper = s->lower; + + dev_priv->surfaces[s->surface_index].refcount--; + if (dev_priv->surfaces[s->surface_index].refcount == 0) + dev_priv->surfaces[s->surface_index].flags = 0; + s->filp = 0; + radeon_apply_surface_regs(s->surface_index, dev_priv); + return 0; + } + } + } + return 1; +} + +static void radeon_surfaces_release(DRMFILE filp, drm_radeon_private_t *dev_priv) +{ + int i; + for( i = 0; i < 2*RADEON_MAX_SURFACES; i++) + { + if (dev_priv->virt_surfaces[i].filp == filp) + free_surface(filp, dev_priv, dev_priv->virt_surfaces[i].lower); + } +} /* ================================================================ * IOCTL functions */ +int radeon_surface_alloc(DRM_IOCTL_ARGS) +{ + DRM_DEVICE; + drm_radeon_private_t *dev_priv = dev->dev_private; + drm_radeon_surface_alloc_t alloc; + + if (!dev_priv) { + DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + return DRM_ERR(EINVAL); + } + + DRM_COPY_FROM_USER_IOCTL(alloc, (drm_radeon_surface_alloc_t __user *)data, + sizeof(alloc)); + + if (alloc_surface(&alloc, dev_priv, filp) == -1) + return DRM_ERR(EINVAL); + else + return 0; +} + +int radeon_surface_free(DRM_IOCTL_ARGS) +{ + DRM_DEVICE; + drm_radeon_private_t *dev_priv = dev->dev_private; + drm_radeon_surface_free_t memfree; + + if (!dev_priv) { + DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + return DRM_ERR(EINVAL); + } + + DRM_COPY_FROM_USER_IOCTL(memfree, (drm_radeon_mem_free_t __user *)data, + sizeof(memfree) ); + + if (free_surface(filp, dev_priv, memfree.address)) + return DRM_ERR(EINVAL); + else + return 0; +} int radeon_cp_clear( DRM_IOCTL_ARGS ) { @@ -1596,7 +1958,7 @@ static int radeon_do_init_pageflip( drm_device_t *dev ) return 0; } -/* Called whenever a client dies, from DRM(release). +/* Called whenever a client dies, from drm_release. * NOTE: Lock isn't necessarily held when this is called! */ int radeon_do_cleanup_pageflip( drm_device_t *dev ) @@ -2084,7 +2446,7 @@ static int radeon_emit_packets( { int id = (int)header.packet.packet_id; int sz, reg; - int __user *data = (int __user *)cmdbuf->buf; + int *data = (int *)cmdbuf->buf; RING_LOCALS; if (id >= RADEON_MAX_STATE_PACKETS) @@ -2105,7 +2467,7 @@ static int radeon_emit_packets( BEGIN_RING(sz+1); OUT_RING( CP_PACKET0( reg, (sz-1) ) ); - OUT_RING_USER_TABLE( data, sz ); + OUT_RING_TABLE( data, sz ); ADVANCE_RING(); cmdbuf->buf += sz * sizeof(int); @@ -2119,7 +2481,6 @@ static __inline__ int radeon_emit_scalars( drm_radeon_cmd_buffer_t *cmdbuf ) { int sz = header.scalars.count; - int __user *data = (int __user *)cmdbuf->buf; int start = header.scalars.offset; int stride = header.scalars.stride; RING_LOCALS; @@ -2128,7 +2489,7 @@ static __inline__ int radeon_emit_scalars( OUT_RING( CP_PACKET0( RADEON_SE_TCL_SCALAR_INDX_REG, 0 ) ); OUT_RING( start | (stride << RADEON_SCAL_INDX_DWORD_STRIDE_SHIFT)); OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_SCALAR_DATA_REG, sz-1 ) ); - OUT_RING_USER_TABLE( data, sz ); + OUT_RING_TABLE( cmdbuf->buf, sz ); ADVANCE_RING(); cmdbuf->buf += sz * sizeof(int); cmdbuf->bufsz -= sz * sizeof(int); @@ -2143,7 +2504,6 @@ static __inline__ int radeon_emit_scalars2( drm_radeon_cmd_buffer_t *cmdbuf ) { int sz = header.scalars.count; - int __user *data = (int __user *)cmdbuf->buf; int start = ((unsigned int)header.scalars.offset) + 0x100; int stride = header.scalars.stride; RING_LOCALS; @@ -2152,7 +2512,7 @@ static __inline__ int radeon_emit_scalars2( OUT_RING( CP_PACKET0( RADEON_SE_TCL_SCALAR_INDX_REG, 0 ) ); OUT_RING( start | (stride << RADEON_SCAL_INDX_DWORD_STRIDE_SHIFT)); OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_SCALAR_DATA_REG, sz-1 ) ); - OUT_RING_USER_TABLE( data, sz ); + OUT_RING_TABLE( cmdbuf->buf, sz ); ADVANCE_RING(); cmdbuf->buf += sz * sizeof(int); cmdbuf->bufsz -= sz * sizeof(int); @@ -2165,7 +2525,6 @@ static __inline__ int radeon_emit_vectors( drm_radeon_cmd_buffer_t *cmdbuf ) { int sz = header.vectors.count; - int __user *data = (int __user *)cmdbuf->buf; int start = header.vectors.offset; int stride = header.vectors.stride; RING_LOCALS; @@ -2174,7 +2533,7 @@ static __inline__ int radeon_emit_vectors( OUT_RING( CP_PACKET0( RADEON_SE_TCL_VECTOR_INDX_REG, 0 ) ); OUT_RING( start | (stride << RADEON_VEC_INDX_OCTWORD_STRIDE_SHIFT)); OUT_RING( CP_PACKET0_TABLE( RADEON_SE_TCL_VECTOR_DATA_REG, (sz-1) ) ); - OUT_RING_USER_TABLE( data, sz ); + OUT_RING_TABLE( cmdbuf->buf, sz ); ADVANCE_RING(); cmdbuf->buf += sz * sizeof(int); @@ -2189,7 +2548,6 @@ static int radeon_emit_packet3( drm_device_t *dev, { drm_radeon_private_t *dev_priv = dev->dev_private; unsigned int cmdsz; - int __user *cmd = (int __user *)cmdbuf->buf; int ret; RING_LOCALS; @@ -2202,7 +2560,7 @@ static int radeon_emit_packet3( drm_device_t *dev, } BEGIN_RING( cmdsz ); - OUT_RING_USER_TABLE( cmd, cmdsz ); + OUT_RING_TABLE( cmdbuf->buf, cmdsz ); ADVANCE_RING(); cmdbuf->buf += cmdsz * 4; @@ -2219,7 +2577,6 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev, drm_radeon_private_t *dev_priv = dev->dev_private; drm_clip_rect_t box; unsigned int cmdsz; - int __user *cmd = (int __user *)cmdbuf->buf; int ret; drm_clip_rect_t __user *boxes = cmdbuf->boxes; int i = 0; @@ -2238,7 +2595,7 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev, do { if ( i < cmdbuf->nbox ) { - if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) )) + if (DRM_COPY_FROM_USER( &box, &boxes[i], sizeof(box) )) return DRM_ERR(EFAULT); /* FIXME The second and subsequent times round * this loop, send a WAIT_UNTIL_3D_IDLE before @@ -2261,7 +2618,7 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev, } BEGIN_RING( cmdsz ); - OUT_RING_USER_TABLE( cmd, cmdsz ); + OUT_RING_TABLE( cmdbuf->buf, cmdsz ); ADVANCE_RING(); } while ( ++i < cmdbuf->nbox ); @@ -2314,7 +2671,8 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) int idx; drm_radeon_cmd_buffer_t cmdbuf; drm_radeon_cmd_header_t header; - int orig_nbox; + int orig_nbox, orig_bufsz; + char *kbuf=NULL; LOCK_TEST_WITH_RETURN( dev, filp ); @@ -2331,24 +2689,29 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) RING_SPACE_TEST_WITH_RETURN( dev_priv ); VB_AGE_TEST_WITH_RETURN( dev_priv ); + if (cmdbuf.bufsz > 64*1024 || cmdbuf.bufsz<0) { + return DRM_ERR(EINVAL); + } - if (DRM_VERIFYAREA_READ( cmdbuf.buf, cmdbuf.bufsz )) - return DRM_ERR(EFAULT); - - if (cmdbuf.nbox && - DRM_VERIFYAREA_READ(cmdbuf.boxes, - cmdbuf.nbox * sizeof(drm_clip_rect_t))) - return DRM_ERR(EFAULT); + /* Allocate an in-kernel area and copy in the cmdbuf. Do this to avoid + * races between checking values and using those values in other code, + * and simply to avoid a lot of function calls to copy in data. + */ + orig_bufsz = cmdbuf.bufsz; + if (orig_bufsz != 0) { + kbuf = drm_alloc(cmdbuf.bufsz, DRM_MEM_DRIVER); + if (kbuf == NULL) + return DRM_ERR(ENOMEM); + if (DRM_COPY_FROM_USER(kbuf, cmdbuf.buf, cmdbuf.bufsz)) + return DRM_ERR(EFAULT); + cmdbuf.buf = kbuf; + } orig_nbox = cmdbuf.nbox; while ( cmdbuf.bufsz >= sizeof(header) ) { - - if (DRM_GET_USER_UNCHECKED( header.i, (int __user *)cmdbuf.buf )) { - DRM_ERROR("__get_user %p\n", cmdbuf.buf); - return DRM_ERR(EFAULT); - } + header.i = *(int *)cmdbuf.buf; cmdbuf.buf += sizeof(header); cmdbuf.bufsz -= sizeof(header); @@ -2357,7 +2720,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_PACKET\n"); if (radeon_emit_packets( dev_priv, filp_priv, header, &cmdbuf )) { DRM_ERROR("radeon_emit_packets failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2365,7 +2728,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_SCALARS\n"); if (radeon_emit_scalars( dev_priv, header, &cmdbuf )) { DRM_ERROR("radeon_emit_scalars failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2373,7 +2736,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_VECTORS\n"); if (radeon_emit_vectors( dev_priv, header, &cmdbuf )) { DRM_ERROR("radeon_emit_vectors failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2383,14 +2746,14 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) if ( idx < 0 || idx >= dma->buf_count ) { DRM_ERROR( "buffer index %d (of %d max)\n", idx, dma->buf_count - 1 ); - return DRM_ERR(EINVAL); + goto err; } buf = dma->buflist[idx]; if ( buf->filp != filp || buf->pending ) { DRM_ERROR( "bad buffer %p %p %d\n", buf->filp, filp, buf->pending); - return DRM_ERR(EINVAL); + goto err; } radeon_cp_discard_buffer( dev, buf ); @@ -2400,7 +2763,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_PACKET3\n"); if (radeon_emit_packet3( dev, filp_priv, &cmdbuf )) { DRM_ERROR("radeon_emit_packet3 failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2408,7 +2771,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_PACKET3_CLIP\n"); if (radeon_emit_packet3_cliprect( dev, filp_priv, &cmdbuf, orig_nbox )) { DRM_ERROR("radeon_emit_packet3_clip failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2416,7 +2779,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_SCALARS2\n"); if (radeon_emit_scalars2( dev_priv, header, &cmdbuf )) { DRM_ERROR("radeon_emit_scalars2 failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; @@ -2424,21 +2787,28 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS ) DRM_DEBUG("RADEON_CMD_WAIT\n"); if (radeon_emit_wait( dev, header.wait.flags )) { DRM_ERROR("radeon_emit_wait failed\n"); - return DRM_ERR(EINVAL); + goto err; } break; default: DRM_ERROR("bad cmd_type %d at %p\n", header.header.cmd_type, cmdbuf.buf - sizeof(header)); - return DRM_ERR(EINVAL); + goto err; } } + if (orig_bufsz != 0) + drm_free(kbuf, orig_bufsz, DRM_MEM_DRIVER); DRM_DEBUG("DONE\n"); COMMIT_RING(); return 0; + +err: + if (orig_bufsz != 0) + drm_free(kbuf, orig_bufsz, DRM_MEM_DRIVER); + return DRM_ERR(EINVAL); } @@ -2539,6 +2909,20 @@ int radeon_cp_setparam( DRM_IOCTL_ARGS ) { radeon_priv = filp_priv->driver_priv; radeon_priv->radeon_fb_delta = dev_priv->fb_location - sp.value; break; + case RADEON_SETPARAM_SWITCH_TILING: + if (sp.value == 0) { + DRM_DEBUG( "color tiling disabled\n" ); + dev_priv->front_pitch_offset &= ~RADEON_DST_TILE_MACRO; + dev_priv->back_pitch_offset &= ~RADEON_DST_TILE_MACRO; + dev_priv->sarea_priv->tiling_enabled = 0; + } + else if (sp.value == 1) { + DRM_DEBUG( "color tiling enabled\n" ); + dev_priv->front_pitch_offset |= RADEON_DST_TILE_MACRO; + dev_priv->back_pitch_offset |= RADEON_DST_TILE_MACRO; + dev_priv->sarea_priv->tiling_enabled = 1; + } + break; default: DRM_DEBUG( "Invalid parameter %d\n", sp.param ); return DRM_ERR( EINVAL ); @@ -2553,7 +2937,7 @@ int radeon_cp_setparam( DRM_IOCTL_ARGS ) { * * DRM infrastructure takes care of reclaiming dma buffers. */ -static void radeon_driver_prerelease(drm_device_t *dev, DRMFILE filp) +void radeon_driver_prerelease(drm_device_t *dev, DRMFILE filp) { if ( dev->dev_private ) { drm_radeon_private_t *dev_priv = dev->dev_private; @@ -2562,20 +2946,21 @@ static void radeon_driver_prerelease(drm_device_t *dev, DRMFILE filp) } radeon_mem_release( filp, dev_priv->gart_heap ); radeon_mem_release( filp, dev_priv->fb_heap ); + radeon_surfaces_release(filp, dev_priv); } } -static void radeon_driver_pretakedown(drm_device_t *dev) +void radeon_driver_pretakedown(drm_device_t *dev) { radeon_do_release(dev); } -static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv) +int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv) { drm_radeon_private_t *dev_priv = dev->dev_private; struct drm_radeon_driver_file_fields *radeon_priv; - radeon_priv = (struct drm_radeon_driver_file_fields *)DRM(alloc)(sizeof(*radeon_priv), DRM_MEM_FILES); + radeon_priv = (struct drm_radeon_driver_file_fields *)drm_alloc(sizeof(*radeon_priv), DRM_MEM_FILES); if (!radeon_priv) return -ENOMEM; @@ -2589,24 +2974,9 @@ static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv) } -static void radeon_driver_free_filp_priv(drm_device_t *dev, drm_file_t *filp_priv) +void radeon_driver_free_filp_priv(drm_device_t *dev, drm_file_t *filp_priv) { struct drm_radeon_driver_file_fields *radeon_priv = filp_priv->driver_priv; - DRM(free)(radeon_priv, sizeof(*radeon_priv), DRM_MEM_FILES); -} - -void radeon_driver_register_fns(struct drm_device *dev) -{ - dev->driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL; - dev->dev_priv_size = sizeof(drm_radeon_buf_priv_t); - dev->fn_tbl.prerelease = radeon_driver_prerelease; - dev->fn_tbl.pretakedown = radeon_driver_pretakedown; - dev->fn_tbl.open_helper = radeon_driver_open_helper; - dev->fn_tbl.free_filp_priv = radeon_driver_free_filp_priv; - dev->fn_tbl.vblank_wait = radeon_driver_vblank_wait; - dev->fn_tbl.irq_preinstall = radeon_driver_irq_preinstall; - dev->fn_tbl.irq_postinstall = radeon_driver_irq_postinstall; - dev->fn_tbl.irq_uninstall = radeon_driver_irq_uninstall; - dev->fn_tbl.irq_handler = radeon_driver_irq_handler; + drm_free(radeon_priv, sizeof(*radeon_priv), DRM_MEM_FILES); } diff --git a/drivers/char/drm/sis_drm.h b/drivers/char/drm/sis_drm.h index 49505719c..e99c3a43a 100644 --- a/drivers/char/drm/sis_drm.h +++ b/drivers/char/drm/sis_drm.h @@ -3,12 +3,21 @@ #define __SIS_DRM_H__ /* SiS specific ioctls */ -#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(0x44, drm_sis_mem_t) -#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t) -#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(0x53, drm_sis_agp_t) -#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(0x54, drm_sis_mem_t) -#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t) -#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( 0x56, drm_sis_fb_t) +#define NOT_USED_0_3 +#define DRM_SIS_FB_ALLOC 0x04 +#define DRM_SIS_FB_FREE 0x05 +#define NOT_USED_6_12 +#define DRM_SIS_AGP_INIT 0x13 +#define DRM_SIS_AGP_ALLOC 0x14 +#define DRM_SIS_AGP_FREE 0x15 +#define DRM_SIS_FB_INIT 0x16 + +#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t) +#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t) +#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t) +#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t) +#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t) +#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t) /* #define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t) #define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49) diff --git a/drivers/char/drm/sis_drv.c b/drivers/char/drm/sis_drv.c index f05734374..35a90638e 100644 --- a/drivers/char/drm/sis_drv.c +++ b/drivers/char/drm/sis_drv.c @@ -26,9 +26,85 @@ */ #include -#include "sis.h" #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" -#include "drm_core.h" +#include "drm_pciids.h" + +static int postinit( struct drm_device *dev, unsigned long flags ) +{ + DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", + DRIVER_NAME, + DRIVER_MAJOR, + DRIVER_MINOR, + DRIVER_PATCHLEVEL, + DRIVER_DATE, + dev->minor, + pci_pretty_name(dev->pdev) + ); + return 0; +} + +static int version( drm_version_t *version ) +{ + int len; + + version->version_major = DRIVER_MAJOR; + version->version_minor = DRIVER_MINOR; + version->version_patchlevel = DRIVER_PATCHLEVEL; + DRM_COPY( version->name, DRIVER_NAME ); + DRM_COPY( version->date, DRIVER_DATE ); + DRM_COPY( version->desc, DRIVER_DESC ); + return 0; +} + +static struct pci_device_id pciidlist[] = { + sisdrv_PCI_IDS +}; + +extern drm_ioctl_desc_t sis_ioctls[]; +extern int sis_max_ioctl; + +static struct drm_driver driver = { + .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR, + .context_ctor = sis_init_context, + .context_dtor = sis_final_context, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .postinit = postinit, + .version = version, + .ioctls = sis_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + } +}; + +static int __init sis_init(void) +{ + driver.num_ioctls = sis_max_ioctl; + return drm_init(&driver); +} + +static void __exit sis_exit(void) +{ + drm_exit(&driver); +} + +module_init(sis_init); +module_exit(sis_exit); + +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL and additional rights"); diff --git a/drivers/char/drm/sis_drv.h b/drivers/char/drm/sis_drv.h index a87001819..7232b8f3f 100644 --- a/drivers/char/drm/sis_drv.h +++ b/drivers/char/drm/sis_drv.h @@ -28,6 +28,17 @@ #ifndef _SIS_DRV_H_ #define _SIS_DRV_H_ +/* General customization: + */ + +#define DRIVER_AUTHOR "SIS" +#define DRIVER_NAME "sis" +#define DRIVER_DESC "SIS 300/630/540" +#define DRIVER_DATE "20030826" +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 1 +#define DRIVER_PATCHLEVEL 0 + #include "sis_ds.h" typedef struct drm_sis_private { @@ -42,4 +53,7 @@ extern int sis_ioctl_agp_alloc( DRM_IOCTL_ARGS ); extern int sis_ioctl_agp_free( DRM_IOCTL_ARGS ); extern int sis_fb_init( DRM_IOCTL_ARGS ); +extern int sis_init_context(drm_device_t *dev, int context); +extern int sis_final_context(drm_device_t *dev, int context); + #endif diff --git a/drivers/char/drm/sis_ds.c b/drivers/char/drm/sis_ds.c index 083915545..1b471be5f 100644 --- a/drivers/char/drm/sis_ds.c +++ b/drivers/char/drm/sis_ds.c @@ -28,7 +28,6 @@ * */ -#include "sis.h" #include "drmP.h" #include "drm.h" #include "sis_ds.h" @@ -42,7 +41,7 @@ set_t *setInit(void) int i; set_t *set; - set = (set_t *)DRM(alloc)(sizeof(set_t), DRM_MEM_DRIVER); + set = (set_t *)drm_alloc(sizeof(set_t), DRM_MEM_DRIVER); if (set != NULL) { for (i = 0; i < SET_SIZE; i++) { set->list[i].free_next = i + 1; @@ -128,14 +127,14 @@ int setNext(set_t *set, ITEM_TYPE *item) int setDestroy(set_t *set) { - DRM(free)(set, sizeof(set_t), DRM_MEM_DRIVER); + drm_free(set, sizeof(set_t), DRM_MEM_DRIVER); return 1; } /* * GLX Hardware Device Driver common code - * Copyright (C) 1999 Keith Whitwell + * Copyright (C) 1999 Wittawat Yamwong * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -150,7 +149,7 @@ int setDestroy(set_t *set) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -167,7 +166,7 @@ memHeap_t *mmInit(int ofs, if (size <= 0) return NULL; - blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER); + blocks = (TMemBlock *)drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); if (blocks != NULL) { blocks->ofs = ofs; blocks->size = size; @@ -202,7 +201,7 @@ memHeap_t *mmAddRange( memHeap_t *heap, int size ) { PMemBlock blocks; - blocks = (TMemBlock *)DRM(calloc)(2, sizeof(TMemBlock), DRM_MEM_DRIVER); + blocks = (TMemBlock *)drm_calloc(2, sizeof(TMemBlock), DRM_MEM_DRIVER); if (blocks != NULL) { blocks[0].size = size; blocks[0].free = 1; @@ -229,7 +228,7 @@ static TMemBlock* SliceBlock(TMemBlock *p, /* break left */ if (startofs > p->ofs) { - newblock = (TMemBlock*) DRM(calloc)(1, sizeof(TMemBlock), + newblock = (TMemBlock*) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); newblock->ofs = startofs; newblock->size = p->size - (startofs - p->ofs); @@ -242,7 +241,7 @@ static TMemBlock* SliceBlock(TMemBlock *p, /* break right */ if (size < p->size) { - newblock = (TMemBlock*) DRM(calloc)(1, sizeof(TMemBlock), + newblock = (TMemBlock*) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); newblock->ofs = startofs + size; newblock->size = p->size - size; @@ -295,7 +294,7 @@ static __inline__ int Join2Blocks(TMemBlock *p) TMemBlock *q = p->next; p->size += q->size; p->next = q->next; - DRM(free)(q, sizeof(TMemBlock), DRM_MEM_DRIVER); + drm_free(q, sizeof(TMemBlock), DRM_MEM_DRIVER); return 1; } return 0; @@ -380,7 +379,7 @@ void mmDestroy(memHeap_t *heap) p = (TMemBlock *)heap; while (p != NULL) { q = p->next; - DRM(free)(p, sizeof(TMemBlock), DRM_MEM_DRIVER); + drm_free(p, sizeof(TMemBlock), DRM_MEM_DRIVER); p = q; } } diff --git a/drivers/char/drm/sis_ds.h b/drivers/char/drm/sis_ds.h index 482693fe9..c3addb526 100644 --- a/drivers/char/drm/sis_ds.h +++ b/drivers/char/drm/sis_ds.h @@ -58,7 +58,7 @@ int setDestroy(set_t *set); /* * GLX Hardware Device Driver common code - * Copyright (C) 1999 Keith Whitwell + * Copyright (C) 1999 Wittawat Yamwong * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -73,7 +73,7 @@ int setDestroy(set_t *set); * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -85,8 +85,8 @@ struct mem_block_t { struct mem_block_t *heap; int ofs,size; int align; - int free:1; - int reserved:1; + unsigned int free:1; + unsigned int reserved:1; }; typedef struct mem_block_t TMemBlock; typedef struct mem_block_t *PMemBlock; diff --git a/drivers/char/drm/sis_mm.c b/drivers/char/drm/sis_mm.c index 244471647..3038e0555 100644 --- a/drivers/char/drm/sis_mm.c +++ b/drivers/char/drm/sis_mm.c @@ -28,7 +28,6 @@ * */ -#include "sis.h" #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" @@ -37,6 +36,17 @@ #include